Philipp Hörist pushed to branch mainwindow at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/gtk/main.py
    ... ... @@ -303,6 +303,8 @@ def add_workspace(self, workspace_id):
    303 303
             self._chat_list_stack.add_chat_list(workspace_id)
    
    304 304
             self._workspace_side_bar.activate_workspace(workspace_id)
    
    305 305
             self._chat_list_stack.show_chat_list(workspace_id)
    
    306
    +        if self._startup_finished:
    
    307
    +            self._workspace_side_bar.store_workspace_order()
    
    306 308
     
    
    307 309
         def _edit_workspace(self, _action, _param):
    
    308 310
             workspace_id = self.get_active_workspace()
    

  • gajim/gtk/workspace_side_bar.py
    ... ... @@ -104,6 +104,7 @@ def _on_drag_data_received(self, _widget, _drag_context, _x_coord,
    104 104
                 pos = len(self.get_children()) - 1
    
    105 105
     
    
    106 106
             self.insert(row, pos)
    
    107
    +        self.store_workspace_order()
    
    107 108
             app.window.activate_workspace(workspace_id)
    
    108 109
     
    
    109 110
         def _on_drag_leave(self, _widget, _drag_context, _time):
    
    ... ... @@ -147,6 +148,11 @@ def add_workspace(self, workspace_id):
    147 148
             # Insert row before AddWorkspace row
    
    148 149
             self.insert(row, len(self.get_children()) - 1)
    
    149 150
     
    
    151
    +    def store_workspace_order(self):
    
    152
    +        order = [row.workspace_id for row in self.get_children()]
    
    153
    +        order.remove('add')
    
    154
    +        app.settings.set_app_setting('workspace_order', order)
    
    155
    +
    
    150 156
         def remove_workspace(self, workspace_id):
    
    151 157
             if len(self._workspaces) == 1:
    
    152 158
                 return False