Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugal-mono-tools.git;a=commitdiff;h=2e9ec07d4245469559946594f35a0fef09ceb673

commit 2e9ec07d4245469559946594f35a0fef09ceb673
Author: bouleetbil <bouleet...@frogdev.info>
Date:   Tue Aug 31 18:45:53 2010 +0200

*added icon systray mode daemon mode

diff --git a/frugal-mono-tools/Main.cs b/frugal-mono-tools/Main.cs
index c4decc1..82d61a8 100644
--- a/frugal-mono-tools/Main.cs
+++ b/frugal-mono-tools/Main.cs
@@ -21,6 +21,9 @@ using System.ComponentModel;
using System.IO;
using System.Threading;
using System.Timers;
+using Gdk;
+using Gtk;
+


namespace frugalmonotools
@@ -64,6 +67,20 @@ namespace frugalmonotools
}
}
private static splash win;
+               private static StatusIcon trayIcon;
+               // Create the popup menu, on right click.
+                       static void OnTrayIconPopup (object o, EventArgs args) {
+                               Menu popupMenu = new Menu();
+                               ImageMenuItem menuItemQuit = new ImageMenuItem 
("Quit");
+                               Gtk.Image appimg = new Gtk.Image(Stock.Quit, 
IconSize.Menu);
+                               menuItemQuit.Image = appimg;
+                               popupMenu.Add(menuItemQuit);
+                               // Quit the application when quit has been 
clicked.
+                               menuItemQuit.Activated += delegate { 
Application.Quit(); };
+                               popupMenu.ShowAll();
+                               popupMenu.Popup();
+                       }
+
public static void Main (string[] args)
{

@@ -104,6 +121,15 @@ namespace frugalmonotools
// Set the Interval to 1 hour.
aTimer.Interval=3600000;
aTimer.Enabled=true;
+                                               // Creation of the Icon
+                                               trayIcon = new StatusIcon(new 
Pixbuf ("/usr/share/pixmaps/FrugalTools.png"));
+                                               trayIcon.Visible = true;
+
+                                               // Show a pop up menu when the 
icon has been right clicked.
+                                               trayIcon.PopupMenu += 
OnTrayIconPopup;
+
+                                               // A Tooltip for the Icon
+                                               trayIcon.Tooltip = "Frugalware 
Control Center";
Gtk.Application.Run ();
break;

diff --git a/frugal-mono-tools/gtk-gui/generated.cs 
b/frugal-mono-tools/gtk-gui/generated.cs
index 8463caa..1b66950 100644
--- a/frugal-mono-tools/gtk-gui/generated.cs
+++ b/frugal-mono-tools/gtk-gui/generated.cs
@@ -10,6 +10,10 @@ namespace Stetic
{
if ((Stetic.Gui.initialized == false)) {
Stetic.Gui.initialized = true;
+                               global::Gtk.IconFactory w1 = new 
global::Gtk.IconFactory ();
+                               global::Gtk.IconSet w2 = new 
global::Gtk.IconSet (global::Gdk.Pixbuf.LoadFromResource 
("frugalmonotools.header.svg"));
+                               w1.Add ("iconeFwCC", w2);
+                               w1.AddDefault ();
}
}
}
diff --git a/frugal-mono-tools/gtk-gui/gui.stetic 
b/frugal-mono-tools/gtk-gui/gui.stetic
index 8f4627b..333e5ac 100644
--- a/frugal-mono-tools/gtk-gui/gui.stetic
+++ b/frugal-mono-tools/gtk-gui/gui.stetic
@@ -11,6 +11,13 @@
<widget-library name="../bin/Debug/frugal-mono-tools.exe" internal="true" />
<widget-library name="vte-sharp, Version=0.16.0.0, Culture=neutral, 
PublicKeyToken=35e10195dab3c99f" />
</import>
+  <icon-factory>
+    <icon-set id="iconeFwCC">
+      <source>
+        <property name="Image">resource:frugalmonotools.header.svg</property>
+      </source>
+    </icon-set>
+  </icon-factory>
<widget class="Gtk.Window" id="MainWindow" design-size="597 395">
<property name="MemberName" />
<property name="Title" translatable="yes">Frugalware-tools</property>
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to