mirror of
https://github.com/transmission/transmission
synced 2025-02-22 06:00:41 +00:00
(trunk gtk,qt) synchronize the gtk, qt preferences dialogs a bit
This commit is contained in:
parent
0df58b9ab4
commit
2c94fbdfd7
6 changed files with 44 additions and 23 deletions
|
@ -295,10 +295,10 @@ addSingleTorrentDialog( GtkWindow * parent,
|
|||
data->filename = g_strdup( tr_ctorGetSourceFile( ctor ) );
|
||||
data->downloadDir = g_strdup( str );
|
||||
data->list = file_list_new( core, 0 );
|
||||
data->trash_check =
|
||||
gtk_check_button_new_with_mnemonic( _( "_Move source file to Trash" ) );
|
||||
data->run_check =
|
||||
gtk_check_button_new_with_mnemonic( _( "_Start when added" ) );
|
||||
str = _( "Mo_ve .torrent file to the trash" );
|
||||
data->trash_check = gtk_check_button_new_with_mnemonic( str );
|
||||
str = _( "_Start when added" );
|
||||
data->run_check = gtk_check_button_new_with_mnemonic( str );
|
||||
|
||||
g_signal_connect( G_OBJECT( d ), "response",
|
||||
G_CALLBACK( addResponseCB ), data );
|
||||
|
@ -457,7 +457,7 @@ addDialog( GtkWindow * parent,
|
|||
if( ( folder = pref_string_get( PREF_KEY_OPEN_DIALOG_FOLDER ) ) )
|
||||
gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER( w ), folder );
|
||||
|
||||
c = gtk_check_button_new_with_mnemonic( _( "Display _options dialog" ) );
|
||||
c = gtk_check_button_new_with_mnemonic( _( "Show _options dialog" ) );
|
||||
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( c ),
|
||||
pref_flag_get( PREF_KEY_OPTIONS_PROMPT ) );
|
||||
gtk_file_chooser_set_extra_widget( GTK_FILE_CHOOSER( w ), c );
|
||||
|
|
|
@ -552,7 +552,7 @@ appsetup( TrWindow * wind,
|
|||
"%s",
|
||||
_( "Transmission is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. And of course, any content you share is your sole responsibility.\n\nYou 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_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:
|
||||
|
|
|
@ -290,14 +290,7 @@ torrentPage( GObject * core )
|
|||
hig_workarea_add_row_w( t, &row, l, w, NULL );
|
||||
#endif
|
||||
|
||||
s = _( "Keep incomplete files in:" );
|
||||
l = new_check_button( s, TR_PREFS_KEY_INCOMPLETE_DIR_ENABLED, core );
|
||||
w = new_path_chooser_button( TR_PREFS_KEY_INCOMPLETE_DIR, core );
|
||||
gtk_widget_set_sensitive( GTK_WIDGET( w ), pref_flag_get( TR_PREFS_KEY_INCOMPLETE_DIR_ENABLED ) );
|
||||
g_signal_connect( l, "toggled", G_CALLBACK( target_cb ), w );
|
||||
hig_workarea_add_row_w( t, &row, l, w, NULL );
|
||||
|
||||
s = _( "Display _options dialog" );
|
||||
s = _( "Show _options dialog" );
|
||||
w = new_check_button( s, PREF_KEY_OPTIONS_PROMPT, core );
|
||||
hig_workarea_add_wide_control( t, &row, w );
|
||||
|
||||
|
@ -305,10 +298,17 @@ torrentPage( GObject * core )
|
|||
w = new_check_button( s, PREF_KEY_START, core );
|
||||
hig_workarea_add_wide_control( t, &row, w );
|
||||
|
||||
s = _( "Mo_ve source files to Trash" );
|
||||
s = _( "Mo_ve .torrent file to the trash" );
|
||||
w = new_check_button( s, PREF_KEY_TRASH_ORIGINAL, core );
|
||||
hig_workarea_add_wide_control( t, &row, w );
|
||||
|
||||
s = _( "Keep _incomplete files in:" );
|
||||
l = new_check_button( s, TR_PREFS_KEY_INCOMPLETE_DIR_ENABLED, core );
|
||||
w = new_path_chooser_button( TR_PREFS_KEY_INCOMPLETE_DIR, core );
|
||||
gtk_widget_set_sensitive( GTK_WIDGET( w ), pref_flag_get( TR_PREFS_KEY_INCOMPLETE_DIR_ENABLED ) );
|
||||
g_signal_connect( l, "toggled", G_CALLBACK( target_cb ), w );
|
||||
hig_workarea_add_row_w( t, &row, l, w, NULL );
|
||||
|
||||
w = new_path_chooser_button( TR_PREFS_KEY_DOWNLOAD_DIR, core );
|
||||
hig_workarea_add_row( t, &row, _( "Save to _Location:" ), w, NULL );
|
||||
|
||||
|
@ -345,11 +345,11 @@ desktopPage( GObject * core )
|
|||
w = new_check_button( s, PREF_KEY_INHIBIT_HIBERNATION, core );
|
||||
hig_workarea_add_wide_control( t, &row, w );
|
||||
|
||||
s = _( "Show Transmission in the notification _area" );
|
||||
s = _( "Show Transmission in the _notification area" );
|
||||
w = new_check_button( s, PREF_KEY_SHOW_TRAY_ICON, core );
|
||||
hig_workarea_add_wide_control( t, &row, w );
|
||||
|
||||
s = _( "Show popup _notifications" );
|
||||
s = _( "Show _popup notifications" );
|
||||
w = new_check_button( s, PREF_KEY_SHOW_DESKTOP_NOTIFICATION, core );
|
||||
hig_workarea_add_wide_control( t, &row, w );
|
||||
|
||||
|
|
|
@ -1080,7 +1080,7 @@ TrMainWindow :: openTorrent( )
|
|||
myFileDialog->setFileMode( QFileDialog::ExistingFiles );
|
||||
|
||||
|
||||
QCheckBox * button = new QCheckBox( tr( "Display &options dialog" ) );
|
||||
QCheckBox * button = new QCheckBox( tr( "Show &options dialog" ) );
|
||||
button->setChecked( myPrefs.getBool( Prefs::OPTIONS_PROMPT ) );
|
||||
QGridLayout * layout = dynamic_cast<QGridLayout*>(myFileDialog->layout());
|
||||
layout->addWidget( button, layout->rowCount( ), 0, 1, -1, Qt::AlignLeft );
|
||||
|
|
|
@ -110,7 +110,7 @@ Options :: Options( Session& session, const Prefs& prefs, const QString& filenam
|
|||
c->setChecked( prefs.getBool( Prefs :: START ) );
|
||||
layout->addWidget( c, ++row, 0, 1, 2, Qt::AlignLeft );
|
||||
|
||||
c = myTrashCheck = new QCheckBox( tr( "&Delete source file" ) );
|
||||
c = myTrashCheck = new QCheckBox( tr( "Mo&ve .torrent file to the trash" ) );
|
||||
c->setChecked( prefs.getBool( Prefs :: TRASH_ORIGINAL ) );
|
||||
layout->addWidget( c, ++row, 0, 1, 2, Qt::AlignLeft );
|
||||
|
||||
|
|
|
@ -563,9 +563,15 @@ PrefsDialog :: createTorrentsTab( )
|
|||
hig->addRow( l, b );
|
||||
enableBuddyWhenChecked( qobject_cast<QCheckBox*>(l), b );
|
||||
|
||||
hig->addWideControl( checkBoxNew( tr( "Display &options dialog" ), Prefs::OPTIONS_PROMPT ) );
|
||||
hig->addWideControl( checkBoxNew( tr( "Show &options dialog" ), Prefs::OPTIONS_PROMPT ) );
|
||||
hig->addWideControl( checkBoxNew( tr( "&Start when added" ), Prefs::START ) );
|
||||
hig->addWideControl( checkBoxNew( tr( "&Delete source files" ), Prefs::TRASH_ORIGINAL ) );
|
||||
hig->addWideControl( checkBoxNew( tr( "Mo&ve .torrent file to the trash" ), Prefs::TRASH_ORIGINAL ) );
|
||||
|
||||
b = myIncompleteButton = new QPushButton;
|
||||
b->setIcon( folderPixmap );
|
||||
b->setStyleSheet( "text-align: left; padding-left: 5; padding-right: 5" );
|
||||
connect( b, SIGNAL(clicked(bool)), this, SLOT(onDestinationClicked(void)) );
|
||||
hig->addRow( tr( "Keep &incomplete files in:" ), b );
|
||||
|
||||
b = myDestinationButton = new QPushButton;
|
||||
b->setIcon( folderPixmap );
|
||||
|
@ -622,7 +628,9 @@ PrefsDialog :: PrefsDialog( Session& session, Prefs& prefs, QWidget * parent ):
|
|||
<< Prefs :: ENCRYPTION
|
||||
<< Prefs :: BLOCKLIST_ENABLED
|
||||
<< Prefs :: DIR_WATCH
|
||||
<< Prefs :: DOWNLOAD_DIR;
|
||||
<< Prefs :: DOWNLOAD_DIR
|
||||
<< Prefs :: INCOMPLETE_DIR
|
||||
<< Prefs :: INCOMPLETE_DIR_ENABLED;
|
||||
foreach( int key, keys )
|
||||
updatePref( key );
|
||||
|
||||
|
@ -709,11 +717,24 @@ PrefsDialog :: updatePref( int key )
|
|||
break;
|
||||
|
||||
case Prefs :: DOWNLOAD_DIR: {
|
||||
QString path( myPrefs.getString( Prefs :: DOWNLOAD_DIR ) );
|
||||
QString path( myPrefs.getString( key ) );
|
||||
myDestinationButton->setText( QFileInfo(path).fileName() );
|
||||
break;
|
||||
}
|
||||
|
||||
case Prefs :: INCOMPLETE_DIR: {
|
||||
QString path( myPrefs.getString( key ) );
|
||||
myIncompleteButton->setText( QFileInfo(path).fileName() );
|
||||
break;
|
||||
}
|
||||
|
||||
case Prefs :: INCOMPLETE_DIR_ENABLED: {
|
||||
const bool enabled = myPrefs.getBool( key );
|
||||
myIncompleteButton->setEnabled( enabled );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue