Newest version of QuasselTopia, and some minor random fixes.
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 18 Oct 2007 15:15:24 +0000 (15:15 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Thu, 18 Oct 2007 15:15:24 +0000 (15:15 +0000)
22 files changed:
Quassel.kdevelop.filelist
i18n/quassel_de.qm
i18n/quassel_de.ts
qtopia-build/quasseltopia.pro
src/client/buffer.cpp
src/client/client.h
src/client/client.pro [deleted file]
src/common/common.pro [deleted file]
src/common/main.cpp
src/common/message.cpp
src/common/message.h
src/qtopia/chatline.cpp
src/qtopia/chatline.h
src/qtopia/chatwidget.cpp
src/qtopia/chatwidget.h
src/qtopia/mainwidget.cpp
src/qtopia/mainwidget.h
src/qtopia/qtopia.pro [deleted file]
src/qtopia/qtopiamainwin.cpp
src/qtopia/quasseltopia.desktop
src/qtopia/topicbar.cpp
src/qtopia/ui/mainwidget.ui

index d4e2802..ff70bb1 100644 (file)
@@ -23,7 +23,6 @@ src/common/logger.h
 src/common/main.cpp
 src/common/message.cpp
 src/common/message.h
-src/common/quasselui.h
 src/common/settings.cpp
 src/common/settings.h
 src/common/util.cpp
@@ -102,8 +101,6 @@ src/contrib/qxt/qxtglobal.h
 src/contrib/qxt/qxtpimpl.h
 src/contrib/qxt/qxtrpcpeer.cpp
 src/contrib/qxt/qxtrpcpeer.h
-src/core/serverinfo.cpp
-src/core/serverinfo.h
 src/contrib/qxt/CMakeLists.txt
 src/common/signalproxy.cpp
 src/common/signalproxy.h
@@ -138,3 +135,10 @@ src/qtopia/chatline.cpp
 src/qtopia/chatline.h
 src/qtopia/chatwidget.cpp
 src/qtopia/chatwidget.h
+src/qtopia/qtopia.pri
+src/qtgui/qtgui.pri
+src/core/core.pri
+src/contrib/qxt/qxt.pri
+src/common/common.pri
+src/client/client.pri
+src/client/quasselui.h
index e429eda..648b42c 100644 (file)
Binary files a/i18n/quassel_de.qm and b/i18n/quassel_de.qm differ
index b9fa7bc..3d6f161 100644 (file)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS><TS version="1.1" language="de">
-<defaultcodec></defaultcodec>
 <context>
     <name>AboutDlg</name>
     <message>
@@ -883,8 +882,8 @@ Networks using this identity will be reset to use the default identity.</source>
         <location filename="../src/qtopia/ui/mainwidget.ui" line="48"/>
         <source>&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
 p, li { white-space: pre-wrap; }
-&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;Trebuchet MS&apos;; font-size:14pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;
-&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;&quot;&gt;&lt;span style=&quot; font-size:6pt;&quot;&gt;&amp;lt;Sput&amp;gt; So soll das hier dann mal ungefähr aussehen...&lt;/span&gt;&lt;/p&gt;
+&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;Trebuchet MS&apos;; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;&quot;&gt;
+&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:6pt;&quot;&gt;&amp;lt;Sput&amp;gt; So soll das hier dann mal ungefähr aussehen...&lt;/span&gt;&lt;/p&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;&quot;&gt;&amp;lt;Foo&amp;gt; aha, na allzuviel Text bekommt man da wahrscheinlich nicht unter.&lt;/p&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;&quot;&gt;&amp;lt;Sput&amp;gt; Man wird sehen müssen...&lt;/p&gt;
 &lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;&quot;&gt;&amp;lt;Foo&amp;gt; Das ist wohl wahr...&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
index f571ef7..3110cc7 100644 (file)
@@ -1,7 +1,8 @@
 qtopia_project(qtopia app)
 
 TARGET=quasseltopia
-CONFIG+=debug qtopia_main no_quicklaunch
+CONFIG+=debug qtopia_main no_quicklaunch no_singleexec no_sxe_test
+QT = core gui network
 
 # Find files
 INCLUDEPATH+=../src/qtopia ../src/client ../src/common ../src/contrib/qxt
index 1fb0797..1561428 100644 (file)
@@ -17,6 +17,8 @@
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
+#include <QDebug>
+
 #include "buffer.h"
 
 #include "client.h"
index 8a824c3..fabed9d 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-07 by The Quassel IRC Development Team             *
+ *   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  *
diff --git a/src/client/client.pro b/src/client/client.pro
deleted file mode 100644 (file)
index 5e67dfb..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-SOURCES+=buffer.cpp buffertreemodel.cpp client.cpp clientsettings.cpp treemodel.cpp
-HEADERS+=buffer.h buffertreemodel.h client.h clientsettings.h treemodel.h
diff --git a/src/common/common.pro b/src/common/common.pro
deleted file mode 100644 (file)
index 0561e30..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-SOURCES+=global.cpp ircuser.cpp logger.cpp message.cpp settings.cpp signalproxy.cpp util.cpp
-HEADERS+=global.h ircuser.h logger.h message.h quasselui.h settings.h signalproxy.h util.h
index b86f226..e160c18 100644 (file)
@@ -77,11 +77,11 @@ int main(int argc, char **argv) {
   QApplication app(argc, argv);
 #endif
 
-/* Just for testing
-  QTranslator translator;
-  translator.load(":i18n/quassel_de");
-  app.installTranslator(&translator);
-*/
+  //Just for testing
+  //QTranslator translator;
+  //translator.load(":i18n/quassel_de");
+  //app.installTranslator(&translator);
+
             
   QCoreApplication::setOrganizationDomain("quassel-irc.org");
   QCoreApplication::setApplicationName("Quassel IRC");
index 797dfbb..57ae388 100644 (file)
@@ -153,6 +153,14 @@ QString Message::formattedText() {
   return _formattedText;
 }
 
+/*
+QString Message::formattedToHtml(const QString &f) {
+
+
+  return f;
+}
+*/
+
 QDataStream &operator<<(QDataStream &out, const Message &msg) {
   out << (quint32)msg.timeStamp().toTime_t() << (quint8)msg.type() << (quint8)msg.flags()
       << msg.buffer() << msg.sender().toUtf8() << msg.text().toUtf8();
index 878acfa..68047db 100644 (file)
@@ -54,6 +54,8 @@ class Message {
     QString formattedSender();
     QString formattedText();
 
+    //static QString formattedToHtml(const QString &);
+
     void format();
 
   private:
index c1e9956..d14be8e 100644 (file)
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
+#include <QtCore>
+
 #include "chatline.h"
 
 ChatLine::ChatLine(Message msg) {
-  
-
-  
+  _text = msg.text();  // FIXME
+  _sender = msg.sender();
+  _timeStamp = msg.timeStamp();
+  _msgId = msg.msgId();
+  _bufferInfo = msg.buffer();
 
+  _htmlSender = formattedToHtml(msg.formattedSender());
+  _htmlText = formattedToHtml(msg.formattedText());
+  _htmlTimeStamp = formattedToHtml(msg.formattedTimeStamp());
 }
 
 QString ChatLine::sender() const {
@@ -47,3 +54,20 @@ QDateTime ChatLine::timeStamp() const {
   return _timeStamp;
 }
 
+QString ChatLine::htmlSender() const {
+  return _htmlSender;
+}
+
+QString ChatLine::htmlText() const {
+  return _htmlText;
+}
+
+QString ChatLine::htmlTimeStamp() const {
+  return _htmlTimeStamp;
+}
+
+
+QString ChatLine::formattedToHtml(const QString &f) {
+
+  return f;
+}
index c6daddd..c03f21a 100644 (file)
@@ -27,18 +27,24 @@ class ChatLine : public AbstractUiMsg {
 
   public:
     ChatLine(Message msg);
-    virtual QString sender() const;
-    virtual QString text() const;
-    virtual MsgId msgId() const;
-    virtual BufferInfo bufferInfo() const;
-    virtual QDateTime timeStamp() const;
+    QString sender() const;
+    QString text() const;
+    MsgId msgId() const;
+    BufferInfo bufferInfo() const;
+    QDateTime timeStamp() const;
+
+    QString htmlSender() const;
+    QString htmlText() const;
+    QString htmlTimeStamp() const;
 
   private:
-    QString _sender, _text;
+    QString _sender, _text, _htmlSender, _htmlText, _htmlTimeStamp;
     MsgId _msgId;
     BufferInfo _bufferInfo;
     QDateTime _timeStamp;
 
+    QString formattedToHtml(const QString &);
+
 };
 
 #endif
index 9151cb7..f7eaed2 100644 (file)
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
+
+#include <QDebug>
+#include "chatwidget.h"
+
+ChatWidget::ChatWidget(QWidget *parent) : QTextEdit(parent) {
+
+}
+
+void ChatWidget::setContents(QList<ChatLine *> lines) {
+  clear();
+  appendChatLines(lines);
+
+}
+
+void ChatWidget::prependMsg(AbstractUiMsg *msg) {
+  ChatLine *line = dynamic_cast<ChatLine*>(msg);
+  Q_ASSERT(line);
+  prependChatLine(line);
+}
+
+void ChatWidget::appendMsg(AbstractUiMsg *msg) {
+  ChatLine *line = dynamic_cast<ChatLine*>(msg);
+  Q_ASSERT(line);
+  appendChatLine(line);
+}
+
+void ChatWidget::appendChatLine(ChatLine *line) {
+  append(line->text()); qDebug() << "appending";
+}
+
+void ChatWidget::appendChatLines(QList<ChatLine *> list) {
+  foreach(ChatLine *line, list) {
+    appendChatLine(line);
+  }
+}
+
+void ChatWidget::prependChatLine(ChatLine *line) {
+  QTextCursor cursor = textCursor();
+  moveCursor(QTextCursor::Start);
+  insertHtml(line->text());
+  setTextCursor(cursor);
+}
+
+void ChatWidget::prependChatLines(QList<ChatLine *> list) {
+
+
+}
index 2a25675..07de94f 100644 (file)
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
+#ifndef _CHATWIDGET_H_
+#define _CHATWIDGET_H_
+
+#include <QTextEdit>
+#include "chatline.h"
+#include "quasselui.h"
+
+class ChatWidget : public QTextEdit {
+  Q_OBJECT
+
+  public:
+    ChatWidget(QWidget *parent = 0);
+
+  public slots:
+    void setContents(QList<ChatLine *>);
+    void appendMsg(AbstractUiMsg *);
+    void prependMsg(AbstractUiMsg *);
+    void prependChatLine(ChatLine *);
+    void appendChatLine(ChatLine *);
+    void prependChatLines(QList<ChatLine *>);
+    void appendChatLines(QList<ChatLine *>);
+
+  private:
+
+
+
+};
+
+#endif
index 9ab5b62..3600fad 100644 (file)
@@ -21,6 +21,7 @@
 #include "mainwidget.h"
 
 #include "buffer.h"
+#include "chatwidget.h"
 
 MainWidget::MainWidget(QWidget *parent) : QWidget(parent) {
   ui.setupUi(this);
@@ -39,9 +40,33 @@ MainWidget::~MainWidget() {
 
 }
 
-void MainWidget::setBuffer(Buffer *b) {
+void MainWidget::setBuffer(Buffer *buf) {
   //  TODO update topic if changed; handle status buffer display
-  QString title = QString("%1 (%2): \"%3\"").arg(b->displayName()).arg(b->networkName()).arg(b->topic());
+  QString title = QString("%1 (%2): \"%3\"").arg(buf->displayName()).arg(buf->networkName()).arg(buf->topic());
   ui.topicBar->setContents(title);
 
+  //ui.chatWidget->setStyleSheet("div { color: #777777; }");
+  //ui.chatWidget->setHtml("<style type=\"text/css\">.foo { color: #777777; } .bar { font-style: italic }</style>"
+  //                       "<div class=\"foo\">foo</div> <div class=\"bar\">bar</div> baz");
+  //ui.chatWidget->moveCursor(QTextCursor::End);
+  //ui.chatWidget->insertHtml("<div class=\"foo\"> brumm</div>");
+
+  ChatWidget *chatWidget;
+  if(!chatWidgets.contains(buf)) {
+    chatWidget = new ChatWidget(this);
+    QList<ChatLine *> lines;
+    QList<AbstractUiMsg *> msgs = buf->contents();
+    foreach(AbstractUiMsg *msg, msgs) {
+      lines.append(dynamic_cast<ChatLine*>(msg));
+    }
+    chatWidget->setContents(lines);
+    connect(buf, SIGNAL(msgAppended(AbstractUiMsg *)), chatWidget, SLOT(appendMsg(AbstractUiMsg *)));
+    connect(buf, SIGNAL(msgPrepended(AbstractUiMsg *)), chatWidget, SLOT(prependMsg(AbstractUiMsg *)));
+    //connect(buf, SIGNAL(topicSet(QString)), this, SLOT(setTopic(QString)));
+    //connect(buf, SIGNAL(ownNickSet(QString)), this, SLOT(setOwnNick(QString)));
+    ui.stack->addWidget(chatWidget);
+    chatWidgets.insert(buf, chatWidget);
+    ui.stack->addWidget(chatWidget);
+  } else chatWidget = chatWidgets[buf];
+  ui.stack->setCurrentWidget(chatWidget);
 }
index 6e0691d..64c2596 100644 (file)
@@ -24,6 +24,7 @@
 #include "ui_mainwidget.h"
 
 class Buffer;
+class ChatWidget;
 
 class MainWidget : public QWidget {
   Q_OBJECT
@@ -37,6 +38,7 @@ class MainWidget : public QWidget {
 
   private:
     Ui::MainWidget ui;
+    QHash<Buffer *, ChatWidget *> chatWidgets;
 
 
 };
diff --git a/src/qtopia/qtopia.pro b/src/qtopia/qtopia.pro
deleted file mode 100644 (file)
index 20766bb..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# Input
-HEADERS += chatline.h chatwidget.h coreconnectdlg.h mainwidget.h qtopiagui.h qtopiamainwin.h topicbar.h
-SOURCES += chatline.cpp chatwidget.cpp coreconnectdlg.cpp mainwidget.cpp qtopiagui.cpp qtopiamainwin.cpp main.cpp topicbar.cpp
-FORMS += ui/coreconnectdlg.ui ui/coreconnectprogressdlg.ui ui/editcoreacctdlg.ui ui/mainwidget.ui
index 1991da9..5296eb4 100644 (file)
@@ -87,8 +87,8 @@ void QtopiaMainWin::connectedToCore() {
     emit requestBacklog(id, 100, -1);
   }
   // FIXME just for testing: select first available buffer
-  if(Client::allBufferInfos().count()) {
-    Buffer *b = Client::buffer(Client::allBufferInfos()[0]);
+  if(Client::allBufferInfos().count() > 1) {
+    Buffer *b = Client::buffer(Client::allBufferInfos()[1]);
     Client::bufferModel()->selectBuffer(b);
   }
 }
index e5c59c1..195a29f 100644 (file)
@@ -1,10 +1,10 @@
 [Translation]
-File=example-nct
-Context=QuasselIRC
+#File=example-nct
+#Context=QuasselIRC
 
 [Desktop Entry]
 Comment[]=A Next-Gen IRC Client
 Exec=quasseltopia
 Icon=example/Example
 Type=Application
-Name[]=QuasselIRC
+Name[]=QuasselTopia
index d8d9f45..a5140f4 100644 (file)
@@ -98,7 +98,7 @@ void TopicBar::updateOffset() {
 
 void TopicBar::startScrolling() {
   if(displayText.length() > text.length()) {
-    oneshot = false;
+    //oneshot = false;
     timer->start();
   }
 }
index ea9d717..6c669d0 100644 (file)
     </widget>
    </item>
    <item>
-    <widget class="QTextEdit" name="chatWidget" >
-     <property name="readOnly" >
-      <bool>true</bool>
-     </property>
-     <property name="html" >
-      <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
-p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Trebuchet MS'; font-size:14pt; font-weight:400; font-style:normal; text-decoration:none;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;">&lt;span style=" font-size:6pt;">&amp;lt;Sput&amp;gt; So soll das hier dann mal ungefähr aussehen...&lt;/span>&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;">&amp;lt;Foo&amp;gt; aha, na allzuviel Text bekommt man da wahrscheinlich nicht unter.&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;">&amp;lt;Sput&amp;gt; Man wird sehen müssen...&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;">&amp;lt;Foo&amp;gt; Das ist wohl wahr...&lt;/p>&lt;/body>&lt;/html></string>
-     </property>
-     <property name="textInteractionFlags" >
-      <enum>Qt::NoTextInteraction</enum>
+    <widget class="QStackedWidget" name="stack" >
+     <property name="currentIndex" >
+      <number>0</number>
      </property>
+     <widget class="QWidget" name="page" />
     </widget>
    </item>
    <item>