X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fsettings.c;fp=src%2Fsettings.c;h=2f617c6834319abc457a7d78616c3504a1cce5dc;hb=2cf9ca6ed6eca3a02209f58ab86d663d7cfbf710;hp=0000000000000000000000000000000000000000;hpb=464cae462442ca890698a0d54e7fb927becd4347;p=ptask.git diff --git a/src/settings.c b/src/settings.c new file mode 100644 index 0000000..2f617c6 --- /dev/null +++ b/src/settings.c @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2012-2013 jeanfi@gmail.com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include + +const char *SETTINGS_KEY_WINDOW_WIDTH = "window-width"; +const char *SETTINGS_KEY_WINDOW_HEIGHT = "window-height"; +const char *SETTINGS_KEY_WINDOW_X = "window-x"; +const char *SETTINGS_KEY_WINDOW_Y = "window-y"; +const char *SETTINGS_KEY_SPLITER_VERTICAL_POS = "spliter-vertical-pos"; +const char *SETTINGS_KEY_SPLITER_HORIZONTAL_POS = "spliter-horizontal-pos"; +const char *SETTINGS_KEY_TASKS_SORT_COL = "tasks-sort-col"; +const char *SETTINGS_KEY_TASKS_SORT_ORDER = "tasks-sort-order"; + +const char * const SETTINGS_VISIBLE_COL_KEYS[] = { + "tasktree-id-visible", + "tasktree-description-visible", + "tasktree-project-visible", + "tasktree-uuid-visible", + "tasktree-priority-visible", + "tasktree-urgency-visible", + "tasktree-creation-date-visible", + "tasktree-due-visible", + "tasktree-start-visible", +}; + +static GSettings *settings; + +void settings_init() +{ + settings = g_settings_new("ptask"); +} + +gint settings_get_int(const gchar *key) +{ + return g_settings_get_int(settings, key); +} + +void settings_set_int(const gchar *key, gint value) +{ + g_settings_set_int(settings, key, value); +} + +gboolean settings_get_boolean(const gchar *key) +{ + return g_settings_get_boolean(settings, key); +} + +void settings_set_boolean(const gchar *key, gboolean value) +{ + g_settings_set_boolean(settings, key, value); +}