diff --git a/gtk/conf.c b/gtk/conf.c index 34df79812..3e3dd010f 100644 --- a/gtk/conf.c +++ b/gtk/conf.c @@ -165,6 +165,7 @@ tr_prefs_init_defaults( tr_benc * d ) tr_bencDictAddBool( d, PREF_KEY_DIR_WATCH_ENABLED, FALSE ); #endif + tr_bencDictAddBool( d, PREF_KEY_LEGAL_DIALOG_ON_STARTUP, TRUE ); tr_bencDictAddBool( d, PREF_KEY_INHIBIT_HIBERNATION, FALSE ); tr_bencDictAddBool( d, PREF_KEY_BLOCKLIST_UPDATES_ENABLED, TRUE ); diff --git a/gtk/main.c b/gtk/main.c index bcdb5f5de..a45b84ae0 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -541,6 +541,32 @@ appsetup( TrWindow * wind, gtk_window_set_skip_taskbar_hint( cbdata->wind, cbdata->icon != NULL ); } + + if( pref_flag_get( PREF_KEY_LEGAL_DIALOG_ON_STARTUP ) ) + { + GtkWidget * w = gtk_message_dialog_new( GTK_WINDOW( wind ), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_NONE, + "%s", + _( "Transmission is a file-sharing program. When you run a torrent " + "in Transmission, its files are made available for copying to " + "other computers. And, of course, any content you share is your " + "sole responsibility.\n\n" + "You probably knew this, so we won't tell you again." ) ); + gtk_dialog_add_button( GTK_DIALOG( w ), GTK_STOCK_QUIT, GTK_RESPONSE_REJECT ); + gtk_dialog_add_button( GTK_DIALOG( w ), _( "I Accept" ), GTK_RESPONSE_ACCEPT ); + gtk_dialog_set_default_response( GTK_DIALOG( w ), GTK_RESPONSE_ACCEPT ); + switch( gtk_dialog_run( GTK_DIALOG( w ) ) ) { + case GTK_RESPONSE_ACCEPT: + /* only show it once */ + pref_flag_set( PREF_KEY_LEGAL_DIALOG_ON_STARTUP, FALSE ); + gtk_widget_destroy( w ); + break; + default: + exit( 0 ); + } + } } static void diff --git a/gtk/tr-prefs.h b/gtk/tr-prefs.h index 43cbe19e6..5271a76f7 100644 --- a/gtk/tr-prefs.h +++ b/gtk/tr-prefs.h @@ -21,6 +21,7 @@ GtkWidget * tr_prefs_dialog_new( GObject * core, /* if you add a key here, you /must/ add its * default in tr_prefs_init_defaults( void ) */ +#define PREF_KEY_LEGAL_DIALOG_ON_STARTUP "show-legal-dialog-on-startup" #define PREF_KEY_OPTIONS_PROMPT "show-options-window" #define PREF_KEY_OPEN_DIALOG_FOLDER "open-dialog-dir" #define PREF_KEY_INHIBIT_HIBERNATION "inhibit-desktop-hibernation"