Skip to content

Commit

Permalink
Activity View: Update only if visible and when becoming visible #4083
Browse files Browse the repository at this point in the history
  • Loading branch information
guruz committed Nov 18, 2015
1 parent 3c1a605 commit f2d8143
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/gui/activitywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,23 @@ void ActivitySettings::slotRemoveAccount( AccountState *ptr )

void ActivitySettings::slotRefresh( AccountState* ptr )
{
if( ptr && ptr->isConnected() ) {
if( ptr && ptr->isConnected() && isVisible()) {
_progressIndicator->startAnimation();
_activityWidget->slotRefresh(ptr);
}
}

bool ActivitySettings::event(QEvent* e)
{
if (e->type() == QEvent::Show) {
AccountManager *am = AccountManager::instance();
foreach (AccountStatePtr a, am->accounts()) {
slotRefresh(a.data());
}
}
return QWidget::event(e);
}

ActivitySettings::~ActivitySettings()
{

Expand Down
2 changes: 2 additions & 0 deletions src/gui/activitywidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ public slots:
void guiLog(const QString&, const QString&);

private:
bool event(QEvent* e) Q_DECL_OVERRIDE;

QTabWidget *_tab;
ActivityWidget *_activityWidget;
ProtocolWidget *_protocolWidget;
Expand Down

1 comment on commit f2d8143

@guruz
Copy link
Contributor Author

@guruz guruz commented on f2d8143 Nov 18, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.