This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KDE 4, plasma source code question.

Tags: None
(comma "," separated)
firewalker
Registered Member
Posts
67
Karma
0
OS

KDE 4, plasma source code question.

Tue Dec 08, 2009 11:58 am
when hovering the mouse above an icon on KDE 4 a tip pops up in less than a second. I want to find the source code and adjust the delay for the pop up. What packet is the main for plasma? It really annoying.

See the picture bellow.

Image

Last edited by firewalker on Wed Dec 09, 2009 11:26 am, edited 1 time in total.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
Probably in trunk/KDE/kdebase/workspace/plasma/desktop/applets/tasks.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
firewalker
Registered Member
Posts
67
Karma
0
OS
I found it. It is trunk/KDE/kdelibs/plasma/tooltipmanager.cpp.

Code: Select all
d->showTimer->start(200);
    } else {
        d->showTimer->start(700);
    }



Change (700) witch is msecs to a value that suits you.
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
Could you please mark the topic as solved?


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts
firewalker
Registered Member
Posts
67
Karma
0
OS

Thu Dec 10, 2009 8:24 am
I don't how to program with C or C++. The following stuff may fry your videotape recorder and make your espresso machine go wild.

I made a little patch. Now the program responsible for the tip will search for a file named tooltipmanager_delay located at /home/user_name/.kde4/share/config/. It opens the file and reads the integer value inside expressed in msecs. The file must only contain an integer number. I do not implent any check for the data contained in the file (a valid value would be 3000, witch means 3 seconds). I only check if the file exists and can be opened. If the file does not exist or there is a read error the program uses the default value (700 msecs).


Code: Select all
--- kdelibs-4.3.4/plasma/tooltipmanager-orig.cpp   2009-06-03 14:54:42.000000000 +0300
+++ kdelibs-4.3.4/plasma/tooltipmanager.cpp   2009-12-09 20:16:39.000000000 +0200
@@ -21,6 +21,17 @@
 
 #include "tooltipmanager.h"
 
+#include <iostream>
+using std::cerr;
+using std::cout;
+using std::endl;
+
+#include <fstream>
+using std::ifstream;
+
+#include <stdlib.h>
+using namespace std;
+
 //Qt
 #include <QCoreApplication>
 #include <QLabel>
@@ -51,6 +62,13 @@
 namespace Plasma
 {
 
+
+
+
+
+
+
+
 class ToolTipManagerPrivate
 {
 public :
@@ -133,6 +151,35 @@
 
 void ToolTipManager::show(QGraphicsWidget *widget)
 {
+    std::string file_path_delay_var; //File path variable
+    std::string file_name_var; //File name variable
+    ifstream indata;
+
+    int delay_num; // variable for input value
+
+    file_path_delay_var = getenv ("HOME"); //Get the home variable
+    file_name_var = "/.kde4/share/config/tooltipmanager_delay";
+    file_path_delay_var = file_path_delay_var + file_name_var;
+   
+    ifstream ifile(file_path_delay_var.c_str());
+    if (ifile) {
+       indata.open(file_path_delay_var.c_str()); // opens the file
+
+       if(!indata) {
+           delay_num = 700; // sets value if no file found
+           }
+       else {
+
+           indata >> delay_num;
+      indata.close();
+
+           }
+   }
+   else {
+      delay_num = 700;   
+   }
+
+
     if (!d->tooltips.contains(widget)) {
         return;
     }
@@ -147,7 +194,7 @@
         // which can be too much for less powerful CPUs to keep up with
         d->showTimer->start(200);
     } else {
-        d->showTimer->start(700);
+        d->showTimer->start(delay_num);
     }
 }


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]