diff options
Diffstat (limited to 'shell.c')
-rw-r--r-- | shell.c | 41 |
1 files changed, 31 insertions, 10 deletions
@@ -28,6 +28,8 @@ #include <menu.h> #include <stock.h> +#include <binreloc.h> + /* * Internal Prototypes ******************************************************** */ @@ -103,7 +105,7 @@ void shell_action_set_enabled(const gchar *action_name, gboolean setting) } } -void shell_set_left_pane_visible(gboolean setting) +void shell_set_side_pane_visible(gboolean setting) { if (setting) gtk_widget_show(shell->tree->scroll); @@ -159,6 +161,12 @@ void shell_action_set_active(const gchar *action_name, gboolean setting) void shell_status_pulse(void) { + if (shell->_pulses++ == 20) { + /* we're pulsing for some time, disable the interface and change the cursor + to a hourglass */ + shell_view_set_enabled(FALSE); + } + gtk_progress_bar_pulse(GTK_PROGRESS_BAR(shell->progress)); while (gtk_events_pending()) gtk_main_iteration(); @@ -177,9 +185,10 @@ void shell_view_set_enabled(gboolean setting) { if (setting) { - widget_set_cursor(shell->window, GDK_LEFT_PTR); + shell->_pulses = 0; + widget_set_cursor(shell->window, GDK_LEFT_PTR); } else { - widget_set_cursor(shell->window, GDK_WATCH); + widget_set_cursor(shell->window, GDK_WATCH); } gtk_widget_set_sensitive(shell->hpaned, setting); @@ -238,7 +247,7 @@ destroy_me(void) static void create_window(void) { - GtkWidget *vbox, *hbox; + GtkWidget *vbox, *hbox; shell = g_new0(Shell, 1); @@ -290,11 +299,17 @@ create_window(void) static void shell_tree_modules_load(ShellTree * shelltree) { + gchar *modules_conf; GKeyFile *keyfile = g_key_file_new(); guint categories, i; keyfile = g_key_file_new(); - g_key_file_load_from_file(keyfile, PREFIX "modules.conf", 0, NULL); + + modules_conf = g_strdup_printf("%s/hardinfo/modules.conf", + gbr_find_data_dir(PREFIX)); + g_key_file_load_from_file(keyfile, modules_conf, 0, NULL); + g_free(modules_conf); + if (g_key_file_get_integer(keyfile, "general", "version", NULL) != 2) { g_error("Wrong version of modules.conf"); } @@ -312,7 +327,9 @@ shell_tree_modules_load(ShellTree * shelltree) module->icon = icon_cache_get_pixbuf(tmp); g_free(tmp); - tmp = g_strdup_printf(PREFIX "modules/%s.so", iname); + tmp = g_strdup_printf("%s/hardinfo/modules/%s.so", + gbr_find_lib_dir(PREFIX), + iname); module->dll = g_module_open(tmp, G_MODULE_BIND_LAZY); g_free(tmp); @@ -519,7 +536,7 @@ shell_init(void) gtk_widget_hide(shell->notebook); shell_action_set_enabled("RefreshAction", FALSE); - shell_action_set_active("LeftPaneAction", TRUE); + shell_action_set_active("SidePaneAction", TRUE); shell_action_set_active("ToolbarAction", TRUE); shell_action_set_property("RefreshAction", "is-important", TRUE); shell_action_set_property("ReportAction", "is-important", TRUE); @@ -539,10 +556,10 @@ update_field(gpointer data) SHELL_VIEW_LOAD_GRAPH */ if (fu->loadgraph && shell->view_type == SHELL_VIEW_LOAD_GRAPH) { GtkTreeSelection *ts; - + ts = gtk_tree_view_get_selection(GTK_TREE_VIEW (shell->info->view)); - + if (iter && gtk_tree_selection_iter_is_selected(ts, iter)) { load_graph_update(shell->loadgraph, atoi(value)); } @@ -667,7 +684,7 @@ group_handle_special(GKeyFile * key_file, ShellModuleEntry * entry, fu->field_name = g_strdup(strchr(key, '$') + 1); fu->entry = entry; fu->loadgraph = TRUE; - + g_timeout_add(ms, update_field, fu); } else if (g_str_equal(key, "ReloadInterval")) { gint ms; @@ -723,6 +740,10 @@ group_handle_normal(GKeyFile * key_file, ShellModuleEntry * entry, GtkTreeIter child; value = g_key_file_get_value(key_file, group, key, NULL); + if (g_str_equal(value, "...") && entry->fieldfunc) { + g_free(value); + value = entry->fieldfunc(key); + } if (g_utf8_validate(key, -1, NULL) && g_utf8_validate(value, -1, NULL)) { gtk_tree_store_append(store, &child, &parent); |