Login | Register
My pages Projects Community openCollabNet

Discussions > commits > svn commit: r271 - trunk/SVN_Notifier/MainForm.cs

svnnotifier
Discussion topic

Back to topic list

svn commit: r271 - trunk/SVN_Notifier/MainForm.cs

Reply

Author vlar
Full name Vlad Rudenko
Date 2009-08-06 06:50:50 PDT
Message Author: vlar
Date: 2009-08-06 06:50:50-0700
New Revision: 271

Modified:
   trunk/SVN_Notifier/MainForm.cs

Log:
Text shown in tray tool tip is optimized

Modified: trunk/SVN_Notifier/MainForm.cs
Url: http://svnnotifier.t​igris.org/source/bro​wse/svnnotifier/trun​k/SVN_Notifier/MainF​orm.cs?view=diff​&pathrev=271&r1=​270&r2=271
====================​====================​====================​==================
--- trunk/SVN_Notifier/MainForm.cs (original)
+++ trunk/SVN_Notifier/MainForm.cs 2009-08-06 06:50:50-0700
@@ -1077,7 +1077,6 @@
             // Update tray ToolTip
 
             const int MaxTrayTextLen = 63 - 4; // "\n...".Length == 4
- string trayText = Application.ProductName;
             string updateTrayText = "";
             string errorTrayText = "";
 
@@ -1086,11 +1085,9 @@
                 if (!folder.Disable && (folder.Status == SvnFolderStatus.Error))
                 {
                     if (errorTrayText == "")
- {
- errorTrayText = "\nFailed:";
- }
+ errorTrayText = "Failed:";
 
- if ((MaxTrayTextLen - (trayText.Length + errorTrayText.Length)) > (1 + folder.VisiblePath.Length))
+ if ((MaxTrayTextLen - errorTrayText.Length) > (1 + folder.VisiblePath.Length))
                     {
                         errorTrayText += "\n" + folder.VisiblePath;
                     }
@@ -1106,12 +1103,15 @@
             {
                 if ((folder.Status == SvnFolderStatus.NeedUpdate) || (folder.Status == SvnFolderStatus.Need​Update_Modified))
                 {
- if ((updateTrayText == "") && ((MaxTrayTextLen - (trayText.Length + updateTrayText.Length + errorTrayText.Length)) > 15)) // "\n\nUpdate needed:".Length == 16
+ if (updateTrayText == "")
                     {
- updateTrayText = (errorTrayText != "" ? "\n" : "") + "\nUpdate needed:";
+ if ((MaxTrayTextLen - errorTrayText.Length) > 15) // "\nUpdate needed:".Length == 15
+ updateTrayText = (errorTrayText != "" ? "\n" : "") + "Update needed:";
+ else
+ break;
                     }
 
- if ((MaxTrayTextLen - (trayText.Length + updateTrayText.Length + errorTrayText.Length)) > (1 + folder.VisiblePath.Length))
+ if ((MaxTrayTextLen - (updateTrayText.Length + errorTrayText.Length)) > (1 + folder.VisiblePath.Length))
                     {
                         updateTrayText += "\n" + folder.VisiblePath;
                     }
@@ -1123,7 +1123,10 @@
                 }
             }
 
- notifyIcon.Text = trayText + errorTrayText + updateTrayText;
+ notifyIcon.Text = errorTrayText + updateTrayText;
+
+ if (notifyIcon.Text == "")
+ notifyIcon.Text = Application.ProductName;
 
             // Update tray icon

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

svn commit: r271 - trunk/SVN_Notifier/MainForm.cs vlar Vlad Rudenko 2009-08-06 06:50:50 PDT
Messages per page: