Changeset 10630


Ignore:
Timestamp:
May 6, 2010, 4:49:10 AM (11 years ago)
Author:
charles
Message:

(trunk qt) #2050 "properties dialog changes seem to undo themselves" -- applied 2nd patch from Longinus00

Location:
trunk/qt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/mainwin.cc

    r10532 r10630  
    8787    myLastFullUpdateTime( 0 ),
    8888    mySessionDialog( new SessionDialog( session, prefs, this ) ),
    89     myPrefsDialog( new PrefsDialog( session, prefs, this ) ),
     89    myPrefsDialog( 0 ),
    9090    myAboutDialog( new AboutDialog( this ) ),
    9191    myStatsDialog( new StatsDialog( session, this ) ),
     
    160160    connect( ui.action_AddURL, SIGNAL(triggered()), this, SLOT(openURL()));
    161161    connect( ui.action_New, SIGNAL(triggered()), this, SLOT(newTorrent()));
    162     connect( ui.action_Preferences, SIGNAL(triggered()), myPrefsDialog, SLOT(show()));
     162    connect( ui.action_Preferences, SIGNAL(triggered()), this, SLOT(openPreferences()));
    163163    connect( ui.action_Statistics, SIGNAL(triggered()), myStatsDialog, SLOT(show()));
    164164    connect( ui.action_About, SIGNAL(triggered()), myAboutDialog, SLOT(show()));
     
    631631
    632632void
     633TrMainWindow :: onPrefsDestroyed( )
     634{
     635    myPrefsDialog = 0;
     636}
     637
     638void
     639TrMainWindow :: openPreferences( )
     640{
     641    if( myPrefsDialog == 0 ) {
     642        myPrefsDialog = new PrefsDialog( mySession, myPrefs, this );
     643        connect( myPrefsDialog, SIGNAL(destroyed(QObject*)), this, SLOT(onPrefsDestroyed()));
     644    }
     645
     646    myPrefsDialog->show( );
     647}
     648
     649void
    633650TrMainWindow :: onDetailsDestroyed( )
    634651{
  • trunk/qt/mainwin.h

    r10532 r10630  
    9696
    9797    private slots:
     98        void onPrefsDestroyed( );
     99        void openPreferences( );
    98100        void onDetailsDestroyed( );
    99101        void onShowModeClicked( );
  • trunk/qt/prefs-dialog.cc

    r10627 r10630  
    621621
    622622    QDialogButtonBox * buttons = new QDialogButtonBox( QDialogButtonBox::Close, Qt::Horizontal, this );
    623     connect( buttons, SIGNAL(rejected()), this, SLOT(hide()) ); // "close" triggers rejected
     623    connect( buttons, SIGNAL(rejected()), this, SLOT(deleteLater()) ); // "close" triggers rejected
    624624    myLayout->addWidget( buttons );
    625625
Note: See TracChangeset for help on using the changeset viewer.