Example #1
0
        public static void Main(string[] args)
        {
            if (true) {
                // Execute the main program
                Application.Init ();
                MainWindow win = new MainWindow ();
                Preferences.Initialize();

                // Set the tray icon properties and delegates
                trayIcon = new StatusIcon(new Gdk.Pixbuf("ScreenlapseIcon.png"));
                trayIcon.Visible = true;
                trayIcon.Activate += delegate(object sender, EventArgs e) {
                    // Toggle the visibility of the main window
                    if(win.Visible)
                    {
                        win.HideAll();
                    }
                    else
                    {
                        win.ShowAll();
                    }
                };
                trayIcon.PopupMenu += HandleTrayIconPopupMenu;
                trayIcon.Tooltip = "ScreenLapse";

                // Start the timer class
                ScrotDaemon.Instance.Activate();
                win.Show ();
                Application.Run ();
            }
            else {
                TestBed();
            }
        }
Example #2
0
        public PreferencesDialog(MainWindow mainWindow)
        {
            this.engineSettings    = SettingsManager.EngineSettings;
            this.prefSettings      = SettingsManager.Preferences;
            this.labelController   = mainWindow.LabelController;
            this.trayIcon          = mainWindow.TrayIcon;
            this.interfaceSettings = mainWindow.InterfaceSettings;

            Build();
            buildFoldersPanel();
            buildImportPanel();
            buildLabelPage();
            buildConnectionPage();
            restorePreferences();
            BuildGeneralPage();
            SetNames();
            upnpCheckBox.Toggled   += OnUpnpCheckBoxToggled;
            spinMaxActive.Sensitive = false;
            spinMaxSeed.Sensitive   = false;
//			spinMaxActive.ValueChanged += delegate {
//				DownloadQueueService queue = ServiceManager.Get <DownloadQueueService> ();
//				queue.MaxActive = spinMaxActive.ValueAsInt;
//			};
            spinMaxDownload.ValueChanged += delegate {
                DownloadQueueService queue = ServiceManager.Get <DownloadQueueService> ();
                queue.MaxDownloads = spinMaxActive.ValueAsInt;
            };
//			spinMaxSeed.ValueChanged += delegate {
//				DownloadQueueService queue = ServiceManager.Get <DownloadQueueService> ();
//				queue.MaxSeeds = spinMaxActive.ValueAsInt;
//			};
        }
        public PreferencesDialog(MainWindow mainWindow)
        {
            this.engineSettings = SettingsManager.EngineSettings;
            this.prefSettings = SettingsManager.Preferences;
            this.labelController = mainWindow.LabelController;
            this.trayIcon = mainWindow.TrayIcon;
            this.interfaceSettings = mainWindow.InterfaceSettings;

            Build();
            buildFoldersPanel();
            buildImportPanel();
            buildLabelPage();
            buildConnectionPage();
            restorePreferences();
            BuildGeneralPage();
            SetNames ();
            upnpCheckBox.Toggled += OnUpnpCheckBoxToggled;
            spinMaxActive.Sensitive = false;
            spinMaxSeed.Sensitive = false;
            //			spinMaxActive.ValueChanged += delegate {
            //				DownloadQueueService queue = ServiceManager.Get <DownloadQueueService> ();
            //				queue.MaxActive = spinMaxActive.ValueAsInt;
            //			};
            spinMaxDownload.ValueChanged += delegate {
                DownloadQueueService queue = ServiceManager.Get <DownloadQueueService> ();
                queue.MaxDownloads = spinMaxActive.ValueAsInt;
            };
            //			spinMaxSeed.ValueChanged += delegate {
            //				DownloadQueueService queue = ServiceManager.Get <DownloadQueueService> ();
            //				queue.MaxSeeds = spinMaxActive.ValueAsInt;
            //			};
        }
		public static void Initialize ()
		{
			DefaultIcon = DockServices.Drawing.LoadIcon (DefaultIconName, NoteIconSize);
			statusIcon = new StatusIcon ();
			statusIcon.Pixbuf = DockServices.Drawing.LoadIcon (DefaultIconName, StatusIconSize);
			statusIcon.Visible = false;	
		}
Example #5
0
        public MainWindow()
        {
            Build ();

            popupMenu = new Menu ();

            ImageMenuItem explore = new ImageMenuItem ("Explore");
            explore.Image = new Image (Stock.Open, IconSize.Menu);
            explore.Activated += Open;
            popupMenu.Add (explore);

            ImageMenuItem quit = new ImageMenuItem ("Exit");
            quit.Image = new Image (Stock.Quit, IconSize.Menu);
            quit.Activated += (object sender, EventArgs e) => {
                Application.Quit ();
            };
            popupMenu.Add (quit);

            statusIcon = new StatusIcon ();
            statusIcon.Pixbuf = c.Icon.Bitmap.ToPixbuf ();
            statusIcon.Activate += Open;
            statusIcon.PopupMenu += (object o, PopupMenuArgs args) => {
                popupMenu.ShowAll ();
                popupMenu.Popup ();
            };
            statusIcon.Tooltip = c.Icon.Tooltip;
            statusIcon.Visible = true;
        }
Example #6
0
        static void Main(String[] args)
        {
            //Application.EnableVisualStyles();
            //Application.SetCompatibleTextRenderingDefault(false);
            //Application.Run(new LoginWindow());
            Application.Init();

            LoginWindow loginWindow = LoginWindow.GetInstance();
            //RCWindow rc = new RCWindow();
            //rc.ShowAll();
            loginWindow.ShowAll();
            // Creation of the Icon
            trayIcon = new StatusIcon(global::Gdk.Pixbuf.LoadFromResource("OpenGraal.GraalIM.Resources.rcicon.ico"));
            //trayIcon.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("OpenGraal.GraalIM.Resources.rcicon.ico");
            trayIcon.Visible = true;

            // Show/Hide the window (even from the Panel/Taskbar) when the TrayIcon has been clicked.
            trayIcon.Activate += delegate
            {
                loginWindow.Visible = !loginWindow.Visible;
                //rc.Visible = !rc.Visible;
            };

            // Show a pop up menu when the icon has been right clicked.
            trayIcon.PopupMenu += OnTrayIconPopup;

            // A Tooltip for the Icon
            trayIcon.Tooltip = "GraalIM";

            Application.Run();
        }
Example #7
0
		public static StatusIcon NewFromIconName(string icon_name)
		{
			IntPtr native_icon_name = GLib.Marshaller.StringToPtrGStrdup (icon_name);
			StatusIcon result = new StatusIcon (gtk_status_icon_new_from_icon_name(native_icon_name));
			GLib.Marshaller.Free (native_icon_name);
			return result;
		}
Example #8
0
        public static StatusIcon NewFromIconName(string icon_name)
        {
            IntPtr     native_icon_name = GLib.Marshaller.StringToPtrGStrdup(icon_name);
            StatusIcon result           = new StatusIcon(gtk_status_icon_new_from_icon_name(native_icon_name));

            GLib.Marshaller.Free(native_icon_name);
            return(result);
        }
Example #9
0
        public static StatusIcon NewFromStock(string stock_id)
        {
            IntPtr     native_stock_id = GLib.Marshaller.StringToPtrGStrdup(stock_id);
            StatusIcon result          = new StatusIcon(gtk_status_icon_new_from_stock(native_stock_id));

            GLib.Marshaller.Free(native_stock_id);
            return(result);
        }
Example #10
0
 public UnixTray(string icon)
     : base(Gtk.WindowType.Toplevel)
 {
     _notifyIcon = new StatusIcon(new Gdk.Pixbuf(icon))
     {
         Visible = true
     };
 }
Example #11
0
 public GTKTray(string icon)
 {
     Application.Init();
     _notifyIcon = new StatusIcon(new Pixbuf(icon))
     {
         Visible = true
     };
     Application.Run();
 }
Example #12
0
 static void Activate_cb(IntPtr inst)
 {
     try {
         StatusIcon __obj = GLib.Object.GetObject(inst, false) as StatusIcon;
         __obj.OnActivate();
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, false);
     }
 }
Example #13
0
 static void PopupMenu_cb(IntPtr inst, uint button, uint activate_time)
 {
     try {
         StatusIcon __obj = GLib.Object.GetObject(inst, false) as StatusIcon;
         __obj.OnPopupMenu(button, activate_time);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, false);
     }
 }
Example #14
0
        public SysTrayIcon(MainWindow parent)
        {
            _parent 			= parent;

            siTray 				= new StatusIcon(new Pixbuf ("images/icon.png"));
            siTray.Visible 		= true;
            siTray.Activate 	+= OnActivate;
            siTray.PopupMenu 	+= OnTrayIconPopup;
            siTray.Tooltip 		= "XBMControl Evo";
        }
Example #15
0
        public SysTrayIcon(XbmControlEvo parent)
        {
            _parent 			= parent;

            siTray 				= new StatusIcon(new Pixbuf (_parent.appDir + "/Interface/" + _parent.theme + "/icons/icon.png"));
            siTray.Visible 		= true;
            siTray.Activate 	+= OnActivate;
            siTray.PopupMenu 	+= OnTrayIconPopup;
            siTray.Tooltip 		= "XBMControl Evo";
        }
Example #16
0
File: Tray.cs Project: GNOME/nemo
        public Tray(MainWindow window)
        {
            main_window = window;
            hidden = false;

            icon =  new StatusIcon(Gdk.Pixbuf.LoadFromResource("small_blue_guy.png"));
            icon.Activate += popupActivated;
            icon.PopupMenu += popupMenuHandler;
            icon.Tooltip = " Nemo ";
        }
Example #17
0
        public TrayIcon()
        {
            Pixbuf pixbuf = new Pixbuf(null, "FileFind.Meshwork.GtkClient.tray_icon.png");
            statusIcon = new StatusIcon(pixbuf);
            statusIcon.Visible = true;

            trayMenu = (Menu) Runtime.UIManager.GetWidget ("/TrayPopupMenu");

            statusIcon.PopupMenu += statusIcon_PopupMenu;
            statusIcon.Activate += statusIcon_Activate;
        }
Example #18
0
 public TrayIcon(string name, ChannelCollection collection)
 {
     mIcon = new Gtk.StatusIcon();
     mIcon.IconName = "blam";
     mIcon.Tooltip = name;
     mIcon.Activate += ButtonPressedCb;
     mIcon.PopupMenu += PopupCb;
     Collection = collection;
     Collection.PropertyChanged += HandlePropertyChanged;
     Collection.CollectionChanged += HandleCollectionChanged;
 }
