#include "settingswidget.h"
#include "ui_settingswidget.h"
-#include "include/daynightmode.h"
#include <QSettings>
SettingsWidget::SettingsWidget(QWidget *parent) :
QWidget(parent),
mp_ui(new Ui::SettingsWidget),
m_dayNightMode(SystemDayNight::DAYNIGHTMODE_DAY), // TODO: read from system
- mp_daynightmodeAdaptor(0),
+ mp_dayNightModeProxy(0),
mp_translator(0)
{
- // publish dbus day night mode interface
- mp_daynightmodeAdaptor = new DaynightmodeAdaptor((QObject*)this);
- QDBusConnection dbus = QDBusConnection::sessionBus();
- dbus.registerObject("/SettingsWidget", this);
- dbus.registerService("org.agl.mainwindow");
+ // this has to be adopted to the system setup
+ mp_dayNightModeProxy = new org::agl::daynightmode("org.agl.homescreen.simulator", //"org.agl.systeminfoprovider"
+ "/",
+ QDBusConnection::sessionBus(),
+ 0);
+ QObject::connect(mp_dayNightModeProxy, SIGNAL(dayNightMode(int)), this, SLOT(dayNightModeSlot(int)));
// multi-language support
mp_translator = new QTranslator();
SettingsWidget::~SettingsWidget()
{
delete mp_translator;
- delete mp_daynightmodeAdaptor;
+ delete mp_dayNightModeProxy;
QSettings settings;
settings.setValue("systemsettings/language", mp_ui->comboBoxLanguage->currentIndex());
delete mp_ui;
}
-void SettingsWidget::setDayNightMode(int mode)
+void SettingsWidget::dayNightModeSlot(int mode)
{
switch (mode)
{