X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=panel-plugin%2Fxfce4-hdaps-dialogs.c;h=bacd540e22ae00e6a027879e53a5ecf18b43ac04;hb=9fb98b3d659e7f19e78a0a561c68e1152cadd3e1;hp=cd8f36a8e6b7f0dafcf9af0d1ca2170832d177dc;hpb=05a5da89a97689a8a6a06e1e6c34fedc0e5a6f35;p=xfce4-hdaps.git diff --git a/panel-plugin/xfce4-hdaps-dialogs.c b/panel-plugin/xfce4-hdaps-dialogs.c index cd8f36a..bacd540 100644 --- a/panel-plugin/xfce4-hdaps-dialogs.c +++ b/panel-plugin/xfce4-hdaps-dialogs.c @@ -102,9 +102,9 @@ void hdaps_configure(XfcePanelPlugin *plugin, dialog = xfce_titled_dialog_new_with_buttons(_("Hdaps Plugin"), GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))), GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_HELP, GTK_RESPONSE_HELP, - GTK_STOCK_SAVE, GTK_RESPONSE_OK, - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + "gtk-help", GTK_RESPONSE_HELP, + "gtk-save", GTK_RESPONSE_OK, + "gtk-cancel", GTK_RESPONSE_CANCEL, NULL); /* Center the dialog on screen. */ @@ -193,41 +193,34 @@ void hdaps_configure(XfcePanelPlugin *plugin, -/* URL handler used on the About dialog. */ -static void hdaps_url_handler(GtkAboutDialog *about, - const gchar *link, +/* URI (http(s):// and mailto://) handler used on the About dialog. */ +static void hdaps_uri_handler(GtkAboutDialog *about, + const gchar *uri, gpointer data) { gchar *cmd; - cmd = g_strdup_printf("%s %s","xdg-open", link); + cmd = g_strdup_printf("%s %s","xdg-open", uri); - /* Stolen from xfce4-power-manager. */ if (!g_spawn_command_line_async(cmd, NULL)) { g_free(cmd); - cmd = g_strdup_printf("%s %s","xfbrowser4", link); + cmd = g_strdup_printf("%s %s","xdg-open", uri); g_spawn_command_line_async(cmd, NULL); } g_free(cmd); } -/* Email address handler used on the About dialog. */ -static void hdaps_mailto_handler(GtkAboutDialog *about, - const gchar *link, - gpointer data) { - gchar *cmd = g_strdup_printf( "%s %s", "xdg-email", link); - - g_spawn_command_line_async(cmd, NULL); - g_free(cmd); -} - - void hdaps_about(XfcePanelPlugin *plugin) { const gchar *authors[] = { "Michael Orlitzky ", NULL }; const gchar *copyright = "Copyright \302\251 2012 Michael Orlitzky"; - gtk_about_dialog_set_url_hook(hdaps_url_handler, NULL, NULL); - gtk_about_dialog_set_email_hook(hdaps_mailto_handler, NULL, NULL); + /* Use a custom URI handler for http(s):// and mailto:// URIs. The + default behavior apparently needs gio/gvfs to work, and I don't + have those installed. */ + g_signal_connect(plugin, + "activate-link", + G_CALLBACK(hdaps_uri_handler), + NULL); gtk_show_about_dialog(NULL, "authors", authors,