1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 09:13:06 +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 ) ),
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<QGridLayout*>(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<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&)));
}
connect( myFileDialog, SIGNAL(filesSelected(const QStringList&)),
this, SLOT(addTorrents(const QStringList&)));
myFileDialog->show( );
}

View file

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