4
// GNOME Do is the legal property of its developers. Please refer to the
5
// COPYRIGHT file distributed with this
6
// source distribution.
8
// This program is free software: you can redistribute it and/or modify
9
// it under the terms of the GNU General Public License as published by
10
// the Free Software Foundation, either version 3 of the License, or
11
// (at your option) any later version.
13
// This program is distributed in the hope that it will be useful,
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
// GNU General Public License for more details.
18
// You should have received a copy of the GNU General Public License
19
// along with this program. If not, see <http://www.gnu.org/licenses/>.
34
[System.ComponentModel.Category("File")]
35
[System.ComponentModel.ToolboxItem(true)]
36
public partial class DropboxConfig : Gtk.Bin
38
private static string home_path = Environment.GetFolderPath (Environment.SpecialFolder.Personal);
39
private static string base_path = System.IO.Path.Combine (home_path, "Dropbox");
41
static IPreferences prefs;
43
public DropboxConfig()
49
private void RefreshView ()
51
base_path_entry.Text = BasePath;
54
static DropboxConfig ()
56
prefs = Services.Preferences.Get<DropboxConfig> ();
59
public static string BasePath
61
get { return prefs.Get<string> ("BasePath", base_path); }
62
set { prefs.Set<string> ("BasePath", value); }
65
protected virtual void OnBasePathBtnClicked (object sender, System.EventArgs e)
67
FileChooserDialog chooser = new FileChooserDialog (
68
AddinManager.CurrentLocalizer.GetString ("Select location of Dropbox folder"),
69
new Dialog (), FileChooserAction.SelectFolder,
70
Gtk.Stock.Cancel, ResponseType.Cancel,
71
Gtk.Stock.Open, ResponseType.Accept);
73
chooser.SetCurrentFolder (BasePath);
74
if (chooser.Run () == (int) ResponseType.Accept) {
75
BasePath = chooser.Filename;