diff options
author | lovetox <philipp@hoerist.com> | 2022-08-20 16:41:21 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2022-08-20 16:41:21 +0300 |
commit | 90c796c5a778b482b66c2810320923055ab582f1 (patch) | |
tree | 8022eafda4d56250418e08d84d8adfb74f709d33 | |
parent | 923a07f4b5084b9cf38d63739ae51d6f97d05a22 (diff) |
imprv: WorkspaceSidebar: Allow removing workspace from context menu
-rw-r--r-- | gajim/gtk/main.py | 9 | ||||
-rw-r--r-- | gajim/gtk/menus.py | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/gajim/gtk/main.py b/gajim/gtk/main.py index b2b428c42..8232d89f2 100644 --- a/gajim/gtk/main.py +++ b/gajim/gtk/main.py @@ -305,7 +305,7 @@ class MainWindow(Gtk.ApplicationWindow, EventHelper): actions = [ ('add-workspace', 's', self._add_workspace), ('edit-workspace', 's', self._edit_workspace), - ('remove-workspace', None, self._remove_workspace), + ('remove-workspace', 's', self._remove_workspace), ('activate-workspace', 's', self._activate_workspace), ('add-chat', 'a{sv}', self._add_chat), ('add-group-chat', 'as', self._add_group_chat), @@ -616,9 +616,12 @@ class MainWindow(Gtk.ApplicationWindow, EventHelper): def _remove_workspace(self, _action: Gio.SimpleAction, - _param: Optional[GLib.Variant]) -> None: + param: GLib.Variant) -> None: + + workspace_id = param.get_string() or None + if workspace_id is None: + workspace_id = self.get_active_workspace() - workspace_id = self.get_active_workspace() if workspace_id is not None: self.remove_workspace(workspace_id) diff --git a/gajim/gtk/menus.py b/gajim/gtk/menus.py index 2febedfb5..2da96b419 100644 --- a/gajim/gtk/menus.py +++ b/gajim/gtk/menus.py @@ -577,6 +577,7 @@ def get_format_menu() -> GajimMenu: def get_workspace_menu(workspace_id: str) -> GajimMenu: menuitems: MenuItemListT = [ (_('Edit…'), 'win.edit-workspace', f'"{workspace_id}"'), + (_('Remove'), 'win.remove-workspace', f'"{workspace_id}"'), ] return GajimMenu.from_list(menuitems) |