From 14cfd0fac027987e66d4195d65de9b7361623fe4 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Thu, 17 Jun 2010 05:56:48 +0000 Subject: [PATCH] (qt) #3268:Within each session, each torrent added presents options dialog for that and all previous torrents added in that sesssion --- qt/mainwin.cc | 30 +++++++++++++----------------- qt/mainwin.h | 3 +-- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/qt/mainwin.cc b/qt/mainwin.cc index baeed0f04..89907b70d 100644 --- a/qt/mainwin.cc +++ b/qt/mainwin.cc @@ -90,7 +90,6 @@ TrMainWindow :: TrMainWindow( Session& session, Prefs& prefs, TorrentModel& mode myAboutDialog( new AboutDialog( this ) ), myStatsDialog( new StatsDialog( session, this ) ), myDetailsDialog( 0 ), - myFileDialog( 0 ), myFilterModel( prefs ), myTorrentDelegate( new TorrentDelegate( this ) ), myTorrentDelegateMin( new TorrentDelegateMin( this ) ), @@ -1112,24 +1111,21 @@ TrMainWindow :: newTorrent( ) void TrMainWindow :: openTorrent( ) { - if( myFileDialog == 0 ) - { - myFileDialog = new QFileDialog( this, - tr( "Add Torrent" ), - myPrefs.getString( Prefs::OPEN_DIALOG_FOLDER ), - tr( "Torrent Files (*.torrent);;All Files (*.*)" ) ); - myFileDialog->setFileMode( QFileDialog::ExistingFiles ); + QFileDialog * myFileDialog; + myFileDialog = new QFileDialog( this, + tr( "Add Torrent" ), + myPrefs.getString( Prefs::OPEN_DIALOG_FOLDER ), + tr( "Torrent Files (*.torrent);;All Files (*.*)" ) ); + myFileDialog->setFileMode( QFileDialog::ExistingFiles ); + QCheckBox * button = new QCheckBox( tr( "Show &options dialog" ) ); + button->setChecked( myPrefs.getBool( Prefs::OPTIONS_PROMPT ) ); + QGridLayout * layout = dynamic_cast(myFileDialog->layout()); + layout->addWidget( button, layout->rowCount( ), 0, 1, -1, Qt::AlignLeft ); + myFileDialogOptionsCheck = button; - QCheckBox * button = new QCheckBox( tr( "Show &options dialog" ) ); - button->setChecked( myPrefs.getBool( Prefs::OPTIONS_PROMPT ) ); - QGridLayout * layout = dynamic_cast(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&))); - } + connect( myFileDialog, SIGNAL(filesSelected(const QStringList&)), + this, SLOT(addTorrents(const QStringList&))); myFileDialog->show( ); } diff --git a/qt/mainwin.h b/qt/mainwin.h index e18f66871..85a83b552 100644 --- a/qt/mainwin.h +++ b/qt/mainwin.h @@ -15,11 +15,11 @@ #include #include -#include #include #include #include #include +#include #include #include #include @@ -60,7 +60,6 @@ class TrMainWindow: public QMainWindow QDialog * myAboutDialog; QDialog * myStatsDialog; Details * myDetailsDialog; - QFileDialog * myFileDialog; QCheckBox * myFileDialogOptionsCheck; QSystemTrayIcon myTrayIcon; TorrentFilter myFilterModel;