#include "chatwidget.h"
#include "chatline-old.h"
#include "qtui.h"
-
+#include "uisettings.h"
ChatWidget::ChatWidget(QWidget *parent) : QAbstractScrollArea(parent) {
//setAutoFillBackground(false);
bufferName = bufname;
setBackgroundRole(QPalette::Base);
setFont(QFont("Fixed"));
- tsWidth = 90;
- senderWidth = 100;
+ UiSettings s;
+ QVariant tsDef = s.value("DefaultTimestampColumnWidth", 90);
+ QVariant senderDef = s.value("DefaultSenderColumnWidth", 100);
+ tsWidth = s.value(QString("%1/%2/TimestampColumnWidth").arg(netname, bufname), tsDef).toInt();
+ senderWidth = s.value(QString("%1/%2/SenderColumnWidth").arg(netname, bufname), senderDef).toInt();
computePositions();
adjustScrollBar();
verticalScrollBar()->setValue(verticalScrollBar()->maximum());
//foreach(ChatLine *l, lines) {
// delete l;
//}
+ UiSettings s;
+ s.setValue("DefaultTimestampColumnWidth", tsWidth); // FIXME stupid dirty quicky
+ s.setValue("DefaultSenderColumnWidth", senderWidth);
+ s.setValue(QString("%1/%2/TimestampColumnWidth").arg(networkName, bufferName), tsWidth);
+ s.setValue(QString("%1/%2/SenderColumnWidth").arg(networkName, bufferName), senderWidth);
}
QSize ChatWidget::sizeHint() const {
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
+
+#include "guisettings.h"
+
+GuiSettings::GuiSettings() : ClientSettings("GUI") {
+
+
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 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 "uisettings.h"
+
+UiSettings::UiSettings() : ClientSettings("UI") {
+
+
+}
+
+void UiSettings::setValue(const QString &key, const QVariant &data) {
+ setLocalValue(key, data);
+}
+
+QVariant UiSettings::value(const QString &key, const QVariant &def) {
+ return localValue(key, def);
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-07 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 _UISETTINGS_H_
+#define _UISETTINGS_H_
+
+#include "clientsettings.h"
+
+class UiSettings : public ClientSettings {
+
+ public:
+ UiSettings();
+
+ void setValue(const QString &key, const QVariant &data);
+ QVariant value(const QString &key, const QVariant &def = QVariant());
+
+
+};
+
+/*
+class GuiProfile : public ClientSettings {
+
+ public:
+ GuiProfile();
+
+ static QStringList availableProfiles();
+ static GuiProfile *profile(QString name);
+
+
+
+};
+*/
+#endif
DEPMOD = common client
QT_MOD = core gui network
-SRCS += bufferview.cpp bufferviewfilter.cpp inputline.cpp nickview.cpp tabcompleter.cpp uistyle.cpp
-HDRS += bufferview.h bufferviewfilter.h inputline.h nickview.h tabcompleter.h uistyle.h
+SRCS += bufferview.cpp bufferviewfilter.cpp inputline.cpp nickview.cpp tabcompleter.cpp uisettings.cpp uistyle.cpp
+HDRS += bufferview.h bufferviewfilter.h inputline.h nickview.h tabcompleter.h uisettings.h uistyle.h
FORMNAMES =