~ubuntu-branches/debian/stretch/geary/stretch

« back to all changes in this revision

Viewing changes to src/client/application/geary-config.vala

  • Committer: Package Import Robot
  • Author(s): Vincent Cheng
  • Date: 2015-04-29 02:55:37 UTC
  • mfrom: (3.1.13)
  • Revision ID: package-import@ubuntu.com-20150429025537-6o00z6549l6c70qz
Tags: 0.10.0-1
New upstream release. (Closes: #782594)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright 2011-2014 Yorba Foundation
 
1
/* Copyright 2011-2015 Yorba Foundation
2
2
 *
3
3
 * This software is licensed under the GNU Lesser General Public License
4
4
 * (version 2.1 or later).  See the COPYING file in this distribution.
10
10
    public const string WINDOW_HEIGHT_KEY = "window-height";
11
11
    public const string WINDOW_MAXIMIZE_KEY = "window-maximize";
12
12
    public const string FOLDER_LIST_PANE_POSITION_KEY = "folder-list-pane-position";
 
13
    public const string FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY = "folder-list-pane-position-horizontal";
 
14
    public const string FOLDER_LIST_PANE_POSITION_VERTICAL_KEY = "folder-list-pane-position-vertical";
 
15
    public const string FOLDER_LIST_PANE_HORIZONTAL_KEY = "folder-list-pane-horizontal";
13
16
    public const string MESSAGES_PANE_POSITION_KEY = "messages-pane-position";
 
17
    public const string COMPOSER_PANE_POSITION_KEY = "composer-pane-position";
14
18
    public const string AUTOSELECT_KEY = "autoselect";
15
19
    public const string DISPLAY_PREVIEW_KEY = "display-preview";
16
20
    public const string SPELL_CHECK_KEY = "spell-check";
37
41
        get { return settings.get_boolean(WINDOW_MAXIMIZE_KEY); }
38
42
    }
39
43
    
40
 
    public int folder_list_pane_position {
 
44
    public int folder_list_pane_position_old {
41
45
        get { return settings.get_int(FOLDER_LIST_PANE_POSITION_KEY); }
42
46
    }
43
47
    
 
48
    public int folder_list_pane_position_horizontal {
 
49
        get { return settings.get_int(FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY); }
 
50
        set { settings.set_int(FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY, value); }
 
51
    }
 
52
    
 
53
    public int folder_list_pane_position_vertical {
 
54
        get { return settings.get_int(FOLDER_LIST_PANE_POSITION_VERTICAL_KEY); }
 
55
    }
 
56
    
 
57
    public bool folder_list_pane_horizontal {
 
58
        get { return settings.get_boolean(FOLDER_LIST_PANE_HORIZONTAL_KEY); }
 
59
    }
 
60
    
44
61
    public int messages_pane_position {
45
62
        get { return settings.get_int(MESSAGES_PANE_POSITION_KEY); }
 
63
        set { settings.set_int(MESSAGES_PANE_POSITION_KEY, value); }
 
64
    }
 
65
    
 
66
    public int composer_pane_position {
 
67
        get { return settings.get_int(COMPOSER_PANE_POSITION_KEY); }
46
68
    }
47
69
    
48
70
    public bool autoselect {
74
96
    private const string TIME_FORMAT_KEY = "time-format";
75
97
    public Date.ClockFormat clock_format {
76
98
        get {
77
 
            if (indicator_datetime != null) {
 
99
            if (GearyApplication.instance.is_running_unity && indicator_datetime != null) {
78
100
                string format = indicator_datetime.get_string(TIME_FORMAT_KEY);
79
101
                if (format == "12-hour")
80
102
                    return Date.ClockFormat.TWELVE_HOURS;
135
157
        if (!settings.set_boolean(name, value))
136
158
            message("Unable to set configuration value %s = %s", name, value.to_string());
137
159
    }
 
160
    
 
161
    public Geary.SearchQuery.Strategy get_search_strategy() {
 
162
        switch (settings.get_string("search-strategy").down()) {
 
163
            case "exact":
 
164
                return Geary.SearchQuery.Strategy.EXACT;
 
165
            
 
166
            case "aggressive":
 
167
                return Geary.SearchQuery.Strategy.AGGRESSIVE;
 
168
            
 
169
            case "horizon":
 
170
                return Geary.SearchQuery.Strategy.HORIZON;
 
171
            
 
172
            case "conservative":
 
173
            default:
 
174
                return Geary.SearchQuery.Strategy.CONSERVATIVE;
 
175
        }
 
176
    }
 
177
    
 
178
    public void set_search_strategy(Geary.SearchQuery.Strategy strategy) {
 
179
        switch (strategy) {
 
180
            case Geary.SearchQuery.Strategy.EXACT:
 
181
                settings.set_string("search-strategy", "exact");
 
182
            break;
 
183
            
 
184
            case Geary.SearchQuery.Strategy.AGGRESSIVE:
 
185
                settings.set_string("search-strategy", "aggressive");
 
186
            break;
 
187
            
 
188
            case Geary.SearchQuery.Strategy.HORIZON:
 
189
                settings.set_string("search-strategy", "horizon");
 
190
            break;
 
191
            
 
192
            case Geary.SearchQuery.Strategy.CONSERVATIVE:
 
193
            default:
 
194
                settings.set_string("search-strategy", "conservative");
 
195
            break;
 
196
        }
 
197
    }
138
198
}
139
199