From 2684aa5295d12e4f7c66b3011fc8b1819f3d1cbb Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Tue, 25 Mar 2008 00:03:22 +0000 Subject: [PATCH] Introducing an abstract layer above BufferWidget and Chat{Widget|View}. This allows us to move most of the former BufferWidget logic into uisupport, thus reducing code duplication. It also allows us to switch between ChatWidget and ChatView more easily. --- src/client/buffersettings.cpp | 2 +- src/qtui/bufferwidget.cpp | 126 +++----------------- src/qtui/bufferwidget.h | 46 +++----- src/qtui/chatview.cpp | 6 +- src/qtui/chatview.h | 6 +- src/qtui/chatwidget.cpp | 11 +- src/qtui/chatwidget.h | 7 +- src/qtui/mainwin.cpp | 12 +- src/uisupport/abstractbuffercontainer.cpp | 136 ++++++++++++++++++++++ src/uisupport/abstractbuffercontainer.h | 82 +++++++++++++ src/uisupport/bufferview.cpp | 4 + src/uisupport/clearablelineedit.cpp | 2 + src/uisupport/uisupport.pri | 6 +- version.inc | 4 +- 14 files changed, 282 insertions(+), 168 deletions(-) create mode 100644 src/uisupport/abstractbuffercontainer.cpp create mode 100644 src/uisupport/abstractbuffercontainer.h diff --git a/src/client/buffersettings.cpp b/src/client/buffersettings.cpp index c586471a..eda11376 100644 --- a/src/client/buffersettings.cpp +++ b/src/client/buffersettings.cpp @@ -30,4 +30,4 @@ void BufferSettings::setValue(const QString &key, const QVariant &data) { QVariant BufferSettings::value(const QString &key, const QVariant &def) { return localValue(key, def); -} \ No newline at end of file +} diff --git a/src/qtui/bufferwidget.cpp b/src/qtui/bufferwidget.cpp index d46fdec5..a6707053 100644 --- a/src/qtui/bufferwidget.cpp +++ b/src/qtui/bufferwidget.cpp @@ -19,136 +19,42 @@ ***************************************************************************/ #include "bufferwidget.h" -#include "buffer.h" #include "chatline.h" #include "chatline-old.h" +#include "chatview.h" #include "chatwidget.h" #include "settings.h" #include "client.h" -#include "identity.h" -#include "network.h" -#include "networkmodel.h" #include "global.h" -BufferWidget::BufferWidget(QWidget *parent) - : AbstractItemView(parent), - _currentBuffer(0) -{ +BufferWidget::BufferWidget(QWidget *parent) : AbstractBufferContainer(parent) { ui.setupUi(this); } BufferWidget::~BufferWidget() { -} -void BufferWidget::init() { } -void BufferWidget::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) { - Q_ASSERT(model()); - if(!parent.isValid()) { - // ok this means that whole networks are about to be removed - // we can't determine which buffers are affect, so we hope that all nets are removed - // this is the most common case (for example disconnecting from the core or terminating the clint) - if(model()->rowCount(parent) != end - start + 1) - return; - - ChatWidget *chatWidget; - QHash::iterator iter = _chatWidgets.begin(); - while(iter != _chatWidgets.end()) { - chatWidget = *iter; - iter = _chatWidgets.erase(iter); - ui.stackedWidget->removeWidget(chatWidget); - chatWidget->deleteLater(); - } - +AbstractChatView *BufferWidget::createChatView(BufferId id) { + AbstractChatView *chatView; + if(Global::SPUTDEV) { + chatView = new ChatView(Client::buffer(id), this); } else { - // check if there are explicitly buffers removed - for(int i = start; i <= end; i++) { - QVariant variant = parent.child(i,0).data(NetworkModel::BufferIdRole); - if(!variant.isValid()) - continue; - - BufferId bufferId = qVariantValue(variant); - removeBuffer(bufferId); - } + chatView = new ChatWidget(id, this); } + ui.stackedWidget->addWidget(dynamic_cast(chatView)); + dynamic_cast(chatView)->setFocusProxy(this); + return chatView; } -void BufferWidget::removeBuffer(BufferId bufferId) { - if(!_chatWidgets.contains(bufferId)) - return; - - if(Client::buffer(bufferId)) Client::buffer(bufferId)->setVisible(false); - ChatWidget *chatWidget = _chatWidgets.take(bufferId); - ui.stackedWidget->removeWidget(chatWidget); - chatWidget->deleteLater(); -} - -void BufferWidget::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { - BufferId newBufferId = current.data(NetworkModel::BufferIdRole).value(); - BufferId oldBufferId = previous.data(NetworkModel::BufferIdRole).value(); - if(newBufferId != oldBufferId) - setCurrentBuffer(newBufferId); +void BufferWidget::removeChatView(AbstractChatView *view) { + ui.stackedWidget->removeWidget(dynamic_cast(view)); + dynamic_cast(view)->deleteLater(); } -void BufferWidget::setCurrentBuffer(BufferId bufferId) { - if(!bufferId.isValid()) { - ui.stackedWidget->setCurrentWidget(ui.page); - return; - } - - ChatWidget *chatWidget = 0; - ChatView *chatView = 0; - Buffer *buf = Client::buffer(bufferId); - if(!buf) { - qWarning() << "BufferWidget::setBuffer(BufferId): Can't show unknown Buffer:" << bufferId; - return; - } - Buffer *prevBuffer = Client::buffer(currentBuffer()); - if(prevBuffer) prevBuffer->setVisible(false); - if(Global::SPUTDEV) { - if(_chatViews.contains(bufferId)) { - chatView = _chatViews[bufferId]; - } else { - chatView = new ChatView(buf, this); - //chatView->init(bufferId); - QList lines; - QList msgs = buf->contents(); - foreach(AbstractUiMsg *msg, msgs) { - lines.append(dynamic_cast(msg)); - } - chatView->setContents(lines); - connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatView, SLOT(appendMsg(AbstractUiMsg *))); - connect(buf, SIGNAL(msgPrepended(AbstractUiMsg *)), chatView, SLOT(prependMsg(AbstractUiMsg *))); - _chatViews[bufferId] = chatView; - ui.stackedWidget->addWidget(chatView); - chatView->setFocusProxy(this); - } - _currentBuffer = bufferId; - ui.stackedWidget->setCurrentWidget(chatView); - } else { - if(_chatWidgets.contains(bufferId)) { - chatWidget = _chatWidgets[bufferId]; - } else { - chatWidget = new ChatWidget(this); - chatWidget->init(bufferId); - QList lines; - QList msgs = buf->contents(); - foreach(AbstractUiMsg *msg, msgs) { - lines.append(dynamic_cast(msg)); - } - chatWidget->setContents(lines); - connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *))); - connect(buf, SIGNAL(msgPrepended(AbstractUiMsg *)), chatWidget, SLOT(prependMsg(AbstractUiMsg *))); - _chatWidgets[bufferId] = chatWidget; - ui.stackedWidget->addWidget(chatWidget); - chatWidget->setFocusProxy(this); - } - _currentBuffer = bufferId; - ui.stackedWidget->setCurrentWidget(chatWidget); - } - buf->setVisible(true); - setFocus(); +void BufferWidget::showChatView(AbstractChatView *view) { + if(!view) ui.stackedWidget->setCurrentWidget(ui.page); + else ui.stackedWidget->setCurrentWidget(dynamic_cast(view)); } diff --git a/src/qtui/bufferwidget.h b/src/qtui/bufferwidget.h index 089d498a..17e939dc 100644 --- a/src/qtui/bufferwidget.h +++ b/src/qtui/bufferwidget.h @@ -18,48 +18,30 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _BUFFERWIDGET_H_ -#define _BUFFERWIDGET_H_ +#ifndef BUFFERWIDGET_H_ +#define BUFFERWIDGET_H_ #include "ui_bufferwidget.h" -#include "abstractitemview.h" -#include "chatview.h" -#include "types.h" +#include "abstractbuffercontainer.h" -class Network; -class ChatView; -class ChatWidget; - -#include "buffermodel.h" - -//! Displays the contents of a Buffer. -/** -*/ -class BufferWidget : public AbstractItemView { +class BufferWidget : public AbstractBufferContainer { Q_OBJECT -public: - BufferWidget(QWidget *parent = 0); - virtual ~BufferWidget(); - void init(); + public: + BufferWidget(QWidget *parent); + virtual ~BufferWidget(); - inline BufferId currentBuffer() const { return _currentBuffer; } - -protected slots: - virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); - virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + protected: + virtual AbstractChatView *createChatView(BufferId); + virtual void removeChatView(AbstractChatView *view); -private slots: - void removeBuffer(BufferId bufferId); - void setCurrentBuffer(BufferId bufferId); + protected slots: + virtual void showChatView(AbstractChatView *view); -private: - Ui::BufferWidget ui; - QHash _chatWidgets; - QHash _chatViews; + private: + Ui::BufferWidget ui; - BufferId _currentBuffer; }; #endif diff --git a/src/qtui/chatview.cpp b/src/qtui/chatview.cpp index f9bc1751..54ca6f90 100644 --- a/src/qtui/chatview.cpp +++ b/src/qtui/chatview.cpp @@ -26,7 +26,7 @@ #include "chatview.h" #include "quasselui.h" -ChatView::ChatView(Buffer *buf, QWidget *parent) : QGraphicsView(parent) { +ChatView::ChatView(Buffer *buf, QWidget *parent) : QGraphicsView(parent), AbstractChatView() { _scene = new ChatScene(buf, this); setScene(_scene); @@ -80,8 +80,8 @@ void ChatView::appendChatLines(QList list) { } } -void ChatView::setContents(QList list) { +void ChatView::setContents(const QList &list) { qDebug() << "setting" << list.count(); - appendChatLines(list); + //appendChatLines(list); } diff --git a/src/qtui/chatview.h b/src/qtui/chatview.h index ef9d9236..cc627c76 100644 --- a/src/qtui/chatview.h +++ b/src/qtui/chatview.h @@ -23,12 +23,14 @@ #include +#include "abstractbuffercontainer.h" + class AbstractUiMsg; class Buffer; class ChatLine; class ChatScene; -class ChatView : public QGraphicsView { +class ChatView : public QGraphicsView, public AbstractChatView { Q_OBJECT public: @@ -49,7 +51,7 @@ class ChatView : public QGraphicsView { void prependChatLines(QList); void appendChatLines(QList); - void setContents(QList); + void setContents(const QList &); private: ChatScene *_scene; diff --git a/src/qtui/chatwidget.cpp b/src/qtui/chatwidget.cpp index 566de0d8..131caa42 100644 --- a/src/qtui/chatwidget.cpp +++ b/src/qtui/chatwidget.cpp @@ -27,8 +27,7 @@ #include "buffer.h" #include "clientbacklogmanager.h" -ChatWidget::ChatWidget(QWidget *parent) - : QAbstractScrollArea(parent), +ChatWidget::ChatWidget(BufferId bufid, QWidget *parent) : QAbstractScrollArea(parent), AbstractChatView(), lastBacklogOffset(0), lastBacklogSize(0) { @@ -50,6 +49,8 @@ ChatWidget::ChatWidget(QWidget *parent) pointerPosition = QPoint(0,0); connect(verticalScrollBar(), SIGNAL(actionTriggered(int)), this, SLOT(scrollBarAction(int))); connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(scrollBarValChanged(int))); + + init(bufid); } void ChatWidget::init(BufferId id) { @@ -248,12 +249,14 @@ void ChatWidget::appendChatLines(QList list) { viewport()->update(); } -void ChatWidget::setContents(QList list) { +void ChatWidget::setContents(const QList &list) { ycoords.clear(); ycoords.append(0); height = 0; lines.clear(); - appendChatLines(list); + QList cl; + foreach(AbstractUiMsg *msg, list) cl << dynamic_cast(msg); + appendChatLines(cl); } //!\brief Computes the different x position vars for given tsWidth and senderWidth. diff --git a/src/qtui/chatwidget.h b/src/qtui/chatwidget.h index e7d1782b..4c01ff1f 100644 --- a/src/qtui/chatwidget.h +++ b/src/qtui/chatwidget.h @@ -23,6 +23,7 @@ #include +#include "abstractbuffercontainer.h" #include "types.h" class ChatLineOld; @@ -39,11 +40,11 @@ class AbstractUiMsg; * Because we use this as a custom widget in Qt Designer, we cannot use a constructor that takes custom * parameters. Instead, it is mandatory to call init() before using this widget. */ -class ChatWidget : public QAbstractScrollArea { +class ChatWidget : public QAbstractScrollArea, public AbstractChatView { Q_OBJECT public: - ChatWidget(QWidget *parent = 0); + ChatWidget(BufferId, QWidget *parent = 0); ~ChatWidget(); void init(BufferId id); @@ -60,7 +61,7 @@ class ChatWidget : public QAbstractScrollArea { void appendChatLine(ChatLineOld *); void prependChatLines(QList); void appendChatLines(QList); - void setContents(QList); + void setContents(const QList &); protected: virtual void resizeEvent(QResizeEvent *event); diff --git a/src/qtui/mainwin.cpp b/src/qtui/mainwin.cpp index e81eb889..cb023cdc 100644 --- a/src/qtui/mainwin.cpp +++ b/src/qtui/mainwin.cpp @@ -84,7 +84,7 @@ void MainWin::init() { connect(Client::instance(), SIGNAL(networkCreated(NetworkId)), this, SLOT(clientNetworkCreated(NetworkId))); connect(Client::instance(), SIGNAL(networkRemoved(NetworkId)), this, SLOT(clientNetworkRemoved(NetworkId))); - ui.bufferWidget->init(); + //ui.bufferWidget->init(); show(); @@ -218,7 +218,7 @@ void MainWin::setupChatMonitor() { VerticalDock *dock = new VerticalDock(tr("Chat Monitor"), this); dock->setObjectName("ChatMonitorDock"); - ChatWidget *chatWidget = new ChatWidget(this); + ChatWidget *chatWidget = new ChatWidget(0, this); chatWidget->show(); dock->setWidget(chatWidget); dock->show(); @@ -227,13 +227,7 @@ void MainWin::setupChatMonitor() { if(!buf) return; - chatWidget->init(BufferId(0)); - QList lines; - QList msgs = buf->contents(); - foreach(AbstractUiMsg *msg, msgs) { - lines.append(dynamic_cast(msg)); - } - chatWidget->setContents(lines); + chatWidget->setContents(buf->contents()); connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *))); connect(buf, SIGNAL(msgPrepended(AbstractUiMsg *)), chatWidget, SLOT(prependMsg(AbstractUiMsg *))); diff --git a/src/uisupport/abstractbuffercontainer.cpp b/src/uisupport/abstractbuffercontainer.cpp new file mode 100644 index 00000000..78ead273 --- /dev/null +++ b/src/uisupport/abstractbuffercontainer.cpp @@ -0,0 +1,136 @@ +/*************************************************************************** + * 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 "abstractbuffercontainer.h" +#include "buffer.h" +#include "client.h" +#include "networkmodel.h" + +AbstractBufferContainer::AbstractBufferContainer(QWidget *parent) : AbstractItemView(parent), _currentBuffer(0) +{ + +} + +AbstractBufferContainer::~AbstractBufferContainer() { + +} + + +void AbstractBufferContainer::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) { + Q_ASSERT(model()); + if(!parent.isValid()) { + // ok this means that whole networks are about to be removed + // we can't determine which buffers are affect, so we hope that all nets are removed + // this is the most common case (for example disconnecting from the core or terminating the client) + if(model()->rowCount(parent) != end - start + 1) + return; + + AbstractChatView *chatView; + QHash::iterator iter = _chatViews.begin(); + while(iter != _chatViews.end()) { + chatView = *iter; + iter = _chatViews.erase(iter); + removeChatView(chatView); + } + } else { + // check if there are explicitly buffers removed + for(int i = start; i <= end; i++) { + QVariant variant = parent.child(i,0).data(NetworkModel::BufferIdRole); + if(!variant.isValid()) + continue; + + BufferId bufferId = variant.value(); + removeBuffer(bufferId); + } + } +} + +void AbstractBufferContainer::removeBuffer(BufferId bufferId) { + if(!_chatViews.contains(bufferId)) + return; + + if(Client::buffer(bufferId)) Client::buffer(bufferId)->setVisible(false); + AbstractChatView *chatView = _chatViews.take(bufferId); + removeChatView(chatView); +} + +void AbstractBufferContainer::currentChanged(const QModelIndex ¤t, const QModelIndex &previous) { + BufferId newBufferId = current.data(NetworkModel::BufferIdRole).value(); + BufferId oldBufferId = previous.data(NetworkModel::BufferIdRole).value(); + if(newBufferId != oldBufferId) + setCurrentBuffer(newBufferId); +} + +void AbstractBufferContainer::setCurrentBuffer(BufferId bufferId) { + if(!bufferId.isValid()) { + showChatView(0); + return; + } + + AbstractChatView *chatView = 0; + Buffer *buf = Client::buffer(bufferId); + if(!buf) { + qWarning() << "AbstractBufferContainer::setBuffer(BufferId): Can't show unknown Buffer:" << bufferId; + return; + } + Buffer *prevBuffer = Client::buffer(currentBuffer()); + if(prevBuffer) prevBuffer->setVisible(false); + if(_chatViews.contains(bufferId)) { + chatView = _chatViews[bufferId]; + } else { + chatView = createChatView(bufferId); + chatView->setContents(buf->contents()); + connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), this, SLOT(appendMsg(AbstractUiMsg *))); + connect(buf, SIGNAL(msgPrepended(AbstractUiMsg *)), this, SLOT(prependMsg(AbstractUiMsg *))); + _chatViews[bufferId] = chatView; + } + _currentBuffer = bufferId; + showChatView(chatView); + buf->setVisible(true); + setFocus(); +} + +void AbstractBufferContainer::appendMsg(AbstractUiMsg *msg) { + Buffer *buf = qobject_cast(sender()); + if(!buf) { + qWarning() << "AbstractBufferContainer::appendMsg(): Invalid slot caller!"; + return; + } + BufferId id = buf->bufferInfo().bufferId(); + if(!_chatViews.contains(id)) { + qWarning() << "AbstractBufferContainer::appendMsg(): Received message for unknown buffer!"; + return; + } + _chatViews[id]->appendMsg(msg); +} + +void AbstractBufferContainer::prependMsg(AbstractUiMsg *msg) { + Buffer *buf = qobject_cast(sender()); + if(!buf) { + qWarning() << "AbstractBufferContainer:prependMsg(): Invalid slot caller!"; + return; + } + BufferId id = buf->bufferInfo().bufferId(); + if(!_chatViews.contains(id)) { + qWarning() << "AbstractBufferContainer::prependMsg(): Received message for unknown buffer!"; + return; + } + _chatViews[id]->prependMsg(msg); +} diff --git a/src/uisupport/abstractbuffercontainer.h b/src/uisupport/abstractbuffercontainer.h new file mode 100644 index 00000000..d7278954 --- /dev/null +++ b/src/uisupport/abstractbuffercontainer.h @@ -0,0 +1,82 @@ +/*************************************************************************** + * 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 ABSTRACTBUFFERCONTAINER_H_ +#define ABSTRACTBUFFERCONTAINER_H_ + +#include "abstractitemview.h" +#include "buffermodel.h" + +class AbstractChatView; +class AbstractUiMsg; +class Buffer; + +class AbstractBufferContainer : public AbstractItemView { + Q_OBJECT + + public: + AbstractBufferContainer(QWidget *parent); + virtual ~AbstractBufferContainer(); + + inline BufferId currentBuffer() const { return _currentBuffer; } + + protected: + //! Create an AbstractChatView for the given BufferId and add it to the UI if necessary + virtual AbstractChatView *createChatView(BufferId) = 0; + + //! Remove a chat view from the UI and delete it + /** This method shall remove the view from the UI (for example, from a QStackedWidget) if appropriate. + * It also shall delete the object afterwards. + * \param view The chat view to be removed and deleted + */ + virtual void removeChatView(AbstractChatView *view) = 0; + + protected slots: + virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); + virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + + //! Show the given chat view + /** This method is called when the given chat view should be displayed. Use this e.g. for + * selecting the appropriate page in a QStackedWidget. + * \param view The chat view to be displayed. May be 0 if no chat view is selected. + */ + virtual void showChatView(AbstractChatView *view) = 0; + + private slots: + void appendMsg(AbstractUiMsg *); + void prependMsg(AbstractUiMsg *); + void removeBuffer(BufferId bufferId); + void setCurrentBuffer(BufferId bufferId); + + private: + BufferId _currentBuffer; + QHash _chatViews; +}; + +class AbstractChatView { + + public: + virtual void appendMsg(AbstractUiMsg *msg) = 0; + virtual void prependMsg(AbstractUiMsg *msg) = 0; + virtual void setContents(const QList &contents) = 0; + +}; + +#endif diff --git a/src/uisupport/bufferview.cpp b/src/uisupport/bufferview.cpp index c4529cbf..bb19b753 100644 --- a/src/uisupport/bufferview.cpp +++ b/src/uisupport/bufferview.cpp @@ -234,16 +234,20 @@ void BufferView::showContextMenu(const QPoint &pos) { network->requestDisconnect(); } else if(result == joinChannelAction) { + // FIXME no QInputDialog in Qtopia +#ifndef Q_WS_QWS bool ok; QString channelName = QInputDialog::getText(this, tr("Join Channel"), tr("Input channel name:"),QLineEdit::Normal, QDir::home().dirName(), &ok); + if (ok && !channelName.isEmpty()) { BufferInfo bufferInfo = index.child(0,0).data(NetworkModel::BufferInfoRole).value(); if(bufferInfo.isValid()) { Client::instance()->userInput(bufferInfo, QString("/J %1").arg(channelName)); } } +#endif } else if(result == joinBufferAction) { Client::instance()->userInput(bufferInfo, QString("/JOIN %1").arg(channelname)); diff --git a/src/uisupport/clearablelineedit.cpp b/src/uisupport/clearablelineedit.cpp index ae99be6f..0ba26d5c 100644 --- a/src/uisupport/clearablelineedit.cpp +++ b/src/uisupport/clearablelineedit.cpp @@ -28,7 +28,9 @@ ClearableLineEdit::ClearableLineEdit(QWidget *parent) { clearButton = new QToolButton(this); clearButton->setIcon(QIcon(":/22x22/actions/oxygen/22x22/actions/edit-clear-locationbar-rtl.png")); +#ifndef Q_WS_QWS clearButton->setCursor(Qt::ArrowCursor); +#endif clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }"); clearButton->hide(); diff --git a/src/uisupport/uisupport.pri b/src/uisupport/uisupport.pri index 426515ab..1f5de7f0 100644 --- a/src/uisupport/uisupport.pri +++ b/src/uisupport/uisupport.pri @@ -1,8 +1,10 @@ DEPMOD = common client QT_MOD = core gui network -SRCS += abstractitemview.cpp bufferview.cpp bufferviewfilter.cpp clearablelineedit.cpp colorbutton.cpp nickviewfilter.cpp inputline.cpp nickview.cpp settingspage.cpp tabcompleter.cpp uisettings.cpp uistyle.cpp uistylesettings.cpp -HDRS += abstractitemview.h bufferview.h bufferviewfilter.h clearablelineedit.h colorbutton.h nickviewfilter.h inputline.h nickview.h settingspage.h tabcompleter.h uisettings.h uistyle.h uistylesettings.h +SRCS += abstractbuffercontainer.cpp abstractitemview.cpp bufferview.cpp bufferviewfilter.cpp clearablelineedit.cpp colorbutton.cpp \ + nickviewfilter.cpp inputline.cpp nickview.cpp settingspage.cpp tabcompleter.cpp uisettings.cpp uistyle.cpp uistylesettings.cpp +HDRS += abstractbuffercontainer.h abstractitemview.h bufferview.h bufferviewfilter.h clearablelineedit.h colorbutton.h \ + nickviewfilter.h inputline.h nickview.h settingspage.h tabcompleter.h uisettings.h uistyle.h uistylesettings.h FORMNAMES = diff --git a/version.inc b/version.inc index 278e4bec..98a81336 100644 --- a/version.inc +++ b/version.inc @@ -4,8 +4,8 @@ { using namespace Global; quasselVersion = "0.2.0-alpha4-pre"; - quasselDate = "2008-03-21"; - quasselBuild = 655; + quasselDate = "2008-03-25"; + quasselBuild = 657; //! Minimum client build number the core needs clientBuildNeeded = 642; -- 2.20.1