mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Integrate Garmin Service warning
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "ANT.h"
|
||||
#include "ANTLogger.h"
|
||||
#include "RealtimeData.h"
|
||||
#include "GarminServiceHelper.h"
|
||||
|
||||
ANTlocalController::ANTlocalController(TrainSidebar *parent, DeviceConfiguration *dc) : RealtimeController(parent, dc)
|
||||
{
|
||||
@@ -64,6 +65,27 @@ ANTlocalController::setDevice(QString device)
|
||||
int
|
||||
ANTlocalController::start()
|
||||
{
|
||||
// Before we do the low level device opening, check for an active Garmin Service
|
||||
if (GarminServiceHelper::isServiceRunning())
|
||||
{
|
||||
int dialogStatus = QMessageBox::warning(parent, tr("Found Garmin Express service"),
|
||||
tr("The Garmin Express service is active on your computer.\n"
|
||||
"This can block GoldenCheetah from accessing your ANT+ stick.\n\n"
|
||||
"Do you want to temporarily disable the service?"),
|
||||
QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Ok);
|
||||
|
||||
if (dialogStatus == QMessageBox::Ok)
|
||||
{
|
||||
if (!GarminServiceHelper::stopService())
|
||||
{
|
||||
// we failed to stop the service, tell the user
|
||||
QMessageBox::critical(parent, tr("Failed stopping Garmin Express service"),
|
||||
tr("GoldenCheetah failed to stop the Garmin Express service.\n"
|
||||
"It might be necessary to manually disable it."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logger->open();
|
||||
myANTlocal->start();
|
||||
myANTlocal->setup();
|
||||
|
||||
Reference in New Issue
Block a user