We now have Behavior/Notifications for stuff like this.
#include "settingspages/highlightsettingspage.h"
#include "settingspages/identitiessettingspage.h"
#include "settingspages/networkssettingspage.h"
-
+#include "settingspages/notificationssettingspage.h"
#include "debugconsole.h"
#include "global.h"
settingsDlg->registerSettingsPage(new GeneralSettingsPage(settingsDlg));
settingsDlg->registerSettingsPage(new HighlightSettingsPage(settingsDlg));
settingsDlg->registerSettingsPage(new AliasesSettingsPage(settingsDlg));
+ settingsDlg->registerSettingsPage(new NotificationsSettingsPage(settingsDlg));
//Category: General
settingsDlg->registerSettingsPage(new IdentitiesSettingsPage(settingsDlg));
settingsDlg->registerSettingsPage(new NetworksSettingsPage(settingsDlg));
if(!reply.isValid()) {
/* ERROR */
- qDebug() << "Error on sending notification...";
+ qDebug() << "Error on sending notification..." << reply;
return;
}
connect(ui.minimizeOnMinimize, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
connect(ui.minimizeOnClose, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.animateTrayIcon, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.bubbleBox, SIGNAL(toggled(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.desktopBox, SIGNAL(toggled(bool)), this, SLOT(widgetHasChanged()));
- connect(ui.timeout_value, SIGNAL(valueChanged(int)), this, SLOT(widgetHasChanged()));
- connect(ui.x_value, SIGNAL(valueChanged(int)), this, SLOT(widgetHasChanged()));
- connect(ui.y_value, SIGNAL(valueChanged(int)), this, SLOT(widgetHasChanged()));
-
connect(ui.userMessagesInStatusBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
connect(ui.userMessagesInQueryBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
connect(ui.userMessagesInCurrentBuffer, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
ui.minimizeOnMinimize->setChecked(false);
ui.minimizeOnClose->setChecked(false);
- ui.animateTrayIcon->setChecked(true);
- ui.bubbleBox->setChecked(true);
- ui.desktopBox->setChecked(true);
- ui.timeout_value->setValue(5000);
- ui.x_value->setValue(0);
- ui.y_value->setValue(0);
-
ui.userMessagesInStatusBuffer->setChecked(true);
ui.userMessagesInQueryBuffer->setChecked(false);
ui.userMessagesInCurrentBuffer->setChecked(false);
settings["MouseWheelChangesBuffers"] = uiSettings.value("MouseWheelChangesBuffers", QVariant(true));
ui.mouseWheelChangesBuffers->setChecked(settings["MouseWheelChangesBuffers"].toBool());
- settings["AnimateTrayIcon"] = uiSettings.value("AnimateTrayIcon", QVariant(true));
- ui.animateTrayIcon->setChecked(settings["AnimateTrayIcon"].toBool());
-
- settings["NotificationBubble"] = uiSettings.value("NotificationBubble", QVariant(true));
- ui.bubbleBox->setChecked(settings["NotificationBubble"].toBool());
-
- settings["NotificationDesktop"] = uiSettings.value("NotificationDesktop", QVariant(true));
- ui.desktopBox->setChecked(settings["NotificationDesktop"].toBool());
- settings["NotificationDesktopTimeout"] = uiSettings.value("NotificationDesktopTimeout", QVariant(5000));
- ui.timeout_value->setValue(settings["NotificationDesktopTimeout"].toInt());
- settings["NotificationDesktopHintX"] = uiSettings.value("NotificationDesktopHintX", QVariant(0));
- ui.x_value->setValue(settings["NotificationDesktopHintX"].toInt());
- settings["NotificationDesktopHintY"] = uiSettings.value("NotificationDesktopHintY", QVariant(0));
- ui.y_value->setValue(settings["NotificationDesktopHintY"].toInt());
-
// bufferSettings:
BufferSettings bufferSettings;
settings["UserMessagesInStatusBuffer"] = bufferSettings.value("UserMessagesInStatusBuffer", QVariant(true));
uiSettings.setValue("MinimizeOnClose", ui.minimizeOnClose->isChecked());
uiSettings.setValue("MouseWheelChangesBuffers", ui.mouseWheelChangesBuffers->isChecked());
- uiSettings.setValue("AnimateTrayIcon", ui.animateTrayIcon->isChecked());
-//<<< HEAD:src/qtui/settingspages/generalsettingspage.cpp
-// uiSettings.setValue("DisplayPopupMessages", ui.displayPopupMessages->isChecked());
-// uiSettings.setValue("CompletionSuffix", ui.completionSuffix->text());
-
-//=======
- uiSettings.setValue("NotificationBubble", ui.bubbleBox->isChecked());
- uiSettings.setValue("NotificationDesktop", ui.desktopBox->isChecked());
- uiSettings.setValue("NotificationDesktopTimeout", ui.timeout_value->value());
- uiSettings.setValue("NotificationDesktopHintX", ui.x_value->value());
- uiSettings.setValue("NotificationDesktopHintY", ui.y_value->value());
-
-//>>> Configuration support for desktop notifications.:src/qtui/settingspages/generalsettingspage.cpp
BufferSettings bufferSettings;
bufferSettings.setValue("UserMessagesInStatusBuffer", ui.userMessagesInStatusBuffer->isChecked());
bufferSettings.setValue("UserMessagesInQueryBuffer", ui.userMessagesInQueryBuffer->isChecked());
bufferSettings.setValue("DisplayTopicInTooltip", ui.displayTopicInTooltip->isChecked());
+ uiSettings.setValue("CompletionSuffix", ui.completionSuffix->text());
+
load();
setChangedState(false);
}
if(settings["MinimizeOnMinimize"].toBool() != ui.minimizeOnMinimize->isChecked()) return true;
if(settings["MinimizeOnClose"].toBool() != ui.minimizeOnClose->isChecked()) return true;
- if(settings["AnimateTrayIcon"].toBool() != ui.animateTrayIcon->isChecked()) return true;
- if(settings["NotificationBubble"].toBool() != ui.bubbleBox->isChecked()) return true;
- if(settings["NotificationDesktop"].toBool() != ui.desktopBox->isChecked()) return true;
- if(settings["NotificationDesktopTimeout"].toInt() != ui.timeout_value->value()) return true;
- if(settings["NotificationDesktopHintX"].toInt() != ui.x_value->value()) return true;
- if(settings["NotificationDesktopHintY"].toInt() != ui.y_value->value()) return true;
-
if(settings["UserMessagesInStatusBuffer"].toBool() != ui.userMessagesInStatusBuffer->isChecked()) return true;
if(settings["UserMessagesInQueryBuffer"].toBool() != ui.userMessagesInQueryBuffer->isChecked()) return true;
if(settings["UserMessagesInCurrentBuffer"].toBool() != ui.userMessagesInCurrentBuffer->isChecked()) return true;
return false;
}
-
-
-
-
<x>0</x>
<y>0</y>
<width>453</width>
- <height>800</height>
+ <height>467</height>
</rect>
</property>
<property name="windowTitle" >
<item>
<widget class="QGroupBox" name="useSystemTrayIcon" >
<property name="title" >
- <string>Use system tray icon:</string>
+ <string>Show System Tray Icon</string>
</property>
<property name="checkable" >
<bool>true</bool>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QVBoxLayout" name="_2" >
<item>
<widget class="QCheckBox" name="minimizeOnMinimize" >
<property name="text" >
<item>
<widget class="QGroupBox" name="macOnly" >
<property name="title" >
- <string>Tray icon:</string>
+ <string>Tray Icon</string>
</property>
- <layout class="QHBoxLayout" >
+ <layout class="QHBoxLayout" name="_3" >
<item>
<widget class="QCheckBox" name="showSystemTrayIcon" >
<property name="text" >
</layout>
</widget>
</item>
- <item>
- <widget class="QGroupBox" name="groupBox_3" >
- <property name="title" >
- <string>User Notification:</string>
- </property>
- <layout class="QGridLayout" >
- <item row="2" column="0" >
- <widget class="QGroupBox" name="bubbleBox" >
- <property name="title" >
- <string>Bubble</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout" />
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QGroupBox" name="desktopBox" >
- <property name="title" >
- <string>Desktop</string>
- </property>
- <property name="checkable" >
- <bool>true</bool>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout_2" >
- <item>
- <widget class="QFrame" name="desktopFrame" >
- <property name="frameShape" >
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow" >
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QFormLayout" name="formLayout" >
- <item row="0" column="0" >
- <widget class="QLabel" name="timeout_label" >
- <property name="text" >
- <string>Timeout</string>
- </property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QSpinBox" name="timeout_value" >
- <property name="minimum" >
- <number>-1</number>
- </property>
- <property name="maximum" >
- <number>100000</number>
- </property>
- <property name="value" >
- <number>5000</number>
- </property>
- </widget>
- </item>
- <item row="1" column="0" >
- <widget class="QLabel" name="x_label" >
- <property name="text" >
- <string>X</string>
- </property>
- </widget>
- </item>
- <item row="2" column="0" >
- <widget class="QLabel" name="y_label" >
- <property name="text" >
- <string>Y</string>
- </property>
- </widget>
- </item>
- <item row="1" column="1" >
- <widget class="QSpinBox" name="x_value" >
- <property name="maximum" >
- <number>10000</number>
- </property>
- </widget>
- </item>
- <item row="2" column="1" >
- <widget class="QSpinBox" name="y_value" >
- <property name="maximum" >
- <number>10000</number>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="1" column="0" >
- <widget class="QCheckBox" name="animateTrayIcon" >
- <property name="text" >
- <string>Animate tray icon</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
- <string>Display user related messages and private Notices:</string>
+ <string>Display User-Related Messages And Private Notices:</string>
</property>
<layout class="QVBoxLayout" >
<item>
<item>
<widget class="QGroupBox" name="groupBox_2" >
<property name="title" >
- <string>Buffer view:</string>
+ <string>Buffer View</string>
</property>
<layout class="QVBoxLayout" >
<item>
<string>The suffix appended to a nick on completion via TAB. Default is ": "</string>
</property>
<property name="title" >
- <string>Input Line:</string>
+ <string>Input Line</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout" >
<item>
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel IRC Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#include "notificationssettingspage.h"
+
+#include "qtui.h"
+#include "uisettings.h"
+#include "buffersettings.h"
+
+NotificationsSettingsPage::NotificationsSettingsPage(QWidget *parent)
+ : SettingsPage(tr("Behaviour"), tr("Notifications"), parent) {
+ ui.setupUi(this);
+
+ connect(ui.animateTrayIcon, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.showBubble, SIGNAL(toggled(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.desktopBox, SIGNAL(toggled(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.timeout_value, SIGNAL(valueChanged(int)), this, SLOT(widgetHasChanged()));
+ connect(ui.x_value, SIGNAL(valueChanged(int)), this, SLOT(widgetHasChanged()));
+ connect(ui.y_value, SIGNAL(valueChanged(int)), this, SLOT(widgetHasChanged()));
+
+}
+
+bool NotificationsSettingsPage::hasDefaults() const {
+ return true;
+}
+
+void NotificationsSettingsPage::defaults() {
+ ui.animateTrayIcon->setChecked(true);
+ ui.showBubble->setChecked(true);
+ ui.desktopBox->setChecked(true);
+ ui.timeout_value->setValue(5000);
+ ui.x_value->setValue(0);
+ ui.y_value->setValue(0);
+
+ widgetHasChanged();
+}
+
+void NotificationsSettingsPage::load() {
+ // uiSettings:
+ UiSettings uiSettings;
+
+ settings["AnimateTrayIcon"] = uiSettings.value("AnimateTrayIcon", QVariant(true));
+ ui.animateTrayIcon->setChecked(settings["AnimateTrayIcon"].toBool());
+
+ settings["NotificationBubble"] = uiSettings.value("NotificationBubble", QVariant(true));
+ ui.showBubble->setChecked(settings["NotificationBubble"].toBool());
+
+ settings["NotificationDesktop"] = uiSettings.value("NotificationDesktop", QVariant(true));
+ ui.desktopBox->setChecked(settings["NotificationDesktop"].toBool());
+ settings["NotificationDesktopTimeout"] = uiSettings.value("NotificationDesktopTimeout", QVariant(5000));
+ ui.timeout_value->setValue(settings["NotificationDesktopTimeout"].toInt());
+ settings["NotificationDesktopHintX"] = uiSettings.value("NotificationDesktopHintX", QVariant(0));
+ ui.x_value->setValue(settings["NotificationDesktopHintX"].toInt());
+ settings["NotificationDesktopHintY"] = uiSettings.value("NotificationDesktopHintY", QVariant(0));
+ ui.y_value->setValue(settings["NotificationDesktopHintY"].toInt());
+
+ setChangedState(false);
+}
+
+void NotificationsSettingsPage::save() {
+ UiSettings uiSettings;
+
+ uiSettings.setValue("AnimateTrayIcon", ui.animateTrayIcon->isChecked());
+
+ uiSettings.setValue("NotificationBubble", ui.showBubble->isChecked());
+ uiSettings.setValue("NotificationDesktop", ui.desktopBox->isChecked());
+ uiSettings.setValue("NotificationDesktopTimeout", ui.timeout_value->value());
+ uiSettings.setValue("NotificationDesktopHintX", ui.x_value->value());
+ uiSettings.setValue("NotificationDesktopHintY", ui.y_value->value());
+
+ load();
+ setChangedState(false);
+}
+
+void NotificationsSettingsPage::widgetHasChanged() {
+ bool changed = testHasChanged();
+ if(changed != hasChanged()) setChangedState(changed);
+}
+
+bool NotificationsSettingsPage::testHasChanged() {
+ if(settings["AnimateTrayIcon"].toBool() != ui.animateTrayIcon->isChecked()) return true;
+ if(settings["NotificationBubble"].toBool() != ui.showBubble->isChecked()) return true;
+ if(settings["NotificationDesktop"].toBool() != ui.desktopBox->isChecked()) return true;
+ if(settings["NotificationDesktopTimeout"].toInt() != ui.timeout_value->value()) return true;
+ if(settings["NotificationDesktopHintX"].toInt() != ui.x_value->value()) return true;
+ if(settings["NotificationDesktopHintY"].toInt() != ui.y_value->value()) return true;
+
+ return false;
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel IRC Team *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ ***************************************************************************/
+
+#ifndef NOTIFICATIONSSETTINGSPAGE_H_
+#define NOTIFICATIONSSETTINGSPAGE_H_
+
+#include <QHash>
+
+#include "settingspage.h"
+#include "ui_notificationssettingspage.h"
+
+class NotificationsSettingsPage : public SettingsPage {
+ Q_OBJECT
+
+ public:
+ NotificationsSettingsPage(QWidget *parent = 0);
+
+ bool hasDefaults() const;
+
+ public slots:
+ void save();
+ void load();
+ void defaults();
+
+ private slots:
+ void widgetHasChanged();
+
+ private:
+ Ui::NotificationsSettingsPage ui;
+ QHash<QString, QVariant> settings;
+
+ bool testHasChanged();
+};
+
+#endif
--- /dev/null
+<ui version="4.0" >
+ <class>NotificationsSettingsPage</class>
+ <widget class="QWidget" name="NotificationsSettingsPage" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>422</width>
+ <height>386</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout" >
+ <item>
+ <widget class="QGroupBox" name="groupBox_3" >
+ <property name="title" >
+ <string>System Tray</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="1" column="0" >
+ <widget class="QCheckBox" name="animateTrayIcon" >
+ <property name="text" >
+ <string>Animate tray icon</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QCheckBox" name="showBubble" >
+ <property name="text" >
+ <string>Show Bubble</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="desktopBox" >
+ <property name="title" >
+ <string>Desktop Notification (via DBus)</string>
+ </property>
+ <property name="checkable" >
+ <bool>true</bool>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout" >
+ <item>
+ <layout class="QGridLayout" name="gridLayout" >
+ <item row="0" column="0" >
+ <widget class="QLabel" name="timeout_label" >
+ <property name="text" >
+ <string>Timeout</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QSpinBox" name="timeout_value" >
+ <property name="minimum" >
+ <number>-1</number>
+ </property>
+ <property name="maximum" >
+ <number>100000</number>
+ </property>
+ <property name="value" >
+ <number>5000</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="x_label" >
+ <property name="text" >
+ <string>X</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QSpinBox" name="x_value" >
+ <property name="maximum" >
+ <number>10000</number>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="y_label" >
+ <property name="text" >
+ <string>Y</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QSpinBox" name="y_value" >
+ <property name="maximum" >
+ <number>10000</number>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>261</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer" >
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0" >
+ <size>
+ <width>20</width>
+ <height>143</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
# Putting $FOO in SETTINGSPAGES automatically includes
# $FOOsettingspage.cpp, $FOOsettingspage.h and $FOOsettingspage.ui
-set(SETTINGSPAGES aliases appearance bufferview color fonts general highlight identities networks)
+
+set(SETTINGSPAGES aliases appearance bufferview color fonts general highlight identities networks notifications)
# Specify additional files (e.g. for subdialogs) here!
set(SP_SOURCES aliasesmodel.cpp)