Ejemplo n.º 1
0
    public static StatusIcon Create(GameObject go, string tooltip)
    {
        GameObject g = Instantiate(go);
        StatusIcon s = g.AddComponent <StatusIcon>();

        return(s);
    }
    public void ModifyRune(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Rune");

        runeStacks += stacks;

        if (stacks > 0)
        {
            VisualEffectManager.Instance.CreateStatusEffect(myLivingEntity.transform.position, "Rune + " + runeStacks.ToString(), false);
        }
        else if (stacks < 0)
        {
            VisualEffectManager.Instance.CreateStatusEffect(myLivingEntity.transform.position, "Rune " + runeStacks.ToString(), false);
        }

        if (runeStacks > 0)
        {
            Rune = true;
        }
        else if (runeStacks <= 0)
        {
            Rune = false;
        }

        myLivingEntity.myStatusManager.StartAddStatusProcess(iconData, stacks);
    }
    public void LearnPoisonImmunity()
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Poison Immunity");

        PoisonImmunity = true;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Poison Immunity"), 1);
    }
Ejemplo n.º 4
0
    public static void Main()
    {
        // Initialize GTK#
        Application.Init();

        // Creates window
        window = new Gtk.Window("This is a window!");

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

        // Create the icon
        trayIcon         = new StatusIcon(new Pixbuf("someIcon.png"));
        trayIcon.Visible = true;

        // Show/Hide the window when the TrayIcon has been clicked.
        trayIcon.Activate += delegate { window.Visible = !window.Visible; };
        // Show a pop up menu when the icon has been right clicked.
        trayIcon.PopupMenu += OnTrayIconPopup;

        // A Tooltip for the Icon
        trayIcon.Tooltip = "Yep. This is a tooltip.";

        // Show main window and start the app
        window.ShowAll();
        Application.Run();
    }
Ejemplo n.º 5
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Id.Length != 0)
            {
                hash ^= Id.GetHashCode();
            }
            if (RewardBonusLocKey.Length != 0)
            {
                hash ^= RewardBonusLocKey.GetHashCode();
            }
            if (RewardBonusIcon.Length != 0)
            {
                hash ^= RewardBonusIcon.GetHashCode();
            }
            if (StatusIcon.Length != 0)
            {
                hash ^= StatusIcon.GetHashCode();
            }
            if (DisplayName.Length != 0)
            {
                hash ^= DisplayName.GetHashCode();
            }
            hash ^= conditionalModifiers_.GetHashCode();
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Ejemplo n.º 6
0
	public StickyUI() {
		this.SetupWindow();
		this.LoadNotes();
		this.status_icon = StatusIcon.NewFromIconName("gnome-sticky-notes-applet");
		this.status_icon.Activate += new EventHandler(this.ToggleNotes);	
		this.notes_showing = true;
	}
Ejemplo n.º 7
0
    public void CheckSpawnIcon(EffectType type)
    {
        //TODO add traits icons
        foreach (StatusIcon si in icons)
        {
            if (si.type == type)//if icon exists, no need to spawn
            {
                //TODO add animation for updating status
                return;
            }
        }
        StatusIcon icon = Instantiate <StatusIcon>(prefab, transform);

        icon.manager = this;
        icon.type    = type;
        if (type == EffectType.baseClass)
        {
            icon.SetImage(SpriteLibrary.GetStatusSprite(unit.stats.GetClassName()));
        }
        else
        {
            icon.SetImage(SpriteLibrary.GetStatusSprite(EffectName.ToString(type)));
        }
        icon.SetPosition(icons.Count);
        icons.Add(icon);
    }
Ejemplo n.º 8
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();
        }
Ejemplo n.º 9
0
        public void ShouldLoadIconFromFileWhenFileExists()
        {
            StatusIcon iconFile = StatusIcon.LoadFromFile(file);
            Size       size     = iconFile.Icon.Size;

            Assert.AreEqual(originalIcon.Size, size);
        }
Ejemplo n.º 10
0
 public static void Initialize()
 {
     DefaultIcon        = DockServices.Drawing.LoadIcon(DefaultIconName, NoteIconSize);
     statusIcon         = new StatusIcon();
     statusIcon.Pixbuf  = DockServices.Drawing.LoadIcon(DefaultIconName, StatusIconSize);
     statusIcon.Visible = false;
 }
Ejemplo n.º 11
0
    public YAWIPForm()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        #region Graphics
        txtFilePath.Xalign = 1.0F;
        spinRefreshRate.Xalign = 1.0F;
        txtVlcHostname.Xalign = 1.0F;
        spinVlcPort.Xalign = 1.0F;
        txtVlcPassword.Xalign = 1.0F;
        txtSpotifyFormat.Xalign = 1.0F;
        #endregion

        #region Configs
        Configs.Load();
        LoadConfigs();
        #endregion

        #region TrayIcon
        trayIcon = new StatusIcon (this.Icon);
        trayIcon.Tooltip = "Yet Another What Is Playing";
        trayIcon.Visible = true;
        trayIcon.Activate += OnTrayIconClick;
        #endregion
    }
Ejemplo n.º 12
0
        // Входящий звонок
        private void softphone_IncomingCallEvent(Call incomingCall)
        {
            // Reject incoming call, if we have active
            if (this.call != null)
            {
                Softphone.TerminateCall(incomingCall);

                // write rejected call to base
                RecordToLocalDataBase.Phone      = GetPhone(incomingCall.From);
                RecordToLocalDataBase.TimeStart  = DateTime.Now;
                RecordToLocalDataBase.isRejected = true;

                return;
            }
            ;

            // set flag
            isIncoming = true;
            // Recieve incoming call
            this.call = incomingCall;

            //Echo cancellation
            Softphone.EchoCancellation(this.call, Settings.isEchoOff);

            string phone  = GetPhone(this.call.From);
            string callId = GetCallId(this.call.From);

            InvokeGUIThread(() =>
            {
                dialog = new IncomingDialog();
                // show incoming call dialog
                dialog.Call      = this.call;
                dialog.SoftPhone = Softphone;
                dialog.UpdateTextPanel(phone, callId);

                dialog.Show();

                // change icon to incoming call
                this.txtStatus.Text  = "Занят";
                lblStatusRecord.Text = "Входящий";
                PhoneIcon.SetResourceReference(Image.SourceProperty, "decline");
                StatusIcon.SetResourceReference(Image.SourceProperty, "presence_not_available");
                this.btnConnectOrReject.Background = Brushes.Red;
            });

            // Play Sound
#pragma warning disable CS0103 // The name 'Properties' does not exist in the current context
#pragma warning disable CS0103 // The name 'Properties' does not exist in the current context
            Classes.LocalAudioPlayer.PlaySound(Properties.Resources.signal, true);
#pragma warning restore CS0103 // The name 'Properties' does not exist in the current context
#pragma warning restore CS0103 // The name 'Properties' does not exist in the current context

            // record call info
            RecordToLocalDataBase.Phone     = phone;
            RecordToLocalDataBase.TimeStart = DateTime.Now;

            // Get information about caller
            GetInfoAboutCaller(call.From);
        }
Ejemplo n.º 13
0
 /// <summary>
 /// Loads tray plugin.
 /// </summary>
 /// <param name="menu">Menu reference.</param>
 /// <param name="rebuildMenuFunc">Rebuild menu function.</param>
 public void Load(Menu menu, MenuFunc rebuildMenuFunc)
 {
     this.menu                 = menu;
     this.RebuildMenu          = rebuildMenuFunc;
     this.statusIcon           = new StatusIcon();
     this.statusIcon.IconName  = EnvironmentVariables.PanelIcon;
     this.statusIcon.Activate += this.OnStatusIconActivated;
 }
Ejemplo n.º 14
0
 public void HandleIconMouseExit(StatusIcon icon)
 {
     if (icon == currentIconUnderMouse)
     {
         currentIconUnderMouse = null;
         DisableView();
     }
 }
    public void LearnQuickReflexes(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Quick Reflexes");

        QuickReflexes        = true;
        quickReflexesStacks += stacks;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Quick Reflexes"), stacks);
    }
    public void LearnPoisonous(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Poisonous");

        Poisonous        = true;
        poisonousStacks += stacks;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Poisonous"), stacks);
    }
    public void LearnThickOfTheFight(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Thick Of The Fight");

        ThickOfTheFight        = true;
        thickOfTheFightStacks += stacks;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Thick Of The Fight"), stacks);
    }
    public void LearnLightningShield(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Lightning Shield");

        LightningShield        = true;
        lightningShieldStacks += stacks;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Lightning Shield"), stacks);
    }
    public void LearnSoulDrainAura(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Soul Drain Aura");

        SoulDrainAura        = true;
        soulDrainAuraStacks += stacks;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Soul Drain Aura"), stacks);
    }
    public void LearnHatefulPresence(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Hateful Presence");

        HatefulPresence        = true;
        hatefulPresenceStacks += stacks;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Hateful Presence"), stacks);
    }
    public void LearnAdaptive(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Adaptive");

        Adaptive        = true;
        adaptiveStacks += stacks;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Adaptive"), stacks);
    }
Ejemplo n.º 22
0
 /// <summary>
 /// Resets the Status bar icon on the left to its default green circle
 /// </summary>
 public void SetStatusIcon()
 {
     StatusIcon.Icon = FontAwesomeIcon.Circle;
     StatusIcon.Foreground = new SolidColorBrush(Colors.Green);
     StatusIcon.Spin = false;
     StatusIcon.SpinDuration = 0;
     StatusIcon.StopSpin();
 }
    public void LearnUnhygienic(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Unhygienic");

        Unhygienic        = true;
        unhygienicStacks += stacks;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Unhygienic"), stacks);
    }
    public void LearnPhysicalImmunity(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Physical Immunity");

        PhysicalImmunity        = true;
        physicalImmunityStacks += stacks;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Physical Immunity"), stacks);
    }
    public void LearnFleetFooted(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Fleet Footed");

        FleetFooted        = true;
        fleetFootedStacks += stacks;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Fleet Footed"), stacks);
    }
    public void LearnVolatile(int stacks)
    {
        StatusIcon iconData = StatusIconLibrary.Instance.GetStatusIconByName("Volatile");

        Volatile        = true;
        volatileStacks += stacks;
        myLivingEntity.myStatusManager.StartAddStatusProcess(StatusIconLibrary.Instance.GetStatusIconByName("Volatile"), stacks);
    }
Ejemplo n.º 27
0
 public StickyUI()
 {
     this.SetupWindow();
     this.LoadNotes();
     this.status_icon           = StatusIcon.NewFromIconName("gnome-sticky-notes-applet");
     this.status_icon.Activate += new EventHandler(this.ToggleNotes);
     this.notes_showing         = true;
 }
