示例#1
0
void CloudView::onRefreshClicked()
{
    if (hasAccount()) {
        showLoadingView();
        refreshRepos();
    }
}
void StarredFilesTab::refresh()
{
    if (!seafApplet->accountManager()->hasAccount() ||
        !seafApplet->accountManager()->accounts().front().isValid()) {
        mStack->setCurrentIndex(INDEX_LOGOUT_VIEW);
        return;
    }
    if (in_refresh_) {
        return;
    }

    in_refresh_ = true;

    showLoadingView();
    //AccountManager *account_mgr = seafApplet->accountManager();

    const std::vector<Account>& accounts = seafApplet->accountManager()->accounts();
    if (accounts.empty()) {
        in_refresh_ = false;
        return;
    }

    if (get_starred_files_req_) {
        get_starred_files_req_->deleteLater();
    }

    get_starred_files_req_ = new GetStarredFilesRequest(accounts[0]);
    connect(get_starred_files_req_, SIGNAL(success(const std::vector<StarredFile>&)),
            this, SLOT(refreshStarredFiles(const std::vector<StarredFile>&)));
    connect(get_starred_files_req_, SIGNAL(failed(const ApiError&)),
            this, SLOT(refreshStarredFilesFailed(const ApiError&)));
    get_starred_files_req_->send();
}
void StarredFilesTab::refresh()
{
    if (in_refresh_) {
        return;
    }

    in_refresh_ = true;

    showLoadingView();
    //AccountManager *account_mgr = seafApplet->accountManager();

    const std::vector<Account>& accounts = seafApplet->accountManager()->accounts();
    if (accounts.empty()) {
        in_refresh_ = false;
        return;
    }

    if (get_starred_files_req_) {
        delete get_starred_files_req_;
    }

    get_starred_files_req_ = new GetStarredFilesRequest(accounts[0]);
    connect(get_starred_files_req_, SIGNAL(success(const std::vector<StarredFile>&)),
            this, SLOT(refreshStarredFiles(const std::vector<StarredFile>&)));
    connect(get_starred_files_req_, SIGNAL(failed(const ApiError&)),
            this, SLOT(refreshStarredFilesFailed(const ApiError&)));
    get_starred_files_req_->send();
}
void CloudView::setCurrentAccount(const Account& account)
{
    if (current_account_ != account) {
        current_account_ = account;
        in_refresh_ = false;
        showLoadingView();
        refreshRepos();
    }
}
void ActivitiesTab::refresh()
{
    if (!seafApplet->accountManager()->hasAccount() ||
        !seafApplet->accountManager()->accounts().front().isValid()) {
        mStack->setCurrentIndex(INDEX_LOGOUT_VIEW);
        return;
    }
    showLoadingView();

    EventsService::instance()->refresh(true);
}
示例#6
0
void CloudView::setCurrentAccount(const Account& account)
{
    if (current_account_ != account) {
        current_account_ = account;
        in_refresh_ = false;
        repos_model_->clear();
        showLoadingView();
        refreshRepos();

        // seahub_messages_monitor_->refresh();

        updateAccountInfoDisplay();
        if (account.isValid()) {
            seafApplet->accountManager()->updateAccountLastVisited(account);
        }
        qDebug("switch to account %s\n", account.username.toUtf8().data());
    }

    refresh_action_->setEnabled(account.isValid());
}
示例#7
0
void ActivitiesTab::refresh()
{
    showLoadingView();

    EventsService::instance()->refresh(true);
}