X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatwidget.cpp;h=e488f03ed3fc5f96135ebfa9983f97e9322fc10b;hb=dcd1ffa954d7b1a582dd45a1c4ca37bdacb92990;hp=b0a06e3f63133b341401ad3387b7e00e38892bb3;hpb=d6b056e936ec441258d291b7a8af7b83f9f53016;p=quassel.git diff --git a/src/qtui/chatwidget.cpp b/src/qtui/chatwidget.cpp index b0a06e3f..e488f03e 100644 --- a/src/qtui/chatwidget.cpp +++ b/src/qtui/chatwidget.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-07 by the Quassel IRC Team * + * Copyright (C) 2005-08 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -22,7 +22,7 @@ #include "chatwidget.h" #include "chatline-old.h" #include "qtui.h" - +#include "uisettings.h" ChatWidget::ChatWidget(QWidget *parent) : QAbstractScrollArea(parent) { //setAutoFillBackground(false); @@ -45,13 +45,15 @@ ChatWidget::ChatWidget(QWidget *parent) : QAbstractScrollArea(parent) { connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(scrollBarValChanged(int))); } -void ChatWidget::init(QString netname, QString bufname) { - networkName = netname; - bufferName = bufname; +void ChatWidget::init(BufferId id) { + bufferId = id; 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/TimestampColumnWidth").arg(bufferId.toInt()), tsDef).toInt(); + senderWidth = s.value(QString("%1/SenderColumnWidth").arg(bufferId.toInt()), senderDef).toInt(); computePositions(); adjustScrollBar(); verticalScrollBar()->setValue(verticalScrollBar()->maximum()); @@ -72,6 +74,11 @@ ChatWidget::~ChatWidget() { //foreach(ChatLine *l, lines) { // delete l; //} + UiSettings s; + s.setValue("DefaultTimestampColumnWidth", tsWidth); // FIXME stupid dirty quicky + s.setValue("DefaultSenderColumnWidth", senderWidth); + s.setValue(QString("%1/TimestampColumnWidth").arg(bufferId.toInt()), tsWidth); + s.setValue(QString("%1/SenderColumnWidth").arg(bufferId.toInt()), senderWidth); } QSize ChatWidget::sizeHint() const {