1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 17:17:31 +00:00

(qt) #3268:Within each session, each torrent added presents options dialog for that and all previous torrents added in that sesssion

This commit is contained in:
Daniel Lee 2010-06-17 05:56:48 +00:00
parent fb8bcfb05d
commit 14cfd0fac0
2 changed files with 14 additions and 19 deletions

View file

@ -90,7 +90,6 @@ TrMainWindow :: TrMainWindow( Session& session, Prefs& prefs, TorrentModel& mode
myAboutDialog( new AboutDialog( this ) ), myAboutDialog( new AboutDialog( this ) ),
myStatsDialog( new StatsDialog( session, this ) ), myStatsDialog( new StatsDialog( session, this ) ),
myDetailsDialog( 0 ), myDetailsDialog( 0 ),
myFileDialog( 0 ),
myFilterModel( prefs ), myFilterModel( prefs ),
myTorrentDelegate( new TorrentDelegate( this ) ), myTorrentDelegate( new TorrentDelegate( this ) ),
myTorrentDelegateMin( new TorrentDelegateMin( this ) ), myTorrentDelegateMin( new TorrentDelegateMin( this ) ),
@ -1112,24 +1111,21 @@ TrMainWindow :: newTorrent( )
void void
TrMainWindow :: openTorrent( ) TrMainWindow :: openTorrent( )
{ {
if( myFileDialog == 0 ) QFileDialog * myFileDialog;
{ myFileDialog = new QFileDialog( this,
myFileDialog = new QFileDialog( this, tr( "Add Torrent" ),
tr( "Add Torrent" ), myPrefs.getString( Prefs::OPEN_DIALOG_FOLDER ),
myPrefs.getString( Prefs::OPEN_DIALOG_FOLDER ), tr( "Torrent Files (*.torrent);;All Files (*.*)" ) );
tr( "Torrent Files (*.torrent);;All Files (*.*)" ) ); myFileDialog->setFileMode( QFileDialog::ExistingFiles );
myFileDialog->setFileMode( QFileDialog::ExistingFiles );
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 );
myFileDialogOptionsCheck = button;
QCheckBox * button = new QCheckBox( tr( "Show &options dialog" ) ); connect( myFileDialog, SIGNAL(filesSelected(const QStringList&)),
button->setChecked( myPrefs.getBool( Prefs::OPTIONS_PROMPT ) ); this, SLOT(addTorrents(const QStringList&)));
QGridLayout * layout = dynamic_cast<QGridLayout*>(myFileDialog->layout());
layout->addWidget( button, layout->rowCount( ), 0, 1, -1, Qt::AlignLeft );
myFileDialogOptionsCheck = button;
connect( myFileDialog, SIGNAL(filesSelected(const QStringList&)),
this, SLOT(addTorrents(const QStringList&)));
}
myFileDialog->show( ); myFileDialog->show( );
} }

View file

@ -15,11 +15,11 @@
#include <ctime> #include <ctime>
#include <QCheckBox> #include <QCheckBox>
#include <QFileDialog>
#include <QLineEdit> #include <QLineEdit>
#include <QIcon> #include <QIcon>
#include <QMainWindow> #include <QMainWindow>
#include <QMap> #include <QMap>
#include <QPushButton>
#include <QSet> #include <QSet>
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include <QTimer> #include <QTimer>
@ -60,7 +60,6 @@ class TrMainWindow: public QMainWindow
QDialog * myAboutDialog; QDialog * myAboutDialog;
QDialog * myStatsDialog; QDialog * myStatsDialog;
Details * myDetailsDialog; Details * myDetailsDialog;
QFileDialog * myFileDialog;
QCheckBox * myFileDialogOptionsCheck; QCheckBox * myFileDialogOptionsCheck;
QSystemTrayIcon myTrayIcon; QSystemTrayIcon myTrayIcon;
TorrentFilter myFilterModel; TorrentFilter myFilterModel;