Skip to content
Snippets Groups Projects
Commit 4c930934 authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Save workspace order

parent 1c540528
No related branches found
No related tags found
No related merge requests found
......@@ -303,6 +303,8 @@ def add_workspace(self, workspace_id):
self._chat_list_stack.add_chat_list(workspace_id)
self._workspace_side_bar.activate_workspace(workspace_id)
self._chat_list_stack.show_chat_list(workspace_id)
if self._startup_finished:
self._workspace_side_bar.store_workspace_order()
def _edit_workspace(self, _action, _param):
workspace_id = self.get_active_workspace()
......
......@@ -104,6 +104,7 @@ def _on_drag_data_received(self, _widget, _drag_context, _x_coord,
pos = len(self.get_children()) - 1
self.insert(row, pos)
self.store_workspace_order()
app.window.activate_workspace(workspace_id)
def _on_drag_leave(self, _widget, _drag_context, _time):
......@@ -147,6 +148,11 @@ def add_workspace(self, workspace_id):
# Insert row before AddWorkspace row
self.insert(row, len(self.get_children()) - 1)
def store_workspace_order(self):
order = [row.workspace_id for row in self.get_children()]
order.remove('add')
app.settings.set_app_setting('workspace_order', order)
def remove_workspace(self, workspace_id):
if len(self._workspaces) == 1:
return False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment