[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/plasma/applets/tasks
From:       Jure Repinc <jlp () holodeck1 ! com>
Date:       2008-01-17 23:05:28
Message-ID: 1200611128.812694.5295.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 762830 by repinc:

Yay "Show only tasks from the current desktop" is back. As a thank you
I can at least polish it up a bit:
* task buttons don't disappear for windows on all desktops after
  you switch to another desktop (used isOnCurrentDesktop())
* after you move the window to another desktop the task button now
  dissapears
* changed the setting label a bit, hope it's a bit better now


 M  +11 -1     tasks.cpp  
 M  +3 -2      tasks.h  
 M  +1 -1      tasksConfig.ui  


--- trunk/KDE/kdebase/workspace/plasma/applets/tasks/tasks.cpp #762829:762830
@@ -97,6 +97,10 @@
 	connect(TaskManager::TaskManager::self(), SIGNAL(desktopChanged(int)),
             this, SLOT(currentDesktopChanged(int)));
 
+    connect(TaskManager::TaskManager::self(), SIGNAL(windowChanged(TaskPtr)),
+            this, SLOT(removeMovedWindow(TaskPtr)));
+
+
     // add the animator once we're initialized to avoid animating like mad on start up
     _rootTaskGroup->layout()->setAnimator(animator);
 }
@@ -159,7 +163,7 @@
         return;
     }
 	
-	if (_showOnlyCurrentDesktop && task->desktop() != TaskManager::TaskManager::self()->currentDesktop())
+	if (_showOnlyCurrentDesktop && !task->isOnCurrentDesktop())
 		return;
     WindowTaskItem *item = 0;
     foreach (StartupPtr startup, _startupTaskItems.keys()) {
@@ -219,6 +223,12 @@
 
 }
 
+void Tasks::removeMovedWindow(TaskPtr task)
+{
+    if (_showOnlyCurrentDesktop && !task->isOnCurrentDesktop())
+    removeWindowTask(task);
+}
+
 void Tasks::showConfigurationInterface()
 {
     if (m_dialog == 0) {
--- trunk/KDE/kdebase/workspace/plasma/applets/tasks/tasks.h #762829:762830
@@ -85,9 +85,10 @@
 
         void addStartingTask(StartupPtr);
         void removeStartingTask(StartupPtr);
-		
-		void currentDesktopChanged(int);
 
+        void currentDesktopChanged(int);
+        void removeMovedWindow(TaskPtr task);
+
 private:
         // creates task representations for existing windows
         // and sets up connections to listen for addition or removal
--- trunk/KDE/kdebase/workspace/plasma/applets/tasks/tasksConfig.ui #762829:762830
@@ -26,7 +26,7 @@
   <item row="1" column="0" >
     <widget class="QCheckBox" name="showOnlyCurrentDesktop" >
      <property name="text" >
-      <string>Show only task of the current desktop</string>
+      <string>Show only tasks from the current desktop</string>
      </property>
     </widget>
    </item>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic