added upload to trainingstagebuch.org

This commit is contained in:
Rainer Clasen
2012-04-26 22:50:49 +02:00
parent a00295d60d
commit bb10ed9207
8 changed files with 624 additions and 0 deletions

View File

@@ -58,6 +58,7 @@
#include "BatchExportDialog.h"
#include "StravaDialog.h"
#include "RideWithGPSDialog.h"
#include "TtbDialog.h"
#include "TwitterDialog.h"
#include "WithingsDownload.h"
#include "CalendarDownload.h"
@@ -681,6 +682,10 @@ MainWindow::MainWindow(const QDir &home) :
connect(rideWithGPSAction, SIGNAL(triggered(bool)), this, SLOT(uploadRideWithGPSAction()));
rideMenu->addAction(rideWithGPSAction);
ttbAction = new QAction("Upload to Trainingstagebuch...", this);
connect(ttbAction, SIGNAL(triggered(bool)), this, SLOT(uploadTtb()));
rideMenu->addAction(ttbAction);
rideMenu->addSeparator ();
rideMenu->addAction(tr("&Save activity"), this, SLOT(saveRide()), tr("Ctrl+S"));
rideMenu->addAction(tr("D&elete activity..."), this, SLOT(deleteRide()));
@@ -928,9 +933,14 @@ MainWindow::setActivityMenu()
if (tripid == "") rideWithGPSAction->setEnabled(true);
else rideWithGPSAction->setEnabled(false);
activityId = ride->ride()->getTag("TtbExercise", "");
if (activityId == "") ttbAction->setEnabled(true);
else ttbAction->setEnabled(false);
} else {
stravaAction->setEnabled(false);
rideWithGPSAction->setEnabled(false);
ttbAction->setEnabled(false);
}
}
@@ -1772,6 +1782,24 @@ MainWindow::uploadRideWithGPSAction()
}
}
/*----------------------------------------------------------------------
* trainingstagebuch.org
*--------------------------------------------------------------------*/
void
MainWindow::uploadTtb()
{
QTreeWidgetItem *_item = treeWidget->currentItem();
if (_item==NULL || _item->type() != RIDE_TYPE) return;
RideItem *item = dynamic_cast<RideItem*>(_item);
if (item) { // menu is disabled anyway, but belt and braces
TtbDialog d(this, item);
d.exec();
}
}
/*----------------------------------------------------------------------
* ErgDB
*--------------------------------------------------------------------*/