Esempio n. 1
0
        private void AddTemplate(Gtk.Menu menu, Wrappers.Wrapper template)
        {
            if (!(d_filter == null || d_filter(template) || (template is Wrappers.Node && d_recursive)))
            {
                return;
            }

            string lbl = template.FullId.Replace("_", "__");

            Gtk.MenuItem item = new Gtk.MenuItem(lbl);
            item.Show();

            item.Activated += delegate {
                if (item.Submenu == null)
                {
                    Activated(this, template);
                }
            };

            menu.Append(item);

            d_map[template] = new MenuInfo(item, menu);

            if (d_recursive && template is Wrappers.Node)
            {
                Gtk.Menu sub = new Gtk.Menu();
                item.Submenu = sub;

                Traverse((Wrappers.Node)template, sub);
            }

            template.WrappedObject.AddNotification("id", HandleIdChanged);
        }
            public GameDBPlugin()
                : base("gamedb",
						     Catalog.
						     GetString
						     ("Games Database Plugin"),
						     Catalog.
						     GetString
						     ("Game database"))
            {
                saveItem = new MenuItem (Catalog.
                             GetString
                             ("Add Games to _Database"));
                saveItem.Activated += on_add_to_db_activate;
                saveItem.Show ();

                /*
                   openDbItem = new MenuItem (Catalog.
                   GetString
                   ("Games _Database"));

                   openDbItem.Activated +=
                   on_open_games_db_activate;
                   openDbItem.Show ();
                 */
            }
Esempio n. 3
0
 public override void Hook_Initialise(Forms.Main main)
 {
     menu = new Gtk.MenuItem("Display ignored text");
     collector = new Graphics.Window();
     collector.CreateChat(null, false, false, false);
     menu.Activated += new EventHandler(Display);
     collector.WindowName = "Ignored";
     main.ToolsMenu.Append(menu);
     menu.Show();
 }
        public override void OnNoteOpened()
        {
            // Add the menu item when the window is created.
            menu_item = new Gtk.MenuItem (
                Catalog.GetString ("Note Statistics"));

            menu_item.Activated += OnMenuItemActivated;

            menu_item.Show ();
            AddPluginMenuItem (menu_item);
        }
 public override void OnNoteOpened()
 {
     if (this.Note.Title.StartsWith("GTD")) {
         item = new Gtk.MenuItem("Update Tasks");
         item.Activated += OnMenuItemActivated;
         item.AddAccelerator ("activate", Window.AccelGroup,
             (uint) Gdk.Key.d, Gdk.ModifierType.ControlMask,
             Gtk.AccelFlags.Visible);
         item.Show ();
         AddPluginMenuItem (item);
     }
 }
Esempio n. 6
0
 public override void Hook_Initialise(Forms.Main main)
 {
     _m = main;
     item = new Gtk.MenuItem("#pidgeon");
     item.Activated += new EventHandler(pidgeonToolStripMenuItem_Click);
     separator = new Gtk.SeparatorMenuItem();
     main.HelpMenu.Append(separator);
     main.HelpMenu.Append(item);
     separator.Show();
     item.Show();
     Core.DebugLog("Registered #pidgeon in menu");
 }
        public void Initialize(IPadWindow window)
        {
            //
            // Handle normal input
            //
            view.ConsoleInput += HandleConsoleInput;

            //
            // Setup Ctrl + / as the interrupt handler
            //
            view.Child.KeyPressEvent += (o, args) => {
                if ((args.Event.State & ModifierType.ControlMask) == ModifierType.ControlMask &&
                    args.Event.Key == Key.slash)
                {
                    if (session != null)
                    {
                        session.Interrupt();
                    }
                }
            };

            //
            // Watch the active doc
            //
            IdeApp.Workbench.ActiveDocumentChanged += HandleActiveDocumentChanged;

            //
            //
            //
            UpdateFont();
            UpdateColors();
            view.ShadowType = Gtk.ShadowType.None;
            view.ShowAll();

            //
            // Add a Restart item to the pop up menu
            //
            var v = view.Child as Gtk.TextView;

            if (v != null)
            {
                v.PopulatePopup += (o, args) => {
                    var item = new Gtk.MenuItem(GettextCatalog.GetString("Reset"));
                    item.Activated += (sender, e) => RestartCsi();
                    item.Show();
                    args.Menu.Add(item);
                };
            }

            //
            // Create the toolbar
            //
        }
Esempio n. 8
0
        public static void Create(Tag [] tags, Gtk.Menu menu)
        {
            var findWithString = Catalog.GetPluralString ("Find _With", "Find _With", tags.Length);
            var item = new Gtk.MenuItem (String.Format (findWithString, tags.Length));

            Gtk.Menu submenu = GetSubmenu (tags);
            if (submenu == null)
                item.Sensitive = false;
            else
                item.Submenu = submenu;

            menu.Append (item);
            item.Show ();
        }
Esempio n. 9
0
 public override void Hook_BeforeTextMenu(Extension.ScrollbackArgs Args)
 {
     text = Args.scrollback.SelectedText;
     Gtk.SeparatorMenuItem xx = new Gtk.SeparatorMenuItem();
     xx.Show();
     Args.menu.Add(xx);
     Gtk.MenuItem wiki = new Gtk.MenuItem("Search using wiki");
     wiki.Activated += new EventHandler(SearchWiki);
     wiki.Show();
     Args.menu.Add(wiki);
     Gtk.MenuItem goog = new Gtk.MenuItem("Search using google");
     goog.Show();
     goog.Activated += new EventHandler(SearchGoogle);
     Args.menu.Add(goog);
 }
Esempio n. 10
0
        public void AddAccelerator(EventHandler handler,
                                   uint key,
                                   Gdk.ModifierType modifiers,
                                   Gtk.AccelFlags flags)
        {
            Gtk.MenuItem foo = new Gtk.MenuItem();
            foo.Activated += handler;
            foo.AddAccelerator("activate",
                               accel_group,
                               key,
                               modifiers,
                               flags);
            foo.Show();

            fake_menu.Append(foo);
        }
Esempio n. 11
0
        public override void OnNoteOpened()
        {
            // Add the menu item when the window is created
            item = new Gtk.MenuItem(
                Catalog.GetString("Insert Timestamp"));
            item.Activated += OnMenuItemActivated;
            item.AddAccelerator("activate", Window.AccelGroup,
                                (uint)Gdk.Key.d, Gdk.ModifierType.ControlMask,
                                Gtk.AccelFlags.Visible);
            item.Show();
            AddPluginMenuItem(item);

            // Get the format from GConf and subscribe to changes
            date_format = (string)Preferences.Get(
                Preferences.INSERT_TIMESTAMP_FORMAT);
            Preferences.SettingChanged += OnFormatSettingChanged;
        }
		public override void OnNoteOpened ()
		{
			// Add the menu item when the window is created
			item = new Gtk.MenuItem (
				Catalog.GetString ("Insert Timestamp"));
			item.Activated += OnMenuItemActivated;
			item.AddAccelerator ("activate", Window.AccelGroup,
				(uint) Gdk.Key.d, Gdk.ModifierType.ControlMask,
				Gtk.AccelFlags.Visible);
			item.Show ();
			AddPluginMenuItem (item);

			// Get the format from GConf and subscribe to changes
			date_format = (string) Preferences.Get (
				Preferences.INSERT_TIMESTAMP_FORMAT);
			Preferences.SettingChanged += OnFormatSettingChanged;
		}
Esempio n. 13
0
        public static void Create(Tag [] tags, Gtk.Menu menu)
        {
            var findWithString = Catalog.GetPluralString("Find _With", "Find _With", tags.Length);
            var item           = new Gtk.MenuItem(String.Format(findWithString, tags.Length));

            Gtk.Menu submenu = GetSubmenu(tags);
            if (submenu == null)
            {
                item.Sensitive = false;
            }
            else
            {
                item.Submenu = submenu;
            }

            menu.Append(item);
            item.Show();
        }
Esempio n. 14
0
        protected override void OnShown()
        {
            Trace.Call();

            if (!IsPopulated)
            {
                IsPopulated = true;

                Gtk.MenuItem item;
                item            = new Gtk.MenuItem(_("Ping"));
                item.Activated += OnPingItemActivated;
                item.Show();
                Append(item);

                item            = new Gtk.MenuItem(_("Version"));
                item.Activated += OnVersionItemActivated;
                item.Show();
                Append(item);

                item            = new Gtk.MenuItem(_("Time"));
                item.Activated += OnTimeItemActivated;
                item.Show();
                Append(item);

                item            = new Gtk.MenuItem(_("Finger"));
                item.Activated += OnFingerItemActivated;
                item.Show();
                Append(item);

                item            = new Gtk.MenuItem(_("Userinfo"));
                item.Activated += OnUserinfoItemActivated;
                item.Show();
                Append(item);
            }

            base.OnShown();
        }
Esempio n. 15
0
        void OnPopulatePopup(object sender, Gtk.PopulatePopupArgs args)
        {
            Gtk.TextIter click_iter = Buffer.GetIterAtMark(click_mark);
            NoteTag      url_tag    = Note.TagTable.UrlTag;

            if (click_iter.HasTag(url_tag) || click_iter.EndsTag(url_tag))
            {
                Gtk.MenuItem item;

                item = new Gtk.SeparatorMenuItem();
                item.Show();
                args.Menu.Prepend(item);

                item            = new Gtk.MenuItem(Catalog.GetString("_Copy Link Address"));
                item.Activated += CopyLinkActivate;
                item.Show();
                args.Menu.Prepend(item);

                item            = new Gtk.MenuItem(Catalog.GetString("_Open Link"));
                item.Activated += OpenLinkActivate;
                item.Show();
                args.Menu.Prepend(item);
            }
        }
Esempio n. 16
0
        void OnPopulatePopup(object sender, Gtk.PopulatePopupArgs args)
        {
            Gtk.TextIter click_iter = Buffer.GetIterAtMark(click_mark);
            TaskTag      task_tag   = (TaskTag)
                                      Buffer.GetDynamicTag("task", click_iter);

            if (task_tag == null)
            {
                return;
            }

            Gtk.MenuItem item;

            item = new Gtk.SeparatorMenuItem();
            item.Show();
            args.Menu.Prepend(item);

            item            = new Gtk.MenuItem(Catalog.GetString("Open To Do List"));
            item.Activated += OnOpenTaskListWindow;
            item.Show();
            args.Menu.Prepend(item);

            item            = new TaskMenuItem(task_tag.Uri, Catalog.GetString("To Do Options"));
            item.Activated += OnOpenTaskOptions;
            item.ShowAll();
            args.Menu.Prepend(item);

            item = new TaskMenuItem(
                task_tag.Uri,
                task_tag.CompletionDate == DateTime.MinValue ?
                Catalog.GetString("Mark Complete") :
                Catalog.GetString("Mark Undone"));
            item.Activated += OnToggleCompletionStatus;
            item.ShowAll();
            args.Menu.Prepend(item);
        }
Esempio n. 17
0
        private void CreateMenu(object o, Gtk.PopulatePopupArgs e)
        {
            CreatingMenu = true;
            Hooks._Scrollback.BeforeMenu(owner, this, e.Menu);
            Gtk.SeparatorMenuItem separator1 = new Gtk.SeparatorMenuItem();
            separator1.Show();
            e.Menu.Append(separator1);
            e.Menu.Append(new Gtk.SeparatorMenuItem());

            listAllChannelsToolStripMenuItem.Visible = (owner != null && owner._Network != null);

            // channels
            if (joinToolStripMenuItem.Visible)
            {
                Gtk.MenuItem join = new Gtk.MenuItem(joinToolStripMenuItem.Text);
                join.Show();
                join.Activated += new EventHandler(joinToolStripMenuItem_Click);
                e.Menu.Append(join);
                Gtk.SeparatorMenuItem separator6 = new Gtk.SeparatorMenuItem();
                separator6.Show();
                e.Menu.Append(separator6);
            }

            if (openLinkInBrowserToolStripMenuItem.Visible)
            {
                Gtk.MenuItem copylink = new Gtk.MenuItem(copyLinkToClipboardToolStripMenuItem.Text);
                copylink.Show();
                copylink.Activated += new EventHandler(copyLinkToClipboardToolStripMenuItem_Click);
                e.Menu.Append(copylink);
            }

            if (openLinkInBrowserToolStripMenuItem.Visible)
            {
                Gtk.MenuItem open = new Gtk.MenuItem(openLinkInBrowserToolStripMenuItem.Text);
                open.Show();
                open.Activated += new EventHandler(openLinkInBrowserToolStripMenuItem_Click);
                e.Menu.Append(open);
                Gtk.SeparatorMenuItem separator8 = new Gtk.SeparatorMenuItem();
                separator8.Show();
                e.Menu.Append(separator8);
            }

            // whois items
            if (whoisToolStripMenuItem.Visible)
            {
                Gtk.MenuItem whois = new Gtk.MenuItem(whoisToolStripMenuItem.Text);
                whois.Show();
                whois.Activated += new EventHandler(whoisToolStripMenuItem_Click);
                e.Menu.Append(whois);

                Gtk.MenuItem whowas = new Gtk.MenuItem(whowasToolStripMenuItem.Text);
                whowas.Show();
                whowas.Activated += new EventHandler(whowasToolStripMenuItem_Click);
                e.Menu.Append(whowas);

                if (kickToolStripMenuItem.Visible)
                {
                    Gtk.MenuItem ku = new Gtk.MenuItem(kickToolStripMenuItem.Text);
                    ku.Show();
                    ku.Activated += new EventHandler(kickToolStripMenuItem_Click);
                    e.Menu.Append(ku);
                }

                Gtk.SeparatorMenuItem separator3 = new Gtk.SeparatorMenuItem();
                separator3.Show();
                e.Menu.Append(separator3);
            }

            if (mode1b2ToolStripMenuItem.Visible)
            {
                Gtk.MenuItem mode1 = new Gtk.MenuItem(mode1b2ToolStripMenuItem.Text);
                mode1.Show();
                mode1.Activated += new EventHandler(mode1b2ToolStripMenuItem_Click);
                e.Menu.Append(mode1);

                Gtk.MenuItem mode2 = new Gtk.MenuItem(mode1e2ToolStripMenuItem.Text);
                mode2.Show();
                mode2.Activated += new EventHandler(mode1e2ToolStripMenuItem_Click);
                e.Menu.Append(mode2);

                Gtk.MenuItem mode3 = new Gtk.MenuItem(mode1I2ToolStripMenuItem.Text);
                mode3.Show();
                mode3.Activated += new EventHandler(mode1I2ToolStripMenuItem_Click);
                e.Menu.Append(mode3);

                Gtk.MenuItem mode4 = new Gtk.MenuItem(mode1q2ToolStripMenuItem.Text);
                mode4.Show();
                mode4.Activated += new EventHandler(mode1q2ToolStripMenuItem_Click);
                e.Menu.Append(mode4);

                Gtk.SeparatorMenuItem separator4 = new Gtk.SeparatorMenuItem();
                separator4.Show();
                e.Menu.Append(separator4);
            }

            Gtk.MenuItem clean = new Gtk.MenuItem("Clean");
            clean.Show();
            e.Menu.Append(clean);
            clean.Activated += new EventHandler(mrhToolStripMenuItem_Click);
            Gtk.CheckMenuItem scroll = new Gtk.CheckMenuItem(scrollToolStripMenuItem.Text);
            if (scrollToolStripMenuItem.Checked)
            {
                scroll.Active = true;
            }
            scroll.Show();
            scroll.Activated += new EventHandler(scrollToolStripMenuItem_Click);
            e.Menu.Append(scroll);
            Gtk.MenuItem refresh = new Gtk.MenuItem("Refresh");
            refresh.Show();
            refresh.Activated += new EventHandler(refreshToolStripMenuItem_Click);
            e.Menu.Append(refresh);
            Gtk.CheckMenuItem taly = new Gtk.CheckMenuItem(toggleAdvancedLayoutToolStripMenuItem.Text);
            taly.Activated += new EventHandler(toggleAdvancedLayoutToolStripMenuItem_Click);
            if (toggleAdvancedLayoutToolStripMenuItem.Checked)
            {
                taly.Active = true;
            }
            taly.Show();
            e.Menu.Append(taly);
            Gtk.CheckMenuItem tsly = new Gtk.CheckMenuItem("Toggle simple layout");
            tsly.Activated += new EventHandler(toggleSimpleLayoutToolStripMenuItem_Click);
            if (toggleSimpleLayoutToolStripMenuItem.Checked)
            {
                tsly.Active = true;
            }
            tsly.Show();
            e.Menu.Append(tsly);
            Gtk.SeparatorMenuItem separator2 = new Gtk.SeparatorMenuItem();
            separator2.Show();
            e.Menu.Append(separator2);
            if (channelToolStripMenuItem.Visible)
            {
                Gtk.MenuItem channel = new Gtk.MenuItem("Channel");
                channel.Show();
                e.Menu.Append(channel);
                channel.Activated += new EventHandler(channelToolStripMenuItem_Click);
            }
            if (listAllChannelsToolStripMenuItem.Visible)
            {
                Gtk.MenuItem list = new Gtk.MenuItem(listAllChannelsToolStripMenuItem.Text);
                list.Show();
                list.Activated += new EventHandler(listAllChannelsToolStripMenuItem_Click);
                e.Menu.Append(list);
            }
            if (retrieveTopicToolStripMenuItem.Visible)
            {
                Gtk.MenuItem retrieve = new Gtk.MenuItem("Retrieve topic");
                retrieve.Show();
                retrieve.Activated += new EventHandler(retrieveTopicToolStripMenuItem_Click);
                e.Menu.Append(retrieve);
            }

            Hooks._Scrollback.AfterMenu(owner, this, e.Menu);

            Gtk.MenuItem copy = new Gtk.MenuItem(copyTextToClipBoardToolStripMenuItem.Text);
            copy.Activated += new EventHandler(copyTextToClipBoardToolStripMenuItem_Click);
            copy.Show();
            e.Menu.Append(copy);
            Gtk.MenuItem copy_x = new Gtk.MenuItem(copyEntireWindowToClipBoardToolStripMenuItem.Text);
            copy_x.Activated += new EventHandler(copyEntireWindowToClipBoardToolStripMenuItem_Click);
            copy_x.Show();
            e.Menu.Append(copy_x);
            CreatingMenu = false;
        }
        public void Initialize(IPadWindow window)
        {
            //
            // Handle normal input
            //
            view.ConsoleInput += HandleConsoleInput;

            //
            // Setup Ctrl + / as the interrupt handler
            //
            view.Child.KeyPressEvent += (o, args) => {
                if ((args.Event.State & ModifierType.ControlMask) == ModifierType.ControlMask &&
                    args.Event.Key == Key.slash) {
                    if (session != null) session.Interrupt ();
                }
            };

            //
            // Watch the active doc
            //
            IdeApp.Workbench.ActiveDocumentChanged += HandleActiveDocumentChanged;

            //
            //
            //
            UpdateFont ();
            UpdateColors ();
            view.ShadowType = Gtk.ShadowType.None;
            view.ShowAll ();

            //
            // Add a Restart item to the pop up menu
            //
            var v = view.Child as Gtk.TextView;
            if (v != null) {
                v.PopulatePopup += (o, args) => {
                    var item = new Gtk.MenuItem(GettextCatalog.GetString("Reset"));
                    item.Activated += (sender, e) => RestartCsi ();
                    item.Show ();
                    args.Menu.Add (item);
                };
            }

            //
            // Create the toolbar
            //
        }
Esempio n. 19
0
        public virtual void AttachObject(object ob)
        {
            this.obj = ob;

            if (!prop.Translatable)
            {
                return;
            }

            initializing = true;

            if (contextBox.Parent != null)
            {
                Remove(contextBox);
            }
            if (commentBox.Parent != null)
            {
                Remove(commentBox);
            }

            markItem.Active = prop.IsTranslated(obj);
            image.Pixbuf    = markItem.Active ? globe : globe_not;

            if (prop.IsTranslated(obj))
            {
                if (prop.TranslationContext(obj) != null)
                {
                    remContextItem.Show();
                    PackStart(contextBox, false, false, 0);
                    contextEntry.Text = prop.TranslationContext(obj);
                }
                else
                {
                    addContextItem.Show();
                }
            }
            else
            {
                addContextItem.Show();
                addContextItem.Sensitive = false;
            }

            if (prop.IsTranslated(obj))
            {
                if (prop.TranslationComment(obj) != null)
                {
                    remCommentItem.Show();
                    PackEnd(commentBox, false, false, 0);
                    commentText.Text = prop.TranslationComment(obj);
                }
                else
                {
                    addCommentItem.Show();
                }
            }
            else
            {
                addCommentItem.Show();
                addCommentItem.Sensitive = false;
            }

            initializing = false;
        }
Esempio n. 20
0
		void OnPopulatePopup (object sender, Gtk.PopulatePopupArgs args)
		{
			Gtk.TextIter click_iter = Buffer.GetIterAtMark (click_mark);
			TaskTag task_tag = (TaskTag)
			                   Buffer.GetDynamicTag ("task", click_iter);
			if (task_tag == null)
				return;

			Gtk.MenuItem item;

			item = new Gtk.SeparatorMenuItem ();
			item.Show ();
			args.Menu.Prepend (item);

			item = new Gtk.MenuItem (Catalog.GetString ("Open To Do List"));
			item.Activated += OnOpenTaskListWindow;
			item.Show ();
			args.Menu.Prepend (item);

			item = new TaskMenuItem (task_tag.Uri, Catalog.GetString ("To Do Options"));
			item.Activated += OnOpenTaskOptions;
			item.ShowAll ();
			args.Menu.Prepend (item);

			item = new TaskMenuItem (
			        task_tag.Uri,
			        task_tag.CompletionDate == DateTime.MinValue ?
			        Catalog.GetString ("Mark Complete") :
			        Catalog.GetString ("Mark Undone"));
			item.Activated += OnToggleCompletionStatus;
			item.ShowAll ();
			args.Menu.Prepend (item);
		}
Esempio n. 21
0
        public override void Initialize()
        {
            item = new Gtk.MenuItem (Catalog.GetString ("Post note to your blog"));
            item.Activated += OnMenuItemActivated;
            item.Show ();
            AddPluginMenuItem (item);

            AuthenticationManager.Register (new GoogleClient ());
        }
Esempio n. 22
0
        protected override void OnShown()
        {
            Trace.Call();

            if (!IsPopulated) {
                IsPopulated = true;

                Gtk.MenuItem item;
                item = new Gtk.MenuItem(_("Ping"));
                item.Activated += OnPingItemActivated;
                item.Show();
                Append(item);

                item = new Gtk.MenuItem(_("Version"));
                item.Activated += OnVersionItemActivated;
                item.Show();
                Append(item);

                item = new Gtk.MenuItem(_("Time"));
                item.Activated += OnTimeItemActivated;
                item.Show();
                Append(item);

                item = new Gtk.MenuItem(_("Finger"));
                item.Activated += OnFingerItemActivated;
                item.Show();
                Append(item);

                item = new Gtk.MenuItem(_("Userinfo"));
                item.Activated += OnUserinfoItemActivated;
                item.Show();
                Append(item);
            }

            base.OnShown();
        }
 public override void Activate()
 {
     _menuItem.Show();
     _sep.Show();
     _track_search.Show();
 }
Esempio n. 24
0
		public void AddAccelerator (EventHandler handler,
					    uint key,
					    Gdk.ModifierType modifiers,
					    Gtk.AccelFlags flags)
		{
			Gtk.MenuItem foo = new Gtk.MenuItem ();
			foo.Activated += handler;
			foo.AddAccelerator ("activate",
					    accel_group,
					    key, 
					    modifiers,
					    flags);
			foo.Show ();

			fake_menu.Append (foo);
		}
Esempio n. 25
0
		void OnPopulatePopup (object sender, Gtk.PopulatePopupArgs args)
		{
			Gtk.TextIter click_iter = Buffer.GetIterAtMark (click_mark);
			NoteTag url_tag = Note.TagTable.UrlTag;
			if (click_iter.HasTag (url_tag) || click_iter.EndsTag (url_tag)) {
				Gtk.MenuItem item;

				item = new Gtk.SeparatorMenuItem ();
				item.Show ();
				args.Menu.Prepend (item);

				item = new Gtk.MenuItem (Catalog.GetString ("_Copy Link Address"));
				item.Activated += CopyLinkActivate;
				item.Show ();
				args.Menu.Prepend (item);

				item = new Gtk.MenuItem (Catalog.GetString ("_Open Link"));
				item.Activated += OpenLinkActivate;
				item.Show ();
				args.Menu.Prepend (item);
			}
		}