2 * Copyright (C) 2012-2013 jeanfi@gmail.com
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 const char *SETTINGS_KEY_WINDOW_WIDTH = "window-width";
23 const char *SETTINGS_KEY_WINDOW_HEIGHT = "window-height";
24 const char *SETTINGS_KEY_WINDOW_X = "window-x";
25 const char *SETTINGS_KEY_WINDOW_Y = "window-y";
26 const char *SETTINGS_KEY_SPLITER_VERTICAL_POS = "spliter-vertical-pos";
27 const char *SETTINGS_KEY_SPLITER_HORIZONTAL_POS = "spliter-horizontal-pos";
28 const char *SETTINGS_KEY_TASKS_SORT_COL = "tasks-sort-col";
29 const char *SETTINGS_KEY_TASKS_SORT_ORDER = "tasks-sort-order";
30 const char *SETTINGS_KEY_NOTES_DIR = "notes-dir";
32 const char * const SETTINGS_VISIBLE_COL_KEYS[] = {
33 "tasktree-id-visible",
34 "tasktree-description-visible",
35 "tasktree-project-visible",
36 "tasktree-uuid-visible",
37 "tasktree-priority-visible",
38 "tasktree-urgency-visible",
39 "tasktree-creation-date-visible",
40 "tasktree-due-visible",
41 "tasktree-start-visible",
44 static GSettings *settings;
48 settings = g_settings_new("ptask");
51 gint settings_get_int(const gchar *key)
53 return g_settings_get_int(settings, key);
56 void settings_set_int(const gchar *key, gint value)
58 g_settings_set_int(settings, key, value);
61 gboolean settings_get_boolean(const gchar *key)
63 return g_settings_get_boolean(settings, key);
66 void settings_set_boolean(const gchar *key, gboolean value)
68 g_settings_set_boolean(settings, key, value);
71 gchar *settings_get_str(const gchar *key)
73 return g_settings_get_string(settings, key);
76 void settings_set_str(const gchar *key, const gchar *value)
78 g_settings_set_string(settings, key, value);
81 const char *settings_get_notes_dir()
83 return settings_get_str(SETTINGS_KEY_NOTES_DIR);
86 void settings_set_notes_dir(const char *dir)
88 settings_set_str(SETTINGS_KEY_NOTES_DIR, dir);