<value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">16</value>
<valuemap key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployed" type="QVariantMap">
<value key="192.168.1.4" type="QDateTime">2010-06-29T00:09:20</value>
- <value key="localhost" type="QDateTime">2010-07-07T00:05:11</value>
+ <value key="localhost" type="QDateTime">2010-07-07T09:57:55</value>
</valuemap>
</valuemap>
<value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
verticalLayoutR->addItem(new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding));
done_btn = new QPushButton(tr("Save"));
done_btn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
- connect(done_btn, SIGNAL(clicked()), this, SLOT(close()));
+ connect(done_btn, SIGNAL(clicked()), this, SLOT(saveAndClose()));
verticalLayoutR->addWidget(done_btn);
hori_layout->addLayout(verticalLayoutR);
// Load settings
loadSettings();
- connect(cb_enable, SIGNAL(toggled(bool)), this, SLOT(enableSilencing(bool)));
// Auto rotation
setAttribute(Qt::WA_Maemo5AutoOrientation, true);
}
delete done_btn;
}
-void MainWindow::closeEvent(QCloseEvent *event) {
+void MainWindow::saveAndClose() {
+ // Save the settings and set the events
if(cb_enable->isChecked()) {
- QMaemo5InformationBox::information(this, tr("The daily profile switching is activated"), 0);
setProfileEvents();
+ QMaemo5InformationBox::information(this, tr("The daily profile switching is activated"), 0);
} else {
+ AlarmdBackend::deleteEvents();
QMaemo5InformationBox::information(this, tr("The daily profile switching is deactivated"), 0);
}
saveSettings();
- event->accept();
+ // Close the window
+ close();
}
void MainWindow::saveSettings() {
static_cast<QMaemo5TimePickSelector*>(from_button->pickSelector())->setCurrentTime(from_time);
QTime to_time = settings.value("to_time", QTime(8, 0)).toTime();
static_cast<QMaemo5TimePickSelector*>(to_button->pickSelector())->setCurrentTime(to_time);
- cb_enable->setChecked(settings.value("enabled", true).toBool());
-}
-
-void MainWindow::enableSilencing(bool enabled) {
- if(enabled) {
- setProfileEvents();
- } else {
- AlarmdBackend::deleteEvents();
- }
+ cb_enable->setChecked(settings.value("enabled", false).toBool());
}
void MainWindow::setProfileEvents() {