: AbstractNotificationBackend(parent)
{
NotificationSettings notificationSettings;
_enabled = notificationSettings.value("Taskbar/Enabled", true).toBool();
_timeout = notificationSettings.value("Taskbar/Timeout", 0).toInt();
: AbstractNotificationBackend(parent)
{
NotificationSettings notificationSettings;
_enabled = notificationSettings.value("Taskbar/Enabled", true).toBool();
_timeout = notificationSettings.value("Taskbar/Timeout", 0).toInt();
- notificationSettings.notify("Taskbar/Enabled", this, SLOT(enabledChanged(const QVariant &)));
- notificationSettings.notify("Taskbar/Timeout", this, SLOT(timeoutChanged(const QVariant &)));
+ notificationSettings.notify("Taskbar/Enabled", this, &TaskbarNotificationBackend::enabledChanged);
+ notificationSettings.notify("Taskbar/Timeout", this, &TaskbarNotificationBackend::timeoutChanged);
{
if (_enabled && (notification.type == Highlight || notification.type == PrivMsg)) {
QApplication::alert(QtUi::mainWindow(), _timeout);
}
}
{
if (_enabled && (notification.type == Highlight || notification.type == PrivMsg)) {
QApplication::alert(QtUi::mainWindow(), _timeout);
}
}
-TaskbarNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : SettingsPage("Internal", "TaskbarNotification", parent)
+TaskbarNotificationBackend::ConfigWidget::ConfigWidget(QWidget* parent)
+ : SettingsPage("Internal", "TaskbarNotification", parent)
connect(enabledBox, &QAbstractButton::toggled, this, &ConfigWidget::widgetChanged);
connect(enabledBox, &QAbstractButton::toggled, timeoutBox, &QWidget::setEnabled);
connect(enabledBox, &QAbstractButton::toggled, this, &ConfigWidget::widgetChanged);
connect(enabledBox, &QAbstractButton::toggled, timeoutBox, &QWidget::setEnabled);
- connect(timeoutBox, SIGNAL(valueChanged(int)), SLOT(widgetChanged()));
+ connect(timeoutBox, selectOverload<int>(&QSpinBox::valueChanged), this, &ConfigWidget::widgetChanged);
- bool changed = (enabled != enabledBox->isChecked() || timeout/1000 != timeoutBox->value());
- if (changed != hasChanged()) setChangedState(changed);
+ bool changed = (enabled != enabledBox->isChecked() || timeout / 1000 != timeoutBox->value());
+ if (changed != hasChanged())
+ setChangedState(changed);
timeout = s.value("Taskbar/Timeout", 0).toInt();
enabledBox->setChecked(enabled);
timeout = s.value("Taskbar/Timeout", 0).toInt();
enabledBox->setChecked(enabled);