1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-03 10:15:45 +00:00

(trunk gtk) #2478: popup dialog for first-time users

This commit is contained in:
Charles Kerr 2009-10-02 21:03:55 +00:00
parent 21bd104bda
commit 9d87314eb0
3 changed files with 28 additions and 0 deletions

View file

@ -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 );

View file

@ -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

View file

@ -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"