Exemplo n.º 1
0
        protected virtual void OnPopulatePopup(object sender, Gtk.PopulatePopupArgs e)
        {
            Trace.Call(sender, e);

            if (!_AtLinkTag)
            {
                return;
            }

            Gtk.Menu popup = e.Menu;
            // remove all items
            foreach (Gtk.Widget children in popup.Children)
            {
                popup.Remove(children);
            }

            Gtk.ImageMenuItem open_item = new Gtk.ImageMenuItem(Gtk.Stock.Open, null);
            open_item.Activated += delegate {
                if (_ActiveLink != null)
                {
                    OpenLink(_ActiveLink);
                }
            };
            popup.Append(open_item);

            Gtk.ImageMenuItem copy_item = new Gtk.ImageMenuItem(Gtk.Stock.Copy, null);
            copy_item.Activated += delegate {
                Gdk.Atom      clipboardAtom = Gdk.Atom.Intern("CLIPBOARD", false);
                Gtk.Clipboard clipboard     = Gtk.Clipboard.Get(clipboardAtom);
                clipboard.Text = _ActiveLink.ToString();
            };
            popup.Append(copy_item);

            popup.ShowAll();
        }
Exemplo n.º 2
0
        private void _OnOutputMessageTextViewPopulatePopup(object o, Gtk.PopulatePopupArgs args)
        {
            if (OutputMessageTextView.IsAtUrlTag)
            {
                return;
            }

            Gtk.Menu popup = args.Menu;

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

            Gtk.ImageMenuItem whois_item = new Gtk.ImageMenuItem(_("Whois"));
            whois_item.Activated += _OnMenuWhoisItemActivated;
            popup.Append(whois_item);

            Gtk.ImageMenuItem ctcp_item      = new Gtk.ImageMenuItem(_("CTCP"));
            Gtk.Menu          ctcp_menu_item = new CtcpMenu(_IrcProtocolManager,
                                                            Frontend.MainWindow.ChatViewManager,
                                                            PersonModel);
            ctcp_item.Submenu = ctcp_menu_item;
            popup.Append(ctcp_item);

            Gtk.ImageMenuItem invite_to_item      = new Gtk.ImageMenuItem(_("Invite to"));
            Gtk.Menu          invite_to_menu_item = new InviteToMenu(_IrcProtocolManager,
                                                                     Frontend.MainWindow.ChatViewManager,
                                                                     PersonModel);
            invite_to_item.Submenu = invite_to_menu_item;
            popup.Append(invite_to_item);

            popup.ShowAll();
        }
Exemplo n.º 3
0
        protected virtual void OnMessageTextViewPopulatePopup(object sender, Gtk.PopulatePopupArgs e)
        {
            Trace.Call(sender, e);

            if (OutputMessageTextView.IsAtUrlTag)
            {
                return;
            }
            if (Frontend.MainWindow.ShowMenuBar)
            {
                return;
            }

            Gtk.Menu popup = e.Menu;
            popup.Prepend(new Gtk.SeparatorMenuItem());

            var item = new Gtk.CheckMenuItem(_("Show _Menubar"));

            item.Active     = Frontend.MainWindow.ShowMenuBar;
            item.Activated += delegate {
                try {
                    Frontend.MainWindow.ShowMenuBar = true;
                } catch (Exception ex) {
                    Frontend.ShowException(ex);
                }
            };
            popup.Prepend(item);
            popup.ShowAll();
        }
Exemplo n.º 4
0
        void OnOutputMessageTextViewPopulatePopup(object o, Gtk.PopulatePopupArgs args)
        {
            if (OutputMessageTextView.IsAtUrlTag)
            {
                return;
            }

            Gtk.Menu popup = args.Menu;

            popup.Append(new Gtk.SeparatorMenuItem());
            foreach (var menu_item in CreateContextMenuItems())
            {
                popup.Append(menu_item);
            }

            popup.ShowAll();
        }
Exemplo n.º 5
0
        private void _OnOutputMessageTextViewPopulatePopup(object o, Gtk.PopulatePopupArgs args)
        {
            if (OutputMessageTextView.IsAtUrlTag)
            {
                return;
            }

            Gtk.Menu popup = args.Menu;

            // minimum version of any command below
            if (Frontend.EngineProtocolVersion < new Version(0, 8, 11))
            {
                return;
            }

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

            if (Frontend.EngineProtocolVersion >= new Version(0, 8, 12))
            {
                Gtk.ImageMenuItem whois_item = new Gtk.ImageMenuItem(_("Whois"));
                whois_item.Activated += _OnMenuWhoisItemActivated;
                popup.Append(whois_item);
            }

            if (Frontend.EngineProtocolVersion >= new Version(0, 8, 11))
            {
                Gtk.ImageMenuItem AddToContacts_item = new Gtk.ImageMenuItem(_("Add To Contacts"));
                AddToContacts_item.Activated += _OnMenuAddToContactsItemActivated;
                popup.Append(AddToContacts_item);
            }

            if (Frontend.EngineProtocolVersion >= new Version(0, 8, 12))
            {
                Gtk.ImageMenuItem invite_to_item      = new Gtk.ImageMenuItem(_("Invite to"));
                Gtk.Menu          invite_to_menu_item = new InviteToMenu(XmppProtocolManager,
                                                                         Frontend.MainWindow.ChatViewManager,
                                                                         PersonModel);
                invite_to_item.Submenu = invite_to_menu_item;
                popup.Append(invite_to_item);
            }

            popup.ShowAll();
        }
Exemplo n.º 6
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);
            }
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
 protected void OnTextview1PopulatePopup(object o, Gtk.PopulatePopupArgs args)
 {
 }