aboutsummaryrefslogtreecommitdiff
path: root/shell/callbacks.c
diff options
context:
space:
mode:
authorL. Pereira <l@tia.mat.br>2023-08-14 22:33:51 -0700
committerL. Pereira <l@tia.mat.br>2023-08-14 22:33:51 -0700
commit8d6c28b8ce4d9959f907c0a48c5032241654fbc8 (patch)
treeab41a708ea34e636e7252dacdd5e15c56f77e092 /shell/callbacks.c
parenta2ac044128305c426235de1b9d3f83ba27c36407 (diff)
Add option to synchronize during startup
Diffstat (limited to 'shell/callbacks.c')
-rw-r--r--shell/callbacks.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/shell/callbacks.c b/shell/callbacks.c
index c6f7997f..9c281eaa 100644
--- a/shell/callbacks.c
+++ b/shell/callbacks.c
@@ -37,6 +37,24 @@ void cb_sync_manager()
sync_manager_show(shell->window);
}
+void cb_sync_on_startup()
+{
+ gboolean setting = shell_action_get_active("SyncOnStartupAction");
+ GKeyFile *key_file = g_key_file_new();
+
+ gchar *conf_path = g_build_filename(g_get_user_config_dir(), "hardinfo",
+ "settings.ini", NULL);
+
+ g_key_file_load_from_file(
+ key_file, conf_path,
+ G_KEY_FILE_KEEP_COMMENTS | G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
+ g_key_file_set_boolean(key_file, "Sync", "OnStartup", setting);
+ g_key_file_save_to_file(key_file, conf_path, NULL);
+
+ g_free(conf_path);
+ g_key_file_free(key_file);
+}
+
void cb_open_web_page()
{
uri_open("http://www.hardinfo.org");