src/qtopia/qtopiagui.h
src/qtopia/qtopiamainwin.cpp
src/qtopia/qtopiamainwin.h
+src/qtopia/qtopiastyle.cpp
+src/qtopia/qtopiastyle.h
src/qtopia/topicbar.cpp
src/qtopia/topicbar.h
src/qtopia/ui
qtopia_project(qtopia app)
-TARGET=quasseltopia
-CONFIG+=debug qtopia_main no_quicklaunch no_singleexec no_sxe_test
+TARGET = quasseltopia
+CONFIG += debug qtopia_main no_quicklaunch no_singleexec no_sxe_test
QT = core gui network
# Find files
-INCLUDEPATH+=../src/qtopia ../src/uisupport ../src/client ../src/common ../src/contrib/qxt
+INCLUDEPATH += ../src/qtopia ../src/uisupport ../src/client ../src/common
+DESTDIR = .
+OBJECTS_DIR = .obj
+MOC_DIR = .moc
+UIC_DIR = .ui
# Include .pri from src dirs
-include(../src/contrib/qxt/qxt.pri)
include(../src/common/common.pri)
include(../src/qtopia/qtopia.pri)
include(../src/client/client.pri)
#include <QtCore>
#include "chatline.h"
+#include "qtopiagui.h"
ChatLine::ChatLine(Message msg) {
- _text = msg.text(); // FIXME
- _sender = msg.sender();
+ //_styledSender = QtopiaUi::style()->styleString(msg.formattedSender());
+ //_styledText = QtopiaUi::style()->styleString(msg.formattedText());
_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 {
#define _CHATLINE_H_
#include "quasselui.h"
+#include "uistyle.h"
class ChatLine : public AbstractUiMsg {
private:
QString _sender, _text, _htmlSender, _htmlText, _htmlTimestamp;
+ UiStyle::StyledText _styledSender, _styledText;
MsgId _msgId;
BufferInfo _bufferInfo;
QDateTime _timestamp;
void MainWidget::setBuffer(Buffer *buf) {
// TODO update topic if changed; handle status buffer display
- QString title = QString("%1 (%2): \"%3\"").arg(buf->displayName()).arg(buf->networkName()).arg(buf->topic());
+ QString title = QString("%1 (%2): \"%3\"").arg(buf->name()).arg(buf->networkName()).arg(buf->topic());
ui.topicBar->setContents(title);
//ui.chatWidget->setStyleSheet("div { color: #777777; }");
-# Input
-HDRS += chatline.h chatwidget.h coreconnectdlg.h mainwidget.h qtopiagui.h qtopiamainwin.h topicbar.h
-SRCS += chatline.cpp chatwidget.cpp coreconnectdlg.cpp mainwidget.cpp qtopiagui.cpp qtopiamainwin.cpp main.cpp topicbar.cpp
+DEPMOD = uisupport common client
+QT_MOD = core gui network
+
+HDRS += chatline.h chatwidget.h coreconnectdlg.h mainwidget.h qtopiagui.h qtopiamainwin.h qtopiastyle.h topicbar.h
+SRCS += chatline.cpp chatwidget.cpp coreconnectdlg.cpp main.cpp mainwidget.cpp qtopiagui.cpp qtopiamainwin.cpp qtopiastyle.cpp topicbar.cpp
FRMS += ui/coreconnectdlg.ui ui/coreconnectprogressdlg.ui ui/editcoreacctdlg.ui ui/mainwidget.ui
#include "qtopiagui.h"
#include "qtopiamainwin.h"
+#include "qtopiastyle.h"
-QtopiaGui::QtopiaGui(QtopiaMainWin *mw) : AbstractUi(), mainWin(mw) {
+QtopiaUi::QtopiaUi(QtopiaMainWin *mw) : AbstractUi(), mainWin(mw) {
+ _style = new QtopiaStyle();
connect(mainWin, SIGNAL(connectToCore(const QVariantMap &)), this, SIGNAL(connectToCore(const QVariantMap &)));
connect(mainWin, SIGNAL(disconnectFromCore()), this, SIGNAL(disconnectFromCore()));
}
-QtopiaGui::~QtopiaGui() {
+QtopiaUi::~QtopiaUi() {
+ delete _style;
delete mainWin;
}
-void QtopiaGui::init() {
+void QtopiaUi::init() {
}
-AbstractUiMsg *QtopiaGui::layoutMsg(const Message &msg) {
+QtopiaStyle *QtopiaUi::style() const {
+ return _style;
+}
+
+AbstractUiMsg *QtopiaUi::layoutMsg(const Message &msg) {
return mainWin->layoutMsg(msg);
}
-void QtopiaGui::connectedToCore() {
+void QtopiaUi::connectedToCore() {
mainWin->connectedToCore();
}
-void QtopiaGui::disconnectedFromCore() {
+void QtopiaUi::disconnectedFromCore() {
mainWin->disconnectedFromCore();
}
#include "quasselui.h"
class QtopiaMainWin;
+class QtopiaStyle;
//! This class encapsulates Quassel's GUI for Qtopia.
-class QtopiaGui : public AbstractUi {
+class QtopiaUi : public AbstractUi {
Q_OBJECT
public:
- QtopiaGui(QtopiaMainWin *mainWin);
- ~QtopiaGui();
+ QtopiaUi(QtopiaMainWin *mainWin);
+ ~QtopiaUi();
void init();
AbstractUiMsg *layoutMsg(const Message &);
+ QtopiaStyle *style() const;
+
protected slots:
void connectedToCore();
void disconnectedFromCore();
private:
QtopiaMainWin *mainWin;
+ QtopiaStyle *_style;
};
QCoreApplication::setOrganizationName("Quassel IRC Development Team");
//Style::init();
- QtopiaGui *gui = new QtopiaGui(this);
+ QtopiaUi *gui = new QtopiaUi(this);
Client::init(gui);
setWindowTitle("Quassel IRC");
MainWidget *mainWidget;
- friend class QtopiaGui;
+ friend class QtopiaUi;
};
#endif
--- /dev/null
+/***************************************************************************
+ * 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 *
+ * 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) any later version. *
+ * *
+ * 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 "qtopiastyle.h"
+
+QtopiaStyle::QtopiaStyle() : UiStyle() {
+
+ QTextCharFormat def;
+ def.setFont(QFont("Verdana",6));
+ setFormat(None, def);
+
+ // We need to just set our internal formats; everything else is done by the base class...
+
+ // Internal message formats
+ QTextCharFormat plainMsg;
+ plainMsg.setForeground(QBrush("black"));
+ setFormat(PlainMsg, plainMsg);
+
+ QTextCharFormat notice;
+ notice.setForeground(QBrush("navy"));
+ setFormat(NoticeMsg, notice);
+
+ QTextCharFormat server;
+ server.setForeground(QBrush("navy"));
+ setFormat(ServerMsg, server);
+
+ QTextCharFormat error;
+ error.setForeground(QBrush("red"));
+ setFormat(ErrorMsg, error);
+
+ QTextCharFormat join;
+ join.setForeground(QBrush("green"));
+ setFormat(JoinMsg, join);
+
+ QTextCharFormat part;
+ part.setForeground(QBrush("indianred"));
+ setFormat(PartMsg, part);
+
+ QTextCharFormat quit;
+ quit.setForeground(QBrush("indianred"));
+ setFormat(QuitMsg, quit);
+
+ QTextCharFormat kick;
+ kick.setForeground(QBrush("indianred"));
+ setFormat(KickMsg, kick);
+
+ QTextCharFormat nren;
+ nren.setForeground(QBrush("magenta"));
+ setFormat(RenameMsg, nren);
+
+ QTextCharFormat mode;
+ mode.setForeground(QBrush("steelblue"));
+ setFormat(ModeMsg, mode);
+
+ QTextCharFormat action;
+ action.setFontItalic(true);
+ action.setForeground(QBrush("darkmagenta"));
+ setFormat(ActionMsg, action);
+
+ // Internal message element formats
+ QTextCharFormat ts;
+ ts.setForeground(QBrush("grey"));
+ setFormat(Timestamp, ts);
+
+ QTextCharFormat sender;
+ sender.setAnchor(true);
+ sender.setForeground(QBrush("navy"));
+ setFormat(Sender, sender);
+
+ QTextCharFormat nick;
+ nick.setAnchor(true);
+ nick.setFontWeight(QFont::Bold);
+ setFormat(Nick, nick);
+
+ QTextCharFormat hostmask;
+ hostmask.setFontItalic(true);
+ setFormat(Hostmask, hostmask);
+
+ QTextCharFormat channel;
+ channel.setAnchor(true);
+ channel.setFontWeight(QFont::Bold);
+ setFormat(ChannelName, channel);
+
+ QTextCharFormat flags;
+ flags.setFontWeight(QFont::Bold);
+ setFormat(ModeFlags, flags);
+
+ QTextCharFormat url;
+ url.setFontUnderline(true);
+ url.setAnchor(true);
+ setFormat(Url, url);
+
+
+}
+
+QtopiaStyle::~QtopiaStyle() {}
--- /dev/null
+/***************************************************************************
+ * 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 *
+ * 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) any later version. *
+ * *
+ * 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 _QTOPIASTYLE_H_
+#define _QTOPIASTYLE_H_
+
+#include "uistyle.h"
+
+class QtopiaStyle : public UiStyle {
+
+ public:
+ QtopiaStyle();
+ virtual ~QtopiaStyle();
+
+};
+
+#endif