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

List:       kde-commits
Subject:    kdebase/kicker
From:       Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date:       2005-03-02 22:13:22
Message-ID: 20050302221322.43B8016EF1 () office ! kde ! org
[Download RAW message or body]

CVS commit by nikolaus: 

sort taskbar buttons alphabetically


  M +0 -5      TODO   1.48
  M +17 -1     taskbar/taskbar.cpp   1.77
  M +6 -2      taskbar/taskbar.h   1.40
  M +5 -0      taskbar/taskbar.kcfg   1.4
  M +4 -0      taskmanager/taskmanager.cpp   1.91
  M +5 -0      taskmanager/taskmanager.h   1.59


--- kdebase/kicker/taskbar/taskbar.cpp  #1.76:1.77
@@ -45,4 +45,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE 
 #include "taskbar.moc"
 
+
+int TaskContainerList::compareItems(QPtrCollection::Item item1,
+                                    QPtrCollection::Item item2)
+{
+    TaskContainer* con1 = static_cast<TaskContainer*>(item1);
+    TaskContainer* con2 = static_cast<TaskContainer*>(item2);
+    return QString::localeAwareCompare(con1->name(), con2->name());
+}
+
+
 TaskBar::TaskBar( QWidget *parent, const char *name )
     : Panner( parent, name ),
@@ -82,4 +92,5 @@ TaskBar::TaskBar( QWidget *parent, const
     connect(TaskManager::the(), SIGNAL(desktopChanged(int)), \
                SLOT(desktopChanged(int)));
     connect(TaskManager::the(), SIGNAL(windowChanged(WId)), \
SLOT(windowChanged(WId))); +    connect(TaskManager::the(), \
SIGNAL(taskNameChanged()), SLOT(reLayout()));  
     isGrouping = shouldGroup();
@@ -493,4 +504,9 @@ void TaskBar::reLayout()
     }
 
+    if (TaskBarSettings::sortByName())
+    {
+        list.sort();
+    }
+
     // sort container list by desktop
     if ( m_sortByDesktop )

--- kdebase/kicker/taskbar/taskbar.h  #1.39:1.40
@@ -45,6 +45,10 @@ typedef QPtrList<Task> TaskList;
 typedef QPtrList<Startup> StartupList;
 typedef QPtrList<QPixmap> PixmapList;
-typedef QPtrList<TaskContainer> TaskContainerList;
 typedef QPtrListIterator<TaskContainer> TaskContainerIterator;
+class TaskContainerList : public QPtrList<TaskContainer>
+{
+public:
+    int compareItems(QPtrCollection::Item, QPtrCollection::Item);
+};
 
 class TaskBar : public Panner
@@ -92,4 +96,5 @@ protected slots:
     void slotActivatePreviousTask();
     void slotSettingsChanged(int);
+    void reLayout();
 
 protected:
@@ -101,5 +106,4 @@ protected:
     void propagateMouseEvent( QMouseEvent* );
     void resizeEvent( QResizeEvent* );
-    void reLayout();
     bool idMatch( const QString& id1, const QString& id2 );
     TaskContainerList filteredContainers();

--- kdebase/kicker/taskbar/taskbar.kcfg  #1.3:1.4
@@ -38,4 +38,9 @@
             <whatsthis>Selecting this option causes the taskbar to show windows in \
order of the desktop they appear on.\n\nBy default this option is \
selected.</whatsthis>  </entry>
+        <entry key="SortByName" type="Bool" >
+            <default>true</default>
+            <label>Sort windows by name</label>
+            <whatsthis>Selecting this option causes the taskbar to show windows \
alphabetically ordered.\n\nBy default this option is selected.</whatsthis> +        \
</entry>  <entry key="ShowIcon" type="Bool" >
             <default>true</default>

--- kdebase/kicker/taskmanager/taskmanager.cpp  #1.90:1.91
@@ -258,4 +258,8 @@ void TaskManager::windowChanged(WId w, u
             t->refreshIcon();
         }
+        else if (dirty == NET::WMName)
+        {
+            emit taskNameChanged();
+        }
     }
 

--- kdebase/kicker/taskmanager/taskmanager.h  #1.58:1.59
@@ -562,4 +562,9 @@ signals:
     void windowChangedGeometry(WId);
 
+    /**
+     * Emitted when a task changes name.
+     */
+    void taskNameChanged();
+
 protected slots:
     //* @internal

--- kdebase/kicker/TODO  #1.47:1.48
@@ -117,9 +117,4 @@
       do some semi-intelligent packing of the icons.
 
-+++   Make the taskbar buttons sorted alphabeticall by default
-**    Taskbar buttons should be ordered alphabetically (in addition to by
-      desktop if that option is selected). It should also be decently
-      performant in doing so.
-
 ++    Dialog for adding elements to the panel
 ***   Context menus are primarily used by advanced users, and yet this is


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

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