tasque r63 - in trunk: . po src src/Backends/Rtm



Author: sharm
Date: Wed May 14 21:22:36 2008
New Revision: 63
URL: http://svn.gnome.org/viewvc/tasque?rev=63&view=rev

Log:
Gtk.StatusIcon patch courtesy of Eric Butler  <eric extremeboredom net>

* tasque.mdp: F5 == make run
* src/Application.cs: Use Gtk.StatusIcon instead of Egg.TrayIcon.
* src/Backends/Rtm/RtmPreferencesWidget.cs, configure.ac: Require
  gtk-sharp >= 2.10.
* src/Makefile.am, src/TrayLib.cs, po/Makefile.in.in: Remove unused
  file.

Removed:
   trunk/po/Makefile.in.in
   trunk/src/TrayLib.cs
Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/po/ChangeLog
   trunk/src/Application.cs
   trunk/src/Backends/Rtm/RtmPreferencesWidget.cs
   trunk/src/Makefile.am
   trunk/tasque.mdp

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Wed May 14 21:22:36 2008
@@ -39,6 +39,7 @@
 PKG_CHECK_MODULES([GLIB_SHARP_20], [glib-sharp-2.0])
 PKG_CHECK_MODULES([GNOME_SHARP_20], [gnome-sharp-2.0])
 PKG_CHECK_MODULES([GTK_DOTNET_20], [gtk-dotnet-2.0])
+PKG_CHECK_MODULES([GTK_SHARP_20], [gtk-sharp-2.0 >= 2.10.0])
 PKG_CHECK_MODULES([NDESK_DBUS_10], [ndesk-dbus-1.0])
 PKG_CHECK_MODULES([NDESK_DBUS_GLIB_10], [ndesk-dbus-glib-1.0])
 
@@ -85,13 +86,6 @@
 #
 # DEFINES uses for #if statements
 #
