void CloudView::refreshStatusBar() { if (!seafApplet->mainWindow()->isVisible()) { return; } refreshTasksInfo(); refreshServerStatus(); refreshTransferRate(); }
CloudView::CloudView(QWidget *parent) : QWidget(parent), clone_task_dialog_(NULL) { setupUi(this); // seahub_messages_monitor_ = new SeahubMessagesMonitor(this); // mSeahubMessagesBtn->setVisible(false); layout()->setContentsMargins(1, 0, 1, 0); // Setup widgets from top down setupHeader(); createAccountView(); createTabs(); // tool bar have to be created after tabs, since some of the toolbar // actions are provided by the tabs createToolBar(); setupDropArea(); setupFooter(); QVBoxLayout *vlayout = (QVBoxLayout *)layout(); vlayout->insertWidget(kIndexOfAccountView, account_view_); vlayout->insertWidget(kIndexOfToolBar, tool_bar_); vlayout->insertWidget(kIndexOfTabWidget, tabs_); resizer_ = new QSizeGrip(this); resizer_->resize(resizer_->sizeHint()); refresh_status_bar_timer_ = new QTimer(this); connect(refresh_status_bar_timer_, SIGNAL(timeout()), this, SLOT(refreshStatusBar())); AccountManager *account_mgr = seafApplet->accountManager(); connect(account_mgr, SIGNAL(accountsChanged()), this, SLOT(onAccountChanged())); #if defined(Q_OS_MAC) mHeader->setVisible(false); #endif connect(ServerStatusService::instance(), SIGNAL(serverStatusChanged()), this, SLOT(refreshServerStatus())); connect(CustomizationService::instance(), SIGNAL(serverLogoFetched(const QUrl&)), this, SLOT(onServerLogoFetched(const QUrl&))); QTimer::singleShot(0, this, SLOT(onAccountChanged())); }
CloudView::CloudView(QWidget* parent) : QWidget(parent), clone_task_dialog_(NULL) { setupUi(this); int marginTop = 0; if (shouldUseFramelessWindow()) { marginTop = 0; } #ifdef Q_OS_MAC marginTop = 0; #endif layout()->setContentsMargins(1, marginTop, 1, 0); // Setup widgets from top down setupHeader(); createAccountView(); createTabs(); // tool bar have to be created after tabs, since some of the toolbar // actions are provided by the tabs // createToolBar(); setupDropArea(); setupFooter(); QVBoxLayout* vlayout = (QVBoxLayout*)layout(); vlayout->insertWidget(kIndexOfAccountView, account_view_); vlayout->insertWidget(kIndexOfTabWidget, tabs_); if (shouldUseFramelessWindow()) { resizer_ = new QSizeGrip(this); resizer_->resize(resizer_->sizeHint()); } refresh_status_bar_timer_ = new QTimer(this); connect(refresh_status_bar_timer_, SIGNAL(timeout()), this, SLOT(refreshStatusBar())); AccountManager* account_mgr = seafApplet->accountManager(); connect(account_mgr, SIGNAL(accountsChanged()), this, SLOT(onAccountChanged())); connect(account_mgr, SIGNAL(accountInfoUpdated(const Account&)), this, SLOT(onAccountInfoUpdated(const Account&))); if (!shouldUseFramelessWindow()) { mHeader->setVisible(false); } connect(ServerStatusService::instance(), SIGNAL(serverStatusChanged()), this, SLOT(refreshServerStatus())); connect(CustomizationService::instance(), SIGNAL(serverLogoFetched(const QUrl&)), this, SLOT(onServerLogoFetched(const QUrl&))); QTimer::singleShot(0, this, SLOT(onAccountChanged())); }