Used the trip back from CeBIT to prepare everything for a huge
authorManuel Nickschas <sputnick@quassel-irc.org>
Fri, 7 Mar 2008 20:59:13 +0000 (20:59 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 7 Mar 2008 20:59:13 +0000 (20:59 +0000)
let's-rewrite-the-ChatWidget action...

* ChatLine -> ChatLineOld
* Added ChatItem, -Line, -Scene, -View to the build system again
* #define SPUTDEV -> Global::SPUTDEV and ./quasselclient --sputdev
* Started some random hacking in the ChatView related sources

Disclaimer: DO NOT USE --sputdev, it might eat your babies (and does
            not look good anyway yet :P)

21 files changed:
src/common/global.cpp
src/common/global.h
src/common/main.cpp
src/qtopia/chatwidget.cpp
src/qtopia/chatwidget.h
src/qtopia/mainwidget.cpp
src/qtopia/qtopiamainwin.cpp
src/qtui/bufferwidget.cpp
src/qtui/bufferwidget.h
src/qtui/chatitem.cpp
src/qtui/chatline-old.cpp
src/qtui/chatline-old.h
src/qtui/chatline.h
src/qtui/chatview.cpp
src/qtui/chatview.h
src/qtui/chatwidget.cpp
src/qtui/chatwidget.h
src/qtui/mainwin.cpp
src/qtui/qtui.pri
src/qtui/settingsdlg.cpp
src/uisupport/bufferview.cpp

index 95f43e7..57de198 100644 (file)
@@ -109,3 +109,5 @@ QString Global::coreVersionNeeded;
 
 Global::RunMode Global::runMode;
 uint Global::defaultPort;
 
 Global::RunMode Global::runMode;
 uint Global::defaultPort;
+
+bool Global::SPUTDEV;
index 3963367..d5fbdec 100644 (file)
@@ -53,6 +53,8 @@ namespace Global {
   extern RunMode runMode;
   extern unsigned int defaultPort;
 
   extern RunMode runMode;
   extern unsigned int defaultPort;
 
+  extern bool SPUTDEV; // FIXME This is for internal use only!
+
   void registerMetaTypes();
 };
 
   void registerMetaTypes();
 };
 
index 0209647..a8421e8 100644 (file)
@@ -103,6 +103,7 @@ int main(int argc, char **argv) {
 
   // Check if a non-standard core port is requested
   QStringList args = QCoreApplication::arguments();  // TODO Build a CLI parser
 
   // Check if a non-standard core port is requested
   QStringList args = QCoreApplication::arguments();  // TODO Build a CLI parser
+  Global::SPUTDEV = args.contains("--sputdev"); // This enables various debug features for Sput. Do not touch.
 
   Global::defaultPort = 4242;
   int idx;
 
   Global::defaultPort = 4242;
   int idx;
index d676df4..43758d3 100644 (file)
@@ -27,25 +27,25 @@ ChatWidget::ChatWidget(QWidget *parent) : QTextEdit(parent) {
   setTextInteractionFlags(Qt::TextBrowserInteraction);
 }
 
   setTextInteractionFlags(Qt::TextBrowserInteraction);
 }
 
-void ChatWidget::setContents(QList<ChatLine *> lines) {
+void ChatWidget::setContents(QList<ChatLineOld *> lines) {
   clear();
   appendChatLines(lines);
 
 }
 
 void ChatWidget::prependMsg(AbstractUiMsg *msg) {
   clear();
   appendChatLines(lines);
 
 }
 
 void ChatWidget::prependMsg(AbstractUiMsg *msg) {
-  ChatLine *line = static_cast<ChatLine*>(msg);
+  ChatLineOld *line = static_cast<ChatLineOld*>(msg);
   Q_ASSERT(line);
   prependChatLine(line);
 }
 
 void ChatWidget::appendMsg(AbstractUiMsg *msg) {
   Q_ASSERT(line);
   prependChatLine(line);
 }
 
 void ChatWidget::appendMsg(AbstractUiMsg *msg) {
-  ChatLine *line = static_cast<ChatLine*>(msg);
+  ChatLineOld *line = static_cast<ChatLineOld*>(msg);
   Q_ASSERT(line);
   appendChatLine(line);
 }
 
   Q_ASSERT(line);
   appendChatLine(line);
 }
 
-void ChatWidget::appendChatLine(ChatLine *line) {
+void ChatWidget::appendChatLine(ChatLineOld *line) {
   QTextCursor cursor = textCursor();
   moveCursor(QTextCursor::End);
   if(!document()->isEmpty()) insertPlainText("\n");
   QTextCursor cursor = textCursor();
   moveCursor(QTextCursor::End);
   if(!document()->isEmpty()) insertPlainText("\n");
@@ -55,13 +55,13 @@ void ChatWidget::appendChatLine(ChatLine *line) {
   setTextCursor(cursor);
 }
 
   setTextCursor(cursor);
 }
 
-void ChatWidget::appendChatLines(QList<ChatLine *> list) {
-  foreach(ChatLine *line, list) {
+void ChatWidget::appendChatLines(QList<ChatLineOld *> list) {
+  foreach(ChatLineOld *line, list) {
     appendChatLine(line);
   }
 }
 
     appendChatLine(line);
   }
 }
 
-void ChatWidget::prependChatLine(ChatLine *line) {
+void ChatWidget::prependChatLine(ChatLineOld *line) {
   QTextCursor cursor = textCursor();
   moveCursor(QTextCursor::Start);
   bool flg = document()->isEmpty();
   QTextCursor cursor = textCursor();
   moveCursor(QTextCursor::Start);
   bool flg = document()->isEmpty();
@@ -72,13 +72,13 @@ void ChatWidget::prependChatLine(ChatLine *line) {
   setTextCursor(cursor);
 }
 
   setTextCursor(cursor);
 }
 
-void ChatWidget::prependChatLines(QList<ChatLine *> list) {
-  foreach(ChatLine *line, list) {
+void ChatWidget::prependChatLines(QList<ChatLineOld *> list) {
+  foreach(ChatLineOld *line, list) {
     prependChatLine(line);
   }
 }
 
     prependChatLine(line);
   }
 }
 
-void ChatWidget::insertChatLine(ChatLine *line) {
+void ChatWidget::insertChatLine(ChatLineOld *line) {
   if(!document()->isEmpty()) insertPlainText("\n");
   insertStyledText(line->styledSender());
   insertPlainText(" ");
   if(!document()->isEmpty()) insertPlainText("\n");
   insertStyledText(line->styledSender());
   insertPlainText(" ");
index a85f263..052adc4 100644 (file)
@@ -33,16 +33,16 @@ class ChatWidget : public QTextEdit {
     ChatWidget(QWidget *parent = 0);
 
   public slots:
     ChatWidget(QWidget *parent = 0);
 
   public slots:
-    void setContents(QList<ChatLine *>);
+    void setContents(QList<ChatLineOld *>);
     void appendMsg(AbstractUiMsg *);
     void prependMsg(AbstractUiMsg *);
     void appendMsg(AbstractUiMsg *);
     void prependMsg(AbstractUiMsg *);
-    void prependChatLine(ChatLine *);
-    void appendChatLine(ChatLine *);
-    void prependChatLines(QList<ChatLine *>);
-    void appendChatLines(QList<ChatLine *>);
+    void prependChatLine(ChatLineOld *);
+    void appendChatLine(ChatLineOld *);
+    void prependChatLines(QList<ChatLineOld *>);
+    void appendChatLines(QList<ChatLineOld *>);
 
   private:
 
   private:
-    void insertChatLine(ChatLine *);
+    void insertChatLine(ChatLineOld *);
     void insertStyledText(const QtopiaUiStyle::StyledText &);
 
 
     void insertStyledText(const QtopiaUiStyle::StyledText &);
 
 
index e8d1184..4fde19b 100644 (file)
@@ -55,10 +55,10 @@ void MainWidget::setBuffer(Buffer *buf) {
   ChatWidget *chatWidget;
   if(!chatWidgets.contains(buf)) {
     chatWidget = new ChatWidget(this);
   ChatWidget *chatWidget;
   if(!chatWidgets.contains(buf)) {
     chatWidget = new ChatWidget(this);
-    QList<ChatLine *> lines;
+    QList<ChatLineOld *> lines;
     QList<AbstractUiMsg *> msgs = buf->contents();
     foreach(AbstractUiMsg *msg, msgs) {
     QList<AbstractUiMsg *> msgs = buf->contents();
     foreach(AbstractUiMsg *msg, msgs) {
-      lines.append((ChatLine*)(msg));
+      lines.append((ChatLineOld*)(msg));
     }
     chatWidget->setContents(lines);
     connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *)));
     }
     chatWidget->setContents(lines);
     connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *)));
index 0b896f3..e6071e6 100644 (file)
@@ -142,7 +142,7 @@ void QtopiaMainWin::disconnectedFromCore() {
 }
 
 AbstractUiMsg *QtopiaMainWin::layoutMsg(const Message &msg) {
 }
 
 AbstractUiMsg *QtopiaMainWin::layoutMsg(const Message &msg) {
-  return new ChatLine(msg);
+  return new ChatLineOld(msg);
   //return 0;
 }
 
   //return 0;
 }
 
index 0ebcffb..51c551c 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "bufferwidget.h"
 #include "buffer.h"
 
 #include "bufferwidget.h"
 #include "buffer.h"
+#include "chatline.h"
 #include "chatline-old.h"
 #include "chatwidget.h"
 #include "settings.h"
 #include "chatline-old.h"
 #include "chatwidget.h"
 #include "settings.h"
@@ -28,6 +29,8 @@
 #include "network.h"
 #include "networkmodel.h"
 
 #include "network.h"
 #include "networkmodel.h"
 
+#include "global.h"
+
 BufferWidget::BufferWidget(QWidget *parent)
   : QWidget(parent),
     _bufferModel(0),
 BufferWidget::BufferWidget(QWidget *parent)
   : QWidget(parent),
     _bufferModel(0),
@@ -51,7 +54,7 @@ void BufferWidget::setModel(BufferModel *bufferModel) {
 
   if(bufferModel) {
     connect(bufferModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)),
 
   if(bufferModel) {
     connect(bufferModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex, int, int)),
-           this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int)));
+            this, SLOT(rowsAboutToBeRemoved(QModelIndex, int, int)));
   }
 }
 
   }
 }
 
@@ -63,7 +66,7 @@ void BufferWidget::setSelectionModel(QItemSelectionModel *selectionModel) {
 
   if(selectionModel) {
     connect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)),
 
   if(selectionModel) {
     connect(selectionModel, SIGNAL(currentChanged(QModelIndex, QModelIndex)),
-           this, SLOT(currentChanged(QModelIndex, QModelIndex)));
+            this, SLOT(currentChanged(QModelIndex, QModelIndex)));
   }
 }
 
   }
 }
 
@@ -90,7 +93,7 @@ void BufferWidget::rowsAboutToBeRemoved(const QModelIndex &parent, int start, in
     for(int i = start; i <= end; i++) {
       QVariant variant = parent.child(i,0).data(NetworkModel::BufferIdRole);
       if(!variant.isValid())
     for(int i = start; i <= end; i++) {
       QVariant variant = parent.child(i,0).data(NetworkModel::BufferIdRole);
       if(!variant.isValid())
-       continue;
+        continue;
       
       BufferId bufferId = qVariantValue<BufferId>(variant);
       removeBuffer(bufferId);
       
       BufferId bufferId = qVariantValue<BufferId>(variant);
       removeBuffer(bufferId);
@@ -122,6 +125,7 @@ void BufferWidget::setCurrentBuffer(BufferId bufferId) {
   }
   
   ChatWidget *chatWidget = 0;
   }
   
   ChatWidget *chatWidget = 0;
+  ChatView *chatView = 0;
   Buffer *buf = Client::buffer(bufferId);
   if(!buf) {
     qWarning() << "BufferWidget::setBuffer(BufferId): Can't show unknown Buffer:" << bufferId;
   Buffer *buf = Client::buffer(bufferId);
   if(!buf) {
     qWarning() << "BufferWidget::setBuffer(BufferId): Can't show unknown Buffer:" << bufferId;
@@ -129,25 +133,47 @@ void BufferWidget::setCurrentBuffer(BufferId bufferId) {
   }
   Buffer *prevBuffer = Client::buffer(currentBuffer());
   if(prevBuffer) prevBuffer->setVisible(false);
   }
   Buffer *prevBuffer = Client::buffer(currentBuffer());
   if(prevBuffer) prevBuffer->setVisible(false);
-  if(_chatWidgets.contains(bufferId)) {
-     chatWidget = _chatWidgets[bufferId];
+  if(Global::SPUTDEV) {
+    if(_chatViews.contains(bufferId)) {
+      chatView = _chatViews[bufferId];
+    } else {
+      chatView = new ChatView(buf, this);
+      //chatView->init(bufferId);
+      QList<ChatLine *> lines;
+      QList<AbstractUiMsg *> msgs = buf->contents();
+      foreach(AbstractUiMsg *msg, msgs) {
+        lines.append(dynamic_cast<ChatLine *>(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 {
   } else {
-    chatWidget = new ChatWidget(this);
-    chatWidget->init(bufferId);
-    QList<ChatLine *> lines;
-    QList<AbstractUiMsg *> msgs = buf->contents();
-    foreach(AbstractUiMsg *msg, msgs) {
-      lines.append(dynamic_cast<ChatLine*>(msg));
+    if(_chatWidgets.contains(bufferId)) {
+      chatWidget = _chatWidgets[bufferId];
+    } else {
+      chatWidget = new ChatWidget(this);
+      chatWidget->init(bufferId);
+      QList<ChatLineOld *> lines;
+      QList<AbstractUiMsg *> msgs = buf->contents();
+      foreach(AbstractUiMsg *msg, msgs) {
+        lines.append(dynamic_cast<ChatLineOld*>(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);
     }
     }
-    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);
   }
   }
-  _currentBuffer = bufferId;
-  ui.stackedWidget->setCurrentWidget(chatWidget);
   buf->setVisible(true);
   setFocus();
 }
   buf->setVisible(true);
   setFocus();
 }
index e484a18..40413b3 100644 (file)
@@ -69,6 +69,7 @@ private slots:
 private:
   Ui::BufferWidget ui;
   QHash<BufferId, ChatWidget *> _chatWidgets;
 private:
   Ui::BufferWidget ui;
   QHash<BufferId, ChatWidget *> _chatWidgets;
+  QHash<BufferId, ChatView *> _chatViews;
 
   QPointer<BufferModel> _bufferModel;
   QPointer<QItemSelectionModel> _selectionModel;
 
   QPointer<BufferModel> _bufferModel;
   QPointer<QItemSelectionModel> _selectionModel;
index 2e3e22d..e6f602e 100644 (file)
@@ -91,7 +91,9 @@ void ChatItem::layout() {
   }
   _layout.endLayout();
   update();
   }
   _layout.endLayout();
   update();
-}
+}    QDateTime _timestamp;
+    MsgId _msgId;
+
 
 QRectF ChatItem::boundingRect() const {
   return _layout.boundingRect();
 
 QRectF ChatItem::boundingRect() const {
   return _layout.boundingRect();
index b7ebf9b..2c9cb0d 100644 (file)
 #include "network.h"
 #include "qtui.h"
 
 #include "network.h"
 #include "qtui.h"
 
-//! Construct a ChatLine object from a message.
+//! Construct a ChatLineOld object from a message.
 /**
  * \param m   The message to be layouted and rendered
  */
 /**
  * \param m   The message to be layouted and rendered
  */
-ChatLine::ChatLine(Message m) {
+ChatLineOld::ChatLineOld(Message m) {
   hght = 0;
   //networkName = m.buffer.network();
   //bufferName = m.buffer.buffer();
   hght = 0;
   //networkName = m.buffer.network();
   //bufferName = m.buffer.buffer();
@@ -37,11 +37,11 @@ ChatLine::ChatLine(Message m) {
   formatMsg(msg);
 }
 
   formatMsg(msg);
 }
 
-ChatLine::~ChatLine() {
+ChatLineOld::~ChatLineOld() {
 
 }
 
 
 }
 
-void ChatLine::formatMsg(Message msg) {
+void ChatLineOld::formatMsg(Message msg) {
   isHighlight = msg.flags() & Message::Highlight;
   QTextOption tsOption, senderOption, textOption;
   styledTimeStamp = QtUi::style()->styleString(msg.formattedTimestamp());
   isHighlight = msg.flags() & Message::Highlight;
   QTextOption tsOption, senderOption, textOption;
   styledTimeStamp = QtUi::style()->styleString(msg.formattedTimestamp());
@@ -51,8 +51,8 @@ void ChatLine::formatMsg(Message msg) {
 }
 
 // This function is almost obsolete, since with the new style engine, we already get a list of formats...
 }
 
 // This function is almost obsolete, since with the new style engine, we already get a list of formats...
-// We don't know yet if we keep this implementation of ChatLine, so I won't bother making this actually nice.
-QList<ChatLine::FormatRange> ChatLine::calcFormatRanges(UiStyle::StyledText fs, QTextLayout::FormatRange additional) {
+// We don't know yet if we keep this implementation of ChatLineOld, so I won't bother making this actually nice.
+QList<ChatLineOld::FormatRange> ChatLineOld::calcFormatRanges(UiStyle::StyledText fs, QTextLayout::FormatRange additional) {
   QList<FormatRange> ranges;
 
   if(additional.length > 0) {
   QList<FormatRange> ranges;
 
   if(additional.length > 0) {
@@ -89,7 +89,7 @@ QList<ChatLine::FormatRange> ChatLine::calcFormatRanges(UiStyle::StyledText fs,
   return ranges;
 }
 
   return ranges;
 }
 
-void ChatLine::setSelection(SelectionMode mode, int start, int end) {
+void ChatLineOld::setSelection(SelectionMode mode, int start, int end) {
   selectionMode = mode;
   //tsFormat.clear(); senderFormat.clear(); textFormat.clear();
   QPalette pal = QApplication::palette();
   selectionMode = mode;
   //tsFormat.clear(); senderFormat.clear(); textFormat.clear();
   QPalette pal = QApplication::palette();
@@ -125,32 +125,32 @@ void ChatLine::setSelection(SelectionMode mode, int start, int end) {
   }
 }
 
   }
 }
 
-MsgId ChatLine::msgId() const {
+MsgId ChatLineOld::msgId() const {
   return msg.msgId();
 }
 
   return msg.msgId();
 }
 
-BufferInfo ChatLine::bufferInfo() const {
+BufferInfo ChatLineOld::bufferInfo() const {
   return msg.bufferInfo();
 }
 
   return msg.bufferInfo();
 }
 
-QDateTime ChatLine::timestamp() const {
+QDateTime ChatLineOld::timestamp() const {
   return msg.timestamp();
 }
 
   return msg.timestamp();
 }
 
-QString ChatLine::sender() const {
+QString ChatLineOld::sender() const {
   return styledSender.text;
 }
 
   return styledSender.text;
 }
 
-QString ChatLine::text() const {
+QString ChatLineOld::text() const {
   return styledText.text;
 }
 
   return styledText.text;
 }
 
-bool ChatLine::isUrl(int c) const {
+bool ChatLineOld::isUrl(int c) const {
   if(c < 0 || c >= charUrlIdx.count()) return false;;
   return charUrlIdx[c] >= 0;
 }
 
   if(c < 0 || c >= charUrlIdx.count()) return false;;
   return charUrlIdx[c] >= 0;
 }
 
-QUrl ChatLine::getUrl(int c) const {
+QUrl ChatLineOld::getUrl(int c) const {
   if(c < 0 || c >= charUrlIdx.count()) return QUrl();
   int i = charUrlIdx[c];
   if(i >= 0) return styledText.urls[i].url;
   if(c < 0 || c >= charUrlIdx.count()) return QUrl();
   int i = charUrlIdx[c];
   if(i >= 0) return styledText.urls[i].url;
@@ -159,10 +159,10 @@ QUrl ChatLine::getUrl(int c) const {
 
 //!\brief Return the cursor position for the given coordinate pos.
 /**
 
 //!\brief Return the cursor position for the given coordinate pos.
 /**
- * \param pos The position relative to the ChatLine
+ * \param pos The position relative to the ChatLineOld
  * \return The cursor position, [or -3 for invalid,] or -2 for timestamp, or -1 for sender
  */
  * \return The cursor position, [or -3 for invalid,] or -2 for timestamp, or -1 for sender
  */
-int ChatLine::posToCursor(QPointF pos) {
+int ChatLineOld::posToCursor(QPointF pos) {
   if(pos.x() < tsWidth + (int)QtUi::style()->sepTsSender()/2) return -2;
   qreal textStart = tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText();
   if(pos.x() < textStart) return -1;
   if(pos.x() < tsWidth + (int)QtUi::style()->sepTsSender()/2) return -2;
   qreal textStart = tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText();
   if(pos.x() < textStart) return -1;
@@ -180,7 +180,7 @@ int ChatLine::posToCursor(QPointF pos) {
   return 0;
 }
 
   return 0;
 }
 
-void ChatLine::precomputeLine() {
+void ChatLineOld::precomputeLine() {
   tsFormat = calcFormatRanges(styledTimeStamp);
   senderFormat = calcFormatRanges(styledSender);
   textFormat = calcFormatRanges(styledText);
   tsFormat = calcFormatRanges(styledTimeStamp);
   senderFormat = calcFormatRanges(styledSender);
   textFormat = calcFormatRanges(styledText);
@@ -233,7 +233,7 @@ void ChatLine::precomputeLine() {
   if(wr.start >= 0) words.append(wr);
 }
 
   if(wr.start >= 0) words.append(wr);
 }
 
-qreal ChatLine::layout(qreal tsw, qreal senderw, qreal textw) {
+qreal ChatLineOld::layout(qreal tsw, qreal senderw, qreal textw) {
   tsWidth = tsw; senderWidth = senderw; textWidth = textw;
   if(textw <= 0) return minHeight;
   lineLayouts.clear(); LineLayout line;
   tsWidth = tsw; senderWidth = senderw; textWidth = textw;
   if(textw <= 0) return minHeight;
   lineLayouts.clear(); LineLayout line;
@@ -298,8 +298,8 @@ qreal ChatLine::layout(qreal tsw, qreal senderw, qreal textw) {
   return hght;
 }
 
   return hght;
 }
 
-//!\brief Draw ChatLine on the given QPainter at the given position.
-void ChatLine::draw(QPainter *p, const QPointF &pos) {
+//!\brief Draw ChatLineOld on the given QPainter at the given position.
+void ChatLineOld::draw(QPainter *p, const QPointF &pos) {
   QPalette pal = QApplication::palette();
 
   if(selectionMode == Full) {
   QPalette pal = QApplication::palette();
 
   if(selectionMode == Full) {
index b29aca2..ac95494 100644 (file)
@@ -18,8 +18,8 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
-#ifndef _CHATLINE_H_
-#define _CHATLINE_H_
+#ifndef _CHATLINE_OLD_H_
+#define _CHATLINE_OLD_H_
 
 #include <QtGui>
 
 
 #include <QtGui>
 
@@ -29,7 +29,7 @@
 
 //FIXME: chatline doku
 //!\brief Containing the layout and providing the rendering of a single message.
 
 //FIXME: chatline doku
 //!\brief Containing the layout and providing the rendering of a single message.
-/** A ChatLine takes a Message object,
+/** A ChatLineOld takes a Message object,
  * formats it (by turning the various message types into a human-readable form and afterwards pumping it through
  * our Style engine), and stores it as a number of QTextLayouts representing the three fields of a chat line
  * (timestamp, sender and text). These layouts already include any rendering information such as font,
  * formats it (by turning the various message types into a human-readable form and afterwards pumping it through
  * our Style engine), and stores it as a number of QTextLayouts representing the three fields of a chat line
  * (timestamp, sender and text). These layouts already include any rendering information such as font,
  * per message) from the actual layouting and painting, we gain a lot of speed compared to the standard Qt rendering
  * functions.
  */
  * per message) from the actual layouting and painting, we gain a lot of speed compared to the standard Qt rendering
  * functions.
  */
-class ChatLine : public QObject, public AbstractUiMsg {
+class ChatLineOld : public QObject, public AbstractUiMsg {
   Q_OBJECT
 
   public:
   Q_OBJECT
 
   public:
-    ChatLine(Message message);
-    virtual ~ChatLine();
+    ChatLineOld(Message message);
+    virtual ~ChatLineOld();
 
     qreal layout(qreal tsWidth, qreal nickWidth, qreal textWidth);
     qreal height() const { return hght; }
 
     qreal layout(qreal tsWidth, qreal nickWidth, qreal textWidth);
     qreal height() const { return hght; }
index 2a6daed..fca296f 100644 (file)
 #include "uistyle.h"
 
 class ChatItem;
 #include "uistyle.h"
 
 class ChatItem;
+class ChatLineData;
+
+/* Concept Ideas
+* Probably makes sense to have ChatLineData be the AbstractUiMsg instead, if it turns out that creating ChatLineData
+is the expensive part... In that case, we could have a QHash<MsgId, ChatLineData*> in the Client, and ChatLine just
+gets a data pointer. This would allow us to share most data between AbstractUiMsgs, and ChatLines themselves could
+be pretty cheap - that'd be a clean solution for having a monitor buffer, highlight buffer etcpp.
+
+* ItemLayoutData
+
+*/
 
 class ChatLine : public QGraphicsItem, public AbstractUiMsg {
 
 
 class ChatLine : public QGraphicsItem, public AbstractUiMsg {
 
@@ -53,6 +64,7 @@ class ChatLine : public QGraphicsItem, public AbstractUiMsg {
 
   private:
     UiStyle::StyledText _styledTimestamp, _styledText, _styledSender;
 
   private:
     UiStyle::StyledText _styledTimestamp, _styledText, _styledSender;
+
     QDateTime _timestamp;
     MsgId _msgId;
 
     QDateTime _timestamp;
     MsgId _msgId;
 
@@ -60,4 +72,30 @@ class ChatLine : public QGraphicsItem, public AbstractUiMsg {
     int _tsColWidth, _senderColWidth, _textColWidth;
 };
 
     int _tsColWidth, _senderColWidth, _textColWidth;
 };
 
+//! This contains the data of a ChatLine, i.e. mainly the styled message contents.
+/** By separating ChatLine and ChatLineData, ChatLine itself is very small and we can reuse the
+ *  same contents in several ChatLine objects without duplicating data.
+ */
+class ChatLineData {
+
+  public:
+    ChatLineData(const Message &msg);
+
+    inline UiStyle::StyledText styledSender() const { return _styledSender; }
+    inline UiStyle::StyledText styledTimestamp() const { return _styledTimestamp; }
+    inline UiStyle::StyledText styledText() const { return _styledText; }
+
+    inline QString sender() const { return _styledSender.text; }
+    inline QString text() const { return _styledText.text; }
+    inline QDateTime timestamp() const { return _timestamp; }
+    inline MsgId msgId() const { return _msgId; }
+
+  private:
+    UiStyle::StyledText _styledSender, _styledText, _styledTimestamp;
+    QDateTime _timestamp;
+    MsgId _msgId;
+
+};
+
+
 #endif
 #endif
index dc337d5..f9bc175 100644 (file)
@@ -30,7 +30,7 @@ ChatView::ChatView(Buffer *buf, QWidget *parent) : QGraphicsView(parent) {
   _scene = new ChatScene(buf, this);
   setScene(_scene);
 
   _scene = new ChatScene(buf, this);
   setScene(_scene);
 
-  QGraphicsTextItem *item = scene()->addText(buf->name());
+  QGraphicsTextItem *item = scene()->addText(buf->bufferInfo().bufferName());
 
 }
 
 
 }
 
@@ -44,7 +44,7 @@ ChatScene *ChatView::scene() const {
   return _scene;
 }
 
   return _scene;
 }
 
-/*
+
 void ChatView::clear()
 {
 }
 void ChatView::clear()
 {
 }
@@ -56,7 +56,7 @@ void ChatView::prependMsg(AbstractUiMsg *msg) {
 }
 
 void ChatView::prependChatLine(ChatLine *line) {
 }
 
 void ChatView::prependChatLine(ChatLine *line) {
-  qDebug() << "prepending";
+  //qDebug() << "prepending";
 }
 
 void ChatView::prependChatLines(QList<ChatLine *> clist) {
 }
 
 void ChatView::prependChatLines(QList<ChatLine *> clist) {
@@ -70,7 +70,7 @@ void ChatView::appendMsg(AbstractUiMsg *msg) {
 }
 
 void ChatView::appendChatLine(ChatLine *line) {
 }
 
 void ChatView::appendChatLine(ChatLine *line) {
-  qDebug() << "appending";
+  //qDebug() << "appending";
 }
 
 
 }
 
 
@@ -84,4 +84,4 @@ void ChatView::setContents(QList<ChatLine *> list) {
   qDebug() << "setting" << list.count();
   appendChatLines(list);
 }
   qDebug() << "setting" << list.count();
   appendChatLines(list);
 }
-*/
+
index 4a46d30..ef9d923 100644 (file)
@@ -38,7 +38,7 @@ class ChatView : public QGraphicsView {
     ChatScene *scene() const;
 
   public slots:
     ChatScene *scene() const;
 
   public slots:
-/*
+
     void clear();
 
     void prependMsg(AbstractUiMsg *);
     void clear();
 
     void prependMsg(AbstractUiMsg *);
@@ -50,7 +50,7 @@ class ChatView : public QGraphicsView {
     void appendChatLines(QList<ChatLine *>);
 
     void setContents(QList<ChatLine *>);
     void appendChatLines(QList<ChatLine *>);
 
     void setContents(QList<ChatLine *>);
-*/
+
   private:
     ChatScene *_scene;
 };
   private:
     ChatScene *_scene;
 };
index 3a04383..8a9b7a2 100644 (file)
@@ -71,7 +71,7 @@ void ChatWidget::init(BufferId id) {
 
 ChatWidget::~ChatWidget() {
   //qDebug() << "destroying chatwidget" << bufferName;
 
 ChatWidget::~ChatWidget() {
   //qDebug() << "destroying chatwidget" << bufferName;
-  //foreach(ChatLine *l, lines) {
+  //foreach(ChatLineOld *l, lines) {
   //  delete l;
   //}
   UiSettings s;
   //  delete l;
   //}
   UiSettings s;
@@ -161,12 +161,12 @@ void ChatWidget::clear() {
 }
 
 void ChatWidget::prependMsg(AbstractUiMsg *msg) {
 }
 
 void ChatWidget::prependMsg(AbstractUiMsg *msg) {
-  ChatLine *line = dynamic_cast<ChatLine*>(msg);
+  ChatLineOld *line = dynamic_cast<ChatLineOld*>(msg);
   Q_ASSERT(line);
   prependChatLine(line);
 }
 
   Q_ASSERT(line);
   prependChatLine(line);
 }
 
-void ChatWidget::prependChatLine(ChatLine *line) {
+void ChatWidget::prependChatLine(ChatLineOld *line) {
   qreal h = line->layout(tsWidth, senderWidth, textWidth);
   for(int i = 1; i < ycoords.count(); i++) ycoords[i] += h;
   ycoords.insert(1, h);
   qreal h = line->layout(tsWidth, senderWidth, textWidth);
   for(int i = 1; i < ycoords.count(); i++) ycoords[i] += h;
   ycoords.insert(1, h);
@@ -181,10 +181,10 @@ void ChatWidget::prependChatLine(ChatLine *line) {
   viewport()->update();
 }
 
   viewport()->update();
 }
 
-void ChatWidget::prependChatLines(QList<ChatLine *> clist) {
+void ChatWidget::prependChatLines(QList<ChatLineOld *> clist) {
   QList<qreal> tmpy; tmpy.append(0);
   qreal h = 0;
   QList<qreal> tmpy; tmpy.append(0);
   qreal h = 0;
-  foreach(ChatLine *l, clist) {
+  foreach(ChatLineOld *l, clist) {
     h += l->layout(tsWidth, senderWidth, textWidth);
     tmpy.append(h);
   }
     h += l->layout(tsWidth, senderWidth, textWidth);
     tmpy.append(h);
   }
@@ -208,12 +208,12 @@ void ChatWidget::prependChatLines(QList<ChatLine *> clist) {
 }
 
 void ChatWidget::appendMsg(AbstractUiMsg *msg) {
 }
 
 void ChatWidget::appendMsg(AbstractUiMsg *msg) {
-  ChatLine *line = dynamic_cast<ChatLine*>(msg);
+  ChatLineOld *line = dynamic_cast<ChatLineOld*>(msg);
   Q_ASSERT(line);
   appendChatLine(line);
 }
 
   Q_ASSERT(line);
   appendChatLine(line);
 }
 
-void ChatWidget::appendChatLine(ChatLine *line) {
+void ChatWidget::appendChatLine(ChatLineOld *line) {
   qreal h = line->layout(tsWidth, senderWidth, textWidth);
   ycoords.append(h + ycoords[ycoords.count() - 1]);
   height += h;
   qreal h = line->layout(tsWidth, senderWidth, textWidth);
   ycoords.append(h + ycoords[ycoords.count() - 1]);
   height += h;
@@ -225,8 +225,8 @@ void ChatWidget::appendChatLine(ChatLine *line) {
 }
 
 
 }
 
 
-void ChatWidget::appendChatLines(QList<ChatLine *> list) {
-  foreach(ChatLine *line, list) {
+void ChatWidget::appendChatLines(QList<ChatLineOld *> list) {
+  foreach(ChatLineOld *line, list) {
     qreal h = line->layout(tsWidth, senderWidth, textWidth);
     ycoords.append(h + ycoords[ycoords.count() - 1]);
     height += h;
     qreal h = line->layout(tsWidth, senderWidth, textWidth);
     ycoords.append(h + ycoords[ycoords.count() - 1]);
     height += h;
@@ -238,7 +238,7 @@ void ChatWidget::appendChatLines(QList<ChatLine *> list) {
   viewport()->update();
 }
 
   viewport()->update();
 }
 
-void ChatWidget::setContents(QList<ChatLine *> list) {
+void ChatWidget::setContents(QList<ChatLineOld *> list) {
   ycoords.clear();
   ycoords.append(0);
   height = 0;
   ycoords.clear();
   ycoords.append(0);
   height = 0;
@@ -351,7 +351,7 @@ void ChatWidget::mouseDoubleClickEvent(QMouseEvent *event) {
   if(lines.count() <= l)
     return;
 
   if(lines.count() <= l)
     return;
 
-  ChatLine *line = lines[l];
+  ChatLineOld *line = lines[l];
   QString text = line->text();
   int cursorAt = qMax(0, line->posToCursor(QPointF(x, y - ycoords[l])) - 1);
 
   QString text = line->text();
   int cursorAt = qMax(0, line->posToCursor(QPointF(x, y - ycoords[l])) - 1);
 
@@ -526,13 +526,13 @@ void ChatWidget::handleMouseMoveEvent(const QPoint &_pos) {
     if(curLine == dragStartLine && c >= 0) {
       if(c != curCursor) {
         curCursor = c;
     if(curLine == dragStartLine && c >= 0) {
       if(c != curCursor) {
         curCursor = c;
-        lines[curLine]->setSelection(ChatLine::Partial, dragStartCursor, c);
+        lines[curLine]->setSelection(ChatLineOld::Partial, dragStartCursor, c);
         viewport()->update();
       }
     } else {
       mouseMode = MarkLines;
       selectionStart = qMin(curLine, dragStartLine); selectionEnd = qMax(curLine, dragStartLine);
         viewport()->update();
       }
     } else {
       mouseMode = MarkLines;
       selectionStart = qMin(curLine, dragStartLine); selectionEnd = qMax(curLine, dragStartLine);
-      for(int i = selectionStart; i <= selectionEnd; i++) lines[i]->setSelection(ChatLine::Full);
+      for(int i = selectionStart; i <= selectionEnd; i++) lines[i]->setSelection(ChatLineOld::Full);
       viewport()->update();
     }
   } else if(mouseMode == MarkLines) {
       viewport()->update();
     }
   } else if(mouseMode == MarkLines) {
@@ -542,16 +542,16 @@ void ChatWidget::handleMouseMoveEvent(const QPoint &_pos) {
       selectionStart = qMin(l, dragStartLine); selectionEnd = qMax(l, dragStartLine);
       if(curLine < 0) {
         Q_ASSERT(selectionStart == selectionEnd);
       selectionStart = qMin(l, dragStartLine); selectionEnd = qMax(l, dragStartLine);
       if(curLine < 0) {
         Q_ASSERT(selectionStart == selectionEnd);
-        lines[l]->setSelection(ChatLine::Full);
+        lines[l]->setSelection(ChatLineOld::Full);
       } else {
         if(curLine < selectionStart) {
       } else {
         if(curLine < selectionStart) {
-          for(int i = curLine; i < selectionStart; i++) lines[i]->setSelection(ChatLine::None);
+          for(int i = curLine; i < selectionStart; i++) lines[i]->setSelection(ChatLineOld::None);
         } else if(curLine > selectionEnd) {
         } else if(curLine > selectionEnd) {
-          for(int i = selectionEnd+1; i <= curLine; i++) lines[i]->setSelection(ChatLine::None);
+          for(int i = selectionEnd+1; i <= curLine; i++) lines[i]->setSelection(ChatLineOld::None);
         } else if(selectionStart < curLine && l < curLine) {
         } else if(selectionStart < curLine && l < curLine) {
-          for(int i = selectionStart; i < curLine; i++) lines[i]->setSelection(ChatLine::Full);
+          for(int i = selectionStart; i < curLine; i++) lines[i]->setSelection(ChatLineOld::Full);
         } else if(curLine < selectionEnd && l > curLine) {
         } else if(curLine < selectionEnd && l > curLine) {
-          for(int i = curLine+1; i <= selectionEnd; i++) lines[i]->setSelection(ChatLine::Full);
+          for(int i = curLine+1; i <= selectionEnd; i++) lines[i]->setSelection(ChatLineOld::Full);
         }
       }
       curLine = l;
         }
       }
       curLine = l;
@@ -564,10 +564,10 @@ void ChatWidget::handleMouseMoveEvent(const QPoint &_pos) {
 //!\brief Clear current text selection.
 void ChatWidget::clearSelection() {
   if(selectionMode == TextSelected) {
 //!\brief Clear current text selection.
 void ChatWidget::clearSelection() {
   if(selectionMode == TextSelected) {
-    lines[selectionLine]->setSelection(ChatLine::None);
+    lines[selectionLine]->setSelection(ChatLineOld::None);
   } else if(selectionMode == LinesSelected) {
     for(int i = selectionStart; i <= selectionEnd; i++) {
   } else if(selectionMode == LinesSelected) {
     for(int i = selectionStart; i <= selectionEnd; i++) {
-      lines[i]->setSelection(ChatLine::None);
+      lines[i]->setSelection(ChatLineOld::None);
     }
   }
   selectionMode = NoSelection;
     }
   }
   selectionMode = NoSelection;
index b8aa5a7..801203c 100644 (file)
@@ -25,7 +25,7 @@
 
 #include "types.h"
 
 
 #include "types.h"
 
-class ChatLine;
+class ChatLineOld;
 class AbstractUiMsg;
 
 //!\brief Scroll area showing part of the chat messages for a given buffer.
 class AbstractUiMsg;
 
 //!\brief Scroll area showing part of the chat messages for a given buffer.
@@ -56,11 +56,11 @@ class ChatWidget : public QAbstractScrollArea {
     void prependMsg(AbstractUiMsg *);
     void appendMsg(AbstractUiMsg *);
 
     void prependMsg(AbstractUiMsg *);
     void appendMsg(AbstractUiMsg *);
 
-    void prependChatLine(ChatLine *);
-    void appendChatLine(ChatLine *);
-    void prependChatLines(QList<ChatLine *>);
-    void appendChatLines(QList<ChatLine *>);
-    void setContents(QList<ChatLine *>);
+    void prependChatLine(ChatLineOld *);
+    void appendChatLine(ChatLineOld *);
+    void prependChatLines(QList<ChatLineOld *>);
+    void appendChatLines(QList<ChatLineOld *>);
+    void setContents(QList<ChatLineOld *>);
 
   protected:
     virtual void resizeEvent(QResizeEvent *event);
 
   protected:
     virtual void resizeEvent(QResizeEvent *event);
@@ -95,7 +95,7 @@ class ChatWidget : public QAbstractScrollArea {
 
     int bottomLine, bottomLineOffset;
 
 
     int bottomLine, bottomLineOffset;
 
-    QList<ChatLine *> lines;
+    QList<ChatLineOld *> lines;
     QList<qreal> ycoords;
     QTimer *scrollTimer;
     QPoint pointerPosition;
     QList<qreal> ycoords;
     QTimer *scrollTimer;
     QPoint pointerPosition;
index aaa59f4..5c3e73f 100644 (file)
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
-//#define SPUTDEV
-
 #include "mainwin.h"
 
 #include "aboutdlg.h"
 #include "chatwidget.h"
 #include "bufferview.h"
 #include "mainwin.h"
 
 #include "aboutdlg.h"
 #include "chatwidget.h"
 #include "bufferview.h"
+#include "chatline.h"
 #include "chatline-old.h"
 #include "client.h"
 #include "coreconnectdlg.h"
 #include "chatline-old.h"
 #include "client.h"
 #include "coreconnectdlg.h"
@@ -51,6 +50,7 @@
 
 
 #include "debugconsole.h"
 
 
 #include "debugconsole.h"
+#include "global.h"
 
 MainWin::MainWin(QtUi *_gui, QWidget *parent)
   : QMainWindow(parent),
 
 MainWin::MainWin(QtUi *_gui, QWidget *parent)
   : QMainWindow(parent),
@@ -115,12 +115,12 @@ void MainWin::init() {
   ui.bufferWidget->setModel(Client::bufferModel());
   ui.bufferWidget->setSelectionModel(Client::bufferModel()->standardSelectionModel());
 
   ui.bufferWidget->setModel(Client::bufferModel());
   ui.bufferWidget->setSelectionModel(Client::bufferModel()->standardSelectionModel());
 
-#ifdef SPUTDEV
-  //showSettingsDlg();
-  //showAboutDlg();
-  showNetworkDlg();
-  exit(1);
-#endif
+  if(Global::SPUTDEV) {
+    //showSettingsDlg();
+    //showAboutDlg();
+    //showNetworkDlg();
+    //exit(1);
+  }
 
 }
 
 
 }
 
@@ -188,11 +188,6 @@ void MainWin::setupSettingsDlg() {
   //Category: General
   settingsDlg->registerSettingsPage(new IdentitiesSettingsPage(settingsDlg));
   settingsDlg->registerSettingsPage(new NetworksSettingsPage(settingsDlg));
   //Category: General
   settingsDlg->registerSettingsPage(new IdentitiesSettingsPage(settingsDlg));
   settingsDlg->registerSettingsPage(new NetworksSettingsPage(settingsDlg));
-
-
-#ifdef SPUTDEV
-  connect(settingsDlg, SIGNAL(finished(int)), QApplication::instance(), SLOT(quit()));  // FIXME
-#endif
 }
 
 void MainWin::setupNickWidget() {
 }
 
 void MainWin::setupNickWidget() {
@@ -229,10 +224,10 @@ void MainWin::setupChatMonitor() {
     return;
 
   chatWidget->init(BufferId(0));
     return;
 
   chatWidget->init(BufferId(0));
-  QList<ChatLine *> lines;
+  QList<ChatLineOld *> lines;
   QList<AbstractUiMsg *> msgs = buf->contents();
   foreach(AbstractUiMsg *msg, msgs) {
   QList<AbstractUiMsg *> msgs = buf->contents();
   foreach(AbstractUiMsg *msg, msgs) {
-    lines.append(dynamic_cast<ChatLine*>(msg));
+    lines.append(dynamic_cast<ChatLineOld*>(msg));
   }
   chatWidget->setContents(lines);
   connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *)));
   }
   chatWidget->setContents(lines);
   connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *)));
@@ -294,11 +289,11 @@ void MainWin::setupSystray() {
   if(s.value("UseSystemTrayIcon", QVariant(true)).toBool()) {
     systray->show();
   }
   if(s.value("UseSystemTrayIcon", QVariant(true)).toBool()) {
     systray->show();
   }
-  
-  #ifndef Q_WS_MAC
+
+#ifndef Q_WS_MAC
   connect(systray, SIGNAL(activated( QSystemTrayIcon::ActivationReason )),
           this, SLOT(systrayActivated( QSystemTrayIcon::ActivationReason )));
   connect(systray, SIGNAL(activated( QSystemTrayIcon::ActivationReason )),
           this, SLOT(systrayActivated( QSystemTrayIcon::ActivationReason )));
-  #endif
+#endif
 
 }
 
 
 }
 
@@ -348,7 +343,8 @@ void MainWin::disconnectedFromCore() {
 }
 
 AbstractUiMsg *MainWin::layoutMsg(const Message &msg) {
 }
 
 AbstractUiMsg *MainWin::layoutMsg(const Message &msg) {
-  return new ChatLine(msg);
+  if(Global::SPUTDEV) return new ChatLine(msg);
+  return new ChatLineOld(msg);
 }
 
 void MainWin::showCoreConnectionDlg(bool autoConnect) {
 }
 
 void MainWin::showCoreConnectionDlg(bool autoConnect) {
index b76a1c8..096fc71 100644 (file)
@@ -1,11 +1,13 @@
 DEPMOD = uisupport common client
 QT_MOD = core gui network
 
 DEPMOD = uisupport common client
 QT_MOD = core gui network
 
-SRCS += aboutdlg.cpp bufferwidget.cpp chatline-old.cpp chatwidget.cpp coreconfigwizard.cpp coreconnectdlg.cpp configwizard.cpp debugconsole.cpp inputwidget.cpp \
+SRCS += aboutdlg.cpp bufferwidget.cpp chatitem.cpp chatline.cpp chatline-old.cpp chatscene.cpp chatview.cpp chatwidget.cpp \
+        coreconfigwizard.cpp coreconnectdlg.cpp configwizard.cpp debugconsole.cpp inputwidget.cpp \
         mainwin.cpp nicklistwidget.cpp qtui.cpp qtuisettings.cpp qtuistyle.cpp settingsdlg.cpp settingspagedlg.cpp \
         topicwidget.cpp verticaldock.cpp jumpkeyhandler.cpp
 
         mainwin.cpp nicklistwidget.cpp qtui.cpp qtuisettings.cpp qtuistyle.cpp settingsdlg.cpp settingspagedlg.cpp \
         topicwidget.cpp verticaldock.cpp jumpkeyhandler.cpp
 
-HDRS += aboutdlg.h bufferwidget.h chatline-old.h chatwidget.h coreconfigwizard.h configwizard.h debugconsole.h inputwidget.h \
+HDRS += aboutdlg.h bufferwidget.h chatitem.h chatline.h chatline-old.h chatscene.h chatview.h chatwidget.h \
+        coreconfigwizard.h configwizard.h debugconsole.h inputwidget.h \
         coreconnectdlg.h mainwin.h nicklistwidget.h qtui.h qtuisettings.h qtuistyle.h settingsdlg.h settingspagedlg.h \
         topicwidget.h verticaldock.h jumpkeyhandler.h
 
         coreconnectdlg.h mainwin.h nicklistwidget.h qtui.h qtuisettings.h qtuistyle.h settingsdlg.h settingspagedlg.h \
         topicwidget.h verticaldock.h jumpkeyhandler.h
 
index b5fc125..a249c79 100644 (file)
@@ -67,7 +67,7 @@ void SettingsDlg::registerSettingsPage(SettingsPage *sp) {
   pages[QString("%1$%2").arg(sp->category(), sp->title())] = sp;
   sp->load();
   // TESTING
   pages[QString("%1$%2").arg(sp->category(), sp->title())] = sp;
   sp->load();
   // TESTING
-  selectPage(sp->category(), sp->title());
+  // selectPage(sp->category(), sp->title());
 }
 
 void SettingsDlg::selectPage(const QString &cat, const QString &title) {
 }
 
 void SettingsDlg::selectPage(const QString &cat, const QString &title) {
index 6bc01d8..c4529cb 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "uisettings.h"
 
 
 #include "uisettings.h"
 
+#include "global.h"
+
 /*****************************************
 * The TreeView showing the Buffers
 *****************************************/
 /*****************************************
 * The TreeView showing the Buffers
 *****************************************/
@@ -115,9 +117,10 @@ void BufferView::keyPressEvent(QKeyEvent *event) {
 // ensure that newly inserted network nodes are expanded per default
 void BufferView::rowsInserted(const QModelIndex & parent, int start, int end) {
   QTreeView::rowsInserted(parent, start, end);
 // ensure that newly inserted network nodes are expanded per default
 void BufferView::rowsInserted(const QModelIndex & parent, int start, int end) {
   QTreeView::rowsInserted(parent, start, end);
-  if(model()->rowCount(parent) == 1 && parent.data(NetworkModel::ItemTypeRole) == NetworkModel::NetworkItemType && parent.data(NetworkModel::ItemActiveRole) == true) {
+  if(model()->rowCount(parent) == 1 && parent.data(NetworkModel::ItemTypeRole) == NetworkModel::NetworkItemType
+     && (Global::SPUTDEV || parent.data(NetworkModel::ItemActiveRole) == true)) {
     // without updating the parent the expand will have no effect... Qt Bug?
     // without updating the parent the expand will have no effect... Qt Bug?
-    update(parent); 
+    update(parent);
     expand(parent);
   }
 }
     expand(parent);
   }
 }
@@ -136,12 +139,16 @@ void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bott
       continue;
 
     bool isActive = networkIdx.data(NetworkModel::ItemActiveRole).toBool();
       continue;
 
     bool isActive = networkIdx.data(NetworkModel::ItemActiveRole).toBool();
-    if(isExpanded(networkIdx) != isActive)
-      setExpanded(networkIdx, isActive);
+    if(Global::SPUTDEV) {
+      if(isExpanded(networkIdx) != isActive) setExpanded(networkIdx, true);
+    } else {
+      if(isExpanded(networkIdx) != isActive)
+        setExpanded(networkIdx, isActive);
+    }
   }
 }
 
   }
 }
 
-                            
+
 void BufferView::toggleHeader(bool checked) {
   QAction *action = qobject_cast<QAction *>(sender());
   header()->setSectionHidden((action->property("column")).toInt(), !checked);
 void BufferView::toggleHeader(bool checked) {
   QAction *action = qobject_cast<QAction *>(sender());
   header()->setSectionHidden((action->property("column")).toInt(), !checked);