Exemple #1
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();
        }
Exemple #2
0
        IEnumerable <Gtk.MenuItem> CreateContextMenuItems()
        {
            if (IrcProtocolManager == null)
            {
                // we are not synced yet
                yield break;
            }

            Gtk.ImageMenuItem whois_item = new Gtk.ImageMenuItem(_("Whois"));
            whois_item.Activated += OnMenuWhoisItemActivated;
            yield return(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;
            yield return(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;
            yield return(invite_to_item);
        }
Exemple #3
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();
        }
Exemple #4
0
        protected override void OnPersonMenuShown(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            foreach (var child in PersonMenu.Children)
            {
                PersonMenu.Remove(child);
            }

            base.OnPersonMenuShown(sender, e);

            Gtk.ImageMenuItem query_item = new Gtk.ImageMenuItem(_("Query"));
            query_item.Activated += OnUserListMenuQueryActivated;
            PersonMenu.Append(query_item);

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

            Gtk.ImageMenuItem op_item = new Gtk.ImageMenuItem(_("Op"));
            op_item.Activated += OnUserListMenuOpActivated;
            PersonMenu.Append(op_item);

            Gtk.ImageMenuItem deop_item = new Gtk.ImageMenuItem(_("Deop"));
            deop_item.Activated += OnUserListMenuDeopActivated;
            PersonMenu.Append(deop_item);

            Gtk.ImageMenuItem voice_item = new Gtk.ImageMenuItem(_("Voice"));
            voice_item.Activated += OnUserListMenuVoiceActivated;
            PersonMenu.Append(voice_item);

            Gtk.ImageMenuItem devoice_item = new Gtk.ImageMenuItem(_("Devoice"));
            devoice_item.Activated += OnUserListMenuDevoiceActivated;
            PersonMenu.Append(devoice_item);

            Gtk.ImageMenuItem kick_item = new Gtk.ImageMenuItem(_("Kick"));
            kick_item.Activated += OnUserListMenuKickActivated;
            PersonMenu.Append(kick_item);

            Gtk.ImageMenuItem kickban_item = new Gtk.ImageMenuItem(_("Kick + Ban"));
            kickban_item.Activated += OnUserListMenuKickBanActivated;
            PersonMenu.Append(kickban_item);

            Gtk.ImageMenuItem ban_item = new Gtk.ImageMenuItem(_("Ban"));
            ban_item.Activated += OnUserListMenuBanActivated;
            PersonMenu.Append(ban_item);

            Gtk.ImageMenuItem unban_item = new Gtk.ImageMenuItem(_("Unban"));
            unban_item.Activated += OnUserListMenuUnbanActivated;
            PersonMenu.Append(unban_item);

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

            Gtk.ImageMenuItem whois_item = new Gtk.ImageMenuItem(_("Whois"));
            whois_item.Activated += OnUserListMenuWhoisActivated;
            PersonMenu.Append(whois_item);

            Gtk.MenuItem ctcp_item = new Gtk.MenuItem(_("CTCP"));
            Gtk.Menu     ctcp_menu = new CtcpMenu(
                IrcProtocolManager,
                Frontend.MainWindow.ChatViewManager,
                GetSelectedPersons()
                );
            ctcp_item.Submenu = ctcp_menu;
            PersonMenu.Append(ctcp_item);

            Gtk.MenuItem invite_to_item      = new Gtk.MenuItem(_("Invite to"));
            Gtk.Menu     invite_to_menu_item = new InviteToMenu(
                IrcProtocolManager,
                Frontend.MainWindow.ChatViewManager,
                GetSelectedPersons()
                );
            invite_to_item.Submenu = invite_to_menu_item;
            PersonMenu.Append(invite_to_item);

            PersonMenu.ShowAll();
        }
Exemple #5
0
        protected override void OnPersonMenuShown(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            foreach (var child in PersonMenu.Children) {
                PersonMenu.Remove(child);
            }

            base.OnPersonMenuShown(sender, e);

            Gtk.ImageMenuItem op_item = new Gtk.ImageMenuItem(_("Op"));
            op_item.Activated += _OnUserListMenuOpActivated;
            PersonMenu.Append(op_item);

            Gtk.ImageMenuItem deop_item = new Gtk.ImageMenuItem(_("Deop"));
            deop_item.Activated += _OnUserListMenuDeopActivated;
            PersonMenu.Append(deop_item);

            Gtk.ImageMenuItem voice_item = new Gtk.ImageMenuItem(_("Voice"));
            voice_item.Activated += _OnUserListMenuVoiceActivated;
            PersonMenu.Append(voice_item);

            Gtk.ImageMenuItem devoice_item = new Gtk.ImageMenuItem(_("Devoice"));
            devoice_item.Activated += _OnUserListMenuDevoiceActivated;
            PersonMenu.Append(devoice_item);

            Gtk.ImageMenuItem kick_item = new Gtk.ImageMenuItem(_("Kick"));
            kick_item.Activated += _OnUserListMenuKickActivated;
            PersonMenu.Append(kick_item);

            Gtk.ImageMenuItem kickban_item = new Gtk.ImageMenuItem(_("Kick + Ban"));
            kickban_item.Activated += _OnUserListMenuKickBanActivated;
            PersonMenu.Append(kickban_item);

            Gtk.ImageMenuItem ban_item = new Gtk.ImageMenuItem(_("Ban"));
            ban_item.Activated += _OnUserListMenuBanActivated;
            PersonMenu.Append(ban_item);

            Gtk.ImageMenuItem unban_item = new Gtk.ImageMenuItem(_("Unban"));
            unban_item.Activated += _OnUserListMenuUnbanActivated;
            PersonMenu.Append(unban_item);

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

            Gtk.ImageMenuItem query_item = new Gtk.ImageMenuItem(_("Query"));
            query_item.Activated += _OnUserListMenuQueryActivated;
            PersonMenu.Append(query_item);

            Gtk.ImageMenuItem whois_item = new Gtk.ImageMenuItem(_("Whois"));
            whois_item.Activated += _OnUserListMenuWhoisActivated;
            PersonMenu.Append(whois_item);

            Gtk.MenuItem ctcp_item = new Gtk.MenuItem(_("CTCP"));
            Gtk.Menu ctcp_menu = new CtcpMenu(
                _IrcProtocolManager,
                Frontend.MainWindow.ChatViewManager,
                GetSelectedPersons()
            );
            ctcp_item.Submenu = ctcp_menu;
            PersonMenu.Append(ctcp_item);

            Gtk.MenuItem invite_to_item = new Gtk.MenuItem(_("Invite to"));
            Gtk.Menu invite_to_menu_item = new InviteToMenu(
                _IrcProtocolManager,
                Frontend.MainWindow.ChatViewManager,
                GetSelectedPersons()
            );
            invite_to_item.Submenu = invite_to_menu_item;
            PersonMenu.Append(invite_to_item);

            PersonMenu.ShowAll();
        }
Exemple #6
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();
        }
        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();
        }
