Bug 102249 - Create option to disable clicking on nicks opening query window
Summary: Create option to disable clicking on nicks opening query window
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-03-23 10:26 UTC by Jes Hall
Modified: 2010-07-01 16:00 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 Jes Hall 2005-03-23 10:26:52 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources

When one clicks on someone's nick in the general chat text in the IRC channel window, it opens a query to this person. Would it be possible to create an option to disable this behaviour? I click within the window to raise it when it's covered by other windows, and invariably end up opening a query I don't want.
Comment 1 Stephan Binner 2005-03-23 11:19:54 UTC
Ack, and somehow unconsciously I succeed to click on my own nick most times opening a query window to myself which doesn't make much sense at all. :-)
Comment 2 Ismail Donmez 2005-03-24 13:56:11 UTC
CVS commit by cartman: 

Don't linkify our own nick
CCBUG:102249


  M +17 -7     ircview.cpp   1.233


--- kdeextragear-2/konversation/konversation/ircview.cpp  #1.232:1.233
@@ -493,13 +493,17 @@ void IRCView::append(const QString& nick
 
     if(nick != m_server->getNickname())
+        {
       color = m_server->obtainNickInfo(nick)->getNickColor();
+          nickLine = "<font color=\"" + color + "\"><a href=\"#" + nick + "\">"+nickLine+"</a></font>";
+        }
     else
+        {
       color = KonversationApplication::preferences.getNickColorList()[8];
+          nickLine = "<font color=\"" + color + "\">"+nickLine+"</font>";
+        }
 
     if(color == "#000000") {
       color = "#000001"; // HACK Working around QTextBrowser's auto link coloring
     }
-
-    nickLine = "<font color=\"" + color + "\"><a href=\"#" + nick + "\">"+nickLine+"</a></font>";
   }
   
@@ -546,7 +550,13 @@ void IRCView::appendQuery(const QString&
     
     if(nick != m_server->getNickname())
+      {
+        nickLine = "<a href=\"#" + nick + "\"><font color=\"" + color + "\">"+nickLine+"</font></a>";
       color = m_server->obtainNickInfo(nick)->getNickColor();
+      }
     else
+      {
+        nickLine = "<font color=\"" + color + "\">"+nickLine+"</font>";
       color = KonversationApplication::preferences.getNickColorList()[8];
+      }
 
     if(color == "#000000") {
@@ -554,5 +564,5 @@ void IRCView::appendQuery(const QString&
     }
 
-    nickLine = "<a href=\"#" + nick + "\"><font color=\"" + color + "\">"+nickLine+"</font></a>";
+    
   }
 
Comment 3 Ismail Donmez 2005-05-14 13:05:09 UTC
SVN commit 413684 by cartman:

Make "clicking on nick opens query optional". No gui yet, add ClickableNicks=false under [General Options].

p.s: sorry this toook so long to fix
p.p.s: argonel I am sorry I had to add another pref. for this :-(

BUG:102249


 M  +9 -3      trunk/extragear/network/konversation/src/ircview.cpp  
 M  +4 -1      trunk/extragear/network/konversation/src/konversationapplication.cpp  
 M  +5 -0      trunk/extragear/network/konversation/src/preferences.cpp  
 M  +5 -0      trunk/extragear/network/konversation/src/preferences.h  


--- trunk/extragear/network/konversation/src/ircview.cpp #413683:413684
@@ -449,7 +449,9 @@
     QString color;
 
     if(nick != m_server->getNickname()) {
-        nickLine = "<a href=\"#" + nick + "\">%2</a>";
+        bool linkNicks = KonversationApplication::preferences.getUseClickableNicks();
+        if(linkNicks)
+            nickLine = "<a href=\"#" + nick + "\">%2</a>";
         KonversationApplication::instance()->increaseKarma(nick,1);
     }
 
@@ -510,7 +512,9 @@
     QString color;
 
     if(nick != m_server->getNickname()) {
-        nickLine = "<a href=\"#" + nick + "\">%2</a>";
+        bool linkNicks = KonversationApplication::preferences.getUseClickableNicks();
+        if(linkNicks)
+            nickLine = "<a href=\"#" + nick + "\">%2</a>";
         KonversationApplication::instance()->increaseKarma(nick,2);
     }
 
@@ -559,7 +563,9 @@
     QString color;
 
     if(nick != m_server->getNickname()) {
-        nickLine = "<a href=\"#" + nick + "\">%2</a>";
+        bool linkNicks = KonversationApplication::preferences.getUseClickableNicks();
+        if(linkNicks)
+            nickLine = "<a href=\"#" + nick + "\">%2</a>";
         KonversationApplication::instance()->increaseKarma(nick,1);
     }
 
--- trunk/extragear/network/konversation/src/konversationapplication.cpp #413683:413684
@@ -424,7 +424,8 @@
   preferences.setAutoWhoContinuousInterval(config->readUnsignedNumEntry("AutoWhoContinuousInterval",preferences.getAutoWhoContinuousInterval()));
   preferences.setShowRealNames(config->readBoolEntry("ShowRealNames",preferences.getShowRealNames()));
 
-  // Double click actions
+  // Double click actions & clickable nicks
+  preferences.setUseClickableNicks(config->readBoolEntry("ClickableNicks",preferences.getUseClickableNicks()));
   preferences.setChannelDoubleClickAction(config->readEntry("ChannelDoubleClickAction",preferences.getChannelDoubleClickAction()));
   preferences.setNotifyDoubleClickAction(config->readEntry("NotifyDoubleClickAction",preferences.getNotifyDoubleClickAction()));
 
@@ -969,6 +970,8 @@
 
   config->writeEntry("ShowBackgroundImage",preferences.getShowBackgroundImage());
 
+  config->writeEntry("ClickableNicks",preferences.getUseClickableNicks());
+
   if ( preferences.getChannelDoubleClickAction() == "/QUERY %u%n" )
       config->deleteEntry("ChannelDoubleClickAction");
   else
--- trunk/extragear/network/konversation/src/preferences.cpp #413683:413684
@@ -160,6 +160,8 @@
   setHighlightOwnLinesColor("#ff0000");
   setHighlightSoundEnabled(true);
 
+  setUseClickableNicks(true);
+
   // On Screen Display
   setOSDUsage(false);
   setOSDShowOwnNick(false);
@@ -705,6 +707,9 @@
 void Preferences::setHighlightOwnLinesColor(const QString &newColor) { highlightOwnLinesColor.setNamedColor(newColor); }
 const QColor Preferences::getHighlightOwnLinesColor() { return highlightOwnLinesColor; }
 
+void Preferences::setUseClickableNicks(bool state) { clickableNicks=state; }
+const bool Preferences::getUseClickableNicks() { return clickableNicks;}
+
 // On Screen Display
 void Preferences::setOSDUsage(bool state) { OSDUsage=state; }
 const bool Preferences::getOSDUsage() { return OSDUsage; }
--- trunk/extragear/network/konversation/src/preferences.h #413683:413684
@@ -214,6 +214,9 @@
     void setHighlightNick(bool state);      // shall we highlight the current nick?
     const bool getHighlightNick();
 
+    void setUseClickableNicks(bool state);
+    const bool getUseClickableNicks();
+
     void setHighlightNickColor(const QString &color);
     const QColor getHighlightNickColor();
 
@@ -620,6 +623,8 @@
     QColor highlightOwnLinesColor;
     bool highlightSoundEnabled;
 
+    bool clickableNicks;
+
     // On Screen Display
     bool OSDUsage;            // Use OSD?
     bool OSDShowOwnNick;      // Message, if own nick appears
Comment 4 Ismail Donmez 2010-07-01 16:00:49 UTC
commit 92ab1cb2b999ae733249c556344ed0464fc55a57
Author: İsmail Dönmez <ismail@kde.org>
Date:   Thu Mar 24 12:56:04 2005 +0000

    Don't linkify our own nick
    CCBUG:102249
    
    svn path=/trunk/kdeextragear-2/konversation/; revision=400219

diff --git a/konversation/ircview.cpp b/konversation/ircview.cpp
index c712473..db85a72 100644
--- a/konversation/ircview.cpp
+++ b/konversation/ircview.cpp
@@ -492,15 +492,19 @@ void IRCView::append(const QString& nick,const QString& message)
   if(KonversationApplication::preferences.getUseColoredNicks()) {
 
     if(nick != m_server->getNickname())
-      color = m_server->obtainNickInfo(nick)->getNickColor();
+	{
+	  color = m_server->obtainNickInfo(nick)->getNickColor();
+	  nickLine = "<font color=\"" + color + "\"><a href=\"#" + nick + "\">"+nickLine+"</a></font>";
+	}
     else
-      color = KonversationApplication::preferences.getNickColorList()[8];
+	{
+	  color = KonversationApplication::preferences.getNickColorList()[8];
+	  nickLine = "<font color=\"" + color + "\">"+nickLine+"</font>";
+	}
 
     if(color == "#000000") {
       color = "#000001"; // HACK Working around QTextBrowser's auto link coloring
     }
-
-    nickLine = "<font color=\"" + color + "\"><a href=\"#" + nick + "\">"+nickLine+"</a></font>";
   }
   
   if(basicDirection(message) == QChar::DirR) {
@@ -545,15 +549,21 @@ void IRCView::appendQuery(const QString& nick,const QString& message)
   if(KonversationApplication::preferences.getUseColoredNicks()) {
     
     if(nick != m_server->getNickname())
-      color = m_server->obtainNickInfo(nick)->getNickColor();
+      {
+	nickLine = "<a href=\"#" + nick + "\"><font color=\"" + color + "\">"+nickLine+"</font></a>";
+	color = m_server->obtainNickInfo(nick)->getNickColor();
+      }
     else
-      color = KonversationApplication::preferences.getNickColorList()[8];
+      {
+	nickLine = "<font color=\"" + color + "\">"+nickLine+"</font>";
+	color = KonversationApplication::preferences.getNickColorList()[8];
+      }
 
     if(color == "#000000") {
       color = "#000001"; // HACK Working around QTextBrowser's auto link coloring
     }
 
-    nickLine = "<a href=\"#" + nick + "\"><font color=\"" + color + "\">"+nickLine+"</font></a>";
+    
   }
 
   if(basicDirection(message) == QChar::DirR) {