+bool DesktopNotificationBackend::ConfigWidget::hasDefaults() const {
+ return true;
+}
+
+void DesktopNotificationBackend::ConfigWidget::defaults() {
+ ui.enabled->setChecked(false);
+ ui.useTimeout->setChecked(true);
+ ui.timeout->setValue(10);
+ ui.useHints->setChecked(false);
+ ui.xHint->setValue(0);
+ ui.yHint->setValue(0);
+ ui.queueNotifications->setChecked(true);
+ widgetChanged();
+}
+
+void DesktopNotificationBackend::ConfigWidget::load() {
+ NotificationSettings s;
+ enabled = s.value("DesktopNotification/Enabled", false).toBool();
+ useTimeout = s.value("DesktopNotification/UseTimeout", true).toBool();
+ timeout = s.value("DesktopNotification/Timeout", 10000).toInt();
+ useHints = s.value("DesktopNotification/UseHints", false).toBool();
+ xHint = s.value("DesktopNotification/XHint", 0).toInt();
+ yHint = s.value("DesktopNotification/YHint", 0).toInt();
+ queueNotifications = s.value("DesktopNotification/QueueNotifications", true).toBool();
+
+ ui.enabled->setChecked(enabled);
+ ui.useTimeout->setChecked(useTimeout);
+ ui.timeout->setValue(timeout/1000);
+ ui.useHints->setChecked(useHints);
+ ui.xHint->setValue(xHint);
+ ui.yHint->setValue(yHint);
+ ui.queueNotifications->setChecked(queueNotifications);
+
+ setChangedState(false);
+}
+
+void DesktopNotificationBackend::ConfigWidget::save() {
+ NotificationSettings s;
+ s.setValue("DesktopNotification/Enabled", ui.enabled->isChecked());
+ s.setValue("DesktopNotification/UseTimeout", ui.useTimeout->isChecked());
+ s.setValue("DesktopNotification/Timeout", ui.timeout->value() * 1000);
+ s.setValue("DesktopNotification/UseHints", ui.useHints->isChecked());
+ s.setValue("DesktopNotification/XHint", ui.xHint->value());
+ s.setValue("DesktopNotification/YHint", ui.yHint->value());
+ s.setValue("DesktopNotification/QueueNotifications", ui.queueNotifications->isChecked());
+
+ load();
+}