[gitg] Add default folder for clone repository widget
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Add default folder for clone repository widget
- Date: Fri, 19 Apr 2013 14:27:29 +0000 (UTC)
commit e4b615bfe50f71ec050d880d8821daf8138112b8
Author: Jose Manuel Pintor Freire <jmpintorfreire gmail com>
Date: Fri Apr 19 00:09:54 2013 +0200
Add default folder for clone repository widget
Signed-off-by: Ignacio Casal Quinteiro <icq gnome org>
data/org.gnome.gitg.gschema.xml.in.in | 6 ++++++
gitg/gitg-window.vala | 16 ++++++++++++++++
2 files changed, 22 insertions(+)
---
diff --git a/data/org.gnome.gitg.gschema.xml.in.in b/data/org.gnome.gitg.gschema.xml.in.in
index 9947057..69500ce 100644
--- a/data/org.gnome.gitg.gschema.xml.in.in
+++ b/data/org.gnome.gitg.gschema.xml.in.in
@@ -55,6 +55,12 @@
<!-- TODO: add _descriptions -->
</key>
</schema>
+ <schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.view.main"
path="/org/gnome/gitg/preferences/view/main/">
+ <key name="clone-directory" type="s">
+ <default>""</default>
+ <!-- TODO: add _descriptions -->
+ </key>
+ </schema>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.gnome.gitg.preferences.interface"
path="/org/gnome/gitg/preferences/interface/">
<key name="orientation" enum="org.gnome.gitg.Layout">
<default>'vertical'</default>
diff --git a/gitg/gitg-window.vala b/gitg/gitg-window.vala
index 7ff0d5d..2476cc3 100644
--- a/gitg/gitg-window.vala
+++ b/gitg/gitg-window.vala
@@ -23,6 +23,7 @@ namespace Gitg
public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.Buildable
{
private Settings d_state_settings;
+ private Settings d_main_settings;
private Repository? d_repository;
private GitgExt.MessageBus d_message_bus;
private string? d_action;
@@ -66,6 +67,8 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
construct
{
add_action_entries(win_entries, this);
+
+ d_main_settings = new Settings("org.gnome.gitg.preferences.view.main");
}
private void on_close_activated()
@@ -207,6 +210,19 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable, Gtk.
dlg.modal = true;
dlg.set_transient_for(this);
+ var default_dir = d_main_settings.get_string("clone-directory");
+
+ if (default_dir == "")
+ {
+ default_dir = Environment.get_home_dir();
+ }
+
+ chooser.set_current_folder(default_dir);
+
+ chooser.selection_changed.connect((c) => {
+ d_main_settings.set_string("clone-directory", c.get_file().get_path());
+ });
+
entry_url.changed.connect((e) => {
string ?tooltip_text = null;
string ?icon_name = null;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]