Exemplo n.º 1
0
 public override void OnNoteOpened()
 {
     item            = new Gtk.ImageMenuItem(Catalog.GetString("Print"));
     item.Image      = new Gtk.Image(Gtk.Stock.Print, Gtk.IconSize.Menu);
     item.Activated += PrintButtonClicked;
     item.AddAccelerator("activate", Window.AccelGroup,
                         (uint)Gdk.Key.p, Gdk.ModifierType.ControlMask,
                         Gtk.AccelFlags.Visible);
     item.Show();
     AddPluginMenuItem(item);
 }
Exemplo n.º 2
0
		public override void OnNoteOpened ()
		{
			item = new Gtk.ImageMenuItem (Catalog.GetString ("Print"));
			item.Image = new Gtk.Image (Gtk.Stock.Print, Gtk.IconSize.Menu);
			item.Activated += PrintButtonClicked;
			item.AddAccelerator ("activate", Window.AccelGroup,
				(uint) Gdk.Key.p, Gdk.ModifierType.ControlMask,
				Gtk.AccelFlags.Visible);
			item.Show ();
			AddPluginMenuItem (item);
		}
Exemplo n.º 3
0
        public override void OnNoteOpened()
        {
            // Add the menu item when the window is created.
            menu_item = new Gtk.ImageMenuItem (
                Catalog.GetString ("Word count"));
            menu_item.Image = new Gtk.Image (Gtk.Stock.Index,
                Gtk.IconSize.Menu);
            menu_item.Activated += OnMenuItemActivated;
            menu_item.AddAccelerator ("activate", Window.AccelGroup,
                (uint) Gdk.Key.o, Gdk.ModifierType.ControlMask,
                Gtk.AccelFlags.Visible);

            menu_item.Show ();
            AddPluginMenuItem (menu_item);
        }
