--- /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) version 3. *
+ * *
+ * 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 "buffersettings.h"
+
+BufferSettings::BufferSettings(const QString &group) : ClientSettings(group) {
+
+}
+
+void BufferSettings::setValue(const QString &key, const QVariant &data) {
+ setLocalValue(key, data);
+}
+
+QVariant BufferSettings::value(const QString &key, const QVariant &def) {
+ return localValue(key, def);
+}
\ No newline at end of file
--- /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) version 3. *
+ * *
+ * 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 _BUFFERSETTINGS_H_
+#define _BUFFERSETTINGS_H_
+
+#include "clientsettings.h"
+
+class BufferSettings : public ClientSettings {
+
+ public:
+ BufferSettings(const QString &group = "Buffer");
+
+ void setValue(const QString &key, const QVariant &data);
+ QVariant value(const QString &key, const QVariant &def = QVariant());
+
+
+};
+
+
+#endif
DEPMOD = common
QT_MOD = core network gui
-SRCS += buffer.cpp treemodel.cpp networkmodel.cpp buffermodel.cpp client.cpp clientsettings.cpp clientsyncer.cpp \
+SRCS += buffer.cpp buffersettings.cpp treemodel.cpp networkmodel.cpp buffermodel.cpp client.cpp clientsettings.cpp clientsyncer.cpp \
mappedselectionmodel.cpp modelpropertymapper.cpp selectionmodelsynchronizer.cpp
-HDRS += buffer.h treemodel.h networkmodel.h buffermodel.h client.h clientsettings.h clientsyncer.h quasselui.h \
+HDRS += buffer.h buffersettings.h treemodel.h networkmodel.h buffermodel.h client.h clientsettings.h clientsyncer.h quasselui.h \
mappedselectionmodel.h modelpropertymapper.h selectionmodelsynchronizer.h
removeLocalKey(QString("%1").arg(id.toInt()));
}
-/***********************************************************************************************/
-
-BufferSettings::BufferSettings(BufferId bufferId)
- : CoreAccountSettings(QString("Buffers/%1").arg(bufferId.toInt()))
-{
-}
-
-void BufferSettings::setLastSeen(QDateTime seenDate) {
- setAccountValue("LastSeen", seenDate);
-}
-
-QDateTime BufferSettings::lastSeen() {
- return accountValue("LastSeen", QDateTime()).value<QDateTime>();
-}
-
-/***********************************************************************************************/
QString _subgroup;
};
-class BufferSettings : public CoreAccountSettings {
-public:
- BufferSettings(BufferId bufferId);
-
- void setLastSeen(QDateTime);
- QDateTime lastSeen();
-};
-
#endif
#include "ircchannel.h"
#include "ircuser.h"
+#include "buffersettings.h"
+
#include "util.h" // get rid of this (needed for isChannelName)
+// #define PHONDEV
+
/*****************************************
* Fancy Buffer Items
*****************************************/
break;
}
case BufferInfo::ChannelBuffer:
- toolTip.append(QString("<b>Channel %1</b>").arg(bufferName()));
+ toolTip.append(QString("<h4>Channel %1</h4>").arg(bufferName()));
if(isActive()) {
- toolTip.append(QString("Topic: %1").arg(topic()));
- toolTip.append(QString("Users: %1").arg(nickCount()));
+ //TODO: add channel modes
+ toolTip.append(QString("<b>Users:</b> %1").arg(nickCount()));
+
+ BufferSettings s;
+ bool showTopic = s.value("DisplayTopicInTooltip", QVariant(false)).toBool();
+ if(showTopic) {
+ QString _topic = topic();
+ if(_topic != "") {
+ _topic.replace(QString("<"), QString("<"));
+ _topic.replace(QString(">"), QString(">"));
+ toolTip.append(QString("<font size='-2'> </font>"));
+ toolTip.append(QString("<b>Topic:</b> %1").arg(_topic));
+ }
+ }
} else {
toolTip.append(QString("Not active <br /> Double-click to join"));
}
systray->setContextMenu(systrayMenu);
- QtUiSettings s;
+ UiSettings s;
if(s.value("UseSystemTrayIcon", QVariant(true)).toBool()) {
systray->show();
}
void MainWin::changeEvent(QEvent *event) {
if(event->type() == QEvent::WindowStateChange) {
if(windowState() & Qt::WindowMinimized) {
- QtUiSettings s;
+ UiSettings s;
if(s.value("UseSystemTrayIcon").toBool() && s.value("MinimizeOnMinimize").toBool()) {
toggleVisibility();
event->ignore();
}
void MainWin::closeEvent(QCloseEvent *event) {
- QtUiSettings s;
+ UiSettings s;
if(s.value("UseSystemTrayIcon").toBool() && s.value("MinimizeOnClose").toBool()) {
toggleVisibility();
event->ignore();
</item>
<item row="1" column="1" >
<widget class="ColorButton" name="noActivityFG" >
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Maximum" hsizetype="Maximum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text" >
<string/>
</property>
<property name="enabled" >
<bool>false</bool>
</property>
+ <property name="sizePolicy" >
+ <sizepolicy vsizetype="Maximum" hsizetype="Maximum" >
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="text" >
<string/>
</property>
#include "generalsettingspage.h"
#include "qtui.h"
-#include "qtuisettings.h"
+#include "uisettings.h"
+#include "buffersettings.h"
GeneralSettingsPage::GeneralSettingsPage(QWidget *parent)
: SettingsPage(tr("Behaviour"), tr("General"), parent) {
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()));
+
+ connect(ui.displayTopicInTooltip, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+ connect(ui.mouseWheelChangesBuffers, SIGNAL(clicked(bool)), this, SLOT(widgetHasChanged()));
+
+ ui.userMessagesInStatusBuffer->setEnabled(false);
+ ui.userMessagesInQueryBuffer->setEnabled(false);
+ ui.userMessagesInCurrentBuffer->setEnabled(false);
}
bool GeneralSettingsPage::hasDefaults() const {
ui.userMessagesInQueryBuffer->setChecked(false);
ui.userMessagesInCurrentBuffer->setChecked(false);
+ ui.displayTopicInTooltip->setChecked(false);
+ ui.mouseWheelChangesBuffers->setChecked(true);
+
widgetHasChanged();
}
void GeneralSettingsPage::load() {
- QtUiSettings s;
- settings["UseSystemTrayIcon"] = s.value("UseSystemTrayIcon", QVariant(true));
+ // uiSettings:
+ UiSettings uiSettings("Ui");
+ settings["UseSystemTrayIcon"] = uiSettings.value("UseSystemTrayIcon", QVariant(true));
ui.useSystemTrayIcon->setChecked(settings["UseSystemTrayIcon"].toBool());
ui.showSystemTrayIcon->setChecked(settings["UseSystemTrayIcon"].toBool());
- settings["MinimizeOnMinimize"] = s.value("MinimizeOnMinimize", QVariant(false));
+ settings["MinimizeOnMinimize"] = uiSettings.value("MinimizeOnMinimize", QVariant(false));
ui.minimizeOnMinimize->setChecked(settings["MinimizeOnMinimize"].toBool());
- settings["MinimizeOnClose"] = s.value("MinimizeOnClose", QVariant(false));
+ settings["MinimizeOnClose"] = uiSettings.value("MinimizeOnClose", QVariant(false));
ui.minimizeOnClose->setChecked(settings["MinimizeOnClose"].toBool());
- settings["UserMessagesInStatusBuffer"] = s.value("UserMessagesInStatusBuffer", QVariant(true));
+ settings["MouseWheelChangesBuffers"] = uiSettings.value("mouseWheelChangesBuffers", QVariant(true));
+ ui.mouseWheelChangesBuffers->setChecked(settings["MouseWheelChangesBuffers"].toBool());
+
+ // bufferSettings:
+ BufferSettings bufferSettings;
+ settings["UserMessagesInStatusBuffer"] = bufferSettings.value("UserMessagesInStatusBuffer", QVariant(true));
ui.userMessagesInStatusBuffer->setChecked(settings["UserMessagesInStatusBuffer"].toBool());
- settings["UserMessagesInQueryBuffer"] = s.value("UserMessagesInQueryBuffer", QVariant(false));
+ settings["UserMessagesInQueryBuffer"] = bufferSettings.value("UserMessagesInQueryBuffer", QVariant(false));
ui.userMessagesInQueryBuffer->setChecked(settings["UserMessagesInQueryBuffer"].toBool());
- settings["UserMessagesInCurrentBuffer"] = s.value("UserMessagesInCurrentBuffer", QVariant(false));
+ settings["UserMessagesInCurrentBuffer"] = bufferSettings.value("UserMessagesInCurrentBuffer", QVariant(false));
ui.userMessagesInCurrentBuffer->setChecked(settings["UserMessagesInCurrentBuffer"].toBool());
+ settings["DisplayTopicInTooltip"] = bufferSettings.value("DisplayTopicInTooltip", QVariant(false));
+ ui.displayTopicInTooltip->setChecked(settings["DisplayTopicInTooltip"].toBool());
+
setChangedState(false);
}
void GeneralSettingsPage::save() {
- QtUiSettings s;
- s.setValue("UseSystemTrayIcon", ui.useSystemTrayIcon->isChecked());
- s.setValue("MinimizeOnMinimize", ui.minimizeOnMinimize->isChecked());
- s.setValue("MinimizeOnClose", ui.minimizeOnClose->isChecked());
+ UiSettings uiSettings("Ui");
+ uiSettings.setValue("UseSystemTrayIcon", ui.useSystemTrayIcon->isChecked());
+ uiSettings.setValue("MinimizeOnMinimize", ui.minimizeOnMinimize->isChecked());
+ uiSettings.setValue("MinimizeOnClose", ui.minimizeOnClose->isChecked());
+ uiSettings.setValue("MouseWheelChangesBuffers", ui.mouseWheelChangesBuffers->isChecked());
+
+ BufferSettings bufferSettings;
+ bufferSettings.setValue("UserMessagesInStatusBuffer", ui.userMessagesInStatusBuffer->isChecked());
+ bufferSettings.setValue("UserMessagesInQueryBuffer", ui.userMessagesInQueryBuffer->isChecked());
+ bufferSettings.setValue("UserMessagesInCurrentBuffer", ui.userMessagesInCurrentBuffer->isChecked());
- s.setValue("UserMessagesInStatusBuffer", ui.userMessagesInStatusBuffer->isChecked());
- s.setValue("UserMessagesInQueryBuffer", ui.userMessagesInQueryBuffer->isChecked());
- s.setValue("UserMessagesInCurrentBuffer", ui.userMessagesInCurrentBuffer->isChecked());
+ bufferSettings.setValue("DisplayTopicInTooltip", ui.displayTopicInTooltip->isChecked());
load();
setChangedState(false);
if(settings["UseSystemTrayIcon"].toBool() != ui.useSystemTrayIcon->isChecked()) return true;
if(settings["MinimizeOnMinimize"].toBool() != ui.minimizeOnMinimize->isChecked()) return true;
if(settings["MinimizeOnClose"].toBool() != ui.minimizeOnClose->isChecked()) 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;
+ if(settings["DisplayTopicInTooltip"].toBool() != ui.displayTopicInTooltip->isChecked()) return true;
+ if(settings["MouseWheelChangesBuffers"].toBool() != ui.mouseWheelChangesBuffers->isChecked()) return true;
+
return false;
}
<rect>
<x>0</x>
<y>0</y>
- <width>475</width>
- <height>366</height>
+ <width>448</width>
+ <height>480</height>
</rect>
</property>
<property name="windowTitle" >
<item>
<widget class="QCheckBox" name="userMessagesInStatusBuffer" >
<property name="enabled" >
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="text" >
<string>in status buffer</string>
<item>
<widget class="QCheckBox" name="userMessagesInQueryBuffer" >
<property name="enabled" >
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="text" >
<string>in query buffer (if exists)</string>
<item>
<widget class="QCheckBox" name="userMessagesInCurrentBuffer" >
<property name="enabled" >
- <bool>false</bool>
+ <bool>true</bool>
</property>
<property name="text" >
<string>in current buffer</string>
</layout>
</widget>
</item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Buffer view:</string>
+ </property>
+ <layout class="QVBoxLayout" >
+ <item>
+ <widget class="QCheckBox" name="displayTopicInTooltip" >
+ <property name="text" >
+ <string>Display topic in tooltip</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="mouseWheelChangesBuffers" >
+ <property name="text" >
+ <string>Mouse wheel changes displayed buffers</string>
+ </property>
+ <property name="checked" >
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
- <property name="sizeHint" stdset="0" >
+ <property name="sizeHint" >
<size>
- <width>457</width>
- <height>51</height>
+ <width>20</width>
+ <height>40</height>
</size>
</property>
</spacer>
</layout>
</widget>
<resources/>
- <connections>
- <connection>
- <sender>showSystemTrayIcon</sender>
- <signal>clicked(bool)</signal>
- <receiver>useSystemTrayIcon</receiver>
- <slot>setChecked(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>237</x>
- <y>139</y>
- </hint>
- <hint type="destinationlabel" >
- <x>237</x>
- <y>49</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>useSystemTrayIcon</sender>
- <signal>clicked(bool)</signal>
- <receiver>showSystemTrayIcon</receiver>
- <slot>setChecked(bool)</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>237</x>
- <y>49</y>
- </hint>
- <hint type="destinationlabel" >
- <x>237</x>
- <y>139</y>
- </hint>
- </hints>
- </connection>
- </connections>
+ <connections/>
</ui>
#include "networkmodel.h"
#include "network.h"
+#include "uisettings.h"
+
/*****************************************
* The TreeView showing the Buffers
*****************************************/
void BufferView::wheelEvent(QWheelEvent* event)
{
+ UiSettings s;
+ if(s.value("MouseWheelChangesBuffers",QVariant(true)).toBool()) {
int rowDelta = ( event->delta() > 0 ) ? -1 : 1;
QModelIndex currentIndex = selectionModel()->currentIndex();
QModelIndex resultingIndex;
}
selectionModel()->setCurrentIndex( resultingIndex, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows );
selectionModel()->select( resultingIndex, QItemSelectionModel::ClearAndSelect );
+ } else {
+ QAbstractScrollArea::wheelEvent(event);
+ }
}
quasselVersion = "0.2.0-alpha1";
quasselDate = "2008-02-24";
- quasselBuild = 584;
+ quasselBuild = 585;
//! Minimum client build number the core needs
clientBuildNeeded = 563;