-CSC_DEFINES=""
-if pkg-config --atleast-version=2.10 gtk-sharp-2.0; then
-	CSC_DEFINES="-d:GTK_2_10"
-fi
-AC_SUBST(CSC_DEFINES)
-
-
 AC_ARG_WITH(dbus_service_dir, [  --with-dbus-service-dir=DIR            Where to install Tasque's DBus service file.])
 AM_CONDITIONAL(WITH_DBUS_SERVICE_DIR, test "x$with_dbus_service_dir" != "x")
 if test "x$with_dbus_service_dir" != "x"; then

Modified: trunk/src/Application.cs
==============================================================================
--- trunk/src/Application.cs	(original)
+++ trunk/src/Application.cs	Wed May 14 21:22:36 2008
@@ -57,7 +57,7 @@
 		private RemoteControl remoteControl;
 		private Gdk.Pixbuf normalPixBuf;
 		private Gtk.Image trayImage;
-		private Egg.TrayIcon trayIcon;	
+		private Gtk.StatusIcon trayIcon;	
 		private Preferences preferences;
 		private EventBox eb;
 		private IBackend backend;
@@ -328,20 +328,15 @@
 
 		private void SetupTrayIcon ()
 		{
-			eb = new EventBox();
-			normalPixBuf = Utilities.GetIcon ("tasque-24", 24);
-			trayImage = new Gtk.Image(normalPixBuf);
-			eb.Add(trayImage);
-
+			trayIcon = new Gtk.StatusIcon();
+			trayIcon.Pixbuf = Utilities.GetIcon ("tasque-24", 24);
+			
 			// hooking event
-			eb.ButtonPressEvent += OnTrayIconClick;
-			trayIcon = new Egg.TrayIcon("Tasque");
-			trayIcon.Add(eb); 
+			trayIcon.Activate += OnTrayIconClick;
+			trayIcon.PopupMenu += OnTrayIconPopupMenu;
 
-//			trayIcon.EnterNotifyEvent += OnTrayIconEnterNotifyEvent;
-//			trayIcon.LeaveNotifyEvent += OnTrayIconLeaveNotifyEvent;
 			// showing the trayicon
-			trayIcon.ShowAll();			
+			trayIcon.Visible = true;
 		}
 
 
@@ -433,65 +428,63 @@
 		
 		
 
-		private void OnTrayIconClick (object o, ButtonPressEventArgs args) // handler for mouse click
+		private void OnTrayIconClick (object sender, EventArgs args) // handler for mouse click
 		{
-			if (args.Event.Button == 1) {
-				TaskWindow.ShowWindow();
-			} else if (args.Event.Button == 3) {
-				// FIXME: Eventually get all these into UIManagerLayout.xml file
-				Menu popupMenu = new Menu();
-
-				ImageMenuItem showTasksItem = new ImageMenuItem
-					(Catalog.GetString ("Show Tasks ..."));
-
-				showTasksItem.Image = new Gtk.Image(Utilities.GetIcon ("tasque-16", 16));
-				showTasksItem.Sensitive = backend != null && backend.Initialized;
-				showTasksItem.Activated += OnShowTaskWindow;
-				popupMenu.Add (showTasksItem);
-				
-				ImageMenuItem newTaskItem = new ImageMenuItem
-					(Catalog.GetString ("New Task ..."));
-				newTaskItem.Image = new Gtk.Image (Gtk.Stock.New, IconSize.Menu);
-				newTaskItem.Sensitive = backend != null && backend.Initialized;
-				newTaskItem.Activated += OnNewTask;
-				popupMenu.Add (newTaskItem);
-
-				SeparatorMenuItem separator = new SeparatorMenuItem ();
-				popupMenu.Add (separator);
-
-				ImageMenuItem preferences = new ImageMenuItem (Gtk.Stock.Preferences, null);
-				preferences.Activated += OnPreferences;
-				popupMenu.Add (preferences);
-
-				ImageMenuItem about = new ImageMenuItem (Gtk.Stock.About, null);
-				about.Activated += OnAbout;
-				popupMenu.Add (about);
-
-				separator = new SeparatorMenuItem ();
-				popupMenu.Add (separator);
-
-				ImageMenuItem refreshAction = new ImageMenuItem
-					(Catalog.GetString ("Refresh Tasks"));
-
-				refreshAction.Image = new Gtk.Image(Utilities.GetIcon (Gtk.Stock.Execute, 16));
-				refreshAction.Sensitive = backend != null && backend.Initialized;
-				refreshAction.Activated += OnRefreshAction;
-				popupMenu.Add (refreshAction);
-				
-				separator = new SeparatorMenuItem ();
-				popupMenu.Add (separator);
-				
-				ImageMenuItem quit = new ImageMenuItem ( Gtk.Stock.Quit, null);
-				quit.Activated += OnQuit;
-				popupMenu.Add (quit);
-
-				popupMenu.ShowAll(); // shows everything
-				//popupMenu.Popup(null, null, null, IntPtr.Zero, args.Event.Button, args.Event.Time);
-				popupMenu.Popup(null, null, null, args.Event.Button, args.Event.Time);
-			}
-		}		
+			TaskWindow.ShowWindow();
+		}
+
+		private void OnTrayIconPopupMenu (object sender, EventArgs args)
+		{
+			// FIXME: Eventually get all these into UIManagerLayout.xml file
+			Menu popupMenu = new Menu();
 
+			ImageMenuItem showTasksItem = new ImageMenuItem
+				(Catalog.GetString ("Show Tasks ..."));
 
+			showTasksItem.Image = new Gtk.Image(Utilities.GetIcon ("tasque-16", 16));
+			showTasksItem.Sensitive = backend != null && backend.Initialized;
+			showTasksItem.Activated += OnShowTaskWindow;
+			popupMenu.Add (showTasksItem);
+			
+			ImageMenuItem newTaskItem = new ImageMenuItem
+				(Catalog.GetString ("New Task ..."));
+			newTaskItem.Image = new Gtk.Image (Gtk.Stock.New, IconSize.Menu);
+			newTaskItem.Sensitive = backend != null && backend.Initialized;
+			newTaskItem.Activated += OnNewTask;
+			popupMenu.Add (newTaskItem);
+
+			SeparatorMenuItem separator = new SeparatorMenuItem ();
+			popupMenu.Add (separator);
+
+			ImageMenuItem preferences = new ImageMenuItem (Gtk.Stock.Preferences, null);
+			preferences.Activated += OnPreferences;
+			popupMenu.Add (preferences);
+
+			ImageMenuItem about = new ImageMenuItem (Gtk.Stock.About, null);
+			about.Activated += OnAbout;
+			popupMenu.Add (about);
+
+			separator = new SeparatorMenuItem ();
+			popupMenu.Add (separator);
+
+			ImageMenuItem refreshAction = new ImageMenuItem
+				(Catalog.GetString ("Refresh Tasks"));
+
+			refreshAction.Image = new Gtk.Image(Utilities.GetIcon (Gtk.Stock.Execute, 16));
+			refreshAction.Sensitive = backend != null && backend.Initialized;
+			refreshAction.Activated += OnRefreshAction;
+			popupMenu.Add (refreshAction);
+			
+			separator = new SeparatorMenuItem ();
+			popupMenu.Add (separator);
+			
+			ImageMenuItem quit = new ImageMenuItem ( Gtk.Stock.Quit, null);
+			quit.Activated += OnQuit;
+			popupMenu.Add (quit);
+
+			popupMenu.ShowAll(); // shows everything
+			popupMenu.Popup();
+		}		
 
 		public static void Main(string[] args)
 		{
@@ -540,8 +533,9 @@
 #if ENABLE_NOTIFY_SHARP
 		public static void ShowAppNotification(Notification notification)
 		{
-			notification.AttachToWidget(
-					Tasque.Application.Instance.trayIcon);
+			// TODO: Use this API for newer versions of notify-sharp
+			//notification.AttachToStatusIcon(
+			//		Tasque.Application.Instance.trayIcon);
 			notification.Show();
 		}
 #endif

Modified: trunk/src/Backends/Rtm/RtmPreferencesWidget.cs
==============================================================================
--- trunk/src/Backends/Rtm/RtmPreferencesWidget.cs	(original)
+++ trunk/src/Backends/Rtm/RtmPreferencesWidget.cs	Wed May 14 21:22:36 2008
@@ -8,11 +8,7 @@
 {
 	public class RtmPreferencesWidget : Gtk.EventBox
 	{
-		#if GTK_2_10
  		private LinkButton		authButton;
-		#else
-		private Button			authButton;
-		#endif
 		
 		private Label			statusLabel;
 		private Gtk.Image		image;
@@ -60,11 +56,7 @@
 			statusLabel.UseMarkup = true;
 			statusLabel.UseUnderline = false;
 
-			#if GTK_2_10
 			authButton = new LinkButton("Click Here to Connect");
-			#else
-			authButton = new Button("Click Here to Connect");
-			#endif
 			
 			authButton.Clicked += OnAuthButtonClicked;
 			

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Wed May 14 21:22:36 2008
@@ -70,7 +70,6 @@
 	$(srcdir)/TaskState.cs \
 	$(srcdir)/TaskWindow.cs \
 	$(srcdir)/TaskTreeView.cs \
-	$(srcdir)/TrayLib.cs \
 	$(srcdir)/Utilities.cs \
 	\
 	$(DUMMY_CSFILES) \
@@ -120,7 +119,7 @@
 	$(EVOLUTION_SHARP_LIBS)
 
 $(TARGET): $(CSFILES) Defines.cs
-	$(CSC) -unsafe -out:$@ $(CSFLAGS) $(NOTIFY_SHARP_CSFLAGS) $(CSC_DEFINES) $^ $(ASSEMBLIES) $(RESOURCES)
+	$(CSC) -unsafe -out:$@ $(CSFLAGS) $(NOTIFY_SHARP_CSFLAGS) $^ $(ASSEMBLIES) $(RESOURCES)
 
 tasquelibdir = $(prefix)/lib/tasque
 tasquelib_DATA = $(TARGET) $(TARGET).config

Modified: trunk/tasque.mdp
==============================================================================
--- trunk/tasque.mdp	(original)
+++ trunk/tasque.mdp	Wed May 14 21:22:36 2008
@@ -20,7 +20,6 @@
     <File name="src/Preferences.cs" subtype="Code" buildaction="Compile" />
     <File name="src/PreferencesDialog.cs" subtype="Code" buildaction="Compile" />
     <File name="src/TaskWindow.cs" subtype="Code" buildaction="Compile" />
-    <File name="src/TrayLib.cs" subtype="Code" buildaction="Compile" />
     <File name="src/Utilities.cs" subtype="Code" buildaction="Compile" />
     <File name="src/CellRendererDate.cs" subtype="Code" buildaction="Compile" />
     <File name="src/DateButton.cs" subtype="Code" buildaction="Compile" />
@@ -81,7 +80,7 @@
     <ProjectReference type="Gac" localcopy="True" refto="Mono.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" />
     <ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   </References>
-  <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="Makefile.am" IsAutotoolsProject="True" RelativeConfigureInPath=".">
+  <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="Makefile.am" ExecuteTargetName="run" IsAutotoolsProject="True" RelativeConfigureInPath=".">
     <BuildFilesVar />
     <DeployFilesVar />
     <ResourcesVar />



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