summaryrefslogtreecommitdiff
path: root/sowatchui
diff options
context:
space:
mode:
authorJavier S. Pedro <maemo@javispedro.com>2013-05-11 16:10:50 +0200
committerJavier S. Pedro <maemo@javispedro.com>2013-05-11 16:10:50 +0200
commitbc899047089079dde323e84a57efe46ce6af653d (patch)
treec88ef2bc6d1876518b285db15e5a400c6c4795a4 /sowatchui
parent4b5bbdea7bdb6defc88023ba65f7aec1a7439977 (diff)
downloadsowatch-bc899047089079dde323e84a57efe46ce6af653d.tar.gz
sowatch-bc899047089079dde323e84a57efe46ce6af653d.zip
add the liveview paint engine
Diffstat (limited to 'sowatchui')
-rw-r--r--sowatchui/configuredwatchletsmodel.cpp (renamed from sowatchui/watchletsmodel.cpp)28
-rw-r--r--sowatchui/configuredwatchletsmodel.h (renamed from sowatchui/watchletsmodel.h)8
-rw-r--r--sowatchui/main.cpp4
-rw-r--r--sowatchui/qml/AddWatchletSheet.qml2
-rw-r--r--sowatchui/qml/WatchPage.qml2
-rw-r--r--sowatchui/sowatchui.pro4
6 files changed, 24 insertions, 24 deletions
diff --git a/sowatchui/watchletsmodel.cpp b/sowatchui/configuredwatchletsmodel.cpp
index 461a38b..dd301b7 100644
--- a/sowatchui/watchletsmodel.cpp
+++ b/sowatchui/configuredwatchletsmodel.cpp
@@ -1,10 +1,10 @@
-#include "watchletsmodel.h"
+#include "configuredwatchletsmodel.h"
using namespace sowatch;
static const QString watchletsSubKey("/watchlets");
-WatchletsModel::WatchletsModel(QObject *parent) :
+ConfiguredWatchletsModel::ConfiguredWatchletsModel(QObject *parent) :
QAbstractListModel(parent),
_config(0),
_unadded(false)
@@ -17,7 +17,7 @@ WatchletsModel::WatchletsModel(QObject *parent) :
setRoleNames(roles);
}
-QString WatchletsModel::configKey() const
+QString ConfiguredWatchletsModel::configKey() const
{
if (_config) {
QString key = _config->key();
@@ -27,7 +27,7 @@ QString WatchletsModel::configKey() const
}
}
-void WatchletsModel::setConfigKey(const QString &configKey)
+void ConfiguredWatchletsModel::setConfigKey(const QString &configKey)
{
QString oldConfigKey = this->configKey();
if (_config) {
@@ -44,12 +44,12 @@ void WatchletsModel::setConfigKey(const QString &configKey)
}
}
-bool WatchletsModel::displayUnadded() const
+bool ConfiguredWatchletsModel::displayUnadded() const
{
return _unadded;
}
-void WatchletsModel::setDisplayUnadded(bool displayUnadded)
+void ConfiguredWatchletsModel::setDisplayUnadded(bool displayUnadded)
{
qDebug() << "Set dunadded" << displayUnadded;
_unadded = displayUnadded;
@@ -57,13 +57,13 @@ void WatchletsModel::setDisplayUnadded(bool displayUnadded)
emit displayUnaddedChanged();
}
-int WatchletsModel::rowCount(const QModelIndex &parent) const
+int ConfiguredWatchletsModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent);
return _list.count();
}
-QVariant WatchletsModel::data(const QModelIndex &index, int role) const
+QVariant ConfiguredWatchletsModel::data(const QModelIndex &index, int role) const
{
const QString id = _list[index.row()];
switch (role) {
@@ -79,7 +79,7 @@ QVariant WatchletsModel::data(const QModelIndex &index, int role) const
return QVariant();
}
-void WatchletsModel::addWatchlet(const QString &name)
+void ConfiguredWatchletsModel::addWatchlet(const QString &name)
{
if (!_config) return;
QStringList enabled = _config->value().toStringList();
@@ -88,7 +88,7 @@ void WatchletsModel::addWatchlet(const QString &name)
_config->set(enabled);
}
-void WatchletsModel::removeWatchlet(const QString &name)
+void ConfiguredWatchletsModel::removeWatchlet(const QString &name)
{
if (!_config) return;
QStringList enabled = _config->value().toStringList();
@@ -96,7 +96,7 @@ void WatchletsModel::removeWatchlet(const QString &name)
_config->set(enabled);
}
-void WatchletsModel::moveWatchletUp(const QString &name)
+void ConfiguredWatchletsModel::moveWatchletUp(const QString &name)
{
if (!_config) return;
QStringList enabled = _config->value().toStringList();
@@ -108,7 +108,7 @@ void WatchletsModel::moveWatchletUp(const QString &name)
_config->set(enabled);
}
-void WatchletsModel::moveWatchletDown(const QString &name)
+void ConfiguredWatchletsModel::moveWatchletDown(const QString &name)
{
if (!_config) return;
QStringList enabled = _config->value().toStringList();
@@ -120,7 +120,7 @@ void WatchletsModel::moveWatchletDown(const QString &name)
_config->set(enabled);
}
-void WatchletsModel::reload()
+void ConfiguredWatchletsModel::reload()
{
Registry *registry = Registry::registry();
Q_ASSERT(_config);
@@ -161,7 +161,7 @@ void WatchletsModel::reload()
endResetModel();
}
-void WatchletsModel::handleConfigChanged()
+void ConfiguredWatchletsModel::handleConfigChanged()
{
// TODO
reload();
diff --git a/sowatchui/watchletsmodel.h b/sowatchui/configuredwatchletsmodel.h
index 4f7ae8f..c0a114d 100644
--- a/sowatchui/watchletsmodel.h
+++ b/sowatchui/configuredwatchletsmodel.h
@@ -1,18 +1,18 @@
-#ifndef WATCHLETSMODEL_H
-#define WATCHLETSMODEL_H
+#ifndef CONFIGUREDWATCHLETSMODEL_H
+#define CONFIGUREDWATCHLETSMODEL_H
#include <QAbstractListModel>
#include <sowatch.h>
-class WatchletsModel : public QAbstractListModel
+class ConfiguredWatchletsModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(QString configKey READ configKey WRITE setConfigKey NOTIFY configKeyChanged)
Q_PROPERTY(bool displayUnadded READ displayUnadded WRITE setDisplayUnadded NOTIFY displayUnaddedChanged)
public:
- explicit WatchletsModel(QObject *parent = 0);
+ explicit ConfiguredWatchletsModel(QObject *parent = 0);
enum DataRoles {
NameRole = Qt::UserRole,
diff --git a/sowatchui/main.cpp b/sowatchui/main.cpp
index 80a0f6b..f8f77e3 100644
--- a/sowatchui/main.cpp
+++ b/sowatchui/main.cpp
@@ -7,7 +7,7 @@
#include "watchesmodel.h"
#include "watchscannermodel.h"
#include "providersmodel.h"
-#include "watchletsmodel.h"
+#include "configuredwatchletsmodel.h"
static sowatch::Registry *registry;
static WatchesModel *watches;
@@ -27,7 +27,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
qmlRegisterType<sowatch::ConfigKey>();
qmlRegisterType<sowatch::GConfKey>("com.javispedro.sowatch", 1, 0, "GConfKey");
qmlRegisterType<ProvidersModel>("com.javispedro.sowatch", 1, 0, "ProvidersModel");
- qmlRegisterType<WatchletsModel>("com.javispedro.sowatch", 1, 0, "WatchletsModel");
+ qmlRegisterType<ConfiguredWatchletsModel>("com.javispedro.sowatch", 1, 0, "ConfiguredWatchletsModel");
viewer->rootContext()->setContextProperty("watches", watches);
viewer->rootContext()->setContextProperty("watchScanner", watchScanner);
diff --git a/sowatchui/qml/AddWatchletSheet.qml b/sowatchui/qml/AddWatchletSheet.qml
index e052350..de10bd6 100644
--- a/sowatchui/qml/AddWatchletSheet.qml
+++ b/sowatchui/qml/AddWatchletSheet.qml
@@ -18,7 +18,7 @@ Sheet {
flickableDirection: Flickable.VerticalFlick
- model: WatchletsModel {
+ model: ConfiguredWatchletsModel {
id: watchletsModel
configKey: sheet.configKey
displayUnadded: true
diff --git a/sowatchui/qml/WatchPage.qml b/sowatchui/qml/WatchPage.qml
index 8d623a6..a47faf8 100644
--- a/sowatchui/qml/WatchPage.qml
+++ b/sowatchui/qml/WatchPage.qml
@@ -158,7 +158,7 @@ Page {
interactive: false
width: parent.width
height: UiConstants.ListItemHeightDefault * count
- model: WatchletsModel {
+ model: ConfiguredWatchletsModel {
id: watchletsModel
configKey: watchPage.configKey
displayUnadded: false
diff --git a/sowatchui/sowatchui.pro b/sowatchui/sowatchui.pro
index 4098228..afbedb6 100644
--- a/sowatchui/sowatchui.pro
+++ b/sowatchui/sowatchui.pro
@@ -39,13 +39,13 @@ SOURCES += main.cpp \
watchesmodel.cpp daemonproxy.cpp \
watchscannermodel.cpp \
providersmodel.cpp \
- watchletsmodel.cpp
+ configuredwatchletsmodel.cpp
HEADERS += \
watchesmodel.h daemonproxy.h \
watchscannermodel.h \
providersmodel.h \
- watchletsmodel.h
+ configuredwatchletsmodel.h
OTHER_FILES += qml/main.qml \
qml/MainPage.qml \