Ejemplo n.º 28
0
 void HideStatusIcon(StatusIcon icon)
 {
     statusIconBox.Remove(icon.EventBox);
     if (statusIconBox.Children.Length == 0)
     {
         statusIconBox.Hide();
     }
     icon.EventBox.Destroy();
 }
Ejemplo n.º 29
0
        public StatusBarIcon ShowStatusIcon(Xwt.Drawing.Image pixbuf)
        {
            Runtime.AssertMainThread();
            StatusIcon icon = new StatusIcon(this, pixbuf);

            statusIconBox.PackEnd(icon.box);
            statusIconBox.ShowAll();
            return(icon);
        }
Ejemplo n.º 30
0
 private void showStatusbarMessage(string message, string title, StatusIcon icon, string secondStatusMessage = null)
 {
     this.statusBar.StatusLabel.Text  = $"{title}: {message}";
     this.statusBar.StatusLabel.Image = icon.ToBitmap();
     if (!string.IsNullOrEmpty(secondStatusMessage))
     {
         this.statusBar.StatusLabel.Text += $"    {secondStatusMessage}";
     }
 }
Ejemplo n.º 31
0
        public StatusBarIcon ShowStatusIcon(Xwt.Drawing.Image pixbuf)
        {
            DispatchService.AssertGuiThread();
            StatusIcon icon = new StatusIcon(this, pixbuf);

            statusIconBox.PackEnd(icon.box);
            statusIconBox.ShowAll();
            return(icon);
        }
Ejemplo n.º 32
0
        private void showMessage(string message, string title, StatusIcon icon, string secondStatusMessage = null)
        {
            this.showStatusbarMessage(message, title, icon, secondStatusMessage);

            if (!Settings.Get.OnlyStatusBar)
            {
                MessageBox.Show(message, title, MessageBoxButtons.OK, icon.ToMessageBoxIcon());
            }
        }
Ejemplo n.º 33
0
        public UI ()
        {
            Application.Init();

            Setup      = new Setup ();
            About      = new About ();
            StatusIcon = new StatusIcon ();

            Program.Controller.UIHasLoaded ();
        }
Ejemplo n.º 34
0
	public PanelWindow (): base (Gtk.WindowType.Toplevel)
	{
		Build ();

		Pixbuf icon = Pixbuf.LoadFromResource ("mono_monkey_icon.png");
		statusIcon = new StatusIcon (icon);
		statusIcon = statusIcon;
		statusIcon.PopupMenu += new PopupMenuHandler (IconPopupHandler);
		statusIcon.Activate += new EventHandler (IconActivateHandler);
	}
Ejemplo n.º 35
0
        public UI() {
            Application.Init();

            this.Setup      = new Setup();
            this.About      = new About();
            this.StatusIcon = new StatusIcon();
            this.Setting    = new Setting();
            this.Transmissions = new TransmissionWindow();
            Program.Controller.UIHasLoaded();
        }
Ejemplo n.º 36
0
        public GUI ()
        {
            Application.Init();

            Setup      = new Setup ();
            About      = new About ();
            StatusIcon = new StatusIcon ();
			CmisSync.Lib.Utils.SetUserNotificationListener (new UserNotificationListenerLinux (StatusIcon));
            Program.Controller.UIHasLoaded ();
        }
Ejemplo n.º 37
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        entry_address.ModifyBase(StateType.Normal, new Gdk.Color(255,0,0));
        led_matrix = new LedMatrix("0.0.0.0");
        led_matrix_thread = new Thread(led_matrix.Runner);
        winamp = new Winamp_httpQ();
        rss = new RssPlugin();
        no_tray_icon = false;
        IPEndPoint mpc_endpoint;
        led_matrix.rss = rss;
        mpc_plugin = new Mpc();

        mpd_timer = new System.Timers.Timer();
        mpd_timer.Elapsed += new ElapsedEventHandler(mpd_timer_elapsed);
        mpd_timer.Interval = 1000; //1s
        mpd_timer.Start();

        try
        {
            tray_icon = new StatusIcon(new Gdk.Pixbuf("icon.png"));
        }
        catch(Exception)
        {
            no_tray_icon = true;
        }
        if(no_tray_icon == false)
        {
            tray_icon.Visible = true;
            tray_icon.Tooltip = "LedMatrix Control";
            tray_icon.Activate += delegate { this.Visible = !this.Visible; };
        }

        loadConfig();
        led_matrix.connection_status_changed_handler += led_matrix_connection_changed;
        led_matrix_thread.Start();
        winamp.title_changed_handler += led_matrix.setWinampPlaylisttitle;
        winamp.connection_changed_handler += winamp_connection_changed;
        try
        {
            //mpc_endpoint = new IPEndPoint(Dns.GetHostAddresses("dockstar-bo-hdd")[0], 6600);
            mpc_endpoint = new IPEndPoint(Dns.GetHostAddresses(entry_mpd.Text)[0], 6600);
            mpc_con = new MpcConnection(mpc_endpoint);
            mpc_plugin.Connection = mpc_con;
            mpc_plugin.Connection.AutoConnect = true;
        }
        catch(Exception)
        {
        }
        user_lines_table = new userLinesTable(ref treeview2, ref led_matrix);
    }