Exemple #8
0
        IEnumerable<Gtk.MenuItem> CreateContextMenuItems()
        {
            Gtk.ImageMenuItem whois_item = new Gtk.ImageMenuItem(_("Whois"));
            whois_item.Activated += OnMenuWhoisItemActivated;
            yield return 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;
            yield return 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;
            yield return invite_to_item;
        }
Exemple #9
0
        protected override void OnPersonMenuShown(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            foreach (var child in PersonMenu.Children) {
                PersonMenu.Remove(child);
            }

            base.OnPersonMenuShown(sender, e);

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

            if (Frontend.EngineVersion >= new Version(0, 8, 9)) {
                Gtk.ImageMenuItem query_item = new Gtk.ImageMenuItem(_("Query"));
                query_item.Activated += _OnUserListMenuQueryActivated;
                PersonMenu.Append(query_item);
            }

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

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

            if (!IsContactList && Frontend.EngineVersion >= new Version(0, 8, 11)) {
                var add_to_contacts_item = new Gtk.ImageMenuItem(_("Add To Contacts"));
                add_to_contacts_item.Activated += _OnMenuAddToContactsItemActivated;
                PersonMenu.Append(add_to_contacts_item);
            }

            if (Frontend.EngineVersion >= new Version(0, 8, 12)) {
                Gtk.MenuItem invite_to_item = new Gtk.MenuItem(_("Invite to"));
                Gtk.Menu invite_to_menu_item = new InviteToMenu(
                    XmppProtocolManager,
                    Frontend.MainWindow.ChatViewManager,
                    GetSelectedPersons()
                );
                invite_to_item.Submenu = invite_to_menu_item;
                PersonMenu.Append(invite_to_item);
            }

            if (IsContactList && Frontend.EngineVersion >= new Version(0, 8, 11)) {
                // cleanup old handlers
                IdentityNameCellRenderer.EditingStarted -= OnPersonRenameEditingStarted;
                IdentityNameCellRenderer.Edited -= OnPersonRenameEdited;

                IdentityNameCellRenderer.EditingStarted += OnPersonRenameEditingStarted;
                IdentityNameCellRenderer.Edited += OnPersonRenameEdited;

                var rename_item = new Gtk.ImageMenuItem(_("Rename"));
                rename_item.Activated += (o, args) => {
                    var paths = PersonTreeView.Selection.GetSelectedRows();
                    if (paths == null || paths.Length == 0) {
                        return;
                    }
                    var path = paths[0];
                    IdentityNameCellRenderer.Editable = true;
                    PersonTreeView.SetCursor(path, IdentityNameColumn, true);
                };
                PersonMenu.Append(rename_item);
            }

            PersonMenu.ShowAll();
        }
Exemple #10
0
        protected override void OnPersonMenuShown(object sender, EventArgs e)
        {
            Trace.Call(sender, e);

            foreach (var child in PersonMenu.Children)
            {
                PersonMenu.Remove(child);
            }

            base.OnPersonMenuShown(sender, e);

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

            if (Frontend.EngineProtocolVersion >= new Version(0, 8, 9))
            {
                Gtk.ImageMenuItem query_item = new Gtk.ImageMenuItem(_("Query"));
                query_item.Activated += _OnUserListMenuQueryActivated;
                PersonMenu.Append(query_item);
            }

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

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

            if (!IsContactList && Frontend.EngineProtocolVersion >= new Version(0, 8, 11))
            {
                var add_to_contacts_item = new Gtk.ImageMenuItem(_("Add To Contacts"));
                add_to_contacts_item.Activated += _OnMenuAddToContactsItemActivated;
                PersonMenu.Append(add_to_contacts_item);
            }

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

            if (IsContactList && Frontend.EngineProtocolVersion >= new Version(0, 8, 11))
            {
                // cleanup old handlers
                IdentityNameCellRenderer.EditingStarted -= OnPersonRenameEditingStarted;
                IdentityNameCellRenderer.Edited         -= OnPersonRenameEdited;

                IdentityNameCellRenderer.EditingStarted += OnPersonRenameEditingStarted;
                IdentityNameCellRenderer.Edited         += OnPersonRenameEdited;

                var rename_item = new Gtk.ImageMenuItem(_("Rename"));
                rename_item.Activated += (o, args) => {
                    var paths = PersonTreeView.Selection.GetSelectedRows();
                    if (paths == null || paths.Length == 0)
                    {
                        return;
                    }
                    var path = paths[0];
                    IdentityNameCellRenderer.Editable = true;
                    PersonTreeView.SetCursor(path, IdentityNameColumn, true);
                };
                PersonMenu.Append(rename_item);

                Gtk.ImageMenuItem remove_item = new Gtk.ImageMenuItem(_("Remove"));
                remove_item.Activated += OnUserListMenuRemoveActivated;
                PersonMenu.Append(remove_item);
            }

            PersonMenu.ShowAll();
        }