Example #19
0
 public StatusIconTray()
 {
     tray = new StatusIcon (Utilities.GetIcon (IconName, 24));
     tray.Visible = true;
     tray.Activate += delegate { ToggleTaskWindowAction.Activate (); };
     tray.PopupMenu += (sender, e) => {
         var popupMenu = Menu;
         popupMenu.ShowAll (); // shows everything
         tray.PresentMenu (popupMenu, (uint)e.Args [0], (uint)e.Args [1]);
     };
 }
Example #20
0
        private void SetupTrayIcon()
        {
//			Logger.Debug ("Creating TrayIcon");

            onPixBuf  = Utilities.GetIcon("giver-24", 24);
            offPixBuf = Utilities.GetIcon("giveroff-24", 24);

            tray_icon            = new Gtk.StatusIcon();
            tray_icon.Pixbuf     = offPixBuf;
            tray_icon.Activate  += delegate { TargetWindow.ShowWindow(locator); };
            tray_icon.PopupMenu += OnPopupMenu;
        }
Example #21
0
        public static void BuildTray()
        {
            m_trayIcon = new StatusIcon(new Pixbuf ("../../../../webui/images/icon.png"));
            m_trayIcon.Visible = true;

            // Show/Hide the window (even from the Panel/Taskbar) when the TrayIcon has been clicked.
            m_trayIcon.Activate += delegate { MainForm.Visible = !MainForm.Visible; };
            // Show a pop up menu when the icon has been right clicked.
            m_trayIcon.PopupMenu += OnTrayIconPopup;

            // A Tooltip for the Icon
            m_trayIcon.Tooltip = "Hello World Icon";
        }
Example #22
0
        public SysTrayIcon(XbmControlEvo parent)
        {
            _parent 			= parent;

            this.siTray 			= new StatusIcon(this._parent.oImages.menu.icon);
            this.siTray.Visible 	= true;
            this.siTray.Activate 	+= OnActivate;
            this.siTray.PopupMenu 	+= OnTrayIconPopup;
            this.siTray.Tooltip 	= "XBMControl Evo";
            this.balloonTip			= new Notification();

            //ShowBallonTip();
        }
Example #23
0
 static bool QueryTooltip_cb(IntPtr inst, int x, int y, bool keyboard_mode, IntPtr tooltip)
 {
     try {
         StatusIcon __obj = GLib.Object.GetObject(inst, false) as StatusIcon;
         bool       __result;
         __result = __obj.OnQueryTooltip(x, y, keyboard_mode, GLib.Object.GetObject(tooltip) as Gtk.Tooltip);
         return(__result);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: above call does not return.
         throw e;
     }
 }
Example #24
0
 static bool SizeChanged_cb(IntPtr inst, int size)
 {
     try {
         StatusIcon __obj = GLib.Object.GetObject(inst, false) as StatusIcon;
         bool       __result;
         __result = __obj.OnSizeChanged(size);
         return(__result);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: above call does not return.
         throw e;
     }
 }
Example #25
0
 static bool ScrollEvent_cb(IntPtr inst, IntPtr evnt)
 {
     try {
         StatusIcon __obj = GLib.Object.GetObject(inst, false) as StatusIcon;
         bool       __result;
         __result = __obj.OnScrollEvent(new Gdk.EventScroll(evnt));
         return(__result);
     } catch (Exception e) {
         GLib.ExceptionManager.RaiseUnhandledException(e, true);
         // NOTREACHED: above call does not return.
         throw e;
     }
 }
Example #26
0
        private void SetupTrayIcon()
        {
            trayIcon        = new Gtk.StatusIcon();
            trayIcon.Pixbuf = Utilities.GetIcon("tasque-24", 24);

            // hooking event
            trayIcon.Activate  += OnTrayIconClick;
            trayIcon.PopupMenu += OnTrayIconPopupMenu;

            // showing the trayicon
            trayIcon.Visible = true;

            RefreshTrayIconTooltip();
        }
Example #27
0
        public static void RunIt()
        {
            Application.Init();

            // Create the Window
            window = new Gtk.Window("Memorize");
            window.DeleteEvent += delegate { Application.Quit(); };
            window.Resize(800, 600);

            // Status bar ...
            icon = new StatusIcon(new Pixbuf("res/icon.png"));
            icon.Visible = true;
            icon.Activate += delegate { window.Visible = !window.Visible; };
            icon.Tooltip = "Yo imma let you finish";

            // Table view
            Table table1 = new Table(2, 2, false);
            Label top = new Label();
            top.Text = "Buttons shortcuts, statuses, etc...";
            Label bottomLeft= new Label();
            bottomLeft.Text = "A \"cardboard\" of memos will be hung here.";
            Label bottomRight = new Label();
            bottomRight.Text = "Menu for creating memo \nlists, projects, memos...";

            // Here I could attach some informations, buttons
            // something that is general to all memos ?
            table1.Attach(top, 0, 2, 0, 1, Gtk.AttachOptions.Expand,
                    Gtk.AttachOptions.Fill, 10, 10);

            // Here I would create a specific widget that specializes
            // in displaying memos
            /*
            BoardDisplay mBoard = new BoardDisplay();
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("1", "one")));
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("2", "two")));
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("3", "three is an incredibly long text blah blah blah")));
            mBoard.AddMemoDisplay(new MemoItemDisplay(new Memo("4", "four")));
            mBoard.DrawBoard();
            table1.Attach(mBoard.Board, 0, 1, 1, 2, Gtk.AttachOptions.Expand,
                    Gtk.AttachOptions.Expand, 10, 10);
            */
            // Ideally here I would attach something that inherits a widget
            // and is a menu for creating new memos
            table1.Attach(bottomRight, 1, 2, 1, 2, Gtk.AttachOptions.Fill,
                    Gtk.AttachOptions.Fill, 1, 1);

            window.Add(table1);
            window.ShowAll();
            Application.Run();
        }
Example #28
0
        // ============================================
        // PUBLIC Constructors
        // ============================================
        /// Create New Tray Icon
        public TrayIcon()
        {
            // Initialize Plugin Info
            this.pluginInfo = new Info();

            // Initialize Status Icon
            Gdk.Pixbuf pixbuf = new Gdk.Pixbuf(null, "TrayIcon.png");
            this.statusIcon = new StatusIcon(pixbuf);
            this.statusIcon.Visible = true;
            this.statusIcon.Tooltip = "NyFolder, Share Your Files...";

            // Initialize Status Icon Events
            this.statusIcon.Activate += new EventHandler(OnStatusIconActivated);
            this.statusIcon.PopupMenu += new PopupMenuHandler(OnStatusIconPopupMenu);
        }
Example #29
0
 public static void Main(string[] args)
 {
     Application.Init();
     icon = StatusIcon.NewFromStock(Stock.ZoomIn);
     icon.Visible = true;
     icon.Tooltip = "Task Tracker";
     icon.PopupMenu += OnStatusIconPopupMenu;
     icon.Activate += MenuViewTaskActivated;
     TaskSettings settings = new TaskSettings();
     settings = settings.Load();
     watch = new Timer(settings.interval);
     watch.Elapsed += HandleWatchElapsed;
     watch.Start();
     RequestWork.DisplayMessage();
     Application.Run();
 }
Example #30
0
        public static void Main(string[] args)
        {
            Console.WriteLine("main: PixClip starting");
            Application.Init();

            trayIcon = new StatusIcon(new Pixbuf("PixClip.ico"));
            trayIcon.Visible = true;

            trayIcon.Activate += OnTrayIconActivate;
            trayIcon.PopupMenu += OnTrayIconPopup;

            trayIcon.Tooltip = "PixClip Linux";

            Application.Run();
            Console.WriteLine("main: ended");
        }
 public void CreateNotifyIcon(IMenuItemParams[] items, string text)
 {
     var appIcon = ToPixbuf(Resources.logo);
     this.trayIcon = new StatusIcon(appIcon)
     {
         Visible = true,
         Tooltip = text
     };
     this.trayIcon.Activate += delegate
     {
         ShowMainMenu(items);
     };
     this.trayIcon.PopupMenu += (o, e) =>
         {
         ShowMainMenu(items);
     };
 }
        public BurningWindow(ref Process proc)
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build();

            burnproc = proc;

            this.button_cancel.Clicked += HandleCancel;
            this.Deletable = false;
            buttonend = false;

            trayicon = new StatusIcon(Pixbuf.LoadFromResource("LinXbox360isoBurner.icon.png"));
            trayicon.Visible = false;
            trayicon.Activate += HandleActivate;

            statusbar.Push(1,"Burning...");
        }
        public RenderingQueueWindow(RenderingQueue renderingQueue)
            : base(WindowType.Toplevel)
        {
            this.Build ();

            title_Label.ModifyFont(FontHelpers.ScaleFontSize(title_Label, 1.4));

            // Adding queue event handlers
            mRenderingQueue = renderingQueue;
            mRenderingQueue.QueueProgressMessageReport += HandleRenderingQueueProgressMessageReport;
            mRenderingQueue.ItemAdded += HandleRenderingQueueItemAdded;
            mRenderingQueue.ItemIndexChanged += HandleRenderingQueueItemIndexChanged;
            mRenderingQueue.ItemRemoved += HandleRenderingQueueItemRemoved;
            mRenderingQueue.BeforeItemProcessingStarted += HandleRenderingQueueBeforeItemProcessingStarted;
            mRenderingQueue.AfterItemProcessingFinished += HandleRenderingQueueAfterItemProcessingFinished;
            mRenderingQueue.ThreadStarted += HandleRenderingQueueThreadStarted;
            mRenderingQueue.ThreadStopped += HandleRenderingQueueThreadStopped;
            mRenderingQueue.QueueEmpty += HandleRenderingQueueQueueEmpty;
            mRenderingQueue.ItemRendering += HandleRenderingQueueItemRendering;

            // Creating status icon

            string icon_res;
            if (System.Environment.OSVersion.Platform == PlatformID.Unix)
                icon_res = "CatEye.UI.Gtk.res.svg-inkscape.cateye-small.svg";
            else
            {
                // Windows, I hope.
                icon_res = "CatEye.UI.Gtk.res.png.cateye-small-16x16.png";
            }

            mProcessingStatusIcon = new StatusIcon(Gdk.Pixbuf.LoadFromResource(icon_res));
            mProcessingStatusIcon.Visible = false;	// In Windows status icon appears visible by default
            mProcessingStatusIcon.Activate += HandleProcessingStatusIconActivate;

            // Preparing queue list
            mQueueNodeStore = new NodeStore(typeof(RenderingTaskTreeNode));
            queue_nodeview.NodeStore = mQueueNodeStore;

            queue_nodeview.AppendColumn("Source", new CellRendererText(), "text", 0);
            queue_nodeview.AppendColumn("Destination", new CellRendererText(), "text", 1);

            expander1.Expanded = false;
            queue_GtkLabel.Markup = "<b>Queue (" + mRenderingQueue.Queue.Length + " left)</b>";
        }
