mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix Stop(DEVICE_OK) connect error in RealtimeWindow
The signal/slot connection in RealtimeWindow for the 'stop' button fails. The code wants to pass DEVICE_OK to the slot but the QWidget connect method wants a SLOT signature. This patch sets a default of DEVICE_OK for the newly introduced 'status' parameter to the Stop() method and corrects the signature used in the connect statement. As a result, if the Stop() button is pressed the status will be 0 (DEVICE_OK). If you press start then stop really quickly and there *is* a device error then it will still create a CSV file with no samples. The CsvRideFileReader should be fixed to parse these files correctly.
This commit is contained in:
@@ -76,7 +76,7 @@ RealtimeWindow::configUpdate()
|
||||
disconnect(stopButton, SIGNAL(clicked()), this, SLOT(warnnoConfig()));
|
||||
connect(startButton, SIGNAL(clicked()), this, SLOT(Start()));
|
||||
connect(pauseButton, SIGNAL(clicked()), this, SLOT(Pause()));
|
||||
connect(stopButton, SIGNAL(clicked()), this, SLOT(Stop(DEVICE_OK)));
|
||||
connect(stopButton, SIGNAL(clicked()), this, SLOT(Stop()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ RealtimeWindow::RealtimeWindow(MainWindow *parent, TrainTool *trainTool, const Q
|
||||
if (Devices.count() > 0) {
|
||||
connect(startButton, SIGNAL(clicked()), this, SLOT(Start()));
|
||||
connect(pauseButton, SIGNAL(clicked()), this, SLOT(Pause()));
|
||||
connect(stopButton, SIGNAL(clicked()), this, SLOT(Stop(DEVICE_OK)));
|
||||
connect(stopButton, SIGNAL(clicked()), this, SLOT(Stop()));
|
||||
} else {
|
||||
connect(startButton, SIGNAL(clicked()), this, SLOT(warnnoConfig()));
|
||||
connect(pauseButton, SIGNAL(clicked()), this, SLOT(warnnoConfig()));
|
||||
|
||||
@@ -70,7 +70,7 @@ class RealtimeWindow : public QWidget
|
||||
|
||||
void Start(); // when start button is pressed
|
||||
void Pause(); // when Paude is pressed
|
||||
void Stop(int status); // when stop button is pressed
|
||||
void Stop(int status=0); // when stop button is pressed
|
||||
|
||||
void FFwd(); // jump forward when in a workout
|
||||
void Rewind(); // jump backwards when in a workout
|
||||
|
||||
Reference in New Issue
Block a user