Skip to content

Commit

Permalink
workspace-directory: prefs GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
olejorgenb authored and hedning committed Oct 18, 2019
1 parent 9d90930 commit 9e8da01
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions prefs.js
Expand Up @@ -295,9 +295,15 @@ class SettingsWidget {
backgroundBox.add(background)
backgroundBox.add(clearBackground)

let directoryChooser = new Gtk.FileChooserButton({
action: Gtk.FileChooserAction.SELECT_FOLDER,
title: 'Select workspace directory'
});

list.add(createRow('Name', nameEntry));
list.add(createRow('Color', colorButton));
list.add(createRow('Background', backgroundBox));
list.add(createRow('Directory', directoryChooser));

let rgba = new Gdk.RGBA();
let color = settings.get_string('color');
Expand Down Expand Up @@ -351,6 +357,17 @@ class SettingsWidget {
clearBackground.sensitive = settings.get_string('background') != '';
});

let dir = settings.get_string('directory')
if (dir === '')
directoryChooser.unselect_all();
else
directoryChooser.set_filename(dir)

directoryChooser.connect('file-set', () => {
let dir = directoryChooser.get_filename();
settings.set_string('directory', dir);
});

return list;
}

Expand Down

0 comments on commit 9e8da01

Please sign in to comment.