Browse Source

Added KDE3 version of kde-systemsettings


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kde-systemsettings@1089234 283d02a7-25f6-0310-bc7c-ecb5cbfe19
tags/v3.5.13
tpearson 9 years ago
commit
686c40f4da
78 changed files with 30563 additions and 0 deletions
  1. 1
    0
      AUTHOR
  2. 21
    0
      CMakeLists.txt
  3. 22
    0
      INDEX
  4. 167
    0
      INSTALL
  5. 5
    0
      Mainpage.dox
  6. 22
    0
      Makefile.am
  7. 21
    0
      Makefile.am.in
  8. 40
    0
      README
  9. 23
    0
      TODO
  10. 12420
    0
      acinclude.m4
  11. 13293
    0
      aclocal.m4
  12. 394
    0
      config.h.in
  13. 2
    0
      configure.files
  14. 146
    0
      configure.in
  15. 30
    0
      configure.in.in
  16. 0
    0
      stamp-h.in
  17. 1
    0
      subdirs
  18. 31
    0
      systemsettings/HACKING
  19. 125
    0
      systemsettings/LAYOUT.html
  20. 45
    0
      systemsettings/Makefile.am
  21. BIN
      systemsettings/cr128-app-systemsettings.png
  22. BIN
      systemsettings/cr16-app-systemsettings.png
  23. BIN
      systemsettings/cr22-app-systemsettings.png
  24. BIN
      systemsettings/cr32-app-systemsettings.png
  25. BIN
      systemsettings/cr48-app-systemsettings.png
  26. BIN
      systemsettings/cr64-app-systemsettings.png
  27. 188
    0
      systemsettings/kcmodulemenu.cpp
  28. 158
    0
      systemsettings/kcmodulemenu.h
  29. 101
    0
      systemsettings/kcmsearch.cpp
  30. 67
    0
      systemsettings/kcmsearch.h
  31. 431
    0
      systemsettings/kcmultiwidget.cpp
  32. 255
    0
      systemsettings/kcmultiwidget.h
  33. 38
    0
      systemsettings/kcscrollview.cpp
  34. 35
    0
      systemsettings/kcscrollview.h
  35. 62
    0
      systemsettings/main.cpp
  36. 362
    0
      systemsettings/mainwindow.cpp
  37. 111
    0
      systemsettings/mainwindow.h
  38. 36
    0
      systemsettings/menu/Makefile.am
  39. 56
    0
      systemsettings/menu/audioencoding.desktop
  40. 97
    0
      systemsettings/menu/defaultapplication.desktop
  41. 62
    0
      systemsettings/menu/kcm_knetworkconfmodule_ss.desktop
  42. 112
    0
      systemsettings/menu/kcmfontinst.desktop
  43. 20
    0
      systemsettings/menu/kde-settings-accessibility_ss.directory
  44. 19
    0
      systemsettings/menu/kde-settings-advanced.directory
  45. 20
    0
      systemsettings/menu/kde-settings-advancedusersettings.directory
  46. 36
    0
      systemsettings/menu/kde-settings-appearance.directory
  47. 19
    0
      systemsettings/menu/kde-settings-computeradministration.directory
  48. 67
    0
      systemsettings/menu/kde-settings-defaultapplications.directory
  49. 18
    0
      systemsettings/menu/kde-settings-general.directory
  50. 21
    0
      systemsettings/menu/kde-settings-keyboardmouse.directory
  51. 21
    0
      systemsettings/menu/kde-settings-laptops.directory
  52. 17
    0
      systemsettings/menu/kde-settings-looknfeel2.directory
  53. 35
    0
      systemsettings/menu/kde-settings-networkconnections.directory
  54. 19
    0
      systemsettings/menu/kde-settings-networkconnectivity.directory
  55. 19
    0
      systemsettings/menu/kde-settings-networksettings.directory
  56. 19
    0
      systemsettings/menu/kde-settings-notifications.directory
  57. 26
    0
      systemsettings/menu/kde-settings-panel.directory
  58. 18
    0
      systemsettings/menu/kde-settings-personal.directory
  59. 32
    0
      systemsettings/menu/kde-settings-power.directory
  60. 19
    0
      systemsettings/menu/kde-settings-regional.directory
  61. 35
    0
      systemsettings/menu/kde-settings-sharing.directory
  62. 19
    0
      systemsettings/menu/kde-settings-splashscreen.directory
  63. 32
    0
      systemsettings/menu/kde-settings-system.directory
  64. 19
    0
      systemsettings/menu/kde-settings-useraccount.directory
  65. 19
    0
      systemsettings/menu/kde-settings-windowbehavior.directory
  66. 43
    0
      systemsettings/menu/laptoppowermanagement.desktop
  67. 57
    0
      systemsettings/menu/medianotifications.desktop
  68. 11
    0
      systemsettings/menu/system-settings-merge.menu
  69. 34
    0
      systemsettings/menu/system-settings.directory
  70. 385
    0
      systemsettings/menu/system-settings.menu
  71. 52
    0
      systemsettings/moduleiconitem.cpp
  72. 57
    0
      systemsettings/moduleiconitem.h
  73. 173
    0
      systemsettings/modulesview.cpp
  74. 100
    0
      systemsettings/modulesview.h
  75. 40
    0
      systemsettings/systemsettings.desktop
  76. 3
    0
      systemsettings/systemsettingsrc
  77. 32
    0
      systemsettings/systemsettingsui.rc
  78. 27
    0
      systemsettings/version.h

+ 1
- 0
AUTHOR View File

@@ -0,0 +1 @@
1
+Benjamin Charles Meyer < ben + systempreferences at meyerhome dot net > 

+ 21
- 0
CMakeLists.txt View File

@@ -0,0 +1,21 @@
1
+project(playground-base)
2
+
3
+find_package(KDE4 REQUIRED)
4
+include (KDE4Defaults)
5
+include(MacroOptionalAddSubdirectory)
6
+
7
+# search packages used by KDE
8
+#find_package (KDE4)
9
+#include(KDE4Defaults)
10
+#include(MacroLibrary)
11
+
12
+#add_subdirectory( qrdf )
13
+#add_subdirectory( raptor )
14
+# needs Qt 3.x
15
+#add_subdirectory( kbfx_plasma )
16
+
17
+#add_subdirectory( plasma )
18
+macro_optional_add_subdirectory( plasmagik )
19
+macro_optional_add_subdirectory( systemsettings )
20
+
21
+#add_subdirectory( strigiplasmoid )

+ 22
- 0
INDEX View File

@@ -0,0 +1,22 @@
1
+Index of software in kdeplayground-base
2
+=======================================
3
+
4
+Please add software to this index. Each entry should include the
5
+following entries:
6
+* Name:, which is the directory name
7
+* Synopsis:, which is a short description of what it does
8
+* Notes:, for key usage / applicability information (optional)
9
+* See also:, for cross references to other KDE apps/modules (optional)
10
+* URL:, for web links to required software or a home page (optional)
11
+
12
+Entries should be entirely objective.
13
+
14
+Name: datasources
15
+Synopsis: ODBC configuration tool.
16
+Notes: Requires unixODBC libraries
17
+
18
+Name: sessionapplet
19
+Synopsis: A kicker applet for management of X sessions.
20
+
21
+Name: raptor
22
+Synopsis: Raptor is a Application Utility  Menu for KDE4

+ 167
- 0
INSTALL View File

@@ -0,0 +1,167 @@
1
+Basic Installation
2
+==================
3
+
4
+   These are generic installation instructions.
5
+
6
+   The `configure' shell script attempts to guess correct values for
7
+various system-dependent variables used during compilation.  It uses
8
+those values to create a `Makefile' in each directory of the package.
9
+It may also create one or more `.h' files containing system-dependent
10
+definitions.  Finally, it creates a shell script `config.status' that
11
+you can run in the future to recreate the current configuration, a file
12
+`config.cache' that saves the results of its tests to speed up
13
+reconfiguring, and a file `config.log' containing compiler output
14
+(useful mainly for debugging `configure').
15
+
16
+   If you need to do unusual things to compile the package, please try
17
+to figure out how `configure' could check whether to do them, and mail
18
+diffs or instructions to the address given in the `README' so they can
19
+be considered for the next release.  If at some point `config.cache'
20
+contains results you don't want to keep, you may remove or edit it.
21
+
22
+   The file `configure.in' is used to create `configure' by a program
23
+called `autoconf'.  You only need `configure.in' if you want to change
24
+it or regenerate `configure' using a newer version of `autoconf'.
25
+
26
+The simplest way to compile this package is:
27
+
28
+  1. `cd' to the directory containing the package's source code and type
29
+     `./configure' to configure the package for your system.  If you're
30
+     using `csh' on an old version of System V, you might need to type
31
+     `sh ./configure' instead to prevent `csh' from trying to execute
32
+     `configure' itself.
33
+
34
+     Running `configure' takes a while.  While running, it prints some
35
+     messages telling which features it is checking for.
36
+
37
+  2. Type `make' to compile the package.
38
+
39
+  3. Type `make install' to install the programs and any data files and
40
+     documentation.
41
+
42
+  4. You can remove the program binaries and object files from the
43
+     source code directory by typing `make clean'.  
44
+
45
+Compilers and Options
46
+=====================
47
+
48
+   Some systems require unusual options for compilation or linking that
49
+the `configure' script does not know about.  You can give `configure'
50
+initial values for variables by setting them in the environment.  Using
51
+a Bourne-compatible shell, you can do that on the command line like
52
+this:
53
+     CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
54
+
55
+Or on systems that have the `env' program, you can do it like this:
56
+     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
57
+
58
+Compiling For Multiple Architectures
59
+====================================
60
+
61
+   You can compile the package for more than one kind of computer at the
62
+same time, by placing the object files for each architecture in their
63
+own directory.  To do this, you must use a version of `make' that
64
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
65
+directory where you want the object files and executables to go and run
66
+the `configure' script.  `configure' automatically checks for the
67
+source code in the directory that `configure' is in and in `..'.
68
+
69
+   If you have to use a `make' that does not supports the `VPATH'
70
+variable, you have to compile the package for one architecture at a time
71
+in the source code directory.  After you have installed the package for
72
+one architecture, use `make distclean' before reconfiguring for another
73
+architecture.
74
+
75
+Installation Names
76
+==================
77
+
78
+   By default, `make install' will install the package's files in
79
+`/usr/local/bin', `/usr/local/man', etc.  You can specify an
80
+installation prefix other than `/usr/local' by giving `configure' the
81
+option `--prefix=PATH'.
82
+
83
+   You can specify separate installation prefixes for
84
+architecture-specific files and architecture-independent files.  If you
85
+give `configure' the option `--exec-prefix=PATH', the package will use
86
+PATH as the prefix for installing programs and libraries.
87
+Documentation and other data files will still use the regular prefix.
88
+
89
+   If the package supports it, you can cause programs to be installed
90
+with an extra prefix or suffix on their names by giving `configure' the
91
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
92
+
93
+Optional Features
94
+=================
95
+
96
+   Some packages pay attention to `--enable-FEATURE' options to
97
+`configure', where FEATURE indicates an optional part of the package.
98
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
99
+is something like `gnu-as' or `x' (for the X Window System).  The
100
+`README' should mention any `--enable-' and `--with-' options that the
101
+package recognizes.
102
+
103
+   For packages that use the X Window System, `configure' can usually
104
+find the X include and library files automatically, but if it doesn't,
105
+you can use the `configure' options `--x-includes=DIR' and
106
+`--x-libraries=DIR' to specify their locations.
107
+
108
+Specifying the System Type
109
+==========================
110
+
111
+   There may be some features `configure' can not figure out
112
+automatically, but needs to determine by the type of host the package
113
+will run on.  Usually `configure' can figure that out, but if it prints
114
+a message saying it can not guess the host type, give it the
115
+`--host=TYPE' option.  TYPE can either be a short name for the system
116
+type, such as `sun4', or a canonical name with three fields:
117
+     CPU-COMPANY-SYSTEM
118
+
119
+See the file `config.sub' for the possible values of each field.  If
120
+`config.sub' isn't included in this package, then this package doesn't
121
+need to know the host type.
122
+
123
+   If you are building compiler tools for cross-compiling, you can also
124
+use the `--target=TYPE' option to select the type of system they will
125
+produce code for and the `--build=TYPE' option to select the type of
126
+system on which you are compiling the package.
127
+
128
+Sharing Defaults
129
+================
130
+
131
+   If you want to set default values for `configure' scripts to share,
132
+you can create a site shell script called `config.site' that gives
133
+default values for variables like `CC', `cache_file', and `prefix'.
134
+`configure' looks for `PREFIX/share/config.site' if it exists, then
135
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
136
+`CONFIG_SITE' environment variable to the location of the site script.
137
+A warning: not all `configure' scripts look for a site script.
138
+
139
+Operation Controls
140
+==================
141
+
142
+   `configure' recognizes the following options to control how it
143
+operates.
144
+
145
+`--cache-file=FILE'
146
+     Use and save the results of the tests in FILE instead of
147
+     `./config.cache'.  Set FILE to `/dev/null' to disable caching, for
148
+     debugging `configure'.
149
+
150
+`--help'
151
+     Print a summary of the options to `configure', and exit.
152
+
153
+`--quiet'
154
+`--silent'
155
+`-q'
156
+     Do not print messages saying which checks are being made.
157
+
158
+`--srcdir=DIR'
159
+     Look for the package's source code in directory DIR.  Usually
160
+     `configure' can determine that directory automatically.
161
+
162
+`--version'
163
+     Print the version of Autoconf used to generate the `configure'
164
+     script, and exit.
165
+
166
+`configure' also accepts some other, not widely useful, options.
167
+

+ 5
- 0
Mainpage.dox View File

@@ -0,0 +1,5 @@
1
+/** @mainpage Playground
2
+*
3
+* The playground is a place to put new and immature and
4
+* flaky apps, to develop them to maturity.
5
+*/

+ 22
- 0
Makefile.am View File

@@ -0,0 +1,22 @@
1
+## (C) 1997 Stephan Kulow
2
+
3
+AUTOMAKE_OPTIONS = foreign 
4
+DISTCLEANFILES = inst-apps
5
+
6
+install-data-local:
7
+	@echo ""
8
+	@echo ""
9
+	@echo "*************** Important *************************"
10
+	@echo ""
11
+	@echo "This module contains unreleased software."
12
+	@echo ""
13
+	@echo "The software may compile and work, but it may just"
14
+	@echo "as well neither compile nor work."
15
+	@echo ""
16
+	@echo "****************************************************"
17
+	@echo ""
18
+
19
+include admin/deps.am
20
+include admin/Doxyfile.am
21
+
22
+SUBDIRS=$(TOPSUBDIRS)

+ 21
- 0
Makefile.am.in View File

@@ -0,0 +1,21 @@
1
+## (C) 1997 Stephan Kulow
2
+
3
+AUTOMAKE_OPTIONS = foreign 
4
+DISTCLEANFILES = inst-apps
5
+
6
+install-data-local:
7
+	@echo ""
8
+	@echo ""
9
+	@echo "*************** Important *************************"
10
+	@echo ""
11
+	@echo "This module contains unreleased software."
12
+	@echo ""
13
+	@echo "The software may compile and work, but it may just"
14
+	@echo "as well neither compile nor work."
15
+	@echo ""
16
+	@echo "****************************************************"
17
+	@echo ""
18
+
19
+include admin/deps.am
20
+include admin/Doxyfile.am
21
+

+ 40
- 0
README View File

@@ -0,0 +1,40 @@
1
+What is kdeplayground?
2
+----------------------
3
+
4
+The kdeplayground modules contain software that is under development but
5
+that has not reached a stable state. Some software present has only been
6
+developed as a proof of concept and will not see further development.
7
+Due to the experimental nature of the software, most of the software in
8
+the kdeplayground packages has not received the same level of scrutiny
9
+as the software in other modules.
10
+
11
+Although the software in the kdeplayground modules is publicly available
12
+for the purpose of its ongoing development, it should not be considered
13
+released, supported in any way or fit for any purpose.
14
+
15
+THIS SOFTWARE IS PROVIDED BY THE AUTHORS `AS IS'' AND ANY EXPRESS OR
16
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17
+OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18
+IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT,
19
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20
+NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+
26
+Package contents
27
+----------------
28
+
29
+Read the INDEX file to find out about the description and status of each
30
+module.
31
+
32
+
33
+Using kdeplayground
34
+-------------------
35
+
36
+The modules use the standard autoconf/automake based KDE build system. To
37
+add a new module to the build, create a subdirectory with your code and then
38
+say "make -f Makefile.cvs".
39
+
40
+Don't forget to add your new subdirectory to the INDEX file.

+ 23
- 0
TODO View File

@@ -0,0 +1,23 @@
1
+Save to real config files.
2
+Module Help link
3
+Module Default/Reset link
4
+Use tabs
5
+View Menu should list of all modules
6
+Remove "module" string
7
+Fix connection
8
+
9
+config icon sizes
10
+command line option to open in new window
11
+
12
+Modules
13
+-lilo _has_ to be spead up
14
+-Date & Time icon should have a Clock
15
+-Samba needs a new icon
16
+-Remote needs a new icon
17
+
18
+Search
19
+-Make search smaller and on the right
20
+-Grep docs?
21
+-Tie into kconfigXT somehow?
22
+-Look at Spotlight
23
+-Task oriented?

+ 12420
- 0
acinclude.m4
File diff suppressed because it is too large
View File


+ 13293
- 0
aclocal.m4
File diff suppressed because it is too large
View File


+ 394
- 0
config.h.in View File

@@ -0,0 +1,394 @@
1
+/* config.h.in.  Generated from configure.in by autoheader.  */
2
+
3
+/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
4
+#undef HAVE_CARBON_CARBON_H
5
+
6
+/* Define if you have the CoreAudio API */
7
+#undef HAVE_COREAUDIO
8
+
9
+/* Define to 1 if you have the <crt_externs.h> header file. */
10
+#undef HAVE_CRT_EXTERNS_H
11
+
12
+/* Defines if your system has the crypt function */
13
+#undef HAVE_CRYPT
14
+
15
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
16
+   */
17
+#undef HAVE_DIRENT_H
18
+
19
+/* Define if you have dlfcn */
20
+#undef HAVE_DLFCN
21
+
22
+/* Define to 1 if you have the <dlfcn.h> header file. */
23
+#undef HAVE_DLFCN_H
24
+
25
+/* Define to 1 if you have the <dl.h> header file. */
26
+#undef HAVE_DL_H
27
+
28
+/* Define to 1 if you have the `fabsl' function. */
29
+#undef HAVE_FABSL
30
+
31
+/* Define to 1 if you have the <fcntl.h> header file. */
32
+#undef HAVE_FCNTL_H
33
+
34
+/* Define to 1 if you have the `flock' function. */
35
+#undef HAVE_FLOCK
36
+
37
+/* Define to 1 if you have the <fnmatch.h> header file. */
38
+#undef HAVE_FNMATCH_H
39
+
40
+/* Define if you have getdomainname */
41
+#undef HAVE_GETDOMAINNAME
42
+
43
+/* Define if you have the getdomainname prototype */
44
+#undef HAVE_GETDOMAINNAME_PROTO
45
+
46
+/* Define if you have gethostname */
47
+#undef HAVE_GETHOSTNAME
48
+
49
+/* Define if you have the gethostname prototype */
50
+#undef HAVE_GETHOSTNAME_PROTO
51
+
52
+/* Define to 1 if you have the <inttypes.h> header file. */
53
+#undef HAVE_INTTYPES_H
54
+
55
+/* Define if you have libjpeg */
56
+#undef HAVE_LIBJPEG
57
+
58
+/* Define if you have libpng */
59
+#undef HAVE_LIBPNG
60
+
61
+/* Define if you have a working libpthread (will enable threaded code) */
62
+#undef HAVE_LIBPTHREAD
63
+
64
+/* Define if you have libz */
65
+#undef HAVE_LIBZ
66
+
67
+/* Define to 1 if you have the <linux/tcp.h> header file. */
68
+#undef HAVE_LINUX_TCP_H
69
+
70
+/* Define to 1 if the type `long double' works and has more range or precision
71
+   than `double'. */
72
+#undef HAVE_LONG_DOUBLE
73
+
74
+/* Define to 1 if the type `long double' works and has more range or precision
75
+   than `double'. */
76
+#undef HAVE_LONG_DOUBLE_WIDER
77
+
78
+/* Define to 1 if you have the <memory.h> header file. */
79
+#undef HAVE_MEMORY_H
80
+
81
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
82
+#undef HAVE_NDIR_H
83
+
84
+/* Define if your system needs _NSGetEnviron to set up the environment */
85
+#undef HAVE_NSGETENVIRON
86
+
87
+/* Define to 1 if you have the <paths.h> header file. */
88
+#undef HAVE_PATHS_H
89
+
90
+/* Define if you have res_init */
91
+#undef HAVE_RES_INIT
92
+
93
+/* Define if you have the res_init prototype */
94
+#undef HAVE_RES_INIT_PROTO
95
+
96
+/* Define to 1 if you have the `re_comp' function. */
97
+#undef HAVE_RE_COMP
98
+
99
+/* Define if you have setenv */
100
+#undef HAVE_SETENV
101
+
102
+/* Define if you have the setenv prototype */
103
+#undef HAVE_SETENV_PROTO
104
+
105
+/* Define if you have a STL implementation by SGI */
106
+#undef HAVE_SGI_STL
107
+
108
+/* Define if you have shload */
109
+#undef HAVE_SHLOAD
110
+
111
+/* Define to 1 if you have the `snprintf' function. */
112
+#undef HAVE_SNPRINTF
113
+
114
+/* Define to 1 if you have the `socket' function. */
115
+#undef HAVE_SOCKET
116
+
117
+/* Define to 1 if you have the <stdint.h> header file. */
118
+#undef HAVE_STDINT_H
119
+
120
+/* Define to 1 if you have the <stdlib.h> header file. */
121
+#undef HAVE_STDLIB_H
122
+
123
+/* Define to 1 if you have the `strdup' function. */
124
+#undef HAVE_STRDUP
125
+
126
+/* Define to 1 if you have the <strings.h> header file. */
127
+#undef HAVE_STRINGS_H
128
+
129
+/* Define to 1 if you have the <string.h> header file. */
130
+#undef HAVE_STRING_H
131
+
132
+/* Define if you have strlcat */
133
+#undef HAVE_STRLCAT
134
+
135
+/* Define if you have the strlcat prototype */
136
+#undef HAVE_STRLCAT_PROTO
137
+
138
+/* Define if you have strlcpy */
139
+#undef HAVE_STRLCPY
140
+
141
+/* Define if you have the strlcpy prototype */
142
+#undef HAVE_STRLCPY_PROTO
143
+
144
+/* Define to 1 if you have the <sysent.h> header file. */
145
+#undef HAVE_SYSENT_H
146
+
147
+/* Define to 1 if you have the <sys/bitypes.h> header file. */
148
+#undef HAVE_SYS_BITYPES_H
149
+
150
+/* Define to 1 if you have the <sys/cdefs.h> header file. */
151
+#undef HAVE_SYS_CDEFS_H
152
+
153
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
154
+   */
155
+#undef HAVE_SYS_DIR_H
156
+
157
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
158
+   */
159
+#undef HAVE_SYS_NDIR_H
160
+
161
+/* Define to 1 if you have the <sys/param.h> header file. */
162
+#undef HAVE_SYS_PARAM_H
163
+
164
+/* Define to 1 if you have the <sys/proc.h> header file. */
165
+#undef HAVE_SYS_PROC_H
166
+
167
+/* Define to 1 if you have the <sys/stat.h> header file. */
168
+#undef HAVE_SYS_STAT_H
169
+
170
+/* Define to 1 if you have the <sys/time.h> header file. */
171
+#undef HAVE_SYS_TIME_H
172
+
173
+/* Define to 1 if you have the <sys/types.h> header file. */
174
+#undef HAVE_SYS_TYPES_H
175
+
176
+/* Define to 1 if you have the <unistd.h> header file. */
177
+#undef HAVE_UNISTD_H
178
+
179
+/* Define if you have unsetenv */
180
+#undef HAVE_UNSETENV
181
+
182
+/* Define if you have the unsetenv prototype */
183
+#undef HAVE_UNSETENV_PROTO
184
+
185
+/* Define to 1 if you have the <utmp.h> header file. */
186
+#undef HAVE_UTMP_H
187
+
188
+/* Define to 1 if you have the `vsnprintf' function. */
189
+#undef HAVE_VSNPRINTF
190
+
191
+/* Suffix for lib directories */
192
+#undef KDELIBSUFF
193
+
194
+/* Name of package */
195
+#undef PACKAGE
196
+
197
+/* Define to the address where bug reports for this package should be sent. */
198
+#undef PACKAGE_BUGREPORT
199
+
200
+/* Define to the full name of this package. */
201
+#undef PACKAGE_NAME
202
+
203
+/* Define to the full name and version of this package. */
204
+#undef PACKAGE_STRING
205
+
206
+/* Define to the one symbol short name of this package. */
207
+#undef PACKAGE_TARNAME
208
+
209
+/* Define to the version of this package. */
210
+#undef PACKAGE_VERSION
211
+
212
+/* The size of `char *', as computed by sizeof. */
213
+#undef SIZEOF_CHAR_P
214
+
215
+/* The size of `int', as computed by sizeof. */
216
+#undef SIZEOF_INT
217
+
218
+/* The size of `long', as computed by sizeof. */
219
+#undef SIZEOF_LONG
220
+
221
+/* The size of `short', as computed by sizeof. */
222
+#undef SIZEOF_SHORT
223
+
224
+/* The size of `size_t', as computed by sizeof. */
225
+#undef SIZEOF_SIZE_T
226
+
227
+/* The size of `unsigned long', as computed by sizeof. */
228
+#undef SIZEOF_UNSIGNED_LONG
229
+
230
+/* Define to 1 if you have the ANSI C header files. */
231
+#undef STDC_HEADERS
232
+
233
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
234
+#undef TIME_WITH_SYS_TIME
235
+
236
+/* Version number of package */
237
+#undef VERSION
238
+
239
+/* Defined if compiling without arts */
240
+#undef WITHOUT_ARTS
241
+
242
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
243
+   `char[]'. */
244
+#undef YYTEXT_POINTER
245
+
246
+/*
247
+ * jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
248
+ * headers and I'm too lazy to write a configure test as long as only
249
+ * unixware is related
250
+ */
251
+#ifdef _UNIXWARE
252
+#define HAVE_BOOLEAN
253
+#endif
254
+
255
+
256
+
257
+/*
258
+ * AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
259
+ * that defines bzero.
260
+ */
261
+
262
+#if defined(_AIX)
263
+#include <strings.h>
264
+#endif
265
+
266
+
267
+
268
+#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
269
+# include <sys/time.h>
270
+# include <crt_externs.h>
271
+# define environ (*_NSGetEnviron())
272
+#endif
273
+
274
+
275
+
276
+#if !defined(HAVE_GETDOMAINNAME_PROTO)
277
+#ifdef __cplusplus
278
+extern "C" {
279
+#endif
280
+#include <sys/types.h>
281
+		int getdomainname (char *, size_t);
282
+#ifdef __cplusplus
283
+}
284
+#endif
285
+#endif
286
+
287
+
288
+
289
+#if !defined(HAVE_GETHOSTNAME_PROTO)
290
+#ifdef __cplusplus
291
+extern "C" {
292
+#endif
293
+int gethostname (char *, unsigned int);
294
+#ifdef __cplusplus
295
+}
296
+#endif
297
+#endif
298
+
299
+
300
+
301
+#if !defined(HAVE_RES_INIT_PROTO)
302
+#ifdef __cplusplus
303
+extern "C" {
304
+#endif
305
+int res_init(void);
306
+#ifdef __cplusplus
307
+}
308
+#endif
309
+#endif
310
+
311
+
312
+
313
+#if !defined(HAVE_SETENV_PROTO)
314
+#ifdef __cplusplus
315
+extern "C" {
316
+#endif
317
+int setenv (const char *, const char *, int);
318
+#ifdef __cplusplus
319
+}
320
+#endif
321
+#endif
322
+
323
+
324
+
325
+#if !defined(HAVE_STRLCAT_PROTO)
326
+#ifdef __cplusplus
327
+extern "C" {
328
+#endif
329
+unsigned long strlcat(char*, const char*, unsigned long);
330
+#ifdef __cplusplus
331
+}
332
+#endif
333
+#endif
334
+
335
+
336
+
337
+#if !defined(HAVE_STRLCPY_PROTO)
338
+#ifdef __cplusplus
339
+extern "C" {
340
+#endif
341
+unsigned long strlcpy(char*, const char*, unsigned long);
342
+#ifdef __cplusplus
343
+}
344
+#endif
345
+#endif
346
+
347
+
348
+
349
+#if !defined(HAVE_UNSETENV_PROTO)
350
+#ifdef __cplusplus
351
+extern "C" {
352
+#endif
353
+void unsetenv (const char *);
354
+#ifdef __cplusplus
355
+}
356
+#endif
357
+#endif
358
+
359
+
360
+
361
+/*
362
+ * On HP-UX, the declaration of vsnprintf() is needed every time !
363
+ */
364
+
365
+#if !defined(HAVE_VSNPRINTF) || defined(hpux)
366
+#if __STDC__
367
+#include <stdarg.h>
368
+#include <stdlib.h>
369
+#else
370
+#include <varargs.h>
371
+#endif
372
+#ifdef __cplusplus
373
+extern "C"
374
+#endif
375
+int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
376
+#ifdef __cplusplus
377
+extern "C"
378
+#endif
379
+int snprintf(char *str, size_t n, char const *fmt, ...);
380
+#endif
381
+
382
+
383
+
384
+#if defined(__SVR4) && !defined(__svr4__)
385
+#define __svr4__ 1
386
+#endif
387
+
388
+
389
+/* type to use in place of socklen_t if not defined */
390
+#undef kde_socklen_t
391
+
392
+/* type to use in place of socklen_t if not defined (deprecated, use
393
+   kde_socklen_t) */
394
+#undef ksize_t

+ 2
- 0
configure.files View File

@@ -0,0 +1,2 @@
1
+./admin/configure.in.min
2
+configure.in.in

+ 146
- 0
configure.in View File

@@ -0,0 +1,146 @@
1
+dnl =======================================================
2
+dnl FILE: ./admin/configure.in.min
3
+dnl =======================================================
4
+
5
+dnl    This file is part of the KDE libraries/packages
6
+dnl    Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
7
+ 
8
+dnl    This file is free software; you can redistribute it and/or
9
+dnl    modify it under the terms of the GNU Library General Public
10
+dnl    License as published by the Free Software Foundation; either
11
+dnl    version 2 of the License, or (at your option) any later version.
12
+ 
13
+dnl    This library is distributed in the hope that it will be useful,
14
+dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
+dnl    Library General Public License for more details.
17
+ 
18
+dnl    You should have received a copy of the GNU Library General Public License
19
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
20
+dnl    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21
+dnl    Boston, MA 02110-1301, USA.
22
+
23
+# Original Author was Kalle@kde.org
24
+# I lifted it in some mater. (Stephan Kulow)
25
+# I used much code from Janos Farkas
26
+
27
+dnl Process this file with autoconf to produce a configure script.
28
+
29
+AC_INIT(acinclude.m4) dnl a source file from your sub dir
30
+
31
+dnl This is so we can use kde-common
32
+AC_CONFIG_AUX_DIR(admin)
33
+
34
+dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
35
+unset CDPATH
36
+
37
+dnl Checking host/target/build systems, for make, install etc.
38
+AC_CANONICAL_SYSTEM 
39
+dnl Perform program name transformation
40
+AC_ARG_PROGRAM
41
+
42
+dnl Automake doc recommends to do this only here. (Janos)
43
+AM_INIT_AUTOMAKE(kde-systemsettings-0.0svn20070312, "3.5.4") dnl searches for some needed programs
44
+
45
+KDE_SET_PREFIX
46
+
47
+dnl generate the config header
48
+AM_CONFIG_HEADER(config.h) dnl at the distribution this done
49
+
50
+dnl Checks for programs.
51
+AC_CHECK_COMPILERS
52
+AC_ENABLE_SHARED(yes)
53
+AC_ENABLE_STATIC(no)
54
+KDE_PROG_LIBTOOL
55
+
56
+dnl for NLS support. Call them in this order!
57
+dnl WITH_NLS is for the po files
58
+AM_KDE_WITH_NLS
59
+
60
+KDE_USE_QT(3.3)
61
+AC_PATH_KDE
62
+dnl =======================================================
63
+dnl FILE: configure.in.in
64
+dnl =======================================================
65
+
66
+#MIN_CONFIG(3.3)
67
+# Define a symbol, to know that we're compiling WITH kde. (for apps that
68
+#  can compile without KDE, optionally)
69
+AM_CONDITIONAL(KDE_INSTALLED, test "$have_kde" = "yes")
70
+
71
+dnl Checks for header files.
72
+AC_HEADER_DIRENT
73
+AC_HEADER_STDC
74
+AC_CHECK_HEADERS(fcntl.h sys/time.h sys/stat.h stdint.h)
75
+AC_CHECK_HEADERS(sys/cdefs.h fnmatch.h sysent.h strings.h paths.h)
76
+AC_CHECK_HEADERS(utmp.h sys/param.h linux/tcp.h sys/proc.h)
77
+
78
+dnl Checks for typedefs, structures, and compiler characteristics.
79
+AC_HEADER_TIME
80
+
81
+AC_C_LONG_DOUBLE  
82
+
83
+dnl Checks for library functions.
84
+KDE_CHECK_DLOPEN
85
+AC_CHECK_FUNCS(socket fabsl strdup vsnprintf re_comp flock) 
86
+AC_CHECK_SETENV
87
+AC_CHECK_UNSETENV
88
+AC_CHECK_GETDOMAINNAME
89
+AC_CHECK_GETHOSTNAME 
90
+AM_PROG_LEX
91
+LFLAGS="-o${LEX_OUTPUT_ROOT}.c"
92
+AC_SUBST(LFLAGS)
93
+
94
+KDE_INIT_DOXYGEN([KDE Playground - Base], [Version $VERSION])
95
+
96
+KDE_CREATE_SUBDIRSLIST
97
+AM_CONDITIONAL(systemsettings_SUBDIR_included, test "x$systemsettings_SUBDIR_included" = xyes)
98
+AC_CONFIG_FILES([ Makefile ])
99
+AC_CONFIG_FILES([ systemsettings/Makefile ])
100
+AC_CONFIG_FILES([ systemsettings/menu/Makefile ])
101
+AC_OUTPUT
102
+# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
103
+if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
104
+  # And if so, warn when they don't match
105
+  if test "$kde_libs_prefix" != "$given_prefix"; then
106
+    # And if kde doesn't know about the prefix yet
107
+    echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
108
+    if test $? -ne 0; then
109
+      echo ""
110
+      echo "Warning: you chose to install this package in $given_prefix,"
111
+      echo "but KDE was found in $kde_libs_prefix."
112
+      echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
113
+      echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
114
+      echo "Then restart KDE."
115
+      echo ""
116
+    fi
117
+  fi
118
+fi
119
+
120
+if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
121
+  echo ""
122
+  echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
123
+  echo "was not included. Therefore, GCC symbol visibility support remains disabled."
124
+  echo ""
125
+  echo "For better performance, consider including the Qt visibility supporting patch"
126
+  echo "located at:"
127
+  echo ""
128
+  echo "http://bugs.kde.org/show_bug.cgi?id=109386"
129
+  echo ""
130
+  echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
131
+  echo "everything will continue to work just fine without it."
132
+  echo ""
133
+fi
134
+
135
+if test "$all_tests" = "bad"; then
136
+  if test ! "$cache_file" = "/dev/null"; then
137
+    echo ""
138
+    echo "Please remove the file $cache_file after changing your setup"
139
+    echo "so that configure will find the changes next time."
140
+    echo ""
141
+  fi
142
+else
143
+  echo ""
144
+  echo "Good - your configure finished. Start make now"
145
+  echo ""
146
+fi

+ 30
- 0
configure.in.in View File

@@ -0,0 +1,30 @@
1
+#MIN_CONFIG(3.3)
2
+# Define a symbol, to know that we're compiling WITH kde. (for apps that
3
+#  can compile without KDE, optionally)
4
+AM_CONDITIONAL(KDE_INSTALLED, test "$have_kde" = "yes")
5
+
6
+dnl Checks for header files.
7
+AC_HEADER_DIRENT
8
+AC_HEADER_STDC
9
+AC_CHECK_HEADERS(fcntl.h sys/time.h sys/stat.h stdint.h)
10
+AC_CHECK_HEADERS(sys/cdefs.h fnmatch.h sysent.h strings.h paths.h)
11
+AC_CHECK_HEADERS(utmp.h sys/param.h linux/tcp.h sys/proc.h)
12
+
13
+dnl Checks for typedefs, structures, and compiler characteristics.
14
+AC_HEADER_TIME
15
+
16
+AC_C_LONG_DOUBLE  
17
+
18
+dnl Checks for library functions.
19
+KDE_CHECK_DLOPEN
20
+AC_CHECK_FUNCS(socket fabsl strdup vsnprintf re_comp flock) 
21
+AC_CHECK_SETENV
22
+AC_CHECK_UNSETENV
23
+AC_CHECK_GETDOMAINNAME
24
+AC_CHECK_GETHOSTNAME 
25
+AM_PROG_LEX
26
+LFLAGS="-o${LEX_OUTPUT_ROOT}.c"
27
+AC_SUBST(LFLAGS)
28
+
29
+KDE_INIT_DOXYGEN([KDE Playground - Base], [Version $VERSION])
30
+

+ 0
- 0
stamp-h.in View File


+ 1
- 0
subdirs View File

@@ -0,0 +1 @@
1
+systemsettings

+ 31
- 0
systemsettings/HACKING View File

@@ -0,0 +1,31 @@
1
+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.
2
+
3
+-- System Settings classes --
4
+
5
+mainwindow - The KMainWindow contains KActions, the stack of the iconlist and the current module(s) view.
6
+
7
+modulesview - The widget that is the icon view that users see when the first enter the app.
8
+kcmsearch - Search widget that can search ModulesView and enable/disable items.
9
+
10
+modulesiconitem - The individual modules items.  Used for loading enabled/disabled images and storing the list of modules acosiated with the item.
11
+
12
+kcmodulemenu - Class that reads in a freedesktop.org .menu file into a QValueList.
13
+
14
+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. 
15
+
16
+-- INSTALL --
17
+
18
+To install a new menu you have to install three files.
19
+
20
+(if you have debian, if you have another system use locate to determine where kde-system.* is installed and install in the same place.
21
+
22
+-/etc/xdg/menus/system-settings.menu
23
+-/etc/xdg/menus/applications-merged/system-settings-merge.menu
24
+-/usr/share/desktop-directories/system-settings.directory
25
+
26
+Also don't forget to install the ui file.
27
+-/share/apps/systemsettings/systempreferencesui.rc
28
+And the desktop file.
29
+-share/applications/kde/systemsettings.desktop
30
+
31
+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.

+ 125
- 0
systemsettings/LAYOUT.html View File

@@ -0,0 +1,125 @@
1
+
2
+<h1>KDE System Settings</h1>
3
+
4
+<p>
5
+This document describes how the System Settings is layed out.
6
+
7
+<p>
8
+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.
9
+
10
+<p>
11
+The reason for this document is:
12
+<p>
13
+1) To categorize the settings together in a user friendly manor.<br>
14
+2) To explain why a setting is where it is and to determine where new settings should go.<br>
15
+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. 
16
+<p>
17
+The System Settings Center is divided into four sections.
18
+<ul>
19
+<li><a href="#personal">Personal</a></li>
20
+<li><a href="#hardware">Hardware</a></li>
21
+<li><a href="#system">System</a></li>
22
+<li><a href="#other">Other</a></li>
23
+</ul>
24
+
25
+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.    
26
+<p>
27
+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 
28
+<p>
29
+Modules that exists within multiple applications configuration menu such as spell check and cddb should not be in the menu.
30
+
31
+<hr>
32
+<a name="personal"><h1>Personal</h1></a>
33
+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. 
34
+<ul>
35
+<li><a href="#personal_theme">Theme Goodies</a></li>
36
+<li><a href="#personal_user">User Settings</a></li>
37
+</ul>
38
+
39
+<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).
40
+
41
+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.
42
+<p>
43
+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. 
44
+<p>
45
+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.
46
+
47
+<h3><a name="personal_user">User Settings</a></h3>
48
+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.
49
+
50
+<h2>Appearance</h2>
51
+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>
52
+Colors, Fonts, Icons, Style, Window Decorations
53
+
54
+<h2>Desktop</h2>
55
+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.
56
+It contains the following items:<br>
57
+Background, Screensaver, Behavior, Window Behavior, Window-Specific Settings, Login Screen
58
+<p>
59
+Panel.
60
+These settings all deal with when users perform actions dealing with or originating from the panel.  It contains the following items:<br>
61
+Panels, Taskbar, Launch Feedback, Multiple Desktops
62
+
63
+<h2>KDE Components</h2>
64
+Specific actuall KDE components which users will probably never actually touch. 
65
+
66
+<h2>Accessibility</h2>
67
+ - International
68
+ - KHotKeys etc
69
+
70
+<h2>Security</h2>
71
+-kdewallet
72
+
73
+<h2>Sound</h2>
74
+Sounds, flashes, logs or other events that happen when KDE applications.
75
+System Bell
76
+System Notifications
77
+
78
+<h2>User Account</h2>
79
+- Password changer, paths, Default Applications, Session Manager
80
+
81
+<hr>
82
+<a name="hardware"><h1>Hardware</h1></a>
83
+Hardware deals with physical hardware configuration.  Configuration is not only for the hardware, but the required supporting systems that use the hardware.
84
+
85
+<h2>Network</h2>
86
+File Sharing
87
+Local Network Browsing
88
+Preferences / Proxy
89
+Wireless
90
+Firewall
91
+<h2>Display</h2>
92
+It contains the following items:<br>
93
+Size & Orientation, Gamma
94
+<h2>Power</h2>
95
+Display power control
96
+laptop battery, cpu temp etc
97
+<h2>Keyboard & Mouse</h2>
98
+Keyboard, Keyboard Layout, Keyboard Shortcuts, Mouse, KHotKeys
99
+<h2>Printer</h2>
100
+<h2>Joystick</h2>
101
+<h2>Audio</h2>
102
+Mixer, SoundSystem (arts)
103
+
104
+<hr>
105
+<a name="system"><h1>System</h1></a>
106
+System deals with settings relating to this computer.
107
+
108
+<h2>Date & Time</h2>
109
+Date, Time, Time zone
110
+
111
+<h2>Fonts</h2>
112
+
113
+<h2>Book Disk</h2>
114
+Lilo, Grub
115
+
116
+<h2>Packages</h2>
117
+System update / rpm manager etc
118
+
119
+<h2>Login Manager</h2>
120
+Login Manger
121
+
122
+<hr>
123
+<a name="other"><h1>Other</h1></a>
124
+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.
125
+

+ 45
- 0
systemsettings/Makefile.am View File

@@ -0,0 +1,45 @@
1
+#
2
+#  Copyright (c) 2005 Benjamin Meyer <ben+systempreferences@meyerhome.net>
3
+# 
4
+#  This program is free software; you can redistribute it and/or modify
5
+#  it under the terms of the GNU General Public License as published by
6
+#  the Free Software Foundation; either version 2 of the License, or
7
+#  (at your option) any later version.
8
+# 
9
+#  This program is distributed in the hope that it will be useful,
10
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
+#  GNU General Public License for more details.
13
+# 
14
+#  You should have received a copy of the GNU General Public License
15
+#  along with this program; if not, write to the Free Software
16
+#  Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA.
17
+# 
18
+
19
+AM_CPPFLAGS= $(all_includes)
20
+METASOURCES = AUTO
21
+
22
+SUBDIRS = . menu
23
+
24
+bin_PROGRAMS = systemsettings
25
+
26
+systemsettings_SOURCES = kcmodulemenu.cpp kcmsearch.cpp kcmultiwidget.cpp main.cpp mainwindow.cpp moduleiconitem.cpp modulesview.cpp kcscrollview.cpp
27
+
28
+EXTRA_DIST = kcmodulemenu.h kcmultiwidget.h moduleiconitem.h version.h kcmsearch.h mainwindow.h modulesview.h kcscrollview.h
29
+
30
+systemsettings_LDADD  = $(LIB_KDEUI) $(LIB_KUTILS)
31
+systemsettings_LDFLAGS = $(all_libraries) -module -avoid-version
32
+
33
+appdata_DATA = systemsettingsui.rc
34
+appdatadir = $(kde_datadir)/systemsettings
35
+
36
+xdg_apps_DATA = systemsettings.desktop
37
+
38
+KDE_ICON=AUTO
39
+
40
+# KDE4 will have this by default 
41
+conf_DATA = systemsettingsrc
42
+confdir = $(kde_confdir)
43
+
44
+messages: rc.cpp
45
+	$(XGETTEXT) *.cpp -o $(podir)/systemsettings.pot

BIN
systemsettings/cr128-app-systemsettings.png View File


BIN
systemsettings/cr16-app-systemsettings.png View File


BIN
systemsettings/cr22-app-systemsettings.png View File


BIN
systemsettings/cr32-app-systemsettings.png View File


BIN
systemsettings/cr48-app-systemsettings.png View File


BIN
systemsettings/cr64-app-systemsettings.png View File


+ 188
- 0
systemsettings/kcmodulemenu.cpp View File

@@ -0,0 +1,188 @@
1
+/**
2
+ * Copyright (C) 2005 Benjamin C Meyer (ben+kcmodulemenu at meyerhome dot net)
3
+ *
4
+ * This library is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU Library General Public
6
+ * License as published by the Free Software Foundation; either
7
+ * version 2 of the License, or (at your option) any later version.
8
+ *
9
+ * This library is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+ * Library General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Library General Public License
15
+ * along with this library; see the file COPYING.LIB.  If not, write to
16
+ * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
17
+ * Boston, MA 02110-1301, USA.
18
+ */
19
+
20
+#include "kcmodulemenu.h"
21
+
22
+#include <kapplication.h>
23
+#include <kservicegroup.h>
24
+#include <kdebug.h>
25
+#include <qdict.h>
26
+
27
+class KCModuleMenuPrivate {
28
+public:
29
+	KCModuleMenuPrivate(){
30
+	}
31
+				
32
+	QMap<QString, QValueList<MenuItem> > menus;
33
+	QString basePath;
34
+};
35
+
36
+KCModuleMenu::KCModuleMenu( const QString &menuName ) :
37
+	d( new KCModuleMenuPrivate )
38
+{
39
+	kdDebug() << "MenuName: \"" << menuName << "\"." << endl;
40
+	// Make sure we can find the menu
41
+	KServiceGroup::Ptr serviceGroup = KServiceGroup::baseGroup( menuName );
42
+	if( !serviceGroup ){
43
+		kdDebug() << "Unable to load menu \"" << menuName << 
44
+						"\" from KServiceGroup." << endl;
45
+		return;
46
+	}
47
+	d->basePath = serviceGroup->relPath();
48
+	readMenu( d->basePath );
49
+}
50
+
51
+KCModuleMenu::~KCModuleMenu()
52
+{
53
+	delete d;
54
+}
55
+
56
+void KCModuleMenu::readMenu( const QString &pathName )
57
+{
58
+	KServiceGroup::Ptr group = KServiceGroup::group( pathName );
59
+	if ( !group || !group->isValid() )
60
+		return;
61
+
62
+	KServiceGroup::List list = group->entries( true, true );
63
+	if( list.isEmpty() )
64
+		return;
65
+
66
+	caption = group->caption();
67
+	QValueList<MenuItem> currentMenu;
68
+			
69
+	for( KServiceGroup::List::ConstIterator it = list.begin();
70
+			 it != list.end(); it++)
71
+	{
72
+		KSycocaEntry *entry = (*it);
73
+		if( addEntry(entry) ) {
74
+			KCModuleInfo module((KService*)entry);
75
+			append(module);
76
+			MenuItem infoItem(false);
77
+			infoItem.caption = this->deriveCaptionFromPath(entry->name());
78
+			infoItem.item = module;
79
+			currentMenu.append( infoItem );
80
+		}
81
+
82
+		if ( entry->isType(KST_KServiceGroup) ){
83
+			MenuItem menuItem(true);
84
+			menuItem.caption = this->deriveCaptionFromPath(entry->name());
85
+			menuItem.subMenu = entry->entryPath();
86
+			currentMenu.append( menuItem );
87
+
88
+			readMenu( entry->entryPath() );
89
+		}
90
+	}
91
+
92
+	d->menus.insert( pathName, currentMenu );
93
+}
94
+
95
+bool KCModuleMenu::addEntry( KSycocaEntry *entry ){
96
+	if( !entry->isType(KST_KService) )
97
+		return false;
98
+	
99
+	KService *service = static_cast<KService*>( entry );
100
+	if ( !kapp->authorizeControlModule( service->menuId()) )
101
+		return false;
102
+
103
+	KCModuleInfo module( service );
104
+	if ( module.library().isEmpty() )
105
+		return false;
106
+
107
+	return true;
108
+}
109
+
110
+
111
+QValueList<KCModuleInfo> KCModuleMenu::modules( const QString &menuPath )
112
+{
113
+	QValueList<KCModuleInfo> list;
114
+
115
+	QValueList<MenuItem> subMenu = menuList(menuPath);
116
+	QValueList<MenuItem>::iterator it;
117
+	for ( it = subMenu.begin(); it != subMenu.end(); ++it ){
118
+		if ( !(*it).menu )
119
+			list.append( (*it).item );
120
+	}
121
+
122
+	return list;
123
+}
124
+
125
+QStringList KCModuleMenu::submenus( const QString &menuPath )
126
+{
127
+	QStringList list;
128
+
129
+	QValueList<MenuItem> subMenu = menuList(menuPath);
130
+	QValueList<MenuItem>::iterator it;
131
+	for ( it = subMenu.begin(); it != subMenu.end(); ++it ){
132
+		if ( (*it).menu )
133
+			list.append( (*it).subMenu );
134
+	}
135
+
136
+	return list;
137
+}
138
+
139
+QValueList<MenuItem> KCModuleMenu::menuList( const QString &menuPath )
140
+{
141
+	if( menuPath.isEmpty() ) {
142
+		if( d->basePath.isEmpty())
143
+			return QValueList<MenuItem>();
144
+		else
145
+			return menuList( d->basePath );
146
+	}
147
+	return d->menus[menuPath];
148
+}
149
+
150
+/*
151
+ * Okay, I think there could be a much more elegant way of doing
152
+ * this... but I'm having a hell fo a time figuring it out.
153
+ *
154
+ * The purpose of this function is to take a menu path and turn it
155
+ * into a caption that we can put in a tab.  Why do it this way?  I
156
+ * don't know, you tell me.  Before I started hacking this we used a
157
+ * radio control with two buttons (or so it seemed, I could be wrong)
158
+ * with General and Advanced in a ui.rc file.
159
+ *
160
+ * Now that we're using tabs, we no longer have that UI file giving us
161
+ * the names for the tabs, and since I didn't want to hard-code
162
+ * anything, and since KSycocaEntry stuff doesn't give you a nice way
163
+ * (that I noticed anyway) to figure out what your caption should be,
164
+ * I decided that cleverness is lost on this problem.  So screw it,
165
+ * I'll just parse the stupid path and be done with it.
166
+ *
167
+ * This function is certainly nothing short of dull and boring and
168
+ * routine, but I figured that this might require a bit of explanation
169
+ * since it just seems kinda silly to do it this way to me.  I guess I
170
+ * never know... I could be doing it the best way.
171
+ *
172
+ * "Michael D. Stemle, Jr." <manchicken@notsosoft.net>
173
+ */
174
+QString KCModuleMenu::deriveCaptionFromPath( const QString &menuPath )
175
+{
176
+	QStringList parts(QStringList::split("/",menuPath));
177
+	QString result("");
178
+
179
+	QStringList::Iterator it = parts.end(); // Start at the end
180
+
181
+	// Find the last non-empty string in the split.
182
+	for (; it != parts.begin(); --it) {
183
+		if (!((*it).isNull()) && !((*it).isEmpty())) {
184
+			result += *it;
185
+			return result;
186
+		}
187
+	}
188
+}

+ 158
- 0
systemsettings/kcmodulemenu.h View File

@@ -0,0 +1,158 @@
1
+/**
2
+ * Copyright (C) 2005 Benjamin C Meyer (ben+kcmodulemenu at meyerhome dot net)
3
+ *
4
+ * This library is free software; you can redistribute it and/or
5
+ * modify it under the terms of the GNU Library General Public
6
+ * License as published by the Free Software Foundation; either
7
+ * version 2 of the License, or (at your option) any later version.
8
+ *
9
+ * This library is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+ * Library General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Library General Public License
15
+ * along with this library; see the file COPYING.LIB.  If not, write to
16
+ * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
17
+ * Boston, MA 02110-1301, USA.
18
+ */
19
+
20
+#ifndef KCMMODULEMENU_H
21
+#define KCMMODULEMENU_H
22
+
23
+#include <kcmoduleinfo.h>
24
+
25
+class KCModuleMenuPrivate;
26
+
27
+/**
28
+ * List of all KCM modules inside a FreeDesktop.org menu
29
+ * The menu spec is located at: http://www.freedesktop.org/Standards/menu-spec
30
+ *
31
+ * For a menu to show up in KDE three files need to be installed in the system.
32
+ * 
33
+ * example-merge.menu
34
+ * example.directory
35
+ * example.menu
36
+ *
37
+ * example-merge.menu should be installed in xdg/menus/applications-merged/
38
+ * so that ksyscoco will find it.
39
+ *
40
+ * \code
41
+ * <!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
42
+ *   "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">
43
+ *
44
+ * <Menu>
45
+ *   <!-- The following menus are hidden by default -->
46
+ *   <Menu>
47
+ *     <Name>Example Menu</Name>
48
+ *     <Directory>example.directory</Directory>
49
+ *     <MergeFile>../example.menu</MergeFile>
50
+ *   </Menu>
51
+ * </Menu>
52
+ * \endcode
53
+ *
54
+ * example.directory should be installed in share/desktop-directories/ where files
55
+ * such as kde-system.directory reside.  It is important that it have X-KDE-BaseGroup
56
+ * as this value is the class constructor argument.
57
+ * 
58
+ * \code
59
+ * [Desktop Entry]
60
+ * Encoding=UTF-8
61
+ * Name=Example Menu
62
+ * NoDisplay=true
63
+ * Icon=package_settings
64
+ * X-KDE-BaseGroup=examplemenu
65
+ * \endcode
66
+ * 
67
+ * example.menu should be installed in xdg/menus/ so that ksyscoco will find
68
+ * it. See the above url for example menus.  After changing the menu you need
69
+ * to run "kbuildsycoca" to regenerate the cache as ksyscoco will cache the
70
+ * menu and is a file that doesn't change on users.
71
+ */
72
+
73
+/**
74
+ * A menu consists of menu items.  An item is either another menu or a module.
75
+ */
76
+class MenuItem {
77
+public:
78
+	MenuItem( bool isMenu=false ){ menu = isMenu; };	
79
+	bool menu;
80
+	QString subMenu;
81
+	QString caption;
82
+	KCModuleInfo item;
83
+};
84
+
85
+
86
+class KCModuleMenu : public QValueList<KCModuleInfo>
87
+{
88
+
89
+public:
90
+	QString caption;
91
+
92
+	/**
93
+	 * @param the X-KDE-BaseGroup item from the directory file
94
+	 * that should be loaded.
95
+	 *
96
+	 * Example:
97
+	 * In example.directory
98
+	 * X-KDE-BaseGroup=examplemenu
99
+	 * so menuName should be "systemsettings"
100
+	 */
101
+	KCModuleMenu( const QString &menuName );
102
+
103
+	/**
104
+	 * Deconstructor
105
+	 */
106
+	virtual ~KCModuleMenu();
107
+
108
+	/**
109
+	 * Returns item of a menu path. An empty string is the top level.
110
+	 * Item order is maintained from the menu file.
111
+	 * @param path to return submenus from.
112
+	 * @return all items in menuPath.
113
+	 */
114
+	QValueList<MenuItem> menuList( const QString &menuPath=QString::null );
115
+
116
+	/**
117
+	 * Returns the modules in a menu path. An empty string is the top level.
118
+	 * @param menu to return modules from.
119
+	 * @returns only the top level modules of menuPath
120
+	 */
121
+	QValueList<KCModuleInfo> modules( const QString &menuPath=QString::null );
122
+
123
+	/**
124
+	 * Returns the sub menus of a menu path. An empty string is the top level.
125
+	 * @param path to return submenus from.
126
+	 * @return only the submenus of menuPath.
127
+	 */
128
+	QStringList submenus( const QString &menuPath=QString::null );
129
+
130
+
131
+protected:
132
+	/**
133
+	 * Reads all the desktop files from the pathName and saves/loads
134
+	 * all of the kcm's into the list.
135
+	 * This is the <Name> from the merge.menu file
136
+	 * @param pathName the base path name of the menu.
137
+	 */
138
+	virtual void readMenu( const QString &pathName );
139
+
140
+	/**
141
+	 * Function that determines if the entry from readMenu
142
+	 * should be added to the list or not.  It checks
143
+	 * to see if it is an authorized kcm module that has a library.
144
+	 *
145
+	 * Overload to filter out kcm modules
146
+	 * 
147
+	 * @entry to test
148
+	 * @return true if it should be included
149
+	 */
150
+	virtual bool addEntry( KSycocaEntry *entry );
151
+
152
+private:
153
+	KCModuleMenuPrivate *d;
154
+	QString deriveCaptionFromPath( const QString &menuPath );
155
+};
156
+
157
+#endif // KCMMODULEMENU_H
158
+

+ 101
- 0
systemsettings/kcmsearch.cpp View File

@@ -0,0 +1,101 @@
1
+/**
2
+ * This file is part of the System Settings package
3
+ * Copyright (C) 2005 Benjamin C Meyer
4
+ *                    <ben+systempreferences at meyerhome dot net>
5
+ *
6
+ * This program is free software; you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation; either version 2 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
+ * Library General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Library General Public License
17
+ * along with this library; see the file COPYING.LIB.  If not, write to
18
+ * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
19
+ * Boston, MA 02110-1301, USA.
20
+ */
21
+
22
+#include "kcmsearch.h"
23
+
24
+#include <qregexp.h>
25
+#include <kdebug.h>
26
+
27
+#include "modulesview.h"
28
+#include "moduleiconitem.h"
29
+
30
+KcmSearch::KcmSearch( QPtrList<ModulesView> *moduleViewList, QWidget *parent, const char *name )
31
+				: KIconViewSearchLine(parent, moduleViewList->at(0)->groups[0], name){
32
+	this->moduleViewList = moduleViewList;
33
+}
34
+
35
+void KcmSearch::updateSearch( const QString &search ) {
36
+	QValueList<RowIconView*>::iterator it;
37
+ 	QPtrListIterator<ModulesView> moduleViewListIt(*moduleViewList);
38
+
39
+	ModulesView *mainView;
40
+	int page = 0;
41
+	int *hitArray = new int[moduleViewList->count()];
42
+
43
+	for ( ; moduleViewListIt.current(); ++moduleViewListIt) {
44
+		mainView = moduleViewListIt.current();
45
+
46
+		int count = 0;
47
+		for ( it = mainView->groups.begin(); it != mainView->groups.end(); ++it ){
48
+			QIconViewItem *item = (*it)->firstItem();
49
+			while( item ) {
50
+				bool hit = itemMatches(item, search);
51
+				((ModuleIconItem*)item)->loadIcon(hit);
52
+				count += hit ? 1 : 0;
53
+				item = item->nextItem();
54
+			}
55
+
56
+		}
57
+		hitArray[page] = count;
58
+		page++;
59
+	}
60
+
61
+	emit searchHits(search, hitArray, moduleViewList->count());
62
+	delete[] hitArray;
63
+}
64
+
65
+bool KcmSearch::itemMatches( const KCModuleInfo &module, const QString &search ) const
66
+{
67
+	// Look in keywords
68
+	QStringList kw = module.keywords();
69
+	for(QStringList::ConstIterator it = kw.begin(); it != kw.end(); ++it) {
70
+		QString name = (*it).lower();
71
+		if ( QRegExp(search+"*", false, true).search(name) >= 0){
72
+			//kdDebug() << "MATCH:" << module.moduleName().latin1()
73
+			//				  << "keyword:" <<  name.latin1() << endl;
74
+			return true;
75
+		}
76
+	}
77
+
78
+	// Don't forget to check the name :)
79
+	if ( QRegExp(search+"*", false, true).search(module.moduleName()) >= 0)
80
+		return true;
81
+
82
+	//kdDebug() << "No MATCH:" << module.moduleName().latin1() << endl;
83
+	return false;
84
+}
85
+
86
+bool KcmSearch::itemMatches( const QIconViewItem *item, const QString & search ) const
87
+{
88
+	if( !item )
89
+		return false;
90
+
91
+	ModuleIconItem *mItem = (ModuleIconItem*)item;
92
+	QValueList<KCModuleInfo>::iterator it;
93
+	for ( it = mItem->modules.begin(); it != mItem->modules.end(); ++it ){
94
+		if( itemMatches( (*it), search ) )
95
+			return true;
96
+	}
97
+	return false;
98
+}
99
+
100
+
101
+#include "kcmsearch.moc"

+ 67
- 0
systemsettings/kcmsearch.h View File

@@ -0,0 +1,67 @@
1
+/**
2
+ * This file is part of the System Settings package
3
+ * Copyright (C) 2005 Benjamin C Meyer
4
+ *                    <ben+systempreferences at meyerhome dot net>
5
+ *
6
+ * This program is free software; you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation; either version 2 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
+ * Library General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Library General Public License
17
+ * along with this library; see the file COPYING.LIB.  If not, write to
18
+ * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
19
+ * Boston, MA 02110-1301, USA.
20
+ */
21
+
22
+#ifndef KCMSEARCH_H
23
+#define KCMSEARCH_H
24
+
25
+#include <kiconviewsearchline.h> 
26
+#include "kcmodulemenu.h"
27
+
28
+class ModulesView;
29
+
30
+/**
31
+ * Searches all the ModuleIconItem's in MainWindow and "disables" the ones
32
+ * whos keywords don't match the current search.
33
+ */
34
+class KcmSearch : public KIconViewSearchLine
35
+{
36
+	Q_OBJECT
37
+
38
+public:
39
+	KcmSearch( QPtrList<ModulesView> *moduleViewList, QWidget *parent = 0, const char *name = 0 );
40
+
41
+public slots:
42
+	/**
43
+	 * Go through all of the iconView groups in mainView and update
44
+	 */
45
+	virtual void updateSearch( const QString &search = QString::null );
46
+	/**
47
+	 * Check module associated with item or if a group check all modules of that group.
48
+	 * @return true if search is in the module(s) keywords
49
+	 */
50
+	virtual bool itemMatches ( const QIconViewItem *item, const QString &search ) const;
51
+
52
+signals:
53
+	void searchHits(const QString &query, int *hitList, int length);
54
+
55
+private:
56
+	/**
57
+	 * Determine if module matches the search 
58
+	 * @return true if search is in module's keywords
59
+	 */
60
+	bool itemMatches ( const KCModuleInfo &module, const QString &search ) const;
61
+
62
+	// Friend class whos groups parsed, 
63
+	QPtrList<ModulesView> *moduleViewList;
64
+};
65
+
66
+#endif // KCMSEARCH_H
67
+

+ 431
- 0
systemsettings/kcmultiwidget.cpp View File

@@ -0,0 +1,431 @@
1
+/*
2
+   Copyright (c) 2000 Matthias Elter <elter@kde.org>
3
+   Copyright (c) 2003 Daniel Molkentin <molkentin@kde.org>
4
+   Copyright (c) 2003 Matthias Kretz <kretz@kde.org>
5
+   Copyright (c) 2004 Frans Englich <frans.erglich.com>
6
+
7
+   This library is free software; you can redistribute it and/or
8
+   modify it under the terms of the GNU Library General Public
9
+   License as published by the Free Software Foundation; either
10
+   version 2 of the License, or (at your option) any later version.
11
+
12
+   This library is distributed in the hope that it will be useful,
13
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
+   Library General Public License for more details.
16
+
17
+   You should have received a copy of the GNU Library General Public License
18
+   along with this library; see the file COPYING.LIB.  If not, write to
19
+   the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
20
+   Boston, MA 02110-1301, USA.
21
+
22
+*/
23
+
24
+#include <qcursor.h>
25
+#include <qhbox.h>
26
+#include <qlayout.h>
27
+#include <qpushbutton.h>
28
+
29
+#include <kaboutdata.h>
30
+#include <kapplication.h>
31
+#include <kdebug.h>
32
+#include <kiconloader.h>
33
+#include <klibloader.h>
34
+#include <klocale.h>
35
+#include <kmessagebox.h>
36
+#include <kprocess.h>
37
+#include <krun.h>
38
+#include <kstdguiitem.h>
39
+#include <kuser.h>
40
+
41
+#include "kcmoduleloader.h"
42
+#include "kcmoduleproxy.h"
43
+#include "kcmultiwidget.h"
44
+
45
+/*
46
+Button usage:
47
+
48
+    User1 => Reset
49
+    User2 => Close
50
+    User3 => Admin
51
+*/
52
+
53
+class KCMultiWidget::KCMultiWidgetPrivate
54
+{
55
+	public:
56
+		KCMultiWidgetPrivate()
57
+			: hasRootKCM( false ), currentModule( 0 )
58
+		{}
59
+
60
+		bool hasRootKCM;
61
+		KCModuleProxy* currentModule;
62
+};
63
+
64
+ 
65
+KCMultiWidget::KCMultiWidget(QWidget *parent, const char *name, bool modal)
66
+	: KDialogBase(IconList, i18n("Configure"), Help | Default |Cancel | Apply |
67
+			Ok | User1 | User2 | User3, Ok, parent, name, modal, true,
68
+			KStdGuiItem::reset(), KStdGuiItem::close(), KStdGuiItem::adminMode())
69
+	, dialogface( IconList ), d( new KCMultiWidgetPrivate )
70
+{
71
+	init();
72
+}
73
+
74
+KCMultiWidget::KCMultiWidget( int dialogFace, QWidget * parent, const char * name, bool modal )
75
+	: KDialogBase( dialogFace, "Caption", Help | Default | Cancel | Apply | Ok |
76
+			User1 | User2 | User3, Ok, parent, name, modal, true,
77
+			KStdGuiItem::reset(), KStdGuiItem::close(), KStdGuiItem::adminMode())
78
+	, dialogface( dialogFace ), d( new KCMultiWidgetPrivate )
79
+{
80
+	init();
81
+}
82
+
83
+inline void KCMultiWidget::init()
84
+{
85
+	connect( this, SIGNAL( finished()), SLOT( dialogClosed()));
86
+	showButton( Ok, false );
87
+	showButton( Cancel, false );
88
+	showButton( User1, true );     // Reset button
89
+	showButton( User2, true );    // Close button.
90
+	showButton( User3, true);      // Admin button.
91
+
92
+	enableButton(Apply, false);
93
+	enableButton(User1, false);
94
+
95
+	connect(this, SIGNAL(aboutToShowPage(QWidget *)), this, SLOT(slotAboutToShow(QWidget *)));
96
+	setInitialSize(QSize(640,480));
97
+	moduleParentComponents.setAutoDelete( true );
98
+}
99
+#include <kmessagebox.h>
100
+
101
+KCMultiWidget::~KCMultiWidget()
102
+{
103
+	OrphanMap::Iterator end2 = m_orphanModules.end();
104
+	for( OrphanMap::Iterator it = m_orphanModules.begin(); it != end2; ++it )
105
+		delete ( *it );
106
+}
107
+
108
+void KCMultiWidget::slotDefault()
109
+{
110
+	int curPageIndex = activePageIndex();
111
+
112
+	ModuleList::Iterator end = m_modules.end();
113
+	for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it )
114
+		if( pageIndex( ( QWidget * )( *it ).kcm->parent() ) == curPageIndex )
115
+		{
116
+		  ( *it ).kcm->defaults();
117
+		  clientChanged( true );
118
+		  return;
119
+		}
120
+}
121
+
122
+// Reset button.
123
+void KCMultiWidget::slotUser1()
124
+{
125
+	int curPageIndex = activePageIndex();
126
+
127
+	ModuleList::Iterator end = m_modules.end();
128
+	for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it )
129
+		if( pageIndex( ( QWidget * )( *it ).kcm->parent() ) == curPageIndex )
130
+		{
131
+			( *it ).kcm->load();
132
+			clientChanged( false );
133
+			return;
134
+		}
135
+}
136
+
137
+void KCMultiWidget::apply()
138
+{
139
+	QStringList updatedModules;
140
+	ModuleList::Iterator end = m_modules.end();
141
+	for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it )
142
+	{
143
+		KCModuleProxy * m = ( *it ).kcm;
144
+		if( m && m->changed() )
145
+		{
146
+			m->save();
147
+			QStringList * names = moduleParentComponents[ m ];
148
+			kdDebug() << k_funcinfo << *names << " saved and added to the list" << endl;
149
+			for( QStringList::ConstIterator it = names->begin(); it != names->end(); ++it )
150
+				if( updatedModules.find( *it ) == updatedModules.end() )
151
+					updatedModules.append( *it );
152
+		}
153
+	}
154
+	for( QStringList::const_iterator it = updatedModules.begin(); it != updatedModules.end(); ++it )
155
+	{
156
+		kdDebug() << k_funcinfo << *it << " " << ( *it ).latin1() << endl;
157
+		emit configCommitted( ( *it ).latin1() );
158
+	}
159
+	emit configCommitted();
160
+}
161
+
162
+void KCMultiWidget::slotApply()
163
+{
164
+	QPushButton *button = actionButton(Apply);
165
+	if (button)
166
+		button->setFocus();
167
+	emit applyClicked();
168
+	apply();
169
+}
170
+
171
+
172
+void KCMultiWidget::slotOk()
173
+{
174
+	QPushButton *button = actionButton(Ok);
175
+	if (button)
176
+		button->setFocus();
177
+	emit okClicked();
178
+	apply();
179
+	accept();
180
+}
181
+
182
+void KCMultiWidget::slotHelp()
183
+{
184
+	QString docPath;
185
+
186
+	int curPageIndex = activePageIndex();
187
+	ModuleList::Iterator end = m_modules.end();
188
+	for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it )
189
+		if( pageIndex( ( QWidget * )( *it ).kcm->parent() ) == curPageIndex )
190
+		{
191
+			docPath = ( *it ).kcm->moduleInfo().docPath();
192
+			break;
193
+		}
194
+
195
+	KURL url( KURL("help:/"), docPath );
196
+
197
+	if (url.protocol() == "help" || url.protocol() == "man" || url.protocol() == "info") {
198
+		KProcess process;
199
+		process << "khelpcenter"
200
+				<< url.url();
201
+		process.start(KProcess::DontCare);
202
+		process.detach();
203
+	} else {
204
+		new KRun(url);
205
+	}
206
+}
207
+
208
+// Close button
209
+void KCMultiWidget::slotUser2() {
210
+    emit close();
211
+}
212
+
213
+void KCMultiWidget::clientChanged(bool state)
214
+{
215
+	kdDebug( 710 ) << k_funcinfo << state << endl;
216
+	ModuleList::Iterator end = m_modules.end();
217
+	for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it )
218
+		if( ( *it ).kcm->changed() ) {
219
+			enableButton( Apply, true );
220
+                        enableButton( User1, true);
221
+			return;
222
+		}
223
+	enableButton( Apply, false );
224
+        enableButton( User1, false);
225
+}
226
+
227
+void KCMultiWidget::addModule(const QString& path, bool withfallback)
228
+{
229
+	QString complete = path;
230
+
231
+	if( !path.endsWith( ".desktop" ))
232
+		complete += ".desktop";
233
+
234
+	KService::Ptr service = KService::serviceByStorageId( complete );
235
+
236
+	addModule( KCModuleInfo( service ), QStringList(), withfallback);
237
+}
238
+
239
+void KCMultiWidget::addModule(const KCModuleInfo& moduleinfo,
240
+		QStringList parentmodulenames, bool withfallback)
241
+{
242
+	if( !moduleinfo.service() )
243
+		return;
244
+
245
+	if ( !kapp->authorizeControlModule( moduleinfo.service()->menuId() ))
246
+			return;
247
+
248
+	if( !KCModuleLoader::testModule( moduleinfo ))
249
+			return;
250
+
251
+	QFrame* page = 0;
252
+	if (!moduleinfo.service()->noDisplay())
253
+		switch( dialogface )
254
+		{
255
+			case TreeList:
256
+				parentmodulenames += moduleinfo.moduleName();
257
+				page = addHBoxPage( parentmodulenames, moduleinfo.comment(),
258
+						SmallIcon( moduleinfo.icon(),
259
+							IconSize( KIcon::Small ) ) );
260
+				break;
261
+			case Tabbed:
262
+			case IconList:
263
+				page = addHBoxPage( moduleinfo.moduleName(),
264
+						moduleinfo.comment(), DesktopIcon( moduleinfo.icon(),
265
+							KIcon::SizeMedium ) );
266
+				break;
267
+			case Plain:
268
+				page = plainPage();
269
+				( new QHBoxLayout( page ) )->setAutoAdd( true );
270
+				break;
271
+			default:
272
+				kdError( 710 ) << "unsupported dialog face for KCMultiWidget"
273
+					<< endl;
274
+				break;
275
+		}
276
+	if(!page) {
277
+		KCModuleLoader::unloadModule(moduleinfo);
278
+		return;
279
+	}
280
+	KCModuleProxy * module;
281
+	if( m_orphanModules.contains( moduleinfo.service() ) )
282
+	{
283
+		// the KCModule already exists - it was removed from the dialog in
284
+		// removeAllModules
285
+		module = m_orphanModules[ moduleinfo.service() ];
286
+		m_orphanModules.remove( moduleinfo.service() );
287
+		kdDebug( 710 ) << "Use KCModule from the list of orphans for " <<
288
+			moduleinfo.moduleName() << ": " << module << endl;
289
+
290
+		module->reparent( page, 0, QPoint( 0, 0 ), true );
291
+
292
+		if( module->changed() )
293
+			clientChanged( true );
294
+
295
+		if( activePageIndex() == -1 ) {
296
+			showPage( pageIndex( page ) );
297
+		}
298
+	}
299
+	else
300
+	{
301
+		module = new KCModuleProxy( moduleinfo, withfallback, page );
302
+
303
+		QStringList parentComponents = moduleinfo.service()->property(
304
+				"X-KDE-ParentComponents" ).toStringList();
305
+		moduleParentComponents.insert( module,
306
+				new QStringList( parentComponents ) );
307
+
308
+		connect(module, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool)));
309
+
310
+	}
311
+
312
+	CreatedModule cm;
313
+	cm.kcm = module;
314
+	cm.service = moduleinfo.service();
315
+	cm.adminmode = false;
316
+	cm.buttons = module->buttons();
317
+	if ( moduleinfo.needsRootPrivileges() &&
318
+			!KUser().isSuperUser() ) {/* If we're embedded, it's true */
319
+		d->hasRootKCM = true;
320
+		cm.adminmode = true;
321
+		m_modules.append( cm );
322
+		if( dialogface==Plain ) {
323
+			slotAboutToShow( page ); // Won't be called otherwise, necessary for adminMode button
324
+               }
325
+	} else {
326
+		m_modules.append( cm );
327
+	}
328
+
329
+	if( m_modules.count() == 1 ) {
330
+		slotAboutToShow( page );
331
+	}
332
+}
333
+
334
+KCModuleProxy * KCMultiWidget::currentModule() {
335
+	if(d) {
336
+		return d->currentModule;
337
+	}
338
+	return NULL;
339
+}
340
+
341
+void KCMultiWidget::applyOrRevert(KCModuleProxy * module){
342
+	if( !module || !module->changed() )
343
+		return;
344
+	
345
+	int res = KMessageBox::warningYesNo(this,
346
+				i18n("There are unsaved changes in the active module.\n"
347
+    			 "Do you want to apply the changes or discard them?"),
348
+                                          i18n("Unsaved Changes"),
349
+                                          KStdGuiItem::apply(),
350
+                                         KStdGuiItem::discard());
351
+	if (res == KMessageBox::Yes) {
352
+		slotApply();
353
+	} else {
354
+		module->load();
355
+		clientChanged( false );
356
+	}
357
+}
358
+
359
+
360
+void KCMultiWidget::slotAboutToShow(QWidget *page)
361
+{
362
+	QObject * obj = page->child( 0, "KCModuleProxy" );
363
+	if( ! obj )
364
+		return;
365
+
366
+	KCModuleProxy *module = ( KCModuleProxy* )obj->qt_cast( "KCModuleProxy" );
367
+	if( ! module )
368
+		return;
369
+
370
+	if( d && d->currentModule )
371
+		applyOrRevert( d->currentModule );
372
+	
373
+	d->currentModule = module;
374
+	emit ( aboutToShow( d->currentModule ) );
375
+
376
+	ModuleList::Iterator end = m_modules.end();
377
+	int buttons = 0;
378
+	for( ModuleList::Iterator it = m_modules.begin(); it != end; ++it ) {
379
+		if( ( *it ).kcm==d->currentModule) {
380
+			showButton(User3, ( *it ).adminmode);
381
+			buttons = ( *it ).buttons;
382
+		}
383
+	}
384
+
385
+        showButton(Apply, buttons & KCModule::Apply);
386
+        showButton(User1, buttons & KCModule::Apply);   // Reset button.
387
+
388
+        // Close button. No Apply button implies a Close button.
389
+        showButton(User2, (buttons & KCModule::Apply)==0);
390
+
391
+	enableButton( KDialogBase::Help, buttons & KCModule::Help );
392
+	enableButton( KDialogBase::Default, buttons & KCModule::Default );
393
+
394
+	disconnect( this, SIGNAL(user3Clicked()), 0, 0 );
395
+
396
+	if (d->currentModule->moduleInfo().needsRootPrivileges() &&
397
+			!d->currentModule->rootMode() )
398
+	{ /* Enable the Admin Mode button */
399
+		enableButton( User3, true );
400
+		connect( this, SIGNAL(user3Clicked()), d->currentModule, SLOT( runAsRoot() ));
401
+		connect( this, SIGNAL(user3Clicked()), SLOT( disableRModeButton() ));
402
+	} else {
403
+		enableButton( User3, false );
404
+	}
405
+}
406
+
407
+void KCMultiWidget::rootExit()
408
+{
409
+	enableButton( User3, true);
410
+}
411
+
412
+void KCMultiWidget::disableRModeButton()
413
+{
414
+	enableButton( User3, false );
415
+	connect ( d->currentModule, SIGNAL( childClosed() ), SLOT( rootExit() ) );
416
+}
417
+
418
+void KCMultiWidget::slotCancel() {
419
+	dialogClosed();
420
+	KDialogBase::slotCancel();
421
+}
422
+
423
+void KCMultiWidget::dialogClosed()
424
+{
425
+	if(d)
426
+	{
427
+		applyOrRevert(d->currentModule);
428
+	}
429
+}
430
+
431
+#include "kcmultiwidget.moc"

+ 255
- 0
systemsettings/kcmultiwidget.h View File

@@ -0,0 +1,255 @@
1
+/*
2
+   Copyright (c) 2000 Matthias Elter <elter@kde.org>
3
+   Copyright (c) 2003 Daniel Molkentin <molkentin@kde.org>
4
+   Copyright (c) 2003 Matthias Kretz <kretz@kde.org>
5
+
6
+   This library is free software; you can redistribute it and/or
7
+   modify it under the terms of the GNU Library General Public
8
+   License as published by the Free Software Foundation; either
9
+   version 2 of the License, or (at your option) any later version.
10
+
11
+   This library is distributed in the hope that it will be useful,
12
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
+   Library General Public License for more details.
15
+
16
+   You should have received a copy of the GNU Library General Public License
17
+   along with this library; see the file COPYING.LIB.  If not, write to
18
+   the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
19
+   Boston, MA 02110-1301, USA.
20
+
21
+*/
22
+
23
+#ifndef KCMULTIDIALOG_H
24
+#define KCMULTIDIALOG_H
25
+
26
+#include <qptrdict.h>
27
+
28
+#include <kdialogbase.h>
29
+#include <klocale.h>
30
+#include <kservice.h>
31
+
32
+class KCModuleProxy;
33
+class KCModuleInfo;
34
+class KCModule;
35
+
36
+/**
37
+ * @short A method that offers a KDialogBase containing arbitrary
38
+ *   Control Modules.
39
+ */
40
+class KUTILS_EXPORT KCMultiWidget : public KDialogBase
41
+{
42
+	Q_OBJECT
43
+
44
+public:
45
+	/**
46
+	 * Constructs a new KCMultiWidget
47
+	 *
48
+	 * @param parent The parent widget
49
+	 * @param name The widget name
50
+	 * @param modal If you pass true here, the dialog will be modal
51
+	 **/
52
+	KCMultiWidget( QWidget *parent=0, const char *name=0, bool modal=false );
53
+
54
+	/**
55
+	 * Construct a personalized KCMultiWidget.
56
+	 *
57
+	 * @param dialogFace You can use TreeList, Tabbed, Plain, Swallow or
58
+	 *		IconList.
59
+	 * @param parent Parent of the dialog.
60
+	 * @param name Dialog name (for internal use only).
61
+	 * @param modal Controls dialog modality. If @p false, the rest of the
62
+	 *		program interface (example: other dialogs) is accessible while
63
+	 *		the dialog is open.
64
+	 */
65
+	KCMultiWidget( int dialogFace, QWidget * parent = 0, 
66
+			const char * name = 0, bool modal = false );
67
+
68
+
69
+	/**
70
+	 * Destructor
71
+	 **/
72
+   virtual ~KCMultiWidget();
73
+
74
+	/**
75
+	 * Add a module.
76
+	 *
77
+	 * @param module Specify the name of the module that is to be added
78
+	 *			   to the list of modules the dialog will show.
79
+	 *
80
+	 * @param withfallback Try harder to load the module. Might result
81
+	 *					 in the module appearing outside the dialog.
82
+	 **/
83
+	void addModule(const QString& module, bool withfallback=true);
84
+
85
+	/**
86
+	 * Add a module.
87
+	 *
88
+	 * @param moduleinfo Pass a KCModuleInfo object which will be
89
+	 *				   used for creating the module. It will be added
90
+	 *				   to the list of modules the dialog will show.
91
+	 *
92
+	 * @param parentmodulenames The names of the modules that should appear as
93
+	 *						  parents in the TreeList. Look at the
94
+	 *						  KDialogBase::addPage documentation for more info
95
+	 *						  on this.
96
+	 *
97
+	 * @param withfallback Try harder to load the module. Might result
98
+	 *					 in the module appearing outside the dialog.
99
+	 **/
100
+	void addModule(const KCModuleInfo& moduleinfo, QStringList
101
+			parentmodulenames = QStringList(), bool withfallback=false);
102
+
103
+	/**
104
+	 * @return the current module that is being shown.
105
+	 */
106
+	KCModuleProxy * currentModule();
107
+	
108
+signals:
109
+	/**
110
+	 * Emitted after all KCModules have been told to save their configuration.
111
+	 *
112
+	 * The applyClicked and okClicked signals are emitted before the
113
+	 * configuration is saved.
114
+	 */
115
+	void configCommitted();
116
+
117
+	/**
118
+	 * Emitted after the KCModules have been told to save their configuration.
119
+	 * It is emitted once for every instance the KCMs that were changed belong
120
+	 * to.
121
+	 *
122
+	 * You can make use of this if you have more than one component in your
123
+	 * application. instanceName tells you the instance that has to reload its
124
+	 * configuration.
125
+	 *
126
+	 * The applyClicked and okClicked signals are emitted before the
127
+	 * configuration is saved.
128
+	 *
129
+	 * @param instanceName The name of the instance that needs to reload its
130
+	 *					 configuration.
131
+	 */
132
+	void configCommitted( const QCString & instanceName );
133
+
134
+	/**
135
+	 * Emitted right before a module is shown.
136
+	 * Usefull for updating caption, help, etc
137
+	 *
138
+	 * @param moduleinfo The module that is about to be shown.
139
+	 * @sense 3.4
140
+	 */
141
+	void aboutToShow( KCModuleProxy *moduleProxy );
142
+
143
+        void close();
144
+
145
+protected slots:
146
+	/**
147
+	 * This slot is called when the user presses the "Default" Button.
148
+	 * You can reimplement it if needed.
149
+	 *
150
+	 * @note Make sure you call the original implementation.
151
+	 **/
152
+	virtual void slotDefault();
153
+
154
+	/**
155
+	 * This slot is called when the user presses the "Reset" Button.
156
+	 * You can reimplement it if needed.
157
+	 *
158
+	 * @note Make sure you call the original implementation.
159
+	 */
160
+	virtual void slotUser1();
161
+	virtual void slotUser2();
162
+
163
+	/**
164
+	 * This slot is called when the user presses the "Apply" Button.
165
+	 * You can reimplement it if needed.
166
+	 *
167
+	 * @note Make sure you call the original implementation.
168
+	 **/
169
+	virtual void slotApply();
170
+
171
+	/**
172
+	 * This slot is called when the user presses the "OK" Button.
173
+	 * You can reimplement it if needed.
174
+	 *
175
+	 * @note Make sure you call the original implementation.
176
+	 **/
177
+	virtual void slotOk();
178
+
179
+	/**
180
+	 * This slot is called when the user presses the "Help" Button.
181
+	 * It reads the DocPath field of the currently selected KControl
182
+	 * module's .desktop file to find the path to the documentation,
183
+	 * which it then attempts to load.
184
+	 * 
185
+	 * You can reimplement this slot if needed.
186
+	 *
187
+	 * @note Make sure you call the original implementation.
188
+	 **/
189
+	virtual void slotHelp();
190
+
191
+	virtual void slotCancel();
192
+
193
+private slots:
194
+
195
+	void slotAboutToShow(QWidget *);
196
+
197
+	void clientChanged(bool state);
198
+
199
+	/**
200
+	 * Called when entering root mode, and disables
201
+	 * the Admin Mode button such that the user doesn't do it
202
+	 * twice.
203
+	 *
204
+	 * @since 3.4
205
+	 */
206
+	void disableRModeButton();
207
+
208
+	/**
209
+	 * Called when the current module exits from root 
210
+	 * mode. Enables the Administrator Mode button, again.
211
+	 *
212
+	 * @since 3.4
213
+	 */
214
+	void rootExit();
215
+
216
+	/**
217
+	 *
218
+	 * Called when the dialog is hidden. It unregisters the modules,
219
+	 * such that they don't hinder the same modules to be opened in 
220
+	 * another application.
221
+	 *
222
+	 * @since 3.4
223
+	 */
224
+	void dialogClosed();
225
+
226
+private:
227
+
228
+	void applyOrRevert(KCModuleProxy * module);
229
+
230
+	void init();
231
+	void apply();
232
+
233
+	struct CreatedModule
234
+	{
235
+		KCModuleProxy * kcm;
236
+		KService::Ptr service;
237
+		bool adminmode;
238
+		int buttons;
239
+	};
240
+	typedef QValueList<CreatedModule> ModuleList;
241
+	ModuleList m_modules;
242
+
243
+	typedef QMap<KService::Ptr, KCModuleProxy*> OrphanMap;
244
+	OrphanMap m_orphanModules;
245
+
246
+	QPtrDict<QStringList> moduleParentComponents;
247
+	QString _docPath;
248
+	int dialogface;
249
+
250
+	class KCMultiWidgetPrivate;
251
+	KCMultiWidgetPrivate *d;
252
+};
253
+
254
+#endif //KCMULTIDIALOG_H
255
+

+ 38
- 0
systemsettings/kcscrollview.cpp View File

@@ -0,0 +1,38 @@
1
+/*
2
+   Copyright (c) 2006 Simon Edwards <simon@simonzone.com>
3
+
4
+   This library is free software; you can redistribute it and/or
5
+   modify it under the terms of the GNU Library General Public
6
+   License as published by the Free Software Foundation; either
7
+   version 2 of the License, or (at your option) any later version.
8
+
9
+   This library is distributed in the hope that it will be useful,
10
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+   Library General Public License for more details.
13
+
14
+   You should have received a copy of the GNU Library General Public License
15
+   along with this library; see the file COPYING.LIB.  If not, write to
16
+   the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
17
+   Boston, MA 02110-1301, USA.
18
+
19
+*/
20
+
21
+#include "kcscrollview.h"
22
+
23
+KCScrollView::KCScrollView( QWidget * parent, const char * name, WFlags f) : QScrollView(parent,name,f) {
24
+	setResizePolicy(AutoOneFit);
25
+	mainChild = 0;
26
+}
27
+
28
+QSize KCScrollView::sizeHint() const {
29
+	QSize vphint = mainChild->sizeHint();
30
+	vphint.setWidth(vphint.width()+2*frameWidth());
31
+	vphint.setHeight(vphint.height()+2*frameWidth());
32
+	return vphint;
33
+}
34
+
35
+void KCScrollView::addChild(QWidget *child, int x, int y) {
36
+	mainChild = child;
37
+	QScrollView::addChild(child,x,y);
38
+}

+ 35
- 0
systemsettings/kcscrollview.h View File

@@ -0,0 +1,35 @@
1
+/*
2
+   Copyright (c) 2006 Simon Edwards <simon@simonzone.com>
3
+
4
+   This library is free software; you can redistribute it and/or
5
+   modify it under the terms of the GNU Library General Public
6
+   License as published by the Free Software Foundation; either
7
+   version 2 of the License, or (at your option) any later version.
8
+
9
+   This library is distributed in the hope that it will be useful,
10
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+   Library General Public License for more details.
13
+
14
+   You should have received a copy of the GNU Library General Public License
15
+   along with this library; see the file COPYING.LIB.  If not, write to
16
+   the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
17
+   Boston, MA 02110-1301, USA.
18
+
19
+*/
20
+
21
+#ifndef KCSCROLLVIEW_H
22
+#define KCSCROLLVIEW_H
23
+#include <qscrollview.h>
24
+
25
+class KCScrollView : public QScrollView {
26
+public:
27
+	KCScrollView ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 );
28
+
29
+	virtual QSize sizeHint() const;
30
+	virtual void addChild(QWidget *child, int x=0, int y=0);
31
+private:
32
+	QWidget *mainChild;
33
+};
34
+
35
+#endif

+ 62
- 0
systemsettings/main.cpp View File

@@ -0,0 +1,62 @@
1
+/**
2
+ * This file is part of the System Settings package
3
+ * Copyright (C) 2005 Benjamin C Meyer
4
+ *                    <ben+systempreferences at meyerhome dot net>
5
+ *
6
+ * This program is free software; you can redistribute it and/or modify
7
+ * it under the terms of the GNU General Public License as published by
8
+ * the Free Software Foundation; either version 2 of the License, or
9
+ * (at your option) any later version.
10
+ *
11
+ * This library is distributed in the hope that it will be useful,
12
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
+ * Library General Public License for more details.
15
+ *
16
+ * You should have received a copy of the GNU Library General Public License
17
+ * along with this library; see the file COPYING.LIB.  If not, write to
18
+ * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
19
+ * Boston, MA 02110-1301, USA.
20
+ */
21
+
22
+#include <kapplication.h>
23
+#include <kcmdlineargs.h>
24
+#include <kaboutdata.h>
25
+
26
+#include "mainwindow.h"
27
+#include "version.h"
28
+
29
+static KCmdLineOptions options[] =
30
+{
31
+	{ "menu <argument>", I18N_NOOP("Menu file"), "systemsettings" },
32
+	{ "e", 0, 0 },
33
+	{ "noembed", I18N_NOOP("Embed windows"), 0 },
34
+	KCmdLineLastOption
35
+};
36
+
37
+int main( int argc, char *argv[] )
38
+{
39
+  KLocale::setMainCatalogue("systemsettings");
40
+	// About data
41
+  KAboutData aboutData("systemsettings", I18N_NOOP("System Settings"),
42
+	  SYSTEM_SETTINGS_VERSION, I18N_NOOP("System Settings"),
43
+	  KAboutData::License_LGPL, "(c) 2005, Benjamin C. Meyer", 0, 0);
44
+  aboutData.addAuthor("Benjamin C. Meyer", I18N_NOOP("Author & Maintainer"),
45
+	  "ben+systempreferences@meyerhome.net");
46
+  KCmdLineArgs::init(argc, argv, &aboutData);
47
+
48
+	// Tell which options are supported
49
+  KCmdLineArgs::addCmdLineOptions( options );
50
+
51
+	KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
52
+
53
+	// Launch
54
+  KApplication application(argc, argv);
55
+
56
+	MainWindow *mainWindow = new MainWindow(args->isSet("embed"), args->getOption("menu"));
57
+	application.setMainWidget( mainWindow );
58
+	mainWindow->show();
59
+
60
+	return application.exec();
61
+}
62
+

+ 362
- 0
systemsettings/mainwindow.cpp View File

@@ -0,0 +1,362 @@
1
+/**
2
+ * This file is part of the System Settings package
3
+ * Copyright (C) 2005 Benjamin C Meyer (ben+systempreferences at meyerhome dot net)
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2 of the License, or
8
+ * (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
+ * Library General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Library General Public License
16
+ * along with this library; see the file COPYING.LIB.  If not, write to
17
+ * the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
18
+ * Boston, MA 02110-1301, USA.
19
+ */
20
+
21
+#include "mainwindow.h"
22
+
23
+#include <kstdaction.h>
24
+#include <qwhatsthis.h>
25
+#include <qlabel.h>
26
+#include <qvbox.h>
27
+#include <kaction.h>
28
+#include <qtoolbutton.h>
29
+#include <klocale.h>
30
+#include <kservicegroup.h>
31
+#include <qlayout.h>
32
+#include <qwidgetstack.h>
33
+#include <qtimer.h>
34
+#include <kiconloader.h>
35
+#include <kcmoduleloader.h>
36
+#include <kdialogbase.h>
37
+#include <kiconviewsearchline.h>
38
+#include <kapplication.h>
39
+#include <kaboutapplication.h>
40
+#include <kdebug.h>
41
+#include <kcmoduleproxy.h>
42
+#include <kbugreport.h>
43
+#include <kmenubar.h>
44
+#include <kactionclasses.h>
45
+#include <ktoolbarbutton.h>
46
+#include <qtabbar.h>
47
+
48
+#include "kcmsearch.h"
49
+#include "modulesview.h"
50
+#include "moduleiconitem.h"
51
+#include "kcmodulemenu.h"
52
+#include "kcmultiwidget.h"
53
+
54
+MainWindow::MainWindow(bool embed, const QString & menuFile,
55
+								QWidget *parent, const char *name) :