2 * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "controlbarwidget.h"
18 #include "ui_controlbarwidget.h"
19 #include <include/daynightmode.hpp>
20 #include <include/inputevent.hpp>
23 ControlBarWidget::ControlBarWidget(QWidget *parent) :
25 mp_ui(new Ui::ControlBarWidget),
26 mp_dBusInputEventProxy()
30 qDebug("D-Bus: connect to org.agl.homescreenappframeworkbindertizen /AppFramework");
31 mp_dBusInputEventProxy = new org::agl::inputevent("org.agl.inputeventmanager",
33 QDBusConnection::sessionBus(),
37 ControlBarWidget::~ControlBarWidget()
39 delete mp_dBusInputEventProxy;
43 void ControlBarWidget::updateColorScheme()
46 QSettings settings_cs(QApplication::applicationDirPath() +
48 settings.value("systemsettings/colorscheme", "default").toString() +
50 QString::number(settings.value("systemsettings/daynightmode", SystemDayNight::DAYNIGHTMODE_DAY).toInt()) +
52 QSettings::IniFormat);
55 mp_ui->widget_Background->setStyleSheet(settings_cs.value(QString("ControlBarWidget/widget_Background")).toString());
57 icon.addFile(settings_cs.value(QString("ControlBarWidget/pushButton_Home")).toString(), QSize(), QIcon::Normal, QIcon::Off);
58 mp_ui->pushButton_Home->setIcon(icon);
59 icon.addFile(settings_cs.value(QString("ControlBarWidget/pushButton_Settings")).toString(), QSize(), QIcon::Normal, QIcon::Off);
60 mp_ui->pushButton_Settings->setIcon(icon);
61 icon.addFile(settings_cs.value(QString("ControlBarWidget/pushButton_Nav")).toString(), QSize(), QIcon::Normal, QIcon::Off);
62 mp_ui->pushButton_Nav->setIcon(icon);
65 void ControlBarWidget::on_pushButton_Settings_clicked()
67 settingsButtonPressed();
70 void ControlBarWidget::on_pushButton_Home_clicked()
75 void ControlBarWidget::on_pushButton_Nav_clicked()
77 mp_dBusInputEventProxy->hardKeyPressed(InputEvent::HARDKEY_NAV);