aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/shell.c
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2009-05-09 11:57:06 -0300
committerLeandro A. F. Pereira <leandro@hardinfo.org>2009-05-09 11:57:06 -0300
commitdbaeacf7888957ca8d0cad69822b2fe4851b19d4 (patch)
treedad4e950c1e997870069120fcc30cf3663420810 /hardinfo2/shell.c
parent79bfb31978e30c1d9c1e6de5a8c234383b07bd66 (diff)
Change remote host dialog to be a Host Manager; add a Connect To window and a Remote menu.
Diffstat (limited to 'hardinfo2/shell.c')
-rw-r--r--hardinfo2/shell.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/hardinfo2/shell.c b/hardinfo2/shell.c
index 1024515b..94cb843f 100644
--- a/hardinfo2/shell.c
+++ b/hardinfo2/shell.c
@@ -585,6 +585,20 @@ static void __tree_iter_destroy(gpointer data)
gtk_tree_iter_free((GtkTreeIter *) data);
}
+void shell_save_hosts_file(void)
+{
+ gchar *path, *remote_conf;
+ gsize length;
+
+ path = g_build_filename(g_get_home_dir(), ".hardinfo", "remote.conf", NULL);
+
+ remote_conf = g_key_file_to_data(shell->hosts, &length, NULL);
+ g_file_set_contents(path, remote_conf, length, NULL);
+
+ g_free(remote_conf);
+ g_free(path);
+}
+
void shell_init(GSList * modules)
{
if (shell) {
@@ -600,6 +614,7 @@ void shell_init(GSList * modules)
shell_action_set_property("CopyAction", "is-important", TRUE);
shell_action_set_property("RefreshAction", "is-important", TRUE);
shell_action_set_property("ReportAction", "is-important", TRUE);
+ shell_action_set_property("ReportBugAction", "is-important", TRUE);
shell->tree = tree_new();
shell->info = info_tree_new(FALSE);
@@ -649,6 +664,18 @@ void shell_init(GSList * modules)
shell_action_set_enabled("SyncManagerAction", FALSE);
#else
shell_action_set_enabled("SyncManagerAction", sync_manager_count_entries() > 0);
+
+ {
+ gchar *path;
+
+ shell->hosts = g_key_file_new();
+ path = g_build_filename(g_get_home_dir(), ".hardinfo", "remote.conf", NULL);
+ g_key_file_load_from_file(shell->hosts, path, 0, NULL);
+ g_free(path);
+
+ g_atexit(shell_save_hosts_file);
+ }
+
#endif
}