chatview.cpp
chatviewsearchbar.cpp
chatviewsearchcontroller.cpp
+ chatviewsettings.cpp
columnhandleitem.cpp
coreconfigwizard.cpp
coreconnectdlg.cpp
chatitem.h
chatline.h
chatlinemodelitem.h
+ chatviewsettings.h
qtuisettings.h
qtuistyle.h)
#include "client.h"
#include "chatlinemodel.h"
#include "networkmodel.h"
+#include "chatviewsettings.h"
ChatMonitorFilter::ChatMonitorFilter(MessageModel *model, QObject *parent)
: MessageFilter(model, parent)
{
- QtUiSettings qtUiSettings;
- QString showFieldSettingId = QString("ChatView/%1/showFields").arg(idString());
- QString showOwnMessagesSettingId = QString("ChatView/%1/showOwnMsgs").arg(idString());
-
- _showFields = qtUiSettings.value(showFieldSettingId, AllFields).toInt();
- _showOwnMessages = qtUiSettings.value(showOwnMessagesSettingId, true).toBool();
- qtUiSettings.notify(showFieldSettingId, this, SLOT(showFieldsSettingsChanged(const QVariant &)));
- qtUiSettings.notify(showOwnMessagesSettingId, this, SLOT(showOwnMessagesSettingChanged(const QVariant &)));
+ ChatViewSettings viewSettings(idString());
+ _showFields = viewSettings.value("showFields", AllFields).toInt();
+ _showOwnMessages = viewSettings.value("showOwnMsgs", true).toBool();
+ viewSettings.notify("showFields", this, SLOT(showFieldsSettingsChanged(const QVariant &)));
+ viewSettings.notify("showOwnMsgs", this, SLOT(showOwnMessagesSettingChanged(const QVariant &)));
}
bool ChatMonitorFilter::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const {
if(_showFields & field)
return;
- QtUiSettings().setValue(QString("ChatView/%1/showFields").arg(idString()), _showFields | field);
+ ChatViewSettings(idString()).setValue("showFields", _showFields | field);
}
void ChatMonitorFilter::removeShowField(int field) {
if(!(_showFields & field))
return;
- QtUiSettings().setValue(QString("ChatView/%1/showFields").arg(idString()), _showFields ^ field);
+ ChatViewSettings(idString()).setValue("showFields", _showFields ^ field);
}
void ChatMonitorFilter::setShowOwnMessages(bool show) {
if(_showOwnMessages == show)
return;
- QtUiSettings().setValue(QString("ChatView/%1/showOwnMsgs").arg(idString()), show);
+ ChatViewSettings(idString()).setValue("showOwnMsgs", show);
}
void ChatMonitorFilter::showFieldsSettingsChanged(const QVariant &newValue) {
#include <QDateTime>
#include "messagefilter.h"
-#include "qtuisettings.h"
class ChatMonitorFilter : public MessageFilter {
Q_OBJECT
#include "columnhandleitem.h"
#include "messagefilter.h"
#include "qtui.h"
-#include "qtuisettings.h"
+#include "chatviewsettings.h"
const qreal minContentsWidth = 200;
_singleBufferScene = filter->isSingleBufferFilter();
}
- QtUiSettings s;
- int defaultFirstColHandlePos = s.value("ChatView/DefaultFirstColumnHandlePos", 80).toInt();
- int defaultSecondColHandlePos = s.value("ChatView/DefaultSecondColumnHandlePos", 200).toInt();
+ ChatViewSettings defaultSettings;
+ int defaultFirstColHandlePos = defaultSettings.value("FirstColumnHandlePos", 80).toInt();
+ int defaultSecondColHandlePos = defaultSettings.value("SecondColumnHandlePos", 200).toInt();
- firstColHandlePos = s.value(QString("ChatView/%1/FirstColumnHandlePos").arg(_idString),
- defaultFirstColHandlePos).toInt();
- secondColHandlePos = s.value(QString("ChatView/%1/SecondColumnHandlePos").arg(_idString),
- defaultSecondColHandlePos).toInt();
+ ChatViewSettings viewSettings(idString);
+ firstColHandlePos = viewSettings.value("FirstColumnHandlePos", defaultFirstColHandlePos).toInt();
+ secondColHandlePos = viewSettings.value("SecondColumnHandlePos", defaultSecondColHandlePos).toInt();
firstColHandle = new ColumnHandleItem(QtUi::style()->firstColumnSeparator());
addItem(firstColHandle);
oldx = secondColHandlePos;
secondColHandlePos = xpos;
}
- QtUiSettings s;
- s.setValue(QString("ChatView/%1/FirstColumnHandlePos").arg(_idString), firstColHandlePos);
- s.setValue(QString("ChatView/%1/SecondColumnHandlePos").arg(_idString), secondColHandlePos);
- s.setValue(QString("ChatView/DefaultFirstColumnHandlePos"), firstColHandlePos);
- s.setValue(QString("ChatView/DefaultSecondColumnHandlePos"), secondColHandlePos);
+
+ ChatViewSettings viewSettings(idString());
+ viewSettings.setValue("FirstColumnHandlePos", firstColHandlePos);
+ viewSettings.setValue("SecondColumnHandlePos", secondColHandlePos);
+
+ ChatViewSettings defaultSettings;
+ defaultSettings.setValue("FirstColumnHandlePos", firstColHandlePos);
+ defaultSettings.setValue("SecondColumnHandlePos", secondColHandlePos);
setWidth(width(), true); // readjust all chatlines
// we get ugly redraw errors if we don't update this explicitly... :(
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * 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 "chatviewsettings.h"
+
+ChatViewSettings::ChatViewSettings(const QString &id)
+ : QtUiSettings(QString("ChatView/%1").arg(id))
+{
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-08 by the Quassel Project *
+ * 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 CHATVIEWSETTINGS_H
+#define CHATVIEWSETTINGS_H
+
+#include "qtuisettings.h"
+
+class ChatViewSettings : public QtUiSettings {
+public:
+ ChatViewSettings(const QString &id = "__default__");
+};
+
+#endif //CHATVIEWSETTINGS_H
#include "qtuisettings.h"
-QtUiSettings::QtUiSettings(const QString &group) : UiSettings(group) {
+QtUiSettings::QtUiSettings(const QString &subGroup)
+ : UiSettings(QString("QtUi/%1").arg(subGroup))
+{
+}
+QtUiSettings::QtUiSettings()
+ : UiSettings("QtUi")
+{
}
/***********************************************************************/
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef _QTUISETTINGS_H_
-#define _QTUISETTINGS_H_
+#ifndef QTUISETTINGS_H_
+#define QTUISETTINGS_H_
#include <QColor>
#include "uisettings.h"
class QtUiSettings : public UiSettings {
-
- public:
- QtUiSettings(const QString &group = "QtUi");
-
+public:
+ QtUiSettings(const QString &subGroup);
+ QtUiSettings();
};
class QtUiStyleSettings : public UiStyleSettings {
+public:
+ QtUiStyleSettings(const QString &group = "QtUiStyle");
- public:
- QtUiStyleSettings(const QString &group = "QtUiStyle");
-
- void setHighlightColor(const QColor &);
- QColor highlightColor();
-
+ void setHighlightColor(const QColor &);
+ QColor highlightColor();
};
#endif
void remove(const QString &key);
};
-class UiStyleSettings : public ClientSettings {
- public:
- UiStyleSettings(const QString &group = "UiStyle");
+class UiStyleSettings : public ClientSettings {
+public:
+ UiStyleSettings(const QString &group = "UiStyle");
- void setCustomFormat(UiStyle::FormatType, QTextCharFormat);
- QTextCharFormat customFormat(UiStyle::FormatType);
+ void setCustomFormat(UiStyle::FormatType, QTextCharFormat);
+ QTextCharFormat customFormat(UiStyle::FormatType);
- void removeCustomFormat(UiStyle::FormatType);
- QList<UiStyle::FormatType> availableFormats();
+ void removeCustomFormat(UiStyle::FormatType);
+ QList<UiStyle::FormatType> availableFormats();
};
#endif