From: Charles Kerr Date: Fri, 9 May 2008 03:20:34 +0000 (+0000) Subject: (gtk) #927: "help" button in the preferences dialog X-Git-Tag: 1.20~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=908ff151be9cb0d650ec53457bb9e26264be6e4c;p=transmission (gtk) #927: "help" button in the preferences dialog --- diff --git a/gtk/tr-prefs.c b/gtk/tr-prefs.c index 472709ebe..8b2a22b88 100644 --- a/gtk/tr-prefs.c +++ b/gtk/tr-prefs.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "conf.h" #include "hig.h" @@ -100,9 +101,14 @@ tr_prefs_init_global( void ) #define PREF_KEY "pref-key" static void -response_cb( GtkDialog * dialog, int response UNUSED, gpointer unused UNUSED ) +response_cb( GtkDialog * dialog, int response, gpointer unused UNUSED ) { - gtk_widget_destroy( GTK_WIDGET(dialog) ); + if( response == GTK_RESPONSE_HELP ) + gtr_open_file( "http://www.transmissionbt.com/help/gtk/" + SHORT_VERSION_STRING "/html/preferences.html" ); + + if( response == GTK_RESPONSE_CLOSE ) + gtk_widget_destroy( GTK_WIDGET(dialog) ); } static void @@ -556,6 +562,7 @@ tr_prefs_dialog_new( GObject * core, GtkWindow * parent ) d = gtk_dialog_new_with_buttons( _( "Transmission Preferences" ), parent, GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_HELP, GTK_RESPONSE_HELP, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL ); gtk_window_set_role( GTK_WINDOW(d), "transmission-preferences-dialog" );