Bug 96880 - Ability to specify color other than black for your own nickname when using nickname coloring
Summary: Ability to specify color other than black for your own nickname when using ni...
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Ismail Donmez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-13 00:23 UTC by Jason Keirstead
Modified: 2010-07-01 15:58 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Keirstead 2005-01-13 00:23:10 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

The nickname coloring is very nice, but I wish I could specify a color other than black for my own nickname (hint: trying to duplicate old XChat behaviour of coloring with yellow).

I like my nickname to be a bright color so that my own messages stand out well.
Comment 1 Peter Simonsson 2005-01-13 14:19:01 UTC
This can be done by selecting 'Always highlight own lines' in Notification->Highlight. Drawback is that it highlights the whole line.
Comment 2 Ismail Donmez 2005-02-02 22:56:08 UTC
CVS commit by cartman: 


Add an option to select own nick color
FEATURE:96880


  M +290 -131  colorsappearance_preferences.ui   1.7
  M +27 -11    ircview.cpp   1.226
  M +1 -0      preferences.cpp   1.179
  M +4 -0      prefspagecolorsappearance.cpp   1.8



Comment 3 Ismail Donmez 2010-07-01 15:58:20 UTC
commit d9cbd7d91138c6decda66e4ec5253e2730c1ebf9
Author: İsmail Dönmez <ismail@kde.org>
Date:   Wed Feb 2 21:56:05 2005 +0000

    Add an option to select own nick color
    FEATURE:96880
    
    svn path=/trunk/kdeextragear-2/konversation/; revision=385557

diff --git a/konversation/colorsappearance_preferences.ui b/konversation/colorsappearance_preferences.ui
index 435ab46..9a9f555 100644
--- a/konversation/colorsappearance_preferences.ui
+++ b/konversation/colorsappearance_preferences.ui
@@ -250,139 +250,297 @@ the Free Software Foundation; either version 2 of the License, or
             <property name="title">
                 <string>Nick Colors</string>
             </property>
-            <grid>
+            <widget class="KColorButton">
                 <property name="name">
-                    <cstring>unnamed</cstring>
+                    <cstring>kcfg_NickColor7</cstring>
                 </property>
