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
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
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
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS><TS version="1.1" language="de">
-<defaultcodec></defaultcodec>
<context>
<name>AboutDlg</name>
<message>
<location filename="../src/qtopia/ui/mainwidget.ui" line="48"/>
<source><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></source>
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
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
+#include <QDebug>
+
#include "buffer.h"
#include "client.h"
/***************************************************************************
- * 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 *
+++ /dev/null
-SOURCES+=buffer.cpp buffertreemodel.cpp client.cpp clientsettings.cpp treemodel.cpp
-HEADERS+=buffer.h buffertreemodel.h client.h clientsettings.h treemodel.h
+++ /dev/null
-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
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");
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();
QString formattedSender();
QString formattedText();
+ //static QString formattedToHtml(const QString &);
+
void format();
private:
* 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 {
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;
+}
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
* 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) {
+
+
+}
* 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
#include "mainwidget.h"
#include "buffer.h"
+#include "chatwidget.h"
MainWidget::MainWidget(QWidget *parent) : QWidget(parent) {
ui.setupUi(this);
}
-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);
}
#include "ui_mainwidget.h"
class Buffer;
+class ChatWidget;
class MainWidget : public QWidget {
Q_OBJECT
private:
Ui::MainWidget ui;
+ QHash<Buffer *, ChatWidget *> chatWidgets;
};
+++ /dev/null
-# 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
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);
}
}
[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
void TopicBar::startScrolling() {
if(displayText.length() > text.length()) {
- oneshot = false;
+ //oneshot = false;
timer->start();
}
}
</widget>
</item>
<item>
- <widget class="QTextEdit" name="chatWidget" >
- <property name="readOnly" >
- <bool>true</bool>
- </property>
- <property name="html" >
- <string><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></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>