mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fix Device Config and Wizard Interaction
.. when you add a device using the wizard from preferences it resets the model to reflect the changes made. Fixes #785
This commit is contained in:
@@ -1084,6 +1084,7 @@ DevicePage::DevicePage(QWidget *parent, Context *context) : QWidget(parent), con
|
||||
|
||||
connect(addButton, SIGNAL(clicked()), this, SLOT(devaddClicked()));
|
||||
connect(delButton, SIGNAL(clicked()), this, SLOT(devdelClicked()));
|
||||
connect(context, SIGNAL(configChanged(qint32)), deviceListModel, SLOT(doReset()));
|
||||
}
|
||||
|
||||
qint32
|
||||
@@ -1164,6 +1165,15 @@ deviceModel::deviceModel(QObject *parent) : QAbstractTableModel(parent)
|
||||
Configuration = all.getList();
|
||||
}
|
||||
|
||||
void
|
||||
deviceModel::doReset()
|
||||
{
|
||||
beginResetModel();
|
||||
DeviceConfigurations all;
|
||||
Configuration = all.getList();
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
int
|
||||
deviceModel::rowCount(const QModelIndex &parent) const
|
||||
{
|
||||
|
||||
@@ -235,8 +235,12 @@ class deviceModel : public QAbstractTableModel
|
||||
bool insertRows(int position, int rows, const QModelIndex &index=QModelIndex());
|
||||
bool removeRows(int position, int rows, const QModelIndex &index=QModelIndex());
|
||||
|
||||
|
||||
QList<DeviceConfiguration> Configuration; // the actual data
|
||||
|
||||
public slots:
|
||||
// config changed by wizard so reset
|
||||
void doReset();
|
||||
|
||||
};
|
||||
|
||||
class DevicePage : public QWidget
|
||||
|
||||
Reference in New Issue
Block a user