massive qml controls replacement (#114)

This commit is contained in:
2016-09-28 13:50:57 +03:00
parent 8aa6d0c626
commit 80c994bce0
11 changed files with 439 additions and 527 deletions

View File

@ -153,12 +153,21 @@ QStringList AWKeys::dictKeys(const bool sorted, const QString regexp) const
}
QStringList AWKeys::getHddDevices() const
QVariantList AWKeys::getHddDevices() const
{
QStringList devices = m_keyOperator->devices(QString("hdd"));
QStringList hddDevices = m_keyOperator->devices(QString("hdd"));
// required by selector in the UI
devices.insert(0, QString("disable"));
devices.insert(0, QString("auto"));
hddDevices.insert(0, QString("disable"));
hddDevices.insert(0, QString("auto"));
// build model
QVariantList devices;
for (auto device : hddDevices) {
QVariantMap model;
model[QString("label")] = device;
model[QString("name")] = device;
devices.append(model);
}
return devices;
}

View File

@ -51,7 +51,7 @@ public:
// keys
Q_INVOKABLE QStringList dictKeys(const bool sorted = false,
const QString regexp = QString()) const;
Q_INVOKABLE QStringList getHddDevices() const;
Q_INVOKABLE QVariantList getHddDevices() const;
// values
Q_INVOKABLE QString infoByKey(QString key) const;
Q_INVOKABLE QString valueByKey(QString key) const;