Ejemplo n.º 38
0
		static Image GetImage(StatusIcon status)
		{
			int index = (int)status;
			if (statusIcons[index] == null) {
				Bitmap statusImages = StatusImages;
				Bitmap smallImage = new Bitmap(7, 10);
				using (Graphics g = Graphics.FromImage(smallImage)) {
					//g.DrawImageUnscaled(statusImages, -index * 7, -3);
					Rectangle srcRect = new Rectangle(index * 7, 3, 7, 10);
					Rectangle destRect = new Rectangle(0, 0, 7, 10);
					g.DrawImage(statusImages, destRect, srcRect, GraphicsUnit.Pixel);
					//g.DrawLine(Pens.Black, 0, 0, 7, 10);
				}
				statusIcons[index] = smallImage;
			}
			return statusIcons[index];
		}
		private void LoadIcon(ProjectState projectState, string iconFilename, StatusIcon defaultIcon)
		{
		    if (string.IsNullOrEmpty(iconFilename))
		    {
		        map.Add(projectState, defaultIcon);
		        return;
		    }

		    try
		    {
		        StatusIcon icon = StatusIcon.LoadFromFile(iconFilename);
		        map.Add(projectState, icon);
		        return;
		    }
		    catch (Exception ex)
		    {
		        MessageBox.Show("Failed to load icon " + iconFilename + " for state " + projectState + ": " + ex);
		    }
		}
Ejemplo n.º 40
0
        public SparkleStatusIcon()
        {
            #if HAVE_APP_INDICATOR
            this.indicator = new ApplicationIndicator ("sparkleshare", "sparkleshare", Category.ApplicationStatus);
            this.indicator.IconName = "process-syncing-idle";
            this.indicator.Status   = Status.Active;
            #else
            this.status_icon        = new StatusIcon ();
            this.status_icon.Pixbuf = this.syncing_idle_image;

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

            CreateMenu ();

            Controller.UpdateIconEvent += delegate (IconState state) {
                Application.Invoke (delegate {
                    switch (state) {
                    case IconState.Idle: {
                        #if HAVE_APP_INDICATOR
                        this.indicator.IconName = "process-syncing-idle";
                        #else
                        this.status_icon.Pixbuf = this.syncing_idle_image;
                        #endif
                        break;
                    }
                    case IconState.SyncingUp: {
                        #if HAVE_APP_INDICATOR
                        this.indicator.IconName = "process-syncing-up";
                        #else
                        this.status_icon.Pixbuf = this.syncing_up_image;
                        #endif
                        break;
                    }
                    case IconState.SyncingDown: {
                        #if HAVE_APP_INDICATOR
                        this.indicator.IconName = "process-syncing-down";
                        #else
                        this.status_icon.Pixbuf = this.syncing_down_image;
                        #endif
                        break;
                    }
                    case IconState.Syncing: {
                        #if HAVE_APP_INDICATOR
                        this.indicator.IconName = "process-syncing";
                        #else
                        this.status_icon.Pixbuf = this.syncing_image;
                        #endif
                        break;
                    }
                    case IconState.Error: {
                        #if HAVE_APP_INDICATOR
                        this.indicator.IconName = "process-syncing-error";
                        #else
                        this.status_icon.Pixbuf = this.syncing_error_image;
                        #endif
                        break;
                    }
                    }

                    #if HAVE_APP_INDICATOR
                    // Force update of the status icon
                    this.indicator.Status = Status.Attention;
                    this.indicator.Status = Status.Active;
                    #endif
                });
            };

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

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

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

            Controller.UpdateMenuEvent += delegate (IconState state) {
                Application.Invoke (delegate {
                    CreateMenu ();
                });
            };
        }
		private void UpdateIcon()
		{
			StatusIcon = iconProvider.GetStatusIconForState( monitor.ProjectState );
		}