Exemplo n.º 4
0
        public MainWindow()
            : base("Smuxi")
        {
            // restore window size / position
            int width, heigth;
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"] != null) {
                width  = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"];
            } else {
                width = 800;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"] != null) {
                heigth = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"];
            } else {
                heigth = 600;
            }
            if (width == -1 && heigth == -1) {
                SetDefaultSize(800, 600);
                Maximize();
            } else if (width == 0 && heigth == 0) {
                // HACK: map 0/0 to default size as it crashes on Windows :/
                SetDefaultSize(800, 600);
            } else {
                SetDefaultSize(width, heigth);
            }

            int x, y;
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"] != null) {
                x = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"];
            } else {
                x = 0;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"] != null) {
                y = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"];
            } else {
                y = 0;
            }
            if (x == 0 && y == 0) {
                SetPosition(Gtk.WindowPosition.Center);
            } else {
                Move(x, y);
            }

            DeleteEvent += OnDeleteEvent;
            FocusInEvent += OnFocusInEvent;
            FocusOutEvent += OnFocusOutEvent;
            WindowStateEvent += OnWindowStateEvent;

            Gtk.AccelGroup agrp = new Gtk.AccelGroup();
            Gtk.AccelKey   akey;
            AddAccelGroup(agrp);

            // Menu
            _MenuBar = new Gtk.MenuBar();
            Gtk.Menu menu;
            Gtk.MenuItem item;
            Gtk.ImageMenuItem image_item;

            // Menu - File
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_File"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            item = new Gtk.ImageMenuItem(Gtk.Stock.Preferences, agrp);
            item.Activated += new EventHandler(_OnPreferencesButtonClicked);
            menu.Append(item);

            menu.Append(new Gtk.SeparatorMenuItem());

            item = new Gtk.ImageMenuItem(Gtk.Stock.Quit, agrp);
            item.Activated += new EventHandler(_OnQuitButtonClicked);
            menu.Append(item);

            // Menu - Server
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_Server"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            image_item = new Gtk.ImageMenuItem(_("_Quick Connect"));
            image_item.Image = new Gtk.Image(Gtk.Stock.Connect, Gtk.IconSize.Menu);
            image_item.Activated += OnServerQuickConnectButtonClicked;
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item = new Gtk.ImageMenuItem(Gtk.Stock.Add, agrp);
            image_item.Activated += OnServerAddButtonClicked;
            menu.Append(image_item);

            image_item = new Gtk.ImageMenuItem(_("_Manage"));
            image_item.Image = new Gtk.Image(Gtk.Stock.Edit, Gtk.IconSize.Menu);
            image_item.Activated += OnServerManageServersButtonClicked;
            menu.Append(image_item);

            // Menu - Chat
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_Chat"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            _OpenChatMenuItem = new Gtk.ImageMenuItem(_("Open / Join Chat"));
            _OpenChatMenuItem.Image = new Gtk.Image(Gtk.Stock.Open, Gtk.IconSize.Menu);
            _OpenChatMenuItem.Activated += OnChatOpenChatButtonClicked;
            _OpenChatMenuItem.Sensitive = false;
            menu.Append(_OpenChatMenuItem);

            _FindGroupChatMenuItem = new Gtk.ImageMenuItem(_("_Find Group Chat"));
            _FindGroupChatMenuItem.Image = new Gtk.Image(Gtk.Stock.Find, Gtk.IconSize.Menu);
            _FindGroupChatMenuItem.Activated += OnChatFindGroupChatButtonClicked;
            _FindGroupChatMenuItem.Sensitive = false;
            menu.Append(_FindGroupChatMenuItem);

            image_item = new Gtk.ImageMenuItem(_("C_lear All Activity"));
            image_item.Image = new Gtk.Image(Gtk.Stock.Clear, Gtk.IconSize.Menu);
            image_item.Activated += OnChatClearAllActivityButtonClicked;
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item = new Gtk.ImageMenuItem(_("_Next Chat"));
            image_item.Image = new Gtk.Image(Gtk.Stock.GoForward, Gtk.IconSize.Menu);
            image_item.Activated += OnNextChatMenuItemActivated;
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods = Gdk.ModifierType.ControlMask;
            akey.Key = Gdk.Key.Page_Down;
            image_item.AddAccelerator("activate", agrp, akey);
            menu.Append(image_item);

            image_item = new Gtk.ImageMenuItem(_("_Previous Chat"));
            image_item.Image = new Gtk.Image(Gtk.Stock.GoBack, Gtk.IconSize.Menu);
            image_item.Activated += OnPreviousChatMenuItemActivated;
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods = Gdk.ModifierType.ControlMask;
            akey.Key = Gdk.Key.Page_Up;
            image_item.AddAccelerator("activate", agrp, akey);
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            /*
            // TODO: make a radio item for each chat hotkey
            Gtk.RadioMenuItem radio_item;
            radio_item = new Gtk.RadioMenuItem();
            radio_item = new Gtk.RadioMenuItem(radio_item);
            radio_item = new Gtk.RadioMenuItem(radio_item);

            menu.Append(new Gtk.SeparatorMenuItem());
            */

            /*
            image_item = new Gtk.ImageMenuItem(Gtk.Stock.Find, agrp);
            image_item.Activated += OnFindChatMenuItemActivated;
            menu.Append(image_item);

            item = new Gtk.MenuItem(_("Find _Next"));
            item.Activated += OnFindNextChatMenuItemActivated;
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods = Gdk.ModifierType.ControlMask;
            akey.Key = Gdk.Key.G;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);

            item = new Gtk.MenuItem(_("Find _Previous"));
            item.Activated += OnFindPreviousChatMenuItemActivated;
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods = Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask;
            akey.Key = Gdk.Key.G;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);
            */

            // ROFL: the empty code statement below is needed to keep stupid
            // gettext away from using all the commented code from above as
            // translator comment
            ;
            _OpenLogChatMenuItem = new Gtk.ImageMenuItem(_("Open Log"));
            _OpenLogChatMenuItem.Image = new Gtk.Image(Gtk.Stock.Open,
                                                       Gtk.IconSize.Menu);
            _OpenLogChatMenuItem.Activated += OnOpenLogChatMenuItemActivated;
            _OpenLogChatMenuItem.Sensitive = false;
            _OpenLogChatMenuItem.NoShowAll = true;
            menu.Append(_OpenLogChatMenuItem);

            _CloseChatMenuItem = new Gtk.ImageMenuItem(Gtk.Stock.Close, agrp);
            _CloseChatMenuItem.Activated += OnCloseChatMenuItemActivated;
            menu.Append(_CloseChatMenuItem);

            // Menu - Engine
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_Engine"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            item = new Gtk.MenuItem(_("_Use Local Engine"));
            item.Activated += new EventHandler(_OnUseLocalEngineButtonClicked);
            menu.Append(item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item = new Gtk.ImageMenuItem(_("_Add Remote Engine"));
            image_item.Image = new Gtk.Image(Gtk.Stock.Add, Gtk.IconSize.Menu);
            image_item.Activated += new EventHandler(_OnAddRemoteEngineButtonClicked);
            menu.Append(image_item);

            image_item = new Gtk.ImageMenuItem(_("_Switch Remote Engine"));
            image_item.Image = new Gtk.Image(Gtk.Stock.Refresh, Gtk.IconSize.Menu);
            image_item.Activated += new EventHandler(_OnSwitchRemoteEngineButtonClicked);
            menu.Append(image_item);

            // Menu - View
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_View"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            item = new Gtk.CheckMenuItem(_("_Caret Mode"));
            item.Activated += new EventHandler(_OnCaretModeButtonClicked);
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key = Gdk.Key.F7;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);

            item = new Gtk.CheckMenuItem(_("_Browse Mode"));
            item.Activated += delegate {
                try {
                    _Notebook.IsBrowseModeEnabled = !_Notebook.IsBrowseModeEnabled;
                } catch (Exception ex) {
                    Frontend.ShowException(this, ex);
                }
            };
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key = Gdk.Key.F8;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);

            _ShowMenuBarItem = new Gtk.CheckMenuItem(_("Show _Menubar"));
            _ShowMenuBarItem.Active = true;
            _ShowMenuBarItem.Activated += delegate {
                try {
                    _MenuBar.Visible = !_MenuBar.Visible;
                } catch (Exception ex) {
                    Frontend.ShowException(this, ex);
                }
            };
            menu.Append(_ShowMenuBarItem);

            item = new Gtk.ImageMenuItem(Gtk.Stock.Fullscreen, agrp);
            item.Activated += delegate {
                try {
                    IsFullscreen = !IsFullscreen;
                } catch (Exception ex) {
                    Frontend.ShowException(this, ex);
                }
            };
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key = Gdk.Key.F11;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);

            // Menu - Help
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_Help"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            image_item = new Gtk.ImageMenuItem(Gtk.Stock.About, agrp);
            image_item.Activated += new EventHandler(_OnAboutButtonClicked);
            menu.Append(image_item);

            // TODO: network treeview
            _Notebook = new Notebook();
            _Notebook.SwitchPage += OnNotebookSwitchPage;

            _ChatViewManager = new ChatViewManager(_Notebook, null);
            Assembly asm = Assembly.GetExecutingAssembly();
            _ChatViewManager.Load(asm);
            _ChatViewManager.LoadAll(System.IO.Path.GetDirectoryName(asm.Location),
                                     "smuxi-frontend-gnome-*.dll");
            _ChatViewManager.ChatAdded += OnChatViewManagerChatAdded;
            _ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved;

            #if GTK_SHARP_2_10
            _StatusIconManager = new StatusIconManager(this, _ChatViewManager);
            #endif
            #if INDICATE_SHARP
            _IndicateManager = new IndicateManager(this, _ChatViewManager);
            #endif
            #if NOTIFY_SHARP
            _NotifyManager = new NotifyManager(this, _ChatViewManager);
            #endif

            _UI = new GnomeUI(_ChatViewManager);

            // HACK: Frontend.FrontendConfig out of scope
            _EngineManager = new EngineManager(Frontend.FrontendConfig, _UI);

            _Entry = new Entry(_Notebook);

            _ProgressBar = new Gtk.ProgressBar();

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.PackStart(_MenuBar, false, false, 0);
            vbox.PackStart(_Notebook, true, true, 0);
            vbox.PackStart(_Entry, false, false, 0);

            _NetworkStatusbar = new Gtk.Statusbar();
            _NetworkStatusbar.WidthRequest = 300;
            _NetworkStatusbar.HasResizeGrip = false;

            _Statusbar = new Gtk.Statusbar();
            _Statusbar.HasResizeGrip = false;

            Gtk.HBox status_bar_hbox = new Gtk.HBox();
            status_bar_hbox.Homogeneous = true;
            status_bar_hbox.PackStart(_NetworkStatusbar, false, true, 0);
            status_bar_hbox.PackStart(_Statusbar, true, true, 0);

            Gtk.HBox status_hbox = new Gtk.HBox();
            status_hbox.PackStart(status_bar_hbox);
            status_hbox.PackStart(_ProgressBar, false, false, 0);

            vbox.PackStart(status_hbox, false, false, 0);
            Add(vbox);
        }
Exemplo n.º 5
0
        private void Build()
        {
            global::Stetic.Gui.Initialize(this);
            this.menubar2 = new Gtk.MenuBar();
            Gtk.AccelGroup agrp = new Gtk.AccelGroup ( );
            this.AddAccelGroup (agrp);
            ////////////////////// FILE //////////////////////
            FileAction = new Gtk.MenuItem(messages.Localize("[[window-menu-file]]"));
            FileAction.Submenu = this.FileMenu;
            OpenNewConnectionAction = new Gtk.ImageMenuItem(messages.Localize("[[window-menu-open]]"));
            OpenNewConnectionAction.AddAccelerator("activate", agrp, new Gtk.AccelKey(Gdk.Key.N, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible));
            OpenNewConnectionAction.Image = new Gtk.Image(Gtk.Stock.Connect, Gtk.IconSize.Menu);
            FileAction.Submenu = this.FileMenu;
            FileMenu.Append(OpenNewConnectionAction);
            FileMenu.Append(new Gtk.SeparatorMenuItem());
            FavoriteNetworksAction = new Gtk.ImageMenuItem(messages.Localize("[[window-menu-favorite]]"));
            FileMenu.Append(FavoriteNetworksAction);
            FileMenu.Append(new Gtk.SeparatorMenuItem());
            PreferencesAction = new Gtk.ImageMenuItem(messages.Localize("[[window-menu-conf]]"));
            PreferencesAction.Image = new Gtk.Image(Gtk.Stock.Preferences, Gtk.IconSize.Menu);
            FileMenu.Append(PreferencesAction);
            FileMenu.Append(new Gtk.SeparatorMenuItem());
            ShutDownAction = new Gtk.ImageMenuItem(messages.Localize("[[window-menu-quit]]"));
            FileMenu.Append(ShutDownAction);
            ////////////////////// TOOLS //////////////////////
            ToolsAction = new Gtk.MenuItem(messages.Localize("[[window-menu-tools]]"));
            ToolsAction.Submenu = ToolsMenu;
            PacketViewerAction = new Gtk.MenuItem(messages.Localize("[[window-menu-viewer]]"));
            PacketViewerAction.AddAccelerator("activate", agrp, new Gtk.AccelKey(Gdk.Key.P, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible));
            ToolsMenu.Append(PacketViewerAction);
            SmallChatAction = new Gtk.MenuItem(messages.Localize("[[window-menu-chat]]"));
            ToolsMenu.Append(SmallChatAction);
            ToolsMenu.Append(new Gtk.SeparatorMenuItem());
            AttachToMicroChatAction = new Gtk.ImageMenuItem(messages.Localize("[[window-menu-chat1]]"));
            AttachToMicroChatAction.Image = new Gtk.Image(Gtk.Stock.Add, Gtk.IconSize.Menu);
            AttachToMicroChatAction.AddAccelerator("activate", agrp, new Gtk.AccelKey(Gdk.Key.M, Gdk.ModifierType.Mod1Mask, Gtk.AccelFlags.Visible));
            ToolsMenu.Append(AttachToMicroChatAction);
            DetachFromMicroChatAction = new Gtk.ImageMenuItem(messages.Localize("[[window-menu-chat2]]"));
            DetachFromMicroChatAction.Image = new Gtk.Image(Gtk.Stock.Remove, Gtk.IconSize.Menu);
            DetachFromMicroChatAction.AddAccelerator("activate", agrp, new Gtk.AccelKey(Gdk.Key.D, Gdk.ModifierType.Mod1Mask, Gtk.AccelFlags.Visible));
            ToolsMenu.Append(DetachFromMicroChatAction);
            ////////////////////// MISC //////////////////////
            MiscAction = new Gtk.MenuItem(messages.Localize("[[window-menu-misc]]"));
            MiscAction.Submenu = MiscMenu;
            SearchAction = new Gtk.ImageMenuItem(messages.Localize("[[window-menu-search]]"));
            SearchAction.Image = new Gtk.Image(Gtk.Stock.Find, Gtk.IconSize.Menu);
            SearchAction.AddAccelerator("activate", agrp, new Gtk.AccelKey(Gdk.Key.F, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible));
            MiscMenu.Append(SearchAction);
            LoadMoreToScrollbackAction = new Gtk.ImageMenuItem(messages.Localize("[[window-menu-more]]"));
            LoadMoreToScrollbackAction.AddAccelerator("activate", agrp, new Gtk.AccelKey(Gdk.Key.U, Gdk.ModifierType.Mod1Mask, Gtk.AccelFlags.Visible));
            MiscMenu.Append(LoadMoreToScrollbackAction);
            MiscMenu.Append(new Gtk.SeparatorMenuItem());
            ConfigurationFileAction = new Gtk.MenuItem(messages.Localize("[[window-menu-cf]]"));
            ////////////////////// SHOW //////////////////////
            ShowAction = new Gtk.MenuItem(messages.Localize("[[window-menu-show]]"));
            ShowAction.Submenu = ShowMenu;
            RootAction = new Gtk.MenuItem(messages.Localize("[[window-menu-root]]"));
            ShowMenu.Append(RootAction);
            HelpAction = new Gtk.ImageMenuItem(messages.Localize("[[window-menu-help]]"));
            HelpAction.Submenu = HelpMenu;
            MiscMenu.Append(ConfigurationFileAction);
            AboutAction = new Gtk.ImageMenuItem(messages.Localize("[[window-menu-about]]"));
            AboutAction.Image = new Gtk.Image(Gtk.Stock.About, Gtk.IconSize.Menu);
            ContentsAction = new Gtk.MenuItem(messages.Localize("[[window-menu-contents]]"));
            HelpMenu.Append(AboutAction);
            FavoriteNetworksAction.Sensitive = false;
            ContentsAction.AddAccelerator("activate", agrp, new Gtk.AccelKey(Gdk.Key.F1, Gdk.ModifierType.None, Gtk.AccelFlags.Visible));
            HelpMenu.Append(ContentsAction);
            menubar2.Add(this.FileAction);
            menubar2.Add(this.ToolsAction);
            menubar2.Add(this.MiscAction);
            this.menubar2.Add(this.ShowAction);
            this.menubar2.Add(this.HelpAction);
            this.Name = "Client.Forms.Main";
            this.Title = "Pidgeon Client";
            this.Icon = global::Gdk.Pixbuf.LoadFromResource("Client.Resources.pigeon_clip_art_hight.ico");
            this.WindowPosition = ((global::Gtk.WindowPosition)(4));
            // Container child Client.Forms.Main.Gtk.Container+ContainerChild
            this.vbox3 = new global::Gtk.VBox();
            this.vbox3.Name = "vbox3";
            this.vbox3.Spacing = 6;
            // Container child vbox3.Gtk.Box+BoxChild
            this.menubar2.Name = "menubar2";
            this.vbox3.Add(this.menubar2);
            global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.menubar2]));
            w2.Position = 0;
            w2.Expand = false;
            w2.Fill = false;
            // Container child vbox3.Gtk.Box+BoxChild
            this.hpaned1 = new global::Gtk.HPaned();
            this.hpaned1.CanFocus = true;
            this.hpaned1.Name = "hpaned1";
            this.hpaned1.Position = 183;
            // Container child hpaned1.Gtk.Paned+PanedChild
            this.pidgeonlist1 = new global::Client.Graphics.PidgeonList();
            this.pidgeonlist1.Events = ((global::Gdk.EventMask)(256));
            this.pidgeonlist1.Name = "pidgeonlist1";

            this.hpaned1.Add(this.pidgeonlist1);
            global::Gtk.Paned.PanedChild w3 = ((global::Gtk.Paned.PanedChild)(this.hpaned1[this.pidgeonlist1]));
            w3.Resize = false;
            this.vbox3.Add(this.hpaned1);
            global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.hpaned1]));
            w4.Position = 1;
            // Container child vbox3.Gtk.Box+BoxChild
            this.toolStrip = new global::Gtk.Statusbar();
            this.toolStrip.Name = "toolStrip";
            this.toolStrip.Spacing = 6;
            // Container child toolStrip.Gtk.Box+BoxChild
            this.toolStripStatusNetwork = new global::Gtk.Label();
            this.toolStripStatusNetwork.Name = "toolStripStatusNetwork";
            this.toolStrip.Add(this.toolStripStatusNetwork);
            global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.toolStrip[this.toolStripStatusNetwork]));
            w5.Position = 0;
            w5.Expand = false;
            w5.Fill = false;
            // Container child toolStrip.Gtk.Box+BoxChild
            this.toolStripStatusChannel = new global::Gtk.Label();
            this.toolStripStatusChannel.Name = "toolStripStatusChannel";
            this.toolStrip.Add(this.toolStripStatusChannel);
            global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.toolStrip[this.toolStripStatusChannel]));
            w6.Position = 1;
            w6.Expand = false;
            w6.Fill = false;
            // Container child toolStrip.Gtk.Box+BoxChild
            this.toolStripInfo = new global::Gtk.Label();
            this.toolStripInfo.Name = "toolStripInfo";
            this.toolStrip.Add(this.toolStripInfo);
            global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.toolStrip[this.toolStripInfo]));
            w7.Position = 3;
            w7.Expand = false;
            w7.Fill = false;
            // Container child toolStrip.Gtk.Box+BoxChild
            this.toolStripProgressBar1 = new global::Gtk.ProgressBar();
            this.toolStripProgressBar1.Name = "toolStripProgressBar1";
            this.toolStrip.Add(this.toolStripProgressBar1);
            global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.toolStrip[this.toolStripProgressBar1]));
            w8.Position = 4;
            this.vbox3.Add(this.toolStrip);
            global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.toolStrip]));
            w9.Position = 2;
            w9.Expand = false;
            w9.Fill = false;
            this.Add(this.vbox3);
            if ((this.Child != null))
            {
                this.Child.ShowAll();
            }
            this.DefaultWidth = 1018;
            this.DefaultHeight = 600;
            this.Show();
            this.DeleteEvent += new global::Gtk.DeleteEventHandler(this.Unshow);
            this.ShutDownAction.Activated += new global::System.EventHandler(this.shutDownToolStripMenuItem_Click);
            this.AboutAction.Activated += new global::System.EventHandler(this.aboutToolStripMenuItem_Click);
            this.OpenNewConnectionAction.Activated += new global::System.EventHandler(this.newConnectionToolStripMenuItem_Click_1);
            this.PreferencesAction.Activated += new global::System.EventHandler(this.preferencesToolStripMenuItem_Click);
            this.PacketViewerAction.Activated += new global::System.EventHandler(this.toolStripMenuItem3_Click);
            this.SmallChatAction.Activated += new global::System.EventHandler(this.taskbarBoxToolStripMenuItem_Click);
            this.AttachToMicroChatAction.Activated += new global::System.EventHandler(this.attachToMicroChatToolStripMenuItem_Click);
            this.DetachFromMicroChatAction.Activated += new global::System.EventHandler(this.detachFromMicroChatToolStripMenuItem_Click);
        }