-                <widget class="KColorButton" row="1" column="7">
-                    <property name="name">
-                        <cstring>kcfg_NickColor7</cstring>
-                    </property>
-                    <property name="text">
-                        <string></string>
-                    </property>
-                </widget>
-                <widget class="QLabel" row="1" column="2">
-                    <property name="name">
-                        <cstring>textLabel6</cstring>
-                    </property>
-                    <property name="text">
-                        <string>2:</string>
-                    </property>
-                </widget>
-                <widget class="KColorButton" row="1" column="3">
-                    <property name="name">
-                        <cstring>kcfg_NickColor3</cstring>
-                    </property>
-                    <property name="text">
-                        <string></string>
-                    </property>
-                </widget>
-                <widget class="QLabel" row="3" column="2">
-                    <property name="name">
-                        <cstring>textLabel7</cstring>
-                    </property>
-                    <property name="text">
-                        <string>3:</string>
-                    </property>
-                </widget>
-                <widget class="KColorButton" row="3" column="3">
-                    <property name="name">
-                        <cstring>kcfg_NickColor4</cstring>
-                    </property>
-                    <property name="text">
-                        <string></string>
-                    </property>
-                </widget>
-                <widget class="QLabel" row="1" column="4">
-                    <property name="name">
-                        <cstring>textLabel8</cstring>
-                    </property>
-                    <property name="text">
-                        <string>4:</string>
-                    </property>
-                </widget>
-                <widget class="KColorButton" row="1" column="5" rowspan="2" colspan="1">
-                    <property name="name">
-                        <cstring>kcfg_NickColor5</cstring>
-                    </property>
-                    <property name="text">
-                        <string></string>
-                    </property>
-                </widget>
-                <widget class="QLabel" row="3" column="4">
-                    <property name="name">
-                        <cstring>textLabel9</cstring>
-                    </property>
-                    <property name="text">
-                        <string>5:</string>
-                    </property>
-                </widget>
-                <widget class="KColorButton" row="3" column="5">
-                    <property name="name">
-                        <cstring>kcfg_NickColor6</cstring>
-                    </property>
-                    <property name="text">
-                        <string></string>
-                    </property>
-                </widget>
-                <widget class="QLabel" row="1" column="6">
-                    <property name="name">
-                        <cstring>textLabel10</cstring>
-                    </property>
-                    <property name="text">
-                        <string>6:</string>
-                    </property>
-                </widget>
-                <widget class="QLabel" row="3" column="6">
-                    <property name="name">
-                        <cstring>textLabel11</cstring>
-                    </property>
-                    <property name="text">
-                        <string>7:</string>
-                    </property>
-                </widget>
-                <widget class="KColorButton" row="3" column="7">
-                    <property name="name">
-                        <cstring>kcfg_NickColor8</cstring>
-                    </property>
-                    <property name="text">
-                        <string></string>
-                    </property>
-                </widget>
-                <widget class="QLabel" row="2" column="0" rowspan="2" colspan="1">
-                    <property name="name">
-                        <cstring>textLabel5_2</cstring>
-                    </property>
-                    <property name="text">
-                        <string>1:</string>
-                    </property>
-                </widget>
-                <widget class="KColorButton" row="1" column="1">
-                    <property name="name">
-                        <cstring>kcfg_NickColor1</cstring>
-                    </property>
-                    <property name="text">
-                        <string></string>
-                    </property>
-                </widget>
-                <widget class="QLabel" row="1" column="0">
-                    <property name="name">
-                        <cstring>textLabel4_2</cstring>
-                    </property>
-                    <property name="text">
-                        <string>0:</string>
-                    </property>
-                </widget>
-                <widget class="KColorButton" row="3" column="1">
-                    <property name="name">
-                        <cstring>kcfg_NickColor2</cstring>
-                    </property>
-                    <property name="text">
-                        <string></string>
-                    </property>
-                </widget>
-            </grid>
+                <property name="geometry">
+                    <rect>
+                        <x>465</x>
+                        <y>22</y>
+                        <width>69</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string></string>
+                </property>
+            </widget>
+            <widget class="QLabel">
+                <property name="name">
+                    <cstring>textLabel6</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>143</x>
+                        <y>22</y>
+                        <width>52</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string>2:</string>
+                </property>
+            </widget>
+            <widget class="KColorButton">
+                <property name="name">
+                    <cstring>kcfg_NickColor3</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>201</x>
+                        <y>22</y>
+                        <width>69</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string></string>
+                </property>
+            </widget>
+            <widget class="QLabel">
+                <property name="name">
+                    <cstring>textLabel7</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>143</x>
+                        <y>58</y>
+                        <width>52</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string>3:</string>
+                </property>
+            </widget>
+            <widget class="QLabel">
+                <property name="name">
+                    <cstring>textLabel8</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>276</x>
+                        <y>22</y>
+                        <width>51</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string>4:</string>
+                </property>
+            </widget>
+            <widget class="KColorButton">
+                <property name="name">
+                    <cstring>kcfg_NickColor5</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>333</x>
+                        <y>25</y>
+                        <width>69</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string></string>
+                </property>
+            </widget>
+            <widget class="QLabel">
+                <property name="name">
+                    <cstring>textLabel9</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>276</x>
+                        <y>58</y>
+                        <width>51</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string>5:</string>
+                </property>
+            </widget>
+            <widget class="KColorButton">
+                <property name="name">
+                    <cstring>kcfg_NickColor6</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>333</x>
+                        <y>58</y>
+                        <width>69</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string></string>
+                </property>
+            </widget>
+            <widget class="QLabel">
+                <property name="name">
+                    <cstring>textLabel10</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>408</x>
+                        <y>22</y>
+                        <width>51</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string>6:</string>
+                </property>
+            </widget>
+            <widget class="QLabel">
+                <property name="name">
+                    <cstring>textLabel11</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>408</x>
+                        <y>58</y>
+                        <width>51</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string>7:</string>
+                </property>
+            </widget>
+            <widget class="QLabel">
+                <property name="name">
+                    <cstring>textLabel5_2</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>11</x>
+                        <y>52</y>
+                        <width>51</width>
+                        <height>30</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string>1:</string>
+                </property>
+            </widget>
+            <widget class="KColorButton">
+                <property name="name">
+                    <cstring>kcfg_NickColor1</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>68</x>
+                        <y>22</y>
+                        <width>69</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string></string>
+                </property>
+            </widget>
+            <widget class="QLabel">
+                <property name="name">
+                    <cstring>textLabel4_2</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>11</x>
+                        <y>22</y>
+                        <width>51</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string>0:</string>
+                </property>
+            </widget>
+            <widget class="KColorButton">
+                <property name="name">
+                    <cstring>kcfg_NickColor4</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>201</x>
+                        <y>58</y>
+                        <width>69</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string></string>
+                </property>
+            </widget>
+            <widget class="KColorButton">
+                <property name="name">
+                    <cstring>kcfg_NickColor2</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>68</x>
+                        <y>58</y>
+                        <width>69</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string></string>
+                </property>
+            </widget>
+            <widget class="KColorButton">
+                <property name="name">
+                    <cstring>kcfg_NickColor8</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>465</x>
+                        <y>58</y>
+                        <width>69</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string></string>
+                </property>
+            </widget>
+            <widget class="QLabel">
+                <property name="name">
+                    <cstring>textLabel1_3</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>10</x>
+                        <y>100</y>
+                        <width>100</width>
+                        <height>21</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string>&amp;Own nick color</string>
+                </property>
+                <property name="buddy" stdset="0">
+                    <cstring>kcfg_NickColor9</cstring>
+                </property>
+            </widget>
+            <widget class="KColorButton">
+                <property name="name">
+                    <cstring>kcfg_NickColor9</cstring>
+                </property>
+                <property name="geometry">
+                    <rect>
+                        <x>120</x>
+                        <y>100</y>
+                        <width>80</width>
+                        <height>24</height>
+                    </rect>
+                </property>
+                <property name="text">
+                    <string></string>
+                </property>
+            </widget>
         </widget>
         <widget class="QCheckBox">
             <property name="name">
