21 #include "indicatorsclient.h"
26 #include <QQmlContext>
30 IndicatorsClient::IndicatorsClient(
int &argc,
char **argv)
34 m_application =
new QApplication(argc, argv);
36 QStringList args = m_application->arguments();
38 m_view =
new QQuickView;
39 m_view->engine()->setBaseUrl(QUrl::fromLocalFile(::qmlDirectory()+
"Panel/Indicators/client/"));
40 prependImportPaths(m_view->engine(), ::overrideImportPaths());
41 appendImportPaths(m_view->engine(), ::fallbackImportPaths());
43 QString profile =
"phone";
44 if (args.contains(QLatin1String(
"-profile")) && args.size() > args.indexOf(QLatin1String(
"-profile")) + 1) {
45 profile = args.at(args.indexOf(QLatin1String(
"-profile")) + 1);
47 m_view->rootContext()->setContextProperty(
"indicatorProfile", profile);
49 m_view->setSource(QUrl(
"IndicatorsClient.qml"));
50 m_view->setResizeMode(QQuickView::SizeRootObjectToView);
51 if (args.contains(QLatin1String(
"-windowgeometry")) && args.size() > args.indexOf(QLatin1String(
"-windowgeometry")) + 1) {
52 QStringList geometryArg = args.at(args.indexOf(QLatin1String(
"-windowgeometry")) + 1).split(
'x');
53 if (geometryArg.size() == 2) {
54 m_view->resize(geometryArg.at(0).toInt(), geometryArg.at(1).toInt());
59 m_view->setMinimumSize(QSize(480, 720));
63 IndicatorsClient::~IndicatorsClient()
72 void IndicatorsClient::setupUI()
77 int IndicatorsClient::run()
80 return m_application->exec();