diff --git a/src/Pages.cpp b/src/Pages.cpp index ae1a3e6d4..ab18fe5ee 100644 --- a/src/Pages.cpp +++ b/src/Pages.cpp @@ -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 { diff --git a/src/Pages.h b/src/Pages.h index 9f6deadef..6805b4352 100644 --- a/src/Pages.h +++ b/src/Pages.h @@ -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 Configuration; // the actual data + + public slots: + // config changed by wizard so reset + void doReset(); + }; class DevicePage : public QWidget