@@ -720,5 +878,6 @@ the Free Software Foundation; either version 2 of the License, or
     <includehint>kcolorbutton.h</includehint>
     <includehint>kcolorbutton.h</includehint>
     <includehint>kcolorbutton.h</includehint>
+    <includehint>kcolorbutton.h</includehint>
 </includehints>
 </UI>
diff --git a/konversation/ircview.cpp b/konversation/ircview.cpp
index 2ac9d3b..8fcdf12 100644
--- a/konversation/ircview.cpp
+++ b/konversation/ircview.cpp
@@ -495,13 +495,19 @@ void IRCView::append(const QString& nick,const QString& message)
   QString channelColor = KonversationApplication::preferences.getColor("ChannelMessage");
   QString line;
   QString nickLine = "%2";
+  QString color;
 
   if(KonversationApplication::preferences.getUseBoldNicks())
     nickLine = "<b>%2</b>";
   
-  if(KonversationApplication::preferences.getUseColoredNicks() && nick != m_server->getNickname()) {
-    NickInfoPtr nickinfo = m_server->obtainNickInfo(nick);
-    nickLine = "<a href=\"#" + nick + "\"><font color=\"" + nickinfo->getNickColor() + "\">"+nickLine+"</font></a>";
+  if(KonversationApplication::preferences.getUseColoredNicks()) {
+
+    if(nick != m_server->getNickname())
+      color = m_server->obtainNickInfo(nick)->getNickColor();
+    else
+      color = KonversationApplication::preferences.getNickColorList()[8];
+
+    nickLine = "<a href=\"#" + nick + "\"><font color=\"" + color + "\">"+nickLine+"</font></a>";
   }
   
   if(basicDirection(message) == QChar::DirR) {
@@ -538,14 +544,19 @@ void IRCView::appendQuery(const QString& nick,const QString& message)
   QString queryColor=KonversationApplication::preferences.getColor("QueryMessage");
   QString line;
   QString nickLine = "%2";
+  QString color;
 
   if(KonversationApplication::preferences.getUseBoldNicks())
     nickLine = "<b>%2</b>";
 
-  if(KonversationApplication::preferences.getUseColoredNicks() && nick != m_server->getNickname())
-  {
-    NickInfoPtr nickinfo = m_server->obtainNickInfo(nick);
-    nickLine = "<font color=\"" + nickinfo->getNickColor() + "\">"+nickLine+"</font>";
+  if(KonversationApplication::preferences.getUseColoredNicks()) {
+    
+    if(nick != m_server->getNickname())
+      color = m_server->obtainNickInfo(nick)->getNickColor();
+    else
+      color = KonversationApplication::preferences.getNickColorList()[8];
+    
+    nickLine = "<a href=\"#" + nick + "\"><font color=\"" + color + "\">"+nickLine+"</font></a>";
   }
 
   if(basicDirection(message) == QChar::DirR) {
@@ -568,14 +579,19 @@ void IRCView::appendAction(const QString& nick,const QString& message)
   QString actionColor=KonversationApplication::preferences.getColor("ActionMessage");
   QString line;
   QString nickLine = "%2";
+  QString color;
 
   if(KonversationApplication::preferences.getUseBoldNicks())
     nickLine = "<b>%2</b>";
 
-  if(KonversationApplication::preferences.getUseColoredNicks() && nick != m_server->getNickname())
-  {
-    NickInfoPtr nickinfo = m_server->obtainNickInfo(nick);
-    nickLine = "<a href=\"#" + nick + "\"><font color=\"" + nickinfo->getNickColor() + "\">"+nickLine+"</font></a>";
+  if(KonversationApplication::preferences.getUseColoredNicks()) {
+    
+    if(nick != m_server->getNickname())
+      QString color = m_server->obtainNickInfo(nick)->getNickColor();
+    else
+      QString color = KonversationApplication::preferences.getNickColorList()[8];
+    
+    nickLine = "<a href=\"#" + nick + "\"><font color=\"" + color + "\">"+nickLine+"</font></a>";
   }
 
   if(basicDirection(message) == QChar::DirR) {
diff --git a/konversation/preferences.cpp b/konversation/preferences.cpp
index d480855..d866dd6 100644
--- a/konversation/preferences.cpp
+++ b/konversation/preferences.cpp
@@ -216,6 +216,7 @@ Preferences::Preferences()
   nickColorList.append("#9E54B3");
   nickColorList.append("#0FB39A");
   nickColorList.append("#3176B3");
+  nickColorList.append("#000000");
   setUseColoredNicks(false);
   setUseBoldNicks(false);
   setUseLiteralModes(false);
diff --git a/konversation/prefspagecolorsappearance.cpp b/konversation/prefspagecolorsappearance.cpp
index b6ab3ca..54656c0 100644
--- a/konversation/prefspagecolorsappearance.cpp
+++ b/konversation/prefspagecolorsappearance.cpp
@@ -53,6 +53,9 @@ PrefsPageColorsAppearance::PrefsPageColorsAppearance(QFrame* newParent,Preferenc
   kcfg_NickColor6->setColor(colorList[5]);
   kcfg_NickColor7->setColor(colorList[6]);
   kcfg_NickColor8->setColor(colorList[7]);
+  if(colorList[8].isEmpty())
+    colorList[8]="#000000";
+  kcfg_NickColor9->setColor(colorList[8]);
 
   // IRC Color Codes
   QStringList ircColorList = preferences->getIRCColorList();
@@ -105,6 +108,7 @@ void PrefsPageColorsAppearance::applyPreferences()
   nickColorList.append(kcfg_NickColor6->color().name());
   nickColorList.append(kcfg_NickColor7->color().name());
   nickColorList.append(kcfg_NickColor8->color().name());
+  nickColorList.append(kcfg_NickColor9->color().name());
   preferences->setNickColorList(nickColorList);