Philipp Hörist pushed to branch move-workspace-chats-on-remove at gajim / gajim


Commits:
c3aa9ee4 by lovetox at 2022-08-29T11:59:23+02:00
fix: Small improvements

- - - - -


2 changed files:

- gajim/gtk/chat_list_stack.py
- gajim/gtk/menus.py


Changes:

=====================================
gajim/gtk/chat_list_stack.py
=====================================
@@ -243,11 +243,7 @@ def _move_chat_to_workspace(self,
         if not workspace_id:
             workspace_id = app.window.add_workspace(switch=False)
 
-        if params.source_workspace_id:
-            source_chatlist = self.get_chatlist(params.source_workspace_id)
-        else:
-            source_chatlist = cast(ChatList, self.get_visible_child())
-
+        source_chatlist = self.get_chatlist(params.source_workspace_id)
         type_ = source_chatlist.get_chat_type(params.account, params.jid)
         if type_ is None:
             return


=====================================
gajim/gtk/menus.py
=====================================
@@ -410,7 +410,7 @@ def get_chat_list_row_menu(workspace_id: str,
     menu = GajimMenu()
 
     params = ChatListEntryParam(workspace_id=workspace_id,
-                                source_workspace_id='',
+                                source_workspace_id=workspace_id,
                                 account=account,
                                 jid=jid)
 
@@ -424,7 +424,7 @@ def get_chat_list_row_menu(workspace_id: str,
             submenu.add_item(name, 'win.move-chat-to-workspace', params)
 
     params = ChatListEntryParam(workspace_id='',
-                                source_workspace_id='',
+                                source_workspace_id=workspace_id,
                                 account=account,
                                 jid=jid)
 
@@ -578,14 +578,15 @@ def get_format_menu() -> GajimMenu:
 
 
 def get_workspace_menu(workspace_id: str) -> GajimMenu:
+    remove_action = 'win.dummy'
+    if len(app.settings.get_workspaces()) > 1:
+        remove_action = 'win.remove-workspace'
+
     menuitems: MenuItemListT = [
         (_('Edit…'), 'win.edit-workspace', f'"{workspace_id}"'),
+        (_('Remove'), remove_action, f'"{workspace_id}"'),
     ]
 
-    if len(app.settings.get_workspaces()) > 1:
-        menuitems.append(
-            (_('Remove'), 'win.remove-workspace', f'"{workspace_id}"'))
-
     return GajimMenu.from_list(menuitems)
 
 



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/c3aa9ee4839359084e1461adf2dc2e250fc5ebc4

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/c3aa9ee4839359084e1461adf2dc2e250fc5ebc4
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to