From: Manuel Nickschas Date: Sun, 4 Nov 2007 02:14:48 +0000 (+0000) Subject: Ah well, apparently calling a class "QtopiaStyle" is _not_ a good idea. X-Git-Tag: 0.1.0~86 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=068a9f975337b4d0b08a438a2abd10ddf94e259d Ah well, apparently calling a class "QtopiaStyle" is _not_ a good idea. Fixed the segfault mentioned earlier. Also, I have converted all colornames we used to RGB codes, since Qtopia does not (necessarily) support named colors... --- diff --git a/qtopia-build/quasseltopia.pro b/qtopia-build/quasseltopia.pro index e04a2a0e..6fdc633d 100644 --- a/qtopia-build/quasseltopia.pro +++ b/qtopia-build/quasseltopia.pro @@ -7,10 +7,10 @@ QT = core gui network # Find files INCLUDEPATH += ../src/qtopia ../src/uisupport ../src/client ../src/common -DESTDIR = . -OBJECTS_DIR = .obj -MOC_DIR = .moc -UIC_DIR = .ui +#DESTDIR = . +#OBJECTS_DIR = .obj +#MOC_DIR = .moc +#UIC_DIR = .ui # Include .pri from src dirs include(../src/common/common.pri) diff --git a/src/qtopia/chatwidget.cpp b/src/qtopia/chatwidget.cpp index b492fd33..6c3ffe20 100644 --- a/src/qtopia/chatwidget.cpp +++ b/src/qtopia/chatwidget.cpp @@ -55,6 +55,7 @@ void ChatWidget::appendChatLines(QList list) { } void ChatWidget::prependChatLine(ChatLine *line) { + qDebug() << "prepending"; return; QTextCursor cursor = textCursor(); moveCursor(QTextCursor::Start); insertHtml(line->text()); diff --git a/src/qtopia/qtopiagui.cpp b/src/qtopia/qtopiagui.cpp index c6d8844d..f797fe4b 100644 --- a/src/qtopia/qtopiagui.cpp +++ b/src/qtopia/qtopiagui.cpp @@ -23,7 +23,7 @@ #include "qtopiastyle.h" QtopiaUi::QtopiaUi(QtopiaMainWin *mw) : AbstractUi(), mainWin(mw) { - _style = new QtopiaStyle(); + _style = new QtopiaUiStyle(); connect(mainWin, SIGNAL(connectToCore(const QVariantMap &)), this, SIGNAL(connectToCore(const QVariantMap &))); connect(mainWin, SIGNAL(disconnectFromCore()), this, SIGNAL(disconnectFromCore())); @@ -40,7 +40,7 @@ void QtopiaUi::init() { } -QtopiaStyle *QtopiaUi::style() const { +QtopiaUiStyle *QtopiaUi::style() const { return _style; } diff --git a/src/qtopia/qtopiagui.h b/src/qtopia/qtopiagui.h index b4dc2ba4..66ee17f9 100644 --- a/src/qtopia/qtopiagui.h +++ b/src/qtopia/qtopiagui.h @@ -24,7 +24,7 @@ #include "quasselui.h" class QtopiaMainWin; -class QtopiaStyle; +class QtopiaUiStyle; //! This class encapsulates Quassel's GUI for Qtopia. class QtopiaUi : public AbstractUi { @@ -36,7 +36,7 @@ class QtopiaUi : public AbstractUi { void init(); AbstractUiMsg *layoutMsg(const Message &); - QtopiaStyle *style() const; + QtopiaUiStyle *style() const; protected slots: void connectedToCore(); @@ -44,7 +44,7 @@ class QtopiaUi : public AbstractUi { private: QtopiaMainWin *mainWin; - QtopiaStyle *_style; + QtopiaUiStyle *_style; }; diff --git a/src/qtopia/qtopiastyle.cpp b/src/qtopia/qtopiastyle.cpp index 12174f11..006628e5 100644 --- a/src/qtopia/qtopiastyle.cpp +++ b/src/qtopia/qtopiastyle.cpp @@ -20,7 +20,7 @@ #include "qtopiastyle.h" -QtopiaStyle::QtopiaStyle() : UiStyle() { +QtopiaUiStyle::QtopiaUiStyle() : UiStyle() { QTextCharFormat def; def.setFont(QFont("Verdana",6)); @@ -29,59 +29,60 @@ QtopiaStyle::QtopiaStyle() : UiStyle() { // 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")); + plainMsg.setForeground(QBrush("#000000")); setFormat(PlainMsg, plainMsg); QTextCharFormat notice; - notice.setForeground(QBrush("navy")); + notice.setForeground(QBrush("#000080")); setFormat(NoticeMsg, notice); QTextCharFormat server; - server.setForeground(QBrush("navy")); + server.setForeground(QBrush("#000080")); setFormat(ServerMsg, server); QTextCharFormat error; - error.setForeground(QBrush("red")); + error.setForeground(QBrush("#ff0000")); setFormat(ErrorMsg, error); QTextCharFormat join; - join.setForeground(QBrush("green")); + join.setForeground(QBrush("#008000")); setFormat(JoinMsg, join); QTextCharFormat part; - part.setForeground(QBrush("indianred")); + part.setForeground(QBrush("#cd5c5c")); setFormat(PartMsg, part); QTextCharFormat quit; - quit.setForeground(QBrush("indianred")); + quit.setForeground(QBrush("#cd5c5c")); setFormat(QuitMsg, quit); QTextCharFormat kick; - kick.setForeground(QBrush("indianred")); + kick.setForeground(QBrush("#cd5c5c")); setFormat(KickMsg, kick); QTextCharFormat nren; - nren.setForeground(QBrush("magenta")); + nren.setForeground(QBrush("#6a5acd")); setFormat(RenameMsg, nren); QTextCharFormat mode; - mode.setForeground(QBrush("steelblue")); + mode.setForeground(QBrush("#4682b4")); setFormat(ModeMsg, mode); QTextCharFormat action; action.setFontItalic(true); - action.setForeground(QBrush("darkmagenta")); + action.setForeground(QBrush("#8b008b")); setFormat(ActionMsg, action); // Internal message element formats QTextCharFormat ts; - ts.setForeground(QBrush("grey")); + ts.setForeground(QBrush("#808080")); setFormat(Timestamp, ts); QTextCharFormat sender; sender.setAnchor(true); - sender.setForeground(QBrush("navy")); + sender.setForeground(QBrush("#000080")); setFormat(Sender, sender); QTextCharFormat nick; @@ -107,7 +108,6 @@ QtopiaStyle::QtopiaStyle() : UiStyle() { url.setAnchor(true); setFormat(Url, url); - } -QtopiaStyle::~QtopiaStyle() {} +QtopiaUiStyle::~QtopiaUiStyle() {} diff --git a/src/qtopia/qtopiastyle.h b/src/qtopia/qtopiastyle.h index c22f7ea6..cdb077c8 100644 --- a/src/qtopia/qtopiastyle.h +++ b/src/qtopia/qtopiastyle.h @@ -23,11 +23,11 @@ #include "uistyle.h" -class QtopiaStyle : public UiStyle { +class QtopiaUiStyle : public UiStyle { public: - QtopiaStyle(); - virtual ~QtopiaStyle(); + QtopiaUiStyle(); + virtual ~QtopiaUiStyle(); }; diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index e14208b4..8c3afaab 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -23,15 +23,17 @@ UiStyle::UiStyle() { // Default format QTextCharFormat def; - def.setForeground(QBrush("black")); + def.setForeground(QBrush("#000000")); def.setFont(QFont("Verdana",9)); _formats = QVector(NumFormatTypes, def); // Initialize color codes according to mIRC "standard" QStringList colors; - colors << "white" << "black" << "navy" << "green" << "red" << "maroon" << "purple" << "orange"; - colors << "yellow" << "lime" << "teal" << "aqua" << "royalblue" << "fuchsia" << "grey" << "silver"; + //colors << "white" << "black" << "navy" << "green" << "red" << "maroon" << "purple" << "orange"; + //colors << "yellow" << "lime" << "teal" << "aqua" << "royalblue" << "fuchsia" << "grey" << "silver"; + colors << "#ffffff" << "#000000" << "#000080" << "#008000" << "#ff0000" << "#800000" << "#800080" << "#ffa500"; + colors << "#ffff00" << "#00ff00" << "#008080" << "#00ffff" << "#4169E1" << "#ff00ff" << "#808080" << "#c0c0c0"; // Now initialize the mapping between FormatCodes and FormatTypes... _formatCodes["%O"] = None;