mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +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:
parent
fb8bcfb05d
commit
14cfd0fac0
2 changed files with 14 additions and 19 deletions
|
@ -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( );
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue