diff options
author | Javier S. Pedro <maemo@javispedro.com> | 2012-08-10 14:02:07 +0200 |
---|---|---|
committer | Javier S. Pedro <maemo@javispedro.com> | 2012-08-10 14:02:07 +0200 |
commit | b9082fda48bb026fc4e6148efeba9aabf608373a (patch) | |
tree | f4f2c498adc8009d082aecc7df2458c2bcf99c15 /sowatchui/providersmodel.h | |
parent | 3ca0764c683f8c6498b80f8d8410eca96cc9a793 (diff) | |
download | sowatch-b9082fda48bb026fc4e6148efeba9aabf608373a.tar.gz sowatch-b9082fda48bb026fc4e6148efeba9aabf608373a.zip |
NotificationProviders UI
Diffstat (limited to 'sowatchui/providersmodel.h')
-rw-r--r-- | sowatchui/providersmodel.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sowatchui/providersmodel.h b/sowatchui/providersmodel.h new file mode 100644 index 0000000..9cf6ec6 --- /dev/null +++ b/sowatchui/providersmodel.h @@ -0,0 +1,44 @@ +#ifndef PROVIDERSMODEL_H +#define PROVIDERSMODEL_H + +#include <QtCore/QAbstractListModel> + +#include <sowatch.h> + +class ProvidersModel : public QAbstractListModel +{ + Q_OBJECT + Q_PROPERTY(QString configKey READ configKey WRITE setConfigKey NOTIFY configKeyChanged) + +public: + explicit ProvidersModel(QObject *parent = 0); + + enum DataRoles { + NameRole = Qt::UserRole, + EnabledRole + }; + + QString configKey() const; + void setConfigKey(const QString& configKey); + + int rowCount(const QModelIndex &parent) const; + QVariant data(const QModelIndex &index, int role) const; + bool setData(const QModelIndex &index, const QVariant &value, int role); + +public slots: + void setProviderEnabled(const QString& id, bool enabled); + +signals: + void configKeyChanged(); + +private slots: + void reload(); + +private: + sowatch::ConfigKey *_config; + QStringList _all_list; + QList<sowatch::NotificationPluginInterface::NotificationProviderInfo> _info_list; + QSet<QString> _enabled; +}; + +#endif // PROVIDERSMODEL_H |