Exemplo n.º 6
0
        public MainWindow()
            : base("Smuxi")
        {
            // restore window size / position
            int width, heigth;
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"] != null) {
                width  = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"];
            } else {
                width = 800;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"] != null) {
                heigth = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"];
            } else {
                heigth = 600;
            }
            if (width < -1 || heigth < -1) {
                width = -1;
                heigth = -1;
            }
            if (width == -1 && heigth == -1) {
                SetDefaultSize(800, 600);
                Maximize();
            } else if (width == 0 && heigth == 0) {
                // HACK: map 0/0 to default size as it crashes on Windows :/
                SetDefaultSize(800, 600);
            } else {
                SetDefaultSize(width, heigth);
            }

            int x, y;
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"] != null) {
                x = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"];
            } else {
                x = 0;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"] != null) {
                y = (int) Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"];
            } else {
                y = 0;
            }
            if (x < 0 || y < 0) {
                x = 0;
                y = 0;
            }
            if (x == 0 && y == 0) {
                SetPosition(Gtk.WindowPosition.Center);
            } else {
                Move(x, y);
            }

            DeleteEvent += OnDeleteEvent;
            FocusInEvent += OnFocusInEvent;
            FocusOutEvent += OnFocusOutEvent;
            WindowStateEvent += OnWindowStateEvent;

            Gtk.AccelGroup agrp = new Gtk.AccelGroup();
            Gtk.AccelKey   akey;
            AddAccelGroup(agrp);

            // Menu
            MenuBar = new Gtk.MenuBar();
            Gtk.Menu menu;
            Gtk.MenuItem item;
            Gtk.ImageMenuItem image_item;

            // Menu - File
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_File"));
            item.Submenu = menu;
            MenuBar.Append(item);

            item = new Gtk.ImageMenuItem(Gtk.Stock.Preferences, agrp);
            item.Activated += new EventHandler(_OnPreferencesButtonClicked);
            item.AccelCanActivate += AccelCanActivateSensitive;
            menu.Append(item);

            menu.Append(new Gtk.SeparatorMenuItem());

            item = new Gtk.ImageMenuItem(Gtk.Stock.Quit, agrp);
            item.Activated += new EventHandler(_OnQuitButtonClicked);
            item.AccelCanActivate += AccelCanActivateSensitive;
            menu.Append(item);

            // Menu - Server
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_Server"));
            item.Submenu = menu;
            MenuBar.Append(item);

            image_item = new Gtk.ImageMenuItem(_("_Quick Connect"));
            image_item.Image = new Gtk.Image(Gtk.Stock.Connect, Gtk.IconSize.Menu);
            image_item.Activated += OnServerQuickConnectButtonClicked;
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item = new Gtk.ImageMenuItem(Gtk.Stock.Add, agrp);
            image_item.Activated += OnServerAddButtonClicked;
            menu.Append(image_item);

            image_item = new Gtk.ImageMenuItem(_("_Manage"));
            image_item.Image = new Gtk.Image(Gtk.Stock.Edit, Gtk.IconSize.Menu);
            image_item.Activated += OnServerManageServersButtonClicked;
            menu.Append(image_item);

            // Menu - Chat
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_Chat"));
            item.Submenu = menu;
            MenuBar.Append(item);

            _OpenChatMenuItem = new Gtk.ImageMenuItem(_("Open / Join Chat"));
            _OpenChatMenuItem.Image = new Gtk.Image(Gtk.Stock.Open, Gtk.IconSize.Menu);
            _OpenChatMenuItem.Activated += OnOpenChatMenuItemActivated;
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods = Gdk.ModifierType.ControlMask;
            akey.Key = Gdk.Key.L;
            _OpenChatMenuItem.AddAccelerator("activate", agrp, akey);
            _OpenChatMenuItem.AccelCanActivate += AccelCanActivateSensitive;
            menu.Append(_OpenChatMenuItem);

            _FindGroupChatMenuItem = new Gtk.ImageMenuItem(_("_Find Group Chat"));
            _FindGroupChatMenuItem.Image = new Gtk.Image(Gtk.Stock.Find, Gtk.IconSize.Menu);
            _FindGroupChatMenuItem.Activated += OnChatFindGroupChatButtonClicked;
            _FindGroupChatMenuItem.Sensitive = false;
            menu.Append(_FindGroupChatMenuItem);

            image_item = new Gtk.ImageMenuItem(_("C_lear All Activity"));
            image_item.Image = new Gtk.Image(Gtk.Stock.Clear, Gtk.IconSize.Menu);
            image_item.Activated += OnChatClearAllActivityButtonClicked;
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item = new Gtk.ImageMenuItem(_("_Next Chat"));
            image_item.Image = new Gtk.Image(Gtk.Stock.GoForward, Gtk.IconSize.Menu);
            image_item.Activated += OnNextChatMenuItemActivated;
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods = Gdk.ModifierType.ControlMask;
            akey.Key = Gdk.Key.Page_Down;
            image_item.AddAccelerator("activate", agrp, akey);
            image_item.AccelCanActivate += AccelCanActivateSensitive;
            menu.Append(image_item);

            image_item = new Gtk.ImageMenuItem(_("_Previous Chat"));
            image_item.Image = new Gtk.Image(Gtk.Stock.GoBack, Gtk.IconSize.Menu);
            image_item.Activated += OnPreviousChatMenuItemActivated;
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods = Gdk.ModifierType.ControlMask;
            akey.Key = Gdk.Key.Page_Up;
            image_item.AddAccelerator("activate", agrp, akey);
            image_item.AccelCanActivate += AccelCanActivateSensitive;
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            /*
            // TODO: make a radio item for each chat hotkey
            Gtk.RadioMenuItem radio_item;
            radio_item = new Gtk.RadioMenuItem();
            radio_item = new Gtk.RadioMenuItem(radio_item);
            radio_item = new Gtk.RadioMenuItem(radio_item);

            menu.Append(new Gtk.SeparatorMenuItem());
            */

            /*
            image_item = new Gtk.ImageMenuItem(Gtk.Stock.Find, agrp);
            image_item.Activated += OnFindChatMenuItemActivated;
            menu.Append(image_item);

            item = new Gtk.MenuItem(_("Find _Next"));
            item.Activated += OnFindNextChatMenuItemActivated;
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods = Gdk.ModifierType.ControlMask;
            akey.Key = Gdk.Key.G;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);

            item = new Gtk.MenuItem(_("Find _Previous"));
            item.Activated += OnFindPreviousChatMenuItemActivated;
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods = Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask;
            akey.Key = Gdk.Key.G;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);
            */

            // ROFL: the empty code statement below is needed to keep stupid
            // gettext away from using all the commented code from above as
            // translator comment
            ;
            _OpenLogChatMenuItem = new Gtk.ImageMenuItem(_("Open Log"));
            _OpenLogChatMenuItem.Image = new Gtk.Image(Gtk.Stock.Open,
                                                       Gtk.IconSize.Menu);
            _OpenLogChatMenuItem.Activated += OnOpenLogChatMenuItemActivated;
            _OpenLogChatMenuItem.Sensitive = false;
            _OpenLogChatMenuItem.NoShowAll = true;
            menu.Append(_OpenLogChatMenuItem);

            _CloseChatMenuItem = new Gtk.ImageMenuItem(Gtk.Stock.Close, agrp);
            _CloseChatMenuItem.Activated += OnCloseChatMenuItemActivated;
            _CloseChatMenuItem.AccelCanActivate += AccelCanActivateSensitive;
            menu.Append(_CloseChatMenuItem);

            // Menu - Engine
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_Engine"));
            item.Submenu = menu;
            MenuBar.Append(item);

            item = new Gtk.MenuItem(_("_Use Local Engine"));
            item.Activated += new EventHandler(_OnUseLocalEngineButtonClicked);
            menu.Append(item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item = new Gtk.ImageMenuItem(_("_Add Remote Engine"));
            image_item.Image = new Gtk.Image(Gtk.Stock.Add, Gtk.IconSize.Menu);
            image_item.Activated += new EventHandler(_OnAddRemoteEngineButtonClicked);
            menu.Append(image_item);

            image_item = new Gtk.ImageMenuItem(_("_Switch Remote Engine"));
            image_item.Image = new Gtk.Image(Gtk.Stock.Refresh, Gtk.IconSize.Menu);
            image_item.Activated += new EventHandler(_OnSwitchRemoteEngineButtonClicked);
            menu.Append(image_item);

            // Menu - View
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_View"));
            item.Submenu = menu;
            MenuBar.Append(item);

            item = new Gtk.CheckMenuItem(_("_Caret Mode"));
            item.Activated += new EventHandler(_OnCaretModeButtonClicked);
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key = Gdk.Key.F7;
            item.AddAccelerator("activate", agrp, akey);
            item.AccelCanActivate += AccelCanActivateSensitive;
            menu.Append(item);

            item = new Gtk.CheckMenuItem(_("_Browse Mode"));
            item.Activated += delegate {
                try {
                    _Notebook.IsBrowseModeEnabled = !_Notebook.IsBrowseModeEnabled;
                } catch (Exception ex) {
                    Frontend.ShowException(this, ex);
                }
            };
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key = Gdk.Key.F8;
            item.AddAccelerator("activate", agrp, akey);
            item.AccelCanActivate += AccelCanActivateSensitive;
            menu.Append(item);

            ShowMenuBarMenuItem = new Gtk.CheckMenuItem(_("Show _Menubar"));
            ShowMenuBarMenuItem.Active = (bool) Frontend.FrontendConfig["ShowMenuBar"];
            ShowMenuBarMenuItem.Activated += OnShowMenuBarMenuItemActivated;
            menu.Append(ShowMenuBarMenuItem);

            ShowStatusBarMenuItem = new Gtk.CheckMenuItem(_("Show _Status Bar"));
            ShowStatusBarMenuItem.Active = (bool) Frontend.FrontendConfig["ShowStatusBar"];
            ShowStatusBarMenuItem.Activated += OnShowStatusBarMenuItemActivated;
            menu.Append(ShowStatusBarMenuItem);

            JoinWidget = new JoinWidget();
            JoinWidget.NoShowAll = true;
            JoinWidget.Visible = (bool) Frontend.FrontendConfig["ShowQuickJoin"];
            JoinWidget.Activated += OnJoinWidgetActivated;

            ShowQuickJoinMenuItem = new Gtk.CheckMenuItem(_("Show _Quick Join"));
            ShowQuickJoinMenuItem.Active = JoinWidget.Visible;
            ShowQuickJoinMenuItem.Activated += OnShowQuickJoinMenuItemActivated;
            menu.Append(ShowQuickJoinMenuItem);

            item = new Gtk.ImageMenuItem(Gtk.Stock.Fullscreen, agrp);
            item.Activated += delegate {
                try {
                    IsFullscreen = !IsFullscreen;
                } catch (Exception ex) {
                    Frontend.ShowException(this, ex);
                }
            };
            akey = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key = Gdk.Key.F11;
            item.AddAccelerator("activate", agrp, akey);
            item.AccelCanActivate += AccelCanActivateSensitive;
            menu.Append(item);

            // Menu - Help
            menu = new Gtk.Menu();
            item = new Gtk.MenuItem(_("_Help"));
            item.Submenu = menu;
            MenuBar.Append(item);

            image_item = new Gtk.ImageMenuItem(Gtk.Stock.About, agrp);
            image_item.Activated += new EventHandler(_OnAboutButtonClicked);
            menu.Append(image_item);

            MenuBar.ShowAll();
            MenuBar.NoShowAll = true;
            MenuBar.Visible = ShowMenuBarMenuItem.Active;

            // TODO: network treeview
            _Notebook = new Notebook();
            _Notebook.SwitchPage += OnNotebookSwitchPage;
            _Notebook.FocusInEvent += OnNotebookFocusInEvent;

            _ChatViewManager = new ChatViewManager(_Notebook, null);
            Assembly asm = Assembly.GetExecutingAssembly();
            _ChatViewManager.Load(asm);
            _ChatViewManager.LoadAll(System.IO.Path.GetDirectoryName(asm.Location),
                                     "smuxi-frontend-gnome-*.dll");
            _ChatViewManager.ChatAdded += OnChatViewManagerChatAdded;
            _ChatViewManager.ChatSynced += OnChatViewManagerChatSynced;
            _ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved;

            #if GTK_SHARP_2_10
            _StatusIconManager = new StatusIconManager(this, _ChatViewManager);
            #endif
            #if INDICATE_SHARP
            _IndicateManager = new IndicateManager(this, _ChatViewManager);
            #endif
            #if NOTIFY_SHARP
            _NotifyManager = new NotifyManager(this, _ChatViewManager);
            #endif
            #if IPC_DBUS
            _NetworkManager = new NetworkManager(_ChatViewManager);
            #endif

            _UI = new GnomeUI(_ChatViewManager);

            // HACK: Frontend.FrontendConfig out of scope
            _EngineManager = new EngineManager(Frontend.FrontendConfig, _UI);

            _Entry = new Entry(_ChatViewManager);
            var entryScrolledWindow = new Gtk.ScrolledWindow();
            entryScrolledWindow.ShadowType = Gtk.ShadowType.EtchedIn;
            entryScrolledWindow.HscrollbarPolicy = Gtk.PolicyType.Never;
            entryScrolledWindow.SizeRequested += delegate(object o, Gtk.SizeRequestedArgs args) {
                // predict and set useful heigth
                var layout = _Entry.CreatePangoLayout("Qp");
                int lineWidth, lineHeigth;
                layout.GetPixelSize(out lineHeigth, out lineHeigth);
                var text = Entry.Text;
                var newLines = text.Count(f => f == '\n');
                // cap to 1-3 lines
                if (text.Length > 0) {
                    newLines++;
                    newLines = Math.Max(newLines, 1);
                    newLines = Math.Min(newLines, 3);
                } else {
                    newLines = 1;
                }
                // use text heigth + a bit extra
                var bestSize = new Gtk.Requisition() {
                    Height = (lineHeigth * newLines) + 5
                };
                args.Requisition = bestSize;
            };
            entryScrolledWindow.Add(_Entry);

            _ProgressBar = new Gtk.ProgressBar();
            _ProgressBar.BarStyle = Gtk.ProgressBarStyle.Continuous;

            MenuHBox = new Gtk.HBox();
            MenuHBox.PackStart(MenuBar, false, false, 0);
            MenuHBox.PackEnd(JoinWidget, false, false, 0);

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.PackStart(MenuHBox, false, false, 0);
            vbox.PackStart(_Notebook, true, true, 0);
            vbox.PackStart(entryScrolledWindow, false, false, 0);

            _NetworkStatusbar = new Gtk.Statusbar();
            _NetworkStatusbar.WidthRequest = 300;
            _NetworkStatusbar.HasResizeGrip = false;

            _Statusbar = new Gtk.Statusbar();
            _Statusbar.HasResizeGrip = false;

            Gtk.HBox status_bar_hbox = new Gtk.HBox();
            status_bar_hbox.Homogeneous = true;
            status_bar_hbox.PackStart(_NetworkStatusbar, false, true, 0);
            status_bar_hbox.PackStart(_Statusbar, true, true, 0);

            StatusHBox = new Gtk.HBox();
            StatusHBox.PackStart(status_bar_hbox);
            StatusHBox.PackStart(_ProgressBar, false, false, 0);
            StatusHBox.ShowAll();
            StatusHBox.NoShowAll = true;
            StatusHBox.Visible = ShowStatusBarMenuItem.Active;

            vbox.PackStart(StatusHBox, false, false, 0);
            Add(vbox);
        }
Exemplo n.º 7
0
        public MainWindow() : base("Smuxi")
        {
            // restore window size / position
            int width, heigth;

            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"] != null)
            {
                width = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"];
            }
            else
            {
                width = 800;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"] != null)
            {
                heigth = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"];
            }
            else
            {
                heigth = 600;
            }
            if (width < -1 || heigth < -1)
            {
                width  = -1;
                heigth = -1;
            }
            if (width == -1 && heigth == -1)
            {
                SetDefaultSize(800, 600);
                Maximize();
            }
            else if (width == 0 && heigth == 0)
            {
                // HACK: map 0/0 to default size as it crashes on Windows :/
                SetDefaultSize(800, 600);
            }
            else
            {
                SetDefaultSize(width, heigth);
            }

            int x, y;

            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"] != null)
            {
                x = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"];
            }
            else
            {
                x = 0;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"] != null)
            {
                y = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"];
            }
            else
            {
                y = 0;
            }
            if (x < 0 || y < 0)
            {
                x = 0;
                y = 0;
            }
            if (x == 0 && y == 0)
            {
                SetPosition(Gtk.WindowPosition.Center);
            }
            else
            {
                Move(x, y);
            }

            DeleteEvent      += OnDeleteEvent;
            FocusInEvent     += OnFocusInEvent;
            FocusOutEvent    += OnFocusOutEvent;
            WindowStateEvent += OnWindowStateEvent;

            Gtk.AccelGroup agrp = new Gtk.AccelGroup();
            Gtk.AccelKey   akey;
            AddAccelGroup(agrp);

            // Menu
            _MenuBar = new Gtk.MenuBar();
            Gtk.Menu          menu;
            Gtk.MenuItem      item;
            Gtk.ImageMenuItem image_item;

            // Menu - File
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_File"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            item            = new Gtk.ImageMenuItem(Gtk.Stock.Preferences, agrp);
            item.Activated += new EventHandler(_OnPreferencesButtonClicked);
            menu.Append(item);

            menu.Append(new Gtk.SeparatorMenuItem());

            item            = new Gtk.ImageMenuItem(Gtk.Stock.Quit, agrp);
            item.Activated += new EventHandler(_OnQuitButtonClicked);
            menu.Append(item);

            // Menu - Server
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_Server"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            image_item            = new Gtk.ImageMenuItem(_("_Quick Connect"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.Connect, Gtk.IconSize.Menu);
            image_item.Activated += OnServerQuickConnectButtonClicked;
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item            = new Gtk.ImageMenuItem(Gtk.Stock.Add, agrp);
            image_item.Activated += OnServerAddButtonClicked;
            menu.Append(image_item);

            image_item            = new Gtk.ImageMenuItem(_("_Manage"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.Edit, Gtk.IconSize.Menu);
            image_item.Activated += OnServerManageServersButtonClicked;
            menu.Append(image_item);

            // Menu - Chat
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_Chat"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            _OpenChatMenuItem            = new Gtk.ImageMenuItem(_("Open / Join Chat"));
            _OpenChatMenuItem.Image      = new Gtk.Image(Gtk.Stock.Open, Gtk.IconSize.Menu);
            _OpenChatMenuItem.Activated += OnChatOpenChatButtonClicked;
            _OpenChatMenuItem.Sensitive  = false;
            menu.Append(_OpenChatMenuItem);

            _FindGroupChatMenuItem            = new Gtk.ImageMenuItem(_("_Find Group Chat"));
            _FindGroupChatMenuItem.Image      = new Gtk.Image(Gtk.Stock.Find, Gtk.IconSize.Menu);
            _FindGroupChatMenuItem.Activated += OnChatFindGroupChatButtonClicked;
            _FindGroupChatMenuItem.Sensitive  = false;
            menu.Append(_FindGroupChatMenuItem);

            image_item            = new Gtk.ImageMenuItem(_("C_lear All Activity"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.Clear, Gtk.IconSize.Menu);
            image_item.Activated += OnChatClearAllActivityButtonClicked;
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item            = new Gtk.ImageMenuItem(_("_Next Chat"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.GoForward, Gtk.IconSize.Menu);
            image_item.Activated += OnNextChatMenuItemActivated;
            akey            = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods  = Gdk.ModifierType.ControlMask;
            akey.Key        = Gdk.Key.Page_Down;
            image_item.AddAccelerator("activate", agrp, akey);
            menu.Append(image_item);

            image_item            = new Gtk.ImageMenuItem(_("_Previous Chat"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.GoBack, Gtk.IconSize.Menu);
            image_item.Activated += OnPreviousChatMenuItemActivated;
            akey            = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods  = Gdk.ModifierType.ControlMask;
            akey.Key        = Gdk.Key.Page_Up;
            image_item.AddAccelerator("activate", agrp, akey);
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            /*
             * // TODO: make a radio item for each chat hotkey
             * Gtk.RadioMenuItem radio_item;
             * radio_item = new Gtk.RadioMenuItem();
             * radio_item = new Gtk.RadioMenuItem(radio_item);
             * radio_item = new Gtk.RadioMenuItem(radio_item);
             *
             * menu.Append(new Gtk.SeparatorMenuItem());
             */

            /*
             * image_item = new Gtk.ImageMenuItem(Gtk.Stock.Find, agrp);
             * image_item.Activated += OnFindChatMenuItemActivated;
             * menu.Append(image_item);
             *
             * item = new Gtk.MenuItem(_("Find _Next"));
             * item.Activated += OnFindNextChatMenuItemActivated;
             * akey = new Gtk.AccelKey();
             * akey.AccelFlags = Gtk.AccelFlags.Visible;
             * akey.AccelMods = Gdk.ModifierType.ControlMask;
             * akey.Key = Gdk.Key.G;
             * item.AddAccelerator("activate", agrp, akey);
             * menu.Append(item);
             *
             * item = new Gtk.MenuItem(_("Find _Previous"));
             * item.Activated += OnFindPreviousChatMenuItemActivated;
             * akey = new Gtk.AccelKey();
             * akey.AccelFlags = Gtk.AccelFlags.Visible;
             * akey.AccelMods = Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask;
             * akey.Key = Gdk.Key.G;
             * item.AddAccelerator("activate", agrp, akey);
             * menu.Append(item);
             */

            // ROFL: the empty code statement below is needed to keep stupid
            // gettext away from using all the commented code from above as
            // translator comment
            ;
            _OpenLogChatMenuItem       = new Gtk.ImageMenuItem(_("Open Log"));
            _OpenLogChatMenuItem.Image = new Gtk.Image(Gtk.Stock.Open,
                                                       Gtk.IconSize.Menu);
            _OpenLogChatMenuItem.Activated += OnOpenLogChatMenuItemActivated;
            _OpenLogChatMenuItem.Sensitive  = false;
            _OpenLogChatMenuItem.NoShowAll  = true;
            menu.Append(_OpenLogChatMenuItem);

            _CloseChatMenuItem            = new Gtk.ImageMenuItem(Gtk.Stock.Close, agrp);
            _CloseChatMenuItem.Activated += OnCloseChatMenuItemActivated;
            menu.Append(_CloseChatMenuItem);

            // Menu - Engine
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_Engine"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            item            = new Gtk.MenuItem(_("_Use Local Engine"));
            item.Activated += new EventHandler(_OnUseLocalEngineButtonClicked);
            menu.Append(item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item            = new Gtk.ImageMenuItem(_("_Add Remote Engine"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.Add, Gtk.IconSize.Menu);
            image_item.Activated += new EventHandler(_OnAddRemoteEngineButtonClicked);
            menu.Append(image_item);

            image_item            = new Gtk.ImageMenuItem(_("_Switch Remote Engine"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.Refresh, Gtk.IconSize.Menu);
            image_item.Activated += new EventHandler(_OnSwitchRemoteEngineButtonClicked);
            menu.Append(image_item);

            // Menu - View
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_View"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            item            = new Gtk.CheckMenuItem(_("_Caret Mode"));
            item.Activated += new EventHandler(_OnCaretModeButtonClicked);
            akey            = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key        = Gdk.Key.F7;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);

            item            = new Gtk.CheckMenuItem(_("_Browse Mode"));
            item.Activated += delegate {
                try {
                    _Notebook.IsBrowseModeEnabled = !_Notebook.IsBrowseModeEnabled;
                } catch (Exception ex) {
                    Frontend.ShowException(this, ex);
                }
            };
            akey            = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key        = Gdk.Key.F8;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);

            _ShowMenuBarItem            = new Gtk.CheckMenuItem(_("Show _Menubar"));
            _ShowMenuBarItem.Active     = true;
            _ShowMenuBarItem.Activated += delegate {
                try {
                    _MenuBar.Visible = !_MenuBar.Visible;
                } catch (Exception ex) {
                    Frontend.ShowException(this, ex);
                }
            };
            menu.Append(_ShowMenuBarItem);

            item            = new Gtk.ImageMenuItem(Gtk.Stock.Fullscreen, agrp);
            item.Activated += delegate {
                try {
                    IsFullscreen = !IsFullscreen;
                } catch (Exception ex) {
                    Frontend.ShowException(this, ex);
                }
            };
            akey            = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key        = Gdk.Key.F11;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);

            // Menu - Help
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_Help"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            image_item            = new Gtk.ImageMenuItem(Gtk.Stock.About, agrp);
            image_item.Activated += new EventHandler(_OnAboutButtonClicked);
            menu.Append(image_item);

            // TODO: network treeview
            _Notebook             = new Notebook();
            _Notebook.SwitchPage += OnNotebookSwitchPage;

            _ChatViewManager = new ChatViewManager(_Notebook, null);
            Assembly asm = Assembly.GetExecutingAssembly();

            _ChatViewManager.Load(asm);
            _ChatViewManager.LoadAll(System.IO.Path.GetDirectoryName(asm.Location),
                                     "smuxi-frontend-gnome-*.dll");
            _ChatViewManager.ChatAdded   += OnChatViewManagerChatAdded;
            _ChatViewManager.ChatSynced  += OnChatViewManagerChatSynced;
            _ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved;

#if GTK_SHARP_2_10
            _StatusIconManager = new StatusIconManager(this, _ChatViewManager);
#endif
#if INDICATE_SHARP
            _IndicateManager = new IndicateManager(this, _ChatViewManager);
#endif
#if NOTIFY_SHARP
            _NotifyManager = new NotifyManager(this, _ChatViewManager);
#endif
#if IPC_DBUS
            _NetworkManager = new NetworkManager(_ChatViewManager);
#endif

            _UI = new GnomeUI(_ChatViewManager);

            // HACK: Frontend.FrontendConfig out of scope
            _EngineManager = new EngineManager(Frontend.FrontendConfig, _UI);

            _Entry = new Entry(_ChatViewManager);

            _ProgressBar          = new Gtk.ProgressBar();
            _ProgressBar.BarStyle = Gtk.ProgressBarStyle.Continuous;

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.PackStart(_MenuBar, false, false, 0);
            vbox.PackStart(_Notebook, true, true, 0);
            vbox.PackStart(_Entry, false, false, 0);

            _NetworkStatusbar = new Gtk.Statusbar();
            _NetworkStatusbar.WidthRequest  = 300;
            _NetworkStatusbar.HasResizeGrip = false;

            _Statusbar = new Gtk.Statusbar();
            _Statusbar.HasResizeGrip = false;

            Gtk.HBox status_bar_hbox = new Gtk.HBox();
            status_bar_hbox.Homogeneous = true;
            status_bar_hbox.PackStart(_NetworkStatusbar, false, true, 0);
            status_bar_hbox.PackStart(_Statusbar, true, true, 0);

            Gtk.HBox status_hbox = new Gtk.HBox();
            status_hbox.PackStart(status_bar_hbox);
            status_hbox.PackStart(_ProgressBar, false, false, 0);

            vbox.PackStart(status_hbox, false, false, 0);
            Add(vbox);
        }