myLastSendTime( 0 ),
myLastReadTime( 0 ),
myNetworkTimer( this ),
- myRefreshTrayIconTimer( this )
+ myRefreshTrayIconTimer( this ),
+ myRefreshActionSensitivityTimer( this )
{
setAcceptDrops( true );
connect( &myFilterModel, SIGNAL(rowsInserted(const QModelIndex&,int,int)), this, SLOT(refreshVisibleCount()));
connect( &myFilterModel, SIGNAL(rowsRemoved(const QModelIndex&,int,int)), this, SLOT(refreshVisibleCount()));
- connect( &myFilterModel, SIGNAL(rowsInserted(const QModelIndex&,int,int)), this, SLOT(refreshActionSensitivity()));
- connect( &myFilterModel, SIGNAL(rowsRemoved(const QModelIndex&,int,int)), this, SLOT(refreshActionSensitivity()));
+ connect( &myFilterModel, SIGNAL(rowsInserted(const QModelIndex&,int,int)), this, SLOT(refreshActionSensitivitySoon()));
+ connect( &myFilterModel, SIGNAL(rowsRemoved(const QModelIndex&,int,int)), this, SLOT(refreshActionSensitivitySoon()));
connect( ui.action_Quit, SIGNAL(triggered()), QCoreApplication::instance(), SLOT(quit()) );
connect( &myModel, SIGNAL(dataChanged(const QModelIndex&,const QModelIndex&)), this, SLOT(refreshTrayIconSoon()));
ui.listView->setModel( &myFilterModel );
- connect( ui.listView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)), this, SLOT(refreshActionSensitivity()));
+ connect( ui.listView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)), this, SLOT(refreshActionSensitivitySoon()));
QActionGroup * actionGroup = new QActionGroup( this );
actionGroup->addAction( ui.action_SortByActivity );
}
connect( &myRefreshTrayIconTimer, SIGNAL(timeout()), this, SLOT(refreshTrayIcon()) );
+ connect( &myRefreshActionSensitivityTimer, SIGNAL(timeout()), this, SLOT(refreshActionSensitivity()) );
- refreshActionSensitivity( );
+ refreshActionSensitivitySoon( );
refreshTrayIconSoon( );
refreshStatusBar( );
refreshTitle( );
{
refreshTitle( );
refreshVisibleCount( );
- refreshActionSensitivity( );
+ refreshActionSensitivitySoon( );
refreshStatusBar( );
refreshTrayIconSoon( );
}
myStatsLabel->setText( str );
}
+
+
+void
+TrMainWindow :: refreshActionSensitivitySoon( )
+{
+ if( !myRefreshActionSensitivityTimer.isActive( ) )
+ {
+ myRefreshActionSensitivityTimer.setSingleShot( true );
+ myRefreshActionSensitivityTimer.start( 500 );
+ }
+}
void
TrMainWindow :: refreshActionSensitivity( )
{
time_t myLastReadTime;
QTimer myNetworkTimer;
QTimer myRefreshTrayIconTimer;
+ QTimer myRefreshActionSensitivityTimer;
QAction * myDlimitOffAction;
QAction * myDlimitOnAction;
QAction * myUlimitOffAction;
void setStatusbarVisible( bool );
void setCompactView( bool );
void refreshActionSensitivity( );
+ void refreshActionSensitivitySoon( );
void wrongAuthentication( );
public: