Mailinglist Archive: yast-commit (1056 mails)

< Previous Next >
[yast-commit] r44181 - in /branches/tmp/tgoettlicher/yast2_2nd_rewrite: ./ systemsettings/ systemsettings/categories/
  • From: tgoettlicher@xxxxxxxxxxxxxxxx
  • Date: Wed, 06 Feb 2008 10:56:53 -0000
  • Message-id: <20080206105654.34BC424058@xxxxxxxxxxxxxxxx>
Author: tgoettlicher
Date: Wed Feb 6 11:56:53 2008
New Revision: 44181

URL: http://svn.opensuse.org/viewcvs/yast?rev=44181&view=rev
Log:
initial checkin

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/CMakeLists.txt
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/AUTHOR
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/CMakeLists.txt
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/HACKING
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/LAYOUT.html
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/Messages.sh
(with props)
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/TODO
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/CMakeLists.txt

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-about-me.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-accessibility.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-advanced-user-settings.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-advanced.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-appearance.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-bluetooth.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-computer-administration.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-desktop.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-display.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-general.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-keyboard-and-mouse.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-look-and-feel.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-network-and-connectivity.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-network-settings.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-notifications.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-personal.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-regional-and-language.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-sharing.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-system.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-window-behaviour.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/systemsettingscategory.desktop

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel.cpp

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel.h

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel_p.h

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview.cpp

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview.h

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview_p.h

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorydrawer.cpp
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorydrawer.h
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmodulemodel.cpp
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmodulemodel.h
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmultiwidget.h

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kicongrouppage.cpp
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kicongrouppage.h
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/main.cpp
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/mainwindow.cpp
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/mainwindow.h
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/menuitem.cpp
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/menuitem.h

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/moduleiconitem.cpp
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/moduleiconitem.h
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/modulesview.cpp
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/modulesview.h

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettings.desktop
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettingsrc

branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettingsui.rc
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/version.h

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/CMakeLists.txt
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/CMakeLists.txt?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/CMakeLists.txt (added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/CMakeLists.txt Wed Feb 6
11:56:53 2008
@@ -0,0 +1,96 @@
+project(KDEBASE_WORKSPACE)
+
+# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is
checked
+set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules )
+
+
+#search packages used by KDE
+find_package(KDE4 REQUIRED)
+find_package(Strigi REQUIRED)
+find_package(Blitz REQUIRED)
+
+macro_optional_find_package(USB)
+macro_optional_find_package(Fontconfig)
+macro_optional_find_package(OpenGL)
+
+include (MacroLibrary)
+include (KDE4Defaults)
+
+macro_optional_find_package(OpenGL)
+
+include(ConfigureChecks.cmake)
+configure_file(config-unix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-unix.h )
+configure_file(config-X11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-X11.h )
+configure_file (config-workspace.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config-workspace.h )
+configure_file (startkde.cmake ${CMAKE_CURRENT_BINARY_DIR}/startkde @ONLY)
+
+add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS} -DHAVE_CONFIG_H=1)
+include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${KDE4_INCLUDES})
+
+set( backgroundlib_SRCS
+ ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgrender.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgsettings.cpp
+)
+
+set( kcmbackgroundlib_SRCS
+ ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgdialog.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgadvanced.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgmonitor.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/kcontrol/kdm/background/bgwallpaper.cpp
+)
+
+include_directories(
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_SOURCE_DIR}/kdm
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs
+ ${CMAKE_CURRENT_SOURCE_DIR}/libs/kworkspace
+)
+# libs
+add_subdirectory(cmake)
+add_subdirectory(libs)
+
+# system settings (kcontrol replacement)
+add_subdirectory( systemsettings )
+
+# core apps
+add_subdirectory( kcheckpass )
+add_subdirectory( kscreensaver )
+add_subdirectory( solid )
+add_subdirectory( ksmserver )
+add_subdirectory( kcminit )
+add_subdirectory( ksplash )
+add_subdirectory( ksysguard )
+add_subdirectory( ktip )
+add_subdirectory( klipper )
+add_subdirectory( kmenuedit )
+add_subdirectory( krunner )
+add_subdirectory( kwin )
+add_subdirectory( plasma )
+add_subdirectory( kstartupconfig )
+
+
+add_subdirectory( khotkeys )
+
+# apps we need to figure out what to do with
+add_subdirectory( kcontrol )
+add_subdirectory( ksystraycmd )
+
+# data
+add_subdirectory( doc )
+add_subdirectory( wallpapers )
+add_subdirectory( menu )
+
+if(X11_Xau_FOUND AND X11_Xdmcp_FOUND)
+ add_subdirectory( kdm )
+else(X11_Xau_FOUND AND X11_Xdmcp_FOUND)
+ MESSAGE(STATUS "Xau lib or Xdmcp lib was missing. kdm will not compile")
+endif(X11_Xau_FOUND AND X11_Xdmcp_FOUND)
+
+SET(krunner_DEPENDS "plasma")
+
+########### install files ###############
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/startkde DESTINATION
${BIN_INSTALL_DIR})
+
+if(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
+ macro_display_feature_log()
+endif(CMAKE_SOURCE_DIR STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/AUTHOR
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/AUTHOR?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/AUTHOR (added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/AUTHOR Wed Feb
6 11:56:53 2008
@@ -0,0 +1 @@
+Benjamin Charles Meyer < ben + systempreferences at meyerhome dot net >

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/CMakeLists.txt
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/CMakeLists.txt?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/CMakeLists.txt
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/CMakeLists.txt
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,32 @@
+
+ADD_SUBDIRECTORY( categories )
+
+########### next target ###############
+
+SET(systemsettings_SRCS
+ kcmodulemodel.cpp
+ kcmultiwidget.cpp
+ main.cpp
+ mainwindow.cpp
+ menuitem.cpp
+ moduleiconitem.cpp
+ kcategorizedview.cpp
+ kcategorydrawer.cpp
+ )
+
+
+KDE4_ADD_EXECUTABLE(systemsettings ${systemsettings_SRCS})
+
+# Uses KIO for KRun and KUtils for KCModuleInfo
+TARGET_LINK_LIBRARIES(systemsettings ${KDE4_KUTILS_LIBS} ${KDE4_KIO_LIBS} )
+
+INSTALL( TARGETS systemsettings DESTINATION ${BIN_INSTALL_DIR})
+
+
+########### install files ###############
+
+install( FILES systemsettings.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
+install( FILES systemsettingsrc DESTINATION ${SYSCONF_INSTALL_DIR} )
+install( FILES systemsettingsui.rc DESTINATION
${DATA_INSTALL_DIR}/systemsettings )
+
+

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/HACKING
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/HACKING?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/HACKING (added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/HACKING Wed Feb
6 11:56:53 2008
@@ -0,0 +1,31 @@
+This is an overview of how the code is situated and a very brief overview of
what the classes do. See the header files for a more indepth overview of what
the classes do.
+
+-- System Settings classes --
+
+mainwindow - The KMainWindow contains KActions, the stack of the iconlist and
the current module(s) view.
+
+modulesview - The widget that is the icon view that users see when the first
enter the app.
+kcmsearch - Search widget that can search ModulesView and enable/disable items.
+
+modulesiconitem - The individual modules items. Used for loading
enabled/disabled images and storing the list of modules acosiated with the item.
+
+kcmodulemenu - Class that reads in a freedesktop.org .menu file into a
QValueList.
+
+kcmultiwidget - A basterdized kcmultidialog from kdelibs/kutil that provides
info about the current shown dialog so the about dialog and caption can be
updated and prompts for unsaved changes.
+
+-- INSTALL --
+
+To install a new menu you have to install three files.
+
+(if you have debian, if you have another system use locate to determine where
kde-system.* is installed and install in the same place.
+
+-/etc/xdg/menus/system-settings.menu
+-/etc/xdg/menus/applications-merged/system-settings-merge.menu
+-/usr/share/desktop-directories/system-settings.directory
+
+Also don't forget to install the ui file.
+-/share/apps/systemsettings/systempreferencesui.rc
+And the desktop file.
+-share/applications/kde/systemsettings.desktop
+
+When you change (or install) any of the first three files make sure to run
kbuildsycoca to re-generate the cache files or log out and back in.

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/LAYOUT.html
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/LAYOUT.html?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/LAYOUT.html
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/LAYOUT.html Wed
Feb 6 11:56:53 2008
@@ -0,0 +1,125 @@
+
+<h1>KDE System Settings</h1>
+
+<p>
+This document describes how the System Settings is layed out.
+
+<p>
+This document was inspired partially by the TODO file located at
kdebase/kcontrol/TODO. Most of the changed are the exact same and were planned
to be done for KDE4. This document is simply a little bit more fleshed out
version. I recomend checking out that document if you havn't already.
+
+<p>
+The reason for this document is:
+<p>
+1) To categorize the settings together in a user friendly manor.<br>
+2) To explain why a setting is where it is and to determine where new settings
should go.<br>
+3) Because of #2 stop the constant reorganization of KControl at every release
confusing users and developers because there isn't a documented location for
where thing go with explanations of why.
+<p>
+The System Settings Center is divided into four sections.
+<ul>
+<li><a href="#personal">Personal</a></li>
+<li><a href="#hardware">Hardware</a></li>
+<li><a href="#system">System</a></li>
+<li><a href="#other">Other</a></li>
+</ul>
+
+Within KDE there are over 50 kcm modules designed for the Control Center and
many more for konquror and other applications. With so many modules there is
no way for a users to find what they are looking for by scanning. To solve
this there are three levels, the last one isn't normally visable to the user
and groups very similar items.
+<p>
+Modules in the System Settings should configure things not do things. Some
examples include the theme manager. It sets/saves themes. Although it
configures settings it is a seperate application because it does actions rather
then just setting/getting values. Items that
+<p>
+Modules that exists within multiple applications configuration menu such as
spell check and cddb should not be in the menu.
+
+<hr>
+<a name="personal"><h1>Personal</h1></a>
+Personal is made up of two parts. The simplest differece between the two are
theme settings will be shared amung friends while users settings wont be.
+<ul>
+<li><a href="#personal_theme">Theme Goodies</a></li>
+<li><a href="#personal_user">User Settings</a></li>
+</ul>
+
+<h3><a name="personal_theme">Theme Goodies</a></h3> which can be changed
without affecting productivity and often doesn't directly apply to a specific
user, but to a user base (Theme of the month crowd).
+
+These deal with how applications are presented to users and how users interact
with them. These don't deal with anything that isn't directly seen/heard or
interacted with.
+<p>
+Every setting in this category must be able to be locked for example in an
government enviornment where they determine exactly how a desktop is to look
for every user. It may look ugly, but users should still be able to acomplish
tasks no matter what these settings are set to.
+<p>
+A separate application (Theme Manager) can set the items in this category on
mass to give an overall theme for the user. This application can also save the
current settings.
+
+<h3><a name="personal_user">User Settings</a></h3>
+Such as that apply to this computer such as language and personal choice for
default web browser. These settings determine how a user interacts with a
computer, but is personal to that user and typically isn't shared like a theme
or icons set is.
+
+<h2>Appearance</h2>
+The Appearance deals with the look of the applications and desktop. These
settings typically will be settings that can be replaced by alternatives
created outside of KDE. These settings will most likely be also set/used by
other Unix desktop enviornments so that all the applications can integration
together (and look consistant to the user). It contains the following
items:<br>
+Colors, Fonts, Icons, Style, Window Decorations
+
+<h2>Desktop</h2>
+These items discus how the desktop behaves. How the windows interact with
each other, the very bottom of the screen (desktop), the very top
(screensaver), and loading of the desktop. These are all separate setting from
KDE (or Gnome) applications and the applications shouldn't need to access them
or know about them.
+It contains the following items:<br>
+Background, Screensaver, Behavior, Window Behavior, Window-Specific Settings,
Login Screen
+<p>
+Panel.
+These settings all deal with when users perform actions dealing with or
originating from the panel. It contains the following items:<br>
+Panels, Taskbar, Launch Feedback, Multiple Desktops
+
+<h2>KDE Components</h2>
+Specific actuall KDE components which users will probably never actually
touch.
+
+<h2>Accessibility</h2>
+ - International
+ - KHotKeys etc
+
+<h2>Security</h2>
+-kdewallet
+
+<h2>Sound</h2>
+Sounds, flashes, logs or other events that happen when KDE applications.
+System Bell
+System Notifications
+
+<h2>User Account</h2>
+- Password changer, paths, Default Applications, Session Manager
+
+<hr>
+<a name="hardware"><h1>Hardware</h1></a>
+Hardware deals with physical hardware configuration. Configuration is not
only for the hardware, but the required supporting systems that use the
hardware.
+
+<h2>Network</h2>
+File Sharing
+Local Network Browsing
+Preferences / Proxy
+Wireless
+Firewall
+<h2>Display</h2>
+It contains the following items:<br>
+Size & Orientation, Gamma
+<h2>Power</h2>
+Display power control
+laptop battery, cpu temp etc
+<h2>Keyboard & Mouse</h2>
+Keyboard, Keyboard Layout, Keyboard Shortcuts, Mouse, KHotKeys
+<h2>Printer</h2>
+<h2>Joystick</h2>
+<h2>Audio</h2>
+Mixer, SoundSystem (arts)
+
+<hr>
+<a name="system"><h1>System</h1></a>
+System deals with settings relating to this computer.
+
+<h2>Date & Time</h2>
+Date, Time, Time zone
+
+<h2>Fonts</h2>
+
+<h2>Book Disk</h2>
+Lilo, Grub
+
+<h2>Packages</h2>
+System update / rpm manager etc
+
+<h2>Login Manager</h2>
+Login Manger
+
+<hr>
+<a name="other"><h1>Other</h1></a>
+A default KDE install should contain nothing here. If there is something here
than this document has failed and needs to be revised. Until that can happen
its temporary home is here. A user should never see this catagory.
+

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/Messages.sh
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/Messages.sh?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/Messages.sh
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/Messages.sh Wed
Feb 6 11:56:53 2008
@@ -0,0 +1,2 @@
+#! /usr/bin/env bash
+$XGETTEXT *.cpp -o $podir/systemsettings.pot

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/TODO
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/TODO?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/TODO (added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/TODO Wed Feb 6
11:56:53 2008
@@ -0,0 +1,23 @@
+Save to real config files.
+Module Help link
+Module Default/Reset link
+X Use tabs
+View Menu should list of all modules
+Remove "module" string
+Fix connection
+
+config icon sizes
+command line option to open in new window
+
+Modules
+-lilo _has_ to be spead up
+X -Date & Time icon should have a Clock
+-Samba needs a new icon
+-Remote needs a new icon
+
+Search
+-Make search smaller and on the right
+-Grep docs?
+-Tie into kconfigXT somehow?
+-Look at Spotlight
+-Task oriented?

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/CMakeLists.txt
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/CMakeLists.txt?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/CMakeLists.txt
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/CMakeLists.txt
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,25 @@
+
+install( FILES systemsettingscategory.desktop DESTINATION
${SERVICETYPES_INSTALL_DIR} )
+
+install( FILES
+ settings-advanced.desktop
+ settings-advanced-user-settings.desktop
+ settings-computer-administration.desktop
+ settings-display.desktop
+ settings-general.desktop
+ settings-look-and-feel.desktop
+ settings-network-and-connectivity.desktop
+ settings-personal.desktop
+ settings-system.desktop
+ settings-about-me.desktop
+ settings-accessibility.desktop
+ settings-appearance.desktop
+ settings-bluetooth.desktop
+ settings-desktop.desktop
+ settings-keyboard-and-mouse.desktop
+ settings-notifications.desktop
+ settings-regional-and-language.desktop
+ settings-sharing.desktop
+ settings-window-behaviour.desktop
+ settings-network-settings.desktop
+ DESTINATION ${SERVICES_INSTALL_DIR} )

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-about-me.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-about-me.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-about-me.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-about-me.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,59 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=about-me
+X-KDE-System-Settings-Parent-Category=personal
+Icon=preferences-desktop-user
+
+Name=About Me
+Name[ar]=نبذة عني
+Name[bg]=За мен
+Name[ca]=Quant a mi
+Name[da]=Om mig
+Name[de]=Persönliche Informationen
+Name[el]=Σχετικά με μένα
+Name[eo]=Pri mi
+Name[es]=Acerca de mí
+Name[et]=Isiklik info
+Name[eu]=Niri buruz
+Name[fa]=درباره من
+Name[fi]=Minä
+Name[fr]=À propos de moi
+Name[fy]=Ynfo oer my
+Name[ga]=Maidir Liomsa
+Name[gl]=Acerca de min
+Name[he]=אודותיי
+Name[hi]=मेरे बारे में
+Name[hu]=Névjegy
+Name[is]=Um mig
+Name[it]=Informazioni su di me
+Name[ja]=個人情報
+Name[kk]=Өзім туралы
+Name[km]=អំពី​ខ្ញុំ​
+Name[ko]=내 정보
+Name[ku]=Der barê min de
+Name[lv]=Par mani
+Name[nb]=Om meg
+Name[nds]=Brukerdaten
+Name[ne]=मेरो बारेमा
+Name[nl]=Info over mij
+Name[nn]=Om meg
+Name[oc]=A prepaus de ieu
+Name[pa]=ਮੇਰੇ ਬਾਰੇ
+Name[pl]=O mnie
+Name[pt]=Acerca de Mim
+Name[pt_BR]=Sobre Eu
+Name[ru]=Личные данные
+Name[se]=Iežan dieđut
+Name[sl]=O meni
+Name[sr]=О мени
+Name[sr@latin]=O meni
+Name[sv]=Om mig
+Name[tg]=Дар бораи ман
+Name[th]=เกี่ยวกับฉัน
+Name[tr]=Hakkımda
+Name[uk]=Про мене
+Name[wa]=Åd fwait d' mi
+Name[x-test]=xxAbout Mexx
+Name[zh_CN]=关于我自己
+Name[zh_TW]=關於我

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-accessibility.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-accessibility.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-accessibility.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-accessibility.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,78 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=accessibility
+X-KDE-System-Settings-Parent-Category=personal
+Icon=preferences-desktop-accessibility
+
+Name=Accessibility
+Name[af]=Toeganklikheid
+Name[ar]=إتاحة الوصول
+Name[be]=Даступнасць
+Name[bg]=Равностоен достъп
+Name[bn]=সহায়ক প্রযুক্তি
+Name[br]=Haezadusted
+Name[ca]=Accessibilitat
+Name[cs]=Zpřístupnění
+Name[csb]=Pòmòce przëstãpù
+Name[cy]=Hygyrchedd
+Name[da]=Tilgængelighed
+Name[de]=Zugangshilfen
+Name[el]=Προσιτότητα
+Name[eo]=Alirebleco
+Name[es]=Accesibilidad
+Name[et]=Hõlbustus
+Name[eu]=Erabilerraztasuna
+Name[fa]=دستیابی‌پذیری
+Name[fi]=Esteettömyys
+Name[fr]=Accessibilité
+Name[fy]=Tagonklikens
+Name[ga]=Inrochtaineacht
+Name[gl]=Acesibilidade
+Name[he]=נגישות
+Name[hi]=पहुँच
+Name[hr]=Pristupačnost
+Name[hu]=Kezelési segítség
+Name[is]=Aðgengi
+Name[it]=Accessibilità
+Name[ja]=アクセシビリティ
+Name[ka]=სპეციალური შესაძლბლობები
+Name[kk]=Арнайы мүмкіндіктер
+Name[km]=មធ្យោបាយ​ងាយស្រួល
+Name[kn]=ನಿಲುಕಣೆ (ಆಕ್ಸೆಸಿಬಿಲಿಟಿ)
+Name[ko]=내게 필요한 설정
+Name[lt]=Prieinamumas
+Name[lv]=Pieejamība
+Name[mk]=Пристапливост
+Name[ms]=Kebolehcapaian
+Name[nb]=Tilgjengelighet
+Name[nds]=Behinnertenhülp
+Name[ne]=पहुँचता
+Name[nl]=Toegankelijkheid
+Name[nn]=Tilgjenge
+Name[oc]=Accessibilitat
+Name[pa]=ਸਹੂਲਤਾਂ
+Name[pl]=Dostępność
+Name[pt]=Acessibilidade
+Name[pt_BR]=Acessibilidade
+Name[ro]=Accesibilitate
+Name[ru]=Специальные возможности
+Name[se]=Álkkibut geavaheapmi
+Name[sk]=Prístupnosť
+Name[sl]=Dostopnost
+Name[sr]=Приступачност
+Name[sr@latin]=Pristupačnost
+Name[sv]=Handikappstöd
+Name[ta]=அணுகல்
+Name[te]=అందుబాటు
+Name[tg]=Тавонёбӣ
+Name[th]=ตัวช่วยในการใช้งาน
+Name[tr]=Erişilebilirlik
+Name[uk]=Доступність
+Name[uz]=Қулайликлар
+Name[vi]=Khả năng truy cập
+Name[wa]=Accessibilité
+Name[x-test]=xxAccessibilityxx
+Name[xh]=Unikezelo
+Name[zh_CN]=辅助
+Name[zh_TW]=無障礙輔助

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-advanced-user-settings.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-advanced-user-settings.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-advanced-user-settings.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-advanced-user-settings.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,61 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=advanced-user-settings
+X-KDE-System-Settings-Parent-Category=advanced
+Icon=system-users
+
+Name=Advanced User Settings
+Name[ar]=إعدادات المستخدم المتقدمة
+Name[be]=Адмысловыя настаўленні карыстальніка
+Name[bg]=Настройване предпазителя на екрана
+Name[ca]=Paràmetres avançats d'usuari
+Name[csb]=Awansowóné nastôwë brëkòwników
+Name[da]=Avanceret brugeropsætning
+Name[de]=Erweiterte Benutzereinstellungen
+Name[el]=Προχωρημένες ρυθμίσεις χρήστη
+Name[eo]=Plia uzantagordo
+Name[es]=Preferencias para usuarios avanzados
+Name[et]=Muud kasutaja seadistused
+Name[eu]=Erabiltzaile aurreratu ezarpenak
+Name[fa]=تنظیمات کاربر پیشرفته
+Name[fi]=Edistyneen käyttäjän asetukset
+Name[fr]=Configuration avancée de l'utilisateur
+Name[fy]=Avansearre brûkers ynstellings
+Name[ga]=Ardsocruithe Úsáideora
+Name[gl]=Configuración avanzada do usuario
+Name[he]=הגדרות משתמש מתקדמות
+Name[hi]=उन्नत उपयोक्ता विन्यास
+Name[hr]=Napredne korisničke postavke
+Name[hu]=Speciális beállítások
+Name[is]=Frekari stillingar notanda
+Name[it]=Impostazioni utente avanzate
+Name[ja]=詳細なユーザ設定
+Name[kk]=Тәжірибелі пайдаланушының
параметрлері
+Name[km]=ការ​កំណត់​អ្នកប្រើ​កម្រិត​ខ្ពស់
+Name[ko]=고급 사용자 설정
+Name[lv]=Paplašināti lietotāja iestatījumi
+Name[nb]=Avanserte brukerinnstillinger
+Name[nds]=Verwiedert Brukerinstellen
+Name[ne]=उन्नत प्रयोगकर्ता सेटिङ
+Name[nl]=Uitgebreide instellingen
+Name[nn]=Avanserte brukarinnstillingar
+Name[oc]=Paramètres personalizats avançats
+Name[pa]=ਤਕਨੀਕੀ ਯੂਜ਼ਰ ਸੈਟਿੰਗ
+Name[pl]=Zaawansowane ustawienia użytkownika
+Name[pt]=Configuração Avançada do Utilizador
+Name[pt_BR]=Configurações Avançadas do Usuário
+Name[ru]=Дополнительные параметры
+Name[se]=Erenoamáš geavaheaddjiheivehusat
+Name[sl]=Napredne nastavitve uporabnika
+Name[sr]=Напредне корисничке поставке
+Name[sr@latin]=Napredne korisničke postavke
+Name[sv]=Avancerade användarinställningar
+Name[tg]=Танзимотҳои корбари пешрафта
+Name[th]=การตั้งค่าผู้ใช้เพิ่มเติม
+Name[tr]=Gelişmiş Kullanıcı Ayarları
+Name[uk]=Додаткові користувацькі параметри
+Name[wa]=Sipepieus apontiaedjes di l' uzeu
+Name[x-test]=xxAdvanced User Settingsxx
+Name[zh_CN]=高级用户设置
+Name[zh_TW]=進階使用者設定

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-advanced.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-advanced.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-advanced.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-advanced.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,77 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-Weight=200
+X-KDE-System-Settings-Category=advanced
+X-KDE-System-Settings-Parent-Category=
+
+Name=Advanced
+Name[af]=Gevorderde
+Name[ar]=متقدم
+Name[be]=Асаблівы
+Name[bg]=Допълнителни
+Name[bn]=অগ্রসর
+Name[br]=Barek
+Name[ca]=Avançat
+Name[cs]=Pokročilé
+Name[csb]=Awansowóné
+Name[cy]=Uwch
+Name[da]=Avanceret
+Name[de]=Erweitert
+Name[el]=Για προχωρημένους
+Name[eo]=Pliaj
+Name[es]=Avanzado
+Name[et]=Muu
+Name[eu]=Aurreratua
+Name[fa]=پیشرفته
+Name[fi]=Lisäasetukset
+Name[fr]=Avancé
+Name[fy]=Avansearre
+Name[ga]=Casta
+Name[gl]=Avanzado
+Name[he]=מתקדם
+Name[hi]=विस्तृत
+Name[hr]=Napredno
+Name[hu]=Speciális
+Name[is]=Ítarlegt
+Name[it]=Avanzate
+Name[ja]=詳細
+Name[ka]=დამატებით
+Name[kk]=Қосымша
+Name[km]=កម្រិត​ខ្ពស់
+Name[kn]=ಪ್ರೌಢ
+Name[ko]=고급
+Name[ku]=Pêşketî
+Name[lt]=Sudėtingiau
+Name[lv]=Paplašināti
+Name[mk]=Напредни
+Name[ms]=Lanjutan
+Name[nb]=Avansert
+Name[nds]=Verwiedert
+Name[ne]=उन्नत
+Name[nl]=Geavanceerd
+Name[nn]=Avansert
+Name[oc]=A_vançat
+Name[pa]=ਤਕਨੀਕੀ
+Name[pl]=Zaawansowane
+Name[pt]=Avançado
+Name[pt_BR]=Avançados
+Name[ro]=Avansat
+Name[ru]=Дополнительно
+Name[se]=Viiddiduvvon
+Name[sk]=Pokročilé
+Name[sl]=Napredno
+Name[sr]=Напредно
+Name[sr@latin]=Napredno
+Name[sv]=Avancerat
+Name[ta]=உயர்நிலை
+Name[tg]=Пешрафта
+Name[tr]=Gelişmiş
+Name[uk]=Додатково
+Name[uz]=Қўшимча
+Name[vi]=Nâng cao
+Name[wa]=Sipepieus
+Name[x-test]=xxAdvancedxx
+Name[xh]=Ebhekisa phambili
+Name[zh_CN]=高级
+Name[zh_TW]=進階

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-appearance.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-appearance.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-appearance.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-appearance.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,78 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=appearance
+X-KDE-System-Settings-Parent-Category=look-and-feel
+Icon=preferences-desktop-theme
+
+Name=Appearance
+Name[af]=Voorkoms
+Name[ar]=المظهر
+Name[be]=Вонкавы выгляд
+Name[bg]=Системен панел
+Name[bn]=চেহারা
+Name[br]=Neuziadur
+Name[ca]=Aparença
+Name[cs]=Vzhled
+Name[csb]=Wëzdrzatk
+Name[cy]=Golwg
+Name[da]=Udseende
+Name[de]=Erscheinungsbild
+Name[el]=Εμφάνιση
+Name[eo]=Aspekto
+Name[es]=Aspecto
+Name[et]=Välimus
+Name[eu]=Itxura
+Name[fa]=ظاهر
+Name[fi]=Ulkonäkö
+Name[fr]=Apparence
+Name[fy]=Uterlik
+Name[ga]=Cuma
+Name[gl]=Aparencia
+Name[he]=מראה
+Name[hi]=रूप
+Name[hr]=Izgled
+Name[hu]=Megjelenés
+Name[is]=Útlit
+Name[it]=Aspetto
+Name[ja]=外観
+Name[ka]=გარეგნობა
+Name[kk]=Көрініс
+Name[km]=រូបរាង
+Name[kn]=ಸ್ವರೂಪ
+Name[ko]=모양
+Name[ku]=Xuyanî
+Name[lt]=Išvaizda
+Name[lv]=Izskats
+Name[mk]=Изглед
+Name[ms]=Rupa
+Name[nb]=Utseende
+Name[nds]=Utsehn
+Name[ne]=देखावट
+Name[nl]=Uiterlijk
+Name[nn]=Utsjånad
+Name[oc]=Aparéncia
+Name[pa]=ਦਿੱਖ
+Name[pl]=Wygląd
+Name[pt]=Aparência
+Name[pt_BR]=Aparência
+Name[ro]=Aspect
+Name[ru]=Внешний вид
+Name[se]=Fárda
+Name[sk]=Vzhľad
+Name[sl]=Videz
+Name[sr]=Изглед
+Name[sr@latin]=Izgled
+Name[sv]=Utseende
+Name[ta]=தோற்றம்
+Name[tg]=Намуди зоҳирӣ
+Name[th]=รูปลักษณ์
+Name[tr]=Görünüm
+Name[uk]=Вигляд
+Name[uz]=Ташқи кўриниш
+Name[vi]=Diện mạo
+Name[wa]=Rivnance
+Name[x-test]=xxAppearancexx
+Name[xh]=Inkangeleko
+Name[zh_CN]=外观
+Name[zh_TW]=外觀

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-bluetooth.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-bluetooth.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-bluetooth.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-bluetooth.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,22 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=bluetooth
+X-KDE-System-Settings-Parent-Category=network-and-connectivity
+Icon=preferences-system-bluetooth
+
+Name=Bluetooth
+Name[ar]=بلوتوث
+Name[fa]=بلوتوث
+Name[hi]=ब्लूटूथ
+Name[is]=Blátönn
+Name[km]=ប៊្លូសធូស
+Name[ko]=블루투스
+Name[ne]=ब्लुटुथ
+Name[pa]=ਬਲਿਊਟੁੱਥ
+Name[sr]=Блутут
+Name[sv]=Blåtand
+Name[th]=บลูทูธ
+Name[x-test]=xxBluetoothxx
+Name[zh_CN]=蓝牙
+Name[zh_TW]=藍芽

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-computer-administration.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-computer-administration.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-computer-administration.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-computer-administration.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,61 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=computer-administration
+X-KDE-System-Settings-Parent-Category=general
+X-KDE-Weight=200
+Icon=preferences-system
+
+Name=Computer Administration
+Name[ar]=إدارة الحاسوب
+Name[be]=Адміністраванне камп'ютэру
+Name[bg]=Администрация
+Name[ca]=Administració de l'ordinador
+Name[csb]=Sprôwianié systemą
+Name[da]=Computeradministration
+Name[de]=Systemverwaltung
+Name[el]=Διαχείριση συστήματος
+Name[eo]=Komputila administrado
+Name[es]=Administración del equipo
+Name[et]=Arvuti haldamine
+Name[eu]=Sistemaren kudeaketa
+Name[fa]=سرپرستی رایانه
+Name[fi]=Järjestelmän hallinta
+Name[fr]=Administration de l'ordinateur
+Name[fy]=Kompjûter administraasje
+Name[ga]=Riarachán an Ríomhaire
+Name[gl]=Administración do ordenador
+Name[he]=ניהול המחשב
+Name[hi]=कम्प्यूटर प्रशासन
+Name[hr]=Administracija računala
+Name[hu]=Számítógépkezelő
+Name[is]=Kerfisstjórnun
+Name[it]=Amministrazione del computer
+Name[ja]=コンピュータの管理
+Name[kk]=Компьютерді қадағалау
+Name[km]=កា​រគ្រប់គ្រង​កុំព្យូទ័រ​
+Name[ko]=컴퓨터 관리
+Name[lv]=Datora administrācija
+Name[nb]=Administrasjon av maskinen
+Name[nds]=Systeempleeg
+Name[ne]=कम्प्युटर प्रशासन
+Name[nl]=Computerbeheer
+Name[nn]=Systemadministrasjon
+Name[pa]=ਕੰਪਿਊਟਰ ਪਰਸ਼ਾਸ਼ਨ
+Name[pl]=Administracja systemu
+Name[pt]=Administração do Computador
+Name[pt_BR]=Administração do Computador
+Name[ru]=Системное администрирование
+Name[se]=Vuogádathálddašeapmi
+Name[sl]=Sistemsko upravljanje
+Name[sr]=Администрација рачунара
+Name[sr@latin]=Administracija računara
+Name[sv]=Datoradministration
+Name[tg]=Мудири компютер
+Name[th]=การดูแลระบบคอมพิวเตอร์
+Name[tr]=Sistem Yönetimi
+Name[uk]=Адміністрування комп'ютера
+Name[wa]=Manaedjmint del copiutrece
+Name[x-test]=xxComputer Administrationxx
+Name[zh_CN]=计算机管理
+Name[zh_TW]=電腦管理

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-desktop.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-desktop.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-desktop.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-desktop.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,76 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=desktop
+X-KDE-System-Settings-Parent-Category=look-and-feel
+Icon=preferences-desktop
+
+Name=Desktop
+Name[af]=Werkskerm
+Name[ar]=سطح المكتب
+Name[be]=Працоўны стол
+Name[bg]=Работен плот
+Name[bn]=ডেস্কটপ
+Name[br]=Gorretaol
+Name[ca]=Escriptori
+Name[cs]=Pracovní plocha
+Name[csb]=Pùlt
+Name[cy]=Penbwrdd
+Name[de]=Arbeitsfläche
+Name[el]=Επιφάνεια εργασίας
+Name[eo]=Labortablo
+Name[es]=Escritorio
+Name[et]=Töölaud
+Name[eu]=Mahaigaina
+Name[fa]=رومیزی
+Name[fi]=Työpöytä
+Name[fr]=Bureau
+Name[fy]=Buroblêd
+Name[ga]=Deasc
+Name[gl]=Escritorio
+Name[he]=שולחן עבודה
+Name[hi]=डेस्कटॉप
+Name[hr]=Radna površina
+Name[hu]=Munkaasztal
+Name[is]=Skjáborð
+Name[ja]=デスクトップ
+Name[ka]=სამუშაო დაფა
+Name[kk]=Жұмыс үстелі
+Name[km]=ផ្ទៃតុ
+Name[kn]=ಗಣಕತೆರೆ
+Name[ko]=데스크톱
+Name[ku]=Sermasê
+Name[lt]=Darbastalis
+Name[lv]=Darbvirsma
+Name[mk]=Работна површина
+Name[ms]=Ruang Kerja
+Name[nb]=Skrivebord
+Name[nds]=Schriefdisch
+Name[ne]=डेस्कटप
+Name[nl]=Bureaublad
+Name[nn]=Skrivebord
+Name[oc]=Burèu
+Name[pa]=ਡੈਸਕਟਾਪ
+Name[pl]=Pulpit
+Name[pt]=Ambiente de Trabalho
+Name[pt_BR]=Área de Trabalho
+Name[ru]=Рабочий стол
+Name[se]=Čállinbeavdi
+Name[sk]=Plocha
+Name[sl]=Namizje
+Name[sr]=Радна површ
+Name[sr@latin]=Radna površ
+Name[sv]=Skrivbord
+Name[ta]=மேல்மேசை
+Name[te]=రంగస్ఠలం
+Name[tg]=Мизи корӣ
+Name[th]=พื้นที่ทำงาน
+Name[tr]=Masaüstü
+Name[uk]=Стільниця
+Name[uz]=Иш столи
+Name[vi]=Màn hình nền
+Name[wa]=Sicribanne
+Name[x-test]=xxDesktopxx
+Name[zh_CN]=桌面
+Name[zh_TW]=桌面
+

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-display.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-display.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-display.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-display.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,143 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=display
+X-KDE-System-Settings-Parent-Category=computer-administration
+Icon=preferences-desktop-display
+
+Name=Display
+Name[af]=Skerm
+Name[ar]=العرض
+Name[be]=Экран
+Name[bg]=Монитор
+Name[bn]=ডিসপ্লে
+Name[br]=Diskwel
+Name[ca]=Pantalla
+Name[cs]=Obrazovka
+Name[csb]=Ekran
+Name[cy]= Arddangos
+Name[da]=Skærm
+Name[de]=Anzeige
+Name[el]=Οθόνη
+Name[eo]=Vidigilo
+Name[es]=Pantalla
+Name[et]=Monitor
+Name[eu]=Pantaila
+Name[fa]=نمایش
+Name[fi]=Näyttö
+Name[fr]=Affichage
+Name[fy]=Byldskerm
+Name[ga]=Scáileán
+Name[gl]=Pantalla
+Name[he]=תצוגה
+Name[hi]=प्रदर्शक
+Name[hr]=Zaslon
+Name[hu]=Képernyő
+Name[is]=Skjár
+Name[ja]=ディスプレイ
+Name[ka]=ჩვენება
+Name[kk]=Дисплей
+Name[km]=ការ​បង្ហាញ
+Name[kn]=ಪ್ರದರ್ಶಿಸು
+Name[ko]=디스플레이
+Name[lt]=Ekranas
+Name[lv]=Ekrāns
+Name[mk]=Приказ
+Name[ms]=Paparan
+Name[nb]=Skjerm
+Name[nds]=Dorstellen
+Name[ne]=प्रदर्शन गर्नुहोस्
+Name[nl]=Beeldscherm
+Name[nn]=Skjerm
+Name[oc]=Visualizar
+Name[pa]=ਡਿਸਪਲੇਅ
+Name[pl]=Ekran
+Name[pt]=Ecrã
+Name[pt_BR]=Tela
+Name[ro]=Monitor
+Name[ru]=Дисплей
+Name[se]=Å earbma
+Name[sk]=Displej
+Name[sl]=Zaslon
+Name[sr]=Екран
+Name[sr@latin]=Ekran
+Name[sv]=Bildskärm
+Name[ta]=காட்சி
+Name[tg]=Намоиш
+Name[th]=การแสดงผล
+Name[tr]=Görüntü
+Name[uk]=Дисплей
+Name[uz]=Дисплей
+Name[vi]=Màn hình
+Name[wa]=HÃ¥ynaedje
+Name[x-test]=xxDisplayxx
+Name[zh_CN]=显示
+Name[zh_TW]=顯示
+Comment=Display Settings
+Comment[af]=Skerm Instellings
+Comment[ar]=إعدادات العرض
+Comment[be]=Настаўленні экрану
+Comment[bg]=Настройване на екрана
+Comment[bn]=ডিসপ্লে সেটিংস
+Comment[br]=Kefluniañ an diskwel
+Comment[ca]=Arranjament de la pantalla
+Comment[cs]=Nastavení obrazovky
+Comment[csb]=Ùstôw ekranu
+Comment[cy]=Gosodiadau Arddangos
+Comment[da]=Opsætning af skærm
+Comment[de]=Anzeige-Einstellungen
+Comment[el]=Ρυθμίσεις οθόνης
+Comment[eo]=Vidigila agordo
+Comment[es]=Preferencias de la pantalla
+Comment[et]=Monitoride seadistused
+Comment[eu]=Pantailaren konfigurazioa
+Comment[fa]=نمایش تنظیمات
+Comment[fi]=Näytön asetukset
+Comment[fr]=Paramètres d'affichage
+Comment[fy]=Byldskerm ynstellings
+Comment[ga]=Socruithe an Scáileáin
+Comment[gl]=Configuración da pantalla
+Comment[he]=הגדרות תצוגה
+Comment[hi]=प्रकटन विन्यास
+Comment[hr]=Postavke zaslona
+Comment[hu]=Képernyőbeállítások
+Comment[is]=Stillingar skjás
+Comment[it]=Impostazioni del display
+Comment[ja]=ディスプレイの設定
+Comment[ka]=დისპლეის კონფიგურირება
+Comment[kk]=Дисплей баптаулары
+Comment[km]=កំណត់​ការ​បង្ហាញ
+Comment[ko]=디스플레이 설정
+Comment[lt]=Ekrano parametrai
+Comment[lv]=Ekrāna parametri
+Comment[mk]=Поставувања на приказот
+Comment[ms]=Seting Paparan
+Comment[nb]=Skjerminnstillinger
+Comment[nds]=Dorstellen inrichten
+Comment[ne]=सेटिङ प्रदर्शन
गर्नुहोस्
+Comment[nl]=Beeldscherminstellingen
+Comment[nn]=Skjerminnstillingar
+Comment[pa]=ਡਿਸਪਲੇਅ ਸੈਟਿੰਗ
+Comment[pl]=Ustawienia ekranu
+Comment[pt]=Configuração do ecrã
+Comment[pt_BR]=Configurações da Tela
+Comment[ro]=Configurează monitorul
+Comment[ru]=Настройка дисплея
+Comment[se]=Å earbmaheivehusat
+Comment[sk]=Nastavenie displeja
+Comment[sl]=Nastavitve zaslona
+Comment[sr]=Подешавања екрана
+Comment[sr@latin]=Podešavanja ekrana
+Comment[sv]=Anpassa bildskärm
+Comment[ta]=அமைப்புகளை காட்டு
+Comment[tg]=Танзимоти намоиш
+Comment[th]=ตั้งค่าการแสดงผล
+Comment[tr]=Görüntü Ayarları
+Comment[uk]=Налаштування дисплея
+Comment[uz]=Дисплейнинг мосламалари
+Comment[vi]=Thiết lập Màn hình
+Comment[wa]=Apontiaedjes do HÃ¥ynaedje
+Comment[x-test]=xxDisplay Settingsxx
+Comment[zh_CN]=显示设置
+Comment[zh_TW]=顯示設定
+

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-general.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-general.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-general.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-general.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,62 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-Weight=100
+X-KDE-System-Settings-Category=general
+X-KDE-System-Settings-Parent-Category=
+
+Name=General
+Name[ar]=عام
+Name[be]=Агульныя
+Name[bg]=Основно
+Name[br]=Pennañ
+Name[cs]=Obecné
+Name[csb]=Spòdlowé
+Name[da]=Generelt
+Name[de]=Allgemein
+Name[el]=Γενικά
+Name[eo]=Ĝenerale
+Name[et]=Üldine
+Name[eu]=Orokorra
+Name[fa]=عمومی
+Name[fi]=Yleinen
+Name[fr]=Général
+Name[fy]=Algemien
+Name[ga]=Ginearálta
+Name[gl]=Xeral
+Name[he]=כללי
+Name[hi]=सामान्य
+Name[hu]=Általános
+Name[is]=Almennt
+Name[it]=Generale
+Name[ja]=全般
+Name[kk]=Жалпы
+Name[km]=ទូទៅ
+Name[kn]=ಸಾಮಾನ್ಯ
+Name[ko]=일반
+Name[ku]=Giştî
+Name[lv]=Vispārēji
+Name[nb]=Generelt
+Name[nds]=Allgemeen
+Name[ne]=सामन्य
+Name[nl]=Algemeen
+Name[nn]=Generelt
+Name[pa]=ਆਮ
+Name[pl]=Ogólne
+Name[pt]=Geral
+Name[pt_BR]=Geral
+Name[se]=Oppalaš
+Name[sl]=Splošno
+Name[sr]=Опште
+Name[sr@latin]=Opšte
+Name[sv]=Allmänt
+Name[ta]=பொது
+Name[tg]=Умумӣ
+Name[th]=ทั่วไป
+Name[tr]=Genel
+Name[uk]=Загальне
+Name[vi]=Chung
+Name[wa]=Djenerå
+Name[x-test]=xxGeneralxx
+Name[zh_CN]=常规
+Name[zh_TW]=一般

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-keyboard-and-mouse.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-keyboard-and-mouse.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-keyboard-and-mouse.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-keyboard-and-mouse.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,60 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=keyboard-and-mouse
+X-KDE-System-Settings-Parent-Category=computer-administration
+Icon=preferences-desktop-keyboard
+
+Name=Keyboard & Mouse
+Name[ar]=لوحة المفاتيح والفأرة
+Name[be]=Клавіятура і мыш
+Name[bg]=Клавиатурни подредби
+Name[ca]=Teclat i ratolí
+Name[csb]=Klawiatura ë mësz
+Name[da]=Tastatur og mus
+Name[de]=Tastatur & Maus
+Name[el]=Πληκτρολόγιο & ποντίκι
+Name[eo]=Klavaro & muso
+Name[es]=Teclado y ratón
+Name[et]=Klaviatuur ja hiir
+Name[eu]=Teklatua eta sagua
+Name[fa]=صفحه کلید و موشی
+Name[fi]=Näppäimistö ja hiiri
+Name[fr]=Clavier & Souris
+Name[fy]=Toetseboerd & Mûs
+Name[ga]=Méarchlár agus Luch
+Name[gl]=Teclado e rato
+Name[he]=מקלדת ועכבר
+Name[hi]=कुंजीपट व माउस
+Name[hu]=Egér és billentyűzet
+Name[is]=Lyklaborð og mús
+Name[it]=Tastiera e mouse
+Name[ja]=キーボードとマウス
+Name[kk]=Перенетақта мен тышқан
+Name[km]=ក្តារ​ចុច​ និង​កណ្តុរ​
+Name[ko]=키보드와 마우스
+Name[lv]=Tastatūra un pele
+Name[nb]=Tastatur og mus
+Name[nds]=Tastatuur un Muus
+Name[ne]=कुञ्जीपाटी र माउस
+Name[nl]=Toetsenbord en muis
+Name[nn]=Tastatur og mus
+Name[oc]=Clavièr e mirga
+Name[pa]=ਕੀ-ਬੋਰਡ ਅਤੇ ਮਾਊਂਸ
+Name[pl]=Klawiatura i mysz
+Name[pt]=Teclado e Rato
+Name[pt_BR]=Mouse & Teclado
+Name[ru]=Клавиатура и мышь
+Name[se]=Boallobeavdi ja sáhpán
+Name[sl]=Tipkovnica in miška
+Name[sr]=Тастатура и миш
+Name[sr@latin]=Tastatura i miš
+Name[sv]=Tangentbord och mus
+Name[tg]=Клавиатура ва муш
+Name[th]=แป้นพิมพ์และเม้าส์
+Name[tr]=Klavye ve Fare
+Name[uk]=Клавіатура і мишка
+Name[wa]=Taprece et sori
+Name[x-test]=xxKeyboard & Mousexx
+Name[zh_CN]=键盘和鼠标
+Name[zh_TW]=鍵盤與滑鼠

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-look-and-feel.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-look-and-feel.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-look-and-feel.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-look-and-feel.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,59 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=look-and-feel
+X-KDE-System-Settings-Parent-Category=general
+X-KDE-Weight=80
+Icon=preferences-desktop-theme
+
+Name=Look & Feel
+Name[ar]=المظهر والسِمة
+Name[be]=Знешні выгляд і інтэрфейс
+Name[bg]=Външен вид
+Name[ca]=Aspecte i efecte
+Name[cs]=Vzhled a chování
+Name[de]=Erscheinungsbild & Verhalten
+Name[el]=Όψη & αίσθηση
+Name[eo]=Fasado
+Name[es]=Aspecto y comportamiento
+Name[et]=Välimus
+Name[eu]=Itxura eta izaera
+Name[fa]=ظاهر و احساس
+Name[fi]=Käyttötuntuma
+Name[fr]=Apparence
+Name[fy]=Uterlik & gefoel
+Name[ga]=Cuma
+Name[gl]=Aparencia e comportamento
+Name[he]=מראה ותחושה
+Name[hi]=रूप व आकार
+Name[hu]=Megjelenés
+Name[is]=Útlit og virkni
+Name[it]=Aspetto
+Name[ja]=外観
+Name[kk]=Түрі мен күйі
+Name[km]=រូបរាង និង​មុខងារ
+Name[ko]=모습과 느낌
+Name[lt]=Išvaizda ir jausena
+Name[lv]=Izskats un sajūtas
+Name[nb]=Utseende og oppførsel
+Name[nds]=Utsehn un Bedregen
+Name[ne]=हेर्नुहोस् र महशुस
गर्नुहोस्
+Name[nl]=Uiterlijk en gedrag
+Name[nn]=Utsjånad og åtferd
+Name[pa]=ਦਿੱਖ ਅਤੇ ਮਹਿਸੂਸ
+Name[pl]=Wygląd
+Name[pt]=Aparência e Comportamento
+Name[pt_BR]=Aparência
+Name[ru]=Внешний вид и поведение
+Name[se]=Fárdá ja láhtten
+Name[sl]=Videz in občutek
+Name[sr]=Изглед и осећај
+Name[sr@latin]=Izgled i osećaj
+Name[sv]=Utseende och känsla
+Name[th]=รูปลักษณ์และความรู้สึก
+Name[tr]=Görünüm
+Name[uk]=Вигляд і поведінка
+Name[wa]=Rivnance et dujhance
+Name[x-test]=xxLook & Feelxx
+Name[zh_CN]=观感
+Name[zh_TW]=外觀與感覺

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-network-and-connectivity.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-network-and-connectivity.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-network-and-connectivity.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-network-and-connectivity.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,60 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=network-and-connectivity
+X-KDE-System-Settings-Parent-Category=general
+X-KDE-Weight=150
+Icon=preferences-system-network
+
+Name=Network & Connectivity
+Name[ar]=الشبكة والاتصال
+Name[bg]=Интернет и мрежа
+Name[ca]=Xarxa i connectivitat
+Name[cs]=Síť a připojení
+Name[da]=Netværk og forbindelse
+Name[de]=Netzwerk & Verbindungen
+Name[el]=Δίκτυο & συνδεσιμότητα
+Name[eo]=Reto kaj konekteco
+Name[es]=Red y conectividad
+Name[et]=Võrk
+Name[eu]=Sarea eta konektibitatea
+Name[fa]=شبکه و اتصال
+Name[fi]=Verkko & yhteydet
+Name[fr]=Réseau & Connectivité
+Name[fy]=Netwurk & ferbinings
+Name[ga]=Líonra agus Comhcheangailteacht
+Name[gl]=Rede e conectividade
+Name[he]=רשת וקישוריות
+Name[hi]=नेटवर्क व कनेक्टिविटी
+Name[hu]=Hálózat
+Name[is]=Net og tengjanleiki
+Name[it]=Rete e connettività
+Name[ja]=ネットワークと接続
+Name[kk]=Желі & Байланыс
+Name[km]=បណ្តាញ និង​ការតភ្ជាប់
+Name[ko]=네트워크와 연결
+Name[ku]=Tor & Girêdan
+Name[lt]=Tinklas ir prisijungimai
+Name[lv]=Tīkls un savienojumi
+Name[nb]=Nettverk og tilkoblinger
+Name[nds]=Nettwark un Verbinnen
+Name[ne]=सञ्जाल र जडान
+Name[nl]=Netwerk en connectiviteit
+Name[nn]=Nettverk og samband
+Name[pa]=ਨੈੱਟਵਰਕ ਅਤੇ ਕੁਨੈਕਟਵਿਟੀ
+Name[pl]=Sieć i połączenia
+Name[pt]=Rede e Conectividade
+Name[pt_BR]=Rede & Conectividade
+Name[ru]=Сеть
+Name[se]=Fierpmádat ja gullahallan
+Name[sl]=Omrežje in povezljivost
+Name[sr]=Мрежа и повезивост
+Name[sr@latin]=Mreža i povezivost
+Name[sv]=Nätverk och anslutningar
+Name[th]=เครือข่ายและการเชื่อมต่อ
+Name[tr]=Ağ ve Bağlanılabilirlik
+Name[uk]=Мережа і з'єднання
+Name[wa]=Rantoele eyet raloyaedje
+Name[x-test]=xxNetwork & Connectivityxx
+Name[zh_CN]=网络和连接
+Name[zh_TW]=網路連線

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-network-settings.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-network-settings.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-network-settings.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-network-settings.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,63 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=network-settings
+X-KDE-System-Settings-Parent-Category=network-and-connectivity
+Icon=preferences-system-network
+
+Name=Network Settings
+Name[ar]=إعدادات الشبكة
+Name[be]=Настаўленні сеткі
+Name[bg]=Мрежови настройки
+Name[br]=Kefluniadur ar Rouedad
+Name[ca]=Paràmetres de xarxa
+Name[csb]=Sécowi ùstôw
+Name[da]=Netværksopsætning
+Name[de]=Netzwerk-Einstellungen
+Name[el]=Ρυθμίσεις δικτύου
+Name[eo]=Reta agordo
+Name[es]=Preferencias de red
+Name[et]=Võrguseadistused
+Name[eu]=Sare ezarpenak
+Name[fa]=تنظیمات شبکه
+Name[fi]=Verkkoasetukset
+Name[fr]=Configuration réseau
+Name[fy]=Netwurk ynstellings
+Name[ga]=Socruithe Líonra
+Name[gl]=Configuración da rede
+Name[he]=הגדרות רשת
+Name[hi]=नेटवर्क विन्यास
+Name[hr]=Postavke mreže
+Name[hu]=Hálózati beállítások
+Name[is]=Netstillingar
+Name[it]=Impostazioni di rete
+Name[ja]=ネットワークの設定
+Name[kk]=Желі параметрлері
+Name[km]=ការ​កំណត់​បណ្តាញ​
+Name[ko]=네트워크 설정
+Name[ku]=Mîhengên Torê
+Name[lv]=Tīkla iestatījumi
+Name[nb]=Nettverksinnstillinger
+Name[nds]=Nettwarkinstellen
+Name[ne]=सञ्जाल सेटिङ
+Name[nl]=Netwerkinstellingen
+Name[nn]=Nettverksinnstillingar
+Name[oc]=Paramètres ret
+Name[pa]=ਨੈੱਟਵਰਕ ਸੈਟਿੰਗ
+Name[pl]=Ustawienia sieci
+Name[pt]=Configuração da Rede
+Name[pt_BR]=Configurações de Rede
+Name[ru]=Настройка сети
+Name[se]=Fierpmádatheivehusat
+Name[sl]=Nastavitve omrežja
+Name[sr]=Мрежне поставке
+Name[sr@latin]=Mrežne postavke
+Name[sv]=Nätverksinställningar
+Name[tg]=Танзимотҳои шабака
+Name[th]=ตั้งค่าเครือข่าย
+Name[tr]=Ağ Ayarları
+Name[uk]=Мережні параметри
+Name[wa]=Apontiaedjes rantoele
+Name[x-test]=xxNetwork Settingsxx
+Name[zh_CN]=网络设置
+Name[zh_TW]=網路設定

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-notifications.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-notifications.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-notifications.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-notifications.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,62 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=notifications
+X-KDE-System-Settings-Parent-Category=look-and-feel
+Icon=preferences-desktop-notification
+
+Name=Notifications
+Name[ar]=تنبيهات
+Name[be]=Абвяшчэнні
+Name[bg]=Уведомяване
+Name[br]=Kemenn
+Name[ca]=Notificacions
+Name[csb]=Dôwanié wiédzë
+Name[da]=Bekendtgørelser
+Name[de]=Benachrichtigungen
+Name[el]=Ειδοποιήσεις
+Name[eo]=Atentigoj
+Name[es]=Notificaciones
+Name[et]=Märguanded
+Name[eu]=Jakinarazpenak
+Name[fa]=اخطارها
+Name[fi]=Huomautukset
+Name[fy]=Notifikaasjes
+Name[ga]=Fógairt
+Name[gl]=Notificacións
+Name[he]=הודעות מערכת
+Name[hi]=सूचनाएँ
+Name[hr]=Obavijesti
+Name[hu]=Rendszerüzenetek
+Name[is]=Kerfistilkynningar
+Name[it]=Avvisi
+Name[ja]=通知
+Name[kk]=Құлақтандыру
+Name[km]=សេចក្តី​ជូន​ដំណឹង​
+Name[kn]=ಸೂಚನೆಗಳು
+Name[ko]=알림
+Name[ku]=Agahdarî
+Name[lv]=Paziņojumi
+Name[nb]=Varslinger
+Name[nds]=Bescheden
+Name[ne]=सूचना
+Name[nl]=Meldingen
+Name[nn]=Varslingar
+Name[pa]=ਨੋਟੀਫਿਕੇਸ਼ਨ
+Name[pl]=Powiadomienia
+Name[pt]=Notificações
+Name[pt_BR]=Notificações
+Name[ru]=Системные уведомления
+Name[se]=Dieđáhusat
+Name[sl]=Obvestila
+Name[sr]=Обавештења
+Name[sr@latin]=Obaveštenja
+Name[sv]=Underrättelser
+Name[tg]=Огоҳномаҳо
+Name[th]=การแจ้งเตือน
+Name[tr]=Bildirimler
+Name[uk]=Сповіщення
+Name[wa]=Notifiaedjes
+Name[x-test]=xxNotificationsxx
+Name[zh_CN]=通知
+Name[zh_TW]=通知

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-personal.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-personal.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-personal.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-personal.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,57 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=personal
+X-KDE-System-Settings-Parent-Category=general
+Icon=preferences-desktop-personal
+
+Name=Personal
+Name[ar]=شخصي
+Name[be]=Асабістыя
+Name[bg]=Лични бележки
+Name[csb]=Swòje
+Name[de]=Persönliches
+Name[el]=Προσωπικά
+Name[eo]=Persona
+Name[et]=Isiklik
+Name[eu]=Pertsonala
+Name[fa]=شخصی
+Name[fi]=Henkilökohtaista
+Name[fr]=Personnel
+Name[fy]=Persoanlik
+Name[ga]=Pearsanta
+Name[gl]=Persoal
+Name[he]=הגדרות אישיות
+Name[hi]=निजी
+Name[hu]=Személyes
+Name[is]=Einkaskrár
+Name[it]=Personale
+Name[ja]=個人
+Name[kk]=Дербес
+Name[km]=ផ្ទាល់ខ្លួន
+Name[kn]=ವೈಯಕ್ತಿಕ
+Name[ko]=개인
+Name[ku]=Şexsî
+Name[lv]=Personas
+Name[nb]=Personlig
+Name[nds]=Persöönlich
+Name[ne]=व्यक्तिगत
+Name[nl]=Persoonlijk
+Name[nn]=Personleg
+Name[pa]=ਨਿੱਜੀ
+Name[pl]=Osobiste
+Name[pt]=Pessoal
+Name[pt_BR]=Pessoais
+Name[se]=Persuvnnalaš
+Name[sl]=Osebno
+Name[sr]=Лични подаци
+Name[sr@latin]=Lični podaci
+Name[sv]=Personligt
+Name[tg]=Шахсӣ
+Name[th]=ส่วนบุคคล
+Name[tr]=Kişisel
+Name[uk]=Особисті параметри
+Name[wa]=Da vosse
+Name[x-test]=xxPersonalxx
+Name[zh_CN]=个人
+Name[zh_TW]=個人

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-regional-and-language.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-regional-and-language.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-regional-and-language.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-regional-and-language.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,60 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=regional-and-language
+X-KDE-System-Settings-Parent-Category=personal
+Icon=preferences-desktop-locale
+
+Name=Regional & Language
+Name[ar]=البلد واللغة
+Name[be]=Краіна/Рэгіён і Мова
+Name[bg]=Държава и език
+Name[br]=Rann-vro & yezh
+Name[ca]=País/Regió i idioma
+Name[csb]=Kraj/dzél kraju ë jãzëk
+Name[de]=Land/Region & Sprache
+Name[el]=Τοπικές ρυθμίσεις & γλώσσα
+Name[eo]=Regiono & Lingvo
+Name[es]=Región e idioma
+Name[et]=Riik/regioon ja keel
+Name[eu]=Herrialdea eta hizkuntza
+Name[fa]=منطقه‌ای و زبان
+Name[fi]=Alue ja kieli
+Name[fr]=Régional & langue
+Name[fy]=Lân/Regio & Taal
+Name[ga]=Réigiún agus Teanga
+Name[gl]=País e lingua
+Name[he]=איזור ושפה
+Name[hi]=क्षेत्रीयता व भाषा
+Name[hu]=Ország és nyelv
+Name[is]=Land & tungumál
+Name[it]=Lingua e paese
+Name[ja]=国と言語
+Name[kk]=Өлке және тіл
+Name[km]=តំបន់ និង​ភាសា​
+Name[ko]=국가 및 언어
+Name[ku]=Herêmî & Ziman
+Name[lv]=Reģions un valoda
+Name[nb]=Land/region og språk
+Name[nds]=Land, Regioon un Spraak
+Name[ne]=क्षेत्र र भाषा
+Name[nl]=Land/regio en taal
+Name[nn]=Land/region og språk
+Name[pa]=ਖੇਤਰੀ ਅਤੇ ਭਾਸ਼ਾ
+Name[pl]=Kraj/region i język
+Name[pt]=Região e Língua
+Name[pt_BR]=Regional & Idioma
+Name[ru]=Страна и язык
+Name[se]=Riika/guovlu ja giella
+Name[sl]=Država/regija in jezik
+Name[sr]=Регија и језик
+Name[sr@latin]=Regija i jezik
+Name[sv]=Region och språk
+Name[tg]=Минтақа ва забон
+Name[th]=เขตพื้นที่และภาษา
+Name[tr]=Ülke, Bölge ve Dil
+Name[uk]=Країна/регіон і мова
+Name[wa]=Payis et lingaedje
+Name[x-test]=xxRegional & Languagexx
+Name[zh_CN]=地区和语言
+Name[zh_TW]=地區與語言

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-sharing.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-sharing.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-sharing.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-sharing.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,59 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=sharing
+X-KDE-System-Settings-Parent-Category=network-and-connectivity
+Icon=preferences-system-network-sharing
+
+Name=Sharing
+Name[ar]=مشاركة
+Name[be]=Абмен
+Name[bg]=Споделяне
+Name[br]=Rannañ
+Name[ca]=Compartició
+Name[csb]=Ùwòlnienié
+Name[de]=Freigabe
+Name[el]=Διαμοιρασμός
+Name[eo]=Komunigo
+Name[es]=Compartición
+Name[et]=Jagamine
+Name[eu]=Banaketak
+Name[fa]=اشتراک
+Name[fi]=Jaetaan
+Name[fr]=Partage
+Name[fy]=Diele
+Name[ga]=Comhroinnt
+Name[gl]=Compartición
+Name[he]=שיתוף
+Name[hi]=साझेदारी
+Name[hr]=Razmjena
+Name[hu]=Megosztás
+Name[is]=Deili
+Name[it]=Condivisione
+Name[ja]=共有
+Name[km]=ការ​ចែក​រំលែក
+Name[ko]=공유
+Name[ku]=Parvekirin
+Name[lv]=Koplietošana
+Name[nb]=Deler
+Name[nds]=Delen
+Name[ne]=साझेदारी
+Name[nl]=Delen
+Name[nn]=Deling
+Name[pa]=ਸਾਂਝ
+Name[pl]=Współdzielenie
+Name[pt]=Partilha
+Name[pt_BR]=Compartilhamento
+Name[ru]=Общий доступ к файлам
+Name[se]=Juogádeapmi
+Name[sl]=Souporaba
+Name[sr]=Дељење
+Name[sr@latin]=Deljenje
+Name[sv]=Delning
+Name[th]=ใช้ร่วมกัน
+Name[tr]=Paylaşım
+Name[uk]=Спільне користування
+Name[wa]=PÃ¥rtaedje
+Name[x-test]=xxSharingxx
+Name[zh_CN]=共享
+Name[zh_TW]=分享

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-system.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-system.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-system.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-system.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,73 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=system
+X-KDE-System-Settings-Parent-Category=advanced
+Icon=preferences-system
+
+Name=System
+Name[af]=Stelsel
+Name[ar]=النظام
+Name[be]=Сістэма
+Name[bg]=Система
+Name[bn]=সিস্টেম
+Name[br]=Reizhiad
+Name[ca]=Sistema
+Name[cs]=Systém
+Name[csb]=Systema
+Name[cy]=Cysawd
+Name[el]=Σύστημα
+Name[eo]=Sistemo
+Name[es]=Sistema
+Name[et]=Süsteem
+Name[eu]=Sistema
+Name[fa]=سیستم
+Name[fi]=Järjestelmä
+Name[fr]=Système
+Name[fy]=Systeem
+Name[ga]=Córas
+Name[gl]=Sistema
+Name[he]=מערכת
+Name[hi]=तंत्र
+Name[hr]=Sustav
+Name[hu]=Rendszer
+Name[is]=Kerfi
+Name[it]=Sistema
+Name[ja]=システム
+Name[ka]=სისტემა
+Name[kk]=Жүйелік
+Name[km]=ប្រព័ន្ធ
+Name[kn]=ವ್ಯವಸ್ಥೆ
+Name[ko]=시스템
+Name[ku]=Pergal
+Name[lt]=Sistema
+Name[lv]=Sistēma
+Name[mk]=Систем
+Name[ms]=Sistem
+Name[nds]=Systeem
+Name[ne]=प्रणाली
+Name[nl]=Systeem
+Name[oc]=Sistèma
+Name[pa]=ਸਿਸਟਮ
+Name[pt]=Sistema
+Name[pt_BR]=Sistema
+Name[ro]=Sistem
+Name[ru]=Система
+Name[se]=Vuogádat
+Name[sk]=Systém
+Name[sl]=Sistem
+Name[sr]=Систем
+Name[sr@latin]=Sistem
+Name[ta]=அமைப்பு
+Name[te]=వ్యవస్థ
+Name[tg]=Система
+Name[th]=ระบบ
+Name[tr]=Sistem
+Name[uk]=Система
+Name[uz]=Тизим
+Name[vi]=Hệ thống
+Name[wa]=Sistinme
+Name[x-test]=xxSystemxx
+Name[xh]=Indlela esestyenziswayo
+Name[zh_CN]=系统
+Name[zh_TW]=系統

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-window-behaviour.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-window-behaviour.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-window-behaviour.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/settings-window-behaviour.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,76 @@
+[Desktop Entry]
+Type=Service
+X-KDE-ServiceTypes=SystemSettingsCategory
+X-KDE-System-Settings-Category=window-behaviour
+X-KDE-System-Settings-Parent-Category=look-and-feel
+Icon=preferences-system-windows
+
+Name=Window Behavior
+Name[af]=Venster Gedrag
+Name[ar]=سلوك النوافذ
+Name[be]=Паводзіны вокнаў
+Name[bg]=Прозорци
+Name[bn]=উইণ্ডো আচরণ
+Name[br]=Emzalc'h ar prenester
+Name[ca]=Comportament de les finestres
+Name[cs]=Chování oken
+Name[csb]=Ùchòwanié òkna
+Name[cy]=Ymddygiad Ffenestri
+Name[da]=Vinduesopførsel
+Name[de]=Fenstereigenschaften
+Name[el]=Συμπεριφορά παραθύρου
+Name[en_GB]=Window Behaviour
+Name[eo]=Fenestrokonduto
+Name[es]=Comportamiento de la ventana
+Name[et]=Akende käitumine
+Name[eu]=Leihoen portaera
+Name[fa]=رفتار پنجره
+Name[fi]=Ikkunoiden käyttäytyminen
+Name[fr]=Comportement des fenêtres
+Name[fy]=Finstergedrach
+Name[ga]=Oibriú na bhFuinneog
+Name[gl]=Comportamento das fiestras
+Name[he]=פעולת חלונות
+Name[hi]=विंडो व्यवहार
+Name[hr]=Ponašanje prozora
+Name[hu]=Ablakműveletek
+Name[is]=Hegðun glugga
+Name[it]=Comportamento delle finestre
+Name[ja]=ウィンドウの挙動
+Name[ka]=ფანჯრის ქცევა
+Name[kk]=Терезе қасиеттері
+Name[km]=ឥរិយាបថ​បង្អួច
+Name[ko]=창 동작
+Name[ku]=Helwesta Paceyan
+Name[lt]=Langų elgsena
+Name[lv]=Loga izturēšanās
+Name[mk]=Однесување на прозорци
+Name[nb]=Vindusoppførsel
+Name[nds]=Finsterbedregen
+Name[ne]=सञ्झ्याल व्यवहार
+Name[nl]=Venstergedrag
+Name[nn]=Vindaugsåtferd
+Name[pa]=ਵਿੰਡੋ ਰਵੱਈਆ
+Name[pl]=Okna
+Name[pt]=Comportamento das Janelas
+Name[pt_BR]=Comportamento da Janela
+Name[ro]=Comportament fereastră
+Name[ru]=Поведение окна
+Name[se]=Láseláhtten
+Name[sk]=Správanie okien
+Name[sl]=Obnašanje oken
+Name[sr]=Понашање прозора
+Name[sr@latin]=Ponašanje prozora
+Name[sv]=Fönsterbeteende
+Name[ta]=சாளர நடத்தை
+Name[tg]=Рафтори тиреза
+Name[th]=พฤติกรรมของหน้าต่าง
+Name[tr]=Pencere Davranışı
+Name[uk]=Поведінка вікон
+Name[uz]=Ойнанинг хусусиятлари
+Name[vi]=Ứng xử của Cửa sổ
+Name[wa]=Dujhance des purneas
+Name[x-test]=xxWindow Behaviorxx
+Name[xh]=Ukuziphatha kwe Window
+Name[zh_CN]=窗口行为
+Name[zh_TW]=視窗行為

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/systemsettingscategory.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/systemsettingscategory.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/systemsettingscategory.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/categories/systemsettingscategory.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,61 @@
+[Desktop Entry]
+Type=ServiceType
+X-KDE-ServiceType=SystemSettingsCategory
+Name=System Settings Category
+Name[ar]=فئة إعدادات النظام
+Name[be]=Катэгорыя сістэмных настаўленняў
+Name[bg]=Категория системни настройки
+Name[ca]=Categoria d'arranjament del sistema
+Name[csb]=Kategòrëjô systemòwégò ùstôwù
+Name[de]=Systemeinstellungen-Kategorie
+Name[el]=Κατηγορία ρυθμίσεων συστήματος
+Name[eo]=Sistemagorda kategorio
+Name[es]=Categoría de preferencias del sistema
+Name[et]=Süsteemi seadistuste kategooria
+Name[eu]=Sistema ezarpenen kategoria
+Name[fa]=دسته تنظیمات سیستم
+Name[fi]=Järjestelmäasetusten luokka
+Name[fr]=Catégorie des paramètres du système
+Name[fy]=Systeem ynstellings katogory
+Name[ga]=Catagóir Socruithe an Chórais
+Name[gl]=Categoría de configuración do sistema
+Name[he]=קטגוריית הגדרות מערכת
+Name[hi]=तंत्र विन्यास वर्ग
+Name[hu]=Rendszerbeállítási kategória
+Name[is]=Kerfisstillingaflokkur
+Name[it]=Categoria delle impostazioni di sistema
+Name[ja]=システム設定のカテゴリ
+Name[kk]=Жүйе параметрлер санаты
+Name[km]=ប្រភេទ​ការ​កំណត់​ប្រព័ន្ធ​
+Name[ko]=시스템 설정 분류
+Name[ku]=Kategoriya Mîhengên Pergalê
+Name[lv]=Sistēmas iestatījumu kategorija
+Name[nb]=Kategori for systeminnstillinger
+Name[nds]=Kategorie Systeeminstellen
+Name[ne]=प्रणाली सेटिङ कोटि
+Name[nl]=Systeeminstellingen-catagorie
+Name[nn]=Kategori for systemval
+Name[pa]=ਸਿਸਟਮ ਸੈਟਿੰਗ ਕੈਟਾਗਰੀ
+Name[pl]=Kategoria: Ustawienia systemowe
+Name[pt]=Categoria da Configuração do Sistema
+Name[pt_BR]=Categoria das Configurações do Sistema
+Name[se]=Vuogádatheivehusaid láhki
+Name[sl]=Kategorija sistemskih nastavitev
+Name[sr]=Категорија системских поставки
+Name[sr@latin]=Kategorija sistemskih postavki
+Name[sv]=Systeminställningskategori
+Name[th]=หมวดหมู่การตั้งค่าระบบ
+Name[tr]=Sistem Ayarları Kategorisi
+Name[uk]=Категорія системних параметрів
+Name[wa]=Categoreye d' apontiaedjes do sistinme
+Name[x-test]=xxSystem Settings Categoryxx
+Name[zh_CN]=系统设置类别
+Name[zh_TW]=系統設定類別
+
+# the category identifier
+[PropertyDef::X-KDE-System-Settings-Category]
+Type=QString
+
+# the parent category identifier
+[PropertyDef::X-KDE-System-Settings-Parent-Category]
+Type=QString

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel.cpp?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel.cpp
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel.cpp
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,288 @@
+/**
+ * This file is part of the KDE project
+ * Copyright (C) 2007 Rafael Fernández López <ereslibre@xxxxxxx>
+ * Copyright (C) 2007 John Tapsell <tapsell@xxxxxxx>
+ * Copyright (C) 2006 by Dominic Battre <dominic@xxxxxxxxx>
+ * Copyright (C) 2006 by Martin Pool <mbp@xxxxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "kcategorizedsortfilterproxymodel.h"
+#include "kcategorizedsortfilterproxymodel_p.h"
+
+#include <limits.h>
+
+#include <QItemSelection>
+#include <QStringList>
+#include <QSize>
+
+KCategorizedSortFilterProxyModel::KCategorizedSortFilterProxyModel(QObject
*parent)
+ : QSortFilterProxyModel(parent)
+ , d(new Private())
+
+{
+}
+
+KCategorizedSortFilterProxyModel::~KCategorizedSortFilterProxyModel()
+{
+ delete d;
+}
+
+void KCategorizedSortFilterProxyModel::sort(int column, Qt::SortOrder order)
+{
+ d->sortColumn = column;
+ d->sortOrder = order;
+
+ QSortFilterProxyModel::sort(column, order);
+}
+
+bool KCategorizedSortFilterProxyModel::isCategorizedModel() const
+{
+ return d->categorizedModel;
+}
+
+void KCategorizedSortFilterProxyModel::setCategorizedModel(bool
categorizedModel)
+{
+ if (categorizedModel == d->categorizedModel)
+ {
+ return;
+ }
+
+ d->categorizedModel = categorizedModel;
+
+ invalidate();
+}
+
+int KCategorizedSortFilterProxyModel::sortColumn() const
+{
+ return d->sortColumn;
+}
+
+Qt::SortOrder KCategorizedSortFilterProxyModel::sortOrder() const
+{
+ return d->sortOrder;
+}
+
+void
KCategorizedSortFilterProxyModel::setSortCategoriesByNaturalComparison(bool
sortCategoriesByNaturalComparison)
+{
+ if (sortCategoriesByNaturalComparison ==
d->sortCategoriesByNaturalComparison)
+ {
+ return;
+ }
+
+ d->sortCategoriesByNaturalComparison = sortCategoriesByNaturalComparison;
+
+ invalidate();
+}
+
+bool KCategorizedSortFilterProxyModel::sortCategoriesByNaturalComparison()
const
+{
+ return d->sortCategoriesByNaturalComparison;
+}
+
+int KCategorizedSortFilterProxyModel::naturalCompare(const QString &a,
+ const QString &b)
+{
+ // This method chops the input a and b into pieces of
+ // digits and non-digits (a1.05 becomes a | 1 | . | 05)
+ // and compares these pieces of a and b to each other
+ // (first with first, second with second, ...).
+ //
+ // This is based on the natural sort order code code by Martin Pool
+ // http://sourcefrog.net/projects/natsort/
+ // Martin Pool agreed to license this under LGPL or GPL.
+
+ const QChar* currA = a.unicode(); // iterator over a
+ const QChar* currB = b.unicode(); // iterator over b
+
+ if (currA == currB) {
+ return 0;
+ }
+
+ const QChar* begSeqA = currA; // beginning of a new character sequence of a
+ const QChar* begSeqB = currB;
+
+ while (!currA->isNull() && !currB->isNull()) {
+ if (currA->unicode() == QChar::ObjectReplacementCharacter) {
+ return 1;
+ }
+
+ if (currB->unicode() == QChar::ObjectReplacementCharacter) {
+ return -1;
+ }
+
+ if (currA->unicode() == QChar::ReplacementCharacter) {
+ return 1;
+ }
+
+ if (currB->unicode() == QChar::ReplacementCharacter) {
+ return -1;
+ }
+
+ // find sequence of characters ending at the first non-character
+ while (!currA->isNull() && !currA->isDigit()) {
+ ++currA;
+ }
+
+ while (!currB->isNull() && !currB->isDigit()) {
+ ++currB;
+ }
+
+ // compare these sequences
+ const QString subA(begSeqA, currA - begSeqA);
+ const QString subB(begSeqB, currB - begSeqB);
+ const int cmp = QString::localeAwareCompare(subA, subB);
+ if (cmp != 0) {
+ return cmp;
+ }
+
+ if (currA->isNull() || currB->isNull()) {
+ break;
+ }
+
+ // now some digits follow...
+ if ((*currA == '0') || (*currB == '0')) {
+ // one digit-sequence starts with 0 -> assume we are in a fraction
part
+ // do left aligned comparison (numbers are considered left aligned)
+ while (1) {
+ if (!currA->isDigit() && !currB->isDigit()) {
+ break;
+ } else if (!currA->isDigit()) {
+ return -1;
+ } else if (!currB->isDigit()) {
+ return + 1;
+ } else if (*currA < *currB) {
+ return -1;
+ } else if (*currA > *currB) {
+ return + 1;
+ }
+ ++currA;
+ ++currB;
+ }
+ } else {
+ // No digit-sequence starts with 0 -> assume we are looking at
some integer
+ // do right aligned comparison.
+ //
+ // The longest run of digits wins. That aside, the greatest
+ // value wins, but we can't know that it will until we've scanned
+ // both numbers to know that they have the same magnitude.
+
+ int weight = 0;
+ while (1) {
+ if (!currA->isDigit() && !currB->isDigit()) {
+ if (weight != 0) {
+ return weight;
+ }
+ break;
+ } else if (!currA->isDigit()) {
+ return -1;
+ } else if (!currB->isDigit()) {
+ return + 1;
+ } else if ((*currA < *currB) && (weight == 0)) {
+ weight = -1;
+ } else if ((*currA > *currB) && (weight == 0)) {
+ weight = + 1;
+ }
+ ++currA;
+ ++currB;
+ }
+ }
+
+ begSeqA = currA;
+ begSeqB = currB;
+ }
+
+ if (currA->isNull() && currB->isNull()) {
+ return 0;
+ }
+
+ return currA->isNull() ? -1 : + 1;
+}
+
+bool KCategorizedSortFilterProxyModel::lessThan(const QModelIndex &left, const
QModelIndex &right) const
+{
+ if (d->categorizedModel)
+ {
+ int compare = compareCategories(left, right);
+
+ if (compare > 0) // left is greater than right
+ {
+ return false;
+ }
+ else if (compare < 0) // left is less than right
+ {
+ return true;
+ }
+ }
+
+ return subSortLessThan(left, right);
+}
+
+bool KCategorizedSortFilterProxyModel::subSortLessThan(const QModelIndex
&left, const QModelIndex &right) const
+{
+ return QSortFilterProxyModel::lessThan(left, right);
+}
+
+int KCategorizedSortFilterProxyModel::compareCategories(const QModelIndex
&left, const QModelIndex &right) const
+{
+ QVariant l = (left.model() ? left.model()->data(left, CategorySortRole) :
QVariant());
+ QVariant r = (right.model() ? right.model()->data(right, CategorySortRole)
: QVariant());
+
+ Q_ASSERT(l.isValid());
+ Q_ASSERT(r.isValid());
+ Q_ASSERT(l.type() == r.type());
+
+ if (l.type() == QVariant::String)
+ {
+ QString lstr = l.toString();
+ QString rstr = r.toString();
+
+ if (d->sortCategoriesByNaturalComparison)
+ {
+ return naturalCompare(lstr, rstr);
+ }
+ else
+ {
+ if (lstr < rstr)
+ {
+ return -1;
+ }
+
+ if (lstr > rstr)
+ {
+ return 1;
+ }
+
+ return 0;
+ }
+ }
+
+ qlonglong lint = l.toLongLong();
+ qlonglong rint = r.toLongLong();
+
+ if (lint < rint)
+ {
+ return -1;
+ }
+
+ if (lint > rint)
+ {
+ return 1;
+ }
+
+ return 0;
+}

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel.h?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel.h
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel.h
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,183 @@
+/**
+ * This file is part of the KDE project
+ * Copyright (C) 2007 Rafael Fernández López <ereslibre@xxxxxxx>
+ * Copyright (C) 2007 John Tapsell <tapsell@xxxxxxx>
+ * Copyright (C) 2006 by Dominic Battre <dominic@xxxxxxxxx>
+ * Copyright (C) 2006 by Martin Pool <mbp@xxxxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef KCATEGORIZEDSORTFILTERPROXYMODEL_H
+#define KCATEGORIZEDSORTFILTERPROXYMODEL_H
+
+#include <QtGui/QSortFilterProxyModel>
+
+#include <kdeui_export.h>
+
+class QItemSelection;
+
+
+/**
+ * This class lets you categorize a view. It is meant to be used along with
+ * KCategorizedView class.
+ *
+ * In general terms all you need to do is to reimplement subSortLessThan() and
+ * compareCategories() methods. In order to make categorization work, you need
+ * to also call setCategorizedModel() class to enable it, since the
categorization
+ * is disabled by default.
+ *
+ * @see KCategorizedView
+ *
+ * @author Rafael Fernández López <ereslibre@xxxxxxx>
+ */
+class KDEUI_EXPORT KCategorizedSortFilterProxyModel
+ : public QSortFilterProxyModel
+{
+public:
+ enum AdditionalRoles {
+ // Note: use printf "0x%08X\n" $(($RANDOM*$RANDOM))
+ // to define additional roles.
+ CategoryDisplayRole = 0x17CE990A, ///< This role is used for asking
the category to a given index
+
+ CategorySortRole = 0x27857E60 ///< This role is used for sorting
categories. You can return a
+ ///< string or a long long value.
Strings will be sorted alphabetically
+ ///< while long long will be sorted
by their value. Please note that this
+ ///< value won't be shown on the
view, is only for sorting purposes. What will
+ ///< be shown as "Category" on the
view will be asked with the role
+ ///< CategoryDisplayRole.
+ };
+
+ KCategorizedSortFilterProxyModel(QObject *parent = 0);
+ virtual ~KCategorizedSortFilterProxyModel();
+
+ /**
+ * Overridden from QSortFilterProxyModel. Sorts the source model using
+ * @p column for the given @p order.
+ */
+ virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
+
+ /**
+ * @return whether the model is categorized or not. Disabled by default.
+ */
+ bool isCategorizedModel() const;
+
+ /**
+ * Enables or disables the categorization feature.
+ *
+ * @param categorizedModel whether to enable or disable the
categorization feature.
+ */
+ void setCategorizedModel(bool categorizedModel);
+
+ /**
+ * @return the column being used for sorting.
+ */
+ int sortColumn() const;
+
+ /**
+ * @return the sort order being used for sorting.
+ */
+ Qt::SortOrder sortOrder() const;
+
+ /**
+ * Set if the sorting using CategorySortRole will use a natural comparison
+ * in the case that strings were returned. If enabled,
QString::localeAwareCompare
+ * will be used for sorting.
+ *
+ * @param sortCategoriesByNaturalComparison whether to sort using a
natural comparison or not.
+ */
+ void setSortCategoriesByNaturalComparison(bool
sortCategoriesByNaturalComparison);
+
+ /**
+ * @return whether it is being used a natural comparison for sorting.
Enabled by default.
+ */
+ bool sortCategoriesByNaturalComparison() const;
+
+ /**
+ * Does a natural comparing of the strings. -1 is returned if \a a
+ * is smaller than \a b. +1 is returned if \a a is greater than \a b. 0
+ * is returned if both values are equal.
+ */
+ static int naturalCompare(const QString &a, const QString &b);
+
+protected:
+ /**
+ * Overridden from QSortFilterProxyModel. If you are subclassing
+ * KCategorizedSortFilterProxyModel, you will probably not need to
reimplement this
+ * method.
+ *
+ * It calls compareCategories() to sort by category. If the both items
are in the
+ * same category (i.e. compareCategories returns 0), then subSortLessThan
is called.
+ *
+ * @return Returns true if the item @p left is less than the item @p
right when sorting.
+ *
+ * @warning You usually won't need to reimplement this method when
subclassing
+ * from KCategorizedSortFilterProxyModel.
+ */
+ virtual bool lessThan(const QModelIndex &left, const QModelIndex &right)
const;
+
+ /**
+ * This method has a similar purpose as lessThan() has on
QSortFilterProxyModel.
+ * It is used for sorting items that are in the same category.
+ *
+ * @return Returns true if the item @p left is less than the item @p
right when sorting.
+ */
+ virtual bool subSortLessThan(const QModelIndex &left, const QModelIndex
&right) const;
+
+ /**
+ * This method compares the category of the @p left index with the
category
+ * of the @p right index.
+ *
+ * Internally and if not reimplemented, this method will ask for @p left
and
+ * @p right models for role CategorySortRole. In order to correctly sort
+ * categories, the data() metod of the model should return a qlonglong
(or numeric) value, or
+ * a QString object. QString objects will be sorted with
QString::localeAwareCompare if
+ * sortCategoriesByNaturalComparison() is true.
+ *
+ * @note Please have present that:
+ * QString(QChar(QChar::ObjectReplacementCharacter)) >
+ * QString(QChar(QChar::ReplacementCharacter)) >
+ * [ all possible strings ] >
+ * QString();
+ *
+ * This means that QString() will be sorted the first one, while
+ * QString(QChar(QChar::ObjectReplacementCharacter)) and
+ * QString(QChar(QChar::ReplacementCharacter)) will be sorted in
last
+ * position.
+ *
+ * @warning Please note that data() method of the model should return
always
+ * information of the same type. If you return a QString for an
index,
+ * you should return always QStrings for all indexes for role
CategorySortRole
+ * in order to correctly sort categories. You can't mix by
returning
+ * a QString for one index, and a qlonglong for other.
+ *
+ * @note If you need a more complex layout, you will have to reimplement
this
+ * method.
+ *
+ * @return A negative value if the category of @p left should be placed
before the
+ * category of @p right. 0 if @p left and @p right are on the
same category, and
+ * a positive value if the category of @p left should be placed
after the
+ * category of @p right.
+ */
+ virtual int compareCategories(const QModelIndex &left, const QModelIndex
&right) const;
+
+private:
+ class Private;
+ Private *const d;
+};
+
+
+#endif // KCATEGORIZEDSORTFILTERPROXYMODEL_H

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel_p.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel_p.h?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel_p.h
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedsortfilterproxymodel_p.h
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,48 @@
+/**
+ * This file is part of the KDE project
+ * Copyright (C) 2007 Rafael Fernández López <ereslibre@xxxxxxx>
+ * Copyright (C) 2007 John Tapsell <tapsell@xxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef KCATEGORIZEDSORTFILTERPROXYMODEL_P_H
+#define KCATEGORIZEDSORTFILTERPROXYMODEL_P_H
+
+class KCategorizedSortFilterProxyModel;
+
+class KCategorizedSortFilterProxyModel::Private
+{
+public:
+ Private()
+ : sortColumn(0)
+ , sortOrder(Qt::AscendingOrder)
+ , categorizedModel(false)
+ , sortCategoriesByNaturalComparison(true)
+ {
+ }
+
+ ~Private()
+ {
+ }
+
+ int sortColumn;
+ Qt::SortOrder sortOrder;
+ bool categorizedModel;
+ bool sortCategoriesByNaturalComparison;
+};
+
+#endif

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview.cpp?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview.cpp
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview.cpp
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,1634 @@
+/**
+ * This file is part of the KDE project
+ * Copyright (C) 2007 Rafael Fernández López <ereslibre@xxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "kcategorizedview.h"
+#include "kcategorizedview_p.h"
+
+#include <math.h> // trunc on C99 compliant systems
+#include <kdefakes.h> // trunc for not C99 compliant systems
+
+#include <QPainter>
+#include <QScrollBar>
+#include <QPaintEvent>
+
+#include <kstyle.h>
+
+#include "kcategorydrawer.h"
+#include "kcategorizedsortfilterproxymodel.h"
+
+// By defining DOLPHIN_DRAGANDDROP the custom drag and drop implementation of
+// KCategorizedView is bypassed to have a consistent drag and drop look for all
+// views. Hopefully transparent pixmaps for drag objects will be supported in
+// Qt 4.4, so that this workaround can be skipped.
+#define DOLPHIN_DRAGANDDROP
+
+KCategorizedView::Private::Private(KCategorizedView *listView)
+ : listView(listView)
+ , categoryDrawer(0)
+ , biggestItemSize(QSize(0, 0))
+ , mouseButtonPressed(false)
+ , rightMouseButtonPressed(false)
+ , isDragging(false)
+ , dragLeftViewport(false)
+ , proxyModel(0)
+{
+}
+
+KCategorizedView::Private::~Private()
+{
+}
+
+const QModelIndexList &KCategorizedView::Private::intersectionSet(const QRect
&rect)
+{
+ QModelIndex index;
+ QRect indexVisualRect;
+
+ intersectedIndexes.clear();
+
+ int itemHeight;
+
+ if (listView->gridSize().isEmpty())
+ {
+ itemHeight = biggestItemSize.height();
+ }
+ else
+ {
+ itemHeight = listView->gridSize().height();
+ }
+
+ // Lets find out where we should start
+ int top = proxyModel->rowCount() - 1;
+ int bottom = 0;
+ int middle = (top + bottom) / 2;
+ while (bottom <= top)
+ {
+ middle = (top + bottom) / 2;
+
+ index = proxyModel->index(middle, 0);
+ indexVisualRect = visualRect(index);
+ // We need the whole height (not only the visualRect). This will help
us to update
+ // all needed indexes correctly (ereslibre)
+ indexVisualRect.setHeight(indexVisualRect.height() + (itemHeight -
indexVisualRect.height()));
+
+ if (qMax(indexVisualRect.topLeft().y(),
+ indexVisualRect.bottomRight().y()) < qMin(rect.topLeft().y(),
+
rect.bottomRight().y()))
+ {
+ bottom = middle + 1;
+ }
+ else
+ {
+ top = middle - 1;
+ }
+ }
+
+ for (int i = middle; i < proxyModel->rowCount(); i++)
+ {
+ index = proxyModel->index(i, 0);
+ indexVisualRect = visualRect(index);
+
+ if (rect.intersects(indexVisualRect))
+ intersectedIndexes.append(index);
+
+ // If we passed next item, stop searching for hits
+ if (qMax(rect.bottomRight().y(), rect.topLeft().y()) <
+
qMin(indexVisualRect.topLeft().y(),
+
indexVisualRect.bottomRight().y()))
+ break;
+ }
+
+ return intersectedIndexes;
+}
+
+QRect KCategorizedView::Private::visualRectInViewport(const QModelIndex
&index) const
+{
+ if (!index.isValid())
+ return QRect();
+
+ QString curCategory = elementsInfo[index.row()].category;
+
+ QRect retRect;
+
+ if (listView->flow() == QListView::LeftToRight)
+ {
+ if (listView->layoutDirection() == Qt::LeftToRight)
+ {
+ retRect = QRect(listView->spacing(), listView->spacing() * 2 +
+ categoryDrawer->categoryHeight(index,
listView->viewOptions()), 0, 0);
+ }
+ else
+ {
+ retRect = QRect(listView->viewport()->width() -
listView->spacing(), listView->spacing() * 2 +
+ categoryDrawer->categoryHeight(index,
listView->viewOptions()), 0, 0);
+ }
+ }
+ else
+ {
+ retRect = QRect(listView->spacing(), listView->spacing() * 2 +
+ categoryDrawer->categoryHeight(index,
listView->viewOptions()), 0, 0);
+ }
+
+ int viewportWidth = listView->viewport()->width() - listView->spacing();
+
+ int itemHeight;
+ int itemWidth;
+
+ if (listView->gridSize().isEmpty() && (listView->flow() ==
QListView::LeftToRight))
+ {
+ itemHeight = biggestItemSize.height();
+ itemWidth = biggestItemSize.width();
+ }
+ else if (listView->flow() == QListView::LeftToRight)
+ {
+ itemHeight = listView->gridSize().height();
+ itemWidth = listView->gridSize().width();
+ }
+ else if (listView->gridSize().isEmpty() && (listView->flow() ==
QListView::TopToBottom))
+ {
+ itemHeight = biggestItemSize.height();
+ itemWidth = listView->viewport()->width() - listView->spacing() * 2;
+ }
+ else
+ {
+ itemHeight = listView->gridSize().height();
+ itemWidth = listView->gridSize().width() - listView->spacing() * 2;
+ }
+
+ int itemWidthPlusSeparation = listView->spacing() + itemWidth;
+ if (!itemWidthPlusSeparation)
+ itemWidthPlusSeparation++;
+ int elementsPerRow = viewportWidth / itemWidthPlusSeparation;
+ if (!elementsPerRow)
+ elementsPerRow++;
+
+ int column;
+ int row;
+
+ if (listView->flow() == QListView::LeftToRight)
+ {
+ column = elementsInfo[index.row()].relativeOffsetToCategory %
elementsPerRow;
+ row = elementsInfo[index.row()].relativeOffsetToCategory /
elementsPerRow;
+
+ if (listView->layoutDirection() == Qt::LeftToRight)
+ {
+ retRect.setLeft(retRect.left() + column * listView->spacing() +
+ column * itemWidth);
+ }
+ else
+ {
+ retRect.setLeft(retRect.right() - column * listView->spacing() -
+ column * itemWidth - itemWidth);
+
+ retRect.setRight(retRect.right() - column * listView->spacing() -
+ column * itemWidth);
+ }
+ }
+ else
+ {
+ elementsPerRow = 1;
+ column = elementsInfo[index.row()].relativeOffsetToCategory %
elementsPerRow;
+ row = elementsInfo[index.row()].relativeOffsetToCategory /
elementsPerRow;
+ }
+
+ foreach (const QString &category, categories)
+ {
+ if (category == curCategory)
+ break;
+
+ float rows = (float) ((float) categoriesIndexes[category].count() /
+ (float) elementsPerRow);
+
+ int rowsInt = categoriesIndexes[category].count() / elementsPerRow;
+
+ if (rows - trunc(rows)) rowsInt++;
+
+ retRect.setTop(retRect.top() +
+ (rowsInt * itemHeight) +
+ categoryDrawer->categoryHeight(index,
listView->viewOptions()) +
+ listView->spacing() * 2);
+
+ if (listView->gridSize().isEmpty())
+ {
+ retRect.setTop(retRect.top() +
+ (rowsInt * listView->spacing()));
+ }
+ }
+
+ if (listView->gridSize().isEmpty())
+ {
+ retRect.setTop(retRect.top() + row * listView->spacing() +
+ (row * itemHeight));
+ }
+ else
+ {
+ retRect.setTop(retRect.top() + (row * itemHeight));
+ }
+
+ retRect.setWidth(itemWidth);
+
+ QModelIndex heightIndex = proxyModel->index(index.row(), 0);
+ if (listView->gridSize().isEmpty())
+ {
+ retRect.setHeight(listView->sizeHintForIndex(heightIndex).height());
+ }
+ else
+ {
+
retRect.setHeight(qMin(listView->sizeHintForIndex(heightIndex).height(),
+ listView->gridSize().height()));
+ }
+
+ return retRect;
+}
+
+QRect KCategorizedView::Private::visualCategoryRectInViewport(const QString
&category) const
+{
+ QRect retRect(listView->spacing(),
+ listView->spacing(),
+ listView->viewport()->width() - listView->spacing() * 2,
+ 0);
+
+ if (!proxyModel->rowCount() || !categories.contains(category))
+ return QRect();
+
+ QModelIndex index = proxyModel->index(0, 0, QModelIndex());
+
+ int viewportWidth = listView->viewport()->width() - listView->spacing();
+
+ int itemHeight;
+ int itemWidth;
+
+ if (listView->gridSize().isEmpty())
+ {
+ itemHeight = biggestItemSize.height();
+ itemWidth = biggestItemSize.width();
+ }
+ else
+ {
+ itemHeight = listView->gridSize().height();
+ itemWidth = listView->gridSize().width();
+ }
+
+ int itemWidthPlusSeparation = listView->spacing() + itemWidth;
+ int elementsPerRow = viewportWidth / itemWidthPlusSeparation;
+
+ if (!elementsPerRow)
+ elementsPerRow++;
+
+ if (listView->flow() == QListView::TopToBottom)
+ {
+ elementsPerRow = 1;
+ }
+
+ foreach (const QString &itCategory, categories)
+ {
+ if (itCategory == category)
+ break;
+
+ float rows = (float) ((float) categoriesIndexes[itCategory].count() /
+ (float) elementsPerRow);
+ int rowsInt = categoriesIndexes[itCategory].count() / elementsPerRow;
+
+ if (rows - trunc(rows)) rowsInt++;
+
+ retRect.setTop(retRect.top() +
+ (rowsInt * itemHeight) +
+ categoryDrawer->categoryHeight(index,
listView->viewOptions()) +
+ listView->spacing() * 2);
+
+ if (listView->gridSize().isEmpty())
+ {
+ retRect.setTop(retRect.top() +
+ (rowsInt * listView->spacing()));
+ }
+ }
+
+ retRect.setHeight(categoryDrawer->categoryHeight(index,
listView->viewOptions()));
+
+ return retRect;
+}
+
+// We're sure elementsPosition doesn't contain index
+const QRect &KCategorizedView::Private::cacheIndex(const QModelIndex &index)
+{
+ QRect rect = visualRectInViewport(index);
+ elementsPosition[index.row()] = rect;
+
+ return elementsPosition[index.row()];
+}
+
+// We're sure categoriesPosition doesn't contain category
+const QRect &KCategorizedView::Private::cacheCategory(const QString &category)
+{
+ QRect rect = visualCategoryRectInViewport(category);
+ categoriesPosition[category] = rect;
+
+ return categoriesPosition[category];
+}
+
+const QRect &KCategorizedView::Private::cachedRectIndex(const QModelIndex
&index)
+{
+ if (elementsPosition.contains(index.row())) // If we have it cached
+ { // return it
+ return elementsPosition[index.row()];
+ }
+ else // Otherwise, cache it
+ { // and return it
+ return cacheIndex(index);
+ }
+}
+
+const QRect &KCategorizedView::Private::cachedRectCategory(const QString
&category)
+{
+ if (categoriesPosition.contains(category)) // If we have it cached
+ { // return it
+ return categoriesPosition[category];
+ }
+ else // Otherwise, cache it and
+ { // return it
+ return cacheCategory(category);
+ }
+}
+
+QRect KCategorizedView::Private::visualRect(const QModelIndex &index)
+{
+ QRect retRect = cachedRectIndex(index);
+ int dx = -listView->horizontalOffset();
+ int dy = -listView->verticalOffset();
+ retRect.adjust(dx, dy, dx, dy);
+
+ return retRect;
+}
+
+QRect KCategorizedView::Private::categoryVisualRect(const QString &category)
+{
+ QRect retRect = cachedRectCategory(category);
+ int dx = -listView->horizontalOffset();
+ int dy = -listView->verticalOffset();
+ retRect.adjust(dx, dy, dx, dy);
+
+ return retRect;
+}
+
+void KCategorizedView::Private::drawNewCategory(const QModelIndex &index,
+ int sortRole,
+ const QStyleOption &option,
+ QPainter *painter)
+{
+ if (!index.isValid())
+ {
+ return;
+ }
+
+ QStyleOption optionCopy = option;
+ const QString category = proxyModel->data(index,
KCategorizedSortFilterProxyModel::CategoryDisplayRole).toString();
+
+ optionCopy.state &= ~QStyle::State_Selected;
+
+ if ((listView->selectionMode() != SingleSelection) &&
(listView->selectionMode() != NoSelection)) {
+ if ((category == hoveredCategory) && !mouseButtonPressed)
+ {
+ optionCopy.state |= QStyle::State_MouseOver;
+ }
+ else if ((category == hoveredCategory) && mouseButtonPressed)
+ {
+ QPoint initialPressPosition =
listView->viewport()->mapFromGlobal(QCursor::pos());
+ initialPressPosition.setY(initialPressPosition.y() +
listView->verticalOffset());
+ initialPressPosition.setX(initialPressPosition.x() +
listView->horizontalOffset());
+
+ if (initialPressPosition == this->initialPressPosition)
+ {
+ optionCopy.state |= QStyle::State_Selected;
+ }
+ }
+ }
+
+ categoryDrawer->drawCategory(index,
+ sortRole,
+ optionCopy,
+ painter);
+}
+
+
+void KCategorizedView::Private::updateScrollbars()
+{
+ // find the last index in the last category
+ QModelIndex lastIndex = categoriesIndexes.isEmpty() ? QModelIndex() :
categoriesIndexes[categories.last()].last();
+
+ int lastItemBottom = cachedRectIndex(lastIndex).top() +
+ listView->spacing() + (listView->gridSize().isEmpty()
? biggestItemSize.height() : listView->gridSize().height()) -
listView->viewport()->height();
+
+ listView->horizontalScrollBar()->setRange(0, 0);
+
+ if (listView->verticalScrollMode() == QAbstractItemView::ScrollPerItem)
+ {
+ listView->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
+ }
+
+ if (listView->horizontalScrollMode() == QAbstractItemView::ScrollPerItem)
+ {
+ listView->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
+ }
+
+
listView->verticalScrollBar()->setSingleStep(listView->viewport()->height() /
10);
+ listView->verticalScrollBar()->setPageStep(listView->viewport()->height());
+ listView->verticalScrollBar()->setRange(0, lastItemBottom);
+}
+
+void KCategorizedView::Private::drawDraggedItems(QPainter *painter)
+{
+ QStyleOptionViewItemV3 option = listView->viewOptions();
+ option.state &= ~QStyle::State_MouseOver;
+ foreach (const QModelIndex &index,
listView->selectionModel()->selectedIndexes())
+ {
+ const int dx = mousePosition.x() - initialPressPosition.x() +
listView->horizontalOffset();
+ const int dy = mousePosition.y() - initialPressPosition.y() +
listView->verticalOffset();
+
+ option.rect = visualRect(index);
+ option.rect.adjust(dx, dy, dx, dy);
+
+ if (option.rect.intersects(listView->viewport()->rect()))
+ {
+ listView->itemDelegate(index)->paint(painter, option, index);
+ }
+ }
+}
+
+void KCategorizedView::Private::layoutChanged(bool forceItemReload)
+{
+ if (proxyModel && categoryDrawer && proxyModel->isCategorizedModel() &&
+ ((forceItemReload ||
+ (modelSortRole != proxyModel->sortRole()) ||
+ (modelSortColumn != proxyModel->sortColumn()) ||
+ (modelSortOrder != proxyModel->sortOrder()) ||
+ (modelLastRowCount != proxyModel->rowCount()) ||
+ (modelCategorized != proxyModel->isCategorizedModel()))))
+ {
+ // Force the view to update all elements
+ listView->rowsInsertedArtifficial(QModelIndex(), 0,
proxyModel->rowCount() - 1);
+
+ if (!forceItemReload)
+ {
+ modelSortRole = proxyModel->sortRole();
+ modelSortColumn = proxyModel->sortColumn();
+ modelSortOrder = proxyModel->sortOrder();
+ modelLastRowCount = proxyModel->rowCount();
+ modelCategorized = proxyModel->isCategorizedModel();
+ }
+ }
+ else if (proxyModel && categoryDrawer && proxyModel->isCategorizedModel())
+ {
+ updateScrollbars();
+ }
+}
+
+void KCategorizedView::Private::drawDraggedItems()
+{
+ QRect rectToUpdate;
+ QRect currentRect;
+ foreach (const QModelIndex &index,
listView->selectionModel()->selectedIndexes())
+ {
+ int dx = mousePosition.x() - initialPressPosition.x() +
listView->horizontalOffset();
+ int dy = mousePosition.y() - initialPressPosition.y() +
listView->verticalOffset();
+
+ currentRect = visualRect(index);
+ currentRect.adjust(dx, dy, dx, dy);
+
+ if (currentRect.intersects(listView->viewport()->rect()))
+ {
+ rectToUpdate = rectToUpdate.united(currentRect);
+ }
+ }
+
+ listView->viewport()->update(lastDraggedItemsRect.united(rectToUpdate));
+
+ lastDraggedItemsRect = rectToUpdate;
+}
+
+
+//==============================================================================
+
+
+KCategorizedView::KCategorizedView(QWidget *parent)
+ : QListView(parent)
+ , d(new Private(this))
+{
+}
+
+KCategorizedView::~KCategorizedView()
+{
+ delete d;
+}
+
+void KCategorizedView::setGridSize(const QSize &size)
+{
+ QListView::setGridSize(size);
+
+ d->layoutChanged(true);
+}
+
+void KCategorizedView::setModel(QAbstractItemModel *model)
+{
+ d->lastSelection = QItemSelection();
+ d->forcedSelectionPosition = 0;
+ d->elementsInfo.clear();
+ d->elementsPosition.clear();
+ d->categoriesIndexes.clear();
+ d->categoriesPosition.clear();
+ d->categories.clear();
+ d->intersectedIndexes.clear();
+ d->modelIndexList.clear();
+ d->hovered = QModelIndex();
+ d->mouseButtonPressed = false;
+ d->rightMouseButtonPressed = false;
+
+ if (d->proxyModel)
+ {
+ QObject::disconnect(d->proxyModel,
+ SIGNAL(layoutChanged()),
+ this, SLOT(slotLayoutChanged()));
+
+ QObject::disconnect(d->proxyModel,
+ SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ this, SLOT(slotLayoutChanged()));
+
+ QObject::disconnect(d->proxyModel,
+ SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsRemoved(QModelIndex,int,int)));
+ }
+
+ QListView::setModel(model);
+
+ d->proxyModel = dynamic_cast<KCategorizedSortFilterProxyModel*>(model);
+
+ if (d->proxyModel)
+ {
+ d->modelSortRole = d->proxyModel->sortRole();
+ d->modelSortColumn = d->proxyModel->sortColumn();
+ d->modelSortOrder = d->proxyModel->sortOrder();
+ d->modelLastRowCount = d->proxyModel->rowCount();
+ d->modelCategorized = d->proxyModel->isCategorizedModel();
+
+ QObject::connect(d->proxyModel,
+ SIGNAL(layoutChanged()),
+ this, SLOT(slotLayoutChanged()));
+
+ QObject::connect(d->proxyModel,
+ SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ this, SLOT(slotLayoutChanged()));
+
+ QObject::connect(d->proxyModel,
+ SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsRemoved(QModelIndex,int,int)));
+
+ if (d->proxyModel->rowCount())
+ {
+ d->layoutChanged(true);
+ }
+ }
+ else
+ {
+ d->modelCategorized = false;
+ }
+}
+
+QRect KCategorizedView::visualRect(const QModelIndex &index) const
+{
+ if (!d->proxyModel || !d->categoryDrawer ||
!d->proxyModel->isCategorizedModel())
+ {
+ return QListView::visualRect(index);
+ }
+
+ if (!qobject_cast<const QSortFilterProxyModel*>(index.model()))
+ {
+ return d->visualRect(d->proxyModel->mapFromSource(index));
+ }
+
+ return d->visualRect(index);
+}
+
+KCategoryDrawer *KCategorizedView::categoryDrawer() const
+{
+ return d->categoryDrawer;
+}
+
+void KCategorizedView::setCategoryDrawer(KCategoryDrawer *categoryDrawer)
+{
+ d->lastSelection = QItemSelection();
+ d->forcedSelectionPosition = 0;
+ d->elementsInfo.clear();
+ d->elementsPosition.clear();
+ d->categoriesIndexes.clear();
+ d->categoriesPosition.clear();
+ d->categories.clear();
+ d->intersectedIndexes.clear();
+ d->modelIndexList.clear();
+ d->hovered = QModelIndex();
+ d->mouseButtonPressed = false;
+ d->rightMouseButtonPressed = false;
+
+ if (!categoryDrawer && d->proxyModel)
+ {
+ QObject::disconnect(d->proxyModel,
+ SIGNAL(layoutChanged()),
+ this, SLOT(slotLayoutChanged()));
+
+ QObject::disconnect(d->proxyModel,
+ SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ this, SLOT(slotLayoutChanged()));
+
+ QObject::disconnect(d->proxyModel,
+ SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsRemoved(QModelIndex,int,int)));
+ }
+ else if (categoryDrawer && d->proxyModel)
+ {
+ QObject::connect(d->proxyModel,
+ SIGNAL(layoutChanged()),
+ this, SLOT(slotLayoutChanged()));
+
+ QObject::connect(d->proxyModel,
+ SIGNAL(dataChanged(QModelIndex,QModelIndex)),
+ this, SLOT(slotLayoutChanged()));
+
+ QObject::connect(d->proxyModel,
+ SIGNAL(rowsRemoved(QModelIndex,int,int)),
+ this, SLOT(rowsRemoved(QModelIndex,int,int)));
+ }
+
+ d->categoryDrawer = categoryDrawer;
+
+ if (categoryDrawer)
+ {
+ if (d->proxyModel)
+ {
+ if (d->proxyModel->rowCount())
+ {
+ d->layoutChanged(true);
+ }
+ }
+ }
+ else
+ {
+ updateGeometries();
+ }
+}
+
+QModelIndex KCategorizedView::indexAt(const QPoint &point) const
+{
+ if (!d->proxyModel || !d->categoryDrawer ||
!d->proxyModel->isCategorizedModel())
+ {
+ return QListView::indexAt(point);
+ }
+
+ QModelIndex index;
+
+ QModelIndexList item = d->intersectionSet(QRect(point, point));
+
+ if (item.count() == 1)
+ {
+ index = item[0];
+ }
+
+ return index;
+}
+
+void KCategorizedView::reset()
+{
+ QListView::reset();
+
+ d->lastSelection = QItemSelection();
+ d->forcedSelectionPosition = 0;
+ d->elementsInfo.clear();
+ d->elementsPosition.clear();
+ d->categoriesIndexes.clear();
+ d->categoriesPosition.clear();
+ d->categories.clear();
+ d->intersectedIndexes.clear();
+ d->modelIndexList.clear();
+ d->hovered = QModelIndex();
+ d->biggestItemSize = QSize(0, 0);
+ d->mouseButtonPressed = false;
+ d->rightMouseButtonPressed = false;
+}
+
+void KCategorizedView::paintEvent(QPaintEvent *event)
+{
+ if (!d->proxyModel || !d->categoryDrawer ||
!d->proxyModel->isCategorizedModel())
+ {
+ QListView::paintEvent(event);
+ return;
+ }
+
+ QStyleOptionViewItemV3 option = viewOptions();
+ option.widget = this;
+ if (wordWrap())
+ {
+ option.features |= QStyleOptionViewItemV2::WrapText;
+ }
+
+ QPainter painter(viewport());
+ QRect area = event->rect();
+ const bool focus = (hasFocus() || viewport()->hasFocus()) &&
+ currentIndex().isValid();
+ const QStyle::State state = option.state;
+ const bool enabled = (state & QStyle::State_Enabled) != 0;
+
+ painter.save();
+
+ QModelIndexList dirtyIndexes = d->intersectionSet(area);
+ foreach (const QModelIndex &index, dirtyIndexes)
+ {
+ option.state = state;
+ option.rect = visualRect(index);
+
+ if (selectionModel() && selectionModel()->isSelected(index))
+ {
+ option.state |= QStyle::State_Selected;
+ }
+
+ if (enabled)
+ {
+ QPalette::ColorGroup cg;
+ if ((d->proxyModel->flags(index) & Qt::ItemIsEnabled) == 0)
+ {
+ option.state &= ~QStyle::State_Enabled;
+ cg = QPalette::Disabled;
+ }
+ else
+ {
+ cg = QPalette::Normal;
+ }
+ option.palette.setCurrentColorGroup(cg);
+ }
+
+ if (focus && currentIndex() == index)
+ {
+ option.state |= QStyle::State_HasFocus;
+ if (this->state() == EditingState)
+ option.state |= QStyle::State_Editing;
+ }
+
+ // we are only interested to give the mouse over feedback when no
+ // dragging is happening (ereslibre)
+ if ((index == d->hovered) && !d->mouseButtonPressed &&
+ (this->state() == QAbstractItemView::NoState))
+ option.state |= QStyle::State_MouseOver;
+ else
+ option.state &= ~QStyle::State_MouseOver;
+
+ itemDelegate(index)->paint(&painter, option, index);
+ }
+
+ // Redraw categories
+ QStyleOptionViewItem otherOption;
+ bool intersectedInThePast = false;
+ foreach (const QString &category, d->categories)
+ {
+ otherOption = option;
+ otherOption.rect = d->categoryVisualRect(category);
+ otherOption.state &= ~QStyle::State_MouseOver;
+
+ if (otherOption.rect.intersects(area))
+ {
+ intersectedInThePast = true;
+
+ QModelIndex indexToDraw =
d->proxyModel->index(d->categoriesIndexes[category][0].row(),
d->proxyModel->sortColumn());
+
+ d->drawNewCategory(indexToDraw,
+ d->proxyModel->sortRole(), otherOption,
&painter);
+ }
+ else if (intersectedInThePast)
+ {
+ break; // the visible area has been finished, we don't need to
keep asking, the rest won't intersect
+ // this is doable because we know that categories are
correctly ordered on the list
+ }
+ }
+
+ if ((selectionMode() != SingleSelection) && (selectionMode() !=
NoSelection))
+ {
+ if (d->mouseButtonPressed && !d->isDragging)
+ {
+ QPoint start, end, initialPressPosition;
+
+ initialPressPosition = d->initialPressPosition;
+
+ initialPressPosition.setY(initialPressPosition.y() -
verticalOffset());
+ initialPressPosition.setX(initialPressPosition.x() -
horizontalOffset());
+
+ if (d->initialPressPosition.x() > d->mousePosition.x() ||
+ d->initialPressPosition.y() > d->mousePosition.y())
+ {
+ start = d->mousePosition;
+ end = initialPressPosition;
+ }
+ else
+ {
+ start = initialPressPosition;
+ end = d->mousePosition;
+ }
+
+ QStyleOptionRubberBand yetAnotherOption;
+ yetAnotherOption.initFrom(this);
+ yetAnotherOption.shape = QRubberBand::Rectangle;
+ yetAnotherOption.opaque = false;
+ yetAnotherOption.rect = QRect(start,
end).intersected(viewport()->rect().adjusted(-16, -16, 16, 16));
+ painter.save();
+ style()->drawControl(QStyle::CE_RubberBand, &yetAnotherOption,
&painter);
+ painter.restore();
+ }
+ }
+
+ if (d->isDragging && !d->dragLeftViewport)
+ {
+ painter.setOpacity(0.5);
+ d->drawDraggedItems(&painter);
+ }
+
+ painter.restore();
+}
+
+void KCategorizedView::resizeEvent(QResizeEvent *event)
+{
+ QListView::resizeEvent(event);
+
+ // Clear the items positions cache
+ d->elementsPosition.clear();
+ d->categoriesPosition.clear();
+ d->forcedSelectionPosition = 0;
+
+ if (!d->proxyModel || !d->categoryDrawer ||
!d->proxyModel->isCategorizedModel())
+ {
+ return;
+ }
+
+ d->updateScrollbars();
+}
+
+void KCategorizedView::setSelection(const QRect &rect,
+ QItemSelectionModel::SelectionFlags flags)
+{
+ if (!d->proxyModel || !d->categoryDrawer ||
!d->proxyModel->isCategorizedModel())
+ {
+ QListView::setSelection(rect, flags);
+ return;
+ }
+
+ if (!flags)
+ return;
+
+ if (flags & QItemSelectionModel::Clear)
+ {
+ selectionModel()->clear();
+ d->lastSelection.clear();
+ }
+
+ QModelIndexList dirtyIndexes = d->intersectionSet(rect);
+
+ // no items affected, just leave
+ if (!dirtyIndexes.count())
+ {
+ selectionModel()->select(d->lastSelection,
QItemSelectionModel::SelectCurrent);
+
+ return;
+ }
+
+ QModelIndex topLeft;
+ QModelIndex bottomRight;
+
+ if (d->mouseButtonPressed || d->rightMouseButtonPressed) // selection with
click + drag
+ {
+ QItemSelection selection;
+
+ QModelIndex prev = dirtyIndexes[0];
+ QModelIndex first = prev;
+ foreach (const QModelIndex &index, dirtyIndexes)
+ {
+ // we have a different interval. non-contiguous items
+ if ((index.row() - prev.row()) > 1) {
+ selection << QItemSelectionRange(first, prev);
+
+ first = index;
+ }
+
+ prev = index;
+ }
+
+ selection << QItemSelectionRange(first, prev);
+
+ if (flags & QItemSelectionModel::Current)
+ {
+ if (rect.topLeft() == rect.bottomRight())
+ {
+ selectionModel()->setCurrentIndex(indexAt(rect.topLeft()),
QItemSelectionModel::NoUpdate);
+ }
+
+ selection.merge(d->lastSelection, flags);
+ }
+ else
+ {
+ selection.merge(selectionModel()->selection(), flags);
+
+ selectionModel()->select(selection,
QItemSelectionModel::SelectCurrent);
+
+ return;
+ }
+
+ selectionModel()->select(selection, flags);
+ }
+ else // selection with click + keyboard keys
+ {
+ QModelIndex topLeftIndex = indexAt(QPoint(rect.topLeft().x(),
+ rect.topLeft().y()));
+ QModelIndex bottomRightIndex = indexAt(QPoint(rect.bottomRight().x(),
+ rect.bottomRight().y()));
+
+ // keyboard selection comes "upside down". Let's normalize it
+ if (topLeftIndex.row() > bottomRightIndex.row())
+ {
+ QModelIndex auxIndex = topLeftIndex;
+ topLeftIndex = bottomRightIndex;
+ bottomRightIndex = auxIndex;
+ }
+
+ int viewportWidth = viewport()->width() - spacing();
+ int itemWidth;
+
+ if (gridSize().isEmpty())
+ {
+ itemWidth = d->biggestItemSize.width();
+ }
+ else
+ {
+ itemWidth = gridSize().width();
+ }
+
+ int itemWidthPlusSeparation = spacing() + itemWidth;
+ if (!itemWidthPlusSeparation)
+ itemWidthPlusSeparation++;
+ int elementsPerRow = viewportWidth / itemWidthPlusSeparation;
+ if (!elementsPerRow)
+ elementsPerRow++;
+
+ QModelIndexList theoricDirty(dirtyIndexes);
+ dirtyIndexes.clear();
+ int first = model()->rowCount();
+ int last = 0;
+
+ foreach (const QModelIndex &index, theoricDirty)
+ {
+ if ((index.row() < first) &&
+ ((((topLeftIndex.row() / elementsPerRow) == (index.row() /
elementsPerRow)) &&
+ ((topLeftIndex.row() % elementsPerRow) <= (index.row() %
elementsPerRow))) ||
+ (topLeftIndex.row() / elementsPerRow) != (index.row() /
elementsPerRow)))
+ {
+ first = index.row();
+ topLeft = index;
+ }
+
+ if ((index.row() > last) &&
+ ((((bottomRightIndex.row() / elementsPerRow) == (index.row() /
elementsPerRow)) &&
+ ((bottomRightIndex.row() % elementsPerRow) >= (index.row() %
elementsPerRow))) ||
+ (bottomRightIndex.row() / elementsPerRow) != (index.row() /
elementsPerRow)))
+ {
+ last = index.row();
+ bottomRight = index;
+ }
+ }
+
+ for (int i = first; i <= last; i++)
+ {
+ dirtyIndexes << model()->index(i, theoricDirty[0].column(),
theoricDirty[0].parent());
+ }
+
+ QItemSelection selection(topLeft, bottomRight);
+
+ selectionModel()->select(selection, flags);
+ }
+}
+
+void KCategorizedView::mouseMoveEvent(QMouseEvent *event)
+{
+ QListView::mouseMoveEvent(event);
+
+ if (!d->proxyModel || !d->categoryDrawer ||
!d->proxyModel->isCategorizedModel())
+ {
+ return;
+ }
+
+ QModelIndexList item = d->intersectionSet(QRect(event->pos(),
event->pos()));
+
+ if (item.count() == 1)
+ {
+ d->hovered = item[0];
+ }
+ else
+ {
+ d->hovered = QModelIndex();
+ }
+
+ const QString previousHoveredCategory = d->hoveredCategory;
+
+ d->mousePosition = event->pos();
+ d->hoveredCategory = QString();
+
+ // Redraw categories
+ foreach (const QString &category, d->categories)
+ {
+ if (d->categoryVisualRect(category).intersects(QRect(event->pos(),
event->pos())))
+ {
+ d->hoveredCategory = category;
+ viewport()->update(d->categoryVisualRect(category));
+ }
+ else if ((category == previousHoveredCategory) &&
+
(!d->categoryVisualRect(previousHoveredCategory).intersects(QRect(event->pos(),
event->pos()))))
+ {
+ viewport()->update(d->categoryVisualRect(category));
+ }
+ }
+
+ QRect rect;
+ if (d->mouseButtonPressed && !d->isDragging)
+ {
+ QPoint start, end, initialPressPosition;
+
+ initialPressPosition = d->initialPressPosition;
+
+ initialPressPosition.setY(initialPressPosition.y() - verticalOffset());
+ initialPressPosition.setX(initialPressPosition.x() -
horizontalOffset());
+
+ if (d->initialPressPosition.x() > d->mousePosition.x() ||
+ d->initialPressPosition.y() > d->mousePosition.y())
+ {
+ start = d->mousePosition;
+ end = initialPressPosition;
+ }
+ else
+ {
+ start = initialPressPosition;
+ end = d->mousePosition;
+ }
+
+ rect = QRect(start, end).adjusted(-16, -16, 16, 16);
+ rect = rect.united(QRect(start, end).adjusted(16, 16, -16,
-16)).intersected(viewport()->rect());
+
+ viewport()->update(rect);
+ }
+}
+
+void KCategorizedView::mousePressEvent(QMouseEvent *event)
+{
+ d->dragLeftViewport = false;
+
+ if (event->button() == Qt::LeftButton)
+ {
+ d->mouseButtonPressed = true;
+
+ d->initialPressPosition = event->pos();
+ d->initialPressPosition.setY(d->initialPressPosition.y() +
+
verticalOffset());
+ d->initialPressPosition.setX(d->initialPressPosition.x() +
+
horizontalOffset());
+ }
+ else if (event->button() == Qt::RightButton)
+ {
+ d->rightMouseButtonPressed = true;
+ }
+
+ QListView::mousePressEvent(event);
+
+ d->lastSelection = selectionModel()->selection();
+
+ viewport()->update(d->categoryVisualRect(d->hoveredCategory));
+}
+
+void KCategorizedView::mouseReleaseEvent(QMouseEvent *event)
+{
+ d->mouseButtonPressed = false;
+ d->rightMouseButtonPressed = false;
+
+ QListView::mouseReleaseEvent(event);
+
+ if (!d->proxyModel || !d->categoryDrawer ||
!d->proxyModel->isCategorizedModel())
+ {
+ return;
+ }
+
+ QPoint initialPressPosition = viewport()->mapFromGlobal(QCursor::pos());
+ initialPressPosition.setY(initialPressPosition.y() + verticalOffset());
+ initialPressPosition.setX(initialPressPosition.x() + horizontalOffset());
+
+ if ((selectionMode() != SingleSelection) && (selectionMode() !=
NoSelection) &&
+ (initialPressPosition == d->initialPressPosition))
+ {
+ foreach(const QString &category, d->categories)
+ {
+ if (d->categoryVisualRect(category).contains(event->pos()))
+ {
+ QItemSelection selection = selectionModel()->selection();
+ QModelIndexList indexList = d->categoriesIndexes[category];
+
+ foreach (const QModelIndex &index, indexList)
+ {
+ QModelIndex selectIndex =
index.model()->index(index.row(), 0);
+
+ selection << QItemSelectionRange(selectIndex);
+ }
+
+ selectionModel()->select(selection,
QItemSelectionModel::SelectCurrent);
+
+ break;
+ }
+ }
+ }
+
+ QRect rect;
+ if (!d->isDragging)
+ {
+ QPoint start, end, initialPressPosition;
+
+ initialPressPosition = d->initialPressPosition;
+
+ initialPressPosition.setY(initialPressPosition.y() - verticalOffset());
+ initialPressPosition.setX(initialPressPosition.x() -
horizontalOffset());
+
+ if (d->initialPressPosition.x() > d->mousePosition.x() ||
+ d->initialPressPosition.y() > d->mousePosition.y())
+ {
+ start = d->mousePosition;
+ end = initialPressPosition;
+ }
+ else
+ {
+ start = initialPressPosition;
+ end = d->mousePosition;
+ }
+
+ rect = QRect(start, end).adjusted(-16, -16, 16, 16);
+ rect = rect.united(QRect(start, end).adjusted(16, 16, -16,
-16)).intersected(viewport()->rect());
+
+ viewport()->update(rect);
+ }
+
+ if (d->hovered.isValid())
+ viewport()->update(visualRect(d->hovered));
+ else if (!d->hoveredCategory.isEmpty())
+ viewport()->update(d->categoryVisualRect(d->hoveredCategory));
+}
+
+void KCategorizedView::leaveEvent(QEvent *event)
+{
+ d->hovered = QModelIndex();
+ d->hoveredCategory = QString();
+
+ QListView::leaveEvent(event);
+}
+
+void KCategorizedView::startDrag(Qt::DropActions supportedActions)
+{
+ // FIXME: QAbstractItemView does far better here since it sets the
+ // pixmap of selected icons to the dragging cursor, but it sets a
non
+ // ARGB window so it is no transparent. Use QAbstractItemView when
+ // this is fixed on Qt.
+ // QAbstractItemView::startDrag(supportedActions);
+#if !defined(DOLPHIN_DRAGANDDROP)
+ QListView::startDrag(supportedActions);
+#endif
+
+ d->isDragging = false;
+ d->mouseButtonPressed = false;
+ d->rightMouseButtonPressed = false;
+
+ viewport()->update(d->lastDraggedItemsRect);
+}
+
+void KCategorizedView::dragMoveEvent(QDragMoveEvent *event)
+{
+ d->mousePosition = event->pos();
+
+ if (d->mouseButtonPressed)
+ {
+ d->isDragging = true;
+ }
+ else
+ {
+ d->isDragging = false;
+ }
+
+ d->dragLeftViewport = false;
+
+#if defined(DOLPHIN_DRAGANDDROP)
+ QAbstractItemView::dragMoveEvent(event);
+#else
+ QListView::dragMoveEvent(event);
+#endif
+
+ if (!d->proxyModel || !d->categoryDrawer ||
!d->proxyModel->isCategorizedModel())
+ {
+ return;
+ }
+
+ d->drawDraggedItems();
+}
+
+void KCategorizedView::dragLeaveEvent(QDragLeaveEvent *event)
+{
+ d->dragLeftViewport = true;
+
+#if defined(DOLPHIN_DRAGANDDROP)
+ QAbstractItemView::dragLeaveEvent(event);
+#else
+ QListView::dragLeaveEvent(event);
+#endif
+}
+
+void KCategorizedView::dropEvent(QDropEvent *event)
+{
+#if defined(DOLPHIN_DRAGANDDROP)
+ QAbstractItemView::dropEvent(event);
+#else
+ QListView::dropEvent(event);
+#endif
+}
+
+QModelIndex KCategorizedView::moveCursor(CursorAction cursorAction,
+ Qt::KeyboardModifiers modifiers)
+{
+ if ((viewMode() != KCategorizedView::IconMode) ||
+ !d->proxyModel ||
+ !d->categoryDrawer ||
+ d->categories.isEmpty() ||
+ !d->proxyModel->isCategorizedModel())
+ {
+ return QListView::moveCursor(cursorAction, modifiers);
+ }
+
+ int viewportWidth = viewport()->width() - spacing();
+ int itemWidth;
+
+ if (gridSize().isEmpty())
+ {
+ itemWidth = d->biggestItemSize.width();
+ }
+ else
+ {
+ itemWidth = gridSize().width();
+ }
+
+ int itemWidthPlusSeparation = spacing() + itemWidth;
+ if (!itemWidthPlusSeparation)
+ itemWidthPlusSeparation++;
+ int elementsPerRow = viewportWidth / itemWidthPlusSeparation;
+ if (!elementsPerRow)
+ elementsPerRow++;
+
+ QModelIndex current = selectionModel()->currentIndex();
+
+ if (!current.isValid())
+ {
+ if (cursorAction == MoveEnd)
+ {
+ current = model()->index(model()->rowCount() - 1, 0,
QModelIndex());
+ d->forcedSelectionPosition =
d->elementsInfo[current.row()].relativeOffsetToCategory % elementsPerRow;
+ }
+ else
+ {
+ current = model()->index(0, 0, QModelIndex());
+ d->forcedSelectionPosition = 0;
+ }
+
+ return current;
+ }
+ else if (!current.isValid())
+ {
+ return QModelIndex();
+ }
+
+ QString lastCategory = d->categories.first();
+ QString theCategory = d->categories.first();
+ QString afterCategory = d->categories.first();
+
+ bool hasToBreak = false;
+ foreach (const QString &category, d->categories)
+ {
+ if (hasToBreak)
+ {
+ afterCategory = category;
+
+ break;
+ }
+
+ if (category == d->elementsInfo[current.row()].category)
+ {
+ theCategory = category;
+
+ hasToBreak = true;
+ }
+
+ if (!hasToBreak)
+ {
+ lastCategory = category;
+ }
+ }
+
+ switch (cursorAction)
+ {
+ case QAbstractItemView::MoveUp: {
+ if (d->elementsInfo[current.row()].relativeOffsetToCategory >=
elementsPerRow)
+ {
+ int indexToMove = current.row();
+ indexToMove -=
qMin(((d->elementsInfo[current.row()].relativeOffsetToCategory) +
d->forcedSelectionPosition), elementsPerRow - d->forcedSelectionPosition +
(d->elementsInfo[current.row()].relativeOffsetToCategory % elementsPerRow));
+
+ return d->proxyModel->index(indexToMove, 0);
+ }
+ else
+ {
+ int lastCategoryLastRow =
(d->categoriesIndexes[lastCategory].count() - 1) % elementsPerRow;
+ int indexToMove = current.row() -
d->elementsInfo[current.row()].relativeOffsetToCategory;
+
+ if (d->forcedSelectionPosition >= lastCategoryLastRow)
+ {
+ indexToMove -= 1;
+ }
+ else
+ {
+ indexToMove -= qMin((lastCategoryLastRow -
d->forcedSelectionPosition + 1), d->forcedSelectionPosition + elementsPerRow +
1);
+ }
+
+ return d->proxyModel->index(indexToMove, 0);
+ }
+ }
+
+ case QAbstractItemView::MoveDown: {
+ if (d->elementsInfo[current.row()].relativeOffsetToCategory <
(d->categoriesIndexes[theCategory].count() - 1 -
((d->categoriesIndexes[theCategory].count() - 1) % elementsPerRow)))
+ {
+ int indexToMove = current.row();
+ indexToMove += qMin(elementsPerRow,
d->categoriesIndexes[theCategory].count() - 1 -
d->elementsInfo[current.row()].relativeOffsetToCategory);
+
+ return d->proxyModel->index(indexToMove, 0);
+ }
+ else
+ {
+ int afterCategoryLastRow = qMin(elementsPerRow,
d->categoriesIndexes[afterCategory].count());
+ int indexToMove = current.row() +
(d->categoriesIndexes[theCategory].count() -
d->elementsInfo[current.row()].relativeOffsetToCategory);
+
+ if (d->forcedSelectionPosition >= afterCategoryLastRow)
+ {
+ indexToMove += afterCategoryLastRow - 1;
+ }
+ else
+ {
+ indexToMove += qMin(d->forcedSelectionPosition,
elementsPerRow);
+ }
+
+ return d->proxyModel->index(indexToMove, 0);
+ }
+ }
+
+ case QAbstractItemView::MoveLeft:
+ if (layoutDirection() == Qt::RightToLeft)
+ {
+ if (!(d->elementsInfo[current.row() +
1].relativeOffsetToCategory % elementsPerRow))
+ return current;
+
+ d->forcedSelectionPosition = d->elementsInfo[current.row() +
1].relativeOffsetToCategory % elementsPerRow;
+
+#if 0 //follow qt view behavior. lateral movements won't change visual row
+ if (d->forcedSelectionPosition < 0)
+ d->forcedSelectionPosition =
(d->categoriesIndexes[theCategory].count() - 1) % elementsPerRow;
+#endif
+
+ return d->proxyModel->index(current.row() + 1, 0);
+ }
+
+ if (!(d->elementsInfo[current.row()].relativeOffsetToCategory %
elementsPerRow))
+ return current;
+
+ d->forcedSelectionPosition = d->elementsInfo[current.row() -
1].relativeOffsetToCategory % elementsPerRow;
+
+#if 0 //follow qt view behavior. lateral movements won't change visual row
+ if (d->forcedSelectionPosition < 0)
+ d->forcedSelectionPosition =
(d->categoriesIndexes[theCategory].count() - 1) % elementsPerRow;
+#endif
+
+ return d->proxyModel->index(current.row() - 1, 0);
+
+ case QAbstractItemView::MoveRight:
+ if (layoutDirection() == Qt::RightToLeft)
+ {
+ if (!(d->elementsInfo[current.row()].relativeOffsetToCategory
% elementsPerRow))
+ return current;
+
+ d->forcedSelectionPosition = d->elementsInfo[current.row() -
1].relativeOffsetToCategory % elementsPerRow;
+
+#if 0 //follow qt view behavior. lateral movements won't change visual row
+ if (d->forcedSelectionPosition < 0)
+ d->forcedSelectionPosition =
(d->categoriesIndexes[theCategory].count() - 1) % elementsPerRow;
+#endif
+
+ return d->proxyModel->index(current.row() - 1, 0);
+ }
+
+ if (!(d->elementsInfo[current.row() + 1].relativeOffsetToCategory
% elementsPerRow))
+ return current;
+
+ d->forcedSelectionPosition = d->elementsInfo[current.row() +
1].relativeOffsetToCategory % elementsPerRow;
+
+#if 0 //follow qt view behavior. lateral movements won't change visual row
+ if (d->forcedSelectionPosition < 0)
+ d->forcedSelectionPosition =
(d->categoriesIndexes[theCategory].count() - 1) % elementsPerRow;
+#endif
+
+ return d->proxyModel->index(current.row() + 1, 0);
+
+ default:
+ break;
+ }
+
+ return QListView::moveCursor(cursorAction, modifiers);
+}
+
+void KCategorizedView::rowsInserted(const QModelIndex &parent,
+ int start,
+ int end)
+{
+ QListView::rowsInserted(parent, start, end);
+
+ if (!d->proxyModel || !d->categoryDrawer ||
!d->proxyModel->isCategorizedModel())
+ {
+ d->forcedSelectionPosition = 0;
+ d->elementsInfo.clear();
+ d->elementsPosition.clear();
+ d->categoriesIndexes.clear();
+ d->categoriesPosition.clear();
+ d->categories.clear();
+ d->intersectedIndexes.clear();
+ d->modelIndexList.clear();
+ d->hovered = QModelIndex();
+ d->biggestItemSize = QSize(0, 0);
+ d->mouseButtonPressed = false;
+ d->rightMouseButtonPressed = false;
+
+ return;
+ }
+
+ rowsInsertedArtifficial(parent, start, end);
+}
+
+void KCategorizedView::rowsInsertedArtifficial(const QModelIndex &parent,
+ int start,
+ int end)
+{
+ Q_UNUSED(parent);
+
+ d->forcedSelectionPosition = 0;
+ d->elementsInfo.clear();
+ d->elementsPosition.clear();
+ d->categoriesIndexes.clear();
+ d->categoriesPosition.clear();
+ d->categories.clear();
+ d->intersectedIndexes.clear();
+ d->modelIndexList.clear();
+ d->hovered = QModelIndex();
+ d->biggestItemSize = QSize(0, 0);
+ d->mouseButtonPressed = false;
+ d->rightMouseButtonPressed = false;
+
+ if (start > end || end < 0 || start < 0 || !d->proxyModel->rowCount())
+ {
+ return;
+ }
+
+ // Add all elements mapped to the source model and explore categories
+ QString prevCategory = d->proxyModel->data(d->proxyModel->index(0,
d->proxyModel->sortColumn()),
KCategorizedSortFilterProxyModel::CategoryDisplayRole).toString();
+ QString lastCategory = prevCategory;
+ QModelIndexList modelIndexList;
+ struct Private::ElementInfo elementInfo;
+ int offset = -1;
+ for (int k = 0; k < d->proxyModel->rowCount(); ++k)
+ {
+ QModelIndex index = d->proxyModel->index(k,
d->proxyModel->sortColumn());
+ QModelIndex indexSize = d->proxyModel->index(k, 0);
+
+ d->biggestItemSize = QSize(qMax(sizeHintForIndex(indexSize).width(),
+ d->biggestItemSize.width()),
+ qMax(sizeHintForIndex(indexSize).height(),
+ d->biggestItemSize.height()));
+
+ d->modelIndexList << index;
+
+ lastCategory = d->proxyModel->data(index,
KCategorizedSortFilterProxyModel::CategoryDisplayRole).toString();
+
+ elementInfo.category = lastCategory;
+
+ if (prevCategory != lastCategory)
+ {
+ offset = 0;
+ d->categoriesIndexes.insert(prevCategory, modelIndexList);
+ d->categories << prevCategory;
+ modelIndexList.clear();
+ }
+ else
+ {
+ offset++;
+ }
+
+ elementInfo.relativeOffsetToCategory = offset;
+
+ modelIndexList << index;
+ prevCategory = lastCategory;
+
+ d->elementsInfo.insert(index.row(), elementInfo);
+ }
+
+ d->categoriesIndexes.insert(prevCategory, modelIndexList);
+ d->categories << prevCategory;
+
+ d->updateScrollbars();
+
+ // FIXME: We need to safely save the last selection. This is on my TODO
+ // list (ereslibre).
+ selectionModel()->clear();
+}
+
+void KCategorizedView::rowsRemoved(const QModelIndex &parent,
+ int start,
+ int end)
+{
+ if (d->proxyModel && d->categoryDrawer &&
d->proxyModel->isCategorizedModel())
+ {
+ // Force the view to update all elements
+ rowsInsertedArtifficial(QModelIndex(), 0, d->proxyModel->rowCount() -
1);
+ }
+}
+
+void KCategorizedView::updateGeometries()
+{
+ if (!d->proxyModel || !d->categoryDrawer ||
!d->proxyModel->isCategorizedModel())
+ {
+ QListView::updateGeometries();
+ return;
+ }
+
+ // Avoid QListView::updateGeometries(), since it will try to set another
+ // range to our scroll bars, what we don't want (ereslibre)
+ QAbstractItemView::updateGeometries();
+}
+
+void KCategorizedView::slotLayoutChanged()
+{
+ d->layoutChanged();
+}
+
+void KCategorizedView::currentChanged(const QModelIndex &current,
+ const QModelIndex &previous)
+{
+ // We need to update the forcedSelectionPosition property in order to
correctly
+ // navigate after with keyboard using up & down keys
+
+ int viewportWidth = viewport()->width() - spacing();
+
+ int itemHeight;
+ int itemWidth;
+
+ if (gridSize().isEmpty())
+ {
+ itemHeight = d->biggestItemSize.height();
+ itemWidth = d->biggestItemSize.width();
+ }
+ else
+ {
+ itemHeight = gridSize().height();
+ itemWidth = gridSize().width();
+ }
+
+ int itemWidthPlusSeparation = spacing() + itemWidth;
+ if (!itemWidthPlusSeparation)
+ itemWidthPlusSeparation++;
+ int elementsPerRow = viewportWidth / itemWidthPlusSeparation;
+ if (!elementsPerRow)
+ elementsPerRow++;
+
+ if (d->mouseButtonPressed || d->rightMouseButtonPressed)
+ d->forcedSelectionPosition =
d->elementsInfo[current.row()].relativeOffsetToCategory % elementsPerRow;
+
+ QListView::currentChanged(current, previous);
+}
+
+#include "kcategorizedview.moc"

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview.h?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview.h
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview.h
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,119 @@
+/**
+ * This file is part of the KDE project
+ * Copyright (C) 2007 Rafael Fernández López <ereslibre@xxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef KCATEGORIZEDVIEW_H
+#define KCATEGORIZEDVIEW_H
+
+#include <QtGui/QListView>
+
+#include <kdeui_export.h>
+
+class KCategoryDrawer;
+
+/**
+ * @short Item view for listing items
+ *
+ * KCategorizedView allows you to use it as it were a QListView. You can add
an
+ * itemCategorizer to it, so your items became categorized depending on the
+ * KItemCategorizer inherited class rules.
+ *
+ * @see KItemCategorizer, KSortFilterProxyModel
+ *
+ * @author Rafael Fernández López <ereslibre@xxxxxxx>
+ */
+class KDEUI_EXPORT KCategorizedView
+ : public QListView
+{
+ Q_OBJECT
+
+public:
+ KCategorizedView(QWidget *parent = 0);
+
+ ~KCategorizedView();
+
+ virtual void setModel(QAbstractItemModel *model);
+
+ void setGridSize(const QSize &size);
+
+ virtual QRect visualRect(const QModelIndex &index) const;
+
+ KCategoryDrawer *categoryDrawer() const;
+
+ void setCategoryDrawer(KCategoryDrawer *categoryDrawer);
+
+ virtual QModelIndex indexAt(const QPoint &point) const;
+
+public Q_SLOTS:
+ virtual void reset();
+
+protected:
+ virtual void paintEvent(QPaintEvent *event);
+
+ virtual void resizeEvent(QResizeEvent *event);
+
+ virtual void setSelection(const QRect &rect,
+ QItemSelectionModel::SelectionFlags flags);
+
+ virtual void mouseMoveEvent(QMouseEvent *event);
+
+ virtual void mousePressEvent(QMouseEvent *event);
+
+ virtual void mouseReleaseEvent(QMouseEvent *event);
+
+ virtual void leaveEvent(QEvent *event);
+
+ virtual void startDrag(Qt::DropActions supportedActions);
+
+ virtual void dragMoveEvent(QDragMoveEvent *event);
+
+ virtual void dragLeaveEvent(QDragLeaveEvent *event);
+
+ virtual void dropEvent(QDropEvent *event);
+
+ virtual QModelIndex moveCursor(CursorAction cursorAction,
+ Qt::KeyboardModifiers modifiers);
+
+protected Q_SLOTS:
+ virtual void rowsInserted(const QModelIndex &parent,
+ int start,
+ int end);
+
+ virtual void rowsInsertedArtifficial(const QModelIndex &parent,
+ int start,
+ int end);
+
+ virtual void rowsRemoved(const QModelIndex &parent,
+ int start,
+ int end);
+
+ virtual void updateGeometries();
+
+ virtual void slotLayoutChanged();
+
+ virtual void currentChanged(const QModelIndex &current,
+ const QModelIndex &previous);
+
+
+private:
+ class Private;
+ Private *d;
+};
+
+#endif // KCATEGORIZEDVIEW_H

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview_p.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview_p.h?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview_p.h
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorizedview_p.h
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,164 @@
+/**
+ * This file is part of the KDE project
+ * Copyright (C) 2007 Rafael Fernández López <ereslibre@xxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef KCATEGORIZEDVIEW_P_H
+#define KCATEGORIZEDVIEW_P_H
+
+class KCategorizedSortFilterProxyModel;
+class KCategoryDrawer;
+
+/**
+ * @internal
+ */
+class KCategorizedView::Private
+{
+public:
+ Private(KCategorizedView *listView);
+ ~Private();
+
+
+ // Methods
+
+ /**
+ * Returns the list of items that intersects with @p rect
+ */
+ const QModelIndexList &intersectionSet(const QRect &rect);
+
+ /**
+ * Gets the item rect in the viewport for @p index
+ */
+ QRect visualRectInViewport(const QModelIndex &index) const;
+
+ /**
+ * Returns the category rect in the viewport for @p category
+ */
+ QRect visualCategoryRectInViewport(const QString &category) const;
+
+ /**
+ * Caches and returns the rect that corresponds to @p index
+ */
+ const QRect &cacheIndex(const QModelIndex &index);
+
+ /**
+ * Caches and returns the rect that corresponds to @p category
+ */
+ const QRect &cacheCategory(const QString &category);
+
+ /**
+ * Returns the rect that corresponds to @p index
+ * @note If the rect is not cached, it becomes cached
+ */
+ const QRect &cachedRectIndex(const QModelIndex &index);
+
+ /**
+ * Returns the rect that corresponds to @p category
+ * @note If the rect is not cached, it becomes cached
+ */
+ const QRect &cachedRectCategory(const QString &category);
+
+ /**
+ * Returns the visual rect (taking in count x and y offsets) for @p index
+ * @note If the rect is not cached, it becomes cached
+ */
+ QRect visualRect(const QModelIndex &index);
+
+ /**
+ * Returns the visual rect (taking in count x and y offsets) for @p
category
+ * @note If the rect is not cached, it becomes cached
+ */
+ QRect categoryVisualRect(const QString &category);
+
+ /**
+ * This method will draw a new category represented by index
+ * @param index on the rect specified by @p option.rect, with
+ * painter @p painter
+ */
+ void drawNewCategory(const QModelIndex &index,
+ int sortRole,
+ const QStyleOption &option,
+ QPainter *painter);
+
+ /**
+ * This method will update scrollbars ranges. Called when our model
changes
+ * or when the view is resized
+ */
+ void updateScrollbars();
+
+ /**
+ * This method will draw dragged items in the painting operation
+ */
+ void drawDraggedItems(QPainter *painter);
+
+ /**
+ * This method will determine which rect needs to be updated because of a
+ * dragging operation
+ */
+ void drawDraggedItems();
+
+ void layoutChanged(bool forceItemReload = false);
+
+
+ // Attributes
+
+ struct ElementInfo
+ {
+ QString category;
+ int relativeOffsetToCategory;
+ };
+
+ // Basic data
+ KCategorizedView *listView;
+ KCategoryDrawer *categoryDrawer;
+ QSize biggestItemSize;
+
+ // Behavior data
+ bool mouseButtonPressed;
+ bool rightMouseButtonPressed;
+ bool isDragging;
+ bool dragLeftViewport;
+ QModelIndex hovered;
+ QString hoveredCategory;
+ QPoint initialPressPosition;
+ QPoint mousePosition;
+ int forcedSelectionPosition;
+
+ // Cache data
+ // We cannot merge some of them into structs because it would affect
+ // performance
+ QHash<int, struct ElementInfo> elementsInfo;
+ QHash<int, QRect> elementsPosition;
+ QHash<QString, QModelIndexList> categoriesIndexes;
+ QHash<QString, QRect> categoriesPosition;
+ QStringList categories;
+ QModelIndexList intersectedIndexes;
+ QRect lastDraggedItemsRect;
+ int modelSortRole;
+ int modelSortColumn;
+ int modelLastRowCount;
+ bool modelCategorized;
+ Qt::SortOrder modelSortOrder;
+ QItemSelection lastSelection;
+
+ // Attributes for speed reasons
+ KCategorizedSortFilterProxyModel *proxyModel;
+ QModelIndexList modelIndexList;
+};
+
+#endif // KCATEGORIZEDVIEW_P_H

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorydrawer.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorydrawer.cpp?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorydrawer.cpp
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorydrawer.cpp
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,118 @@
+/**
+ * This file is part of the KDE project
+ * Copyright (C) 2007 Rafael Fernández López <ereslibre@xxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "kcategorydrawer.h"
+
+#include <QPainter>
+#include <QStyleOption>
+
+#include <kiconloader.h>
+#include <kcategorizedsortfilterproxymodel.h>
+
+KCategoryDrawer::KCategoryDrawer()
+{
+}
+
+KCategoryDrawer::~KCategoryDrawer()
+{
+}
+
+void KCategoryDrawer::drawCategory(const QModelIndex &index,
+ int /*sortRole*/,
+ const QStyleOption &option,
+ QPainter *painter) const
+{
+ const QString category = index.model()->data(index,
KCategorizedSortFilterProxyModel::CategoryDisplayRole).toString();
+
+ QColor color;
+
+ if (option.state & QStyle::State_Selected)
+ {
+ color = option.palette.color(QPalette::HighlightedText);
+ }
+ else
+ {
+ color = option.palette.color(QPalette::Text);
+ }
+
+ painter->save();
+ painter->setRenderHint(QPainter::Antialiasing);
+
+ if (option.state & QStyle::State_Selected)
+ {
+ QColor selected = option.palette.color(QPalette::Highlight);
+
+ QLinearGradient gradient(option.rect.topLeft(),
+ option.rect.bottomRight());
+ gradient.setColorAt(option.direction == Qt::LeftToRight ? 0
+ : 1, selected);
+ gradient.setColorAt(option.direction == Qt::LeftToRight ? 1
+ : 0,
Qt::transparent);
+
+ painter->fillRect(option.rect, gradient);
+ }
+ else if (option.state & QStyle::State_MouseOver)
+ {
+ QColor hover = option.palette.color(QPalette::Highlight).light();
+ hover.setAlpha(88);
+
+ QLinearGradient gradient(option.rect.topLeft(),
+ option.rect.bottomRight());
+ gradient.setColorAt(option.direction == Qt::LeftToRight ? 0
+ : 1, hover);
+ gradient.setColorAt(option.direction == Qt::LeftToRight ? 1
+ : 0,
Qt::transparent);
+
+ painter->fillRect(option.rect, gradient);
+ }
+
+ QFont painterFont = painter->font();
+ painterFont.setWeight(QFont::Bold);
+ QFontMetrics metrics(painterFont);
+ painter->setFont(painterFont);
+
+ QRect lineRect(option.rect.left(),
+ option.rect.bottom() - 1,
+ option.rect.width(),
+ 1);
+
+ QLinearGradient gradient(option.rect.topLeft(),
+ option.rect.bottomRight());
+ gradient.setColorAt(option.direction == Qt::LeftToRight ? 0
+ : 1, color);
+ gradient.setColorAt(option.direction == Qt::LeftToRight ? 1
+ : 0,
Qt::transparent);
+
+ painter->fillRect(lineRect, gradient);
+
+ painter->setPen(color);
+
+ painter->drawText(option.rect, Qt::AlignVCenter | Qt::AlignLeft,
+ metrics.elidedText(category, Qt::ElideRight, option.rect.width()));
+
+ painter->restore();
+}
+
+int KCategoryDrawer::categoryHeight(const QModelIndex &index, const
QStyleOption &option) const
+{
+ Q_UNUSED(index);
+
+ return option.fontMetrics.height() + 4 /* 3 separator; 1 gradient */;
+}

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorydrawer.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorydrawer.h?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorydrawer.h
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcategorydrawer.h
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,52 @@
+/**
+ * This file is part of the KDE project
+ * Copyright (C) 2007 Rafael Fernández López <ereslibre@xxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef KCATEGORYDRAWER_H
+#define KCATEGORYDRAWER_H
+
+#include <kdeui_export.h>
+
+class QPainter;
+class QModelIndex;
+class QStyleOption;
+
+class KDEUI_EXPORT KCategoryDrawer
+{
+public:
+ KCategoryDrawer();
+
+ virtual ~KCategoryDrawer();
+
+ /**
+ * This method purpose is to draw a category represented by the given
+ * @param index with the given @param sortRole sorting role
+ *
+ * @note This method will be called one time per category, always with the
+ * first element in that category
+ */
+ virtual void drawCategory(const QModelIndex &index,
+ int sortRole,
+ const QStyleOption &option,
+ QPainter *painter) const;
+
+ virtual int categoryHeight(const QModelIndex &index, const QStyleOption
&option) const;
+};
+
+#endif // KCATEGORYDRAWER_H

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmodulemodel.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmodulemodel.cpp?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmodulemodel.cpp
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmodulemodel.cpp
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,222 @@
+/* This file is part of the KDE project
+ Copyright 2007 Will Stephenson <wstephenson@xxxxxxx>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License or (at your option) version 3 or any later version
+ accepted by the membership of KDE e.V. (or its successor approved
+ by the membership of KDE e.V.), which shall act as a proxy
+ defined in Section 14 of version 3 of the license.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "kcmodulemodel.h"
+
+#include <QHash>
+#include <QList>
+#include <KDebug>
+#include <KIcon>
+#include <KServiceTypeTrader>
+
+#include "kcategorizedsortfilterproxymodel.h"
+#include "menuitem.h"
+
+Q_DECLARE_METATYPE(MenuItem *)
+
+SystemSettingsProxyModel::SystemSettingsProxyModel( QObject * parent )
+ : KCategorizedSortFilterProxyModel( parent )
+{
+
+}
+
+SystemSettingsProxyModel::~SystemSettingsProxyModel()
+{}
+
+bool SystemSettingsProxyModel::subSortLessThan(const QModelIndex &left, const
QModelIndex &right) const
+{
+ QVariant leftWeight = left.data( KCModuleModel::WeightRole );
+ QVariant rightWeight = right.data( KCModuleModel::WeightRole );
+
+ if ( !( leftWeight.isValid() && rightWeight.isValid() ) ) {
+ return KCategorizedSortFilterProxyModel::subSortLessThan( left, right
);
+ } else {
+ kDebug() << "comparing " << left.data().toString() << " (" <<
leftWeight.toInt() << ") and " << right.data().toString() << " (" <<
rightWeight.toInt() << ")";
+ if ( leftWeight.toInt() == rightWeight.toInt() ) {
+ return left.data().toString() < right.data().toString();
+ } else {
+ return leftWeight.toInt() < rightWeight.toInt();
+ }
+ }
+}
+
+
+bool SystemSettingsProxyModel::filterAcceptsRow( int source_row, const
QModelIndex & source_parent ) const
+{
+ QModelIndex index = sourceModel()->index( source_row, 0, source_parent );
+ MenuItem * mItem = index.data( Qt::UserRole ).value<MenuItem*>();
+ // accept only systemsettings categories that have children
+ if ( mItem->children.isEmpty() &&
mItem->service->serviceTypes().contains("SystemSettingsCategory" ) ) {
+ return false;
+ } else {
+ return KCategorizedSortFilterProxyModel::filterAcceptsRow( source_row,
source_parent );
+ }
+}
+
+int weightOfService( const KService::Ptr service )
+{
+ QVariant tmp = service->property( "X-KDE-Weight", QVariant::Int );
+ int weight = tmp.isValid() ? tmp.toInt() : 100;
+ return weight;
+}
+
+class KCModuleModelPrivate {
+public:
+ KCModuleModelPrivate(){
+ }
+
+ MenuItem * rootItem;
+};
+
+const int KCModuleModel::UserFilterRole = 0x015D1AE6;
+const int KCModuleModel::WeightRole = 0x03A8CC00;
+
+KCModuleModel::KCModuleModel( MenuItem * menuRoot, QObject * parent )
+ : QAbstractItemModel( parent ), d( new KCModuleModelPrivate )
+{
+ d->rootItem = menuRoot;
+}
+
+KCModuleModel::~KCModuleModel()
+{
+}
+
+int KCModuleModel::rowCount( const QModelIndex & index ) const
+{
+ int count = 0;
+ MenuItem * mi;
+ if ( index.isValid() ) {
+ mi = static_cast<MenuItem *>( index.internalPointer() );
+ } else {
+ mi = d->rootItem;
+ }
+ if ( mi ) {
+ foreach ( MenuItem * i, mi->children ) {
+ count += i->children.count();
+ }
+ }
+ return count;
+}
+
+int KCModuleModel::columnCount( const QModelIndex & /*index*/ ) const
+{
+ return 2; // name and comment
+}
+
+QModelIndex KCModuleModel::index( int row, int column, const QModelIndex &
parent ) const
+{
+ if ( !hasIndex( row, column, parent ) ) {
+ return QModelIndex();
+ }
+ MenuItem * parentItem;
+ if ( !parent.isValid() ) {
+ parentItem = d->rootItem;
+ } else {
+ parentItem = static_cast<MenuItem*>( parent.internalPointer() );
+ }
+ MenuItem * foundItem = parentItem->grandChildAt( row );
+ if ( foundItem ) {
+ QModelIndex index = createIndex( row, column, (void*)foundItem );
+ return index;
+ }
+ return QModelIndex();
+}
+
+
+QModelIndex KCModuleModel::parent( const QModelIndex & index ) const
+{
+ if ( !index.isValid() ) {
+ return QModelIndex();
+ }
+
+ MenuItem * parentItem = static_cast<MenuItem*>( index.internalPointer()
)->parent;
+ if ( parentItem == d->rootItem ) {
+ return QModelIndex();
+ } else {
+ return createIndex( parentItem->parent->children.indexOf( parentItem
), 0, parentItem );
+ }
+}
+
+QVariant KCModuleModel::data(const QModelIndex &index, int role) const
+{
+ MenuItem * mi = 0;
+ QVariant theData;
+ if ( !index.isValid() ) {
+ return QVariant();
+ }
+ mi = static_cast<MenuItem *>( index.internalPointer() );
+ QStringList searchKeyWords;
+ switch ( role ) {
+ case Qt::DisplayRole:
+ switch ( index.column() ) {
+ case 0:
+ theData.setValue( mi->service->name());
+ break;
+ case 1:
+ theData.setValue( mi->service->comment());
+ break;
+ default:
+ break;
+ }
+ break;
+ case Qt::DecorationRole:
+ if ( index.column() == 0 )
+ theData = QVariant( KIcon( mi->service->icon() ) );
+ break;
+ case KCategorizedSortFilterProxyModel::CategorySortRole:
+ if ( mi->parent )
+ theData.setValue( QString("%1%2").arg( QString::number(
weightOfService( mi->parent->service) ), 5, '0' ).arg(
mi->parent->service->name() ) );
+ break;
+ case KCategorizedSortFilterProxyModel::CategoryDisplayRole:
+ if ( mi->parent )
+ theData.setValue( mi->parent->service->name());
+ break;
+ case Qt::UserRole:
+ theData.setValue( mi );
+ break;
+ case UserFilterRole:
+ foreach ( MenuItem * child, mi->children ) {
+ searchKeyWords << child->item.keywords() <<
child->service->name();
+ }
+ searchKeyWords << mi->item.keywords() << mi->service->name();
+ theData.setValue( searchKeyWords.join( QString() ) );
+ break;
+ case WeightRole:
+ theData.setValue( weightOfService( mi->service ) );
+ break;
+ default:
+ break;
+ }
+ return theData;
+}
+
+Qt::ItemFlags KCModuleModel::flags(const QModelIndex &index) const
+{
+ if (!index.isValid())
+ return 0;
+
+ return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
+}
+
+QVariant KCModuleModel::headerData(int section, Qt::Orientation orientation,
int role ) const
+{
+ return QAbstractItemModel::headerData( section, orientation, role );
+}
+

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmodulemodel.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmodulemodel.h?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmodulemodel.h
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmodulemodel.h
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,66 @@
+/* This file is part of the KDE project
+ Copyright 2007 Will Stephenson <wstephenson@xxxxxxx>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License or (at your option) version 3 or any later version
+ accepted by the membership of KDE e.V. (or its successor approved
+ by the membership of KDE e.V.), which shall act as a proxy
+ defined in Section 14 of version 3 of the license.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+#ifndef KCMODULEMODEL_H
+#define KCMODULEMODEL_H
+
+#include <QAbstractItemModel>
+#include <kcategorizedsortfilterproxymodel.h>
+
+class MenuItem;
+class KCModuleModelPrivate;
+
+class SystemSettingsProxyModel : public KCategorizedSortFilterProxyModel
+{
+public:
+ SystemSettingsProxyModel(QObject *parent = 0);
+ virtual ~SystemSettingsProxyModel();
+ virtual bool subSortLessThan(const QModelIndex &left, const QModelIndex
&right) const;
+ virtual bool filterAcceptsRow( int source_column, const QModelIndex &
source_parent ) const;
+};
+
+class KCModuleModel : public QAbstractItemModel
+{
+Q_OBJECT
+public:
+ static const int UserFilterRole, WeightRole;
+ KCModuleModel( MenuItem * menuRoot, QObject * parent = 0 );
+ ~KCModuleModel();
+ // setup method
+ // QAbstractItemModel reimplementations
+ QModelIndex index( int row, int column, const QModelIndex & parent =
QModelIndex() ) const;
+ QModelIndex parent( const QModelIndex & index ) const;
+ int rowCount( const QModelIndex & index ) const;
+ int columnCount( const QModelIndex & index ) const;
+
+ QVariant data(const QModelIndex &index, int role) const;
+
+ Qt::ItemFlags flags(const QModelIndex &index) const;
+ QVariant headerData(int section, Qt::Orientation orientation, int role =
Qt::DisplayRole) const;
+private:
+ KCModuleModelPrivate * d;
+};
+
+class KCModuleSortFilterProxyModel : public KCategorizedSortFilterProxyModel
+{
+public:
+protected:
+};
+
+#endif

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmultiwidget.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmultiwidget.h?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmultiwidget.h
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kcmultiwidget.h
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,227 @@
+/*
+ Copyright (c) 2000 Matthias Elter <elter@xxxxxxx>
+ Copyright (c) 2003 Daniel Molkentin <molkentin@xxxxxxx>
+ Copyright (c) 2003 Matthias Kretz <kretz@xxxxxxx>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef KCMULTIWIDGET_H
+#define KCMULTIWIDGET_H
+
+// Qt
+#include <QtCore/QHash>
+#include <QtCore/QList>
+
+// KDE
+#include <kpagedialog.h>
+#include <kservice.h>
+
+class KCModuleProxy;
+class KCModuleInfo;
+
+/**
+ * @short A method that offers a KDialog containing arbitrary
+ * Control Modules.
+ */
+class /*KUTILS_EXPORT*/ KCMultiWidget : public KPageDialog
+{
+Q_OBJECT
+
+public:
+ /**
+ * Constructs a new KCMultiWidget
+ *
+ * @param parent The parent widget
+ * @param modality Qt::WindowModality value indicating the modality of the
window.
+ **/
+ KCMultiWidget( QWidget *parent=0,
+ Qt::WindowModality modality = Qt::NonModal );
+
+ /**
+ * Initialize the KIconDialog widget
+ *
+ * @param caption Specify the caption for the KIconDialog
+ * @param modality Qt::WindowModality value indicating the modality of the
window.
+ * If @p Qt::NonModal, the rest of the program interface
+ * (example: other dialogs) is accessible while the dialog is open.
+ **/
+ void InitKIconDialog(const QString& caption,
+ Qt::WindowModality modality = Qt::NonModal);
+
+ /**
+ * Destructor
+ **/
+ virtual ~KCMultiWidget();
+
+ /**
+ * Add a module.
+ *
+ * @param moduleinfo Pass a KCModuleInfo object which will be
+ * used for creating the module. It will be added
+ * to the list of modules the dialog will show.
+ **/
+ void addModule(const KCModuleInfo& moduleinfo);
+
+ /**
+ * @return the current module that is being shown.
+ */
+ KCModuleProxy * currentModule();
+
+signals:
+ /**
+ * Emitted after all KCModules have been told to save their configuration.
+ *
+ * The applyClicked and okClicked signals are emitted before the
+ * configuration is saved.
+ */
+ void configCommitted();
+
+ /**
+ * Emitted after the KCModules have been told to save their configuration.
+ * It is emitted once for every instance the KCMs that were changed belong
+ * to.
+ *
+ * You can make use of this if you have more than one component in your
+ * application. instanceName tells you the instance that has to reload its
+ * configuration.
+ *
+ * The applyClicked and okClicked signals are emitted before the
+ * configuration is saved.
+ *
+ * @param instanceName The name of the instance that needs to reload its
+ * configuration.
+ */
+ void configCommitted( const QByteArray & instanceName );
+
+ /**
+ * Emitted right before a module is shown.
+ * Useful for updating caption, help, etc
+ *
+ * @param moduleinfo The module that is about to be shown.
+ * @sense 3.4
+ */
+ void aboutToShow( KCModuleProxy *moduleProxy );
+
+ void close();
+
+protected slots:
+ /**
+ * This slot is called when the user presses the "Default" Button.
+ * You can reimplement it if needed.
+ *
+ * @note Make sure you call the original implementation.
+ **/
+ virtual void slotDefault();
+
+ /**
+ * This slot is called when the user presses the "Reset" Button.
+ * You can reimplement it if needed.
+ *
+ * @note Make sure you call the original implementation.
+ */
+ virtual void slotReset();
+ virtual void slotClose();
+
+ /**
+ * This slot is called when the user presses the "Apply" Button.
+ * You can reimplement it if needed.
+ *
+ * @note Make sure you call the original implementation.
+ **/
+ virtual void slotApply();
+
+ /**
+ * This slot is called when the user presses the "OK" Button.
+ * You can reimplement it if needed.
+ *
+ * @note Make sure you call the original implementation.
+ **/
+ virtual void slotOk();
+
+ /**
+ * This slot is called when the user presses the "Help" Button.
+ * It reads the DocPath field of the currently selected KControl
+ * module's .desktop file to find the path to the documentation,
+ * which it then attempts to load.
+ *
+ * You can reimplement this slot if needed.
+ *
+ * @note Make sure you call the original implementation.
+ **/
+ virtual void slotHelp();
+
+ virtual void slotCancel();
+
+private slots:
+
+ void slotAboutToShow(QWidget *);
+
+ void slotAboutToShow(KPageWidgetItem* current, KPageWidgetItem* before);
+
+ void clientChanged(bool state);
+
+ /**
+ * Called when entering root mode, and disables
+ * the Admin Mode button such that the user doesn't do it
+ * twice.
+ */
+ void disableRModeButton();
+
+ /**
+ * Called when the current module exits from root
+ * mode. Enables the Administrator Mode button, again.
+ */
+ void rootExit();
+
+public slots:
+
+ /**
+ *
+ * Called when the dialog is hidden. It unregisters the modules,
+ * such that they don't hinder the same modules to be opened in
+ * another application.
+ */
+ void dialogClosed();
+
+private:
+ void applyOrRevert(KCModuleProxy * module);
+
+ void init();
+ void apply();
+
+ struct CreatedModule
+ {
+ KCModuleProxy * kcm;
+ KService::Ptr service;
+ bool adminmode;
+ int buttons;
+ };
+ typedef QList<CreatedModule> ModuleList;
+ ModuleList m_modules;
+
+ typedef QMap<KService::Ptr, KCModuleProxy*> OrphanMap;
+ OrphanMap m_orphanModules;
+
+ QHash<KCModuleProxy*,QStringList> moduleParentComponents;
+ QString _docPath;
+
+ class KCMultiWidgetPrivate;
+ KCMultiWidgetPrivate *d;
+};
+
+#endif //KCMULTIWIDGET_H

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kicongrouppage.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kicongrouppage.cpp?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kicongrouppage.cpp
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kicongrouppage.cpp
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,134 @@
+/*
+ kicongrouppage.cpp
+
+ Copyright (c) 2007 Michael D. Stemle, Jr. <manchicken@xxxxxxxxxxxxx>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+*/
+
+#include <QtAlgorithms>
+#include <QStyle>
+
+#include "kicongrouppage.h"
+
+/*********** KIconGroupPage **************/
+KIconGroupPage::KIconGroupPage(QWidget* parent) : QFrame(parent) {
+ render();
+}
+
+KIconGroupPage::~KIconGroupPage() {
+ // Delete the rows...
+ qDeleteAll(m_rows.values().begin(), m_rows.values().end());
+ m_rows.clear();
+}
+
+const KIconGroupRow* KIconGroupPage::appendGroup(QString name) {
+ KIconGroupRow* group = new KIconGroupRow(name, parentWidget());
+
+ m_rows.insert(name, group);
+
+ render();
+
+ return group;
+}
+
+const KIconGroupItem* KIconGroupPage::appendIconToGroup(const QString& group,
+ const QIcon& icon,
+ const QString& label) {
+ if (!m_rows.contains(group)) {
+ appendGroup(group);
+ }
+
+ return m_rows[group]->appendIcon(icon, label);
+}
+
+void KIconGroupPage::render() {
+ m_layout = new QBoxLayout(QBoxLayout::TopToBottom, parentWidget());
+}
+
+
+/*********** KIconGroupRow **************/
+KIconGroupRow::KIconGroupRow(QWidget* parent) :
QBoxLayout(QBoxLayout::LeftToRight, parent) {
+ render();
+}
+
+KIconGroupRow::KIconGroupRow(QString& name, QWidget* parent) :
QBoxLayout(QBoxLayout::LeftToRight, parent) {
+ setGroupName(name);
+ render();
+}
+
+KIconGroupRow::~KIconGroupRow() {
+ // Let's delete our icons
+ qDeleteAll(m_icons.begin(), m_icons.end());
+ m_icons.clear();
+}
+
+const KIconGroupItem* KIconGroupRow::appendIcon( const QIcon& icon, const
QString& label ) {
+ KIconGroupItem* item = new KIconGroupItem(parentWidget(),icon,label);
+ item->setParent(parentWidget());
+
+ m_icons.append(item);
+
+ return item;
+}
+
+void KIconGroupRow::render() {
+}
+
+
+/*********** KIconGroupItem **************/
+KIconGroupItem::KIconGroupItem(QWidget* parent,
+ const QIcon& icon,
+ const QString& label) : QLabel(parent) {
+ m_parent = parent;
+ m_icon = icon;
+ m_text = label; // Lets keep our own copy...
+
+ render();
+}
+
+void KIconGroupItem::render() {
+ QStyle *stl = 0;
+
+ // If there's no parent, we've got no style, can't draw an icon.
+ if (!m_parent) {
+ return;
+ }
+
+ setPixmap(static_cast<const
QPixmap&>(m_icon.pixmap(m_parent->style()->pixelMetric(QStyle::PM_IconViewIconSize))));
+ setText(m_text);
+}
+
+void KIconGroupItem::setParent(QWidget* parent) {
+ m_parent = parent;
+
+ render();
+}
+
+void KIconGroupItem::setIcon(const QIcon& icon) {
+ m_icon = icon;
+
+ render();
+}
+
+void KIconGroupItem::setLabel(const QString& label) {
+ m_text = label;
+
+ render();
+}
+
+#include "kicongrouppage.moc"

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kicongrouppage.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kicongrouppage.h?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kicongrouppage.h
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/kicongrouppage.h
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,258 @@
+/*
+ kicongrouppage.h
+
+ Copyright (c) 2007 Michael D. Stemle, Jr. <manchicken@xxxxxxxxxxxxx>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public License
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
+
+*/
+
+#ifndef KICONGROUPPAGE_H
+
+#define KICONGROUPPAGE_H
+
+#include <QObject>
+#include <QList>
+#include <QMap>
+#include <QBoxLayout>
+#include <QIcon>
+#include <QLabel>
+#include <kicon.h>
+
+class KIconGroupPage;
+class KIconGroupRow;
+class KIconGroupItem;
+
+/* DESIGN
+ VBox contains two rows: title and HBOX (maybe a third for a line?
+ HBOX contains columns of VBOXes
+ Those VBoxes contain two rows: icon and title
+
+ +---------------Box-----------------+
+ | |
+ | +-------------Box---------------+ |
+ | | | |
+ | | +-----------Box-------------+ | |
+ | | | | | |
+ | | | +--QLabel--+ +--QLabel--+ | | |
+ | | | | | | | | | |
+ | | | | ICON | | ICON | | | |
+ | | | | LABEL | | LABEL | | | |
+ | | | | | | | | | |
+ | | | +----------+ +----------+ | | |
+ | | | | | |
+ | | +---------------------------+ | |
+ | | | |
+ | +-------------------------------+ |
+ | |
+ +-----------------------------------+
+
+
+ */
+
+
+/**
+ * A page of group icons
+ **/
+class KIconGroupPage : public QFrame {
+ Q_OBJECT;
+
+ /**
+ * Property for the page name
+ **/
+ Q_PROPERTY(QString m_pageName READ pageName WRITE setPageName);
+
+ public:
+
+ /**
+ * Constructor for KIconGroupPage
+ *
+ * @param parent The parent widget for the page..
+ **/
+ explicit KIconGroupPage(QWidget* parent = 0);
+
+ ~KIconGroupPage();
+
+ /**
+ * Append a group to the page
+ *
+ * @param title The title of the group
+ * @returns A constant pointer to the group that was added.
+ **/
+ void appendGroup(QString name);
+
+ /**
+ * Append an icon to a group
+ *
+ * @param group The group name to append the icon to
+ * @param icon The icon to use
+ * @param label The label to use with the icon
+ * @returns A constant pointer to the item that was added.
+ **/
+ const KIconGroupItem* appendIconToGroup(const QString& name,
+ const QIcon& icon,
+ const QString& label);
+
+ /**
+ * Set the page name
+ *
+ * @param name The name to assign.
+ **/
+ void setPageName(QString name) { m_pageName = name; };
+
+ /**
+ * Get the page name
+ *
+ * @return Returns the page name
+ **/
+ QString pageName() const { return m_pageName; };
+
+ private:
+ void render();
+
+ // Internal values
+ QString m_pageName;
+ QMap<QString, KIconGroupRow*> m_rows;
+ QBoxLayout* m_layout;
+};
+
+
+/**
+ * The row of icon groups
+ **/
+class KIconGroupRow : public QBoxLayout {
+ Q_OBJECT;
+
+ /**
+ * Property for the icon group name
+ **/
+ Q_PROPERTY(QString m_groupName READ groupName WRITE setGroupName);
+
+ public:
+
+ /**
+ * Constructor for KIconGroupRow
+ *
+ * @param parent The parent to stick the KIconGroupRow widget into.
+ **/
+ explicit KIconGroupRow(QWidget* parent = 0);
+
+ /**
+ * Constructor for KIconGroupRow
+ *
+ * @param parent The parent to stick the KIconGroupRow widget into.
+ * @param name The name for the icon group row.
+ **/
+ explicit KIconGroupRow(QString& name, QWidget* parent = 0);
+
+ /**
+ * Deconstructor
+ **/
+ ~KIconGroupRow();
+
+ /**
+ * Append an icon
+ *
+ * @param icon The icon to add
+ * @param label The label to add
+ * @returns A constant pointer to the item that was just added.
+ **/
+ const KIconGroupItem* appendIcon( const QIcon& icon, const QString& label );
+
+ /**
+ * Set the group name
+ *
+ * @param name The name to assign
+ **/
+ void setGroupName(QString name) { m_groupName = name; };
+
+ /**
+ * Get the group name
+ *
+ * @return The group name.
+ **/
+ QString groupName() const { return m_groupName; };
+
+ private:
+ void render();
+
+ QString m_groupName;
+ QList<KIconGroupItem*> m_icons;
+};
+
+
+/**
+ * KIconGroupItem
+ *
+ * @notes This is the low-level icon class for the icon groups.
+ **/
+class KIconGroupItem : public QLabel {
+ Q_OBJECT;
+
+ public:
+
+ /**
+ * A single icon in the group.
+ * @param parent The parent widget
+ * @param icon The icon to display
+ * @param label The label to display for the icon.
+ **/
+ explicit KIconGroupItem(QWidget* parent, const QIcon& icon, const QString&
label);
+
+ /**
+ * Set the parent widget
+ *
+ * @param parent The parent widget to set
+ **/
+ void setParent(QWidget* parent);
+
+ /**
+ * Set the icon
+ *
+ * @param icon The icon to add to the group item
+ **/
+ void setIcon(const QIcon& icon);
+
+ /**
+ * Get the icon
+ *
+ * @return Returns the currently set icon object
+ **/
+ const QIcon& icon() { return m_icon; };
+
+ /**
+ * Set the label
+ *
+ * @param label The label to set
+ **/
+ void setLabel(const QString& label);
+
+ /**
+ * Fetch the label
+ **/
+ const QString& label() { return m_text; };
+
+ protected:
+ void render();
+
+ private:
+ Q_DISABLE_COPY(KIconGroupItem);
+ QWidget* m_parent;
+ QIcon m_icon;
+ QString m_text;
+};
+
+#endif // KICONGROUPPAGE_H

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/main.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/main.cpp?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/main.cpp (added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/main.cpp Wed Feb
6 11:56:53 2008
@@ -0,0 +1,65 @@
+/**
+ * This file is part of the System Settings package
+ * Copyright (C) 2005 Benjamin C Meyer
+ * <ben+systempreferences at meyerhome dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <KAboutData>
+#include <KCmdLineArgs>
+#include <KIcon>
+#include <KLocale>
+#include <KUniqueApplication>
+
+#include "mainwindow.h"
+#include "version.h"
+
+#include <iostream>
+
+int main( int argc, char *argv[] )
+{
+ KLocale::setMainCatalog("systemsettings");
+ // About data
+ KAboutData aboutData("systemsettings", 0, ki18n("System Settings"),
+ SYSTEM_SETTINGS_VERSION, ki18n("System Settings"),
+ KAboutData::License_LGPL, ki18n("(c) 2005, Benjamin C.
Meyer; (c) 2007, Canonical Ltd"));
+ aboutData.addAuthor(ki18n("Benjamin C. Meyer"), ki18n("Author"),
+ "ben+systempreferences@xxxxxxxxxxxxx");
+ aboutData.addAuthor(ki18n("Jonathan Riddell"), ki18n("Contributor"),
+ "jriddell@xxxxxxxxxx");
+ aboutData.addAuthor(ki18n("Michael D. Stemle"), ki18n("Contributor"),
+ "manchicken@xxxxxxxxxxxxx");
+ aboutData.addAuthor(ki18n("Simon Edwards"), ki18n("Contributor"),
+ "simon@xxxxxxxxxxxxx");
+ aboutData.addAuthor(ki18n("Ellen Reitmayr"), ki18n("Usability"),
+ "ellen@xxxxxxx");
+ KCmdLineArgs::init(argc, argv, &aboutData);
+
+ if (!KUniqueApplication::start()) {
+ std::cerr << "This program is already running." << std::endl;
+ return 0;
+ }
+ KUniqueApplication application;
+
+ QApplication::setWindowIcon(KIcon("preferences-system"));
+
+ MainWindow *mainWindow = new MainWindow();
+
+ mainWindow->show();
+
+ return application.exec();
+}

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/mainwindow.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/mainwindow.cpp?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/mainwindow.cpp
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/mainwindow.cpp
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,491 @@
+/**
+ * This file is part of the System Settings package
+ * Copyright (C) 2005 Benjamin C Meyer (ben+systempreferences at meyerhome dot
net)
+ * (C) 2007 Will Stephenson <wstephenson@xxxxxxx>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "mainwindow.h"
+
+#include <QApplication>
+#include <QLabel>
+#include <QLayout>
+#include <QScrollArea>
+#include <QStackedWidget>
+
+#include <KAboutApplicationDialog>
+#include <KActionCollection>
+#include <KCModuleInfo>
+#include <KCModuleProxy>
+#include <KDebug>
+#include <KDialog> // for spacing
+#include <KGlobalSettings>
+#include <KIconLoader>
+#include <KLineEdit>
+#include <KLocale>
+#include <KMenuBar>
+#include <KServiceTypeTrader>
+#include <KStandardAction>
+#include <KTabWidget>
+#include <KToggleAction>
+#include <KToggleToolBarAction>
+#include <KToolBarSpacerAction>
+#include <kcategorizedsortfilterproxymodel.h>
+#include "kcategorizedview.h"
+#include "kcategorydrawer.h"
+
+#include "kcmodulemodel.h"
+#include "kcmultiwidget.h"
+#include "menuitem.h"
+#include "moduleiconitem.h"
+
+Q_DECLARE_METATYPE(MenuItem *)
+
+MainWindow::MainWindow(QWidget *parent) :
+ KXmlGuiWindow(parent), categories(
KServiceTypeTrader::self()->query("SystemSettingsCategory") ),
+ modules( KServiceTypeTrader::self()->query("KCModule") ),
+ rootItem(new MenuItem( true, 0 )),
+ groupWidget(NULL), selectedPage(0) {
+
+ // Load the menu structure in from disk.
+ readMenu( rootItem );
+ qStableSort( rootItem->children.begin(), rootItem->children.end(),
pageLessThan ); // sort tabs by weight
+ moduleTabs = new KTabWidget(this,
QTabWidget::North|QTabWidget::Rounded);
+ buildActions();
+ buildMainWidget();
+ setupGUI(ToolBar|Save|Create,QString());
+ //widgetChange();
+ menuBar()->hide();
+
+ connect(moduleTabs, SIGNAL(currentChanged(int)), SLOT(widgetChange()));
+}
+
+MainWindow::~MainWindow()
+{
+ delete moduleTabs;
+ delete rootItem;
+}
+
+QSize MainWindow::sizeHint() const
+{
+ return QSize(780, 580);
+}
+
+void MainWindow::readMenu( MenuItem * parent )
+{
+ // look for any categories inside this level, and recurse into them
+ int depth = 0;
+ MenuItem * current = parent;
+ while ( current && current->parent ) {
+ depth++;
+ current = current->parent;
+ }
+
+ QString space;
+ space.fill( ' ', depth * 2 );
+ kDebug() << space << "Looking for children in '" << parent->name << "'";
+ for (int i = 0; i < categories.size(); ++i) {
+ KService::Ptr entry = categories.at(i);
+ QString parentCategory =
entry->property("X-KDE-System-Settings-Parent-Category").toString();
+ QString category =
entry->property("X-KDE-System-Settings-Category").toString();
+ //kDebug() << "Examining category " << parentCategory << "/" <<
category;
+ if ( parentCategory == parent->name ) {
+ KCModuleInfo module( entry->entryPath() );
+
+ MenuItem * menuItem = new MenuItem(true, parent);
+ menuItem->name = category;
+ menuItem->service = entry;
+ menuItem->item = module;
+ readMenu( menuItem );
+ }
+ }
+
+ // scan for any modules at this level and add them
+ for (int i = 0; i < modules.size(); ++i) {
+ KService::Ptr entry = modules.at(i);
+ QString category =
entry->property("X-KDE-System-Settings-Parent-Category").toString();
+ //kDebug() << "Examining module " << category;
+ if(!parent->name.isEmpty() && category == parent->name ) {
+ kDebug() << space << "found module '" << entry->name() << "' " <<
entry->desktopEntryPath();
+ // Add the module info to the menu
+ KCModuleInfo module(entry->entryPath());
+ kDebug() << space << "filename is " << module.fileName();
+ //append(module);
+ MenuItem * infoItem = new MenuItem(false, parent);
+ infoItem->name = category;
+ infoItem->service = entry;
+ infoItem->item = module;
+ }
+ }
+}
+
+void MainWindow::closeEvent ( QCloseEvent * )
+{
+ if ( groupWidget ) {
+ groupWidget->dialogClosed();
+ }
+}
+
+void MainWindow::buildMainWidget()
+{
+ windowStack = new QStackedWidget(this);
+
+ // Top level pages.
+ moduleTabs->show();
+
+ foreach ( MenuItem* item, rootItem->children ) {
+ model = new KCModuleModel( item, this );
+ KCategoryDrawer * drawer = new KCategoryDrawer;
+ KCategorizedView * tv = new KCategorizedView( this );
+ tv->setSelectionMode(QAbstractItemView::SingleSelection);
+ tv->setSpacing(KDialog::spacingHint());
+ tv->setCategoryDrawer( drawer );
+ tv->setViewMode( QListView::IconMode );
+ tv->setItemDelegate( new ModuleIconItemDelegate( this ) );
+ tv->setMouseTracking( true );
+ tv->viewport()->setAttribute( Qt::WA_Hover );
+ KCategorizedSortFilterProxyModel * kcsfpm = new
SystemSettingsProxyModel( this );
+ kcsfpm->setCategorizedModel( true );
+ kcsfpm->setSourceModel( model );
+ kcsfpm->setFilterRole( KCModuleModel::UserFilterRole );
+ kcsfpm->setFilterCaseSensitivity( Qt::CaseInsensitive );
+ kcsfpm->sort( 0 );
+ tv->setModel( kcsfpm );
+ connect( tv,
+ SIGNAL(activated(const QModelIndex&)),
+ SLOT(selectionChanged(const QModelIndex&)) );
+ if (KGlobalSettings::singleClick()) {
+ connect( tv, SIGNAL(clicked(const QModelIndex&)),
+ SLOT(selectionChanged(const QModelIndex&)));
+ } else {
+ connect( tv, SIGNAL(doubleClicked(const QModelIndex&)),
+ SLOT(selectionChanged(const QModelIndex&)));
+ }
+ connect( search, SIGNAL(textChanged(const QString&)),
+ kcsfpm, SLOT(setFilterRegExp(const QString&)));
+ connect( kcsfpm, SIGNAL(layoutChanged()),
+ SLOT(updateSearchHits()) );
+ moduleTabs->addTab(tv, item->service->name() );
+ // record the index of the newly added tab so that we can later update
the label showing
+ // number of search hits
+ modelToTabHash.insert( kcsfpm, moduleTabs->count() - 1 );
+ }
+ windowStack->addWidget(moduleTabs);
+ windowStack->setCurrentWidget(moduleTabs);
+ setCentralWidget(windowStack);
+}
+
+void MainWindow::buildActions()
+{
+ addAction(actionCollection()->addAction(KStandardAction::Quit,
qobject_cast<QObject*>(this), SLOT(close())));
+
+ resetModule = actionCollection() -> addAction("resetModule");
+ resetModule->setText(i18n("Undo Changes"));
+ connect(resetModule, SIGNAL(triggered()), this, SLOT(close()));
+ resetModule->setEnabled(false);
+ addAction(resetModule);
+
+ defaultModule = actionCollection() -> addAction("defaultModule");
+ defaultModule->setText(i18n("Reset to Defaults"));
+ connect(defaultModule, SIGNAL(triggered()), this,
SLOT(showAllModules()));;
+ defaultModule->setEnabled(false);
+ addAction(defaultModule);
+
+ showAllAction = actionCollection()->addAction("showAll");
+ showAllAction->setIcon( KIcon(QApplication::layoutDirection() ==
Qt::RightToLeft?"go-next":"go-previous") );
+ showAllAction->setText( i18n("Overview") );
+ connect(showAllAction, SIGNAL(triggered()), this,
SLOT(showAllModules()));
+ showAllAction->setEnabled(false);
+ showAllAction->setShortcut(i18n("Ctrl+O"));
+ addAction(showAllAction);
+
+ aboutModuleAction = actionCollection() ->
addAction("help_about_module");
+ aboutModuleAction->setText(i18n("About Current Module"));
+ connect(aboutModuleAction, SIGNAL(triggered()), this,
SLOT(aboutCurrentModule()));
+ addAction(aboutModuleAction);
+
+ resetModuleHelp();
+
+ QWidget *searchWid = new QWidget( this );
+ QLabel * searchIcon = new QLabel( searchWid );
+ searchIcon->setPixmap( BarIcon( "system-search" ) );
+ QLabel *searchLabel = new QLabel( searchWid );
+ searchLabel->setObjectName( QLatin1String("SearchLabel"));
+ searchLabel->setText( i18n("S&earch:") );
+ searchLabel->setFont(KGlobalSettings::toolBarFont());
+ searchLabel->setMargin(2);
+ QHBoxLayout * hlay = new QHBoxLayout( searchWid );
+ hlay->addWidget( searchIcon );
+ hlay->addWidget( searchLabel );
+ searchWid->setLayout( hlay );
+
+ searchText = new KAction( this );
+ searchText->setDefaultWidget(searchWid);
+
+ //actionCollection()->addAction( "spacer", new KToolBarSpacerAction(
this ) );
+ actionCollection()->addAction( "searchText", searchText );
+ searchText->setShortcut(Qt::Key_F6);
+ addAction(searchText);
+
+ // Search edit box and result labels
+ QWidget *hbox = new QWidget( this );
+
+ search = new KLineEdit( hbox );
+ search->setObjectName(QLatin1String("search"));
+ search->setClearButtonShown( true );
+ search->setFocusPolicy( Qt::StrongFocus );
+ searchLabel->setBuddy( search );
+ connect(searchText, SIGNAL(triggered()), search, SLOT(setFocus()));
+
+ QWidget* vbox = new QWidget(hbox);
+ // Set a non empty content to prevent the toolbar from getting taller
when
+ // starting a search (at least with Oxygen style).
+ generalHitLabel = new QLabel(" ", vbox);
+ advancedHitLabel = new QLabel(" ", vbox);
+
+ QVBoxLayout* vlayout = new QVBoxLayout;
+ vlayout->setMargin(0);
+ vlayout->setSpacing(0);
+ vlayout->addWidget(generalHitLabel);
+ vlayout->addWidget(advancedHitLabel);
+ vlayout->setStretchFactor(generalHitLabel,1);
+ vlayout->setStretchFactor(advancedHitLabel,1);
+ vbox->setLayout(vlayout);
+
+ QHBoxLayout* hlayout = new QHBoxLayout;
+ hlayout->setMargin(0);
+ hlayout->addWidget(search);
+ hlayout->addWidget(vbox);
+ hlayout->setStretchFactor(search,1);
+ hlayout->setStretchFactor(vbox,1);
+ hbox->setLayout(hlayout);
+
+ searchAction = new KAction( "none", this );
+ searchAction->setDefaultWidget(hbox);
+ actionCollection()->addAction( "search", searchAction );
+ searchAction->setShortcutConfigurable( false );
+ hbox->setWhatsThis( i18n("Search Bar<p>Enter a search term.</p>") );
+#if 0
+ // Now it's time to draw our display
+ foreach( const MenuItem &item , menu->menuList() ) {
+ if( item.menu ) {
+ KServiceGroup::Ptr group = KServiceGroup::group(
item.subMenu );
+ if ( !group ){
+ kDebug() << "Invalid Group \"" << item.subMenu
<< "\". Check your installation.";
+ continue;
+ }
+
+ KToggleAction *newAction = new KToggleAction(
KIcon(group->icon()), group->caption(), this);
+ connect(newAction, SIGNAL(toggled(bool)), this,
SLOT(slotTopPage()));
+
+ pageActions.append(newAction);
+ kDebug() << "relpath is :" << group->relPath();
+ }
+ }
+#endif
+}
+
+void MainWindow::aboutCurrentModule()
+{
+ if(!groupWidget) {
+ return;
+ }
+
+ KCModuleProxy* module = groupWidget->currentModule();
+ if( module && module->aboutData() ){
+ KAboutApplicationDialog dlg( module->aboutData() );
+ dlg.exec();
+ }
+}
+
+void MainWindow::groupModulesFinished()
+{
+ showAllModules();
+}
+
+void MainWindow::showAllModules()
+{
+ windowStack->setCurrentWidget(moduleTabs);
+
+ // Reset the widget for normal all widget viewing
+ groupWidget = 0;
+ widgetChange();
+
+ showAllAction->setEnabled(false);
+ aboutModuleAction->setEnabled(false);
+
+ searchText->setEnabled(true);
+ search->setEnabled(true);
+ searchAction->setEnabled(true);
+
+ KToggleAction *currentRadioAction;
+ foreach ( currentRadioAction, pageActions ) {
+ currentRadioAction->setEnabled(true);
+ }
+
+ resetModuleHelp();
+}
+
+void MainWindow::selectionChanged( const QModelIndex& selected )
+{
+ if ( !selected.isValid() )
+ return;
+
+ MenuItem * mItem = selected.data( Qt::UserRole ).value<MenuItem*>();
+ if ( mItem ) {
+ kDebug() << "Selected item: " << mItem->service->name();
+ kDebug() << "Comment: " << mItem->service->comment();
+ } else {
+ kDebug() << ":'( Got dud pointer from " << selected.data(
Qt::DisplayRole ).toString();
+ }
+ // Because some KCMultiWidgets take an age to load, it is possible
+ // for the user to click another ModuleIconItem while loading.
+ // This causes execution to return here while the first groupWidget is
shown
+ if ( groupWidget )
+ return;
+
+ groupWidget = moduleItemToWidgetDict[mItem->service];
+
+ if( !groupWidget ) {
+ groupWidget = new KCMultiWidget(windowStack, Qt::NonModal); // THAT
ZERO IS NEW (actually the 0 can go, jr)
+ windowStack->addWidget(groupWidget);
+ moduleItemToWidgetDict.insert(mItem->service,groupWidget);
+
+ connect(groupWidget, SIGNAL(aboutToShow( KCModuleProxy * )), this,
SLOT(updateModuleHelp( KCModuleProxy * )));
+ connect(groupWidget, SIGNAL(finished()), this,
SLOT(groupModulesFinished()));
+ connect(groupWidget, SIGNAL(close()), this, SLOT(showAllModules()));
+
+ if ( ! mItem->menu ) {
+ groupWidget->addModule( mItem->item );
+ } else {
+ foreach ( MenuItem * i, mItem->children ) {
+ kDebug() << "adding " , i->item.fileName();
+ groupWidget->addModule( i->item );
+ }
+ }
+ }
+
+ // calling this with a shown KCMultiWidget sets groupWidget to 0
+ // which makes the show() call below segfault. The groupWidget test
+ // above should prevent execution reaching here while the KCMultiWidget is
+ // visible
+ windowStack->setCurrentWidget( groupWidget );
+
+ setCaption( mItem->service->name() );
+ showAllAction->setEnabled(true);
+ searchText->setEnabled(false);
+ search->setEnabled(false);
+ searchAction->setEnabled(false);
+
+ KToggleAction *currentRadioAction;
+ foreach ( currentRadioAction, pageActions ) {
+ currentRadioAction->setEnabled(false);
+ }
+}
+
+void MainWindow::updateModuleHelp( KCModuleProxy *currentModule ) {
+ if ( currentModule->aboutData() ) {
+ aboutModuleAction->setText(i18nc("Help menu->about
<modulename>", "About %1",
+
currentModule->moduleInfo().moduleName().replace("&","&&")));
+
aboutModuleAction->setIcon(KIcon(currentModule->moduleInfo().icon()));
+ aboutModuleAction->setEnabled(true);
+ }
+ else {
+ resetModuleHelp();
+ }
+}
+
+void MainWindow::resetModuleHelp() {
+ aboutModuleAction->setText(i18n("About Current Module"));
+ aboutModuleAction->setIcon(QIcon());
+ aboutModuleAction->setEnabled(false);
+}
+
+void MainWindow::widgetChange() {
+ QString name;
+ if( groupWidget && groupWidget->currentModule()) {
+ name = groupWidget->currentModule()->moduleInfo().moduleName();
+ }
+
+ if( !groupWidget ) {
+ setCaption(QString());
+
+ KCategorizedView * currentView = qobject_cast<KCategorizedView *>(
moduleTabs->currentWidget() );
+ currentView->selectionModel()->clear();
+ }
+}
+
+void MainWindow::slotTopPage() {
+ KToggleAction *clickedRadioAction = (KToggleAction *)sender();
+ selectedPage = pageActions.indexOf(clickedRadioAction);
+
+ KToggleAction *currentRadioAction;
+ foreach ( currentRadioAction, pageActions ) {
+
currentRadioAction->setChecked(currentRadioAction==clickedRadioAction);
+ }
+
+ windowStack->setCurrentWidget(overviewPages.at(selectedPage));
+}
+
+void MainWindow::updateSearchHits()
+{
+ // if the search lineedit is empty, clear the search labels
+ if ( search->text().isEmpty() ) {
+ generalHitLabel->setText(QString());
+ advancedHitLabel->setText(QString());
+ } else { // otherwise update the tab for the sender()
+ for ( int i = 0; i < moduleTabs->count(); i++ ) {
+ const KCategorizedSortFilterProxyModel * kcsfpm =
static_cast<KCategorizedSortFilterProxyModel*>( sender() );
+ if (kcsfpm && modelToTabHash.contains( kcsfpm ) ) {
+ switch ( modelToTabHash[ kcsfpm ] ) {
+ case 0:
+ generalHitLabel->setText(i18np("%1 hit in General","%1
hits in General", kcsfpm->rowCount()));
+ break;
+ case 1:
+ advancedHitLabel->setText(i18np("%1 hit in
Advanced","%1 hits in Advanced",kcsfpm->rowCount()));
+ break;
+ default:
+ kDebug() << "Hits found in top level system settings
other than General, Advanced, and the UI is hardcoded to only indicate hits in
these tabs";
+ }
+ }
+ }
+ }
+}
+
+void MainWindow::slotSearchHits(const QString &query, int *hitList, int
length) {
+ if(query.isEmpty()) {
+ generalHitLabel->setText(QString());
+ advancedHitLabel->setText(QString());
+ } else {
+
+ if(length>=1) {
+ generalHitLabel->setText(i18np("%1 hit in General","%1
hits in General",hitList[0]));
+ }
+
+ if(length>=2) {
+ advancedHitLabel->setText(i18np("%1 hit in
Advanced","%1 hits in Advanced",hitList[1]));
+ }
+
+ }
+}
+
+bool pageLessThan( MenuItem *page1, MenuItem *page2 )
+{
+ return page1->item.weight() < page2->item.weight();
+}
+
+#include "mainwindow.moc"

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/mainwindow.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/mainwindow.h?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/mainwindow.h
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/mainwindow.h Wed
Feb 6 11:56:53 2008
@@ -0,0 +1,111 @@
+/**
+ * This file is part of the System Settings package
+ * Copyright (C) 2005 Benjamin C Meyer (ben+systempreferences at meyerhome dot
net)
+ * (C) 2007 Will Stephenson <wstephenson@xxxxxxx>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+// KDE
+#include <KService>
+#include <KXmlGuiWindow>
+
+class QAbstractItemModel;
+class QAction;
+class QLabel;
+class QModelIndex;
+class QScrollArea;
+class QStackedWidget;
+class KAction;
+class KCModuleProxy;
+class KCModuleModel;
+class KCMultiWidget;
+class KLineEdit;
+class KTabWidget;
+class KToggleAction;
+class MenuItem;
+
+class MainWindow : public KXmlGuiWindow
+{
+ Q_OBJECT
+
+public:
+ explicit MainWindow(QWidget *parent=0);
+ ~MainWindow();
+ virtual void closeEvent ( QCloseEvent * );
+
+protected:
+ virtual QSize sizeHint() const;
+
+private slots:
+ void selectionChanged( const QModelIndex & selected );
+ void updateSearchHits();
+ void showAllModules();
+ void aboutCurrentModule();
+ void updateModuleHelp( KCModuleProxy * );
+
+ void resetModuleHelp();
+ void groupModulesFinished();
+
+ void widgetChange();
+ void slotTopPage();
+ void slotSearchHits(const QString &query, int *hitList, int length);
+
+private:
+ void readMenu( MenuItem * );
+
+ KCModuleModel *model;
+ KService::List categories;
+ KService::List modules;
+ MenuItem * rootItem;
+ QStackedWidget *windowStack;
+ KTabWidget *moduleTabs;
+ KLineEdit * search;
+
+ KCMultiWidget *groupWidget;
+ QScrollArea *scrollView;
+
+ QHash<KService::Ptr,KCMultiWidget*> moduleItemToWidgetDict;
+ QHash<const QAbstractItemModel *,int> modelToTabHash;
+
+ QList<KToggleAction*> pageActions;
+ QList<QScrollArea*> overviewPages;
+ int selectedPage;
+
+ QAction *resetModule;
+ QAction *defaultModule;
+
+ QAction *showAllAction;
+ KAction *searchText;
+ KAction *searchClear;
+ KAction *searchAction;
+
+ QAction *aboutModuleAction;
+
+ void buildMainWidget();
+ void buildActions();
+
+ QLabel *generalHitLabel;
+ QLabel *advancedHitLabel;
+};
+
+bool pageLessThan( MenuItem *page1, MenuItem *page2 );
+
+#endif
+

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/menuitem.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/menuitem.cpp?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/menuitem.cpp
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/menuitem.cpp Wed
Feb 6 11:56:53 2008
@@ -0,0 +1,60 @@
+/* This file is part of the KDE project
+ Copyright 2007 Will Stephenson <wstephenson@xxxxxxx>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License or (at your option) version 3 or any later version
+ accepted by the membership of KDE e.V. (or its successor approved
+ by the membership of KDE e.V.), which shall act as a proxy
+ defined in Section 14 of version 3 of the license.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "menuitem.h"
+
+MenuItem::MenuItem( bool isMenu, MenuItem * itsParent )
+ : parent( itsParent ),
+ menu( isMenu ),
+ name( QString() ),
+ caption( QString() ),
+ service( NULL ),
+ item( NULL )
+
+{
+ if ( parent ) {
+ parent->children.append( this );
+ }
+}
+
+MenuItem::~MenuItem()
+{
+ qDeleteAll( children );
+}
+
+MenuItem * MenuItem::grandChildAt( int index )
+{
+ int count = 0;
+ MenuItem * foundItem = 0;
+ foreach ( MenuItem * child, children ) {
+ foreach ( MenuItem * grandChild, child->children ) {
+ if ( count == index ) {
+ foundItem = grandChild;
+ break;
+ }
+ count++;
+ }
+ if ( foundItem ) {
+ break;
+ }
+ }
+ return foundItem;
+}
+

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/menuitem.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/menuitem.h?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/menuitem.h
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/menuitem.h Wed
Feb 6 11:56:53 2008
@@ -0,0 +1,45 @@
+/* This file is part of the KDE project
+ Copyright 2007 Will Stephenson <wstephenson@xxxxxxx>
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of
+ the License or (at your option) version 3 or any later version
+ accepted by the membership of KDE e.V. (or its successor approved
+ by the membership of KDE e.V.), which shall act as a proxy
+ defined in Section 14 of version 3 of the license.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+#ifndef KCMENUITEM_H
+#define KCMENUITEM_H
+
+#include <QList>
+#include <QString>
+#include <KCModuleInfo>
+#include <KService> // for KService::Ptr
+
+/**
+ * A menu consists of menu items. An item is either another menu or a module.
+ */
+class MenuItem {
+public:
+ MenuItem( bool isMenu, MenuItem * parent );
+ ~MenuItem();
+ MenuItem * grandChildAt( int index );
+ MenuItem * parent;
+ QList< MenuItem * > children;
+ bool menu;
+ QString name;
+ QString caption;
+ KService::Ptr service;
+ KCModuleInfo item;
+};
+
+#endif

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/moduleiconitem.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/moduleiconitem.cpp?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/moduleiconitem.cpp
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/moduleiconitem.cpp
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,133 @@
+/**
+ * This file is part of the System Settings package
+ * Copyright (C) 2005 Benjamin C Meyer
+* <ben+systempreferences at meyerhome dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "moduleiconitem.h"
+#include <kiconloader.h>
+#include <kdebug.h>
+#include <kcmoduleinfo.h>
+
+#include <climits>
+
+#include <qapplication.h>
+#include <qpainter.h>
+
+#define IMAGE_SIZE 32
+#define ICON_WIDTH 100
+
+ModuleIconItemDelegate::ModuleIconItemDelegate(QObject *parent) :
QItemDelegate(parent)
+{
+}
+
+void ModuleIconItemDelegate::paint(QPainter *painter, const
QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+ painter->save();
+ painter->setRenderHints(QPainter::Antialiasing |
QPainter::TextAntialiasing);
+
+ QStyle *style;
+ bool selected = option.state & QStyle::State_Selected || option.state &
QStyle::State_HasFocus;
+ if (const QStyleOptionViewItemV3 *v3 = qstyleoption_cast<const
QStyleOptionViewItemV3 *>(&option)) {
+ style = v3->widget->style();
+ if (!v3->widget->hasFocus()) selected = false;
+ } else {
+ style = QApplication::style();
+ }
+
+ if (selected) {
+ painter->fillPath(roundedRectangle(option.rect, 10),
option.palette.brush(QPalette::Highlight));
+
painter->setPen(option.palette.color(QPalette::HighlightedText));
+ }
+
+ if (!selected && (option.state & QStyle::State_MouseOver)) {
+ QColor hover = option.palette.color(QPalette::Highlight);
+ hover.setAlpha(88);
+ painter->fillPath(roundedRectangle(option.rect, 10), hover);
+ }
+
+ if( index.data( Qt::UserRole ).toInt() == KIconLoader::DisabledState ) {
+ painter->setPen( option.palette.color( QPalette::Disabled,
QPalette::Text ) );
+ }
+
+ const QSize &decorationSize = option.decorationSize;
+ QIcon::Mode iconMode = QIcon::Normal;
+ if (selected) iconMode = QIcon::Selected;
+ const QPixmap &pixmap =
qvariant_cast<QIcon>(index.data(Qt::DecorationRole)).pixmap(option.decorationSize,
iconMode);
+ int iconX = option.rect.left() + (option.rect.width() -
decorationSize.width()) / 2;
+ painter->drawPixmap(iconX, option.rect.top() +
style->pixelMetric(QStyle::PM_FocusFrameVMargin), decorationSize.width(),
decorationSize.height(), pixmap);
+
+ QRect textRectangle = option.rect;
+ textRectangle.setTop(textRectangle.top() + decorationSize.height() +
style->pixelMetric(QStyle::PM_FocusFrameVMargin));
+ painter->drawText(textRectangle, Qt::AlignHCenter | Qt::TextWordWrap,
index.data(Qt::DisplayRole).toString());
+ painter->restore();
+}
+
+// Method taken from KFileItemDelegate. Check whether it has been moved to
+// kdefx/kdrawutil.cpp as the comment says on Fredrik's code. If so, remove
+// this code (duplication), and use the library one.
+QPainterPath ModuleIconItemDelegate::roundedRectangle(const QRectF &rect,
qreal radius) const
+{
+ QPainterPath path(QPointF(rect.left(), rect.top() + radius));
+ path.quadTo(rect.left(), rect.top(), rect.left() + radius, rect.top());
// Top left corner
+ path.lineTo(rect.right() - radius, rect.top());
// Top side
+ path.quadTo(rect.right(), rect.top(), rect.right(), rect.top() +
radius); // Top right corner
+ path.lineTo(rect.right(), rect.bottom() - radius);
// Right side
+ path.quadTo(rect.right(), rect.bottom(), rect.right() - radius,
rect.bottom()); // Bottom right corner
+ path.lineTo(rect.left() + radius, rect.bottom());
// Bottom side
+ path.quadTo(rect.left(), rect.bottom(), rect.left(), rect.bottom() -
radius); // Bottom left corner
+ path.closeSubpath();
+
+ return path;
+}
+
+ModuleIconItem::ModuleIconItem( QListWidget* parent, const KCModuleInfo&
module)
+ : QListWidgetItem(SmallIcon( module.icon(), IMAGE_SIZE ),
module.moduleName(), parent),
+ imageName(module.icon())
+{
+ setData( Qt::UserRole, KIconLoader::DefaultState );
+ modules.append(module);
+ setSize();
+}
+
+ModuleIconItem::ModuleIconItem( QListWidget* parent, const QString &text,
+ const QString &_imageName )
+ : QListWidgetItem( SmallIcon( _imageName, IMAGE_SIZE ), text, parent ),
+ imageName(_imageName)
+{
+ setData( Qt::UserRole, KIconLoader::DefaultState );
+ setSize();
+}
+
+void ModuleIconItem::loadIcon( bool enabled )
+{
+ int newState = enabled ? KIconLoader::DefaultState :
KIconLoader::DisabledState;
+ if( newState == data( Qt::UserRole ).toInt() )
+ return;
+
+ setData( Qt::UserRole, newState );
+ setIcon( DesktopIcon( imageName, IMAGE_SIZE , newState ) );
+}
+
+void ModuleIconItem::setSize()
+{
+ QStyle *style = listWidget()->style();
+ QFontMetrics fm(font());
+ const QRect &rect = fm.boundingRect(0, 0, ICON_WIDTH, INT_MAX,
Qt::TextWordWrap, text());
+ setData(Qt::SizeHintRole, QSize(ICON_WIDTH, IMAGE_SIZE +
style->pixelMetric(QStyle::PM_FocusFrameVMargin) + rect.height()));
+}

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/moduleiconitem.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/moduleiconitem.h?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/moduleiconitem.h
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/moduleiconitem.h
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,74 @@
+/**
+ * This file is part of the System Settings package
+ * Copyright (C) 2005 Benjamin C Meyer
+ * <ben+systempreferences at meyerhome dot net>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef MODULEICONITEM_H
+#define MODULEICONITEM_H
+
+#include <QItemDelegate>
+#include <QListWidgetItem>
+#include <QList>
+#include <QPainterPath>
+#include <QRectF>
+
+class KCModuleInfo;
+
+class ModuleIconItemDelegate : public QItemDelegate
+{
+ public:
+ ModuleIconItemDelegate(QObject *parent);
+
+ void paint(QPainter *painter, const QStyleOptionViewItem
&option, const QModelIndex &index) const;
+
+ private:
+ // Method taken from KFileItemDelegate. Check whether it has
been moved to
+ // kdefx/kdrawutil.cpp as the comment says on Fredrik's code.
If so, remove
+ // this code (duplication), and use the library one.
+ QPainterPath roundedRectangle(const QRectF &rect, qreal radius)
const;
+};
+
+/**
+ * Stores information about what modules goes with this item.
+ * Also provides means of loading the enabled/disabled image (see kcmsearch).
+ */
+class ModuleIconItem : public QListWidgetItem
+{
+
+public:
+ ModuleIconItem( QListWidget *parent, const KCModuleInfo& module );
+
+ ModuleIconItem( QListWidget *parent, const QString &text, const QString
&imageName );
+
+ /**
+ * Update the icon to either be enabled or not.
+ */
+ void loadIcon( bool enabled = true );
+
+ // The modules that go with this item
+ QList<KCModuleInfo> modules;
+
+private:
+ void setSize();
+
+ QString imageName;
+};
+
+#endif // MODULEICONITEM_H
+

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/modulesview.cpp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/modulesview.cpp?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/modulesview.cpp
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/modulesview.cpp
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,189 @@
+/**
+ * This file is part of the System Settings package
+ * Copyright (C) 2005 Benjamin C Meyer (ben+systempreferences at meyerhome dot
net)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "modulesview.h"
+
+#include <qlabel.h>
+#include <QListWidget>
+#include <qlayout.h>
+#include <kiconloader.h>
+#include <kdebug.h>
+#include <kservicetypetrader.h>
+#include <QApplication>
+#include <kdialog.h>
+
+#include "kcmsearch.h"
+#include "moduleiconitem.h"
+#include "kcmodulemenu.h"
+
+ModulesView::ModulesView( KCModuleMenu *rootMenu, const QString &menuPath,
QWidget *parent ) : QWidget( parent ), rootMenu( NULL )
+{
+ this->rootMenu = rootMenu;
+ this->menuPath = menuPath;
+ this->categories =
KServiceTypeTrader::self()->query("SystemSettingsCategory");
+
+ QVBoxLayout *layout = new QVBoxLayout( this );
+ layout->setMargin( KDialog::marginHint() );
+ layout->setSpacing( KDialog::spacingHint() );
+ layout->setObjectName( QLatin1String( "layout" ) );
+
+ displayName = this->rootMenu->caption;
+
+ QList<MenuItem> subMenus = rootMenu->menuList(menuPath);
+ QList<MenuItem>::const_iterator it;
+ for ( it = subMenus.begin(); it != subMenus.end(); ++it ){
+ if( !(*it).menu )
+ continue;
+
+ // After the first time around add a line
+ if( it != subMenus.begin() ){
+ QFrame *line = new QFrame( this );
+ line->setObjectName( QLatin1String( "line" ) );
+ line->setFrameShadow( QFrame::Sunken );
+ line->setFrameShape( QFrame::HLine );
+ layout->addWidget( line );
+ }
+
+ // Build the row of modules/icons
+ createRow( (*it).subMenu, layout );
+ }
+ layout->addStretch(1);
+
+ setBackgroundRole(QPalette::Base);
+ setForegroundRole(QPalette::Text);
+
+ /*
+ // Align them up!
+ uint most = 0;
+ QList<RowIconView*>::iterator it2;
+ for ( it2 = groups.begin(); it2 != groups.end(); ++it2 ){
+ for (int i = 0; i < (*it2)->count(); ++i ) {
+ QListWidgetItem * item = (*it2)->item( i );
+ if ( item && item->sizeHint().width() > most ) {
+ most = item->sizeHint().width();
+ }
+ }
+ }
+*/
+/*FIXME
+ for ( it = groups.begin(); it != groups.end(); ++it )
+ (*it)->setGridX(most);
+
+ }
+*/
+}
+
+ModulesView::~ModulesView()
+{
+}
+
+void ModulesView::createRow( const QString &parentPath, QBoxLayout *boxLayout )
+{
+ //find the category name and search for it
+ QString categoryName = parentPath.section('/', -2, -2);
+ QString iconName;
+ for (int i = 0; i < categories.size(); ++i) {
+ const KService* entry = categories.at(i).data();
+ if (entry->name() == categoryName) {
+ iconName = entry->icon();
+ break;
+ }
+ }
+
+ // Make header
+ QHBoxLayout *rowLayout = new QHBoxLayout();
+ rowLayout->setMargin( 0 );
+ rowLayout->setSpacing( 6 );
+ rowLayout->setObjectName( QLatin1String( "rowLayout" ) );
+
+ // Header Icon
+ QLabel *icon = new QLabel( this );
+ icon->setObjectName( QLatin1String( "groupicon" ) );
+ icon->setPixmap( SmallIcon( iconName ));
+ QSizePolicy sp( QSizePolicy::Minimum, QSizePolicy::Preferred );
+ sp.setHeightForWidth( icon->sizePolicy().hasHeightForWidth() );
+ icon->setSizePolicy( sp );
+ rowLayout->addWidget( icon );
+
+ // Header Name
+ QLabel *textLabel = new QLabel( this );
+ textLabel->setObjectName( QLatin1String( "groupcaption" ) );
+ textLabel->setText( categoryName );
+ QSizePolicy sp1( QSizePolicy::Expanding, QSizePolicy::Preferred );
+ sp1.setHeightForWidth( textLabel->sizePolicy().hasHeightForWidth() );
+ textLabel->setSizePolicy( sp1 );
+ QFont textLabel_font( textLabel->font() );
+ textLabel_font.setBold( true );
+ textLabel->setFont( textLabel_font );
+ rowLayout->addWidget( textLabel );
+
+ boxLayout->addLayout( rowLayout );
+
+ // Make IconView
+ RowIconView* iconWidget = new RowIconView( this );
+ connect(iconWidget, SIGNAL( itemClicked( QListWidgetItem* ) ),
+ this, SIGNAL( itemSelected( QListWidgetItem* ) ) );
+ connect(iconWidget, SIGNAL( itemActivated( QListWidgetItem* ) ),
+ this, SIGNAL( itemSelected( QListWidgetItem* ) ) );
+ groups.append( iconWidget );
+ boxLayout->addWidget( iconWidget );
+
+ int height = 0;
+ // Add all the items in their proper order
+ QList<MenuItem> list = rootMenu->menuList( parentPath );
+ QList<MenuItem>::const_iterator it;
+ for ( it = list.begin(); it != list.end(); ++it ){
+ ModuleIconItem *item = NULL;
+ if( !(*it).menu ) {
+ item = new ModuleIconItem( iconWidget, (*it).item );
+ } else {
+ QString path = (*it).subMenu;
+
+ QString categoryCaption = (*it).caption;
+ QString iconFile;
+ for (int i = 0; i < categories.size(); ++i) {
+ const KService* entry = categories.at(i).data();
+ if (entry->name() == categoryCaption) {
+ iconFile = entry->icon();
+ break;
+ }
+ }
+
+ const QList<KCModuleInfo> &modules = rootMenu->modules(
path );
+ if ( modules.count() > 0 ) {
+ item = new ModuleIconItem( iconWidget,
categoryCaption, iconFile);
+ item->modules = modules;
+ }
+ }
+ if (item) height = qMax(height,
item->data(Qt::SizeHintRole).toSize().height());
+ }
+
+ // give the proper height to make all the items visible
+ iconWidget->setMinimumHeight(height);
+}
+
+void ModulesView::clearSelection() {
+ QList<RowIconView*>::const_iterator it;
+ for ( it = groups.begin(); it != groups.end(); ++it ) {
+ (*it)->clearSelection();
+ }
+}
+
+#include "modulesview.moc"

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/modulesview.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/modulesview.h?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/modulesview.h
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/modulesview.h
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,112 @@
+/**
+ * This file is part of the System Preferences package
+ * Copyright (C) 2005 Benjamin C Meyer (ben+systempreferences at meyerhome dot
net)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef MODULESVIEW_H
+#define MODULESVIEW_H
+
+#include "moduleiconitem.h"
+
+#include <QListWidget>
+#include <QList>
+
+#include <KService>
+/**
+ * Overloaded to give a larger default size that fits with text of two lines.
+ */
+class RowIconView : public QListWidget
+{
+
+public:
+ RowIconView( QWidget* parent ) : QListWidget( parent )
+ {
+ setResizeMode(Adjust);
+ setViewMode(IconMode);
+ setMovement(Static);
+ setFrameShape(NoFrame);
+ setWordWrap(true);
+ setItemDelegate(new ModuleIconItemDelegate(this));
+ }
+
+ // Figure out the hight/width to have only one row
+ QSize minimumSizeHint() const {
+ int width = 0;
+ /*
+ for ( QIconViewItem *item = firstItem(); item; item =
item->nextItem() )
+ width += item->width();
+ width +=
spacing()*(count())+(margin()+frameWidth()+lineWidth()+midLineWidth())*2 ;
+ */
+
+ //width = count()*gridX()+frameWidth()*2;
+ width = count()*gridSize().width()+frameWidth()*2;
+
+ int height =48;
+//FIXME for ( Q3IconViewItem *item = firstItem(); item; item =
item->nextItem() )
+// if(item->height() > height)
+// height = item->height();
+ // I honestly don't know where the 4+4 is coming from...
+ // What other spacing did I miss?
+ height +=
(/*margin()+*/frameWidth()+spacing()+lineWidth()+midLineWidth())*2+8;
+
+/*
+ int h = fontMetrics().height();
+ if ( h < 10 )
+ h = 10;
+ int f = 2 * frameWidth();
+ int height = ( 2*h ) + f + spacing() * 2 + 32 + lineWidth()*2 +
10;
+ */
+ return QSize( width, height );
+ }
+};
+
+class QBoxLayout;
+class KCModuleMenu;
+
+/**
+ * This widget contains the IconView's of all of the modules etc
+ * It is the basic thing that users see.
+ */
+class ModulesView : public QWidget
+{
+ // To search the groups
+ friend class KcmSearch;
+
+Q_OBJECT
+public:
+ void clearSelection();
+ QString displayName;
+
+signals:
+ void itemSelected( QListWidgetItem* item );
+
+public:
+ ModulesView( KCModuleMenu *rootMenu, const QString &menuPath, QWidget
*parent=0 );
+ ~ModulesView();
+
+private:
+ QList<RowIconView*> groups;
+ KCModuleMenu *rootMenu;
+ QString menuPath;
+ KService::List categories;
+
+ void createRow( const QString &parentPath, QBoxLayout *layout );
+};
+
+#endif // MODULESVIEW_H
+

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettings.desktop
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettings.desktop?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettings.desktop
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettings.desktop
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,111 @@
+[Desktop Entry]
+Exec=systemsettings -caption "%c" %i
+Icon=preferences-system
+Type=Application
+X-DocPath=systemsettings/index.html
+X-KDE-StartupNotify=true
+
+GenericName=System Settings
+GenericName[ar]=إعدادات النظام
+GenericName[bg]=Системни настройки
+GenericName[ca]=Arranjament del sistema
+GenericName[csb]=Systemòwé ùstôwë
+GenericName[de]=Systemeinstellungen
+GenericName[el]=Ρυθμίσεις συστήματος
+GenericName[eo]=Sistema agordo
+GenericName[es]=Preferencias del sistema
+GenericName[et]=Süsteemi seadistused
+GenericName[eu]=Sistemaren ezarpenak
+GenericName[fi]=Järjestelmän asetukset
+GenericName[fr]=Configuration du système
+GenericName[fy]=Systeemynstellings
+GenericName[ga]=Socruithe an Chórais
+GenericName[gl]=Configuración do Sistema
+GenericName[hu]=Rendszerbeállítások
+GenericName[is]=Kerfisstillingar
+GenericName[it]=Impostazioni di sistema
+GenericName[ja]=システム設定
+GenericName[km]=ការ​កំណត់​ប្រព័ន្ធ​
+GenericName[ko]=시스템 설정
+GenericName[ku]=Mîhengên Pergalê
+GenericName[lv]=Sistēmas iestatījumi
+GenericName[nb]=Systeminnstillinger
+GenericName[nds]=Systeeminstellen
+GenericName[nl]=Systeeminstellingen
+GenericName[nn]=Systemoppsett
+GenericName[pa]=ਸਿਸਟਮ ਸੈਟਿੰਗ
+GenericName[pl]=Ustawienia systemowe
+GenericName[pt]=Configuração do Sistema
+GenericName[pt_BR]=Configurações do Sistema
+GenericName[ru]=Системные параметры
+GenericName[se]=Vuogádatheivehusat
+GenericName[sl]=Sistemske nastavitve
+GenericName[sr]=Системске поставке
+GenericName[sr@latin]=Sistemske postavke
+GenericName[sv]=Systeminställningar
+GenericName[tg]=Танзимотҳои система
+GenericName[th]=ตั้งค่าระบบ
+GenericName[tr]=Sistem Ayarları
+GenericName[uk]=Системні параметри
+GenericName[wa]=Apontiaedjes do sistinme
+GenericName[x-test]=xxSystem Settingsxx
+GenericName[zh_CN]=系统设置
+GenericName[zh_TW]=系統設定
+
+Name=System Settings
+Name[ar]=إعدادات النظام
+Name[be]=Сістэмныя настаўленні
+Name[bg]=Системни настройки
+Name[br]=Dibarzhoù ar reizhiad
+Name[ca]=Arranjament del sistema
+Name[csb]=Systemòwé ùstôwë
+Name[de]=Systemeinstellungen
+Name[el]=Ρυθμίσεις συστήματος
+Name[eo]=Sistema agordo
+Name[es]=Preferencias del sistema
+Name[et]=Süsteemi seadistused
+Name[eu]=Sistemaren ezarpenak
+Name[fa]=تنظیمات سیستم
+Name[fi]=Järjestelmän asetukset
+Name[fr]=Configuration du système
+Name[fy]=Systeemynstellings
+Name[ga]=Socruithe an Chórais
+Name[gl]=Configuración do sistema
+Name[he]=הגדרות מערכת
+Name[hi]=तंत्र विन्यास
+Name[hr]=Postavke sustava
+Name[hu]=Rendszerbeállítások
+Name[is]=Kerfisstillingar
+Name[it]=Impostazioni di sistema
+Name[ja]=KDE システム設定
+Name[kk]=Жүйе параметрлері
+Name[km]=ការ​កំណត់​ប្រព័ន្ធ​
+Name[ko]=시스템 설정
+Name[ku]=Mîhengên Pergalê
+Name[lv]=Sistēmas iestatījumi
+Name[nb]=Systeminnstillinger
+Name[nds]=Systeeminstellen
+Name[ne]=प्रणाली सेटिङ
+Name[nl]=Systeeminstellingen
+Name[nn]=Systemoppsett
+Name[pa]=ਸਿਸਟਮ ਸੈਟਿੰਗ
+Name[pl]=Ustawienia systemowe
+Name[pt]=Configuração do Sistema
+Name[pt_BR]=Configurações do Sistema
+Name[ru]=Системные параметры
+Name[se]=Vuogádatheivehusat
+Name[sl]=Sistemske nastavitve
+Name[sr]=Системске поставке
+Name[sr@latin]=Sistemske postavke
+Name[sv]=Systeminställningar
+Name[tg]=Танзимотҳои система
+Name[th]=ตั้งค่าระบบ
+Name[tr]=Sistem Ayarları
+Name[uk]=Системні параметри
+Name[wa]=Apontiaedjes do sistinme
+Name[x-test]=xxSystem Settingsxx
+Name[zh_CN]=系统设置
+Name[zh_TW]=系統設定
+
+X-DBUS-StartupType=Unique
+Categories=Qt;KDE;System;

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettingsrc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettingsrc?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettingsrc
(added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettingsrc
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,3 @@
+[MainWindow Toolbar mainToolBar]
+ToolButtonStyle=TextBesideIcon
+

Added:
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettingsui.rc
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettingsui.rc?rev=44181&view=auto
==============================================================================
---
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettingsui.rc
(added)
+++
branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/systemsettingsui.rc
Wed Feb 6 11:56:53 2008
@@ -0,0 +1,32 @@
+<!DOCTYPE kpartgui>
+<kpartgui name="systemsettings" version="1">
+
+<MenuBar>
+ <Menu name="file"><Text>&amp;File</Text>
+ <Action name="resetModule"/>
+ <Action name="defaultModule"/>
+ <Separator/>
+ </Menu>
+
+ <Menu name="view"><Text>&amp;View</Text>
+ <Action name="showAll"/>
+ </Menu>
+
+ <Menu name="help">
+ <Action name="help_about_module" append="about_merge"/>
+ </Menu>
+</MenuBar>
+
+<ToolBar name="mainToolBar" iconText="icontextright">
+ <Action name="showAll"/>
+ <Separator/>
+ <Action name="spacer"/>
+ <Action name="searchText"/>
+ <Action name="search"/>
+</ToolBar>
+
+<ActionProperties>
+ <Action name="showAll" />
+</ActionProperties>
+
+</kpartgui>

Added: branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/version.h
URL:
http://svn.opensuse.org/viewcvs/yast/branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/version.h?rev=44181&view=auto
==============================================================================
--- branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/version.h (added)
+++ branches/tmp/tgoettlicher/yast2_2nd_rewrite/systemsettings/version.h Wed
Feb 6 11:56:53 2008
@@ -0,0 +1,28 @@
+/**
+ * This file is part of the System Settings package
+ * Copyright (C) 2005 Benjamin C Meyer (ben+systempreferences at meyerhome dot
net)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef VERSION_H
+#define VERSION_H
+
+#include <kdeversion.h>
+#define SYSTEM_SETTINGS_VERSION KDE_VERSION_STRING
+
+#endif // VERSION_H
+

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages