diff options
Diffstat (limited to 'shell/shell.c')
-rw-r--r-- | shell/shell.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/shell/shell.c b/shell/shell.c index 75ee8300..31836d62 100644 --- a/shell/shell.c +++ b/shell/shell.c @@ -720,6 +720,22 @@ select_first_tree_item(gpointer data) return FALSE; } +gboolean hardinfo_link(const gchar *uri) { + /* Clicked link events pass through here on their + * way to the default handler (xdg-open). + * + * TODO: In the future, links could be used to + * jump to different pages in hardinfo. + * + * if (g_str_has_prefix(uri, "hardinfo:")) { + * hardinfo_navigate(g_utf8_strchr(uri, strlen("hardinfo"), ':') + 1); + * return TRUE; + * } + */ + + return FALSE; /* didn't handle it */ +} + void shell_init(GSList * modules) { if (shell) { @@ -729,6 +745,8 @@ void shell_init(GSList * modules) DEBUG("initializing shell"); + uri_set_function(hardinfo_link); + create_window(); shell_action_set_property("ConnectToAction", "is-important", TRUE); @@ -1502,6 +1520,10 @@ static void module_selected_show_info_list(GKeyFile *key_file, ngroups > 1); } +static gboolean detail_activate_link (GtkLabel *label, gchar *uri, gpointer user_data) { + return uri_open(uri); +} + static void module_selected_show_info_detail(GKeyFile *key_file, ShellModuleEntry *entry, gchar **groups) @@ -1570,6 +1592,9 @@ static void module_selected_show_info_detail(GKeyFile *key_file, gtk_box_pack_start(GTK_BOX(value_box), value_icon, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(value_box), value_label, TRUE, TRUE, 0); + g_signal_connect(key_label, "activate-link", G_CALLBACK(detail_activate_link), NULL); + g_signal_connect(value_label, "activate-link", G_CALLBACK(detail_activate_link), NULL); + gtk_widget_show(key_label); gtk_widget_show(value_box); gtk_widget_show(value_label); |