[blam/gtk3] Remove old status icon implementation



commit b86e3816dbff141d7a014fb7bb5ac86872e95fa3
Author: Carlos Martín Nieto <cmn dwim me>
Date:   Sun Oct 13 17:02:56 2013 +0200

    Remove old status icon implementation

 src/TrayIcon.cs |  102 -------------------------------------------------------
 1 files changed, 0 insertions(+), 102 deletions(-)
---
diff --git a/src/TrayIcon.cs b/src/TrayIcon.cs
index a6134ab..290b915 100644
--- a/src/TrayIcon.cs
+++ b/src/TrayIcon.cs
@@ -109,105 +109,3 @@ namespace Blam
 
        }
 }
-
-namespace Imendio.Blam {
-    public class TrayIcon {
-    private Gtk.StatusIcon mIcon = null;
-    ChannelCollection Collection { get; set; }
-
-       public event EventHandler RefreshAllEvent;
-       public event EventHandler PreferencesEvent;
-       public event EventHandler AboutEvent;
-       public event EventHandler QuitEvent;
-
-       public event EventHandler ButtonPressEvent;
-
-       public string Tooltip {
-           set {
-                   mIcon.TooltipText = value;
-           }
-       }
-
-       public TrayIcon (string name, ChannelCollection collection)
-       {
-        mIcon = new Gtk.StatusIcon();
-        mIcon.IconName = "blam";
-        mIcon.TooltipText = name;
-        mIcon.Activate += ButtonPressedCb;
-        mIcon.PopupMenu += PopupCb;
-                       Collection = collection;
-        Collection.PropertyChanged += HandlePropertyChanged;
-                       Collection.CollectionChanged += HandleCollectionChanged;
-       }
-
-               void HandleCollectionChanged (object sender, 
System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
-               {
-                       UpdateTooltip();
-               }
-
-               void HandlePropertyChanged (object sender, PropertyChangedEventArgs e)
-               {
-                       UpdateTooltip();
-               }
-       
-               void UpdateTooltip()
-               {
-                       var nrUnread = Collection.NrOfUnreadItems;
-                       var nrNew = Collection.NrOfNewItems;
-
-                       var strUnread = string.Format(Catalog.GetPluralString ("{0} unread item", "{0} unread 
items", nrUnread), nrUnread);
-                       var strNew = string.Format(Catalog.GetPluralString("({0} new)", "({0} new)", nrNew), 
nrNew);
-                       var tooltip = strUnread + " " + strNew;
-
-                       Tooltip = tooltip;
-               }
-
-    public void Hide()
-    {
-        mIcon.Visible = false;
-    }
-
-       public void Show ()
-       {
-           mIcon.Visible = true;
-       }
-
-       private void ButtonPressedCb (object o, EventArgs args)
-       {
-           if (this.ButtonPressEvent != null) {
-               this.ButtonPressEvent (o, args);
-           }
-       }
-       /*
-        * Create a popup menu
-        */
-       public void PopupCb(object o, EventArgs args)
-       {
-               Gtk.Menu menu = new Gtk.Menu();
-               Gtk.ImageMenuItem refreshItem = new Gtk.ImageMenuItem(Catalog.GetString("_Refresh"));
-               refreshItem.Image = new Gtk.Image(Stock.Refresh,IconSize.Menu);
-               refreshItem.Activated += RefreshAllEvent;
-
-               Gtk.ImageMenuItem prefItem = new Gtk.ImageMenuItem(Catalog.GetString("Preferences"));
-               prefItem.Image = new Gtk.Image(Stock.Preferences,IconSize.Menu);
-               prefItem.Activated += PreferencesEvent;
-
-               Gtk.ImageMenuItem aboutItem = new Gtk.ImageMenuItem(Catalog.GetString("About Blam"));
-               aboutItem.Image = new Gtk.Image(Stock.About,IconSize.Menu);
-               aboutItem.Activated += AboutEvent;
-
-               Gtk.ImageMenuItem quitItem = new Gtk.ImageMenuItem(Catalog.GetString("Quit"));
-               quitItem.Image = new Gtk.Image(Stock.Quit,IconSize.Menu);
-               quitItem.Activated += QuitEvent;
-
-               menu.Add(refreshItem);
-               menu.Add(prefItem);
-               menu.Add(new Gtk.SeparatorMenuItem());
-               menu.Add(aboutItem);
-               menu.Add(new Gtk.SeparatorMenuItem());
-               menu.Add(quitItem);
-               menu.ShowAll();
-               menu.Popup();
-       }
-    }
-}


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