Skip to content

Commit 1bedcc4

Browse files
committed
Persist order-folders setting
1 parent bdc4e53 commit 1bedcc4

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

data/io.elementary.code.gschema.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
<summary>Terminal visibility</summary>
5959
<description>Whether or not the terminal pane is visible</description>
6060
</key>
61+
<key name="order-folders" type="b">
62+
<default>true</default>
63+
<summary>Sort open projects</summary>
64+
<description>Keep the open projects in alphabetical order</description>
65+
</key>
6166
<key name="last-opened-path" type="s">
6267
<default>''</default>
6368
<summary>Last opened path</summary>

src/MainWindow.vala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,8 @@ namespace Scratch {
347347
sidebar_action.set_state (saved_state.get_boolean ("sidebar-visible"));
348348
update_toolbar_button (ACTION_TOGGLE_SIDEBAR, saved_state.get_boolean ("sidebar-visible"));
349349

350-
// var order_folders_action = Utils.action_from_group (ACTION_ORDER_FOLDERS, actions);
351-
// order_folders_action.set_state (saved_state.get_boolean ("order-folders"));
352-
// update_toolbar_button (ACTION_ORDER_FOLDERS, saved_state.get_boolean ("order-folders"));
350+
var order_folders_action = Utils.action_from_group (ACTION_ORDER_FOLDERS, actions);
351+
order_folders_action.set_state (saved_state.get_boolean ("order-folders"));
353352

354353
var outline_action = Utils.action_from_group (ACTION_TOGGLE_OUTLINE, actions);
355354
outline_action.set_state (saved_state.get_boolean ("outline-visible"));
@@ -571,6 +570,7 @@ namespace Scratch {
571570
Scratch.saved_state.bind ("sidebar-visible", sidebar, "visible", SettingsBindFlags.DEFAULT);
572571
Scratch.saved_state.bind ("outline-visible", document_view , "outline_visible", SettingsBindFlags.DEFAULT);
573572
Scratch.saved_state.bind ("terminal-visible", terminal, "visible", SettingsBindFlags.DEFAULT);
573+
Scratch.saved_state.bind ("order-folders", folder_manager_view, "order-folders", SettingsBindFlags.DEFAULT);
574574
// Plugins hook
575575
HookFunc hook_func = () => {
576576
plugins.hook_window (this);

0 commit comments

Comments
 (0)