diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 7db0d0a01..4fc42c3c6 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -558,7 +558,7 @@ MainWindow::MainWindow(const QDir &home) #ifdef GC_HAVE_SOAP rideMenu->addSeparator (); rideMenu->addAction(tr("&Upload to TrainingPeaks"), this, SLOT(uploadTP()), tr("Ctrl+T")); - rideMenu->addAction(tr("Down&load from TrainingPeaks..."), this, SLOT(downloadTP()), tr("Ctrl+L")); + rideMenu->addAction(tr("Synchronise TrainingPeaks..."), this, SLOT(downloadTP()), tr("")); #endif #ifdef GC_HAVE_LIBOAUTH diff --git a/src/PwxRideFile.cpp b/src/PwxRideFile.cpp index b70d14536..dbf6ec3fd 100644 --- a/src/PwxRideFile.cpp +++ b/src/PwxRideFile.cpp @@ -370,8 +370,38 @@ PwxFileReader::writeRideFile(Context *context, const RideFile *ride, QFile &file } // workout title + QString wtitle; if (ride->getTag("Workout Title", "") != "") { - QString wtitle = ride->getTag("Workout Title", ""); + wtitle = ride->getTag("Workout Title", ""); + } else { + + // We try metadata fields; Title, then Name then Route then Workout Code + + // is "Title" set? + if (!ride->getTag("Title", "").isEmpty()) { + wtitle = ride->getTag("Title", ""); + } else { + + // is "Name" set? + if (!ride->getTag("Name", "").isEmpty()) { + wtitle = ride->getTag("Name", ""); + } else { + + // is "Route" set? + if (!ride->getTag("Route", "").isEmpty()) { + wtitle = ride->getTag("Route", ""); + } else { + + // is Workout Code set? + if (!ride->getTag("Workout Code", "").isEmpty()) { + wtitle = ride->getTag("Workout Code", ""); + } + } + } + } + } + // did we set it to /anything/ ? + if (wtitle != "") { QDomElement title = doc.createElement("title"); text = doc.createTextNode(wtitle); title.appendChild(text); root.appendChild(title); diff --git a/src/TPDownloadDialog.cpp b/src/TPDownloadDialog.cpp index fcf5b9a77..a54e3b039 100644 --- a/src/TPDownloadDialog.cpp +++ b/src/TPDownloadDialog.cpp @@ -29,7 +29,7 @@ TPDownloadDialog::TPDownloadDialog(Context *context) : QDialog(context->mainWindow, Qt::Dialog), context(context), downloading(false), aborted(false) { - setWindowTitle(tr("Download from TrainingPeaks.com")); + setWindowTitle(tr("Synchronise TrainingPeaks.com")); athleter = new TPAthlete(this); @@ -39,6 +39,7 @@ TPDownloadDialog::TPDownloadDialog(Context *context) : QDialog(context->mainWind appsettings->cvalue(context->athlete->cyclist, GC_TPPASS, "null").toString()); QWidget::hide(); // don't show just yet... + QApplication::processEvents(); } void