mirror of
https://github.com/transmission/transmission
synced 2025-03-11 14:43:42 +00:00
(trunk qt) session dialog improvements from W4pp
This commit is contained in:
parent
b2c65797e0
commit
d41318bb05
6 changed files with 19 additions and 12 deletions
|
@ -79,6 +79,7 @@ namespace
|
|||
|
||||
TrMainWindow :: TrMainWindow( Session& session, Prefs& prefs, TorrentModel& model, bool minimized ):
|
||||
myLastFullUpdateTime( 0 ),
|
||||
mySessionDialog( new SessionDialog( session, prefs, this ) ),
|
||||
myPrefsDialog( new PrefsDialog( session, prefs, this ) ),
|
||||
myAboutDialog( new AboutDialog( this ) ),
|
||||
myStatsDialog( new StatsDialog( session, this ) ),
|
||||
|
@ -157,7 +158,7 @@ TrMainWindow :: TrMainWindow( Session& session, Prefs& prefs, TorrentModel& mode
|
|||
connect( ui.action_Contents, SIGNAL(triggered()), this, SLOT(openHelp()));
|
||||
connect( ui.action_OpenFolder, SIGNAL(triggered()), this, SLOT(openFolder()));
|
||||
connect( ui.action_Properties, SIGNAL(triggered()), this, SLOT(openProperties()));
|
||||
connect( ui.action_SessionDialog, SIGNAL(triggered()), this, SLOT(openSessionDialog()));
|
||||
connect( ui.action_SessionDialog, SIGNAL(triggered()), mySessionDialog, SLOT(show()));
|
||||
connect( ui.listView, SIGNAL(activated(const QModelIndex&)), ui.action_Properties, SLOT(trigger()));
|
||||
|
||||
// context menu
|
||||
|
@ -255,6 +256,7 @@ TrMainWindow :: TrMainWindow( Session& session, Prefs& prefs, TorrentModel& mode
|
|||
connect( &mySession, SIGNAL(statsUpdated()), this, SLOT(refreshStatusBar()) );
|
||||
connect( &mySession, SIGNAL(dataReadProgress()), this, SLOT(dataReadProgress()) );
|
||||
connect( &mySession, SIGNAL(dataSendProgress()), this, SLOT(dataSendProgress()) );
|
||||
connect( &mySession, SIGNAL(httpAuthenticationRequired()), this, SLOT(wrongAuthentication()) );
|
||||
|
||||
if( mySession.isServer( ) )
|
||||
myNetworkLabel->hide( );
|
||||
|
@ -596,13 +598,6 @@ TrMainWindow :: openProperties( )
|
|||
myDetailsDialog->show( );
|
||||
}
|
||||
|
||||
void
|
||||
TrMainWindow :: openSessionDialog( )
|
||||
{
|
||||
SessionDialog * d = new SessionDialog( mySession, myPrefs, this );
|
||||
d->show( );
|
||||
}
|
||||
|
||||
void
|
||||
TrMainWindow :: openFolder( )
|
||||
{
|
||||
|
@ -1094,3 +1089,10 @@ TrMainWindow :: dataSendProgress( )
|
|||
myLastSendTime = time( NULL );
|
||||
updateNetworkIcon( );
|
||||
}
|
||||
|
||||
void
|
||||
TrMainWindow :: wrongAuthentication( )
|
||||
{
|
||||
mySession.stop( );
|
||||
mySessionDialog->show( );
|
||||
}
|
||||
|
|
|
@ -52,6 +52,7 @@ class TrMainWindow: public QMainWindow
|
|||
|
||||
private:
|
||||
time_t myLastFullUpdateTime;
|
||||
QDialog * mySessionDialog;
|
||||
QDialog * myPrefsDialog;
|
||||
QDialog * myAboutDialog;
|
||||
QDialog * myStatsDialog;
|
||||
|
@ -113,7 +114,6 @@ class TrMainWindow: public QMainWindow
|
|||
void openHelp( );
|
||||
void openFolder( );
|
||||
void openProperties( );
|
||||
void openSessionDialog( );
|
||||
void toggleSpeedMode( );
|
||||
void dataReadProgress( );
|
||||
void dataSendProgress( );
|
||||
|
@ -180,6 +180,7 @@ class TrMainWindow: public QMainWindow
|
|||
void setTrayIconVisible( bool );
|
||||
void setMinimalView( bool );
|
||||
void refreshActionSensitivity( );
|
||||
void wrongAuthentication( );
|
||||
|
||||
public:
|
||||
TrMainWindow( Session&, Prefs&, TorrentModel&, bool minized );
|
||||
|
|
|
@ -125,7 +125,9 @@ Options :: Options( Session& session, const Prefs& prefs, const QString& filenam
|
|||
|
||||
connect( myTree, SIGNAL(priorityChanged(const QSet<int>&,int)), this, SLOT(onPriorityChanged(const QSet<int>&,int)));
|
||||
connect( myTree, SIGNAL(wantedChanged(const QSet<int>&,bool)), this, SLOT(onWantedChanged(const QSet<int>&,bool)));
|
||||
connect( myVerifyButton, SIGNAL(clicked(bool)), this, SLOT(onVerify()));
|
||||
if( session.isLocal( ) )
|
||||
connect( myVerifyButton, SIGNAL(clicked(bool)), this, SLOT(onVerify()));
|
||||
|
||||
connect( &myVerifyTimer, SIGNAL(timeout()), this, SLOT(onTimeout()));
|
||||
|
||||
reload( );
|
||||
|
|
|
@ -37,7 +37,7 @@ SessionDialog :: onAccepted( )
|
|||
myPrefs.set( Prefs::SESSION_REMOTE_USERNAME, myUsernameLineEdit->text( ) );
|
||||
myPrefs.set( Prefs::SESSION_REMOTE_PASSWORD, myPasswordLineEdit->text( ) );
|
||||
mySession.restart( );
|
||||
deleteLater( );
|
||||
hide( );
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -111,7 +111,7 @@ SessionDialog :: SessionDialog( Session& session, Prefs& prefs, QWidget * parent
|
|||
resensitize( );
|
||||
|
||||
QDialogButtonBox * buttons = new QDialogButtonBox( QDialogButtonBox::Cancel|QDialogButtonBox::Ok );
|
||||
connect( buttons, SIGNAL(rejected()), this, SLOT(deleteLater()));
|
||||
connect( buttons, SIGNAL(rejected()), this, SLOT(hide()));
|
||||
connect( buttons, SIGNAL(accepted()), this, SLOT(onAccepted()));
|
||||
top->addWidget( buttons, 0 );
|
||||
}
|
||||
|
|
|
@ -193,6 +193,7 @@ Session :: Session( const char * configDir, Prefs& prefs ):
|
|||
connect( &myHttp, SIGNAL(requestFinished(int,bool)), this, SLOT(onRequestFinished(int,bool)));
|
||||
connect( &myHttp, SIGNAL(dataReadProgress(int,int)), this, SIGNAL(dataReadProgress()));
|
||||
connect( &myHttp, SIGNAL(dataSendProgress(int,int)), this, SIGNAL(dataSendProgress()));
|
||||
connect( &myHttp, SIGNAL(authenticationRequired(QString, quint16, QAuthenticator*)), this, SIGNAL(httpAuthenticationRequired()) );
|
||||
connect( &myPrefs, SIGNAL(changed(int)), this, SLOT(updatePref(int)) );
|
||||
|
||||
myBuffer.open( QIODevice::ReadWrite );
|
||||
|
|
|
@ -122,6 +122,7 @@ class Session: public QObject
|
|||
void torrentsRemoved( struct tr_benc * torrentList );
|
||||
void dataReadProgress( );
|
||||
void dataSendProgress( );
|
||||
void httpAuthenticationRequired( );
|
||||
|
||||
private:
|
||||
int64_t myBlocklistSize;
|
||||
|
|
Loading…
Add table
Reference in a new issue