mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-15 08:59:55 +00:00
Context Menu for Devices in Train View
Right click to add/delete a new device on the device list in the train view sidebar. It is temporary to bring the train view in line with the rest of GC, but will then be updated as we remove functionality that is hidden behind a right click.
This commit is contained in:
@@ -68,6 +68,8 @@
|
||||
#include "WorkoutWizard.h"
|
||||
#include "ErgDB.h"
|
||||
#include "ErgDBDownloadDialog.h"
|
||||
#include "DeviceConfiguration.h"
|
||||
#include "AddDeviceWizard.h"
|
||||
#include "TrainTool.h"
|
||||
|
||||
#include "GcWindowTool.h"
|
||||
@@ -1809,6 +1811,30 @@ MainWindow::deleteRide()
|
||||
removeCurrentRide();
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Realtime Devices and Workouts
|
||||
*--------------------------------------------------------------------*/
|
||||
void
|
||||
MainWindow::addDevice()
|
||||
{
|
||||
// get device config
|
||||
DeviceConfigurations all;
|
||||
DeviceConfiguration add;
|
||||
|
||||
// lets get a new one
|
||||
AddDeviceWizard *p = new AddDeviceWizard(this, add);
|
||||
if (p->exec() == QDialog::Accepted) {
|
||||
QList<DeviceConfiguration> list = all.getList();
|
||||
list.insert(0, add);
|
||||
|
||||
// call device add wizard.
|
||||
all.writeConfig(list);
|
||||
|
||||
// tell everyone
|
||||
emit configChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
* Cyclists
|
||||
*--------------------------------------------------------------------*/
|
||||
@@ -2346,5 +2372,4 @@ MainWindow::actionClicked(int index)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user