#include <QtGui/QHBoxLayout>
#include <QtGui/QVBoxLayout>
#include <QtGui/QMessageBox>
+#include <QMaemo5InformationBox>
#include "themeselector.h"
#include "themepicker.h"
#include "themeloader.h"
buttons->addButton(saveButton, QDialogButtonBox::AcceptRole);
selector_ = new ThemePicker(tr("Theme"), this);
- theme_ = Settings::instance().value("theme", "default").toString();
+ connect(selector_, SIGNAL(selected()), this, SLOT(disableScheduler()));
QPushButton* loadButton = new QPushButton(tr("Import"));
connect(loadButton, SIGNAL(clicked(bool)), this, SLOT(loadFromFile()));
void ThemeSelector::saveTheme()
{
QString theme = selector_->value().toString();
-
- if(theme == theme_)
- {
- hide();
- return;
- }
-
Settings::instance().setValue("theme", theme);
hide();
- theme_ = theme;
emit themeChanged();
}
if(!themeScheduler_)
{
themeScheduler_ = new ThemeSchedulerSettings(this);
+ connect(themeScheduler_, SIGNAL(themeChanged()), this, SIGNAL(themeChanged()));
}
themeScheduler_->show();
}
+
+void ThemeSelector::disableScheduler()
+{
+ if(ThemeScheduler::instance().isEnabled())
+ {
+ QMaemo5InformationBox::information(this, tr("Disabling theme scheduler..."), 1000);
+ ThemeScheduler::instance().setEnabled(false);
+ }
+}