tomboy r2416 - in trunk: . Setup Tomboy



Author: sharm
Date: Sun Mar  8 17:56:00 2009
New Revision: 2416
URL: http://svn.gnome.org/viewvc/tomboy?rev=2416&view=rev

Log:
* Setup/Files.wxs: Include AUTHORS, README, COPYING, and NEWS in installer.
* Tomboy/Tray.cs: Save reference to context menu and add some checks to
  prevent multiple simultaneous menus showing. Fixes Windows-only bug #556406
  and bug #566173.

Modified:
   trunk/ChangeLog
   trunk/Setup/Files.wxs
   trunk/Tomboy/Tray.cs

Modified: trunk/Setup/Files.wxs
==============================================================================
--- trunk/Setup/Files.wxs	(original)
+++ trunk/Setup/Files.wxs	Sun Mar  8 17:56:00 2009
@@ -6,6 +6,10 @@
 				<Directory Id="INSTALLDIR" Name="Tomboy">
 					<Component Id="MyComponent" Guid="01F111EB-3C6C-4E5B-8655-7922ED600DAC" DiskId="1">
 						<File Id="LicenseFile" Name="license.rtf" Source="license.rtf" />
+						<File Id="README" Name="README" Source="..\README" />
+						<File Id="COPYING" Name="COPYING" Source="..\COPYING" />
+						<File Id="NEWS" Name="NEWS" Source="..\NEWS" />
+						<File Id="AUTHORS" Name="AUTHORS" Source="..\AUTHORS" />
 						<File Source="..\bin\Debug\Backlinks.dll" Name="Backlinks.dll" Id="Backlinks.dll" />
 						<File Source="..\bin\Debug\Bugzilla.dll" Name="Bugzilla.dll" Id="Bugzilla.dll" />
 						<File Source="..\bin\Debug\ExportToHtml.dll" Name="ExportToHtml.dll" Id="ExportToHtml.dll" />

Modified: trunk/Tomboy/Tray.cs
==============================================================================
--- trunk/Tomboy/Tray.cs	(original)
+++ trunk/Tomboy/Tray.cs	Sun Mar  8 17:56:00 2009
@@ -136,6 +136,7 @@
 	{
 		TomboyTray tray;
 		TomboyPrefsKeybinder keybinder;
+		Gtk.Menu context_menu;
 
 		public TomboyTrayIcon (NoteManager manager)
 		{
@@ -167,7 +168,7 @@
 		protected override void OnPopupMenu (uint button, uint activate_time)
 		{
 			if (button == 3)
-				GuiUtils.PopupMenu (MakeRightClickMenu (),
+				GuiUtils.PopupMenu (GetRightClickMenu (),
 				                    null, 
 				                    new Gtk.MenuPositionFunc (GetTrayMenuPosition));
 				
@@ -175,6 +176,9 @@
 		
 		public void ShowMenu (bool select_first_item)
 		{
+			if (context_menu != null)
+				context_menu.Hide ();
+
 			TomboyTrayUtils.UpdateTomboyTrayMenu (tray, null);
 			if (select_first_item)
 				tray.TomboyTrayMenu.SelectFirst (false);
@@ -219,39 +223,47 @@
 			}
 		}
 		
-		Gtk.Menu MakeRightClickMenu ()
+		Gtk.Menu GetRightClickMenu ()
 		{
-			Gtk.Menu menu = new Gtk.Menu ();
+			if (tray.TomboyTrayMenu != null)
+				tray.TomboyTrayMenu.Hide ();
+
+			if (context_menu != null) {
+				context_menu.Hide ();
+				return context_menu;
+			}
+
+			context_menu = new Gtk.Menu ();
 
 			Gtk.AccelGroup accel_group = new Gtk.AccelGroup ();
-			menu.AccelGroup = accel_group;
+			context_menu.AccelGroup = accel_group;
 
 			Gtk.ImageMenuItem item;
 
 			item = new Gtk.ImageMenuItem (Catalog.GetString ("_Preferences"));
 			item.Image = new Gtk.Image (Gtk.Stock.Preferences, Gtk.IconSize.Menu);
 			item.Activated += ShowPreferences;
-			menu.Append (item);
+			context_menu.Append (item);
 
 			item = new Gtk.ImageMenuItem (Catalog.GetString ("_Help"));
 			item.Image = new Gtk.Image (Gtk.Stock.Help, Gtk.IconSize.Menu);
 			item.Activated += ShowHelpContents;
-			menu.Append (item);
+			context_menu.Append (item);
 
 			item = new Gtk.ImageMenuItem (Catalog.GetString ("_About Tomboy"));
 			item.Image = new Gtk.Image (Gtk.Stock.About, Gtk.IconSize.Menu);
 			item.Activated += ShowAbout;
-			menu.Append (item);
+			context_menu.Append (item);
 
-			menu.Append (new Gtk.SeparatorMenuItem ());
+			context_menu.Append (new Gtk.SeparatorMenuItem ());
 
 			item = new Gtk.ImageMenuItem (Catalog.GetString ("_Quit"));
 			item.Image = new Gtk.Image (Gtk.Stock.Quit, Gtk.IconSize.Menu);
 			item.Activated += Quit;
-			menu.Append (item);
+			context_menu.Append (item);
 
-			menu.ShowAll ();
-			return menu;
+			context_menu.ShowAll ();
+			return context_menu;
 		}
 
 		void ShowPreferences (object sender, EventArgs args)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]