From 27856879bf962f178d88e79144e37a47e731b122 Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 3 Sep 2010 09:14:57 +0000 Subject: * Massive import of OpenSUSE patches, primarily for bugfixes * Added some infrastructure created by OpenSUSE to allow for future addition of the Kickoff menu as an option * Minor Slackware compilation fixes git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1171255 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kicker/applets/systemtray/systemtrayapplet.cpp | 98 ++++++++++++---- kicker/applets/systemtray/systemtrayapplet.h | 1 + .../data/kickoff/button-box-gradient-topdown.png | Bin 0 -> 213 bytes kicker/data/kickoff/button-box-gradient.png | Bin 0 -> 255 bytes kicker/data/kickoff/button-box-left-corner.png | Bin 0 -> 203 bytes kicker/data/kickoff/button-box-left.png | Bin 0 -> 306 bytes kicker/data/kickoff/button-box-right-corner.png | Bin 0 -> 214 bytes kicker/data/kickoff/button-box-top.png | Bin 0 -> 163 bytes kicker/data/kickoff/cr128-action-suspend2disk.png | Bin 0 -> 13797 bytes kicker/data/kickoff/cr128-action-suspend2ram.png | Bin 0 -> 15500 bytes kicker/data/kickoff/cr16-action-suspend2disk.png | Bin 0 -> 834 bytes kicker/data/kickoff/cr16-action-suspend2ram.png | Bin 0 -> 865 bytes kicker/data/kickoff/cr32-action-leave.png | Bin 0 -> 1602 bytes kicker/data/kickoff/cr32-action-suspend2disk.png | Bin 0 -> 2091 bytes kicker/data/kickoff/cr32-action-suspend2ram.png | Bin 0 -> 2243 bytes kicker/data/kickoff/cr48-action-leave.png | Bin 0 -> 2475 bytes kicker/data/kickoff/cr48-action-suspend2disk.png | Bin 0 -> 3713 bytes kicker/data/kickoff/cr48-action-suspend2ram.png | Bin 0 -> 3965 bytes kicker/data/kickoff/cr48-app-recently_used.png | Bin 0 -> 4736 bytes kicker/data/kickoff/cr64-action-suspend2disk.png | Bin 0 -> 5601 bytes kicker/data/kickoff/cr64-action-suspend2ram.png | Bin 0 -> 6115 bytes kicker/data/kickoff/crsc-action-leave.svgz | Bin 0 -> 3915 bytes kicker/data/kickoff/crsc-action-suspend2disk.svgz | Bin 0 -> 12713 bytes kicker/data/kickoff/crsc-action-suspend2ram.svgz | Bin 0 -> 13613 bytes kicker/data/kickoff/kmenu_active.png | Bin 0 -> 3257 bytes kicker/data/kickoff/kmenu_basic.mng | Bin 0 -> 81101 bytes kicker/data/kickoff/kmenu_flipped.mng | Bin 0 -> 81240 bytes kicker/data/kickoff/kmenu_vertical.mng | Bin 0 -> 62006 bytes kicker/data/kickoff/left_triangle.png | Bin 0 -> 781 bytes kicker/data/kickoff/main_border_bc.png | Bin 0 -> 171 bytes kicker/data/kickoff/main_border_lc.png | Bin 0 -> 166 bytes kicker/data/kickoff/main_border_rc.png | Bin 0 -> 174 bytes kicker/data/kickoff/main_border_tc.png | Bin 0 -> 163 bytes kicker/data/kickoff/main_corner_bl.png | Bin 0 -> 211 bytes kicker/data/kickoff/main_corner_br.png | Bin 0 -> 218 bytes kicker/data/kickoff/main_corner_tl.png | Bin 0 -> 176 bytes kicker/data/kickoff/main_corner_tr.png | Bin 0 -> 202 bytes kicker/data/kickoff/menu_separator.png | Bin 0 -> 260 bytes kicker/data/kickoff/resize_handle.png | Bin 0 -> 217 bytes kicker/data/kickoff/right_triangle.png | Bin 0 -> 722 bytes kicker/data/kickoff/search-gradient-topdown.png | Bin 0 -> 181 bytes kicker/data/kickoff/search-gradient.png | Bin 0 -> 218 bytes kicker/data/kickoff/search-running.mng | Bin 0 -> 11888 bytes kicker/data/kickoff/search-tab-center.png | Bin 0 -> 170 bytes kicker/data/kickoff/search-tab-left.png | Bin 0 -> 398 bytes kicker/data/kickoff/search-tab-right.png | Bin 0 -> 417 bytes kicker/data/kickoff/search-tab-top-center.png | Bin 0 -> 146 bytes kicker/data/kickoff/search-tab-top-left.png | Bin 0 -> 2960 bytes kicker/data/kickoff/search-tab-top-right.png | Bin 0 -> 368 bytes kicker/data/kickoff/tab-bottom-left-topdown.png | Bin 0 -> 145 bytes kicker/data/kickoff/tab-bottom-left.png | Bin 0 -> 304 bytes kicker/data/kickoff/tab-bottom-right-topdown.png | Bin 0 -> 171 bytes kicker/data/kickoff/tab-bottom-right.png | Bin 0 -> 351 bytes kicker/data/kickoff/tab-center-topdown.png | Bin 0 -> 142 bytes kicker/data/kickoff/tab-center.png | Bin 0 -> 175 bytes kicker/data/kickoff/tab-left_center.png | Bin 0 -> 165 bytes kicker/data/kickoff/tab-right_center.png | Bin 0 -> 165 bytes kicker/data/kickoff/tab-top-left-topdown.png | Bin 0 -> 256 bytes kicker/data/kickoff/tab-top-left.png | Bin 0 -> 198 bytes kicker/data/kickoff/tab-top-right-topdown.png | Bin 0 -> 327 bytes kicker/data/kickoff/tab-top-right.png | Bin 0 -> 198 bytes kicker/kicker/ui/browser_mnu.cpp | 9 +- kicker/kicker/ui/service_mnu.cpp | 123 +++++++++++++++++++-- kicker/kicker/ui/service_mnu.h | 3 +- kicker/libkicker/kickerSettings.kcfg | 5 + 65 files changed, 205 insertions(+), 34 deletions(-) create mode 100644 kicker/data/kickoff/button-box-gradient-topdown.png create mode 100644 kicker/data/kickoff/button-box-gradient.png create mode 100644 kicker/data/kickoff/button-box-left-corner.png create mode 100644 kicker/data/kickoff/button-box-left.png create mode 100644 kicker/data/kickoff/button-box-right-corner.png create mode 100644 kicker/data/kickoff/button-box-top.png create mode 100644 kicker/data/kickoff/cr128-action-suspend2disk.png create mode 100644 kicker/data/kickoff/cr128-action-suspend2ram.png create mode 100644 kicker/data/kickoff/cr16-action-suspend2disk.png create mode 100644 kicker/data/kickoff/cr16-action-suspend2ram.png create mode 100644 kicker/data/kickoff/cr32-action-leave.png create mode 100644 kicker/data/kickoff/cr32-action-suspend2disk.png create mode 100644 kicker/data/kickoff/cr32-action-suspend2ram.png create mode 100644 kicker/data/kickoff/cr48-action-leave.png create mode 100644 kicker/data/kickoff/cr48-action-suspend2disk.png create mode 100644 kicker/data/kickoff/cr48-action-suspend2ram.png create mode 100644 kicker/data/kickoff/cr48-app-recently_used.png create mode 100644 kicker/data/kickoff/cr64-action-suspend2disk.png create mode 100644 kicker/data/kickoff/cr64-action-suspend2ram.png create mode 100644 kicker/data/kickoff/crsc-action-leave.svgz create mode 100644 kicker/data/kickoff/crsc-action-suspend2disk.svgz create mode 100644 kicker/data/kickoff/crsc-action-suspend2ram.svgz create mode 100644 kicker/data/kickoff/kmenu_active.png create mode 100644 kicker/data/kickoff/kmenu_basic.mng create mode 100644 kicker/data/kickoff/kmenu_flipped.mng create mode 100644 kicker/data/kickoff/kmenu_vertical.mng create mode 100644 kicker/data/kickoff/left_triangle.png create mode 100644 kicker/data/kickoff/main_border_bc.png create mode 100644 kicker/data/kickoff/main_border_lc.png create mode 100644 kicker/data/kickoff/main_border_rc.png create mode 100644 kicker/data/kickoff/main_border_tc.png create mode 100644 kicker/data/kickoff/main_corner_bl.png create mode 100644 kicker/data/kickoff/main_corner_br.png create mode 100644 kicker/data/kickoff/main_corner_tl.png create mode 100644 kicker/data/kickoff/main_corner_tr.png create mode 100644 kicker/data/kickoff/menu_separator.png create mode 100644 kicker/data/kickoff/resize_handle.png create mode 100644 kicker/data/kickoff/right_triangle.png create mode 100644 kicker/data/kickoff/search-gradient-topdown.png create mode 100644 kicker/data/kickoff/search-gradient.png create mode 100644 kicker/data/kickoff/search-running.mng create mode 100644 kicker/data/kickoff/search-tab-center.png create mode 100644 kicker/data/kickoff/search-tab-left.png create mode 100644 kicker/data/kickoff/search-tab-right.png create mode 100644 kicker/data/kickoff/search-tab-top-center.png create mode 100644 kicker/data/kickoff/search-tab-top-left.png create mode 100644 kicker/data/kickoff/search-tab-top-right.png create mode 100644 kicker/data/kickoff/tab-bottom-left-topdown.png create mode 100644 kicker/data/kickoff/tab-bottom-left.png create mode 100644 kicker/data/kickoff/tab-bottom-right-topdown.png create mode 100644 kicker/data/kickoff/tab-bottom-right.png create mode 100644 kicker/data/kickoff/tab-center-topdown.png create mode 100644 kicker/data/kickoff/tab-center.png create mode 100644 kicker/data/kickoff/tab-left_center.png create mode 100644 kicker/data/kickoff/tab-right_center.png create mode 100644 kicker/data/kickoff/tab-top-left-topdown.png create mode 100644 kicker/data/kickoff/tab-top-left.png create mode 100644 kicker/data/kickoff/tab-top-right-topdown.png create mode 100644 kicker/data/kickoff/tab-top-right.png (limited to 'kicker') diff --git a/kicker/applets/systemtray/systemtrayapplet.cpp b/kicker/applets/systemtray/systemtrayapplet.cpp index 933855f74..51bf2b9d8 100644 --- a/kicker/applets/systemtray/systemtrayapplet.cpp +++ b/kicker/applets/systemtray/systemtrayapplet.cpp @@ -189,6 +189,7 @@ bool SystemTrayApplet::x11Event( XEvent *e ) if( isWinManaged( (WId)e->xclient.data.l[2] ) ) // we already manage it return true; embedWindow( e->xclient.data.l[2], false ); + updateVisibleWins(); layoutTray(); return true; } @@ -215,13 +216,12 @@ void SystemTrayApplet::preferences() connect(m_settingsDialog, TQT_SIGNAL(finished()), this, TQT_SLOT(settingsDialogFinished())); m_iconSelector = new KActionSelector(m_settingsDialog); - m_iconSelector->setAvailableLabel(i18n("Visible icons:")); - m_iconSelector->setSelectedLabel(i18n("Hidden icons:")); - m_iconSelector->setShowUpDownButtons(false); + m_iconSelector->setAvailableLabel(i18n("Hidden icons:")); + m_iconSelector->setSelectedLabel(i18n("Visible icons:")); m_settingsDialog->setMainWidget(m_iconSelector); - TQListBox *shownListBox = m_iconSelector->availableListBox(); - TQListBox *hiddenListBox = m_iconSelector->selectedListBox(); + TQListBox *hiddenListBox = m_iconSelector->availableListBox(); + TQListBox *shownListBox = m_iconSelector->selectedListBox(); TrayEmbedList::const_iterator it = m_shownWins.begin(); TrayEmbedList::const_iterator itEnd = m_shownWins.end(); @@ -263,26 +263,48 @@ void SystemTrayApplet::applySettings() } KConfig *conf = config(); - conf->setGroup("HiddenTrayIcons"); - TQString name; - - // use the following snippet of code someday to implement ordering - // of icons - /* - m_visibleIconList.clear(); - TQListBoxItem* item = m_iconSelector->availableListBox()->firstItem(); - for (; item; item = item->next()) + + // Save the sort order and hidden status using the window class (WM_CLASS) rather + // than window name (caption) - window name is i18n-ed, so it's for example + // not possible to create default settings. + // For backwards compatibility, name is kept as it is, class is preceded by '!'. + TQMap< TQString, TQString > windowNameToClass; + for( TrayEmbedList::ConstIterator it = m_shownWins.begin(); + it != m_shownWins.end(); + ++it ) { + KWin::WindowInfo info = KWin::windowInfo( (*it)->embeddedWinId(), NET::WMName, NET::WM2WindowClass); + windowNameToClass[ info.name() ] = '!' + info.windowClassClass(); + } + for( TrayEmbedList::ConstIterator it = m_hiddenWins.begin(); + it != m_hiddenWins.end(); + ++it ) { + KWin::WindowInfo info = KWin::windowInfo( (*it)->embeddedWinId(), NET::WMName, NET::WM2WindowClass); + windowNameToClass[ info.name() ] = '!' + info.windowClassClass(); + } + + conf->setGroup("SortedTrayIcons"); + m_sortOrderIconList.clear(); + for(TQListBoxItem* item = m_iconSelector->selectedListBox()->firstItem(); + item; + item = item->next()) { - m_visibleIconList.append(item->text()); + if( windowNameToClass.contains(item->text())) + m_sortOrderIconList.append(windowNameToClass[item->text()]); + else + m_sortOrderIconList.append(item->text()); } - conf->writeEntry("Visible", m_visibleIconList); - selection.clear();*/ + conf->writeEntry("SortOrder", m_sortOrderIconList); + conf->setGroup("HiddenTrayIcons"); m_hiddenIconList.clear(); - TQListBoxItem* item = m_iconSelector->selectedListBox()->firstItem(); - for (; item; item = item->next()) + for(TQListBoxItem* item = m_iconSelector->availableListBox()->firstItem(); + item; + item = item->next()) { - m_hiddenIconList.append(item->text()); + if( windowNameToClass.contains(item->text())) + m_hiddenIconList.append(windowNameToClass[item->text()]); + else + m_hiddenIconList.append(item->text()); } conf->writeEntry("Hidden", m_hiddenIconList); conf->sync(); @@ -437,6 +459,9 @@ void SystemTrayApplet::loadSettings() conf->setGroup("HiddenTrayIcons"); m_hiddenIconList = conf->readListEntry("Hidden"); + conf->setGroup("SortedTrayIcons"); + m_sortOrderIconList = conf->readListEntry("SortOrder"); + //Note This setting comes from kdeglobal. conf->setGroup("System Tray"); m_iconSize = conf->readNumEntry("systrayIconWidth", 22); @@ -526,7 +551,9 @@ bool SystemTrayApplet::isWinManaged(WId w) bool SystemTrayApplet::shouldHide(WId w) { - return m_hiddenIconList.find(KWin::windowInfo(w).name()) != m_hiddenIconList.end(); + return m_hiddenIconList.find(KWin::windowInfo(w).name()) != m_hiddenIconList.end() + || m_hiddenIconList.find('!'+KWin::windowInfo(w,0,NET::WM2WindowClass).windowClassClass()) + != m_hiddenIconList.end(); } void SystemTrayApplet::updateVisibleWins() @@ -549,6 +576,35 @@ void SystemTrayApplet::updateVisibleWins() (*emb)->hide(); } } + + TQMap< QXEmbed*, TQString > names; // cache window names and classes + TQMap< QXEmbed*, TQString > classes; + for( TrayEmbedList::const_iterator it = m_shownWins.begin(); + it != m_shownWins.end(); + ++it ) { + KWin::WindowInfo info = KWin::windowInfo((*it)->embeddedWinId(),NET::WMName,NET::WM2WindowClass); + names[ *it ] = info.name(); + classes[ *it ] = '!'+info.windowClassClass(); + } + TrayEmbedList newList; + for( TQStringList::const_iterator it1 = m_sortOrderIconList.begin(); + it1 != m_sortOrderIconList.end(); + ++it1 ) { + for( TrayEmbedList::iterator it2 = m_shownWins.begin(); + it2 != m_shownWins.end(); + ) { + if( (*it1).startsWith("!") ? classes[ *it2 ] == *it1 : names[ *it2 ] == *it1 ) { + newList.append( *it2 ); // don't bail out, there may be multiple ones + it2 = m_shownWins.erase( it2 ); + } else + ++it2; + } + } + for( TrayEmbedList::const_iterator it = m_shownWins.begin(); + it != m_shownWins.end(); + ++it ) + newList.append( *it ); // append unsorted items + m_shownWins = newList; } void SystemTrayApplet::toggleExpanded() diff --git a/kicker/applets/systemtray/systemtrayapplet.h b/kicker/applets/systemtray/systemtrayapplet.h index a92b8f74e..f66e0caa5 100644 --- a/kicker/applets/systemtray/systemtrayapplet.h +++ b/kicker/applets/systemtray/systemtrayapplet.h @@ -98,6 +98,7 @@ private: TrayEmbedList m_shownWins; TrayEmbedList m_hiddenWins; TQStringList m_hiddenIconList; + TQStringList m_sortOrderIconList; KWinModule *kwin_module; Atom net_system_tray_selection; Atom net_system_tray_opcode; diff --git a/kicker/data/kickoff/button-box-gradient-topdown.png b/kicker/data/kickoff/button-box-gradient-topdown.png new file mode 100644 index 000000000..378816342 Binary files /dev/null and b/kicker/data/kickoff/button-box-gradient-topdown.png differ diff --git a/kicker/data/kickoff/button-box-gradient.png b/kicker/data/kickoff/button-box-gradient.png new file mode 100644 index 000000000..a7c11adba Binary files /dev/null and b/kicker/data/kickoff/button-box-gradient.png differ diff --git a/kicker/data/kickoff/button-box-left-corner.png b/kicker/data/kickoff/button-box-left-corner.png new file mode 100644 index 000000000..c4080cb00 Binary files /dev/null and b/kicker/data/kickoff/button-box-left-corner.png differ diff --git a/kicker/data/kickoff/button-box-left.png b/kicker/data/kickoff/button-box-left.png new file mode 100644 index 000000000..3b532f8bd Binary files /dev/null and b/kicker/data/kickoff/button-box-left.png differ diff --git a/kicker/data/kickoff/button-box-right-corner.png b/kicker/data/kickoff/button-box-right-corner.png new file mode 100644 index 000000000..ef44b1fab Binary files /dev/null and b/kicker/data/kickoff/button-box-right-corner.png differ diff --git a/kicker/data/kickoff/button-box-top.png b/kicker/data/kickoff/button-box-top.png new file mode 100644 index 000000000..1cac298be Binary files /dev/null and b/kicker/data/kickoff/button-box-top.png differ diff --git a/kicker/data/kickoff/cr128-action-suspend2disk.png b/kicker/data/kickoff/cr128-action-suspend2disk.png new file mode 100644 index 000000000..b3ac2fe05 Binary files /dev/null and b/kicker/data/kickoff/cr128-action-suspend2disk.png differ diff --git a/kicker/data/kickoff/cr128-action-suspend2ram.png b/kicker/data/kickoff/cr128-action-suspend2ram.png new file mode 100644 index 000000000..9e641bd47 Binary files /dev/null and b/kicker/data/kickoff/cr128-action-suspend2ram.png differ diff --git a/kicker/data/kickoff/cr16-action-suspend2disk.png b/kicker/data/kickoff/cr16-action-suspend2disk.png new file mode 100644 index 000000000..a28ab8ad9 Binary files /dev/null and b/kicker/data/kickoff/cr16-action-suspend2disk.png differ diff --git a/kicker/data/kickoff/cr16-action-suspend2ram.png b/kicker/data/kickoff/cr16-action-suspend2ram.png new file mode 100644 index 000000000..45738ccc5 Binary files /dev/null and b/kicker/data/kickoff/cr16-action-suspend2ram.png differ diff --git a/kicker/data/kickoff/cr32-action-leave.png b/kicker/data/kickoff/cr32-action-leave.png new file mode 100644 index 000000000..89dc15953 Binary files /dev/null and b/kicker/data/kickoff/cr32-action-leave.png differ diff --git a/kicker/data/kickoff/cr32-action-suspend2disk.png b/kicker/data/kickoff/cr32-action-suspend2disk.png new file mode 100644 index 000000000..7bcb027b1 Binary files /dev/null and b/kicker/data/kickoff/cr32-action-suspend2disk.png differ diff --git a/kicker/data/kickoff/cr32-action-suspend2ram.png b/kicker/data/kickoff/cr32-action-suspend2ram.png new file mode 100644 index 000000000..7a96cd24f Binary files /dev/null and b/kicker/data/kickoff/cr32-action-suspend2ram.png differ diff --git a/kicker/data/kickoff/cr48-action-leave.png b/kicker/data/kickoff/cr48-action-leave.png new file mode 100644 index 000000000..7c01634b9 Binary files /dev/null and b/kicker/data/kickoff/cr48-action-leave.png differ diff --git a/kicker/data/kickoff/cr48-action-suspend2disk.png b/kicker/data/kickoff/cr48-action-suspend2disk.png new file mode 100644 index 000000000..9ff2148b8 Binary files /dev/null and b/kicker/data/kickoff/cr48-action-suspend2disk.png differ diff --git a/kicker/data/kickoff/cr48-action-suspend2ram.png b/kicker/data/kickoff/cr48-action-suspend2ram.png new file mode 100644 index 000000000..2aefa6ce4 Binary files /dev/null and b/kicker/data/kickoff/cr48-action-suspend2ram.png differ diff --git a/kicker/data/kickoff/cr48-app-recently_used.png b/kicker/data/kickoff/cr48-app-recently_used.png new file mode 100644 index 000000000..b97479759 Binary files /dev/null and b/kicker/data/kickoff/cr48-app-recently_used.png differ diff --git a/kicker/data/kickoff/cr64-action-suspend2disk.png b/kicker/data/kickoff/cr64-action-suspend2disk.png new file mode 100644 index 000000000..f6e57d786 Binary files /dev/null and b/kicker/data/kickoff/cr64-action-suspend2disk.png differ diff --git a/kicker/data/kickoff/cr64-action-suspend2ram.png b/kicker/data/kickoff/cr64-action-suspend2ram.png new file mode 100644 index 000000000..cdb47d04f Binary files /dev/null and b/kicker/data/kickoff/cr64-action-suspend2ram.png differ diff --git a/kicker/data/kickoff/crsc-action-leave.svgz b/kicker/data/kickoff/crsc-action-leave.svgz new file mode 100644 index 000000000..b6a93b05c Binary files /dev/null and b/kicker/data/kickoff/crsc-action-leave.svgz differ diff --git a/kicker/data/kickoff/crsc-action-suspend2disk.svgz b/kicker/data/kickoff/crsc-action-suspend2disk.svgz new file mode 100644 index 000000000..d73b491d9 Binary files /dev/null and b/kicker/data/kickoff/crsc-action-suspend2disk.svgz differ diff --git a/kicker/data/kickoff/crsc-action-suspend2ram.svgz b/kicker/data/kickoff/crsc-action-suspend2ram.svgz new file mode 100644 index 000000000..c38d2ed33 Binary files /dev/null and b/kicker/data/kickoff/crsc-action-suspend2ram.svgz differ diff --git a/kicker/data/kickoff/kmenu_active.png b/kicker/data/kickoff/kmenu_active.png new file mode 100644 index 000000000..fa5ae4de1 Binary files /dev/null and b/kicker/data/kickoff/kmenu_active.png differ diff --git a/kicker/data/kickoff/kmenu_basic.mng b/kicker/data/kickoff/kmenu_basic.mng new file mode 100644 index 000000000..4cea61fff Binary files /dev/null and b/kicker/data/kickoff/kmenu_basic.mng differ diff --git a/kicker/data/kickoff/kmenu_flipped.mng b/kicker/data/kickoff/kmenu_flipped.mng new file mode 100644 index 000000000..2b78b4007 Binary files /dev/null and b/kicker/data/kickoff/kmenu_flipped.mng differ diff --git a/kicker/data/kickoff/kmenu_vertical.mng b/kicker/data/kickoff/kmenu_vertical.mng new file mode 100644 index 000000000..9cd3aac2b Binary files /dev/null and b/kicker/data/kickoff/kmenu_vertical.mng differ diff --git a/kicker/data/kickoff/left_triangle.png b/kicker/data/kickoff/left_triangle.png new file mode 100644 index 000000000..b8ac404fd Binary files /dev/null and b/kicker/data/kickoff/left_triangle.png differ diff --git a/kicker/data/kickoff/main_border_bc.png b/kicker/data/kickoff/main_border_bc.png new file mode 100644 index 000000000..05e497763 Binary files /dev/null and b/kicker/data/kickoff/main_border_bc.png differ diff --git a/kicker/data/kickoff/main_border_lc.png b/kicker/data/kickoff/main_border_lc.png new file mode 100644 index 000000000..c440e859e Binary files /dev/null and b/kicker/data/kickoff/main_border_lc.png differ diff --git a/kicker/data/kickoff/main_border_rc.png b/kicker/data/kickoff/main_border_rc.png new file mode 100644 index 000000000..6cef8af01 Binary files /dev/null and b/kicker/data/kickoff/main_border_rc.png differ diff --git a/kicker/data/kickoff/main_border_tc.png b/kicker/data/kickoff/main_border_tc.png new file mode 100644 index 000000000..bc03e85dd Binary files /dev/null and b/kicker/data/kickoff/main_border_tc.png differ diff --git a/kicker/data/kickoff/main_corner_bl.png b/kicker/data/kickoff/main_corner_bl.png new file mode 100644 index 000000000..32ea680f1 Binary files /dev/null and b/kicker/data/kickoff/main_corner_bl.png differ diff --git a/kicker/data/kickoff/main_corner_br.png b/kicker/data/kickoff/main_corner_br.png new file mode 100644 index 000000000..b2d898ab6 Binary files /dev/null and b/kicker/data/kickoff/main_corner_br.png differ diff --git a/kicker/data/kickoff/main_corner_tl.png b/kicker/data/kickoff/main_corner_tl.png new file mode 100644 index 000000000..11fe645ce Binary files /dev/null and b/kicker/data/kickoff/main_corner_tl.png differ diff --git a/kicker/data/kickoff/main_corner_tr.png b/kicker/data/kickoff/main_corner_tr.png new file mode 100644 index 000000000..a439d9763 Binary files /dev/null and b/kicker/data/kickoff/main_corner_tr.png differ diff --git a/kicker/data/kickoff/menu_separator.png b/kicker/data/kickoff/menu_separator.png new file mode 100644 index 000000000..2ba13727d Binary files /dev/null and b/kicker/data/kickoff/menu_separator.png differ diff --git a/kicker/data/kickoff/resize_handle.png b/kicker/data/kickoff/resize_handle.png new file mode 100644 index 000000000..c0811dc50 Binary files /dev/null and b/kicker/data/kickoff/resize_handle.png differ diff --git a/kicker/data/kickoff/right_triangle.png b/kicker/data/kickoff/right_triangle.png new file mode 100644 index 000000000..9766030c0 Binary files /dev/null and b/kicker/data/kickoff/right_triangle.png differ diff --git a/kicker/data/kickoff/search-gradient-topdown.png b/kicker/data/kickoff/search-gradient-topdown.png new file mode 100644 index 000000000..b13a19290 Binary files /dev/null and b/kicker/data/kickoff/search-gradient-topdown.png differ diff --git a/kicker/data/kickoff/search-gradient.png b/kicker/data/kickoff/search-gradient.png new file mode 100644 index 000000000..3478ea18b Binary files /dev/null and b/kicker/data/kickoff/search-gradient.png differ diff --git a/kicker/data/kickoff/search-running.mng b/kicker/data/kickoff/search-running.mng new file mode 100644 index 000000000..9f477c9c3 Binary files /dev/null and b/kicker/data/kickoff/search-running.mng differ diff --git a/kicker/data/kickoff/search-tab-center.png b/kicker/data/kickoff/search-tab-center.png new file mode 100644 index 000000000..26ec2f2e9 Binary files /dev/null and b/kicker/data/kickoff/search-tab-center.png differ diff --git a/kicker/data/kickoff/search-tab-left.png b/kicker/data/kickoff/search-tab-left.png new file mode 100644 index 000000000..507b41767 Binary files /dev/null and b/kicker/data/kickoff/search-tab-left.png differ diff --git a/kicker/data/kickoff/search-tab-right.png b/kicker/data/kickoff/search-tab-right.png new file mode 100644 index 000000000..94a410443 Binary files /dev/null and b/kicker/data/kickoff/search-tab-right.png differ diff --git a/kicker/data/kickoff/search-tab-top-center.png b/kicker/data/kickoff/search-tab-top-center.png new file mode 100644 index 000000000..51482ad23 Binary files /dev/null and b/kicker/data/kickoff/search-tab-top-center.png differ diff --git a/kicker/data/kickoff/search-tab-top-left.png b/kicker/data/kickoff/search-tab-top-left.png new file mode 100644 index 000000000..97264782a Binary files /dev/null and b/kicker/data/kickoff/search-tab-top-left.png differ diff --git a/kicker/data/kickoff/search-tab-top-right.png b/kicker/data/kickoff/search-tab-top-right.png new file mode 100644 index 000000000..fc80f40c2 Binary files /dev/null and b/kicker/data/kickoff/search-tab-top-right.png differ diff --git a/kicker/data/kickoff/tab-bottom-left-topdown.png b/kicker/data/kickoff/tab-bottom-left-topdown.png new file mode 100644 index 000000000..a96a7bf12 Binary files /dev/null and b/kicker/data/kickoff/tab-bottom-left-topdown.png differ diff --git a/kicker/data/kickoff/tab-bottom-left.png b/kicker/data/kickoff/tab-bottom-left.png new file mode 100644 index 000000000..fd8a34aca Binary files /dev/null and b/kicker/data/kickoff/tab-bottom-left.png differ diff --git a/kicker/data/kickoff/tab-bottom-right-topdown.png b/kicker/data/kickoff/tab-bottom-right-topdown.png new file mode 100644 index 000000000..d1d80a6b3 Binary files /dev/null and b/kicker/data/kickoff/tab-bottom-right-topdown.png differ diff --git a/kicker/data/kickoff/tab-bottom-right.png b/kicker/data/kickoff/tab-bottom-right.png new file mode 100644 index 000000000..86d226b51 Binary files /dev/null and b/kicker/data/kickoff/tab-bottom-right.png differ diff --git a/kicker/data/kickoff/tab-center-topdown.png b/kicker/data/kickoff/tab-center-topdown.png new file mode 100644 index 000000000..c35438d91 Binary files /dev/null and b/kicker/data/kickoff/tab-center-topdown.png differ diff --git a/kicker/data/kickoff/tab-center.png b/kicker/data/kickoff/tab-center.png new file mode 100644 index 000000000..0ef1f6d34 Binary files /dev/null and b/kicker/data/kickoff/tab-center.png differ diff --git a/kicker/data/kickoff/tab-left_center.png b/kicker/data/kickoff/tab-left_center.png new file mode 100644 index 000000000..4c8c39794 Binary files /dev/null and b/kicker/data/kickoff/tab-left_center.png differ diff --git a/kicker/data/kickoff/tab-right_center.png b/kicker/data/kickoff/tab-right_center.png new file mode 100644 index 000000000..3df6564f4 Binary files /dev/null and b/kicker/data/kickoff/tab-right_center.png differ diff --git a/kicker/data/kickoff/tab-top-left-topdown.png b/kicker/data/kickoff/tab-top-left-topdown.png new file mode 100644 index 000000000..3df580e1d Binary files /dev/null and b/kicker/data/kickoff/tab-top-left-topdown.png differ diff --git a/kicker/data/kickoff/tab-top-left.png b/kicker/data/kickoff/tab-top-left.png new file mode 100644 index 000000000..910967a18 Binary files /dev/null and b/kicker/data/kickoff/tab-top-left.png differ diff --git a/kicker/data/kickoff/tab-top-right-topdown.png b/kicker/data/kickoff/tab-top-right-topdown.png new file mode 100644 index 000000000..dd672cad9 Binary files /dev/null and b/kicker/data/kickoff/tab-top-right-topdown.png differ diff --git a/kicker/data/kickoff/tab-top-right.png b/kicker/data/kickoff/tab-top-right.png new file mode 100644 index 000000000..e96019d6d Binary files /dev/null and b/kicker/data/kickoff/tab-top-right.png differ diff --git a/kicker/kicker/ui/browser_mnu.cpp b/kicker/kicker/ui/browser_mnu.cpp index 6802e6388..88ce30713 100644 --- a/kicker/kicker/ui/browser_mnu.cpp +++ b/kicker/kicker/ui/browser_mnu.cpp @@ -31,6 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include +#include #include #include #include @@ -148,12 +149,14 @@ void PanelBrowserMenu::initialize() // only the first part menu got them if(_startid == 0 && !_filesOnly) { insertTitle(path()); + KConfig *c = KGlobal::config(); + c->setGroup("menus"); insertItem(CICON("kfm"), i18n("Open in File Manager"), this, TQT_SLOT(slotOpenFileManager())); - if (kapp->authorize("shell_access")) - insertItem(CICON("terminal"), i18n("Open in Terminal"), this, TQT_SLOT(slotOpenTerminal())); + if (kapp->authorize("shell_access") && c->readBoolEntry("kickerOpenInTerminalIsVisible",false)) + insertItem(CICON("terminal"), i18n("Open in Terminal"), this, TQT_SLOT(slotOpenTerminal())); + insertSeparator(); } - bool first_entry = true; bool dirfile_separator = false; unsigned int item_count = 0; diff --git a/kicker/kicker/ui/service_mnu.cpp b/kicker/kicker/ui/service_mnu.cpp index fa18a7038..3042eddfe 100644 --- a/kicker/kicker/ui/service_mnu.cpp +++ b/kicker/kicker/ui/service_mnu.cpp @@ -114,6 +114,11 @@ void PanelServiceMenu::fillMenu(KServiceGroup::Ptr& _root, TQStringList suppressGenericNames = _root->suppressGenericNames(); KServiceGroup::List::ConstIterator it = _list.begin(); + KSortableValueList,TQCString> slist; + KSortableValueList,TQCString> glist; + TQMap specialTitle; + TQMap categoryIcon; + bool separatorNeeded = false; for (; it != _list.end(); ++it) { @@ -121,19 +126,108 @@ void PanelServiceMenu::fillMenu(KServiceGroup::Ptr& _root, if (e->isType(KST_KServiceGroup)) { + KServiceGroup::Ptr g(static_cast(e)); + if ( KickerSettings::reduceMenuDepth() && g->SuSEshortMenu() ){ + KServiceGroup::List l = g->entries(true, excludeNoDisplay_ ); + if ( l.count() == 1 ) { + // the special case, we want to short the menu. + // TOFIX? : this works only for one level + KServiceGroup::List::ConstIterator _it=l.begin(); + KSycocaEntry *_e = *_it; + if (_e->isType(KST_KService)) { + KService::Ptr s(static_cast(_e)); + TQString key; + if ( g->SuSEgeneralDescription() ) { + // we use the application name + key = s->name(); + if( !s->genericName().isEmpty()) { + if (KickerSettings::menuEntryFormat() == KickerSettings::NameAndDescription) + key = s->name() + " (" + s->genericName() + ")"; + else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionAndName) + key = s->genericName() + " (" + s->name() + ")"; + else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionOnly) + key = s->genericName(); + } + } + else { + // we use the normal menu description + key = s->name(); + if( !s->genericName().isEmpty()) { + if (KickerSettings::menuEntryFormat() == KickerSettings::NameAndDescription) + key = s->name() + " (" + g->caption() + ")"; + else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionAndName) + key = g->caption() + " (" + s->name() + ")"; + else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionOnly) + key = g->caption(); + } + } + specialTitle.insert( _e->name(), key ); + categoryIcon.insert( _e->name(), g->icon() ); + slist.insert( key.local8Bit(), _e ); + // and escape from here + continue; + } + } + } + glist.insert( g->caption().local8Bit(), e ); + }else if( e->isType(KST_KService)) { + KService::Ptr s(static_cast(e)); + TQString name = s->name(); + if( !s->genericName().isEmpty()) { + if (KickerSettings::menuEntryFormat() == KickerSettings::NameAndDescription) + name = s->name() + " (" + s->genericName() + ")"; + else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionAndName) + name = s->genericName() + " (" + s->name() + ")"; + else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionOnly) + name = s->genericName(); + } + slist.insert( name.local8Bit(), e ); + } else + slist.insert( e->name().local8Bit(), e ); + } + + _list = _root->SuSEsortEntries( slist, glist, excludeNoDisplay_, true ); + it = _list.begin(); + + for (; it != _list.end(); ++it) { + KSycocaEntry * e = *it; + + if (e->isType(KST_KServiceGroup)) { KServiceGroup::Ptr g(static_cast(e)); + if ( KickerSettings::reduceMenuDepth() && g->SuSEshortMenu() ){ + KServiceGroup::List l = g->entries(true, excludeNoDisplay_ ); + if ( l.count() == 1 ) { + /* // the special case, we want to short the menu. + // TOFIX? : this works only for one level + KServiceGroup::List::ConstIterator _it=l.begin(); + KSycocaEntry *_e = *_it; + if (_e->isType(KST_KService)) { + KService::Ptr s(static_cast(_e)); + if ( g->SuSEgeneralDescription() ) + // we use the application name + insertMenuItem(s, id++, -1, 0, TQString::null, TQString::null, g->icon() ); + else + // we use the normal menu description + insertMenuItem(s, id++, -1, 0, TQString::null, g->caption(), g->icon() ); + // and escape from here */ + continue; + // } + } + } + // standard sub menu + TQString groupCaption = g->caption(); - + // Avoid adding empty groups. KServiceGroup::Ptr subMenuRoot = KServiceGroup::group(g->relPath()); - + int nbChildCount = subMenuRoot->childCount(); if (nbChildCount == 0 && !g->showEmptyMenu()) - { + { continue; - } - + } + TQString inlineHeaderName = g->showInlineHeader() ? groupCaption : ""; // Item names may contain ampersands. To avoid them being converted // to accelerators, replace them with two ampersands. @@ -156,7 +250,8 @@ void PanelServiceMenu::fillMenu(KServiceGroup::Ptr& _root, } KService::Ptr s(static_cast(e1)); - insertMenuItem(s, id++, -1, &suppressGenericNames); +// insertMenuItem(s, id++, -1, &suppressGenericNames); + insertMenuItem(s, id++, -1, &suppressGenericNames, TQString::null, specialTitle[s->name()], categoryIcon[s->name()] ); continue; } } @@ -222,7 +317,8 @@ void PanelServiceMenu::fillMenu(KServiceGroup::Ptr& _root, KService::Ptr s(static_cast(e)); searchMenuItems.insert(id); - insertMenuItem(s, id++, -1, &suppressGenericNames); +// insertMenuItem(s, id++, -1, &suppressGenericNames); + insertMenuItem(s, id++, -1, &suppressGenericNames, TQString::null, specialTitle[s->name()], categoryIcon[s->name()] ); } else if (e->isType(KST_KServiceSeparator)) { @@ -304,7 +400,8 @@ void PanelServiceMenu::configChanged() void PanelServiceMenu::insertMenuItem(KService::Ptr & s, int nId, int nIndex/*= -1*/, const TQStringList *suppressGenericNames /* = 0 */, - const TQString & aliasname) + const TQString & aliasname, const TQString & label /*=TQString::NULL*/, + const TQString & categoryIcon /*=TQString::null*/) { TQString serviceName = (aliasname.isEmpty() ? s->name() : aliasname).simplifyWhiteSpace(); TQString comment = s->genericName().simplifyWhiteSpace(); @@ -355,7 +452,15 @@ void PanelServiceMenu::insertMenuItem(KService::Ptr & s, int nId, // to accelerators, replace them with two ampersands. serviceName.replace("&", "&&"); - int newId = insertItem(KickerLib::menuIconSet(s->icon()), serviceName, nId, nIndex); + TQString icon = s->icon(); + if (icon=="unknown") + icon = categoryIcon; + + int newId; + if ( label.isEmpty() ) + newId = insertItem(KickerLib::menuIconSet(s->icon()), serviceName, nId, nIndex); + else + newId = insertItem(KickerLib::menuIconSet(s->icon()), label, nId, nIndex); entryMap_.insert(newId, static_cast(s)); } diff --git a/kicker/kicker/ui/service_mnu.h b/kicker/kicker/ui/service_mnu.h index 193e4faf8..44e35a6c2 100644 --- a/kicker/kicker/ui/service_mnu.h +++ b/kicker/kicker/ui/service_mnu.h @@ -89,7 +89,8 @@ protected slots: protected: void insertMenuItem(KService::Ptr & s, int nId, int nIndex = -1, const TQStringList *suppressGenericNames=0, - const TQString &aliasname = TQString::null); + const TQString &aliasname = TQString::null, + const TQString &label = TQString::null, const TQString &categoryIcon = TQString::null); virtual PanelServiceMenu * newSubMenu(const TQString & label, const TQString & relPath, TQWidget * parent, const char * name, diff --git a/kicker/libkicker/kickerSettings.kcfg b/kicker/libkicker/kickerSettings.kcfg index ff86c8431..6f7f2427e 100644 --- a/kicker/libkicker/kickerSettings.kcfg +++ b/kicker/libkicker/kickerSettings.kcfg @@ -126,6 +126,11 @@ true + + + false + + 0 -- cgit v1.2.1