From: Manuel Nickschas Date: Thu, 18 Oct 2007 15:15:24 +0000 (+0000) Subject: Newest version of QuasselTopia, and some minor random fixes. X-Git-Tag: 0.1.0~129 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=52380175425bdab29f825c9cd17a0e4c1952c2db Newest version of QuasselTopia, and some minor random fixes. --- diff --git a/Quassel.kdevelop.filelist b/Quassel.kdevelop.filelist index d4e2802d..ff70bb1d 100644 --- a/Quassel.kdevelop.filelist +++ b/Quassel.kdevelop.filelist @@ -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 diff --git a/i18n/quassel_de.qm b/i18n/quassel_de.qm index e429eda2..648b42c7 100644 Binary files a/i18n/quassel_de.qm and b/i18n/quassel_de.qm differ diff --git a/i18n/quassel_de.ts b/i18n/quassel_de.ts index b9fa7bc7..3d6f1611 100644 --- a/i18n/quassel_de.ts +++ b/i18n/quassel_de.ts @@ -1,6 +1,5 @@ - AboutDlg @@ -883,8 +882,8 @@ Networks using this identity will be reset to use the default identity. <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Trebuchet MS'; font-size:14pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><span style=" font-size:6pt;">&lt;Sput&gt; So soll das hier dann mal ungefähr aussehen...</span></p> +</style></head><body style=" font-family:'Trebuchet MS'; font-size:10pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:6pt;">&lt;Sput&gt; So soll das hier dann mal ungefähr aussehen...</span></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;">&lt;Foo&gt; aha, na allzuviel Text bekommt man da wahrscheinlich nicht unter.</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;">&lt;Sput&gt; Man wird sehen müssen...</p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;">&lt;Foo&gt; Das ist wohl wahr...</p></body></html> diff --git a/qtopia-build/quasseltopia.pro b/qtopia-build/quasseltopia.pro index f571ef7d..3110cc76 100644 --- a/qtopia-build/quasseltopia.pro +++ b/qtopia-build/quasseltopia.pro @@ -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 diff --git a/src/client/buffer.cpp b/src/client/buffer.cpp index 1fb07971..1561428e 100644 --- a/src/client/buffer.cpp +++ b/src/client/buffer.cpp @@ -17,6 +17,8 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include + #include "buffer.h" #include "client.h" diff --git a/src/client/client.h b/src/client/client.h index 8a824c37..fabed9d6 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -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 index 5e67dfb6..00000000 --- a/src/client/client.pro +++ /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 index 0561e307..00000000 --- a/src/common/common.pro +++ /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 diff --git a/src/common/main.cpp b/src/common/main.cpp index b86f2261..e160c18e 100644 --- a/src/common/main.cpp +++ b/src/common/main.cpp @@ -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"); diff --git a/src/common/message.cpp b/src/common/message.cpp index 797dfbbf..57ae3880 100644 --- a/src/common/message.cpp +++ b/src/common/message.cpp @@ -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(); diff --git a/src/common/message.h b/src/common/message.h index 878acfad..68047db5 100644 --- a/src/common/message.h +++ b/src/common/message.h @@ -54,6 +54,8 @@ class Message { QString formattedSender(); QString formattedText(); + //static QString formattedToHtml(const QString &); + void format(); private: diff --git a/src/qtopia/chatline.cpp b/src/qtopia/chatline.cpp index c1e9956f..d14be8e1 100644 --- a/src/qtopia/chatline.cpp +++ b/src/qtopia/chatline.cpp @@ -18,13 +18,20 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include + #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; +} diff --git a/src/qtopia/chatline.h b/src/qtopia/chatline.h index c6daddd6..c03f21a8 100644 --- a/src/qtopia/chatline.h +++ b/src/qtopia/chatline.h @@ -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 diff --git a/src/qtopia/chatwidget.cpp b/src/qtopia/chatwidget.cpp index 9151cb79..f7eaed2d 100644 --- a/src/qtopia/chatwidget.cpp +++ b/src/qtopia/chatwidget.cpp @@ -17,3 +17,50 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + +#include +#include "chatwidget.h" + +ChatWidget::ChatWidget(QWidget *parent) : QTextEdit(parent) { + +} + +void ChatWidget::setContents(QList lines) { + clear(); + appendChatLines(lines); + +} + +void ChatWidget::prependMsg(AbstractUiMsg *msg) { + ChatLine *line = dynamic_cast(msg); + Q_ASSERT(line); + prependChatLine(line); +} + +void ChatWidget::appendMsg(AbstractUiMsg *msg) { + ChatLine *line = dynamic_cast(msg); + Q_ASSERT(line); + appendChatLine(line); +} + +void ChatWidget::appendChatLine(ChatLine *line) { + append(line->text()); qDebug() << "appending"; +} + +void ChatWidget::appendChatLines(QList 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 list) { + + +} diff --git a/src/qtopia/chatwidget.h b/src/qtopia/chatwidget.h index 2a25675a..07de94ff 100644 --- a/src/qtopia/chatwidget.h +++ b/src/qtopia/chatwidget.h @@ -18,3 +18,32 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#ifndef _CHATWIDGET_H_ +#define _CHATWIDGET_H_ + +#include +#include "chatline.h" +#include "quasselui.h" + +class ChatWidget : public QTextEdit { + Q_OBJECT + + public: + ChatWidget(QWidget *parent = 0); + + public slots: + void setContents(QList); + void appendMsg(AbstractUiMsg *); + void prependMsg(AbstractUiMsg *); + void prependChatLine(ChatLine *); + void appendChatLine(ChatLine *); + void prependChatLines(QList); + void appendChatLines(QList); + + private: + + + +}; + +#endif diff --git a/src/qtopia/mainwidget.cpp b/src/qtopia/mainwidget.cpp index 9ab5b620..3600fadf 100644 --- a/src/qtopia/mainwidget.cpp +++ b/src/qtopia/mainwidget.cpp @@ -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("" + // "
foo
bar
baz"); + //ui.chatWidget->moveCursor(QTextCursor::End); + //ui.chatWidget->insertHtml("
brumm
"); + + ChatWidget *chatWidget; + if(!chatWidgets.contains(buf)) { + chatWidget = new ChatWidget(this); + 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 *))); + //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); } diff --git a/src/qtopia/mainwidget.h b/src/qtopia/mainwidget.h index 6e0691d4..64c25961 100644 --- a/src/qtopia/mainwidget.h +++ b/src/qtopia/mainwidget.h @@ -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 chatWidgets; }; diff --git a/src/qtopia/qtopia.pro b/src/qtopia/qtopia.pro deleted file mode 100644 index 20766bb3..00000000 --- a/src/qtopia/qtopia.pro +++ /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 diff --git a/src/qtopia/qtopiamainwin.cpp b/src/qtopia/qtopiamainwin.cpp index 1991da9f..5296eb47 100644 --- a/src/qtopia/qtopiamainwin.cpp +++ b/src/qtopia/qtopiamainwin.cpp @@ -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); } } diff --git a/src/qtopia/quasseltopia.desktop b/src/qtopia/quasseltopia.desktop index e5c59c18..195a29f8 100644 --- a/src/qtopia/quasseltopia.desktop +++ b/src/qtopia/quasseltopia.desktop @@ -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 diff --git a/src/qtopia/topicbar.cpp b/src/qtopia/topicbar.cpp index d8d9f45a..a5140f43 100644 --- a/src/qtopia/topicbar.cpp +++ b/src/qtopia/topicbar.cpp @@ -98,7 +98,7 @@ void TopicBar::updateOffset() { void TopicBar::startScrolling() { if(displayText.length() > text.length()) { - oneshot = false; + //oneshot = false; timer->start(); } } diff --git a/src/qtopia/ui/mainwidget.ui b/src/qtopia/ui/mainwidget.ui index ea9d717d..6c669d0f 100644 --- a/src/qtopia/ui/mainwidget.ui +++ b/src/qtopia/ui/mainwidget.ui @@ -40,22 +40,11 @@ - - - true - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Trebuchet MS'; font-size:14pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><span style=" font-size:6pt;">&lt;Sput&gt; So soll das hier dann mal ungefähr aussehen...</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;">&lt;Foo&gt; aha, na allzuviel Text bekommt man da wahrscheinlich nicht unter.</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;">&lt;Sput&gt; Man wird sehen müssen...</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:6pt;">&lt;Foo&gt; Das ist wohl wahr...</p></body></html> - - - Qt::NoTextInteraction + + + 0 +