Skip to content

Commit

Permalink
Share menu manually check for new data
Browse files Browse the repository at this point in the history
.. sometimes we just want to get the data that was
   just posted without having to restart.
  • Loading branch information
liversedge committed May 7, 2017
1 parent e3a4883 commit e1dcd0d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Cloud/CloudService.cpp
Expand Up @@ -1596,6 +1596,13 @@ CloudServiceAutoDownload::autoDownload()
}
}

void
CloudServiceAutoDownload::checkDownload()
{
// manually called to check
start();
}

void
CloudServiceAutoDownload::run()
{
Expand Down
3 changes: 3 additions & 0 deletions src/Cloud/CloudService.h
Expand Up @@ -446,6 +446,9 @@ class CloudServiceAutoDownload : public QThread {
// automatically downloads from cloud services
CloudServiceAutoDownload(Context *context) : context(context), initial(true) {}

// re-run after inital
void checkDownload();

public slots:

// external entry point to trigger auto download
Expand Down
13 changes: 13 additions & 0 deletions src/Gui/MainWindow.cpp
Expand Up @@ -433,6 +433,12 @@ MainWindow::MainWindow(const QDir &home)
uploadMenu = shareMenu->addMenu("Upload");
syncMenu = shareMenu->addMenu("Synchronise");

shareMenu->addSeparator();
shareAction = new QAction(tr("Check For New Data"), this);
shareAction->setShortcut(tr("Ctrl-C"));
connect(shareAction, SIGNAL(triggered(bool)), this, SLOT(checkCloud()));
shareMenu->addAction(shareAction);

// set the menus to reflect the configured accounts
connect(uploadMenu, SIGNAL(aboutToShow()), this, SLOT(setUploadMenu()));
connect(syncMenu, SIGNAL(aboutToShow()), this, SLOT(setSyncMenu()));
Expand Down Expand Up @@ -2027,6 +2033,13 @@ MainWindow::addAccount()
p->show();
}

void
MainWindow::checkCloud()
{
// kick off a check
currentTab->context->athlete->cloudAutoDownload->checkDownload();
}

void
MainWindow::uploadCloud(QAction *name)
{
Expand Down
1 change: 1 addition & 0 deletions src/Gui/MainWindow.h
Expand Up @@ -170,6 +170,7 @@ class MainWindow : public QMainWindow
// menus to reflect cloud
void setUploadMenu();
void setSyncMenu();
void checkCloud();

void showOptions();

Expand Down

0 comments on commit e1dcd0d

Please sign in to comment.