Ah well, apparently calling a class "QtopiaStyle" is _not_ a good idea.
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 4 Nov 2007 02:14:48 +0000 (02:14 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 4 Nov 2007 02:14:48 +0000 (02:14 +0000)
Fixed the segfault mentioned earlier. Also, I have converted all colornames
we used to RGB codes, since Qtopia does not (necessarily) support named colors...

qtopia-build/quasseltopia.pro
src/qtopia/chatwidget.cpp
src/qtopia/qtopiagui.cpp
src/qtopia/qtopiagui.h
src/qtopia/qtopiastyle.cpp
src/qtopia/qtopiastyle.h
src/uisupport/uistyle.cpp

index e04a2a0..6fdc633 100644 (file)
@@ -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)
index b492fd3..6c3ffe2 100644 (file)
@@ -55,6 +55,7 @@ void ChatWidget::appendChatLines(QList<ChatLine *> list) {
 }
 
 void ChatWidget::prependChatLine(ChatLine *line) {
+  qDebug() << "prepending"; return;
   QTextCursor cursor = textCursor();
   moveCursor(QTextCursor::Start);
   insertHtml(line->text());
index c6d8844..f797fe4 100644 (file)
@@ -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;
 }
 
index b4dc2ba..66ee17f 100644 (file)
@@ -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;
 };
 
 
index 12174f1..006628e 100644 (file)
@@ -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() {}
index c22f7ea..cdb077c 100644 (file)
 
 #include "uistyle.h"
 
-class QtopiaStyle : public UiStyle {
+class QtopiaUiStyle : public UiStyle {
 
   public:
-    QtopiaStyle();
-    virtual ~QtopiaStyle();
+    QtopiaUiStyle();
+    virtual ~QtopiaUiStyle();
 
 };
 
index e14208b..8c3afaa 100644 (file)
 UiStyle::UiStyle() {
   // Default format
   QTextCharFormat def;
-  def.setForeground(QBrush("black"));
+  def.setForeground(QBrush("#000000"));
   def.setFont(QFont("Verdana",9));
 
   _formats = QVector<QTextCharFormat>(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;