Ejemplo n.º 42
0
        public SparkleStatusIcon()
        {
            AnimationFrames = CreateAnimationFrames ();
            Animation       = CreateAnimation ();

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

                Status = Status.Attention
            };
            #else
            this.status_icon = new StatusIcon ();

            this.status_icon.Activate += ShowMenu; // Primary mouse button click
            this.status_icon.PopupMenu += ShowMenu; // Secondary mouse button click
            this.status_icon.Pixbuf = AnimationFrames [0];
            #endif

            if (Controller.Folders.Length == 0)
                StateText = _("Welcome to SparkleShare!");
            else
                StateText = _("Up to date") + " — " + Controller.FolderSize;

            CreateMenu ();

            Controller.UpdateMenuEvent += delegate (IconState state) {
                Application.Invoke (delegate {
                        switch (state) {
                        case IconState.Idle:

                            Animation.Stop ();

                            if (Controller.Folders.Length == 0)
                                StateText = _("Welcome to SparkleShare!");
                            else
                                StateText = _("Up to date") + " — " + Controller.FolderSize;

                            #if HAVE_APP_INDICATOR
                            this.indicator.IconName = "process-syncing-sparkleshare-i";
                            #else
                            this.status_icon.Pixbuf = AnimationFrames [0];
                            #endif

                            UpdateStateText ();
                            CreateMenu ();

                            break;

                        case IconState.Syncing:

                            StateText = _("Syncing…");
                            UpdateStateText ();

                            if (!Animation.Enabled)
                                Animation.Start ();

                            break;

                        case IconState.Error:

                            StateText = _("Not everything is synced");
                            UpdateStateText ();
                            CreateMenu ();

                            #if HAVE_APP_INDICATOR
                            this.indicator.IconName = "sparkleshare-syncing-error";
                            #else
                            this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon ("sparkleshare-syncing-error", 24);
                            #endif

                            break;
                        }
                });
            };
        }
        public SparkleStatusIcon()
        {
            CreateAnimationFrames ();
            CreateAnimation ();

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

                Status = Status.Attention
            };
            #else
            this.status_icon = new StatusIcon ();

            this.status_icon.Activate += ShowMenu; // Primary mouse button click
            this.status_icon.PopupMenu += ShowMenu; // Secondary mouse button click
            this.status_icon.Pixbuf = this.animation_frames [0];
            #endif

            if (Controller.Folders.Length == 0)
                this.state_text = _("Welcome to SparkleShare!");
            else
                this.state_text = _("Files up to date") + Controller.FolderSize;

            CreateMenu ();

            Controller.UpdateQuitItemEvent += delegate (bool quit_item_enabled) {
                Application.Invoke (delegate {
                    if (this.quit_item != null) {
                        this.quit_item.Sensitive = quit_item_enabled;
                        this.menu.ShowAll ();
                    }
                });
            };

            Controller.UpdateMenuEvent += delegate (IconState state) {
                Application.Invoke (delegate {
                    switch (state) {
                    case IconState.Idle:

                        this.animation.Stop ();

                        if (Controller.Folders.Length == 0)
                            this.state_text = _("Welcome to SparkleShare!");
                        else
                            this.state_text = _("Files up to date") + Controller.FolderSize;

                        #if HAVE_APP_INDICATOR
                        this.indicator.IconName = "process-syncing-sparkleshare-i";
                        #else
                        this.status_icon.Pixbuf = this.animation_frames [0];
                        #endif

                        UpdateStateText ();
                        CreateMenu ();

                        break;

                    case IconState.Syncing:

                        this.state_text = _("Syncing… ") +
                                    Controller.ProgressPercentage + "%  " +
                                    Controller.ProgressSpeed;

                        UpdateStateText ();

                        if (!this.animation.Enabled)
                            this.animation.Start ();

                        break;

                    case IconState.Error:

                        this.animation.Stop ();

                        this.state_text = _("Not everything is synced");
                        UpdateStateText ();
                        CreateMenu ();

                        #if HAVE_APP_INDICATOR
                        this.indicator.IconName = "sparkleshare-syncing-error";
                        #else
                        this.status_icon.Pixbuf = SparkleUIHelpers.GetIcon ("sparkleshare-syncing-error", 24);
                        #endif

                        break;
                    }

                    this.menu.ShowAll ();
                });
            };
        }
Ejemplo n.º 44
0
        public SparkleStatusIcon()
        {
            AnimationFrames = CreateAnimationFrames ();
            Animation = CreateAnimation ();

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

                Status = Status.Attention
            };
            #else
            this.status_icon = new StatusIcon ();

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

            SetNormalState ();
            CreateMenu ();

            SparkleShare.Controller.FolderSizeChanged += delegate {
                Application.Invoke (delegate {
                    if (!Animation.Enabled)
                        SetNormalState ();

                    UpdateMenu ();
                });
            };

            SparkleShare.Controller.FolderListChanged += delegate {
                Application.Invoke (delegate {
                    SetNormalState ();
                    CreateMenu ();
                });
            };

            SparkleShare.Controller.OnIdle += delegate {
                Application.Invoke (delegate {
                    SetNormalState ();
                    UpdateMenu ();
                });
            };

            SparkleShare.Controller.OnSyncing += delegate {
                Application.Invoke (delegate {
                    SetAnimationState ();
                    UpdateMenu ();
                });
            };

            SparkleShare.Controller.OnError += delegate {
                Application.Invoke (delegate {
                    SetNormalState (true);
                    UpdateMenu ();
                });
            };
        }
Ejemplo n.º 45
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();

        // Creation of the Tray Icon
        m_TrayIcon = new StatusIcon(Gdk.Pixbuf.LoadFromResource("ECMGTK.Resources.Icons.Corpse.png"));
        m_TrayIcon.Visible = false;

        // Show/Hide the window (even from the Panel/Taskbar) when the TrayIcon has been clicked.
        m_TrayIcon.Activate += OnTrayIconPopup; ;

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

        // A Tooltip for the Icon
        m_TrayIcon.Tooltip = "Eve Character Monitor";

        ntbPages.CurrentPage = STARTING_PAGE;
        hpnMarket.Position = MARKET_PANE_DEFAULT;

        while (Gtk.Application.EventsPending ())
            Gtk.Application.RunIteration ();

        GLib.ExceptionManager.UnhandledException += OnUnhandledException;

        FillTabsWithImages();

        BackgroundWorker worker = new BackgroundWorker();
        worker.DoWork += delegate
        {
            LoadMarket();
            SetupCharacterTrees();
            ECM.MapDatabase.LoadMap();
            ECM.Core.Init();

            Gtk.Application.Invoke(delegate
            {
                Show();
                m_TrayIcon.Visible = true;
            });
        };

        worker.RunWorkerCompleted += HandleWorkerRunWorkerCompleted;
        hpnMarket.Sensitive = false;
        worker.RunWorkerAsync();

        imgNetworkIndicator.PixbufAnimation = new Gdk.PixbufAnimation(ECM.Core.LoadingSpinnerGIF16);
        //imgNetworkIndicator.Visible = false;

        SetupGui();

        ECM.Core.OnUpdateGui += new EventHandler(UpdateGui);
        ECM.Core.OnCharacterChanged += CharacterChanged;
        ECM.Core.OnTQServerUpdate += TQServerUpdate;

        Timer heartbeat = new Timer(HEARTBEAT_RATE);
        heartbeat.AutoReset = true;
        heartbeat.Elapsed += new ElapsedEventHandler(heartbeat_Elapsed);
        heartbeat.Start();
    }
Ejemplo n.º 46
0
        public SparkleStatusIcon ()
        {
            #if HAVE_APP_INDICATOR
            this.indicator = new Indicator ("sparkleshare", "sparkleshare", (int) IndicatorCategory.ApplicationStatus);
            this.indicator.IconName = "process-syncing-idle";
            this.indicator.Status   = (int) IndicatorStatus.Active;
            #else
			this.status_icon          = new StatusIcon ();
            this.status_icon.IconName = "sparkleshare";

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

            CreateMenu ();

            Controller.UpdateIconEvent += delegate (IconState state) {
                Application.Invoke (delegate {
                    #if HAVE_APP_INDICATOR
                    string icon_name = "process-syncing-idle";
                    #else
                    string icon_name = "sparkleshare";
                    #endif

                    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 HAVE_APP_INDICATOR
                    this.indicator.IconName = icon_name;

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

            Controller.UpdateStatusItemEvent += delegate (string state_text) {
                Application.Invoke (delegate {
                    (this.state_item.Child as Label).Text = state_text;
                    this.state_item.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 (); });
            };
        }
Ejemplo n.º 47
0
    public MainWindow(string tp, string dp, string ep, StatusIcon si)
        : base(Gtk.WindowType.Toplevel)
    {
        Build ();
        this.tp = tp;
        this.dp = dp;
        this.si = si;
        this.ep = ep;
        dhtpath = ep+ "/dht.data";
        fastResumePath = ep+"/FastResume.Data";
        EngineSettings es = new EngineSettings ();
        es.PreferEncryption = false;
        es.AllowedEncryption = EncryptionTypes.All;

        managers = new List<TorrentManager>();
        engine = new MonoTorrent.Client.ClientEngine (es);

        engine.StatsUpdate += UpdateAll;

        nodeview2.NodeStore = new NodeStore (typeof(TorrentInfoRow));
        nodeview2.AppendColumn ("Status", new Gtk.CellRendererText (), "text", 0);
        nodeview2.AppendColumn ("Progress",  new CellRendererProgressBar(), "value", 4);
        nodeview2.AppendColumn ("Ds" + "(КБ/с)", new Gtk.CellRendererText (), "text", 2);
        nodeview2.AppendColumn ("Us" + "(КБ/с)", new Gtk.CellRendererText (), "text", 3);
        nodeview2.AppendColumn ("Seeds", new Gtk.CellRendererText (), "text", 5);

        jBox = new Gtk.Menu ();
        Gtk.MenuItem MenuItem1 = new MenuItem ("Запустить");
        MenuItem1.ButtonReleaseEvent += HandleMenuItem1ButtonReleaseEvent;
        jBox.Add (MenuItem1);
        Gtk.MenuItem MenuItem4 = new MenuItem ("Пауза");
        MenuItem4.ButtonReleaseEvent += HandleMenuItem4ButtonReleaseEvent;
        Gtk.MenuItem MenuItem2 = new MenuItem ("Остановить");
        MenuItem2.ButtonReleaseEvent += HandleMenuItem2ButtonReleaseEvent;
        jBox.Add (MenuItem2);
        Gtk.MenuItem MenuItem5 = new MenuItem ("Открыть Папку...");
        MenuItem5.ButtonReleaseEvent += HandleMenuItem5ButtonReleaseEvent;
        jBox.Add (MenuItem5);
        MenuItem3 = new MenuItem ("Открыть Файл");
        MenuItem3.Sensitive = false;
        MenuItem3.ButtonReleaseEvent += HandleMenuItem3ButtonReleaseEvent;
        jBox.Add (MenuItem3);
        Gtk.MenuItem MenuItem6 = new MenuItem ("Удалить торрент");
        MenuItem6.ButtonReleaseEvent += HandleMenuItem6ButtonReleaseEvent;;
        jBox.Add (MenuItem6);
        Gtk.MenuItem MenuItem7 = new MenuItem ("Удалить торрент и файлы");
        MenuItem7.ButtonReleaseEvent += HandleMenuItem7ButtonReleaseEvent;;
        jBox.Add (MenuItem7);

        foreach (string file in Directory.GetFiles (tp))
        {
            if (file.EndsWith (".torrent"))
            {
                try
                {
                    LoadTorrent (file);
                } catch (Exception e)
                {
                    File.WriteAllText(ep+"/Error.txt","Couldn't decode: "+file);
                    XenoTorrent.TorrentError ts = new XenoTorrent.TorrentError (e.Message,file);
                    ts.Show ();
                    continue;
                }
            }
        }
        //engine.StopAll();
        LoadFastResume(managers);
        newTorrents = new int[managers.Count];
        StartDht (22334);
        // Working only with Gtk.Window object! (except [GLib.ConnectBeforeAttribute] attribute is defined on callback method)
        nodeview2.ButtonPressEvent += HandleNodeview2ButtonPressEvent;

        nodeview2.ShowAll ();

        engine.LocalPeerSearchEnabled = true;

        engine.StartAll ();
    }
Ejemplo n.º 48
0
        public void Dispose() {
            if (this.disposed) {
                return;
            }

            if (this.Setup != null) {
                this.Setup.Dispose();
                this.Setup = null;
            }

            if (this.About != null) {
                this.About.Dispose();
                this.About = null;
            }

            if (this.StatusIcon != null) {
                this.StatusIcon.Dispose();
                this.StatusIcon = null;
            }

            if (this.Setting != null) {
                this.Setting.Dispose();
                this.Setting = null;
            }

            this.disposed = true;
        }
Ejemplo n.º 49
0
	public MainWindow (): base (Gtk.WindowType.Toplevel)
	{
		if (!BlinkstickDeviceFinder.IsUnix())
		{
			SetupSingleInstanceEvent();
		}

		Build ();

		this.Title = "BlinkStick " + ApplicationVersion;

		log.Debug("Setting up controls");

		Gtk.TreeViewColumn eventTitleColumn = new Gtk.TreeViewColumn ();
		eventTitleColumn.Title = "Name";

		Gtk.TreeViewColumn eventTypeColumn = new Gtk.TreeViewColumn ();
		eventTypeColumn.Title = "Type";

		Gtk.TreeViewColumn eventColorColumn = new Gtk.TreeViewColumn ();
		eventColorColumn.Title = "Color";

		// Create the text cell that will display the artist name
		Gtk.CellRendererText eventTitleCell = new Gtk.CellRendererText ();
		Gtk.CellRendererText eventTypeCell = new Gtk.CellRendererText ();
		Gtk.CellRendererPixbuf eventColorCell = new Gtk.CellRendererPixbuf ();

		log.Debug ("Loading main form icon");
		this.Icon = new global::Gdk.Pixbuf (global::System.IO.Path.Combine (global::System.AppDomain.CurrentDomain.BaseDirectory, "icon.png"));
			 
		log.Debug( "Setting up treeview");
		// Add the cell to the column
		eventColorColumn.PackStart (eventColorCell, false);
		eventTypeColumn.PackEnd (eventTypeCell, true);
		eventTitleColumn.PackEnd (eventTitleCell, true);
	 
		// Tell the Cell Renderers which items in the model to display
		//eventTitleColumn.AddAttribute (eventTitleCell, "name", 0);
		eventTitleColumn.SetCellDataFunc (eventTitleCell, new Gtk.TreeCellDataFunc (RenderEventName));
		eventTypeColumn.SetCellDataFunc (eventTypeCell, new Gtk.TreeCellDataFunc (RenderEventType));
		eventColorColumn.SetCellDataFunc (eventColorCell, new Gtk.TreeCellDataFunc (RenderEventColor));

		treeviewEvents.Model = EventListStore;

		treeviewEvents.AppendColumn (eventColorColumn);
		treeviewEvents.AppendColumn (eventTypeColumn);
		treeviewEvents.AppendColumn (eventTitleColumn);

		log.Debug("Updating buttons");
		UpdateButtons ();

		log.Debug("Setting up notification manager");
		Manager = new NotificationManager ();
		Manager.NotificationUpdated += HandleNotificationUpdated;
		Manager.Load ();
		Manager.UpdateControllers();

		DeviceMonitor = new UsbMonitor(this.GdkWindow.Handle);
		DeviceMonitor.UsbDeviceAdded += (object sender, EventArgs e) => {
			Gtk.Application.Invoke (delegate {
				Manager.UpdateControllers();

				if (testForm != null)
				{
					testForm.PopulateForm();
				}
			});
		};
		DeviceMonitor.Start ();

		log.Debug("Adding notifications to the tree");
		//Gtk.TreeIter customEventRoot = EventListStore.AppendValues(new TriggeredEvent("Custom"));
		foreach (CustomNotification e in Manager.Notifications) {
			//EventListStore.AppendValues(customEventRoot, e);
			EventListStore.AppendValues (e);
		}

		log.Debug("Starting notification manager");
		Manager.Start ();

		log.Debug ("Building popup menu");
		//Build Popup Menu for TrayIcon
		popupMenu = new Menu ();

		//Settings menu item
		ImageMenuItem menuItemSettings = new ImageMenuItem ("Settings");
		menuItemSettings.Image = new Gtk.Image(Stock.Preferences, IconSize.Menu);
		menuItemSettings.Activated += ToggleMainWindow;
		popupMenu.Append(menuItemSettings);

		popupMenu.Append(new SeparatorMenuItem());

		//Quit menu item
		ImageMenuItem menuItemQuit = new ImageMenuItem ("Quit");
		menuItemQuit.Image = new Gtk.Image (Stock.Quit, IconSize.Menu);
		menuItemQuit.Activated += OnQuitActionActivated;
		popupMenu.Append (menuItemQuit);

		log.Debug("Showing popup menu");
		popupMenu.ShowAll();

#if LINUX
		indicator = new ApplicationIndicator ("blinkstick", "icon", Category.ApplicationStatus, ExecutableFolder);	
		indicator.Menu = popupMenu;
		indicator.Status = AppIndicator.Status.Active;	
#else

		log.Debug ("Setting up tray icon");
		trayIcon = new StatusIcon (new Pixbuf (System.IO.Path.Combine(ExecutableFolder, "icon.ico")));
		trayIcon.Tooltip = this.Title;
		trayIcon.Visible = true;

		// Show/Hide the window (even from the Panel/Taskbar) when the TrayIcon has been clicked.
		trayIcon.Activate += ToggleMainWindow;

		trayIcon.PopupMenu += delegate {
			popupMenu.ShowAll ();
			popupMenu.Popup ();
		};
#endif
		log.Debug("Initialization done");
	}
Ejemplo n.º 50
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();

        trayIcon = new StatusIcon(MainClass.GetResource("omvviewer-light.xpm"));
        trayIcon.Visible=true;
        trayIcon.Tooltip="Disconnected";
        trayIcon.Activate+= delegate{
            Visible=!Visible;
            this.Deiconify();
        };
        trayIcon.Activate += delegate { trayIcon.Blinking = false; this.UrgencyHint = false; };

        trayIcon.PopupMenu += delegate {
            Gtk.Menu menu = new Gtk.Menu();
                Gtk.ImageMenuItem menu_hide = new ImageMenuItem("Minimse");
              Gtk.ImageMenuItem menu_restore = new ImageMenuItem("Restore");
            AccelGroup ag=new AccelGroup();
              Gtk.ImageMenuItem menu_quit = new ImageMenuItem("gtk-quit",ag);

              menu_quit.ButtonPressEvent += new ButtonPressEventHandler(menu_quit_fn);
              menu_restore.ButtonPressEvent  += new ButtonPressEventHandler(menu_restore_fn);
              menu_hide.ButtonPressEvent  += new ButtonPressEventHandler(menu_hide_fn);
              if(MainClass.win.Visible)
                  menu.Append(menu_hide);
              else
                menu.Append(menu_restore);
              menu.Append(menu_quit);
              menu.ShowAll();
              menu.Popup();
        };

        this.Icon=MainClass.GetResource("omvviewer-light.xpm");
        status_location=new Gtk.Label("Location: Unknown (0,0,0)");

        appearancesetting.Set();

        status_balance=new Gtk.HBox();
        status_balance_lable=new Gtk.Label("?");
        Gtk.Image balicon=new Gtk.Image();
        balicon.Pixbuf = MainClass.GetResource("status_money.png");
        status_balance.PackStart(balicon);
        status_balance.PackStart(status_balance_lable);
        status_balance.SetChildPacking(balicon,false,false,0,PackType.Start);
        status_balance.SetChildPacking(status_balance_lable,false,false,0,PackType.Start);

        status_parcel=new Gtk.Label("Parcel: Unknown");

        this.statusbar1.PackStart(status_location);
        this.statusbar1.PackStart(status_parcel);
        this.statusbar1.PackStart(status_balance);

        this.Title="omvviewer light v0.48.1";

           chat=new ChatLayout();
           chat_tab_lable=this.addtabwithicon("icn_voice-pvtfocus.png","Chat",chat);
           chat.passontablable(chat_tab_lable);
           this.notebook.SwitchPage += new SwitchPageHandler(chat.onSwitchPage);

            this.LocationAction.Active = MainClass.appsettings.tab_location;

            this.SearchAction.Active = MainClass.appsettings.tab_search;

            this.GroupsAction.Active = MainClass.appsettings.tab_groups;

            this.InventoryAction.Active = MainClass.appsettings.tab_inv;

            this.ObjectsAction.Active = MainClass.appsettings.tab_objects;

            this.ParcelAction.Active = MainClass.appsettings.tab_parcel;

        this.statusbar1.ShowAll();

        MainClass.onRegister += new MainClass.register(MainClass_onRegister);
        MainClass.onDeregister += new MainClass.deregister(MainClass_onDeregister);
        if(MainClass.client != null ) { MainClass_onRegister(); }

        //this.menubar1.get

        this.AvaiableAction.Activate();
        this.StandingAction.Activate();

        this.AvaiableAction.Sensitive=false;
        this.AwayAction.Sensitive=false;
        this.BusyAction.Sensitive=false;
        this.StandingAction.Sensitive=false;
        this.CrouchAction.Sensitive=false;
        this.FlyAction.Sensitive=false;
        this.GroundSitAction.Sensitive=false;
        this.SittingAction.Sensitive=false;

        this.WindowStateEvent += delegate { if (this.Visible) { trayIcon.Blinking = false; this.UrgencyHint = false; };};

        this.DeleteEvent += new DeleteEventHandler(MainWindow_DeleteEvent);

        GLib.Timeout.Add(1000,OnUpdateStatus);

        tooltips1 = new Tooltips();
        this.statusbar1.Push(1, "Logged out");
    }
Ejemplo n.º 51
0
        public SparkleStatusIcon()
        {
            CreateAnimationFrames ();

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

            this.indicator.Status = Status.Active;
            #else
            this.status_icon        = new 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 = SparkleUIHelpers.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.UpdateQuitItemEvent += delegate (bool item_enabled) {
                Application.Invoke (delegate {
                    this.quit_item.Sensitive = item_enabled;
                    this.quit_item.ShowAll ();
                });
            };

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

            Controller.UpdateMenuEvent += delegate (IconState state) {
                Application.Invoke (delegate {
                    CreateMenu ();
                });
            };
        }
        private static Image GetImage(StatusIcon status)
        {
            var index = (int)status;
            if (StatusIcons[index] == null)
            {
                var statusImages = StatusImages;
                var smallImage = new Bitmap(7, 10);
                using (var g = Graphics.FromImage(smallImage))
                {
                    //g.DrawImageUnscaled(statusImages, -index * 7, -3);
                    var srcRect = new Rectangle(index * 7, 3, 7, 10);
                    var destRect = new Rectangle(0, 0, 7, 10);
                    g.DrawImage(statusImages, destRect, srcRect, GraphicsUnit.Pixel);

                    //g.DrawLine(Pens.Black, 0, 0, 7, 10);
                }
                smallImage.Tag = typeof(OverlayIconManager);
                StatusIcons[index] = smallImage;
            }
            return StatusIcons[index];
        }