Example #34
0
        public static void Main(string[] args)
        {
            settings = settingsService.GetSettings ();
            Application.Init ();

            string iconPath = settings.ExecutingPath + "favicon.ico";

            trayIcon = new StatusIcon (new Pixbuf (iconPath));
            trayIcon.PopupMenu += OnTrayIconPopup;
            trayIcon.Visible = true;
            trayIcon.Tooltip = "Remote Access";

            if (Directory.Exists ("machines") == false) {
                Directory.CreateDirectory ("machines");
            }

            Application.Run ();
        }
        public void AttachToWidget(Gtk.Widget widget)
        {
            int x, y;

            widget.GdkWindow.GetOrigin(out x, out y);

            if (widget.GetType() != typeof(Gtk.Window) || !widget.GetType().IsSubclassOf(typeof(Gtk.Window)))
            {
                x += widget.Allocation.X;
                y += widget.Allocation.Y;
            }

            x += widget.Allocation.Width / 2;
            y += widget.Allocation.Height / 2;

            SetGeometryHints(widget.Screen, x, y);
            attach_widget = widget;
            status_icon   = null;
        }
Example #36
0
        public static void Main(string[] args)
        {
            // Inicia a aplicacao
            Application.Init ();

            if(args.Length == 0)
            {
                 win = new MainWindow ();
            }
            else
            {
                string[] newargs;

                // If there is only one arg, it is assumed that that is the file arg.
                if(!args[0].StartsWith("-"))
                {
                    newargs = new string[] {"-f", args[0]};
                }
                else
                {
                    newargs = args;
                }

                Configuration config = new Configuration(newargs);
                win = new MainWindow(config);
            }

            // Attach to the Delete Event when the window has been closed.
            win.DeleteEvent += delegate { Application.Quit (); };

            // Creation of the Icon
            trayIcon = new StatusIcon(Gdk.Pixbuf.LoadFromResource ("Ideas.Scada.Server.Manager.Resources.Icons.Interface.16.ideas.png"));
            trayIcon.Visible = true;

            // Show/Hide the window (even from the Panel/Taskbar) when the TrayIcon has been clicked.
            trayIcon.Activate += delegate { win.Visible = !win.Visible; };

            // A Tooltip for the Icon
            trayIcon.Tooltip = "Ideas Server Manager";

            win.ShowAll ();
            Application.Run ();
        }
Example #37
0
        public void AttachToStatusIcon(Gtk.StatusIcon status_icon)
        {
            Gdk.Screen    screen;
            Gdk.Rectangle rect;
            Orientation   orientation;
            int           x, y;

            if (!status_icon.GetGeometry(out screen, out rect, out orientation))
            {
                return;
            }

            x = rect.X + rect.Width / 2;
            y = rect.Y + rect.Height / 2;

            SetGeometryHints(screen, x, y);

            this.status_icon = status_icon;
            attach_widget    = null;
        }
Example #38
0
        public StatusIcon()
        {
            CreateAnimationFrames();

#if HAVE_APP_INDICATOR
            this.indicator = new ApplicationIndicator("cmissync",
                                                      "process-syncing-i", Category.ApplicationStatus);

            this.indicator.Status = Status.Active;
#else
            this.status_icon        = new Gtk.StatusIcon();
            this.status_icon.Pixbuf = this.animation_frames [0];

            this.status_icon.Activate  += ShowMenu; // Primary mouse button click
            this.status_icon.PopupMenu += ShowMenu; // Secondary mouse button click
#endif

            CreateMenu();


            Controller.UpdateIconEvent += delegate(int icon_frame) {
                Application.Invoke(delegate {
                    if (icon_frame > -1)
                    {
#if HAVE_APP_INDICATOR
                        string icon_name = "process-syncing-";
                        for (int i = 0; i <= icon_frame; i++)
                        {
                            icon_name += "i";
                        }

                        this.indicator.IconName = icon_name;

                        // Force update of the icon
                        this.indicator.Status = Status.Attention;
                        this.indicator.Status = Status.Active;
#else
                        this.status_icon.Pixbuf = this.animation_frames [icon_frame];
#endif
                    }
                    else
                    {
#if HAVE_APP_INDICATOR
                        this.indicator.IconName = "process-syncing-error";

                        // Force update of the icon
                        this.indicator.Status = Status.Attention;
                        this.indicator.Status = Status.Active;
#else
                        this.status_icon.Pixbuf = UIHelpers.GetIcon("process-syncing-error", 24);
#endif
                    }
                });
            };

            Controller.UpdateStatusItemEvent += delegate(string state_text) {
                if (!IsHandleCreated)
                {
                    return;
                }
                Application.Invoke(delegate {
                    (this.state_item.Child as Label).Text = state_text;
                    this.state_item.ShowAll();
                });
            };

            Controller.UpdateMenuEvent += delegate(IconState state) {
                Application.Invoke(delegate {
                    CreateMenu();
                });
            };

            Controller.UpdateSuspendSyncFolderEvent += delegate(string reponame) {
                if (!IsHandleCreated)
                {
                    return;
                }
                Application.Invoke(delegate
                {
                    foreach (var menuItem in this.menu.Children)
                    {
                        if (menuItem is CmisSyncMenuItem && reponame.Equals(((CmisSyncMenuItem)menuItem).RepoName))
                        {
                            foreach (RepoBase aRepo in Program.Controller.Repositories)
                            {
                                if (aRepo.Name.Equals(reponame))
                                {
                                    Menu submenu = (Menu)((CmisSyncMenuItem)menuItem).Submenu;
                                    CmisSyncMenuItem pauseItem = (CmisSyncMenuItem)submenu.Children[1];
                                    setSyncItemState(pauseItem, aRepo.Status);
                                    break;
                                }
                            }
                            break;
                        }
                    }
                });
            };
        }
Example #39
0
        public StatusIcon()
        {
            this.CreateAnimationFrames();

#if HAVE_APP_INDICATOR
            this.indicator = new ApplicationIndicator("dataspacesync",
                                                      "dataspacesync-process-syncing-i", Category.ApplicationStatus);

            this.indicator.Status = Status.Active;
#else
            this.statusIcon        = new Gtk.StatusIcon();
            this.statusIcon.Pixbuf = this.animationFrames[0];

            this.statusIcon.Activate += delegate(object sender, EventArgs args) {
                this.Controller.LocalFolderClicked(null); // Primary mouse button click shows default folder
            };

            this.statusIcon.PopupMenu += this.ShowMenu; // Secondary mouse button click
#endif

            this.CreateMenu();

            this.Controller.UpdateIconEvent += delegate(int icon_frame) {
                Application.Invoke(delegate {
                    if (icon_frame > -1)
                    {
#if HAVE_APP_INDICATOR
                        string icon_name = "dataspacesync-process-syncing-";
                        for (int i = 0; i <= icon_frame; i++)
                        {
                            icon_name += "i";
                        }

                        this.indicator.IconName = icon_name;

                        // Force update of the icon
                        this.indicator.Status = Status.Attention;
                        this.indicator.Status = Status.Active;
#else
                        this.statusIcon.Pixbuf = this.animationFrames[icon_frame];
#endif
                    }
                    else
                    {
#if HAVE_APP_INDICATOR
                        this.indicator.IconName = "dataspacesync-process-syncing-error";

                        // Force update of the icon
                        this.indicator.Status = Status.Attention;
                        this.indicator.Status = Status.Active;
#else
                        this.statusIcon.Pixbuf = UIHelpers.GetIcon("dataspacesync-process-syncing-error", 24);
#endif
                    }
                });
            };

            this.Controller.UpdateMenuEvent += delegate(IconState state) {
                Application.Invoke(delegate {
                    this.CreateMenu();
                });
            };

            this.Controller.UpdateSuspendSyncFolderEvent += delegate(string reponame) {
                if (!this.isHandleCreated)
                {
                    return;
                }

                Application.Invoke(delegate {
                    foreach (var repoItem in this.repoItems)
                    {
                        if (repoItem.RepositoryName == reponame)
                        {
                            foreach (var repo in Program.Controller.Repositories)
                            {
                                if (repo.Name.Equals(reponame))
                                {
                                    repoItem.Status = repo.Status;
                                    break;
                                }
                            }

                            break;
                        }
                    }
                });
            };
        }
Example #40
0
        public StatusIcon()
        {
            CreateAnimationFrames();

#if HAVE_APP_INDICATOR
            this.indicator = new ApplicationIndicator("dataspacesync",
                                                      "dataspacesync-process-syncing-i", Category.ApplicationStatus);

            this.indicator.Status = Status.Active;
#else
            this.status_icon        = new Gtk.StatusIcon();
            this.status_icon.Pixbuf = this.animation_frames [0];

            this.status_icon.Activate  += OpenFolderDelegate(null); // Primary mouse button click shows default folder
            this.status_icon.PopupMenu += ShowMenu;                 // Secondary mouse button click
#endif

            CreateMenu();


            Controller.UpdateIconEvent += delegate(int icon_frame) {
                Application.Invoke(delegate {
                    if (icon_frame > -1)
                    {
#if HAVE_APP_INDICATOR
                        string icon_name = "dataspacesync-process-syncing-";
                        for (int i = 0; i <= icon_frame; i++)
                        {
                            icon_name += "i";
                        }

                        this.indicator.IconName = icon_name;

                        // Force update of the icon
                        this.indicator.Status = Status.Attention;
                        this.indicator.Status = Status.Active;
#else
                        this.status_icon.Pixbuf = this.animation_frames [icon_frame];
#endif
                    }
                    else
                    {
#if HAVE_APP_INDICATOR
                        this.indicator.IconName = "dataspacesync-process-syncing-error";

                        // Force update of the icon
                        this.indicator.Status = Status.Attention;
                        this.indicator.Status = Status.Active;
#else
                        this.status_icon.Pixbuf = UIHelpers.GetIcon("dataspacesync-process-syncing-error", 24);
#endif
                    }
                });
            };

            Controller.UpdateStatusItemEvent += delegate(string state_text) {
                if (!IsHandleCreated)
                {
                    return;
                }
                Application.Invoke(delegate {
                    (this.state_item.Child as Label).Text = state_text;
                    this.state_item.ShowAll();
                });
            };

            Controller.UpdateMenuEvent += delegate(IconState state) {
                Application.Invoke(delegate {
                    CreateMenu();
                });
            };

            Controller.UpdateSuspendSyncFolderEvent += delegate(string reponame) {
                if (!IsHandleCreated)
                {
                    return;
                }
                Application.Invoke(delegate {
                    foreach (var menuItem in this.menu.Children)
                    {
                        if (menuItem is CmisSyncMenuItem && reponame.Equals(((CmisSyncMenuItem)menuItem).RepoName))
                        {
                            foreach (Repository aRepo in Program.Controller.Repositories)
                            {
                                if (aRepo.Name.Equals(reponame))
                                {
                                    Menu submenu = (Menu)((CmisSyncMenuItem)menuItem).Submenu;
                                    CmisSyncMenuItem pauseItem = (CmisSyncMenuItem)submenu.Children[1];
                                    setSyncItemState(pauseItem, aRepo.Status);
                                    break;
                                }
                            }
                            break;
                        }
                    }
                });
            };

            Controller.UpdateTransmissionMenuEvent += delegate {
                if (!IsHandleCreated)
                {
                    return;
                }
                Application.Invoke(delegate {
                    List <FileTransmissionEvent> transmissionEvents = Program.Controller.ActiveTransmissions();
                    if (transmissionEvents.Count != 0)
                    {
                        this.state_item.Sensitive = true;

                        Menu submenu            = new Menu();
                        this.state_item.Submenu = submenu;

                        foreach (FileTransmissionEvent e in transmissionEvents)
                        {
                            ImageMenuItem transmission_sub_menu_item = new TransmissionMenuItem(e);
                            submenu.Add(transmission_sub_menu_item);
                            state_item.ShowAll();
                        }
                    }
                    else
                    {
                        this.state_item.Submenu   = null;
                        this.state_item.Sensitive = false;
                    }
                });
            };
        }
Example #41
0
        public StatusIcon()
        {
            if (InstallationInfo.OperatingSystem == OS.Ubuntu)
            {
                #if HAVE_APP_INDICATOR
                indicator = new Indicator("sparkleshare", "sparkleshare", (int)IndicatorCategory.ApplicationStatus)
                {
                    IconName = "process-syncing-idle",
                    Status   = (int)IndicatorStatus.Active
                };
                #endif
            }
            else
            {
                this.status_icon = new Gtk.StatusIcon {
                    IconName = "org.sparkleshare.SparkleShare"
                };
                this.status_icon.Activate  += ShowMenu; // Primary mouse button click
                this.status_icon.PopupMenu += ShowMenu; // Secondary mouse button click
            }

            CreateMenu();

            Controller.UpdateIconEvent += delegate(IconState state) {
                Application.Invoke(delegate {
                    string icon_name = "org.sparkleshare.SparkleShare";

                    if (InstallationInfo.OperatingSystem == OS.Ubuntu)
                    {
                        icon_name = "process-syncing-idle";
                    }

                    if (state == IconState.SyncingUp)
                    {
                        icon_name = "process-syncing-up";
                    }
                    else if (state == IconState.SyncingDown)
                    {
                        icon_name = "process-syncing-down";
                    }
                    else if (state == IconState.Syncing)
                    {
                        icon_name = "process-syncing";
                    }
                    else if (state == IconState.Error)
                    {
                        icon_name = "process-syncing-error";
                    }

                    if (InstallationInfo.OperatingSystem == OS.Ubuntu)
                    {
                        #if HAVE_APP_INDICATOR
                        indicator.IconName = icon_name;

                        // Force update of the status icon
                        indicator.Status = (int)IndicatorStatus.Attention;
                        indicator.Status = (int)IndicatorStatus.Active;
                        #endif
                    }
                    else
                    {
                        this.status_icon.IconName = icon_name;
                    }
                });
            };

            Controller.UpdateStatusItemEvent += delegate(string state_text) {
                Application.Invoke(delegate {
                    (this.state_item.Child as Label).Text = state_text;
                    this.state_item.ShowAll();

                    if (Controller.Projects.Length == this.state_menu_items.Length)
                    {
                        for (int i = 0; i < Controller.Projects.Length; i++)
                        {
                            (this.state_menu_items [i].Child as Label).Text = Controller.Projects [i].StatusMessage;
                            this.state_menu_items [i].ShowAll();
                        }
                    }
                });
            };

            Controller.UpdateQuitItemEvent += delegate(bool item_enabled) {
                Application.Invoke(delegate {
                    this.quit_item.Sensitive = item_enabled;
                    this.quit_item.ShowAll();
                });
            };

            Controller.UpdateMenuEvent += delegate(IconState state) {
                Application.Invoke(delegate { CreateMenu(); });
            };
        }
Example #42
0
        public StatusIcon()
        {
            CreateAnimationFrames();

#if HAVE_APP_INDICATOR
            this.indicator = new ApplicationIndicator("cmissync",
                                                      "process-syncing-i", Category.ApplicationStatus);

            this.indicator.Status = Status.Active;
#else
            this.status_icon        = new Gtk.StatusIcon();
            this.status_icon.Pixbuf = this.animation_frames [0];

            this.status_icon.Activate  += ShowMenu; // Primary mouse button click
            this.status_icon.PopupMenu += ShowMenu; // Secondary mouse button click
#endif

            CreateMenu();


            Controller.UpdateIconEvent += delegate(int icon_frame) {
                Application.Invoke(delegate {
                    if (icon_frame > -1)
                    {
#if HAVE_APP_INDICATOR
                        string icon_name = "process-syncing-";
                        for (int i = 0; i <= icon_frame; i++)
                        {
                            icon_name += "i";
                        }

                        this.indicator.IconName = icon_name;

                        // Force update of the icon
                        this.indicator.Status = Status.Attention;
                        this.indicator.Status = Status.Active;
#else
                        this.status_icon.Pixbuf = this.animation_frames [icon_frame];
#endif
                    }
                    else
                    {
#if HAVE_APP_INDICATOR
                        this.indicator.IconName = "process-syncing-error";

                        // Force update of the icon
                        this.indicator.Status = Status.Attention;
                        this.indicator.Status = Status.Active;
#else
                        this.status_icon.Pixbuf = UIHelpers.GetIcon("process-syncing-error", 24);
#endif
                    }
                });
            };

            Controller.UpdateStatusItemEvent += delegate(string state_text) {
                Application.Invoke(delegate {
                    (this.state_item.Child as Label).Text = state_text;
                    this.state_item.ShowAll();
                });
            };

            Controller.UpdateMenuEvent += delegate(IconState state) {
                Application.Invoke(delegate {
                    CreateMenu();
                });
            };
        }
Example #43
0
        public static void Main(string[] args)
        {
            //bool onlyInstance;
            //Push changes
            //bool onlyInstance;
            //Push changes test
            //Mutex mtx = new Mutex (true, "XenoTorrent.exe", out onlyInstance); // используйте имя вашего приложения

            if (!IsApplicationRunningOnMono ("XenoTorrent.exe"))
            {
                ep = Path.GetDirectoryName (System.Reflection.Assembly.GetExecutingAssembly ().Location);

                InitSettings();

                if (!Directory.Exists(tp))
                {
                    Directory.CreateDirectory(tp);
                }

                if (!Directory.Exists (dp))
                {
                    Directory.CreateDirectory (dp);
                }

                foreach (string s in args)
                {
                    try
                    {
                        File.Copy(s, tp+"/"+Path.GetFileName(s));
                    }
                    catch{}
                }

                Application.Init ();

                    if (File.Exists(ep+"/1.png"))
                        trayIcon = new StatusIcon (new Pixbuf (ep+"/1.png"));
                    else
                        trayIcon = new StatusIcon();
                    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 = "XenoTorrent";

                    MainWindow win = new MainWindow (tp,dp,ep, trayIcon);

                    // Show/Hide the window (even from the Panel/Taskbar) when the TrayIcon has been clicked.
                    trayIcon.Activate += delegate {
                        win.Move (win.Screen.Width - 385, win.Screen.Height - 320);
                        win.Visible = !win.Visible;
                        };
                    win.Move (win.Screen.Width - 385, win.Screen.Height - 320);
                    win.Show ();

                Application.Run ();
            }
        }
Example #44
0
 public Notification(string summary, string body, string icon, Gtk.StatusIcon status_icon) : this(summary, body, icon)
 {
     AttachToStatusIcon(status_icon);
 }
Example #45
0
        private void SetupTrayIcon()
        {
            trayIcon = new Gtk.StatusIcon();
            trayIcon.Pixbuf = Utilities.GetIcon ("tasque-24", 24);

            // hooking event
            trayIcon.Activate += OnTrayIconClick;
            trayIcon.PopupMenu += OnTrayIconPopupMenu;

            // showing the trayicon
            trayIcon.Visible = true;

            RefreshTrayIconTooltip ();
        }
Example #46
0
 /// <summary>
 /// Creates a main form
 /// </summary>
 public Main()
 {
     try
     {
         Core.SetMain(this);
         if (Configuration.UserData.TrayIcon)
         {
             icon = new StatusIcon(global::Gdk.Pixbuf.LoadFromResource("Client.Resources.pigeon_clip_art_hight.ico"));
             icon.Visible = true;
             icon.PopupMenu += new PopupMenuHandler(TrayMenu);
         }
         this.Build();
         this.LC("MainForm");
         timer = new GLib.TimeoutHandler(updater_Tick);
         GLib.Timeout.Add(200, timer);
         this.DetachFromMicroChatAction.Activated += new EventHandler(detachFromMicroChatToolStripMenuItem_Click);
         this.AttachToMicroChatAction.Activated += new EventHandler(attachToMicroChatToolStripMenuItem_Click);
         this.SearchAction.Activated += new EventHandler(searchToolStripMenuItem_Click);
         this.ContentsAction.Activated += new EventHandler(contentsToolStripMenuItem_Click);
         this.ConfigurationFileAction.Activated += new EventHandler(configurationFileToolStripMenuItem_Click);
         this.FavoriteNetworksAction.Activated += new EventHandler(favoriteNetworksToolStripMenuItem_Click);
         this.RootAction.Activated += new EventHandler(rootToolStripMenuItem_Click);
         this.LoadMoreToScrollbackAction.Activated += new EventHandler(loadToolStripMenuItem_Click);
         this.SizeAllocated += new SizeAllocatedHandler(resize);
         this.FavoriteNetworksAction.Sensitive = false;
         _Load();
         Status("Welcome to pidgeon");
     }
     catch (Exception fail)
     {
         Core.handleException(fail);
     }
 }
		void HideStatusIcon (StatusIcon icon)
		{
			statusIconBox.Remove (icon.EventBox);
			icon.EventBox.Destroy ();
		}
		public StatusBarIcon ShowStatusIcon (Gdk.Pixbuf pixbuf)
		{
			DispatchService.AssertGuiThread ();
			StatusIcon icon = new StatusIcon (this, pixbuf);
			statusIconBox.PackEnd (icon.box);
			statusIconBox.ShowAll ();
			return icon;
		}