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