diff options
author | Javier S. Pedro <dev.git@javispedro.com> | 2014-09-13 22:40:39 +0200 |
---|---|---|
committer | Javier S. Pedro <dev.git@javispedro.com> | 2014-09-13 22:40:39 +0200 |
commit | 85fb48bc51fed06a50b6178727fdf9e96aea4fc4 (patch) | |
tree | e5aa942addaf99bb29c73f5e946cf250ca8b80f8 /src/salmeta.cpp | |
parent | ed40a7f1cbc1da5ae21c58882df241fc0071c2f7 (diff) | |
download | salmeta-85fb48bc51fed06a50b6178727fdf9e96aea4fc4.tar.gz salmeta-85fb48bc51fed06a50b6178727fdf9e96aea4fc4.zip |
UI can now add some widgets around
Diffstat (limited to 'src/salmeta.cpp')
-rw-r--r-- | src/salmeta.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/salmeta.cpp b/src/salmeta.cpp index f13cd64..46e4e89 100644 --- a/src/salmeta.cpp +++ b/src/salmeta.cpp @@ -2,7 +2,8 @@ #include <sailfishapp.h> #include "controller.h" -#include "watchviewitem.h" +#include "widgetinfomodel.h" +#include "availablewidgetsmodel.h" static bool launch_daemon = false; static QString settings_key_prefix("/apps/salmeta/watch0"); @@ -25,7 +26,8 @@ int main(int argc, char *argv[]) ++it; } - qmlRegisterType<WatchViewItem>("com.javispedro.salmeta", 1, 0, "WatchView"); + qmlRegisterUncreatableType<WidgetInfo>("com.javispedro.salmeta", 1, 0, "WidgetInfo", + "Use the models, not this"); if (launch_daemon) { qDebug() << "Starting salmeta (daemon) with settings from" << settings_key_prefix; @@ -33,7 +35,9 @@ int main(int argc, char *argv[]) new Controller(settings_key_prefix, SailfishApp::createView()); } else { QQuickView *view = SailfishApp::createView(); - view->rootContext()->setContextProperty("settingsPrefix", settings_key_prefix); + view->rootContext()->setContextProperty("curSettingsPrefix", settings_key_prefix); + view->rootContext()->setContextProperty("curWidgets", new WidgetInfoModel(settings_key_prefix)); + view->rootContext()->setContextProperty("allWidgets", new AvailableWidgetsModel); view->setSource(SailfishApp::pathTo("qml/salmeta.qml")); view->show(); } |