dbus-1-tqt -> libdbus-tqt-1-0 AND tdelibs import (unchanged)

v3.5.13-sru
Robert Xu 13 years ago
parent 425774d7d1
commit 93c66bf8bb

@ -49,7 +49,7 @@ if [ "$SELECTION" = "1" ]; then
clear
echo "Dependencies: Select what you want us to generate."
echo "(1) libtqt4"
echo "(2) dbus-1-tqt"
echo "(2) libdbus-tqt-1-0"
echo "(3) libdbus-1-tqt-0"
echo "(4) arts"
read CHOICE
@ -66,9 +66,11 @@ elif [ "$SELECTION" = "2" ]; then
clear
echo "Main: Select what you want us to generate."
echo "(1) tdelibs"
echo "(2) tdebase"
read CHOICE
if [ "$CHOICE" = "1" ]; then NAME='kdelibs';
elif [ "$CHOICE" = "2" ]; then NAME='kdebase';
else
echo "Invalid, bye." && exit 1
fi

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Aug 24 19:36:38 UTC 2011 - rxu@lincomlinux.org
- fix naming error: libdbus-tqt-1-0
-------------------------------------------------------------------
Sat Aug 13 16:49:42 UTC 2011 - rxu@lincomlinux.org

@ -18,7 +18,7 @@
# norootforbuild
Name: dbus-1-tqt
Name: libdbus-tqt-1-0
BuildRequires: dbus-1 dbus-1-devel libtqt4-devel cmake
URL: http://dbus.freedesktop.org/
License: GPLv2+
@ -33,13 +33,15 @@ Patch0: dbus-qt3-compile-fix-thoenig-01.patch
Patch1: dbus-qt3-do-not-close-shared-connection-thoenig-01.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: dbus-1 >= %( echo `rpm -q --queryformat '%{VERSION}-%{RELEASE}' dbus-1`)
Provides: dbus-1-tqt
%package devel
License: Other uncritical OpenSource License
Summary: Developer package for TQt/KDE bindings for D-Bus
Requires: dbus-1 >= %( echo `rpm -q --queryformat '%{VERSION}-%{RELEASE}' dbus-1`)
Requires: dbus-1-devel >= %( echo `rpm -q --queryformat '%{VERSION}-%{RELEASE}' dbus-1-devel`)
Requires: dbus-1-tqt = %{version}
Requires: %{name} = %{version}
Provides: dbus-1-tqt-devel
AutoReqProv: on
Group: Development/Libraries/TDE
@ -89,8 +91,8 @@ Authors:
%prep
%setup -n dbus-tqt-%{version} -q
%patch0 -p0
%patch1 -p0
#%patch0 -p0
#%patch1 -p0
%build
RPM_OPT_FLAGS="${RPM_OPT_FLAGS} -fstack-protector -fno-strict-aliasing -fPIC"
@ -114,6 +116,7 @@ cd build
make
%install
cd build
make DESTDIR=%{buildroot} install
%post
@ -127,7 +130,7 @@ make DESTDIR=%{buildroot} install
%files
%defattr(-, root, root)
%{_libdir}/libdbus-tqt-1.so.1*
%{_libdir}/libdbus-tqt-1.so.0*
%files devel
%defattr(-, root, root)
@ -139,5 +142,6 @@ make DESTDIR=%{buildroot} install
%{_includedir}/dbus-1.0/dbus/server.h
%{_libdir}/libdbus-tqt-1.la
%{_libdir}/libdbus-tqt-1.so
%{_libdir}/pkgconfig/dbus-tqt.pc
%changelog

File diff suppressed because it is too large Load Diff

@ -0,0 +1,51 @@
Index: kcontrol/access/kaccess.cpp
===================================================================
--- kcontrol/access/kaccess.cpp.orig
+++ kcontrol/access/kaccess.cpp
@@ -216,7 +216,7 @@ void KAccessApp::readSettings()
xkb->ctrls->debounce_delay = config->readNumEntry("BounceKeysDelay", 500);
// gestures for enabling the other features
- _gestures = config->readBoolEntry("Gestures", true);
+ _gestures = config->readBoolEntry("Gestures", ::access("/opt/kde3/bin/kmag", X_OK) == 0);
if (_gestures)
xkb->ctrls->enabled_ctrls |= XkbAccessXKeysMask;
else
@@ -241,7 +241,7 @@ void KAccessApp::readSettings()
else
xkb->ctrls->ax_options &= ~(XkbAX_FeatureFBMask | XkbAX_SlowWarnFBMask);
- _gestureConfirmation = config->readBoolEntry("GestureConfirmation", true);
+ _gestureConfirmation = config->readBoolEntry("GestureConfirmation", ::access("/opt/kde3/bin/kmag", X_OK) == 0);
_kNotifyModifiers = config->readBoolEntry("kNotifyModifiers", false);
_kNotifyAccessX = config->readBoolEntry("kNotifyAccessX", false);
Index: kcontrol/access/kcmaccess.cpp
===================================================================
--- kcontrol/access/kcmaccess.cpp.orig
+++ kcontrol/access/kcmaccess.cpp
@@ -7,6 +7,7 @@
#include <stdlib.h>
+#include <unistd.h>
#include <math.h>
#include <dcopref.h>
@@ -686,12 +687,14 @@ void KAccessConfig::load( bool useDefaul
bounceKeysDelay->setValue(config->readNumEntry("BounceKeysDelay", 500));
bounceKeysRejectBeep->setChecked(config->readBoolEntry("BounceKeysRejectBeep", true));
- gestures->setChecked(config->readBoolEntry("Gestures", true));
+ gestures->setChecked(config->readBoolEntry("Gestures",
+ ::access("/opt/kde3/bin/kmag", X_OK) == 0));
timeout->setChecked(config->readBoolEntry("AccessXTimeout", false));
timeoutDelay->setValue(config->readNumEntry("AccessXTimeoutDelay", 30));
accessxBeep->setChecked(config->readBoolEntry("AccessXBeep", true));
- gestureConfirmation->setChecked(config->readBoolEntry("GestureConfirmation", false));
+ gestureConfirmation->setChecked(config->readBoolEntry("GestureConfirmation",
+ ::access("/opt/kde3/bin/kmag", X_OK) == 0));
kNotifyAccessX->setChecked(config->readBoolEntry("kNotifyAccessX", false));
delete config;

@ -0,0 +1,122 @@
Index: kicker/applets/lockout/lockout.cpp
===================================================================
--- kicker/applets/lockout/lockout.cpp.orig
+++ kicker/applets/lockout/lockout.cpp
@@ -31,6 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include <qtoolbutton.h>
#include <qstyle.h>
#include <qtooltip.h>
+#include <qobjectlist.h>
#include <dcopclient.h>
@@ -54,7 +55,7 @@ extern "C"
}
Lockout::Lockout( const QString& configFile, QWidget *parent, const char *name)
- : KPanelApplet( configFile, KPanelApplet::Normal, 0, parent, name ), bTransparent( false )
+ : KPanelApplet( configFile, KPanelApplet::Normal, 0, parent, name ), bTransparent( false ), bAlternateButtonOrder( false )
{
KConfig *conf = config();
conf->setGroup("lockout");
@@ -71,8 +72,16 @@ Lockout::Lockout( const QString& configF
layout->setMargin( 0 );
layout->setSpacing( 0 );
- lockButton = new SimpleButton( this, "lock");
- logoutButton = new SimpleButton( this, "logout");
+ bAlternateButtonOrder = !conf->readBoolEntry( "OriginalLayout",true );
+
+ if (bAlternateButtonOrder) {
+ lockButton = new SimpleButton( this, "lock");
+ logoutButton = new SimpleButton( this, "logout");
+ }
+ else {
+ logoutButton = new SimpleButton( this, "logout");
+ lockButton = new SimpleButton( this, "lock");
+ }
QToolTip::add( lockButton, i18n("Lock the session") );
QToolTip::add( logoutButton, i18n("Log out") );
@@ -204,12 +213,15 @@ bool Lockout::eventFilter( QObject *o, Q
this, SLOT( lock() ) );
popup->insertSeparator();
+ popup->insertItem( i18n( "&Alternate Button Order" ), 90 );
i18n("&Transparent");
//popup->insertItem( i18n( "&Transparent" ), 100 );
popup->insertItem( SmallIcon( "configure" ),
i18n( "&Configure Screen Saver..." ),
this, SLOT( slotLockPrefs() ) );
+ popup->setItemChecked( 90, bAlternateButtonOrder );
+ popup->connectItem(90, this, SLOT( slotButtonOrder() ) );
//popup->setItemChecked( 100, bTransparent );
//popup->connectItem(100, this, SLOT( slotTransparent() ) );
//if (conf->entryIsImmutable( "Transparent" ))
@@ -226,6 +238,7 @@ bool Lockout::eventFilter( QObject *o, Q
popup->insertItem( SmallIcon( "exit" ), i18n("&Log Out..."),
this, SLOT( logout() ) );
popup->insertSeparator();
+ popup->insertItem( i18n( "&Alternate Button Order" ), 90 );
//popup->insertItem( i18n( "&Transparent" ), 100 );
popup->insertItem( SmallIcon( "configure" ),
i18n( "&Configure Session Manager..." ),
@@ -235,6 +248,9 @@ bool Lockout::eventFilter( QObject *o, Q
//popup->connectItem(100, this, SLOT( slotTransparent() ) );
//if (conf->entryIsImmutable( "Transparent" ))
// popup->setItemEnabled( 100, false );
+ popup->setItemChecked( 90, bAlternateButtonOrder );
+ popup->connectItem(90, this, SLOT( slotButtonOrder() ) );
+
popup->exec( me->globalPos() );
delete popup;
@@ -263,6 +279,27 @@ void Lockout::slotTransparent()
conf->sync();
}
+void Lockout::slotButtonOrder()
+{
+ QObject* child = children()->getFirst();
+
+ if (bAlternateButtonOrder)
+ child = lockButton;
+ else
+ child = logoutButton;
+
+ removeChild(child);
+ insertChild(child);
+ update();
+
+ bAlternateButtonOrder = !bAlternateButtonOrder;
+
+ KConfig* conf = config();
+ conf->setGroup("lockout");
+ conf->writeEntry( "OriginalLayout", !bAlternateButtonOrder );
+ conf->sync();
+}
+
void Lockout::slotLogoutPrefs()
{
// Run the logout settings.
Index: kicker/applets/lockout/lockout.h
===================================================================
--- kicker/applets/lockout/lockout.h.orig
+++ kicker/applets/lockout/lockout.h
@@ -36,6 +36,7 @@ private slots:
void slotLockPrefs();
void slotLogoutPrefs();
+ void slotButtonOrder();
void slotTransparent();
void slotIconChanged();
@@ -47,6 +48,7 @@ private:
QBoxLayout *layout;
bool bTransparent;
+ bool bAlternateButtonOrder;
};
#endif // LOCKOUT_H

@ -0,0 +1,98 @@
Index: kcontrol/arts/Makefile.am
===================================================================
--- kcontrol/arts/Makefile.am.orig
+++ kcontrol/arts/Makefile.am
@@ -1,3 +1,9 @@
+bin_PROGRAMS = arts-start
+
+arts_start_SOURCES = arts-start.cpp
+arts_start_LDFLAGS = $(all_libraries)
+arts_start_LDADD = $(LIB_KDECORE)
+
kde_module_LTLIBRARIES = kcm_arts.la
kcm_arts_la_SOURCES = arts.cpp generaltab.ui hardwaretab.ui krichtextlabel.cpp
Index: kcontrol/arts/arts-start.cpp
===================================================================
--- /dev/null
+++ kcontrol/arts/arts-start.cpp
@@ -0,0 +1,79 @@
+/*
+
+ Copyright (C) 2007 Lubos Lunak <l.lunak@suse.cz>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+ Permission is also granted to link this program with the Qt
+ library, treating Qt like a library that normally accompanies the
+ operating system kernel, whether or not that is in fact the case.
+
+*/
+
+#include <kconfig.h>
+#include <kinstance.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <X11/Xlib.h>
+
+static bool arts_running()
+ {
+ int status = system( "artsshell status >/dev/null 2>/dev/null" );
+ return WIFEXITED( status ) && WEXITSTATUS( status ) == 0;
+ }
+
+int main()
+ {
+ // Try to launch arts this way only a single time in the whole session. After first
+ // try set X property on the root window and following attemps bail out if it's set.
+ Display* dpy = XOpenDisplay( NULL );
+ if( dpy == NULL ) // don't launch arts without X
+ return 4;
+ Atom atom = XInternAtom( dpy, "_KDE_ARTS_TRIED", False );
+ int count;
+ Atom* atoms = XListProperties( dpy, DefaultRootWindow( dpy ), &count );
+ bool tried = false;
+ if( atoms != NULL )
+ {
+ for( int i = 0;
+ i < count;
+ ++i )
+ if( atoms[ i ] == atom )
+ {
+ tried = true;
+ break;
+ }
+ }
+ if( tried ) // this should probably wait, but artsshell will result in calling this too
+ return 2;
+ long dummy = 1;
+ XChangeProperty( dpy, DefaultRootWindow( dpy ), atom, atom, 32, PropModeReplace, (const unsigned char*)&dummy, 1 );
+ XCloseDisplay( dpy );
+ KInstance inst( "arts-start" );
+ KConfig config("kcmartsrc", true, false);
+ config.setGroup("Arts");
+ if( !config.readBoolEntry("StartServer",true))
+ return 2;
+ system( "kcminit arts" );
+ for( int i = 0;
+ i < 50; // give it 5 seconds
+ ++i )
+ {
+ if( arts_running())
+ return 0;
+ usleep( 100 * 1000 );
+ }
+ return 3;
+ }

@ -0,0 +1,35 @@
Index: kioslave/fish/fish.protocol
===================================================================
--- kioslave/fish/fish.protocol.orig
+++ kioslave/fish/fish.protocol
@@ -10,7 +10,7 @@ makedir=true
deleting=true
linking=true
moving=true
-Icon=remote
+Icon=folder_html
Description=A kioslave for the FISH protocol
Description[af]='n Kioslave vir die FISH protokol
Description[be]=Kioslave для пратакола FISH
Index: kioslave/floppy/floppy.protocol
===================================================================
--- kioslave/floppy/floppy.protocol.orig
+++ kioslave/floppy/floppy.protocol
@@ -9,6 +9,6 @@ writing=true
makedir=true
deleting=true
moving=true
-Icon=3floppy_mount
+Icon=3floppy_unmount
DocPath=kioslave/floppy.html
Class=:local
Index: kioslave/nfs/nfs.protocol
===================================================================
--- kioslave/nfs/nfs.protocol.orig
+++ kioslave/nfs/nfs.protocol
@@ -11,4 +11,4 @@ deleting=true
linking=true
moving=true
DocPath=kioslave/nfs.html
-Icon=nfs_mount
+Icon=nfs_unmount

@ -0,0 +1,27 @@
Index: kioslave/media/medianotifier/medianotifier.cpp
===================================================================
--- kioslave/media/medianotifier/medianotifier.cpp.orig
+++ kioslave/media/medianotifier/medianotifier.cpp
@@ -133,7 +133,7 @@ bool MediaNotifier::autostart( const KFi
// be checked for the following Autostart files in order of precedence:
// .autorun, autorun, autorun.sh
QStringList autorun_list;
- autorun_list << ".autorun" << "autorun" << "autorun.sh";
+ autorun_list << ".autorun" << "autorun" << "autorun.sh" << "setup.sh" << "media.1/patches";
QStringList::iterator it = autorun_list.begin();
QStringList::iterator end = autorun_list.end();
@@ -191,7 +191,12 @@ bool MediaNotifier::execAutorun( const K
// with the current working directory ( CWD ) set to the root
// directory of the medium.
KProcess proc;
- proc << "sh" << autorunFile;
+ if (autorunFile == "setup.sh")
+ proc << "kdesu" << autorunFile;
+ else if (autorunFile == "media.1/patches")
+ proc << "kdesu" << "--nonewdcop" << "/sbin/yast2" << "online_update" << ".cd_default";
+ else
+ proc << "sh" << autorunFile;
proc.setWorkingDirectory( path );
proc.start();
proc.detach();

@ -0,0 +1,13 @@
Index: kcontrol/background/bgwallpaper.cpp
===================================================================
--- kcontrol/background/bgwallpaper.cpp.orig
+++ kcontrol/background/bgwallpaper.cpp
@@ -149,7 +149,7 @@ void BGMultiWallpaperDialog::slotAdd()
mimeTypes += "image/svg+xml";
#endif
- KFileDialog fileDialog(KGlobal::dirs()->findDirs("wallpaper", "").first(),
+ KFileDialog fileDialog("/usr/share/wallpapers",
mimeTypes.join( " " ), this,
0L, true);

@ -0,0 +1,2 @@
kdebase3
kdebase3-runtime

@ -0,0 +1,21 @@
--- kicker/configure.in.in 2008/01/28 11:03:28 1.1
+++ kicker/configure.in.in 2008/01/28 11:03:45
@@ -42,14 +42,14 @@
AC_SUBST(GLIB_LIBADD)
AC_SUBST(GLIB_LDFLAGS)
-dnl Check for libbeagle 0.2.0
+dnl Check for libbeagle 0.3.0
# LIBBEAGLE_CFLAGS: cflags for compiling libbeagle dependant sources
# LIBBEAGLE_LIBADD: libbeagle libraries (-l options)
# LIBBEAGLE_LDFLAGS: flags containing path to libbeagle libraries (-L options)
-LIBBEAGLE_PACKAGES="libbeagle-0.0"
-LIBBEAGLE_VERSION="0.2.4"
-AC_MSG_CHECKING(for libbeagle-0.2.4 (at least $LIBBEAGLE_VERSION))
+LIBBEAGLE_PACKAGES="libbeagle-1.0"
+LIBBEAGLE_VERSION="0.3.0"
+AC_MSG_CHECKING(for libbeagle-0.3.0 (at least $LIBBEAGLE_VERSION))
if $PKG_CONFIG --atleast-pkgconfig-version 0.15 ; then
if $PKG_CONFIG --atleast-version $LIBBEAGLE_VERSION $LIBBEAGLE_PACKAGES >/dev/null 2>&1 ; then

@ -0,0 +1,8 @@
[Desktop Entry]
Charset=
Hidden=false
Keys=bnc
Name=Novell Bugzilla
Query=https://bugzilla.novell.com/show_bug.cgi?id=\\{@}
ServiceTypes=SearchProvider
Type=Service

@ -0,0 +1,189 @@
--- kdebase-3.5.10/kdm/backend/ctrl.c.sav 2010-03-23 13:22:28.000000000 +0100
+++ kdebase-3.5.10/kdm/backend/ctrl.c 2010-03-23 14:21:48.619350322 +0100
@@ -78,7 +78,25 @@ nukeSock( struct cmdsock *cs )
}
+#ifdef HONORS_SOCKET_PERMS
static CtrlRec ctrl = { 0, 0, -1, 0, 0, { -1, 0, 0 } };
+#else
+static CtrlRec ctrl = { 0, 0, 0, -1, 0, 0, { -1, 0, 0 } };
+
+static int mkTempDir( char *dir )
+{
+ int i, l = strlen( dir ) - 6;
+
+ for (i = 0; i < 100; i++) {
+ randomStr( dir + l );
+ if (!mkdir( dir, 0700 ))
+ return True;
+ if (errno != EEXIST)
+ break;
+ }
+ return False;
+}
+#endif
void
openCtrl( struct display *d )
@@ -140,22 +158,50 @@ openCtrl( struct display *d )
if (strlen( cr->path ) >= sizeof(sa.sun_path))
LogError( "path %\"s too long; no control sockets will be available\n",
cr->path );
- else if (mkdir( sockdir, 0755 ) && errno != EEXIST)
+#ifdef HONORS_SOCKET_PERMS
+ else if (mkdir( sockdir, 0700 ) && errno != EEXIST)
LogError( "mkdir %\"s failed; no control sockets will be available\n",
sockdir );
+ else if (unlink( cr->path ) && errno != ENOENT)
+ LogError( "unlink %\"s failed: %m; control socket will not be available\n",
+ cr->path );
else {
- if (!d)
- chown( sockdir, -1, fifoGroup );
+#else
+ else if (unlink( sockdir ) && errno != ENOENT)
+ LogError( "unlink %\"s failed: %m; control socket will not be available\n",
+ sockdir );
+ else if (!strApp( &cr->realdir, sockdir, "-XXXXXX", (char *)0))
+ ;
+ else if (!mkTempDir( cr->realdir )) {
+ LogError( "mkdir %\"s failed: %m; control socket will not be available\n",
+ cr->realdir );
+ free( cr->realdir );
+ cr->realdir = 0;
+ } else if (symlink( cr->realdir, sockdir )) {
+ LogError( "symlink %\"s => %\"s failed: %m; control socket will not be available\n",
+ sockdir, cr->realdir );
+ rmdir( cr->realdir );
+ free( cr->realdir );
+ cr->realdir = 0;
+ } else {
+ chown( sockdir, 0, d ? 0 : fifoGroup );
chmod( sockdir, 0750 );
+#endif
if ((cr->fd = socket( PF_UNIX, SOCK_STREAM, 0 )) < 0)
LogError( "Cannot create control socket\n" );
else {
- unlink( cr->path );
sa.sun_family = AF_UNIX;
strcpy( sa.sun_path, cr->path );
if (!bind( cr->fd, (struct sockaddr *)&sa, sizeof(sa) )) {
if (!listen( cr->fd, 5 )) {
+#ifdef HONORS_SOCKET_PERMS
+ chmod( cr->path, 0660 );
+ if (!d)
+ chown( cr->path, -1, fifoGroup );
+ chmod( sockdir, 0755 );
+#else
chmod( cr->path, 0666 );
+#endif
RegisterCloseOnFork( cr->fd );
RegisterInput( cr->fd );
free( sockdir );
@@ -170,6 +216,14 @@ openCtrl( struct display *d )
close( cr->fd );
cr->fd = -1;
}
+#ifdef HONORS_SOCKET_PERMS
+ rmdir( sockdir );
+#else
+ unlink( sockdir );
+ rmdir( cr->realdir );
+ free( cr->realdir );
+ cr->realdir = 0;
+#endif
}
free( cr->path );
cr->path = 0;
@@ -190,7 +244,14 @@ closeCtrl( struct display *d )
cr->fd = -1;
unlink( cr->path );
*strrchr( cr->path, '/' ) = 0;
+#ifdef HONORS_SOCKET_PERMS
rmdir( cr->path );
+#else
+ unlink( cr->path );
+ rmdir( cr->realdir );
+ free( cr->realdir );
+ cr->realdir = 0;
+#endif
free( cr->path );
cr->path = 0;
while (cr->css) {
@@ -218,12 +279,12 @@ chownCtrl( CtrlRec *cr, int uid )
{
if (cr->fpath)
chown( cr->fpath, uid, -1 );
- if (cr->path) {
- char *ptr = strrchr( cr->path, '/' );
- *ptr = 0;
+ if (cr->path)
+#ifdef HONORS_SOCKET_PERMS
chown( cr->path, uid, -1 );
- *ptr = '/';
- }
+#else
+ chown( cr->realdir, uid, -1 );
+#endif
}
void
--- kdebase-3.5.10/kdm/backend/dm.h.sav 2010-03-23 13:22:28.401354858 +0100
+++ kdebase-3.5.10/kdm/backend/dm.h 2010-03-23 13:28:24.843351116 +0100
@@ -218,6 +218,9 @@ typedef struct {
struct cmdsock *css; /* open connections */
char *path; /* filename of the socket */
+#ifndef HONORS_SOCKET_PERMS
+ char *realdir; /* real dirname of the socket */
+#endif
int fd; /* fd of the socket */
int gid; /* owner group of the socket */
--- kdebase-3.5.10/config.h.in.sav 2008-08-20 18:00:23.000000000 +0200
+++ kdebase-3.5.10/config.h.in 2010-03-23 13:36:38.913475918 +0100
@@ -739,6 +739,9 @@
/* Defined if your system has XRandR support */
#undef XRANDR_SUPPORT
+/* Define to 1 if OS honors permission bits on socket inodes */
+#undef HONORS_SOCKET_PERMS
+
/*
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
* headers and I'm too lazy to write a configure test as long as only
--- kdebase-3.5.10/configure.in.in.sav 2006-07-22 10:15:55.000000000 +0200
+++ kdebase-3.5.10/configure.in.in 2010-03-23 13:51:24.504477535 +0100
@@ -274,3 +274,31 @@ AC_SUBST(LIBART_RPATH)
AC_ARG_WITH([composite],
AC_HELP_STRING([--without-composite], [Disable Xcomposite support (default: check)]) )
+AC_TRY_RUN([
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+int main()
+{
+ int fd, fd2;
+ struct sockaddr_un sa;
+
+ if ((fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
+ return 2;
+ sa.sun_family = AF_UNIX;
+ strcpy(sa.sun_path, "testsock");
+ unlink(sa.sun_path);
+ if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)))
+ return 2;
+ chmod(sa.sun_path, 0);
+ setuid(getuid() + 1000);
+ if ((fd2 = socket(PF_UNIX, SOCK_STREAM, 0)) < 0)
+ return 2;
+ connect(fd2, (struct sockaddr *)&sa, sizeof(sa));
+ return errno != EACCES;
+}
+], AC_DEFINE_UNQUOTED(HONORS_SOCKET_PERMS, 1, [Define to 1 if OS honors permission bits on socket inodes]))

@ -0,0 +1,22 @@
Index: kicker/applets/clock/clockapplet.kcfg
===================================================================
--- kicker/applets/clock/clockapplet.kcfg.orig
+++ kicker/applets/clock/clockapplet.kcfg
@@ -14,7 +14,7 @@
<choice name="Analog"/>
<choice name="Fuzzy"/>
</choices>
- <default>Digital</default>
+ <default>Plain</default>
</entry>
</group>
<group name="Date">
@@ -56,7 +56,7 @@ defFont.setPointSize(8);
<label>Font for the clock.</label>
<code>
defFont=KGlobalSettings::generalFont();
-defFont.setPointSize(8);
+defFont.setPointSize(16);
defFont.setBold(true);
</code>
<default code="true">defFont</default>

@ -0,0 +1,288 @@
Index: kcontrol/clock/tzone.cpp
===================================================================
--- kcontrol/clock/tzone.cpp.orig
+++ kcontrol/clock/tzone.cpp
@@ -27,12 +27,16 @@
#include <qlabel.h>
#include <qfile.h>
+#include <qregexp.h>
#include <kdebug.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kdialog.h>
#include <kio/netaccess.h>
+#include <kprocess.h>
+#include <ksavefile.h>
+#include <kstandarddirs.h>
//#include "xpm/world.xpm"
#include "tzone.h"
@@ -55,6 +59,8 @@ Tzone::Tzone(QWidget * parent, const cha
connect( tzonelist, SIGNAL(selectionChanged()), SLOT(handleZoneChange()) );
m_local = new QLabel(this);
+
+ setupSuseTimezone();
load();
@@ -158,28 +164,38 @@ void Tzone::save()
QString val = selectedzone;
#else
- QFile fTimezoneFile("/etc/timezone");
+ QString tz = "/usr/share/zoneinfo/" + selectedzone;
- if (fTimezoneFile.open(IO_WriteOnly | IO_Truncate) )
+ kdDebug() << "Set time zone " << tz << endl;
+
+ writeSuseTimezone( selectedzone );
+
+ if( !KStandardDirs::findExe( "zic" ).isEmpty())
{
- QTextStream t(&fTimezoneFile);
- t << selectedzone;
- fTimezoneFile.close();
+ KProcess proc;
+ proc << "zic" << "-l" << selectedzone;
+ proc.start( KProcess::Block );
}
+ else
+ {
+ QFile fTimezoneFile("/etc/timezone");
- QString tz = "/usr/share/zoneinfo/" + selectedzone;
-
- kdDebug() << "Set time zone " << tz << endl;
+ if (fTimezoneFile.open(IO_WriteOnly | IO_Truncate) )
+ {
+ QTextStream t(&fTimezoneFile);
+ t << selectedzone;
+ fTimezoneFile.close();
+ }
- if (!QFile::remove("/etc/localtime"))
- {
+ if (!QFile::remove("/etc/localtime"))
+ {
//After the KDE 3.2 release, need to add an error message
- }
- else
+ }
+ else
if (!KIO::NetAccess::file_copy(KURL(tz),KURL("/etc/localtime")))
KMessageBox::error( 0, i18n("Error setting new timezone."),
i18n("Timezone Error"));
-
+ }
QString val = ":" + tz;
#endif // !USE_SOLARIS
@@ -198,3 +214,58 @@ void Tzone::save()
currentZone();
}
+
+// read the configured timezone from /etc/sysconfig/clock
+// and simply set it as $TZ, KDE code then will take it as the timezone
+void Tzone::setupSuseTimezone()
+{
+ QFile f( "/etc/sysconfig/clock" );
+ if( !f.open( IO_ReadOnly ))
+ return;
+ QTextStream str( &f );
+ while( !str.atEnd())
+ {
+ QString line = str.readLine();
+ if( line.startsWith( "TIMEZONE=" ))
+ {
+ QRegExp r( "\\s*TIMEZONE=\"(.*)\"\\s*" );
+ if( r.exactMatch( line ))
+ {
+ QString tz = r.cap( 1 );
+ setenv( "TZ", tz.ascii(), 1 );
+ }
+ }
+ }
+}
+
+void Tzone::writeSuseTimezone( QString zone )
+{
+ QFile f( "/etc/sysconfig/clock" );
+ if( !f.open( IO_ReadOnly ))
+ return;
+ KSaveFile out( "/etc/sysconfig/clock", 0644 );
+ QFile* fout = out.file();
+ if( fout == NULL )
+ return;
+ QTextStream str( &f );
+ QTextStream strout( fout );
+ while( !str.atEnd())
+ {
+ QString line = str.readLine();
+ if( line.startsWith( "TIMEZONE=" ))
+ {
+ QRegExp r( "\\s*TIMEZONE=\"(.*)\"\\s*" );
+ if( r.exactMatch( line ))
+ {
+ QString tz = r.cap( 1 );
+ if( tz == zone ) // not changed, abort
+ {
+ out.abort();
+ return;
+ }
+ line = "TIMEZONE=\"" + zone + "\"";
+ }
+ }
+ strout << line << '\n';
+ }
+}
Index: kcontrol/clock/tzone.h
===================================================================
--- kcontrol/clock/tzone.h.orig
+++ kcontrol/clock/tzone.h
@@ -47,6 +47,8 @@ protected slots:
private:
void currentZone();
+ void setupSuseTimezone();
+ void writeSuseTimezone( QString timezone );
KTimezones m_zoneDb;
QLabel *m_local;
KTimezoneWidget *tzonelist;
Index: kcontrol/clock/dtime.h
===================================================================
--- kcontrol/clock/dtime.h.orig
+++ kcontrol/clock/dtime.h
@@ -65,6 +65,9 @@ signals:
void timeout();
void set_time();
void changeDate(QDate);
+#if 1
+ void configureTimeServer();
+#endif
private:
void findNTPutility();
@@ -72,7 +75,11 @@ private:
QWidget* privateLayoutWidget;
QCheckBox *setDateTimeAuto;
+#if 1
+ QPushButton *timeServerConfigure;
+#else
QComboBox *timeServerList;
+#endif
KDatePicker *cal;
QComboBox *month;
Index: kcontrol/clock/dtime.cpp
===================================================================
--- kcontrol/clock/dtime.cpp.orig
+++ kcontrol/clock/dtime.cpp
@@ -38,6 +38,7 @@
#include <kmessagebox.h>
#include <kdialog.h>
#include <kconfig.h>
+#include <kstandarddirs.h>
#include "dtime.h"
#include "dtime.moc"
@@ -74,6 +75,18 @@ Dtime::Dtime(QWidget * parent, const cha
connect(setDateTimeAuto, SIGNAL(toggled(bool)), SLOT(configChanged()));
layout1->addWidget( setDateTimeAuto );
+#if 1
+ // simply add a pushbutton that'll invoke the yast module
+ ntpUtility = KStandardDirs::findExe( "rcntp");
+ timeServerConfigure = new QPushButton( i18n( "Configure" ), privateLayoutWidget, "timeServerConfigure" );
+ connect(timeServerConfigure, SIGNAL(clicked()), SLOT(configChanged()));
+ connect(timeServerConfigure, SIGNAL(clicked()), SLOT(configureTimeServer()));
+ connect(setDateTimeAuto, SIGNAL(toggled(bool)), timeServerConfigure, SLOT(setEnabled(bool)));
+ timeServerConfigure->setEnabled(false);
+ layout1->addWidget( timeServerConfigure );
+ if( ntpUtility.isEmpty())
+ privateLayoutWidget->hide();
+#else
timeServerList = new QComboBox( false, privateLayoutWidget, "timeServerList" );
connect(timeServerList, SIGNAL(activated(int)), SLOT(configChanged()));
connect(timeServerList, SIGNAL(textChanged(const QString &)), SLOT(configChanged()));
@@ -82,6 +95,7 @@ Dtime::Dtime(QWidget * parent, const cha
timeServerList->setEditable(true);
layout1->addWidget( timeServerList );
findNTPutility();
+#endif
// Date box
QGroupBox* dateBox = new QGroupBox( this, "dateBox" );
@@ -179,7 +193,11 @@ Dtime::Dtime(QWidget * parent, const cha
hour->setEnabled(false);
minute->setEnabled(false);
second->setEnabled(false);
+#if 1
+ timeServerConfigure->setEnabled(false);
+#else
timeServerList->setEnabled(false);
+#endif
setDateTimeAuto->setEnabled(false);
}
kclock->setEnabled(false);
@@ -241,6 +259,15 @@ void Dtime::configChanged(){
void Dtime::load()
{
KConfig config("kcmclockrc", true, false);
+#if 1
+ if( !ntpUtility.isEmpty())
+ {
+ KProcess proc;
+ proc << ntpUtility << "status";
+ proc.start( KProcess::Block );
+ setDateTimeAuto->setChecked( proc.exitStatus() == 0 );
+ }
+#else
config.setGroup("NTP");
timeServerList->insertStringList(QStringList::split(',', config.readEntry("servers",
i18n("Public Time Server (pool.ntp.org),\
@@ -249,6 +276,7 @@ europe.pool.ntp.org,\
north-america.pool.ntp.org,\
oceania.pool.ntp.org"))));
setDateTimeAuto->setChecked(config.readBoolEntry("enabled", false));
+#endif
// Reset to the current date and time
time = QTime::currentTime();
@@ -264,6 +292,7 @@ oceania.pool.ntp.org"))));
void Dtime::save()
{
KConfig config("kcmclockrc", false, false);
+#if 0
config.setGroup("NTP");
// Save the order, but don't duplicate!
@@ -301,7 +330,9 @@ void Dtime::save()
kdDebug() << "Set date from time server " << timeServer.latin1() << " success!" << endl;
}
}
- else {
+ else
+#endif
+ {
// User time setting
KProcess c_proc;
@@ -356,6 +387,13 @@ void Dtime::timeout()
kclock->setTime( time );
}
+void Dtime::configureTimeServer()
+{
+ KProcess proc;
+ proc << "/sbin/yast2" << "ntp-client";
+ proc.start( KProcess::DontCare );
+}
+
QString Dtime::quickHelp() const
{
return i18n("<h1>Date & Time</h1> This control module can be used to set the system date and"

@ -0,0 +1,13 @@
Index: kdeprint/kdeprintfax/confsystem.cpp
===================================================================
--- kdeprint/kdeprintfax/confsystem.cpp.orig
+++ kdeprint/kdeprintfax/confsystem.cpp
@@ -103,7 +103,7 @@ void ConfSystem::load()
m_commands << conf->readPathEntry("HylaFax", defaultCommand(hylafax_default_cmd));
m_commands << conf->readPathEntry("Mgetty", defaultCommand(mgetty_default_cmd));
m_commands << conf->readPathEntry( "Other", QString::null );
- QString v = conf->readEntry("System", "efax");
+ QString v = conf->readEntry("System", "hylafax");
if (v == "mgetty") m_current = MGETTY_ID;
else if (v == "hylafax") m_current = HYLAFAX_ID;
else if ( v == "other" ) m_current = OTHER_ID;

@ -0,0 +1,25 @@
Index: kcontrol/fonts/fonts.cpp
===================================================================
--- kcontrol/fonts/fonts.cpp.orig
+++ kcontrol/fonts/fonts.cpp
@@ -1,3 +1,4 @@
+
// KDE Display fonts setup tab
//
// Copyright (c) Mark Donohoe 1997
@@ -524,11 +525,11 @@ KFonts::KFonts(QWidget *parent, const ch
// Keep in sync with kdelibs/kdecore/kglobalsettings.cpp
- QFont f0("Sans Serif", 10);
- QFont f1("Monospace", 10);
+ QFont f0("Sans Serif", 12);
+ QFont f1("courier", 12);
QFont f2("Sans Serif", 10);
- QFont f3("Sans Serif", 9, QFont::Bold);
- QFont f4("Sans Serif", 10);
+ QFont f3("Sans Serif", 12, QFont::Bold);
+ QFont f4("Sans Serif", 11);
f0.setPointSize(10);
f1.setPointSize(10);

File diff suppressed because it is too large Load Diff

@ -0,0 +1,66 @@
Index: kcontrol/access/kcmaccess.cpp
===================================================================
--- kcontrol/access/kcmaccess.cpp.orig
+++ kcontrol/access/kcmaccess.cpp
@@ -103,10 +103,57 @@ void ExtendedIntNumInput::slotSliderValu
static bool needToRunKAccessDaemon( KConfig *config )
{
- // We always start the KAccess Daemon, if it is not needed,
- // it will terminate itself after configuring the AccessX
- // features.
- return true;
+ KConfigGroup bell( config, "Bell" );
+
+ if (!bell.readBoolEntry("SystemBell", true))
+ return true;
+ if (bell.readBoolEntry("ArtsBell", false))
+ return true;
+ if (bell.readBoolEntry("VisibleBell", false))
+ return true;
+
+ KConfigGroup keyboard( config, "Keyboard" );
+
+ if (keyboard.readBoolEntry("StickyKeys", false))
+ return true;
+ if (keyboard.readBoolEntry("SlowKeys", false))
+ return true;
+ if (keyboard.readBoolEntry("BounceKeys", false))
+ return true;
+ if (keyboard.readBoolEntry("Gestures", true))
+ return true;
+ // Find out whether the gestures are activated by default in the X configuration or not.
+ int major = XkbMajorVersion;
+ int minor = XkbMinorVersion;
+ if (XkbLibraryVersion(&major, &minor))
+ {
+ int opcode_rtrn;
+ int error_rtrn;
+ int xkb_opcode;
+ if (XkbQueryExtension(qt_xdisplay(), &opcode_rtrn, &xkb_opcode, &error_rtrn,
+ &major, &minor))
+ {
+ if(XkbDescPtr xkbdesc = XkbGetMap(qt_xdisplay(), 0, XkbUseCoreKbd))
+ {
+ if(XkbGetControls(qt_xdisplay(), XkbAllControlsMask/*XkbAccessXKeysMask*/, xkbdesc ) == Success )
+ {
+ if(xkbdesc->ctrls->enabled_ctrls & XkbAccessXKeysMask)
+ {
+ XkbFreeClientMap(xkbdesc,0,True);
+ return true;
+ }
+ }
+ XkbFreeClientMap(xkbdesc,0,True);
+ }
+ }
+ }
+
+ KConfigGroup mouse( config, "Mouse" );
+
+ if (mouse.readBoolEntry("MouseKeys", false))
+ return true;
+
+ return false; // don't need it
}
QString mouseKeysShortcut (Display *display) {

@ -0,0 +1,250 @@
Index: kcontrol/componentchooser/componentchooser.desktop
===================================================================
--- kcontrol/componentchooser/componentchooser.desktop.orig
+++ kcontrol/componentchooser/componentchooser.desktop
@@ -1,6 +1,6 @@
[Desktop Entry]
Exec=kcmshell componentchooser
-Icon=misc
+Icon=kcmcomponentchooser
Type=Application
Index: kcontrol/taskbar/kcmtaskbar.desktop
===================================================================
--- kcontrol/taskbar/kcmtaskbar.desktop.orig
+++ kcontrol/taskbar/kcmtaskbar.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Icon=kmenu
+Icon=kcmtaskbar
Type=Application
DocPath=kcontrol/kcmtaskbar/index.html
Exec=kcmshell kcmtaskbar
Index: kcontrol/nics/nic.desktop
===================================================================
--- kcontrol/nics/nic.desktop.orig
+++ kcontrol/nics/nic.desktop
@@ -2,7 +2,7 @@
Exec=kcmshell nic
Type=Application
DocPath=kinfocenter/nics/index.html
-Icon=network
+Icon=kcmnic
X-KDE-Library=nic
Index: kcontrol/input/mouse.desktop
===================================================================
--- kcontrol/input/mouse.desktop.orig
+++ kcontrol/input/mouse.desktop
@@ -1,6 +1,6 @@
[Desktop Entry]
Exec=kcmshell mouse
-Icon=mouse
+Icon=kcmmouse
Type=Application
DocPath=kcontrol/mouse/index.html
Index: kcontrol/smserver/kcmsmserver.desktop
===================================================================
--- kcontrol/smserver/kcmsmserver.desktop.orig
+++ kcontrol/smserver/kcmsmserver.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Icon=exit
+Icon=kcmsmserver
Type=Application
DocPath=kcontrol/kcmsmserver/index.html
Exec=kcmshell kcmsmserver
Index: kcontrol/kded/kcmkded.desktop
===================================================================
--- kcontrol/kded/kcmkded.desktop.orig
+++ kcontrol/kded/kcmkded.desktop
@@ -1,6 +1,6 @@
[Desktop Entry]
Exec=kcmshell kcmkded
-Icon=services
+Icon=kcmkded
Type=Application
Index: kcontrol/konq/desktop.desktop
===================================================================
--- kcontrol/konq/desktop.desktop.orig
+++ kcontrol/konq/desktop.desktop
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
DocPath=kcontrol/desktop/index.html#desktop-number
-Icon=desktop
+Icon=kcmdesktop
Exec=kcmshell desktop
Index: kcontrol/konq/desktopbehavior.desktop
===================================================================
--- kcontrol/konq/desktopbehavior.desktop.orig
+++ kcontrol/konq/desktopbehavior.desktop
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
DocPath=kcontrol/desktopbehavior/index.html
-Icon=desktop
+Icon=kcmdesktopbehavior
Exec=kcmshell desktopbehavior
Index: kcontrol/privacy/privacy.desktop
===================================================================
--- kcontrol/privacy/privacy.desktop.orig
+++ kcontrol/privacy/privacy.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Icon=trashcan_empty
+Icon=kcmprivacy
Comment=Privacy - a kcontrol module to clean unwanted traces the user leaves on the system
Comment[af]=Privaatheid - 'n Beheer module wat voetspore wat deur gebruikers op die stelsel gelaat word skoon maak
Comment[ar]=الخصوصية - وحدة kcontrol لتنظيÙ<C5A0> الآثار غير المرغوب بها التي يتركها المستخدم على النظام
Index: kcontrol/crypto/crypto.desktop
===================================================================
--- kcontrol/crypto/crypto.desktop.orig
+++ kcontrol/crypto/crypto.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Icon=encrypted
+Icon=kcmcrypto
Type=Application
Exec=kcmshell crypto
DocPath=kcontrol/crypto/index.html
Index: kcontrol/kio/netpref.desktop
===================================================================
--- kcontrol/kio/netpref.desktop.orig
+++ kcontrol/kio/netpref.desktop
@@ -76,7 +76,7 @@ Comment[zh_CN]=é…<C3A9>置通用ç½ç»œé¦é€‰é
Comment[zh_TW]=設定一般網路喜好設定,例如逾時值
Comment[zu]=Hlanganisela okuncanyelwa uwonkewonke koxhumano olusazekile, njengamanani esikhathi sokuphuma
Exec=kcmshell netpref
-Icon=network
+Icon=kcmnetpref
Keywords=timeout,iopref,netpref,network preferences,ftp
Keywords[be]=ТÑ<C2A2>рмÑн чаканнÑ<C2BD>,УлаÑ<C2B0>цÑваÑ<C2B0>Ñ†Ñ Ñ<>еÑкÑ,timeout,iopref,netpref,network preferences,ftp
Keywords[bg]=проÑ<C2BE>рочка, време, времето, пауза, прекъÑ<C5A0>ване, връзка, timeout, iopref, netpref, network preferences, ftp
Index: kcontrol/konqhtml/khtml_filter.desktop
===================================================================
--- kcontrol/konqhtml/khtml_filter.desktop.orig
+++ kcontrol/konqhtml/khtml_filter.desktop
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
DocPath=kcontrol/khtml/index.html#khtml-adblock
-Icon=filter
+Icon=kcmkhtml_filter
Exec=kcmshell khtml_filter
X-KDE-Library=konqhtml
Index: kcontrol/joystick/joystick.desktop
===================================================================
--- kcontrol/joystick/joystick.desktop.orig
+++ kcontrol/joystick/joystick.desktop
@@ -173,5 +173,5 @@ Type=Application
X-KDE-FactoryName=kcm_joystick
X-KDE-Library=joystick
X-KDE-Test-Module=true
-Icon=joystick
+Icon=kcmjoystick
Categories=Qt;KDE;X-KDE-settings-hardware;
Index: kcontrol/colors/colors.desktop
===================================================================
--- kcontrol/colors/colors.desktop.orig
+++ kcontrol/colors/colors.desktop
@@ -1,6 +1,6 @@
[Desktop Entry]
Exec=kcmshell colors
-Icon=colorscm
+Icon=kcmcolors
Type=Application
DocPath=kcontrol/colors/index.html
Index: kcontrol/performance/kcmperformance.desktop
===================================================================
--- kcontrol/performance/kcmperformance.desktop.orig
+++ kcontrol/performance/kcmperformance.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Icon=launch
+Icon=kcmperformance
Type=Application
Exec=kcmshell kcmperformance
Index: kcontrol/launch/kcmlaunch.desktop
===================================================================
--- kcontrol/launch/kcmlaunch.desktop.orig
+++ kcontrol/launch/kcmlaunch.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Icon=launch
+Icon=kcmlaunch
Type=Application
DocPath=kcontrol/kcmlaunch/index.html
Exec=kcmshell kcmlaunch
Index: kcontrol/dnssd/kcm_kdnssd.desktop
===================================================================
--- kcontrol/dnssd/kcm_kdnssd.desktop.orig
+++ kcontrol/dnssd/kcm_kdnssd.desktop
@@ -70,7 +70,7 @@ Comment[zh_TW]=設定æœ<C3A6>å™å<E284A2>µæ¸¬
Exec=kcmshell kcm_kdnssd
GenericName=
GenericName[ko]=ì<>¼ë°˜
-Icon=blockdevice
+Icon=kcmkdnssd
MimeType=
Name=Service Discovery
Name[af]=Dienste ontdekker
Index: kcontrol/spellchecking/spellchecking.desktop
===================================================================
--- kcontrol/spellchecking/spellchecking.desktop.orig
+++ kcontrol/spellchecking/spellchecking.desktop
@@ -1,6 +1,6 @@
[Desktop Entry]
Exec=kcmshell spellchecking
-Icon=spellcheck
+Icon=kcmspellchecking
Type=Application
DocPath=kcontrol/spellchecking/index.html
Index: konqueror/sidebar/trees/history_module/kcmhistory.desktop
===================================================================
--- konqueror/sidebar/trees/history_module/kcmhistory.desktop.orig
+++ konqueror/sidebar/trees/history_module/kcmhistory.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Icon=history
+Icon=kcmhistory
Type=Application
Exec=kcmshell kcmhistory
Index: kioslave/cgi/kcmcgi/kcmcgi.desktop
===================================================================
--- kioslave/cgi/kcmcgi/kcmcgi.desktop.orig
+++ kioslave/cgi/kcmcgi/kcmcgi.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Icon=run
+Icon=kcmcgi
Type=Application
Exec=kcmshell kcmcgi
DocPath=
Index: kioslave/media/kcmodule/media.desktop
===================================================================
--- kioslave/media/kcmodule/media.desktop.orig
+++ kioslave/media/kcmodule/media.desktop
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Application
#DocPath=
-Icon=system
+Icon=kcmmedia
Exec=kcmshell media

@ -0,0 +1,63 @@
Index: kcontrol/kcontrol/modules.cpp
===================================================================
--- kcontrol/kcontrol/modules.cpp.orig
+++ kcontrol/kcontrol/modules.cpp
@@ -19,6 +19,7 @@
#include <unistd.h>
#include <sys/types.h>
+#include <stdlib.h>
#include <qlabel.h>
@@ -59,6 +60,10 @@ ConfigModule::~ConfigModule()
ProxyWidget *ConfigModule::module()
{
+ KDesktopFile kd(service()->desktopEntryPath());
+ if ( !kd.readEntry("X-SuSE-YaST-Call").isEmpty() )
+ setenv("KCMYAST2_CALL", kd.readEntry("X-SuSE-YaST-Call").latin1(), 1 );
+
if (_module)
return _module;
@@ -168,6 +173,7 @@ void ConfigModule::runAsRoot()
// prepare the process to run the kcmshell
QString cmd = service()->exec().stripWhiteSpace();
bool kdeshell = false;
+ bool proxy = false;
if (cmd.left(5) == "kdesu")
{
cmd = cmd.remove(0,5).stripWhiteSpace();
@@ -185,6 +191,15 @@ void ConfigModule::runAsRoot()
kdeshell = true;
}
+ KDesktopFile kd(service()->desktopEntryPath());
+ if ( !kd.readEntry("X-SuSE-YaST-Call").isEmpty() ){
+ kdeshell = true;
+ proxy = true;
+ cmd=service()->desktopEntryPath();
+
+ setenv("KCMYAST2_CALL", kd.readEntry("X-SuSE-YaST-Call").latin1(), 1 );
+ }
+
// run the process
QString kdesu = KStandardDirs::findExe("kdesu");
if (!kdesu.isEmpty())
@@ -196,12 +211,12 @@ void ConfigModule::runAsRoot()
// in that case the modules is started through kdesud and kdesu
// returns before the module is running and that doesn't work.
// We also don't have a way to close the module in that case.
- *_rootProcess << "--n"; // Don't keep password.
+ *_rootProcess << "--n" << "-t"; // Don't keep password.
if (kdeshell) {
- *_rootProcess << QString("%1 %2 --embed %3 --lang %4").arg(locate("exe", "kcmshell")).arg(cmd).arg(_embedWidget->winId()).arg(KGlobal::locale()->language());
+ *_rootProcess << QString("%1 %2 %3 %4 --lang %5").arg(locate("exe", "kcmshell")).arg(cmd).arg(proxy?"--embed-proxy":"--embed").arg(_embedWidget->winId()).arg(KGlobal::locale()->language());
}
else {
- *_rootProcess << QString("%1 --embed %2 --lang %3").arg(cmd).arg(_embedWidget->winId()).arg( KGlobal::locale()->language() );
+ *_rootProcess << QString("%1 %2 %3 --lang %4").arg(cmd).arg(proxy?"--embed-proxy":"--embed").arg(_embedWidget->winId()).arg( KGlobal::locale()->language() );
}
connect(_rootProcess, SIGNAL(processExited(KProcess*)), this, SLOT(rootExited(KProcess*)));

@ -0,0 +1,13 @@
? kioslave/smb/kio_smb_la_all_cpp.cpp
Index: kioslave/smb/kio_smb_auth.cpp
===================================================================
--- kioslave/smb/kio_smb_auth.cpp.orig
+++ kioslave/smb/kio_smb_auth.cpp
@@ -144,6 +144,7 @@ bool SMBSlave::checkPassword(SMBUrl &url
if ( openPassDlg(info) ) {
kdDebug(KIO_SMB) << "openPassDlg returned " << info.username << endl;
url.setUser(info.username);
+ url.setPass(info.password);
return true;
}
kdDebug(KIO_SMB) << "no value from openPassDlg\n";

@ -0,0 +1,20 @@
Index: khelpcenter/navigator.cpp
===================================================================
--- khelpcenter/navigator.cpp.orig
+++ khelpcenter/navigator.cpp
@@ -333,9 +333,14 @@ void Navigator::selectItem( const KURL &
// First, populate the NavigatorAppItems if we don't want the home page
if ( url != homeURL() ) {
for ( QListViewItem *item = mContentsTree->firstChild(); item;
- item = item->nextSibling() ) {
+ item = item->nextSibling() ) {
NavigatorAppItem *appItem = dynamic_cast<NavigatorAppItem *>( item );
if ( appItem ) appItem->populate( true /* recursive */ );
+ for ( QListViewItem *subitem = item->firstChild(); subitem;
+ subitem = subitem->nextSibling() ) {
+ appItem = dynamic_cast<NavigatorAppItem *>( subitem );
+ if ( appItem ) appItem->populate( true /* recursive */ );
+ }
}
}

@ -0,0 +1,59 @@
Index: kcontrol/kthememanager/ktheme.cpp
===================================================================
--- kcontrol/kthememanager/ktheme.cpp.orig
+++ kcontrol/kthememanager/ktheme.cpp
@@ -188,11 +188,11 @@ QString KTheme::createYourself( bool pac
globalConf->setGroup( "Icons" );
QDomElement iconElem = m_dom.createElement( "icons" );
iconElem.setAttribute( "name", globalConf->readEntry( "Theme",KIconTheme::current() ) );
- createIconElems( "DesktopIcons", "desktop", iconElem, globalConf );
- createIconElems( "MainToolbarIcons", "mainToolbar", iconElem, globalConf );
- createIconElems( "PanelIcons", "panel", iconElem, globalConf );
- createIconElems( "SmallIcons", "small", iconElem, globalConf );
- createIconElems( "ToolbarIcons", "toolbar", iconElem, globalConf );
+ createIconElems( "DesktopIcons", "desktop", 32, iconElem, globalConf );
+ createIconElems( "MainToolbarIcons", "mainToolbar", 22, iconElem, globalConf );
+ createIconElems( "PanelIcons", "panel", 32, iconElem, globalConf );
+ createIconElems( "SmallIcons", "small", 16, iconElem, globalConf );
+ createIconElems( "ToolbarIcons", "toolbar", 22, iconElem, globalConf );
m_root.appendChild( iconElem );
// 4. Sounds
@@ -726,7 +726,7 @@ QString KTheme::getProperty( QDomElement
}
void KTheme::createIconElems( const QString & group, const QString & object,
- QDomElement parent, KConfig * cfg )
+ int defsize, QDomElement parent, KConfig * cfg )
{
cfg->setGroup( group );
QStringList elemNames;
@@ -745,7 +745,9 @@ void KTheme::createIconElems( const QStr
QDomElement tmpCol = m_dom.createElement( *it );
tmpCol.setAttribute( "object", object );
- if ( (*it).contains( "Value" ) || *it == "Size" )
+ if ( *it == "Size" )
+ tmpCol.setAttribute( "value", cfg->readNumEntry( *it, defsize ) );
+ else if ( (*it).contains( "Value" ))
tmpCol.setAttribute( "value", cfg->readNumEntry( *it, 1 ) );
else if ( (*it).contains( "DisabledEffect" ) )
tmpCol.setAttribute( "name", cfg->readEntry( *it, "togray" ) );
Index: kcontrol/kthememanager/ktheme.h
===================================================================
--- kcontrol/kthememanager/ktheme.h.orig
+++ kcontrol/kthememanager/ktheme.h
@@ -155,11 +155,12 @@ private:
* Creates a list of "icon" elements based on:
* @param group The group in the KConfig object @p cfg
* @param object Specifier (similiar, but not identical to @p group)
+ * @param defsize default icon size
* @param parent Parent element to append to
* @param cfg The KConfig object to work with
*/
void createIconElems( const QString & group, const QString & object,
- QDomElement parent, KConfig * cfg );
+ int defsize, QDomElement parent, KConfig * cfg );
/**
* Creates a color DOM element @p name, with a specifier @p object,

@ -0,0 +1,20 @@
--- kcontrol/kfontinst/kfontinst/Fontmap.cpp.sav 2006-01-19 18:00:49.000000000 +0100
+++ kcontrol/kfontinst/kfontinst/Fontmap.cpp 2009-05-29 14:50:08.000000000 +0200
@@ -44,7 +44,7 @@
using namespace std;
-static char * findSpace(char *str)
+static const char * findSpace(const char *str)
{
while(str && *str!=' ' && *str!='\t')
str++;
@@ -65,7 +65,7 @@ static bool parseLine(const char *line,
char a[constMaxLen+1],
b[constFileMaxLen+1];
- char *slash1=strchr(line, '/'),
+ const char *slash1=strchr(line, '/'),
*space1=slash1 ? findSpace(slash1) : NULL, //strchr(slash1, ' ') : NULL,
*ob=slash1 ? strchr(slash1, '(') : NULL,
*cb=ob ? strchr(ob, ')') : NULL,

@ -0,0 +1,14 @@
Index: konqueror/konq_mainwindow.cc
===================================================================
--- konqueror/konq_mainwindow.cc.orig
+++ konqueror/konq_mainwindow.cc
@@ -4926,6 +4926,9 @@ void KonqMainWindow::updateOpenWithActio
KTrader::OfferList::ConstIterator end = services.end();
for (; it != end; ++it )
{
+ if ( (*it)->noDisplay() )
+ continue;
+
KAction *action = new KAction( i18n( "Open with %1" ).arg( (*it)->name() ), 0, 0, (*it)->desktopEntryName().latin1() );
action->setIcon( (*it)->icon() );

@ -0,0 +1,32 @@
Index: kicker/libkicker/global.cpp
===================================================================
--- kicker/libkicker/global.cpp.orig
+++ kicker/libkicker/global.cpp
@@ -425,6 +425,12 @@ QIconSet menuIconSet(const QString& icon
KIcon::ActiveState,
0,
true);
+ QPixmap disabled = KGlobal::iconLoader()->loadIcon(icon,
+ KIcon::Small,
+ 0,
+ KIcon::DisabledState,
+ 0,
+ true);
// make sure they are not larger than 20x20
if (normal.width() > 20 || normal.height() > 20)
@@ -437,8 +443,14 @@ QIconSet menuIconSet(const QString& icon
active.convertFromImage(active.convertToImage().smoothScale(20,20));
}
+ if (disabled.width() > 20 || disabled.height() > 20)
+ {
+ disabled.convertFromImage(disabled.convertToImage().smoothScale(20,20));
+ }
+
iconset.setPixmap(normal, QIconSet::Small, QIconSet::Normal);
iconset.setPixmap(active, QIconSet::Small, QIconSet::Active);
+ iconset.setPixmap(disabled, QIconSet::Small, QIconSet::Disabled);
}
}

@ -0,0 +1,13 @@
Index: kcontrol/ioslaveinfo/ioslaveinfo.desktop
===================================================================
--- kcontrol/ioslaveinfo/ioslaveinfo.desktop.orig
+++ kcontrol/ioslaveinfo/ioslaveinfo.desktop
@@ -79,7 +79,7 @@ Comment[zh_TW]=可用協定的資訊
Comment[zu]=Ulwazi mayelana nemithetho elandelwayo ekhona
DocPath=kinfocenter/protocols/index.html
Exec=kcmshell ioslaveinfo
-Icon=history
+Icon=enhanced_browsing
Keywords=Protocol,IO slaves,Slaves,Network,Information,Timeout
Keywords[ar]=الميفاق,IO Slaves,Slaves,الشبكة,معلومات نفاذ الوقت
Keywords[az]=Protokol, IO Kölələri, Kölələr, Şəbəkə,Mə'lumat, Vaxt Dolması

@ -0,0 +1,6 @@
#%PAM-1.0
auth include common-auth
account include common-account
password include common-password
session include common-session
session required pam_resmgr.so

@ -0,0 +1,5 @@
#%PAM-1.0
auth include common-auth
account include common-account
password include common-password
session include common-session

@ -0,0 +1,7 @@
#%PAM-1.0
auth include common-auth
account include common-account
password include common-password
session include common-session
session required pam_devperm.so
session required pam_resmgr.so

Binary file not shown.

@ -0,0 +1,14 @@
Index: kcminit/main.cpp
===================================================================
--- kcminit/main.cpp.orig
+++ kcminit/main.cpp
@@ -98,6 +98,9 @@ void KCMInit::runModules( int phase )
if (library.isEmpty())
library = service->library();
+ if (library == "arts" && list.size() > 1)
+ continue;
+
if (library.isEmpty() || service->init().isEmpty())
continue; // Skip

@ -0,0 +1,13 @@
Index: kcontrol/kdm/kdm-shut.cpp
===================================================================
--- kcontrol/kdm/kdm-shut.cpp.orig
+++ kcontrol/kdm/kdm-shut.cpp
@@ -90,7 +90,7 @@ KDMSessionsWidget::KDMSessionsWidget(QWi
QGroupBox *group4 = new QGroupBox( i18n("Miscellaneous"), this );
bm_combo = new KBackedComboBox( group4 );
- bm_combo->insertItem("None", i18n("boot manager", "None"));
+ bm_combo->insertItem("None", i18n("boot manager", "Grub"));
bm_combo->insertItem("Grub", i18n("Grub"));
#if defined(__linux__) && ( defined(__i386__) || defined(__amd64__) )
bm_combo->insertItem("Lilo", i18n("Lilo"));

@ -0,0 +1,31 @@
Index: kcontrol/samba/kcmsambalog.cpp
===================================================================
--- kcontrol/samba/kcmsambalog.cpp.orig
+++ kcontrol/samba/kcmsambalog.cpp
@@ -39,7 +39,7 @@ LogView::LogView(QWidget *parent,KConfig
,configFile(config)
,filesCount(0)
,connectionsCount(0)
-,logFileName("/var/log/samba.log",this)
+,logFileName("/var/log/samba/log.smbd",this)
,label(&logFileName,i18n("Samba log file: "),this)
,viewHistory(this)
,showConnOpen(i18n("Show opened connections"),this)
@@ -88,7 +88,7 @@ LogView::LogView(QWidget *parent,KConfig
" on this page. The log file (shown above) will be read to obtain the"
" events logged by samba.") );
- logFileName.setURL("/var/log/samba.log");
+ logFileName.setURL("/var/log/samba/log.smbd");
viewHistory.setAllColumnsShowFocus(TRUE);
viewHistory.setFocusPolicy(QWidget::ClickFocus);
@@ -130,7 +130,7 @@ void LogView::loadSettings()
{
if (configFile==0) return;
configFile->setGroup(LOGGROUPNAME);
- logFileName.setURL(configFile->readPathEntry( "SambaLogFile", "/var/log/samba.log"));
+ logFileName.setURL(configFile->readPathEntry( "SambaLogFile", "/var/log/samba/log.smbd"));
showConnOpen.setChecked(configFile->readBoolEntry( "ShowConnectionOpen", TRUE));
showConnClose.setChecked(configFile->readBoolEntry( "ShowConnectionClose", FALSE));

@ -0,0 +1,11 @@
Index: kcontrol/info/sound.desktop
===================================================================
--- kcontrol/info/sound.desktop.orig
+++ kcontrol/info/sound.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Exec=kcmshell sound
+Exec=kcmshell kde-sound
Icon=kcmsound
Type=Application
DocPath=kinfocenter/sound/index.html

@ -0,0 +1,167 @@
Index: kcontrol/energy/energy.h
===================================================================
--- kcontrol/energy/energy.h.orig
+++ kcontrol/energy/energy.h
@@ -44,6 +44,7 @@ private slots:
void slotChangeStandby(int);
void slotChangeSuspend(int);
void slotChangeOff(int);
+ void slotLaunchKPowersave();
void openURL(const QString &);
private:
@@ -54,7 +55,7 @@ private:
static void applySettings(bool, int, int, int);
friend void init_energy();
- bool m_bChanged, m_bDPMS, m_bEnabled, m_bMaintainSanity;
+ bool m_bChanged, m_bDPMS, m_bKPowersave, m_bEnabled, m_bMaintainSanity;
int m_Standby, m_Suspend, m_Off;
int m_StandbyDesired, m_SuspendDesired, m_OffDesired;
Index: kcontrol/energy/energy.cpp
===================================================================
--- kcontrol/energy/energy.cpp.orig
+++ kcontrol/energy/energy.cpp
@@ -26,6 +26,7 @@
#include <qlabel.h>
#include <qlayout.h>
#include <qwhatsthis.h>
+#include <qpushbutton.h>
#include <kconfig.h>
#include <kcursor.h>
@@ -36,6 +37,7 @@
#include <krun.h>
#include <kstandarddirs.h>
#include <kurllabel.h>
+#include <dcopref.h>
#include <X11/X.h>
#include <X11/Xlib.h>
@@ -140,6 +142,7 @@ KEnergy::KEnergy(QWidget *parent, const
m_Suspend = DFLT_SUSPEND;
m_Off = DFLT_OFF;
m_bDPMS = false;
+ m_bKPowersave = false;
m_bMaintainSanity = true;
setQuickHelp( i18n("<h1>Display Power Control</h1> If your display supports"
@@ -154,6 +157,13 @@ KEnergy::KEnergy(QWidget *parent, const
#ifdef HAVE_DPMS
int dummy;
m_bDPMS = DPMSQueryExtension(qt_xdisplay(), &dummy, &dummy);
+
+ DCOPRef kpowersave("kpowersave", "KPowersaveIface");
+ DCOPReply managingDPMS = kpowersave.call("currentSchemeManagesDPMS()");
+ if (managingDPMS.isValid()) {
+ m_bKPowersave = managingDPMS;
+ m_bDPMS = !m_bKPowersave;
+ }
#endif
QVBoxLayout *top = new QVBoxLayout(this, 0, KDialog::spacingHint());
@@ -162,14 +172,26 @@ KEnergy::KEnergy(QWidget *parent, const
QLabel *lbl;
if (m_bDPMS) {
- m_pCBEnable= new QCheckBox(i18n("&Enable display power management" ), this);
- connect(m_pCBEnable, SIGNAL(toggled(bool)), SLOT(slotChangeEnable(bool)));
- hbox->addWidget(m_pCBEnable);
+ KGlobal::locale()->insertCatalogue("kpowersave");
+
+ // ### these i18n strings need to be synced with kpowersave !!
+ m_pCBEnable= new QCheckBox(i18n("&Enable display power management" ), this);
+ connect(m_pCBEnable, SIGNAL(toggled(bool)), SLOT(slotChangeEnable(bool)));
+ hbox->addWidget(m_pCBEnable);
QWhatsThis::add( m_pCBEnable, i18n("Check this option to enable the"
- " power saving features of your display.") );
- } else {
+ " power saving features of your display.") );
+
+ // ###
+ } else if(m_bKPowersave) {
+ m_pCBEnable = new QCheckBox(i18n("&Enable specific display power management"), this);
+ hbox->addWidget(m_pCBEnable);
+ m_bEnabled = false;
+ m_pCBEnable->setChecked(true);
+ m_pCBEnable->setEnabled(false);
+
+ } else {
lbl = new QLabel(i18n("Your display does not support power saving."), this);
- hbox->addWidget(lbl);
+ hbox->addWidget(lbl);
}
KURLLabel *logo = new KURLLabel(this);
@@ -183,6 +205,7 @@ connect(logo, SIGNAL(leftClickedURL(cons
hbox->addWidget(logo);
// Sliders
+ if (!m_bKPowersave) {
m_pStandbySlider = new KIntNumInput(m_Standby, this);
m_pStandbySlider->setLabel(i18n("&Standby after:"));
m_pStandbySlider->setRange(0, 120, 10);
@@ -218,6 +241,17 @@ connect(logo, SIGNAL(leftClickedURL(cons
" greatest level of power saving that can be achieved while the"
" display is still physically turned on.") );
+ }
+ else {
+ m_pStandbySlider = 0;
+ m_pSuspendSlider = 0;
+ m_pOffSlider = 0;
+ QPushButton* btnKPowersave = new QPushButton(this);
+ btnKPowersave->setText(i18n("Configure KPowersave..."));
+ connect(btnKPowersave, SIGNAL(clicked()), SLOT(slotLaunchKPowersave()));
+ top->addWidget(btnKPowersave);
+ }
+
top->addStretch();
if (m_bDPMS)
@@ -270,7 +304,8 @@ void KEnergy::defaults()
void KEnergy::readSettings()
{
- m_bEnabled = m_pConfig->readBoolEntry("displayEnergySaving", false);
+ if (m_bDPMS)
+ m_bEnabled = m_pConfig->readBoolEntry("displayEnergySaving", false);
m_Standby = m_pConfig->readNumEntry("displayStandby", DFLT_STANDBY);
m_Suspend = m_pConfig->readNumEntry("displaySuspend", DFLT_SUSPEND);
m_Off = m_pConfig->readNumEntry("displayPowerOff", DFLT_OFF);
@@ -297,20 +332,27 @@ void KEnergy::writeSettings()
m_bChanged = false;
}
+void KEnergy::slotLaunchKPowersave()
+{
+ DCOPRef r("kpowersave", "KPowersaveIface");
+ r.send("openConfigureDialog()");
+}
void KEnergy::showSettings()
{
m_bMaintainSanity = false;
if (m_bDPMS)
- m_pCBEnable->setChecked(m_bEnabled);
+ m_pCBEnable->setChecked(m_bEnabled);
- m_pStandbySlider->setEnabled(m_bEnabled);
- m_pStandbySlider->setValue(m_Standby);
- m_pSuspendSlider->setEnabled(m_bEnabled);
- m_pSuspendSlider->setValue(m_Suspend);
- m_pOffSlider->setEnabled(m_bEnabled);
- m_pOffSlider->setValue(m_Off);
+ if (!m_bKPowersave) {
+ m_pStandbySlider->setEnabled(m_bEnabled);
+ m_pStandbySlider->setValue(m_Standby);
+ m_pSuspendSlider->setEnabled(m_bEnabled);
+ m_pSuspendSlider->setValue(m_Suspend);
+ m_pOffSlider->setEnabled(m_bEnabled);
+ m_pOffSlider->setValue(m_Off);
+ }
m_bMaintainSanity = true;
}

@ -0,0 +1,11 @@
Index: kcontrol/kcontrol/KControl.desktop
===================================================================
--- kcontrol/kcontrol/KControl.desktop.orig
+++ kcontrol/kcontrol/KControl.desktop
@@ -1,4 +1,6 @@
[Desktop Entry]
+Categories=Qt;KDE;X-SuSE-core
+OnlyShowIn=KDE;
Exec=kcontrol -caption "%c" %i %m
Icon=kcontrol
Type=Application

@ -0,0 +1,12 @@
Index: kde3
===================================================================
--- kde3.orig
+++ kde3
@@ -6,4 +6,7 @@
# and make sure this script is in $PATH (e.g. make a symlink if necessary).
#
+PATH=/opt/kde3/bin:${PATH/:\/opt\/kde3\/bin}
+export PATH
+
exec "$@"

@ -0,0 +1,13 @@
Index: kdm/kfrontend/sessions/kde.desktop.in
===================================================================
--- kdm/kfrontend/sessions/kde.desktop.in.orig
+++ kdm/kfrontend/sessions/kde.desktop.in
@@ -3,7 +3,7 @@ Encoding=UTF-8
Type=XSession
Exec=@KDE_BINDIR@/startkde
TryExec=@KDE_BINDIR@/startkde
-Name=KDE
+Name=KDE3
Name[hi]=केडीई
Name[mn]=КДЭ
Name[ta]=Kஏற்றக் காவலன்

@ -0,0 +1,606 @@
Index: khelpcenter/khelpcenterui.rc
===================================================================
--- khelpcenter/khelpcenterui.rc.orig
+++ khelpcenter/khelpcenterui.rc
@@ -1,5 +1,5 @@
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
-<kpartgui name="khelpcenter" version="14">
+<kpartgui name="khelpcenter" version="15">
<MenuBar>
<Menu name="file" noMerge="1">
<text>&amp;File</text>
@@ -23,8 +23,8 @@
</Menu>
<Menu name="go_web">
<text>&amp;Go</text>
- <Action name="prevPage" />
- <Action name="nextPage" />
+ <Action name="rellinks_previous" />
+ <Action name="rellinks_next" />
<Separator />
<Action name="back" />
<Action name="forward" />
@@ -41,13 +41,19 @@
<Action name="go_home" />
<Action name="back" />
<Action name="forward" />
- <Separator />
+ <Separator />
<Action name="printFrame" />
<Separator />
<Action name="copy_text" />
<Action name="find" />
- <Separator />
<Action name="incFontSizes" />
<Action name="decFontSizes" />
+ <Separator />
+ <Action name="rellinks_top" />
+ <Action name="rellinks_up" />
+ <Action name="rellinks_first" />
+ <Action name="rellinks_previous" />
+ <Action name="rellinks_next" />
+ <Action name="rellinks_last" />
</ToolBar>
</kpartgui>
Index: khelpcenter/mainwindow.cpp
===================================================================
--- khelpcenter/mainwindow.cpp.orig
+++ khelpcenter/mainwindow.cpp
@@ -41,6 +41,7 @@
#include <kstatusbar.h>
#include <kstdaccel.h>
#include <kdialogbase.h>
+#include <kpopupmenu.h>
#include <qsplitter.h>
#include <qtextedit.h>
@@ -106,6 +107,8 @@ MainWindow::MainWindow()
connect( mDoc, SIGNAL( selectionChanged() ),
SLOT( enableCopyTextAction() ) );
+ connect( mDoc, SIGNAL( completed() ),
+ SLOT( updateLinkActions() ) );
statusBar()->insertItem(i18n("Preparing Index"), 0, 1);
statusBar()->setItemAlignment(0, AlignLeft | AlignVCenter);
@@ -250,6 +253,8 @@ void MainWindow::setupActions()
new KAction( i18n( "Configure Fonts..." ), KShortcut(), this, SLOT( slotConfigureFonts() ), actionCollection(), "configure_fonts" );
new KAction( i18n( "Increase Font Sizes" ), "viewmag+", KShortcut(), this, SLOT( slotIncFontSizes() ), actionCollection(), "incFontSizes" );
new KAction( i18n( "Decrease Font Sizes" ), "viewmag-", KShortcut(), this, SLOT( slotDecFontSizes() ), actionCollection(), "decFontSizes" );
+
+ initActions();
}
void MainWindow::slotCopySelectedText()
@@ -462,6 +467,418 @@ void MainWindow::slotConfigureFonts()
mDoc->slotReload();
}
+void MainWindow::initActions()
+{
+ kdDebug() << k_funcinfo << endl;
+
+ // ------------- Navigation links --------------
+ kaction_map["home"] = new KAction( i18n("&Top"), "2uparrow", KShortcut("Ctrl+Alt+T"), this, SLOT(goHome()), actionCollection(), "rellinks_top" );
+ kaction_map["home"]->setWhatsThis( i18n("<p>This link references a home page or the top of some hierarchy.</p>") );
+
+ kaction_map["up"] = new KAction( i18n("&Up"), "1uparrow", KShortcut("Ctrl+Alt+U"), this, SLOT(goUp()), actionCollection(), "rellinks_up" );
+ kaction_map["up"]->setWhatsThis( i18n("<p>This link references the immediate parent of the current document.</p>") );
+
+ bool isRTL = QApplication::reverseLayout();
+
+ kaction_map["begin"] = new KAction( i18n("&First"), isRTL ? "2rightarrow" : "2leftarrow", KShortcut("Ctrl+Alt+F"), this, SLOT(goFirst()), actionCollection(), "rellinks_first" );
+ kaction_map["begin"]->setWhatsThis( i18n("<p>This link type tells search engines which document is considered by the author to be the starting point of the collection.</p>") );
+
+ kaction_map["prev"] = new KAction( i18n("&Previous"), isRTL ? "1rightarrow" : "1leftarrow", KShortcut("Ctrl+Alt+P"), this, SLOT(goPrevious()), actionCollection(), "rellinks_previous" );
+ kaction_map["prev"]->setWhatsThis( i18n("<p>This link references the previous document in an ordered series of documents.</p>") );
+
+ kaction_map["next"] = new KAction( i18n("&Next"), isRTL ? "1leftarrow" : "1rightarrow", KShortcut("Ctrl+Alt+N"), this, SLOT(goNext()), actionCollection(), "rellinks_next" );
+ kaction_map["next"]->setWhatsThis( i18n("<p>This link references the next document in an ordered series of documents.</p>") );
+
+ kaction_map["last"] = new KAction( i18n("&Last"), isRTL ? "2leftarrow" : "2rightarrow", KShortcut("Ctrl+Alt+L"), this, SLOT(goLast()), actionCollection(), "rellinks_last" );
+ kaction_map["last"]->setWhatsThis( i18n("<p>This link references the end of a sequence of documents.</p>") );
+
+ // ------------ special items --------------------------
+ kaction_map["search"] = new KAction( i18n("&Search"), "filefind", KShortcut("Ctrl+Alt+S"), this, SLOT(goSearch()), actionCollection(), "rellinks_search" );
+ kaction_map["search"]->setWhatsThis( i18n("<p>This link references the search.</p>") );
+
+ // ------------ Document structure links ---------------
+ m_document = new KActionMenu( i18n("Document"), "contents", actionCollection(), "rellinks_document" );
+ m_document->setWhatsThis( i18n("<p>This menu contains the links referring the document information.</p>") );
+ m_document->setDelayed(false);
+
+ kaction_map["contents"] = new KAction( i18n("Table of &Contents"), "contents", KShortcut("Ctrl+Alt+C"), this, SLOT(goContents()), actionCollection(), "rellinks_toc" );
+ m_document->insert(kaction_map["contents"]);
+ kaction_map["contents"]->setWhatsThis( i18n("<p>This link references the table of contents.</p>") );
+
+ kactionmenu_map["chapter"] = new KActionMenu( i18n("Chapters"), "fileopen", actionCollection(), "rellinks_chapters" );
+ m_document->insert(kactionmenu_map["chapter"]);
+ connect( kactionmenu_map["chapter"]->popupMenu(), SIGNAL( activated( int ) ), this, SLOT(goChapter(int)));
+ kactionmenu_map["chapter"]->setWhatsThis( i18n("<p>This menu references the chapters of the document.</p>") );
+ kactionmenu_map["chapter"]->setDelayed(false);
+
+ kactionmenu_map["section"] = new KActionMenu( i18n("Sections"), "fileopen", actionCollection(), "rellinks_sections" );
+ m_document->insert(kactionmenu_map["section"]);
+ connect( kactionmenu_map["section"]->popupMenu(), SIGNAL( activated( int ) ), this, SLOT( goSection( int ) ) );
+ kactionmenu_map["section"]->setWhatsThis( i18n("<p>This menu references the sections of the document.</p>") );
+ kactionmenu_map["section"]->setDelayed(false);
+
+ kactionmenu_map["subsection"] = new KActionMenu( i18n("Subsections"), "fileopen", actionCollection(), "rellinks_subsections" );
+ m_document->insert(kactionmenu_map["subsection"]);
+ connect( kactionmenu_map["subsection"]->popupMenu(), SIGNAL( activated( int ) ), this, SLOT( goSubsection( int ) ) );
+ kactionmenu_map["subsection"]->setWhatsThis( i18n("<p>This menu references the subsections of the document.</p>") );
+ kactionmenu_map["subsection"]->setDelayed(false);
+
+ kactionmenu_map["appendix"] = new KActionMenu( i18n("Appendix"), "edit", actionCollection(), "rellinks_appendix" );
+ m_document->insert(kactionmenu_map["appendix"]);
+ connect( kactionmenu_map["appendix"]->popupMenu(), SIGNAL( activated( int ) ), this, SLOT( goAppendix( int ) ) );
+ kactionmenu_map["appendix"]->setWhatsThis( i18n("<p>This link references the appendix.</p>") );
+ kactionmenu_map["appendix"]->setDelayed(false);
+
+ kaction_map["glossary"] = new KAction( i18n("&Glossary"), "flag", KShortcut("Ctrl+Alt+G"), this, SLOT(goGlossary()), actionCollection(), "rellinks_glossary" );
+ m_document->insert(kaction_map["glossary"]);
+ kaction_map["glossary"]->setWhatsThis( i18n("<p>This link references the glossary.</p>") );
+
+ kaction_map["index"] = new KAction( i18n("&Index"), "info", KShortcut("Ctrl+Alt+I"), this, SLOT(goIndex()), actionCollection(), "rellinks_index" );
+ m_document->insert(kaction_map["index"]);
+ kaction_map["index"]->setWhatsThis( i18n("<p>This link references the index.</p>") );
+
+ // Other links
+ m_more = new KActionMenu( i18n("More"), "misc", actionCollection(), "rellinks_more" );
+ m_more->setWhatsThis( i18n("<p>This menu contains other important links.</p>") );
+ m_more->setDelayed(false);
+
+ kaction_map["help"] = new KAction( i18n("&Help"), "help", KShortcut("Ctrl+Alt+H"), this, SLOT(goHelp()), actionCollection(), "rellinks_help" );
+ m_more->insert(kaction_map["help"]);
+ kaction_map["help"]->setWhatsThis( i18n("<p>This link references the help.</p>") );
+
+ kaction_map["author"] = new KAction( i18n("&Authors"), "mail_new", KShortcut("Ctrl+Alt+A"), this, SLOT(goAuthor()), actionCollection(), "rellinks_authors" );
+ m_more->insert(kaction_map["author"]);
+ kaction_map["author"]->setWhatsThis( i18n("<p>This link references the author.</p>") );
+
+ kaction_map["copyright"] = new KAction( i18n("Copy&right"), "signature", KShortcut("Ctrl+Alt+R"), this, SLOT(goCopyright()), actionCollection(), "rellinks_copyright" );
+ m_more->insert(kaction_map["copyright"]);
+ kaction_map["copyright"]->setWhatsThis( i18n("<p>This link references the copyright.</p>") );
+
+ kactionmenu_map["bookmark"] = new KActionMenu( i18n("Bookmarks"), "bookmark_folder", actionCollection(), "rellinks_bookmarks" );
+ m_more->insert(kactionmenu_map["bookmark"]);
+ kactionmenu_map["bookmark"]->setWhatsThis( i18n("<p>This menu references the bookmarks.</p>") );
+ connect( kactionmenu_map["bookmark"]->popupMenu(), SIGNAL( activated( int ) ), this, SLOT( goBookmark( int ) ) );
+ kactionmenu_map["bookmark"]->setDelayed(false);
+
+ kactionmenu_map["alternate"] = new KActionMenu( i18n("Other Versions"), "attach", actionCollection(), "rellinks_other_versions" );
+ m_more->insert(kactionmenu_map["alternate"]);
+ kactionmenu_map["alternate"]->setWhatsThis( i18n("<p>This link references the alternate versions of this document.</p>") );
+ connect( kactionmenu_map["alternate"]->popupMenu(), SIGNAL( activated( int ) ), this, SLOT( goAlternate( int ) ) );
+ kactionmenu_map["alternate"]->setDelayed(false);
+
+ // Unclassified menu
+ m_links = new KActionMenu( i18n("Miscellaneous"), "rellinks", actionCollection(), "rellinks_links" );
+ kactionmenu_map["unclassified"] = m_links;
+ kactionmenu_map["unclassified"]->setWhatsThis( i18n("<p>Miscellaneous links.</p>") );
+ connect( kactionmenu_map["unclassified"]->popupMenu(), SIGNAL( activated( int ) ), this, SLOT( goAllElements( int ) ) );
+ kactionmenu_map["unclassified"]->setDelayed(false);
+
+ // We unactivate all the possible actions
+ disableAll();
+}
+
+/* Code from plugin_rellinks
+ * Copyright (C) 2002, Anders Lund <anders@alweb.dk> *
+ * Copyright (C) 2003, 2004, Franck Qu<51>ain <shift@free.fr> *
+ * Copyright (C) 2004, Kevin Krammer <kevin.krammer@gmx.at> *
+ * Copyright (C) 2004, 2005, Oliviet Goffart <ogoffart @ kde.org>
+*/
+void MainWindow::updateLinkActions()
+{
+ // We disable all
+ disableAll();
+
+ // get a list of LINK nodes in document
+ DOM::NodeList linkNodes = mDoc->document().getElementsByTagName( "link" );
+
+ kdDebug() << "HELP Rellinks: Link nodes =" << linkNodes.length() << endl;
+
+ unsigned long nodeLength = linkNodes.length();
+
+ for ( unsigned int i=0; i < nodeLength; i++ ) {
+ // create a entry for each one
+ DOM::Element e( linkNodes.item( i ) );
+
+
+ // --- Retrieve of the relation type --
+
+ QString rel = e.getAttribute( "rel" ).string();
+ rel = rel.simplifyWhiteSpace();
+ if (rel.isEmpty()) {
+ // If the "rel" attribut is null then use the "rev" attribute...
+ QString rev = e.getAttribute( "rev" ).string();
+ rev = rev.simplifyWhiteSpace();
+ if (rev.isEmpty()) {
+ // if "rev" attribut is also empty => ignore
+ continue;
+ }
+ // Determine the "rel" equivalent of "rev" type
+ rel = transformRevToRel(rev);
+ }
+ // Determin the name used internally
+ QString lrel = getLinkType(rel.lower());
+ // relation to ignore
+ if (lrel.isEmpty()) continue;
+ kdDebug() << "lrel=" << lrel << endl;
+
+ // -- Retrieve of other usefull informations --
+
+ QString href = e.getAttribute( "href" ).string();
+ // if nowhere to go, ignore the link
+ if (href.isEmpty()) continue;
+ QString title = e.getAttribute( "title" ).string();
+ QString hreflang = e.getAttribute( "hreflang" ).string();
+
+ KURL ref( mDoc->url(), href );
+ if ( title.isEmpty() )
+ title = ref.prettyURL();
+
+ // escape ampersand before settings as action title, otherwise the menu entry will interpret it as an
+ // accelerator
+ title.replace('&', "&&");
+
+ // -- Menus activation --
+
+ // Activation of "Document" menu ?
+ if (lrel == "contents" || lrel == "glossary" || lrel == "index" || lrel == "appendix") {
+ m_document->setEnabled(true);
+ }
+ // Activation of "More" menu ?
+ if (lrel == "help" || lrel == "author" || lrel == "copyright" ) {
+ m_more->setEnabled(true);
+ }
+
+ // -- Buttons or menu items activation / creation --
+ if (lrel == "bookmark" || lrel == "alternate") {
+ int id = kactionmenu_map[lrel]->popupMenu()->insertItem( title );
+ m_more->setEnabled(true);
+ kactionmenu_map[lrel]->setEnabled(true);
+ element_map[lrel][id] = e;
+
+ } else if (lrel == "appendix" || lrel == "chapter" || lrel == "section" || lrel == "subsection") {
+ int id = kactionmenu_map[lrel]->popupMenu()->insertItem( title );
+ m_document->setEnabled(true);
+ kactionmenu_map[lrel]->setEnabled(true);
+ element_map[lrel][id] = e;
+
+ } else {
+ // It is a unique action
+ element_map[lrel][0] = e;
+ if (kaction_map[lrel]) {
+ kaction_map[lrel]->setEnabled(true);
+ // Tooltip
+ if (hreflang.isEmpty()) {
+ kaction_map[lrel]->setToolTip( title );
+ } else {
+ kaction_map[lrel]->setToolTip( title + " [" + hreflang + "]");
+ }
+ } else {
+ // For the moment all the elements are reference in a separated menu
+ // TODO : reference the unknown ?
+ int id = kactionmenu_map["unclassified"]->popupMenu()->insertItem( lrel + " : " + title );
+ kactionmenu_map["unclassified"]->setEnabled(true);
+ element_map["unclassified"][id] = e;
+ }
+
+ }
+
+ }
+}
+
+void MainWindow::disableAll() {
+ element_map.clear();
+
+ // Clear actions
+ KActionMap::Iterator it;
+ for ( it = kaction_map.begin(); it != kaction_map.end(); ++it ) {
+ // If I don't test it crash :(
+ if (it.data()) {
+ it.data()->setEnabled(false);
+ it.data()->setToolTip(it.data()->text().remove('&'));
+ }
+ }
+
+ // Clear actions
+ KActionMenuMap::Iterator itmenu;
+ for ( itmenu = kactionmenu_map.begin(); itmenu != kactionmenu_map.end(); ++itmenu ) {
+ // If I don't test it crash :(
+ if (itmenu.data()) {
+ itmenu.data()->popupMenu()->clear();
+ itmenu.data()->setEnabled(false);
+ itmenu.data()->setToolTip(itmenu.data()->text().remove('&'));
+ }
+ }
+
+ // Unactivate menus
+ m_more->setEnabled(false);
+ m_document->setEnabled(false);
+
+}
+
+QString MainWindow::getLinkType(const QString &lrel) {
+ // Relations to ignore...
+ if (lrel.contains("stylesheet")
+ || lrel == "script"
+ || lrel == "icon"
+ || lrel == "shortcut icon"
+ || lrel == "prefetch" )
+ return QString::null;
+
+ // ...known relations...
+ if (lrel == "top" || lrel == "origin" || lrel == "start")
+ return "home";
+ if (lrel == "parent")
+ return "up";
+ if (lrel == "first")
+ return "begin";
+ if (lrel == "previous")
+ return "prev";
+ if (lrel == "child")
+ return "next";
+ if (lrel == "end")
+ return "last";
+ if (lrel == "toc")
+ return "contents";
+ if (lrel == "find")
+ return "search";
+ if (lrel == "alternative stylesheet")
+ return "alternate stylesheet";
+ if (lrel == "authors")
+ return "author";
+ if (lrel == "toc")
+ return "contents";
+
+ //...unknown relations or name that don't need to change
+ return lrel;
+}
+
+QString MainWindow::transformRevToRel(const QString &rev) {
+ QString altRev = getLinkType(rev);
+
+ // Known relations
+ if (altRev == "prev")
+ return getLinkType("next");
+ if (altRev == "next")
+ return getLinkType("prev");
+ if (altRev == "made")
+ return getLinkType("author");
+ if (altRev == "up")
+ return getLinkType("child");
+ if (altRev == "sibling")
+ return getLinkType("sibling");
+
+ //...unknown inverse relation => ignore for the moment
+ return QString::null;
+}
+
+void MainWindow::goHome() {
+ goToLink("home");
+}
+
+void MainWindow::goUp() {
+ goToLink("up");
+}
+
+void MainWindow::goFirst() {
+ goToLink("begin");
+}
+
+void MainWindow::goPrevious() {
+ goToLink("prev");
+}
+
+void MainWindow::goNext() {
+ goToLink("next");
+}
+
+void MainWindow::goLast() {
+ goToLink("last");
+}
+
+void MainWindow::goContents() {
+ goToLink("contents");
+}
+
+void MainWindow::goIndex() {
+ goToLink("index");
+}
+
+void MainWindow::goGlossary() {
+ goToLink("glossary");
+}
+
+void MainWindow::goHelp() {
+ goToLink("help");
+}
+
+void MainWindow::goSearch() {
+ goToLink("search");
+}
+
+void MainWindow::goAuthor() {
+ goToLink("author");
+}
+
+
+void MainWindow::goCopyright() {
+ goToLink("copyright");
+}
+
+void MainWindow::goBookmark(int id) {
+ goToLink("bookmark", id);
+}
+
+void MainWindow::goChapter(int id) {
+ goToLink("chapter", id);
+}
+
+void MainWindow::goSection(int id) {
+ goToLink("section", id);
+}
+
+void MainWindow::goSubsection(int id) {
+ goToLink("subsection", id);
+}
+
+void MainWindow::goAppendix(int id) {
+ goToLink("appendix", id);
+}
+
+void MainWindow::goAlternate(int id) {
+ goToLink("alternate", id);
+}
+
+void MainWindow::goAllElements(int id) {
+ goToLink("unclassified", id);
+}
+
+/** Menu links */
+void MainWindow::goToLink(const QString & rel, int id) {
+ // have the KHTML part open it
+ if (!mDoc)
+ return;
+
+ DOM::Element e = element_map[rel][id];
+ QString href = e.getAttribute("href").string();
+ KURL url( mDoc->url(), href );
+ QString target = e.getAttribute("target").string();
+
+ // URL arguments
+ KParts::URLArgs args;
+ args.frameName = target;
+
+ // Add base url if not valid
+ if (url.isValid()) {
+ mDoc->browserExtension()->openURLRequest(url, args);
+ } else {
+ KURL baseURL = mDoc->baseURL();
+ QString endURL = url.prettyURL();
+ KURL realURL = KURL(baseURL, endURL);
+ mDoc->browserExtension()->openURLRequest(realURL, args);
+ }
+
+}
+
#include "mainwindow.moc"
// vim:ts=2:sw=2:et
Index: khelpcenter/mainwindow.h
===================================================================
--- khelpcenter/mainwindow.h.orig
+++ khelpcenter/mainwindow.h
@@ -13,6 +13,15 @@
#include "navigator.h"
#include "glossary.h"
+#include <dom/dom_element.h>
+
+class KAction;
+class KActionMenu;
+// type definitions
+typedef QMap<int,DOM::Element> DOMElementMap;
+typedef QMap<QString, KAction*> KActionMap;
+typedef QMap<QString, KActionMenu*> KActionMenuMap;
+
class KHTMLPart;
class QSplitter;
@@ -68,11 +77,43 @@ class MainWindow : public KMainWindow, p
void writeConfig();
protected slots:
+ void updateLinkActions();
void enableLastSearchAction();
void enableCopyTextAction();
private:
void stop();
+ /**
+ * initialise all KActions
+ */
+ void initActions();
+ /**
+ * Function used to disable all the item of the toolbar (c) rellinks
+ */
+ void disableAll();
+ /**
+ * Function used to get link type of a relation.
+ * For example "prev" is of type "previous" and "toc" is of type "contents"
+ * If the relation must be ignored return NULL.
+ * If the relation is unknow return the input relation type.
+ * @param lrel Previous relation name
+ * @return New relation name
+ */
+ QString getLinkType(const QString &lrel);
+ /**
+ * Function used to return the "rel" equivalent of "rev" link type
+ * If the equivalent is not found return NULL
+ * @param rev Inverse relation name
+ * @return Equivalent relation name
+ */
+ QString transformRevToRel(const QString &rev) ;
+
+ /**
+ * Go to the link (c) rellinks
+ * @param rel Relation name
+ * @param id Identifier of the menu item
+ */
+ void goToLink(const QString & rel, int id=0);
private slots:
void slotGlossSelected(const GlossaryEntry &entry);
@@ -90,7 +131,29 @@ class MainWindow : public KMainWindow, p
void slotConfigureFonts();
void slotCopySelectedText();
-private:
+ void goHome();
+ void goUp();
+ void goFirst();
+ void goPrevious();
+ void goNext();
+ void goLast();
+ void goContents();
+ void goIndex();
+ void goGlossary();
+ void goHelp();
+ void goSearch();
+ void goCopyright();
+ void goAuthor();
+
+ void goBookmark(int id);
+ void goChapter(int id);
+ void goSection(int id);
+ void goSubsection(int id);
+ void goAppendix(int id);
+ void goAlternate(int id);
+ void goAllElements(int id);
+
+ private:
void updateZoomActions();
QSplitter *mSplitter;
@@ -100,6 +163,17 @@ private:
KAction *mLastSearchAction;
KAction *mCopyText;
LogDialog *mLogDialog;
+ //(c) rellinks
+ /** Map of KAction */
+ KActionMap kaction_map;
+ /** Map of KActionMenu */
+ KActionMenuMap kactionmenu_map;
+ /** Map of all the link element which can be managed by rellinks */
+ QMap<QString,DOMElementMap> element_map;
+ KActionMenu *m_document;
+ KActionMenu *m_more;
+ KActionMenu *m_links;
+
};
}

@ -0,0 +1,36 @@
Index: konqueror/konq_frame.cc
===================================================================
--- konqueror/konq_frame.cc.orig
+++ konqueror/konq_frame.cc
@@ -34,6 +34,7 @@
#include <kprogress.h>
#include <klocale.h>
#include <ksqueezedtextlabel.h>
+#include <networkstatusindicator.h>
#include "konq_events.h"
#include "konq_frame.h"
@@ -97,6 +98,10 @@ KonqFrameStatusBar::KonqFrameStatusBar(
m_progressBar->hide();
addWidget( m_progressBar, 0, true /*permanent->right align*/ );
+ StatusBarNetworkStatusIndicator * indicator = new StatusBarNetworkStatusIndicator( this, "networkstatusindicator" );
+ addWidget( indicator, 0, false );
+ indicator->init();
+
fontChange(QFont());
installEventFilter( this );
}
Index: konqueror/Makefile.am
===================================================================
--- konqueror/Makefile.am.orig
+++ konqueror/Makefile.am
@@ -48,7 +48,7 @@ noinst_HEADERS = KonqMainWindowIface.h K
konq_misc.h konq_openurlrequest.h konq_profiledlg.h konq_run.h \
konq_view.h konq_viewmgr.h konq_extensionmanager.h version.h
-konqueror_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+konqueror_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) -lconnectionmanager
konqueror_la_LIBADD = ../libkonq/libkonq.la libkonqueror_intern.la $(LIBMALLOC) $(LIB_KUTILS)
# Hmm, this experiment of a static konq failed, don't trust it...

@ -0,0 +1,58 @@
Index: kdeeject/kdeeject
===================================================================
--- kdeeject/kdeeject.orig
+++ kdeeject/kdeeject
@@ -4,12 +4,38 @@
#
# Copyright GPL v2 by David Faure <david@mandrakesoft.com>
#
-if test $# -ge 1 -a "$1" != "--help"; then
- quiet=0
- if test "$1" = "-q"; then
- quiet=1
- shift
- fi
+quiet=0
+if test "$1" = "-q"; then
+ quiet=1
+ shift
+fi
+
+if test "$1" = "--help"; then
+ echo "Usage: $0 <name> where name is a device or a mountpoint."
+ exit 0
+fi
+
+if test -z "$1"; then
+ for dev in /dev/cdrom /dev/dvd /dev/dvdram /dev/cdrecorder; do
+ if test -e $dev; then
+ lp=`readlink $dev`
+ if test -n "$lp"; then
+ device=/dev/$lp
+ else
+ device=$dev
+ fi
+ break
+ fi
+ done
+else
+ device=$1
+fi
+
+udi=`dcop kded mediamanager properties $device 2>/dev/null | head -n 1 `
+if test -n "$udi"; then
+ dcop kded mediamanager unmount "$udi" >/dev/null 2>&1
+fi
+
# Checking for stuff in the PATH is ugly with sh.
# I guess this is the reason for making this a kde app...
OS=`uname -s`
@@ -34,7 +60,5 @@ if test $# -ge 1 -a "$1" != "--help"; th
elif test $quiet -eq 0; then
kdialog --title "KDE Eject" --error "Eject $1 failed!"
fi
-else
- kdialog --title "KDE Eject" --msgbox "Usage: $0 <name> where name is a device or a mountpoint."
-fi
+
exit 1

@ -0,0 +1,311 @@
Index: kdesktop/KDesktopIface.h
===================================================================
--- kdesktop/KDesktopIface.h.orig
+++ kdesktop/KDesktopIface.h
@@ -107,6 +107,35 @@ k_dcop:
* space for desktop icons
*/
virtual void desktopIconsAreaChanged(const QRect &area, int screen) = 0;
+
+ /**
+ * Find the next free place for a not yet existing icon, so it fits
+ * in the user arrangement. Basicly prepare for icons to be moved in.
+ * It will try to find a place in the virtual grid near col,row
+ * where no other icon is.
+ *
+ * If you specify -1 for row or column, it will try to find the next
+ * free room where no other icon follows. E.g. if you specify column
+ * = -1 and row = 0, kdesktop will find the next vertical placement
+ * so that the icon appears at the end of the existing icons preferable
+ * in the first column. If the first column is full, it will find the
+ * next free room in the second column.
+ *
+ * If you specify both column and row, kdesktop won't care for aligning,
+ * or surrounding icons, but try to find the free place near the given
+ * grid place (e.g. specify 0,0 to find the nearest place in the left
+ * upper corner).
+ */
+ virtual QPoint findPlaceForIcon( int column, int row) = 0;
+
+ /// copy the desktop file in the Desktop and place it at x, y
+ virtual void addIcon(const QString &url, int x, int y) = 0;
+
+ /// same with specific destination
+ virtual void addIcon(const QString &url, const QString &dest, int x, int y) = 0;
+
+ /// remove the desktop file (either full path or relative)
+ virtual void removeIcon(const QString &dest) = 0;
};
#endif
Index: kdesktop/desktop.cc
===================================================================
--- kdesktop/desktop.cc.orig
+++ kdesktop/desktop.cc
@@ -32,6 +32,9 @@
#include <unistd.h>
#include <kcolordrag.h>
#include <kurldrag.h>
+#include <stdlib.h>
+#include <kio/job.h>
+#include <qfile.h>
#include <qdir.h>
#include <qevent.h>
@@ -58,6 +61,7 @@
#include <kglobalsettings.h>
#include <kpopupmenu.h>
#include <kapplication.h>
+#include <kdirlister.h>
// Create the equivalent of KAccelBase::connectItem
// and then remove this include and fix reconnects in initRoot() -- ellis
//#include <kaccelbase.h>
@@ -983,4 +987,47 @@ bool KDesktop::event(QEvent * e)
return QWidget::event(e);
}
+QPoint KDesktop::findPlaceForIcon( int column, int row )
+{
+ if (m_pIconView)
+ return m_pIconView->findPlaceForIcon(column, row);
+ else
+ return QPoint(-1, -1);
+}
+
+void KDesktop::addIcon(const QString & _url, int x, int y)
+{
+ addIcon( _url, KGlobalSettings::desktopPath(), x, y );
+}
+
+void KDesktop::addIcon(const QString & _url, const QString & _dest, int x, int y)
+{
+ QString filename = _url.mid(_url.findRev('/') + 1);
+
+ QValueList<KIO::CopyInfo> files;
+ KIO::CopyInfo i;
+ i.uSource = KURL::fromPathOrURL( _url );
+ i.uDest = KURL::fromPathOrURL( _dest );
+ i.uDest.addPath( filename );
+ files.append(i);
+ if (!QFile::exists(i.uDest.prettyURL().replace("file://",QString::null))) { m_pIconView->slotAboutToCreate( QPoint( x, y ), files );
+ KIO::copy( i.uSource, i.uDest, false ); }
+
+// m_pIconView->addFuturePosition(filename, x, y);
+ // qDebug("addIcon %s %s %d %d", _url.latin1(), _dest.latin1(), x, y);
+// system(QString("cp \"%1\" \"%2/%3\"").arg(KURL(_url).path()).arg(KURL(_dest).path()).arg(filename).latin1());
+// m_pIconView->update( _dest );
+}
+
+void KDesktop::removeIcon(const QString &_url)
+{
+ if (_url.at(0) != '/') {
+ qDebug("removeIcon with relative path not supported for now");
+ return;
+ }
+ unlink(KURL(_url).path().latin1());
+ QString dest = _url.left(_url.findRev('/') + 1);
+ m_pIconView->update( dest );
+}
+
#include "desktop.moc"
Index: kdesktop/desktop.h
===================================================================
--- kdesktop/desktop.h.orig
+++ kdesktop/desktop.h
@@ -164,6 +164,11 @@ protected:
virtual void setIconsEnabled( bool enable );
virtual bool event ( QEvent * e );
+ virtual QPoint findPlaceForIcon( int column, int row);
+ virtual void addIcon(const QString &url, int x, int y);
+ virtual void addIcon(const QString &url, const QString &dest, int x, int y);
+ virtual void removeIcon(const QString &url);
+
private slots:
void desktopResized();
Index: kdesktop/kdiconview.cc
===================================================================
--- kdesktop/kdiconview.cc.orig
+++ kdesktop/kdiconview.cc
@@ -962,6 +962,18 @@ void KDIconView::slotNewItems( const KFi
kdDebug(1214) << "KDIconView::slotNewItems count=" << entries.count() << endl;
KFileItemListIterator it(entries);
KFileIVI* fileIVI = 0L;
+
+ if (m_nextItemPos.isNull() && !m_dotDirectory) {
+ // Not found, we'll need to save the new pos
+ kdDebug(1214)<<"Neither a drop position stored nor m_dotDirectory set"<<endl;
+ m_dotDirectory = new KSimpleConfig( dotDirectoryPath(), true );
+ // recursion
+ slotNewItems( entries );
+ delete m_dotDirectory;
+ m_dotDirectory = 0;
+ return;
+ }
+
for (; it.current(); ++it)
{
KURL url = it.current()->url();
@@ -1026,15 +1038,6 @@ void KDIconView::slotNewItems( const KFi
kdDebug(1214)<<"Using saved position"<<endl;
}
}
- else
- {
- // Not found, we'll need to save the new pos
- kdDebug(1214)<<"slotNewItems(): New item without position information, try to find a sane location"<<endl;
-
- moveToFreePosition(fileIVI);
-
- m_bNeedSave = true;
- }
}
}
@@ -1638,6 +1641,98 @@ void KDIconView::moveToFreePosition(QIco
}
+QPoint KDIconView::findPlaceForIconCol( int column, int dx, int dy)
+{
+ if (column < 0)
+ return QPoint();
+
+ QRect rect;
+ rect.moveTopLeft( QPoint(column * dx, 0) );
+ rect.setWidth(dx);
+ rect.setHeight(dy);
+
+ if (rect.right() > viewport()->width())
+ return QPoint();
+
+ while ( rect.bottom() < viewport()->height() - spacing() )
+ {
+ if ( !isFreePosition(0,rect) )
+ rect.moveBy(0, rect.height());
+ else
+ return rect.topLeft();
+ }
+
+ return QPoint();
+}
+
+QPoint KDIconView::findPlaceForIconRow( int row, int dx, int dy )
+{
+ if (row < 0)
+ return QPoint();
+
+ QRect rect;
+ rect.moveTopLeft(QPoint(0, row * dy));
+ rect.setWidth(dx);
+ rect.setHeight(dy);
+
+ if (rect.bottom() > viewport()->height())
+ return QPoint();
+
+ while (rect.right() < viewport()->width() - spacing())
+ {
+ if (!isFreePosition(0,rect))
+ rect.moveBy(rect.width()+spacing(), 0);
+ else
+ return rect.topLeft();
+ }
+
+ return QPoint();
+}
+
+QPoint KDIconView::findPlaceForIcon( int column, int row)
+{
+ int dx = gridXValue(), dy = 0;
+ QIconViewItem *item = firstItem();
+ for ( ; item; item = item->nextItem() ) {
+ dx = QMAX( dx, item->width() );
+ dy = QMAX( dy, item->height() );
+ }
+
+ dx += spacing();
+ dy += spacing();
+
+ if (row == -1) {
+ int max_cols = viewport()->width() / dx;
+ int delta = 0;
+ QPoint res;
+ do {
+ delta++;
+ res = findPlaceForIconCol(column + (delta / 2) * (-2 * (delta % 2) + 1),
+ dx, dy);
+ if (delta / 2 > QMAX(max_cols - column, column))
+ return res;
+ } while (res.isNull());
+ return res;
+ }
+
+ if (column == -1) {
+ int max_rows = viewport()->height() / dy;
+ int delta = 0;
+ QPoint res;
+ do {
+ delta++;
+ res = findPlaceForIconRow(row + (delta / 2) * (-2 * (delta % 2) + 1),
+ dx, dy);
+ if (delta / 2 > QMAX(max_rows - row, row))
+ return res;
+ } while (res.isNull());
+ return res;
+ }
+
+ // very unlikely - if I may add that
+ return QPoint(0, 0);
+}
+
void KDIconView::saveIconPositions()
{
kdDebug(1214) << "KDIconView::saveIconPositions" << endl;
@@ -1665,4 +1760,11 @@ void KDIconView::saveIconPositions()
m_dotDirectory->sync();
}
+void KDIconView::update( const QString &_url )
+{
+ if (m_dirLister)
+ m_dirLister->updateDirectory( _url );
+}
+
+
#include "kdiconview.moc"
Index: kdesktop/kdiconview.h
===================================================================
--- kdesktop/kdiconview.h.orig
+++ kdesktop/kdiconview.h
@@ -73,6 +73,8 @@ public:
QStringList selectedURLs();
+ void update( const QString &url );
+
/**
* Save the icon positions
*/
@@ -103,6 +105,10 @@ public:
void startDirLister();
+ QPoint findPlaceForIconCol( int column, int dx, int dy );
+ QPoint findPlaceForIconRow( int row, int dx, int dy );
+ QPoint findPlaceForIcon( int column, int row );
+
protected slots:
// slots connected to the icon view
@@ -112,8 +118,9 @@ protected slots:
void slotMouseButtonClickedKDesktop(int _button, QIconViewItem* _item, const QPoint& _global);
void slotContextMenuRequested(QIconViewItem* _item, const QPoint& _global);
void slotEnableAction( const char * name, bool enabled );
+public slots:
void slotAboutToCreate(const QPoint &pos, const QValueList<KIO::CopyInfo> &files);
-
+protected slots:
void slotItemRenamed(QIconViewItem*, const QString &name);
// slots connected to the directory lister

@ -0,0 +1,18 @@
Subject: Default to kdesu password remembering on, but remember last state
From: Lubos Lunak
Feature: bnc#386531
Patch-upstream: no
Relates: kdebase4/kdesu-remember-keep-password.diff, kdelibs3/kdesu-settings.diff
Index: kdesu/kdesu/kdesu.cpp
===================================================================
--- kdesu/kdesu/kdesu.cpp (revision 810363)
+++ kdesu/kdesu/kdesu.cpp (working copy)
@@ -382,6 +382,7 @@
change_uid = false;
password = dlg.password();
keep = dlg.keep();
+ KConfigGroup(config,"Passwords").writeEntry("Keep", keep);
data.setSilent( KStartupInfoData::No );
KStartupInfo::sendChange( id, data );
}

@ -0,0 +1,21 @@
Index: kdesu/kdesud/kdesud.cpp
===================================================================
--- kdesu/kdesud/kdesud.cpp.orig
+++ kdesu/kdesud/kdesud.cpp
@@ -45,6 +45,7 @@
#include <pwd.h>
#include <errno.h>
+#include <sys/prctl.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -248,6 +249,8 @@ int create_socket()
int main(int argc, char *argv[])
{
+ prctl(PR_SET_DUMPABLE, 0);
+
KAboutData aboutData("kdesud", I18N_NOOP("KDE su daemon"),
Version, I18N_NOOP("Daemon used by kdesu"),
KAboutData::License_Artistic,

@ -0,0 +1,424 @@
Index: kdm/config.def
===================================================================
--- kdm/config.def.orig
+++ kdm/config.def
@@ -2002,6 +2002,17 @@ Description:
Specify the widget style for the greeter. Empty means to use the
built-in default which currently is <literal>Plastik</literal>.
+Key: UseAdminSession
+Type: bool
+Default: false
+User: greeter
+Instance: #*/!
+Comment:
+ Admin session
+Description:
+ If given there will be a special button that requires root password
+ and starts the given session
+
Key: ColorScheme
Type: string
Default: ""
Index: kdm/kfrontend/Makefile.am
===================================================================
--- kdm/kfrontend/Makefile.am.orig
+++ kdm/kfrontend/Makefile.am
@@ -21,6 +21,7 @@ kdm_greet_SOURCES = \
kchooser.cpp \
kgverify.cpp \
kdmshutdown.cpp \
+ kdmadmindialog.cpp \
kgreeter.cpp \
kgapp.cpp
kdm_greet_LDFLAGS = $(all_libraries) $(KDE_RPATH)
Index: kdm/kfrontend/kdmadmindialog.cpp
===================================================================
--- /dev/null
+++ kdm/kfrontend/kdmadmindialog.cpp
@@ -0,0 +1,176 @@
+ /*
+
+ Admin dialog
+
+ Copyright (C) 1997, 1998, 2000 Steffen Hansen <hansen@kde.org>
+ Copyright (C) 2000-2003 Oswald Buddenhagen <ossi@kde.org>
+
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ */
+
+#include "kdmadmindialog.h"
+#include "kdmconfig.h"
+#include "kgdialog.h"
+#include "kdm_greet.h"
+#include <stdlib.h>
+
+#include <kapplication.h>
+#include <kseparator.h>
+#include <klocale.h>
+#include <kpushbutton.h>
+#include <kstdguiitem.h>
+
+#include <qcombobox.h>
+#include <qvbuttongroup.h>
+#include <qstyle.h>
+#include <qlayout.h>
+#include <qaccel.h>
+#include <qpopupmenu.h>
+
+int KDMAdmin::curPlugin = -1;
+PluginList KDMAdmin::pluginList;
+
+KDMAdmin::KDMAdmin( const QString &user, QWidget *_parent )
+ : inherited( _parent )
+ , verify( 0 ), curUser(user)
+{
+ QSizePolicy fp( QSizePolicy::Fixed, QSizePolicy::Fixed );
+
+ QVBoxLayout *box = new QVBoxLayout( this, 10 );
+
+ QHBoxLayout *hlay = new QHBoxLayout( box );
+
+ GSendInt( G_ReadDmrc );
+ GSendStr( "root" );
+ GRecvInt(); // ignore status code ...
+
+ if (curPlugin < 0) {
+ curPlugin = 0;
+ pluginList = KGVerify::init( "classic" );
+ }
+ verify = new KGStdVerify( this, this,
+ this, "root",
+ pluginList, KGreeterPlugin::Authenticate,
+ KGreeterPlugin::Shutdown );
+ verify->selectPlugin( curPlugin );
+ box->addLayout( verify->getLayout() );
+ QAccel *accel = new QAccel( this );
+ accel->insertItem( ALT+Key_A, 0 );
+ connect( accel, SIGNAL(activated(int)), SLOT(slotActivatePlugMenu()) );
+
+ box->addWidget( new KSeparator( KSeparator::HLine, this ) );
+
+ okButton = new KPushButton( KStdGuiItem::ok(), this );
+ okButton->setSizePolicy( fp );
+ okButton->setDefault( true );
+ cancelButton = new KPushButton( KStdGuiItem::cancel(), this );
+ cancelButton->setSizePolicy( fp );
+
+ hlay = new QHBoxLayout( box );
+ hlay->addStretch( 1 );
+ hlay->addWidget( okButton );
+ hlay->addStretch( 1 );
+ hlay->addWidget( cancelButton );
+ hlay->addStretch( 1 );
+
+ connect( okButton, SIGNAL(clicked()), SLOT(accept()) );
+ connect( cancelButton, SIGNAL(clicked()), SLOT(reject()) );
+
+ slotWhenChanged();
+}
+
+KDMAdmin::~KDMAdmin()
+{
+ hide();
+ delete verify;
+}
+
+void
+KDMAdmin::slotActivatePlugMenu()
+{
+ QPopupMenu *cmnu = verify->getPlugMenu();
+ QSize sh( cmnu->sizeHint() / 2 );
+ cmnu->exec( geometry().center() - QPoint( sh.width(), sh.height() ) );
+}
+
+void
+KDMAdmin::accept()
+{
+ verify->accept();
+}
+
+void
+KDMAdmin::slotWhenChanged()
+{
+ verify->abort();
+ verify->setEnabled( 1 );
+ verify->start();
+}
+
+void
+KDMAdmin::bye_bye()
+{
+ GSendInt( G_GetDmrc );
+ GSendStr( "Session" );
+ char *sess = GRecvStr();
+ if (sess && strcmp(sess, "admin")) {
+ GSendInt( G_PutDmrc );
+ GSendStr( "OrigSession");
+ GSendStr( sess);
+ free(sess);
+ }
+
+ GSendInt( G_PutDmrc );
+ GSendStr( "Session" );
+ GSendStr( "admin" );
+ inherited::accept();
+}
+
+void
+KDMAdmin::verifyPluginChanged( int id )
+{
+ curPlugin = id;
+ adjustSize();
+}
+
+void
+KDMAdmin::verifyOk()
+{
+ bye_bye();
+}
+
+void
+KDMAdmin::verifyFailed()
+{
+ okButton->setEnabled( false );
+ cancelButton->setEnabled( false );
+}
+
+void
+KDMAdmin::verifyRetry()
+{
+ okButton->setEnabled( true );
+ cancelButton->setEnabled( true );
+}
+
+void
+KDMAdmin::verifySetUser( const QString & )
+{
+}
+
+
+#include "kdmadmindialog.moc"
Index: kdm/kfrontend/kdmadmindialog.h
===================================================================
--- /dev/null
+++ kdm/kfrontend/kdmadmindialog.h
@@ -0,0 +1,70 @@
+ /*
+
+ Shutdown dialog
+
+ Copyright (C) 1997, 1998 Steffen Hansen <hansen@kde.org>
+ Copyright (C) 2000-2003 Oswald Buddenhagen <ossi@kde.org>
+
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ */
+
+
+#ifndef KDMADMIN_H
+#define KDMADMIN_H
+
+#include "kgverify.h"
+
+#include <qradiobutton.h>
+
+class LiloInfo;
+class QLabel;
+class KPushButton;
+class QButtonGroup;
+class QComboBox;
+
+class KDMAdmin : public FDialog, public KGVerifyHandler {
+ Q_OBJECT
+ typedef FDialog inherited;
+
+public:
+ KDMAdmin( const QString &user, QWidget *_parent = 0 );
+ ~KDMAdmin();
+
+public slots:
+ void accept();
+ void slotWhenChanged();
+ void slotActivatePlugMenu();
+
+private:
+ void bye_bye();
+
+ KPushButton *okButton, *cancelButton;
+ KGStdVerify *verify;
+ QString curUser;
+
+ static int curPlugin;
+ static PluginList pluginList;
+
+public: // from KGVerifyHandler
+ virtual void verifyPluginChanged( int id );
+ virtual void verifyOk();
+ virtual void verifyFailed();
+ virtual void verifyRetry();
+ virtual void verifySetUser( const QString &user );
+};
+
+#endif
Index: kdm/kfrontend/kgreeter.cpp
===================================================================
--- kdm/kfrontend/kgreeter.cpp.orig
+++ kdm/kfrontend/kgreeter.cpp
@@ -27,6 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fi
#include "kdmconfig.h"
#include "kdmclock.h"
#include "kdm_greet.h"
+#include "kdmadmindialog.h"
#include "themer/kdmthemer.h"
#include "themer/kdmitem.h"
#include "themer/kdmlabel.h"
@@ -509,7 +510,7 @@ KGreeter::insertSessions()
for (char **dit = _sessionsDirs; *dit; ++dit) {
QStringList ents = QDir( *dit ).entryList();
for (QStringList::ConstIterator it = ents.begin(); it != ents.end(); ++it)
- if ((*it).endsWith( ".desktop" )) {
+ if ((*it).endsWith( ".desktop" ) && !(*it).endsWith("admin.desktop")) {
KSimpleConfig dsk( QString( *dit ).append( '/' ).append( *it ) );
dsk.setGroup( "Desktop Entry" );
putSession( (*it).left( (*it).length() - 8 ),
@@ -648,6 +649,17 @@ KGreeter::slotLoadPrevWM()
return;
}
} else {
+ if (!strcmp(sess, "admin")) {
+ // need to get the original
+ GSendInt( G_GetDmrc);
+ GSendStr( "OrigSession");
+ sess = GRecvStr();
+ if (!sess) {
+ free(sess);
+ sess = strdup("default");
+ }
+ }
+
for (uint i = 0; i < sessionTypes.count() && !sessionTypes[i].hid; i++)
if (sessionTypes[i].type == sess) {
free( sess );
@@ -998,6 +1010,12 @@ KThemedGreeter::KThemedGreeter()
}
}
+ admin_button = themer->findNode( "admin_button");
+ if ( admin_button ) {
+ if ( !_useAdminSession )
+ admin_button->hide( true );
+ }
+
if (plugMenu) {
inserten( i18n("&Authentication Method"), 0, plugMenu );
needSep = true;
@@ -1103,6 +1121,8 @@ KThemedGreeter::slotThemeActivated( cons
slotSessMenu();
else if (id == "system_button")
slotActionMenu();
+ else if (id == "admin_button")
+ slotAskAdminPassword();
}
void
@@ -1129,4 +1149,15 @@ KThemedGreeter::keyPressEvent( QKeyEvent
accept();
}
+void
+KThemedGreeter::slotAskAdminPassword()
+{
+ KDMAdmin k(curUser, this);
+ if (k.exec()) {
+ GSendInt(G_Ready);
+ hide();
+ done(ex_exit);
+ }
+}
+
#include "kgreeter.moc"
Index: kdm/kfrontend/kgreeter.h
===================================================================
--- kdm/kfrontend/kgreeter.h.orig
+++ kdm/kfrontend/kgreeter.h
@@ -146,6 +146,7 @@ class KThemedGreeter : public KGreeter {
void slotThemeActivated( const QString &id );
void slotSessMenu();
void slotActionMenu();
+ void slotAskAdminPassword();
protected:
virtual void updateStatus( bool fail, bool caps, int timedleft );
@@ -158,7 +159,7 @@ class KThemedGreeter : public KGreeter {
KdmThemer *themer;
KdmItem *caps_warning, *xauth_warning, *pam_error, *timed_label,
*console_rect, *userlist_rect,
- *session_button, *system_button;
+ *session_button, *system_button, *admin_button;
public: // from KGVerifyHandler
virtual void verifyFailed();
Index: kdm/kfrontend/sessions/Makefile.am
===================================================================
--- kdm/kfrontend/sessions/Makefile.am.orig
+++ kdm/kfrontend/sessions/Makefile.am
@@ -1,6 +1,6 @@
sessionsdir = $(kde_datadir)/kdm/sessions
sessions_DATA = \
- kde.desktop gnome.desktop \
+ admin.desktop kde.desktop gnome.desktop \
9wm.desktop \
aewm++.desktop \
aewm.desktop \
Index: kdm/kfrontend/sessions/admin.desktop
===================================================================
--- /dev/null
+++ kdm/kfrontend/sessions/admin.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Encoding=UTF-8
+Type=XSession
+Exec=YaSTadminSession
+TryExec=YaSTadminSession
+Name=admin
+Comment=Yast Admin Session
Index: kdm/kfrontend/themer/kdmlabel.cpp
===================================================================
--- kdm/kfrontend/themer/kdmlabel.cpp.orig
+++ kdm/kfrontend/themer/kdmlabel.cpp
@@ -214,6 +214,7 @@ static const struct {
{ "language", I18N_NOOP("&Language") },
{ "session", I18N_NOOP("Session &Type") },
{ "system", I18N_NOOP("&System") }, // i18n("Actions");
+ { "admin", I18N_NOOP("&Administration") },
{ "disconnect", I18N_NOOP("&Disconnect") },
{ "quit", I18N_NOOP("&Quit") },
{ "halt", I18N_NOOP("Power O&ff") },

@ -0,0 +1,11 @@
Index: kdm/backend/Makefile.am
===================================================================
--- kdm/backend/Makefile.am.orig
+++ kdm/backend/Makefile.am
@@ -1,5 +1,6 @@
# forcibly remove thread-related defines & flags
AUTOMAKE_OPTIONS = foreign
+CFLAGS = $(XDM_CFLAGS) -fno-strict-aliasing
CPPFLAGS = $(USER_INCLUDES) $(X_INCLUDES) $(KRB4_INCS) $(KRB5_INCS) -I.. -I../..
LDFLAGS = $(USER_LDFLAGS) $(X_LDFLAGS) $(X_RPATH) $(KRB4_RPATH) $(KRB5_RPATH)
LDADD = $(LIB_X11) -lXau $(LIBXDMCP) $(PASSWDLIBS) $(LIBSHADOW) $(LIBGEN) \

@ -0,0 +1,46 @@
Index: kdm/kfrontend/kgreeter.cpp
===================================================================
--- kdm/kfrontend/kgreeter.cpp.orig
+++ kdm/kfrontend/kgreeter.cpp
@@ -59,6 +59,7 @@ Foundation, Inc., 51 Franklin Street, Fi
#include <qtooltip.h>
#include <qaccel.h>
#include <qeventloop.h>
+#include <qbitmap.h>
#include <pwd.h>
#include <grp.h>
@@ -313,6 +314,33 @@ KGreeter::insertUser( const QImage &defa
if ( p.isNull() )
p = default_pix;
+ const int size = 48;
+ const int wdiff = size - p.size().width();
+ const int hdiff = size - p.size().height();
+ if (wdiff>0 || hdiff>0) {
+ QPixmap pix(p);
+ QBitmap mask;
+ mask.convertFromImage(p.createAlphaMask());
+ pix.resize(size, size);
+ bitBlt(&pix, wdiff/2.0, hdiff/2.0, &pix);
+ if (mask.isNull()) {
+ mask = QBitmap(size, size);
+ mask.fill(Qt::color1);
+ }
+ else {
+ mask.resize(size, size);
+ bitBlt(&mask, wdiff/2.0, hdiff/2.0, &mask);
+ }
+ QPainter pa(&mask);
+ pa.fillRect(0, 0, size, hdiff/2.0, Qt::color0);
+ pa.fillRect(0, 0, wdiff/2.0, size, Qt::color0);
+ pa.fillRect(size-(wdiff/2.0), 0, size, size, Qt::color0);
+ pa.fillRect(0, size-(hdiff/2.0), size, size, Qt::color0);
+ pa.end();
+ pix.setMask(mask);
+ p=pix.convertToImage();
+ }
+
QString realname = KStringHandler::from8Bit( ps->pw_gecos );
realname.truncate( realname.find( ',' ) );
if (realname.isEmpty() || realname == username)

@ -0,0 +1,34 @@
Index: kdm/backend/client.c
===================================================================
--- kdm/backend/client.c.orig
+++ kdm/backend/client.c
@@ -386,6 +386,9 @@ AccNoPass( const char *un, struct passwd
if (cursource != PWSRC_MANUAL)
return 1;
+ if (td->noPassAllUsers)
+ return 1;
+
for (hg = 0, fp = td->noPassUsers; *fp; fp++)
if (**fp == '@')
hg = 1;
Index: kdm/config.def
===================================================================
--- kdm/config.def.orig
+++ kdm/config.def
@@ -1852,6 +1852,15 @@ Description:
(and any other user with UID = 0).
<emphasis>Never</emphasis> list <systemitem class="username">root</systemitem>.
+Key: NoPassAllUsers
+Type: bool
+Default: false
+User: core
+Instance: #:0/true
+Comment: &
+Description:
+ All users can login without password
+
Key: AutoLoginEnable
Type: bool
Default: false

@ -0,0 +1,190 @@
Index: kdm/backend/client.c
===================================================================
--- kdm/backend/client.c.orig
+++ kdm/backend/client.c
@@ -87,6 +87,14 @@ extern int loginsuccess( const char *Use
#include "consolekit.h"
#endif
+#define AU_FAILED 0
+#define AU_SUCCESS 1
+#ifdef HAVE_LIBAUDIT
+#include <libaudit.h>
+#else
+#define log_to_audit_system(l,h,d,s) do { ; } while (0)
+#endif
+
/*
* Session data, mostly what struct verify_info was for
*/
@@ -291,6 +299,56 @@ fail_delay( int retval ATTR_UNUSED, unsi
{}
# endif
+ /**
+ * log_to_audit_system:
+ * @login: Name of user
+ * @hostname: Name of host machine
+ * @tty: Name of display
+ * @success: 1 for success, 0 for failure
+ *
+ * Logs the success or failure of the login attempt with the linux kernel
+ * audit system. The intent is to capture failed events where the user
+ * fails authentication or otherwise is not permitted to login. There are
+ * many other places where pam could potentially fail and cause login to
+ * fail, but these are system failures rather than the signs of an account
+ * being hacked.
+ *
+ * Returns nothing.
+ */
+
+#ifdef HAVE_LIBAUDIT
+static void
+log_to_audit_system (const char *loginname,
+ const char *hostname,
+ const char *tty,
+ int success)
+{
+ struct passwd *pw;
+ char buf[64];
+ int audit_fd;
+
+ audit_fd = audit_open();
+ if (loginname)
+ pw = getpwnam(loginname);
+ else {
+ loginname = "unknown";
+ pw = NULL;
+ }
+ Debug("log_to_audit %p %s\n", pw, loginname);
+
+ if (pw) {
+ snprintf(buf, sizeof(buf), "uid=%d", pw->pw_uid);
+ audit_log_user_message(audit_fd, AUDIT_USER_LOGIN,
+ buf, hostname, NULL, tty, (int)success);
+ } else {
+ snprintf(buf, sizeof(buf), "acct=%s", loginname);
+ audit_log_user_message(audit_fd, AUDIT_USER_LOGIN,
+ buf, hostname, NULL, tty, (int)success);
+ }
+ close(audit_fd);
+}
+#endif
+
static int
doPAMAuth( const char *psrv, struct pam_data *pdata )
{
@@ -349,6 +407,8 @@ doPAMAuth( const char *psrv, struct pam_
GSendStr( curuser );
}
if (pretc != PAM_SUCCESS) {
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
switch (pretc) {
case PAM_USER_UNKNOWN:
case PAM_AUTH_ERR:
@@ -702,6 +762,8 @@ Verify( GConvFunc gconv, int rootok )
if (!p->pw_uid) {
if (!rootok && !td->allowRootLogin)
V_RET_FAIL( "Root logins are not allowed" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
return 1; /* don't deny root to log in */
}
@@ -738,6 +800,8 @@ Verify( GConvFunc gconv, int rootok )
}
if (pretc == PAM_SUCCESS)
break;
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
/* effectively there is only PAM_AUTHTOK_ERR */
GSendInt( V_FAIL );
}
@@ -827,6 +891,8 @@ Verify( GConvFunc gconv, int rootok )
GSendInt( V_MSG_ERR );
GSendStr( "Your account has expired;"
" please contact your system administrator" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
GSendInt( V_FAIL );
LC_RET0;
} else if (tim > (expir - warntime) && !quietlog) {
@@ -861,6 +927,8 @@ Verify( GConvFunc gconv, int rootok )
GSendInt( V_MSG_ERR );
GSendStr( "Your account has expired;"
" please contact your system administrator" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
GSendInt( V_FAIL );
LC_RET0;
}
@@ -920,6 +988,8 @@ Verify( GConvFunc gconv, int rootok )
close( fd );
}
GSendStr( "Logins are not allowed at the moment.\nTry again later" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
GSendInt( V_FAIL );
LC_RET0;
}
@@ -930,6 +1000,8 @@ Verify( GConvFunc gconv, int rootok )
PrepErrorGreet();
GSendInt( V_MSG_ERR );
GSendStr( "You are not allowed to login at the moment" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
GSendInt( V_FAIL );
LC_RET0;
}
@@ -941,6 +1013,8 @@ Verify( GConvFunc gconv, int rootok )
Debug( "shell not in /etc/shells\n" );
endusershell();
V_RET_FAIL( "Your login shell is not listed in /etc/shells" );
+ /* Log the failed login attempt */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_FAILED);
}
if (!strcmp( s, p->pw_shell )) {
endusershell();
@@ -1365,6 +1439,9 @@ StartClient()
# define D_LOGIN_SETGROUP 0
#endif /* USE_PAM */
+ /* Login succeeded */
+ log_to_audit_system (curuser, td->remoteHost, td->name, AU_SUCCESS);
+
removeAuth = 1;
chownCtrl( &td->ctrl, curuid );
endpwent();
Index: kdm/configure.in.in
===================================================================
--- kdm/configure.in.in.orig
+++ kdm/configure.in.in
@@ -288,3 +288,27 @@ fi
AC_SUBST(DBUS_LIBS)
dnl AC_OUTPUT(kdm/kfrontend/sessions/kde.desktop)
+
+
+AC_ARG_WITH(libaudit,
+ [ --with-libaudit=[auto/yes/no] Add Linux audit support [default=auto]],,
+ with_libaudit=auto)
+
+# Check for Linux auditing API
+#
+# libaudit detection
+if test x$with_libaudit = xno ; then
+ have_libaudit=no;
+else
+ # See if we have audit daemon library
+ AC_CHECK_LIB(audit, audit_log_user_message,
+ have_libaudit=yes, have_libaudit=no)
+fi
+
+AM_CONDITIONAL(HAVE_LIBAUDIT, test x$have_libaudit = xyes)
+
+if test x$have_libaudit = xyes ; then
+ EXTRA_DAEMON_LIBS="$EXTRA_DAEMON_LIBS -laudit"
+ AC_DEFINE(HAVE_LIBAUDIT,1,[linux audit support])
+fi
+

@ -0,0 +1,28 @@
Index: kdm/kfrontend/kgapp.cpp
===================================================================
--- kdm/kfrontend/kgapp.cpp.orig
+++ kdm/kfrontend/kgapp.cpp
@@ -42,6 +42,7 @@ Foundation, Inc., 51 Franklin Street, Fi
#include <qtimer.h>
#include <qcursor.h>
#include <qpalette.h>
+#include <qfile.h>
#include <stdlib.h> // free(), exit()
#include <unistd.h> // alarm()
@@ -144,7 +145,14 @@ kg_main( const char *argv0 )
if (!_GUIStyle.isEmpty())
app.setStyle( _GUIStyle );
- _colorScheme = locate( "data", "kdisplay/color-schemes/" + _colorScheme + ".kcsrc" );
+ const QString _configColorScheme = _colorScheme;
+
+ if (_useTheme && !_theme.isEmpty())
+ _colorScheme = _theme + "/color.kcsrc";
+
+ if (!QFile::exists(_colorScheme))
+ _colorScheme = locate( "data", "kdisplay/color-schemes/" + _configColorScheme + ".kcsrc" );
+
if (!_colorScheme.isEmpty()) {
KSimpleConfig config( _colorScheme, true );
config.setGroup( "Color Scheme" );

@ -0,0 +1,822 @@
Index: kdm/backend/client.c
===================================================================
--- kdm/backend/client.c.orig
+++ kdm/backend/client.c
@@ -83,6 +83,10 @@ extern int loginsuccess( const char *Use
#endif
#include <signal.h>
+#ifdef WITH_CONSOLE_KIT
+#include "consolekit.h"
+#endif
+
/*
* Session data, mostly what struct verify_info was for
*/
@@ -1124,8 +1128,13 @@ static int removeSession;
static int removeCreds;
#endif
+#ifdef WITH_CONSOLE_KIT
+int
+StartClient( const char *ck_session_cookie )
+#else
int
StartClient()
+#endif
{
const char *home, *sessargs, *desksess;
char **env, *xma;
@@ -1223,6 +1232,11 @@ StartClient()
if (krbtkfile[0] != '\0')
env = setEnv( env, "KRBTKFILE", krbtkfile );
#endif
+#ifdef WITH_CONSOLE_KIT
+ if (ck_session_cookie != NULL) {
+ env = setEnv ( env, "XDG_SESSION_COOKIE", ck_session_cookie );
+ }
+#endif
userEnviron = inheritEnv( env, envvars );
env = systemEnv( p->pw_name );
systemEnviron = setEnv( env, "HOME", p->pw_dir );
Index: kdm/backend/consolekit.c
===================================================================
--- /dev/null
+++ kdm/backend/consolekit.c
@@ -0,0 +1,552 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2006-2007 William Jon McCann <mccann@jhu.edu>
+ * Copyright (C) 2007 Kevin Kofler <Kevin@tigcc.ticalc.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "dm.h"
+#include "dm_auth.h"
+#include "dm_error.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <pwd.h>
+
+#define DBUS_API_SUBJECT_TO_CHANGE
+#include <dbus/dbus.h>
+
+#include "consolekit.h"
+
+
+#define CK_NAME "org.freedesktop.ConsoleKit"
+#define CK_PATH "/org/freedesktop/ConsoleKit"
+#define CK_INTERFACE "org.freedesktop.ConsoleKit"
+#define CK_MANAGER_PATH "/org/freedesktop/ConsoleKit/Manager"
+#define CK_MANAGER_INTERFACE "org.freedesktop.ConsoleKit.Manager"
+#define CK_SESSION_INTERFACE "org.freedesktop.ConsoleKit.Session"
+
+static DBusConnection *private_connection = NULL;
+
+static void
+add_param_int (DBusMessageIter *iter_struct,
+ const char *key,
+ int value)
+{
+ DBusMessageIter iter_struct_entry;
+ DBusMessageIter iter_var;
+
+ dbus_message_iter_open_container (iter_struct,
+ DBUS_TYPE_STRUCT,
+ NULL,
+ &iter_struct_entry);
+
+ dbus_message_iter_append_basic (&iter_struct_entry,
+ DBUS_TYPE_STRING,
+ &key);
+
+ dbus_message_iter_open_container (&iter_struct_entry,
+ DBUS_TYPE_VARIANT,
+ DBUS_TYPE_INT32_AS_STRING,
+ &iter_var);
+
+ dbus_message_iter_append_basic (&iter_var,
+ DBUS_TYPE_INT32,
+ &value);
+
+ dbus_message_iter_close_container (&iter_struct_entry,
+ &iter_var);
+
+ dbus_message_iter_close_container (iter_struct, &iter_struct_entry);
+}
+
+static void
+add_param_boolean (DBusMessageIter *iter_struct,
+ const char *key,
+ int value)
+{
+ DBusMessageIter iter_struct_entry;
+ DBusMessageIter iter_var;
+
+ dbus_message_iter_open_container (iter_struct,
+ DBUS_TYPE_STRUCT,
+ NULL,
+ &iter_struct_entry);
+
+ dbus_message_iter_append_basic (&iter_struct_entry,
+ DBUS_TYPE_STRING,
+ &key);
+
+ dbus_message_iter_open_container (&iter_struct_entry,
+ DBUS_TYPE_VARIANT,
+ DBUS_TYPE_BOOLEAN_AS_STRING,
+ &iter_var);
+
+ dbus_message_iter_append_basic (&iter_var,
+ DBUS_TYPE_BOOLEAN,
+ &value);
+
+ dbus_message_iter_close_container (&iter_struct_entry,
+ &iter_var);
+
+ dbus_message_iter_close_container (iter_struct, &iter_struct_entry);
+}
+
+static void
+add_param_string (DBusMessageIter *iter_struct,
+ const char *key,
+ const char *value)
+{
+ DBusMessageIter iter_struct_entry;
+ DBusMessageIter iter_var;
+
+ dbus_message_iter_open_container (iter_struct,
+ DBUS_TYPE_STRUCT,
+ NULL,
+ &iter_struct_entry);
+
+ dbus_message_iter_append_basic (&iter_struct_entry,
+ DBUS_TYPE_STRING,
+ &key);
+
+ dbus_message_iter_open_container (&iter_struct_entry,
+ DBUS_TYPE_VARIANT,
+ DBUS_TYPE_STRING_AS_STRING,
+ &iter_var);
+
+ dbus_message_iter_append_basic (&iter_var,
+ DBUS_TYPE_STRING,
+ &value);
+
+ dbus_message_iter_close_container (&iter_struct_entry,
+ &iter_var);
+
+ dbus_message_iter_close_container (iter_struct, &iter_struct_entry);
+}
+
+static int
+session_get_x11_display (DBusConnection *connection,
+ const char *ssid,
+ char **str)
+{
+ DBusError error;
+ DBusMessage *message;
+ DBusMessage *reply;
+ DBusMessageIter iter;
+ const char *value;
+
+ if (str != NULL) {
+ *str = NULL;
+ }
+
+ message = dbus_message_new_method_call (CK_NAME,
+ ssid,
+ CK_SESSION_INTERFACE,
+ "GetX11Display");
+ if (message == NULL) {
+ Debug ("ConsoleKit: Couldn't allocate the D-Bus message");
+ return FALSE;
+ }
+
+ dbus_error_init (&error);
+ reply = dbus_connection_send_with_reply_and_block (connection,
+ message,
+ -1, &error);
+ if (dbus_error_is_set (&error)) {
+ Debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message);
+ reply = NULL;
+ }
+
+ dbus_connection_flush (connection);
+ dbus_message_unref (message);
+
+ if (reply == NULL) {
+ return FALSE;
+ }
+
+ dbus_message_iter_init (reply, &iter);
+ dbus_message_iter_get_basic (&iter, &value);
+ if (str != NULL) {
+ *str = strdup (value);
+ }
+ dbus_message_unref (reply);
+
+ return TRUE;
+}
+
+static int
+session_unlock (DBusConnection *connection,
+ const char *ssid)
+{
+ DBusError error;
+ DBusMessage *message;
+ DBusMessage *reply;
+
+ Debug ("ConsoleKit: Unlocking session %s", ssid);
+ message = dbus_message_new_method_call (CK_NAME,
+ ssid,
+ CK_SESSION_INTERFACE,
+ "Unlock");
+ if (message == NULL) {
+ Debug ("ConsoleKit: Couldn't allocate the D-Bus message");
+ return FALSE;
+ }
+
+ dbus_error_init (&error);
+ reply = dbus_connection_send_with_reply_and_block (connection,
+ message,
+ -1, &error);
+ dbus_message_unref (message);
+ dbus_message_unref (reply);
+ dbus_connection_flush (connection);
+
+ if (dbus_error_is_set (&error)) {
+ Debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* from libhal */
+static char **
+get_path_array_from_iter (DBusMessageIter *iter,
+ int *num_elements)
+{
+ int count;
+ char **buffer;
+
+ count = 0;
+ buffer = (char **)malloc (sizeof (char *) * 8);
+
+ if (buffer == NULL)
+ goto oom;
+
+ buffer[0] = NULL;
+ while (dbus_message_iter_get_arg_type (iter) == DBUS_TYPE_OBJECT_PATH) {
+ const char *value;
+ char *str;
+
+ if ((count % 8) == 0 && count != 0) {
+ buffer = realloc (buffer, sizeof (char *) * (count + 8));
+ if (buffer == NULL)
+ goto oom;
+ }
+
+ dbus_message_iter_get_basic (iter, &value);
+ str = strdup (value);
+ if (str == NULL)
+ goto oom;
+
+ buffer[count] = str;
+
+ dbus_message_iter_next (iter);
+ count++;
+ }
+
+ if ((count % 8) == 0) {
+ buffer = realloc (buffer, sizeof (char *) * (count + 1));
+ if (buffer == NULL)
+ goto oom;
+ }
+
+ buffer[count] = NULL;
+ if (num_elements != NULL)
+ *num_elements = count;
+ return buffer;
+
+oom:
+ LogWarn ("%s %d : error allocating memory\n", __FILE__, __LINE__);
+ return NULL;
+
+}
+
+static char **
+get_sessions_for_user (DBusConnection *connection,
+ const char *user,
+ const char *x11_display)
+{
+ DBusError error;
+ DBusMessage *message;
+ DBusMessage *reply;
+ DBusMessageIter iter;
+ DBusMessageIter iter_reply;
+ DBusMessageIter iter_array;
+ struct passwd *pwent;
+ char **sessions;
+
+ sessions = NULL;
+ message = NULL;
+ reply = NULL;
+
+ pwent = getpwnam (user);
+
+ dbus_error_init (&error);
+ message = dbus_message_new_method_call (CK_NAME,
+ CK_MANAGER_PATH,
+ CK_MANAGER_INTERFACE,
+ "GetSessionsForUser");
+ if (message == NULL) {
+ Debug ("ConsoleKit: Couldn't allocate the D-Bus message");
+ goto out;
+ }
+
+ dbus_message_iter_init_append (message, &iter);
+ dbus_message_iter_append_basic (&iter,
+ DBUS_TYPE_UINT32,
+ &pwent->pw_uid);
+
+ dbus_error_init (&error);
+ reply = dbus_connection_send_with_reply_and_block (connection,
+ message,
+ -1, &error);
+ dbus_connection_flush (connection);
+
+ if (dbus_error_is_set (&error)) {
+ Debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message);
+ goto out;
+ }
+
+ if (reply == NULL) {
+ Debug ("ConsoleKit: No reply for GetSessionsForUser");
+ goto out;
+ }
+
+ dbus_message_iter_init (reply, &iter_reply);
+ if (dbus_message_iter_get_arg_type (&iter_reply) != DBUS_TYPE_ARRAY) {
+ Debug ("ConsoleKit: Wrong reply for GetSessionsForUser - expecting an array.");
+ goto out;
+ }
+
+ dbus_message_iter_recurse (&iter_reply, &iter_array);
+ sessions = get_path_array_from_iter (&iter_array, NULL);
+
+ out:
+ if (message != NULL) {
+ dbus_message_unref (message);
+ }
+ if (reply != NULL) {
+ dbus_message_unref (reply);
+ }
+
+ return sessions;
+}
+
+void
+unlock_ck_session (const char *user,
+ const char *x11_display)
+{
+ DBusError error;
+ DBusConnection *connection;
+ char **sessions;
+ int i;
+
+ Debug ("ConsoleKit: Unlocking session for %s on %s", user, x11_display);
+
+ dbus_error_init (&error);
+ connection = dbus_bus_get (DBUS_BUS_SYSTEM, &error);
+ if (connection == NULL) {
+ Debug ("ConsoleKit: Failed to connect to the D-Bus daemon: %s", error.message);
+ dbus_error_free (&error);
+ return;
+ }
+
+ sessions = get_sessions_for_user (connection, user, x11_display);
+ if (sessions == NULL || sessions[0] == NULL) {
+ Debug ("ConsoleKit: no sessions found");
+ return;
+ }
+
+ for (i = 0; sessions[i] != NULL; i++) {
+ char *ssid;
+ char *xdisplay;
+
+ ssid = sessions[i];
+ session_get_x11_display (connection, ssid, &xdisplay);
+ Debug ("ConsoleKit: session %s has DISPLAY %s", ssid, xdisplay);
+
+ if (xdisplay != NULL
+ && x11_display != NULL
+ && strcmp (xdisplay, x11_display) == 0) {
+ int res;
+
+ res = session_unlock (connection, ssid);
+ if (! res) {
+ LogError ("ConsoleKit: Unable to unlock %s", ssid);
+ }
+ }
+
+ free (xdisplay);
+ }
+
+ freeStrArr (sessions);
+}
+
+char *
+open_ck_session (struct passwd *pwent,
+ struct display *d)
+{
+ DBusConnection *connection;
+ DBusError error;
+ DBusMessage *message;
+ DBusMessage *reply;
+ DBusMessageIter iter;
+ DBusMessageIter iter_struct;
+ char *cookie;
+
+ cookie = NULL;
+
+ Debug ("ConsoleKit: Opening session for %s", pwent->pw_name);
+
+ dbus_error_init (&error);
+ connection = dbus_bus_get_private (DBUS_BUS_SYSTEM, &error);
+ private_connection = connection;
+
+ if (connection == NULL) {
+ Debug ("ConsoleKit: Failed to connect to the D-Bus daemon: %s", error.message);
+ dbus_error_free (&error);
+ return NULL;
+ }
+
+ dbus_connection_set_exit_on_disconnect (connection, FALSE);
+ /* FIXME: What to do about these?
+ dbus_connection_set_watch_functions( connection,
+ dbusAddWatch,
+ dbusRemoveWatch,
+ dbusToggleWatch,
+ data, 0 );
+ dbus_connection_set_timeout_functions( connection,
+ dbusAddTimeout,
+ dbusRemoveTimeout,
+ dbusToggleTimeout,
+ data, 0 );
+ dbus_connection_set_wakeup_main_function( connection,
+ dbusWakeupMain,
+ data, 0 ); */
+
+ dbus_error_init (&error);
+ message = dbus_message_new_method_call (CK_NAME,
+ CK_MANAGER_PATH,
+ CK_MANAGER_INTERFACE,
+ "OpenSessionWithParameters");
+ if (message == NULL) {
+ Debug ("ConsoleKit: Couldn't allocate the D-Bus message");
+ return NULL;
+ }
+
+ dbus_message_iter_init_append (message, &iter);
+ dbus_message_iter_open_container (&iter,
+ DBUS_TYPE_ARRAY,
+ DBUS_STRUCT_BEGIN_CHAR_AS_STRING
+ DBUS_TYPE_STRING_AS_STRING
+ DBUS_TYPE_VARIANT_AS_STRING
+ DBUS_STRUCT_END_CHAR_AS_STRING,
+ &iter_struct);
+
+ add_param_int (&iter_struct, "user", pwent->pw_uid);
+ add_param_string (&iter_struct, "x11-display", d->name);
+ add_param_boolean (&iter_struct, "is-local", ((d->displayType & d_location) == dLocal));
+#ifdef XDMCP
+ if (d->status == remoteLogin && !((d->displayType & d_location) == dLocal)) {
+ add_param_string (&iter_struct, "remote-host-name", d->remoteHost);
+ }
+#endif
+
+#ifdef HAVE_VTS
+ if (d->serverVT > 0) {
+ char device[20];
+
+ /* FIXME: how does xorg construct this */
+ sprintf(device, "/dev/tty%d", d->serverVT);
+ add_param_string (&iter_struct, "x11-display-device", device);
+ }
+#endif
+
+ dbus_message_iter_close_container (&iter, &iter_struct);
+
+ reply = dbus_connection_send_with_reply_and_block (connection,
+ message,
+ -1, &error);
+ if (dbus_error_is_set (&error)) {
+ Debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message);
+ reply = NULL;
+ }
+
+ dbus_connection_flush (connection);
+
+ dbus_message_unref (message);
+ dbus_error_free (&error);
+
+ if (reply != NULL) {
+ const char *value;
+
+ dbus_message_iter_init (reply, &iter);
+ dbus_message_iter_get_basic (&iter, &value);
+ cookie = strdup (value);
+ dbus_message_unref (reply);
+ }
+
+ return cookie;
+}
+
+void
+close_ck_session (const char *cookie)
+{
+ DBusError error;
+ DBusMessage *message;
+ DBusMessage *reply;
+ DBusMessageIter iter;
+
+ if (cookie == NULL) {
+ return;
+ }
+
+ if (private_connection == NULL) {
+ return;
+ }
+
+ dbus_error_init (&error);
+ message = dbus_message_new_method_call (CK_NAME,
+ CK_MANAGER_PATH,
+ CK_MANAGER_INTERFACE,
+ "CloseSession");
+ if (message == NULL) {
+ Debug ("ConsoleKit: Couldn't allocate the D-Bus message");
+ return;
+ }
+
+ dbus_message_iter_init_append (message, &iter);
+ dbus_message_iter_append_basic (&iter,
+ DBUS_TYPE_STRING,
+ &cookie);
+
+ reply = dbus_connection_send_with_reply_and_block (private_connection,
+ message,
+ -1, &error);
+ if (dbus_error_is_set (&error)) {
+ Debug ("ConsoleKit: %s raised:\n %s\n\n", error.name, error.message);
+ reply = NULL;
+ }
+
+ dbus_connection_flush (private_connection);
+
+ dbus_message_unref (message);
+ dbus_error_free (&error);
+
+ dbus_connection_close (private_connection);
+ private_connection = NULL;
+}
Index: kdm/backend/consolekit.h
===================================================================
--- /dev/null
+++ kdm/backend/consolekit.h
@@ -0,0 +1,36 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+ *
+ * Copyright (C) 2006 William Jon McCann <mccann@jhu.edu>
+ * Copyright (C) 2007 Kevin Kofler <Kevin@tigcc.ticalc.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+
+#ifndef __CONSOLE_KIT_H
+#define __CONSOLE_KIT_H
+
+#include <pwd.h>
+
+struct display;
+
+char * open_ck_session (struct passwd *pwent,
+ struct display *display);
+void close_ck_session (const char *cookie);
+void unlock_ck_session (const char *user,
+ const char *x11_display);
+
+#endif /* __CONSOLE_KIT_H */
Index: kdm/backend/dm.h
===================================================================
--- kdm/backend/dm.h.orig
+++ kdm/backend/dm.h
@@ -37,6 +37,8 @@ from the copyright holder.
#ifndef _DM_H_
#define _DM_H_ 1
+#define WITH_CONSOLE_KIT
+
#include "greet.h"
#include <config.ci>
@@ -476,7 +478,11 @@ char **GRecvArgv( void );
#define GCONV_BINARY 5
typedef char *(*GConvFunc)( int what, const char *prompt );
int Verify( GConvFunc gconv, int rootok );
+#ifdef WITH_CONSOLE_KIT
+int StartClient( const char *ck_session_cookie );
+#else
int StartClient( void );
+#endif
void SessionExit( int status ) ATTR_NORETURN;
int ReadDmrc( void );
extern char **userEnviron, **systemEnviron;
Index: kdm/backend/Imakefile
===================================================================
--- kdm/backend/Imakefile.orig
+++ kdm/backend/Imakefile
@@ -155,13 +155,13 @@ PROCTITLE_DEFINES = -DHAS_SETPROCTITLE
netaddr.c reset.c resource.c protodpy.c policy.c \
session.c socket.c streams.c util.c xdmcp.c \
process.c mitauth.c \
- genauth.c access.c choose.c \
+ genauth.c access.c choose.c consolekit.c \
$(XDMAUTHSRCS) $(RPCSRCS) $(KRB5SRCS)
COMMOBJS = auth.o daemon.o server.o dpylist.o dm.o error.o \
netaddr.o reset.o resource.o protodpy.o policy.o \
session.o socket.o streams.o util.o xdmcp.o \
process.o mitauth.o \
- genauth.o access.o choose.o \
+ genauth.o access.o choose.o consolekit.o \
$(XDMAUTHOBJS) $(RPCOBJS) $(KRB5OBJS)
SRCS1 = $(COMMSRCS) client.c
Index: kdm/backend/Makefile.am
===================================================================
--- kdm/backend/Makefile.am.orig
+++ kdm/backend/Makefile.am
@@ -1,6 +1,6 @@
# forcibly remove thread-related defines & flags
AUTOMAKE_OPTIONS = foreign
-AM_CPPFLAGS = $(USER_INCLUDES) $(X_INCLUDES) $(KRB4_INCS) $(KRB5_INCS) -I.. -I../..
+AM_CPPFLAGS = -DWITH_CONSOLE_KIT=1 $(USER_INCLUDES) $(X_INCLUDES) $(KRB4_INCS) $(KRB5_INCS) $(DBUS_INCS) -I.. -I../..
bin_PROGRAMS = kdm
kdm_SOURCES = \
@@ -9,6 +9,7 @@ kdm_SOURCES = \
bootman.c \
choose.c \
client.c \
+ consolekit.c \
ctrl.c \
daemon.c \
dm.c \
@@ -37,7 +38,7 @@ kdm_SOURCES = \
kdm_LDFLAGS = $(USER_LDFLAGS) $(X_LDFLAGS) $(X_RPATH) $(KRB4_RPATH) $(KRB5_RPATH)
kdm_LDADD = $(LIB_X11) -lXau $(LIBXDMCP) $(PASSWDLIBS) \
$(LIB_LIBS) $(KRB4_LIBS) $(KRB5_LIBS) $(LIBSOCKET) $(LIBRESOLV) \
- $(LIBUCB) $(LIBUTIL) $(LIBPOSIX4)
+ $(DBUS_LIBS) $(LIBUCB) $(LIBUTIL) $(LIBPOSIX4)
EXTRA_DIST = printf.c
Index: kdm/backend/session.c
===================================================================
--- kdm/backend/session.c.orig
+++ kdm/backend/session.c
@@ -45,6 +45,10 @@ from the copyright holder.
#include <ctype.h>
#include <signal.h>
+#ifdef WITH_CONSOLE_KIT
+#include "consolekit.h"
+#endif
+
struct display *td;
const char *td_setup = "auto";
@@ -530,6 +534,9 @@ ManageSession( struct display *d )
int ex, cmd;
volatile int clientPid = 0;
volatile Time_t tdiff = 0;
+#ifdef WITH_CONSOLE_KIT
+ char *ck_session_cookie;
+#endif
td = d;
Debug( "ManageSession %s\n", d->name );
@@ -626,7 +633,12 @@ ManageSession( struct display *d )
if (td_setup)
SetupDisplay( td_setup );
+#ifdef WITH_CONSOLE_KIT
+ ck_session_cookie = open_ck_session (getpwnam(curuser), d);
+ if (!(clientPid = StartClient(ck_session_cookie))) {
+#else
if (!(clientPid = StartClient())) {
+#endif
LogError( "Client start failed\n" );
SessionExit( EX_NORMAL ); /* XXX maybe EX_REMANAGE_DPY? -- enable in dm.c! */
}
@@ -648,6 +660,14 @@ ManageSession( struct display *d )
catchTerm( SIGTERM );
}
}
+
+#ifdef WITH_CONSOLE_KIT
+ if (ck_session_cookie != NULL) {
+ close_ck_session (ck_session_cookie);
+ free (ck_session_cookie);
+ }
+#endif
+
/*
* Sometimes the Xsession somehow manages to exit before
* a server crash is noticed - so we sleep a bit and wait
Index: kdm/configure.in.in
===================================================================
--- kdm/configure.in.in.orig
+++ kdm/configure.in.in
@@ -240,4 +240,51 @@ if test "x$with_kdm_xconsole" = xyes; th
AC_DEFINE(WITH_KDM_XCONSOLE, 1, [Build kdm with built-in xconsole])
fi
+########### Check for DBus
+
+ AC_MSG_CHECKING(for DBus)
+
+ dbus_inc=NOTFOUND
+ dbus_lib=NOTFOUND
+ dbus=NOTFOUND
+
+ search_incs="$kde_includes $kde_extra_includes /usr/include /usr/include/dbus-1.0 /usr/local/include /usr/local/include/dbus-1.0"
+ AC_FIND_FILE(dbus/dbus.h, $search_incs, dbus_incdir)
+
+ search_incs_arch_deps="$kde_includes $kde_extra_includes /usr/lib$kdelibsuff/dbus-1.0/include /usr/local/lib$kdelibsuff/dbus-1.0/include"
+ AC_FIND_FILE(dbus/dbus-arch-deps.h, $search_incs_arch_deps, dbus_incdir_arch_deps)
+
+ if test -r $dbus_incdir/dbus/dbus.h && test -r $dbus_incdir_arch_deps/dbus/dbus-arch-deps.h ; then
+ DBUS_INCS="-I$dbus_incdir -I$dbus_incdir_arch_deps"
+ dbus_inc=FOUND
+ fi
+
+ search_libs="$kde_libraries $kde_extra_libs /usr/lib$kdelibsuff /usr/local/lib$kdelibsuff"
+ AC_FIND_FILE(libdbus-1.so, $search_libs, dbus_libdir)
+
+ if test -r $dbus_libdir/libdbus-1.so ; then
+ DBUS_LIBS="-L$dbus_libdir -ldbus-1"
+ dbus_lib=FOUND
+ fi
+
+ if test $dbus_inc != FOUND || test $dbus_lib != FOUND ; then
+ KDE_PKG_CHECK_MODULES( DBUS, "dbus-1", [ DBUS_INCS=$DBUS_CFLAGS; dbus_inc=FOUND; dbus_lib=FOUND; ] , AC_MSG_RESULT( Nothing found on PKG_CONFIG_PATH ) )
+ fi
+
+ dbus_bus_var=`pkg-config --variable=system_bus_default_address dbus-1 2>/dev/null`
+ if test -z "$dbus_bus_var"; then
+ dbus_bus_var="unix:path=/var/run/dbus/system_bus_socket"
+ fi
+ AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS, "$dbus_bus_var", [Define the unix domain path for dbus system bus])
+
+ if test $dbus_inc = FOUND && test $dbus_lib = FOUND ; then
+ AC_MSG_RESULT(headers $DBUS_INCS libraries $DBUS_LIBS)
+ dbus=FOUND
+ else
+ AC_MSG_RESULT(searched but not found)
+ fi
+
+ AC_SUBST(DBUS_INCS)
+ AC_SUBST(DBUS_LIBS)
+
dnl AC_OUTPUT(kdm/kfrontend/sessions/kde.desktop)

@ -0,0 +1,27 @@
Index: kdm/backend/bootman.c
===================================================================
--- kdm/backend/bootman.c.orig
+++ kdm/backend/bootman.c
@@ -132,19 +132,14 @@ setGrub( const char *opt, SdRec *sdr )
static void
commitGrub( void )
{
- FILE *f;
- int pid;
- static const char *args[] = { 0, "--batch", "--no-floppy", 0 };
+ char buffer[PATH_MAX];
if (sdRec.bmstamp != mTime( GRUB_MENU ) &&
setGrub( sdRec.osname, &sdRec ) != BO_OK)
return;
- args[0] = grub;
- if ((f = pOpen( (char **)args, 'w', &pid ))) {
- fprintf( f, "savedefault --default=%d --once\n", sdRec.osindex );
- pClose( f, pid );
- }
+ snprintf(buffer, PATH_MAX, "/usr/sbin/grubonce %d", sdRec.osindex);
+ system(buffer);
}
static char *lilo;

File diff suppressed because it is too large Load Diff

@ -0,0 +1,13 @@
Index: kdm/backend/client.c
===================================================================
--- kdm/backend/client.c.orig
+++ kdm/backend/client.c
@@ -1214,6 +1214,8 @@ StartClient()
env = setEnv( env, "PATH", curuid ? td->userPath : td->systemPath );
env = setEnv( env, "SHELL", p->pw_shell );
env = setEnv( env, "HOME", p->pw_dir );
+ if (cursource == PWSRC_AUTOLOGIN)
+ env = setEnv (env, "KDM_AUTOLOGIN", curuser);
#if !defined(USE_PAM) && !defined(_AIX) && defined(KERBEROS)
if (krbtkfile[0] != '\0')
env = setEnv( env, "KRBTKFILE", krbtkfile );

@ -0,0 +1,7 @@
#%PAM-1.0
auth required pam_permit.so
account include common-account
password include common-password
session include common-session
session required pam_devperm.so
session required pam_resmgr.so

@ -0,0 +1,22 @@
Index: kdm/backend/auth.c
===================================================================
--- kdm/backend/auth.c.orig
+++ kdm/backend/auth.c
@@ -518,6 +518,7 @@ DefineLocal( FILE *file, Xauth *auth, in
uname( &name );
writeAddr( FamilyLocal, strlen( name.nodename ), name.nodename,
file, auth, ok );
+ setenv("XAUTHLOCALHOSTNAME", name.nodename, 1);
#endif
#if !defined(NEED_UTSNAME) || defined(__hpux)
@@ -1211,6 +1212,9 @@ SetUserAuthorization( struct display *d
userEnviron = setEnv( userEnviron, "XAUTHORITY", envname );
systemEnviron = setEnv( systemEnviron, "XAUTHORITY", envname );
}
+ name = getenv("XAUTHLOCALHOSTNAME");
+ if (name)
+ userEnviron = setEnv( userEnviron, "XAUTHLOCALHOSTNAME", name);
/* a chown() used to be here, but this code runs as user anyway */
}
Debug( "done SetUserAuthorization\n" );

@ -0,0 +1,331 @@
Index: kdm/backend/ctrl.c
===================================================================
--- kdm/backend/ctrl.c.orig
+++ kdm/backend/ctrl.c
@@ -483,6 +483,10 @@ processCtrl( const char *string, int len
Reply( "nuke\t" );
}
}
+ if (d->allowSuspend != SHUT_NONE) {
+ Reply( "suspend\t" );
+ }
+
if ((d->displayType & d_location) == dLocal &&
AnyReserveDisplays())
Writer( fd, cbuf, sprintf( cbuf, "reserve %d\t",
Index: kdm/backend/greet.h
===================================================================
--- kdm/backend/greet.h.orig
+++ kdm/backend/greet.h
@@ -125,6 +125,7 @@ from the copyright holder.
# define SHUT_REBOOT 1 /* how */
# define SHUT_HALT 2
# define SHUT_CONSOLE -1 /* pseudo-code */
+# define SHUT_SUSPEND -2 /* pseudo-code */
# define SHUT_SCHEDULE 0 /* when; config only */
# define SHUT_TRYNOW 1
# define SHUT_FORCENOW 2
Index: kdm/config.def
===================================================================
--- kdm/config.def.orig
+++ kdm/config.def
@@ -1799,6 +1799,19 @@ Description:
Who is allowed to shut down the system. This applies both to the
greeter and to the command <acronym>FiFo</acronym>.
+Key: AllowSuspend
+Type: enum
+ None/SHUT_NONE: no <guilabel>Suspend...</guilabel> menu entry is shown at all
+ Root/SHUT_ROOT: the <systemitem class="username">root</systemitem> password must be entered to suspend
+ All/SHUT_ALL: everybody can suspend the machine
+Default: Root
+User: greeter
+User: core
+Instance: #:0/All
+Comment: &
+Description:
+ If the user should have an option to suspend the system if configured to (also in the desktop)
+
Key: AllowSdForceNow
Type: enum
None: no forced shutdown is allowed at all
Index: kdm/kfrontend/kdmshutdown.cpp
===================================================================
--- kdm/kfrontend/kdmshutdown.cpp.orig
+++ kdm/kfrontend/kdmshutdown.cpp
@@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fi
*/
+#include <liblazy.h>
#include "kdmshutdown.h"
#include "kdm_greet.h"
@@ -34,6 +35,7 @@ Foundation, Inc., 51 Franklin Street, Fi
#include <kdialog.h>
#include <kstandarddirs.h>
#include <kuser.h>
+#include <kdebug.h>
#include <qcombobox.h>
#include <qvbuttongroup.h>
@@ -57,6 +59,10 @@ Foundation, Inc., 51 Franklin Street, Fi
int KDMShutdownBase::curPlugin = -1;
PluginList KDMShutdownBase::pluginList;
+#define DBUS_HAL_INTERFACE "org.freedesktop.Hal"
+#define DBUS_HAL_SYSTEM_POWER_INTERFACE "org.freedesktop.Hal.Device.SystemPowerManagement"
+#define HAL_UDI_COMPUTER "/org/freedesktop/Hal/devices/computer"
+
KDMShutdownBase::KDMShutdownBase( int _uid, QWidget *_parent )
: inherited( _parent )
, box( new QVBoxLayout( this, KDmh, KDsh ) )
@@ -71,6 +77,7 @@ KDMShutdownBase::KDMShutdownBase( int _u
, verify( 0 )
, needRoot( -1 )
, uid( _uid )
+ , willSuspend( false )
{
}
@@ -87,6 +94,7 @@ KDMShutdownBase::complete( QWidget *prev
if (uid &&
((willShut && _allowShutdown == SHUT_ROOT) ||
+ ( willSuspend && _allowSuspend == SHUT_ROOT ) ||
(mayNuke && _allowNuke == SHUT_ROOT)))
{
rootlab = new QLabel( i18n("Root authorization required."), this );
@@ -169,6 +177,7 @@ KDMShutdownBase::updateNeedRoot()
{
int nNeedRoot = uid &&
(((willShut && _allowShutdown == SHUT_ROOT) ||
+ ( willSuspend && _allowSuspend == SHUT_ROOT ) ||
(_allowNuke == SHUT_ROOT && doesNuke)));
if (verify && nNeedRoot != needRoot) {
if (needRoot == 1)
@@ -425,7 +434,7 @@ KDMRadioButton::mouseDoubleClickEvent( Q
KDMDelayedPushButton::KDMDelayedPushButton( const KGuiItem &item,
- QWidget *parent,
+ QWidget *parent,
const char *name )
: inherited( item, parent, name )
, pop( 0 )
@@ -490,6 +499,57 @@ KDMSlimShutdown::KDMSlimShutdown( QWidge
buttonlay->addWidget( btnReboot );
connect( btnReboot, SIGNAL(clicked()), SLOT(slotReboot()) );
+ if ( _allowSuspend != SHUT_NONE )
+ {
+ int supported = -1;
+ liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_suspend", &supported);
+ if (supported == 1)
+ suspend_ram = true;
+ else
+ suspend_ram = false;
+
+ liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_standby", &supported);
+ if (supported == 1)
+ standby = true;
+ else
+ standby = false;
+ liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_hibernate", &supported);
+ if (supported == 1)
+ suspend_disk = true;
+ else
+ suspend_disk = false;
+
+/* if (liblazy_polkit_is_user_allowed_by_uid(0, "hal-power-hibernate", NULL) != 1)
+ suspend_disk = false;
+ if (liblazy_polkit_is_user_allowed_by_uid(0, "hal-power-suspend", NULL) != 1)
+ suspend_ram = false;
+ if (liblazy_polkit_is_user_allowed_by_uid(0, "hal-power-standby", NULL) != 1)
+ standby = false;
+*/
+ int sum = standby + suspend_ram + suspend_disk;
+ if ( sum ) {
+ buttonlay->addSpacing( KDialog::spacingHint() );
+
+ QButton *btnSuspend;
+ if (sum > 1) {
+ btnSuspend = new KDMDelayedPushButton( KGuiItem( i18n("&Suspend Computer"), "player_pause"), this );
+ QPopupMenu *suspends = new QPopupMenu(this);
+ if (suspend_disk)
+ suspends->insertItem(i18n("Suspend to Disk"), 1);
+ if (suspend_ram)
+ suspends->insertItem(i18n("Suspend to RAM"), 2);
+ if (standby)
+ suspends->insertItem(i18n("Standby"), 3);
+ connect(suspends, SIGNAL(activated(int)), SLOT(slotSuspend(int)));
+ static_cast<KDMDelayedPushButton*>(btnSuspend)->setPopup(suspends);
+ } else {
+ btnSuspend = new KPushButton( KGuiItem( i18n("&Suspend Computer"), "player_pause"), this );
+ }
+ buttonlay->addWidget( btnSuspend );
+ connect(btnSuspend, SIGNAL(clicked()), SLOT(slotSuspend()));
+ }
+ }
+
GSet( 1 );
GSendInt( G_ListBootOpts );
if (GRecvInt() == BO_OK) {
@@ -536,6 +596,65 @@ KDMSlimShutdown::~KDMSlimShutdown()
freeStrArr( targetList );
}
+void KDMSlimShutdown::slotSuspend()
+{
+ if (suspend_disk)
+ slotSuspend( 1 );
+ else if (suspend_ram)
+ slotSuspend( 2 );
+ else if ( standby )
+ slotSuspend( 3 );
+ else
+ reject();
+}
+
+void KDMSlimShutdown::slotSuspend(int id)
+{
+ reject();
+ // dpySpec *sess = fetchSessions( lstRemote | lstTTY );
+ // it would be nice to show the sessions to suspend, but it
+ // would require string changes (coolo)
+ dpySpec *sess = 0;
+ kdDebug() << "slotSuspend " << _allowSuspend << endl;
+ if (sess || _allowSuspend == SHUT_ROOT)
+ {
+ int ret = KDMConfShutdown( -1, sess, SHUT_SUSPEND, 0 ).exec();
+ if ( !ret )
+ return;
+ }
+
+ int error = 0;
+ int wake = 0;
+ DBusMessage *reply;
+
+ if (suspend_disk && id == 1) {
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Hibernate",
+ &reply,
+ DBUS_TYPE_INVALID);
+ } else if (suspend_ram && id == 2)
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Suspend",
+ &reply,
+ DBUS_TYPE_INT32,
+ &wake,
+ DBUS_TYPE_INVALID);
+ else if (standby && id == 3)
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Standby",
+ &reply,
+ DBUS_TYPE_INVALID);
+ else {
+ return;
+ }
+}
+
void
KDMSlimShutdown::slotSched()
{
@@ -601,16 +720,27 @@ KDMConfShutdown::KDMConfShutdown( int _u
if (type == SHUT_CONSOLE)
willShut = false;
#endif
+ QString title;
+ if ( type == SHUT_HALT)
+ title = i18n("Turn Off Computer");
+ else {
+#ifdef HAVE_VTS
+ if ( type == SHUT_CONSOLE)
+ title = i18n("Switch to Console");
+ else
+#endif
+ if ( type == SHUT_SUSPEND ) {
+ willSuspend = true;
+ title = i18n( "Suspend Computer" );
+ }
+ else
+ title = i18n("Restart Computer");
+ }
+
box->addWidget( new QLabel( QString( "<qt><center><b><nobr>"
"%1%2"
"</nobr></b></center><br></qt>" )
- .arg( (type == SHUT_HALT) ?
- i18n("Turn Off Computer") :
-#ifdef HAVE_VTS
- (type == SHUT_CONSOLE) ?
- i18n("Switch to Console") :
-#endif
- i18n("Restart Computer") )
+ .arg( title )
.arg( os ?
i18n("<br>(Next boot: %1)")
.arg( QString::fromLocal8Bit( os ) ) :
Index: kdm/kfrontend/kdmshutdown.h
===================================================================
--- kdm/kfrontend/kdmshutdown.h.orig
+++ kdm/kfrontend/kdmshutdown.h
@@ -67,7 +67,7 @@ class KDMShutdownBase : public FDialog,
#else
static const bool willShut = true;
#endif
- bool mayNuke, doesNuke, mayOk, maySched;
+ bool mayNuke, doesNuke, mayOk, maySched, willSuspend;
private slots:
void slotSched();
@@ -118,7 +118,6 @@ class KDMShutdown : public KDMShutdownBa
QComboBox *targets;
int oldTarget;
int sch_st, sch_to;
-
};
class KDMRadioButton : public QRadioButton {
@@ -168,10 +167,13 @@ class KDMSlimShutdown : public FDialog {
void slotReboot();
void slotReboot( int );
void slotSched();
+ void slotSuspend();
+ void slotSuspend(int);
private:
bool checkShutdown( int type, const char *os );
char **targetList;
+ bool suspend_disk, suspend_ram, standby;
};
Index: kdm/kfrontend/Makefile.am
===================================================================
--- kdm/kfrontend/Makefile.am.orig
+++ kdm/kfrontend/Makefile.am
@@ -4,7 +4,7 @@ GENKDMCONF_FLAGS =
SUBDIRS = themer themes pics sessions
AM_CPPFLAGS = -I$(srcdir)/../backend -I.. -I$(top_srcdir)/kcontrol/background \
- -I$(top_srcdir)/kdmlib $(all_includes)
+ -I$(top_srcdir)/kdmlib $(all_includes) $(DBUS_INCS)
bin_PROGRAMS = kdm_config kdm_greet krootimage genkdmconf kdmctl
@@ -25,7 +25,7 @@ kdm_greet_SOURCES = \
kgreeter.cpp \
kgapp.cpp
kdm_greet_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-kdm_greet_LDADD = themer/libkdmthemer.a $(LIB_KDEUI) $(XTESTLIB) $(LIBPOSIX4)
+kdm_greet_LDADD = themer/libkdmthemer.a $(LIB_KDEUI) $(XTESTLIB) $(LIBPOSIX4) -llazy $(DBUS_LIBS)
krootimage_SOURCES = krootimage.cpp
krootimage_LDFLAGS = $(all_libraries) $(KDE_RPATH)

@ -0,0 +1,737 @@
Index: kdm/config.def
===================================================================
--- kdm/config.def.orig
+++ kdm/config.def
@@ -792,6 +792,21 @@ Description:
<emphasis>Do not</emphasis> change it, you may interfere with future
upgrades and this could result in &kdm; failing to run.
+Key: SUSEConfigVersion
+Type: string
+Default: ""
+CDefault: -
+User: dummy
+# will be overwritten
+Instance:
+Comment:
+ This option exists solely for the purpose of a clean automatic upgrade.
+ Do not even think about changing it!
+Description:
+ This option exists solely for the purpose of clean automatic upgrades.
+ <emphasis>Do not</emphasis> change it, you may interfere with future
+ upgrades and this could result in &kdm; failing to run.
+
Key: PAMService
If: defined(USE_PAM)
Type: string
@@ -874,10 +889,10 @@ Description:
Key: PidFile
Type: string
-Default: ""
+Default: "/var/run/kdm.pid"
User: core
-Instance: "/var/run/kdm.pid"
-Merge: xdm
+Instance: ""
+Update: reset_sec_0_1
Comment:
Where &kdm; should store its PID (do not store if empty).
Description:
@@ -901,10 +916,10 @@ Description:
Key: AuthDir
Type: path
# differs from XDM
-Default: "/var/run/xauth"
+Default: "/var/lib/xdm/authdir/authfiles"
User: core
-Instance: #"/tmp"
-Merge: xdm(P_authDir)
+Instance: #""
+Update: reset_sec_0_1
Comment:
Where to store authorization files.
Description:
@@ -930,7 +945,7 @@ Description:
Key: ExportList
Type: list
-Default: ""
+Default: "LANG,XCURSOR_THEME"
User: core
Instance: #"LD_LIBRARY_PATH,ANOTHER_IMPORTANT_VAR"
Merge: xdm(P_List)
@@ -1063,9 +1078,10 @@ Description:
Key: Enable
Type: bool
-Default: true
+Default: false
User: dep(xdmcpEnable)
Instance: false
+Update: reset_sec_0_1
Comment: &
Description:
Whether &kdm; should listen to incoming &XDMCP; requests.
@@ -1102,11 +1118,10 @@ Description:
Key: Xaccess
Type: string
# differs from xdm
-Default: *KDMCONF "/Xaccess"
+Default: *"/etc/X11/xdm/Xaccess"
User: config(Xaccess)
-Instance: #""
-Update: mk_xaccess
-Merge: xdm:accessFile
+Instance: #
+Update: reset_sec_0_1
Comment:
&XDMCP; access control file in the usual XDM-Xaccess format.
Description:
@@ -1164,13 +1179,11 @@ Description:
Key: Willing
Type: string
-Default: ""
+Default: "/etc/X11/xdm/Xwilling"
User: core
# will be overwritten
Instance: #
-Update: mk_willing
-Merge: xdm
-Merge: kdm:Xwilling
+Update: reset_sec_0_1
Comment:
The program which is invoked to dynamically generate replies to &XDMCP;
DirectQuery or BroadcastQuery requests.
@@ -1244,7 +1257,7 @@ Type: enum
None/BO_NONE: no boot manager
Grub/BO_GRUB: Grub boot manager
Lilo/BO_LILO: Lilo boot manager (Linux on i386 &amp; x86-64 only)
-Default: None
+Default: Grub
User: core
User: greeter
Instance: #Grub
@@ -1347,6 +1360,7 @@ Default: DEF_SERVER_CMD
DDefault: -
User: core
Instance: :*/DEF_SERVER_CMD
+Update: reset_sec_0_1
Comment:
The command line to start the &X-Server;, without display number and VT spec.
This string is subject to word splitting.
@@ -1355,7 +1369,7 @@ Description:
This string is subject to word splitting.
</para><para>
The default is something reasonable for the system on which &kdm; was built,
- like <command>/usr/X11R6/bin/X</command>.
+ like <command>/usr/bin/X</command>.
Key: ServerArgsLocal
Type: string
@@ -1549,11 +1563,10 @@ Description:
Key: Resources
# XXX strictly speaking this is supposed to be a string list, i think.
Type: string
-Default: ""
+Default: "/etx/X11/xdm/Xresources"
User: core
Instance: #*/""
-Update: cp_resources
-Merge: xdm
+Update: reset_sec_0_1
Comment:
Specify a file with X-resources for the greeter, chooser and background.
The KDE frontend does not use this file, so you do not need it unless you
@@ -1581,12 +1594,11 @@ Description:
Key: Setup
Type: string
-Default: ""
+Default: "/etc/X11/xdm/Xsetup"
User: core
# will be overwritten
Instance: #*/""
-Update: mk_setup
-Merge: xdm
+Update: reset_sec_0_1
Comment:
A program to run before the greeter is shown. Can be used to start an
xconsole or an alternative background generator. Subject to word splitting.
@@ -1602,12 +1614,11 @@ Description:
Key: Startup
Type: string
-Default: ""
+Default: "/etc/X11/xdm/Xstartup"
User: core
# will be overwritten
Instance: #*/""
-Update: mk_startup
-Merge: xdm
+Update: reset_sec_0_1
Comment:
A program to run before a user session starts. Subject to word splitting.
Description:
@@ -1620,12 +1631,11 @@ Description:
Key: Reset
Type: string
-Default: ""
+Default: "/etc/X11/xdm/Xreset"
User: core
# will be overwritten
Instance: #*/""
-Update: mk_reset
-Merge: xdm
+Update: reset_sec_0_1
Comment:
A program to run after a user session exits. Subject to word splitting.
Description:
@@ -1638,12 +1648,12 @@ Description:
Key: Session
Type: string
-Default: XBINDIR "/xterm -ls -T"
+Default: "/etc/X11/xdm/Xsession"
#Merge: xdm - incompatible!
User: core
# will be overwritten
Instance: #*/""
-Update: mk_session
+Update: reset_sec_0_1
Comment:
The program which is run as the user which logs in. It is supposed to
interpret the session argument (see SessionsDirs) and start an appropriate
@@ -1746,10 +1756,11 @@ Description:
Key: AllowRootLogin
Type: bool
-Default: true
+Default: false
User: core
User: greeter(showRoot)
-Instance: */false
+Instance: #*/false
+Update: reset_sec_1_2
Merge: xdm
Comment:
Allow root logins?
@@ -1764,6 +1775,7 @@ User: core
# sensible?
Instance: */false
Instance: :*/true
+Update: reset_sec_0_1
Merge: xdm
Comment:
Allow to log in, when user has set an empty password?
@@ -1775,12 +1787,13 @@ Type: enum
None/SHUT_NONE: no <guilabel>Shutdown...</guilabel> menu entry is shown at all
Root/SHUT_ROOT: the <systemitem class="username">root</systemitem> password must be entered to shut down
All/SHUT_ALL: everybody can shut down the machine
-Default: All
+Default: Root
User: core
User: greeter
Instance: */Root
-Instance: :*/All
-Merge: kdm:-Greeter/
+Instance: #:*/All
+Update: reset_sec_0_1
+#Merge: kdm:-Greeter/
Comment: &
Description:
Who is allowed to shut down the system. This applies both to the
@@ -1866,6 +1879,7 @@ Type: bool
Default: false
User: dep
Instance: #:0/true
+Update: reset_sec_0_1
Comment: &
Description:
Enable automatic login. <emphasis>Use with extreme care!</emphasis>
@@ -1899,7 +1913,7 @@ Default: ""
PostProc: PautoLoginX
User: core(autoUser)
User: greeter
-Instance: #:0/"fred"
+Instance: #:0/""
Merge: xdm:autoUser(P_autoUser)
Comment: &
Description:
@@ -1930,10 +1944,10 @@ Description:
Key: SessionsDirs
Type: list
-Default: KDMDATA "/sessions"
+Default: "/etc/X11/sessions," KDMDATA "/sessions,/usr/share/xsessions"
User: core
User: greeter-c
-Instance: #*/"/etc/X11/sessions,/usr/share/xsessions"
+Instance: #*/""
Comment:
The directories containing session type definitions in .desktop format.
Description:
@@ -2008,7 +2022,8 @@ Type: enum
Clock/LOGO_CLOCK: a neat analog clock
Default: Clock
User: greeter
-Instance: */Logo
+Instance: */Clock
+Update: reset_sec_0_1
Comment:
What should be shown in the greeter's logo are:
Description:
@@ -2223,7 +2238,7 @@ Description:
Key: HiddenUsers
Type: list
-Default: ""
+Default: "root"
User: greeter-c(noUsers)
Instance: #*/"root"
# depends on {Min,Max}ShowUID
@@ -2363,13 +2378,14 @@ Type: enum
Default: OneStar
User: greeter
Instance: #*/NoEcho
+Update: reset_sec_0_1
Comment: &
Description:
The password input fields cloak the typed in text. Specify, how to do it:
Key: UseBackground
Type: bool
-Default: true
+Default: false
User: greeter
Instance: #*/!
Comment:
@@ -2507,6 +2523,7 @@ Type: bool
Default: false
User: greeter
Instance: :0/true
+Update: reset_sec_0_1
Comment:
Enable &kdm;'s built-in xconsole. Note that this can be enabled for only
one display at a time.
@@ -2595,9 +2612,10 @@ Description:
Key: Preloader
Type: string
-Default: ""
+Default: KDE_BINDIR "/preloadkde"
User: greeter-c
-Instance: */KDE_BINDIR "/preloadkde"
+Instance: */""
+Update: reset_sec_0_1
Comment: &
Description:
A program to run while the greeter is visible. It is supposed to preload
@@ -2606,7 +2624,7 @@ Description:
Key: UseTheme
Type: bool
-Default: false
+Default: true
User: greeter
Instance: #*/true
Comment: &
@@ -2615,9 +2633,10 @@ Description:
Key: Theme
Type: string
-Default: ""
+Default: KDMDATA "/themes/SUSE"
User: greeter
-Instance: */KDMDATA "/themes/circles"
+Instance: */""
+Update: reset_sec_0_1
Comment: &
Description:
The theme to use for the greeter. Can point to either a directory or an XML
Index: kdm/kfrontend/read_sysconfig.sh
===================================================================
--- /dev/null
+++ kdm/kfrontend/read_sysconfig.sh
@@ -0,0 +1,147 @@
+#!/bin/bash
+#
+# Copyright (c) 2006 SUSE Linux Products GmbH Nuernberg, Germany.
+#
+# Author: Stephan Kulow <coolo@suse.de>
+#
+
+#
+# check if we are started as root
+# only one of UID and USER must be set correctly
+#
+if test "$UID" != 0 -a "$USER" != root; then
+ echo "You must be root to start $0."
+ exit 1
+fi
+
+#
+# check for sysconfig/displaymanager or rc.config
+#
+test -f /etc/sysconfig/displaymanager && source /etc/sysconfig/displaymanager
+test -f /etc/sysconfig/security && source /etc/sysconfig/security
+test -f /etc/sysconfig/language && source /etc/sysconfig/language
+
+#
+# source /etc/profile to get $kdedir
+#
+kdedir="/opt/kde3"
+kdmdir="/var/adm/kdm"
+
+# check for write permissions
+[ -w ${kdmdir} ] || mkdir -p ${kdmdir}
+[ -w ${kdmdir} ] || exit
+
+#
+# Set Style of Shutdown
+#
+ECHO_MODE="OneStar"
+ALLOW_ROOT_LOGIN="true"
+case "$DISPLAYMANAGER_SHUTDOWN" in
+ all|ALL|All)
+ DISPLAYMANAGER_SHUTDOWN=All;;
+ none|NONE|None)
+ DISPLAYMANAGER_SHUTDOWN=None;;
+ auto|Auto|AUTO)
+ case "$PERMISSION_SECURITY" in
+ *easy*)
+ DISPLAYMANAGER_SHUTDOWN=All
+ ;;
+ *paranoid*)
+ ECHO_MODE="NoEcho"
+ ALLOW_ROOT_LOGIN="false"
+ DISPLAYMANAGER_SHUTDOWN=Root
+ ;;
+ *)
+ DISPLAYMANAGER_SHUTDOWN=Root
+ ;;
+ esac
+ ;;
+ * )
+ DISPLAYMANAGER_SHUTDOWN=Root;;
+esac
+
+(
+echo "[X-*-Greeter]"
+if [ -n "$KDM_USERS" ]; then
+ echo "ShowUsers=Selected"
+ echo -n "SelectedUsers="
+ echo ${KDM_USERS}|sed -e 's@ [ ]*@ @g' -e 's@ @,@g'
+else
+ echo "ShowUsers=NotHidden"
+fi
+if [ "$DISPLAYMANAGER_AD_INTEGRATION" = "yes" ]; then
+ echo "PluginsLogin=winbind"
+fi
+if [ -n "$DISPLAYMANAGER_KDM_THEME" -a -d "/opt/kde3/share/apps/kdm/themes/$DISPLAYMANAGER_KDM_THEME" ]; then
+ echo "Theme=/opt/kde3/share/apps/kdm/themes/$DISPLAYMANAGER_KDM_THEME"
+ echo "UseTheme=true"
+ echo "UseBackground=false"
+else
+ echo "UseTheme=false"
+ echo "UseBackground=true"
+fi
+# kdm has en_US as default instead of simply reading LC_LANG :(
+echo "Language="
+
+echo "[Xdmcp]"
+if [ "$DISPLAYMANAGER_REMOTE_ACCESS" = "yes" ]; then
+ echo "Enable=true"
+else
+ echo "Enable=false"
+fi
+
+echo "[X-:0-Core]"
+if [ "$DISPLAYMANAGER_AUTOLOGIN" ]; then
+ echo "AutoLoginEnable=true"
+ echo "AutoLoginUser=${DISPLAYMANAGER_AUTOLOGIN}"
+else
+ echo "AutoLoginEnable=false"
+fi
+if [ "$DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN" = "yes" ]; then
+ echo "ServerArgsLocal="
+else
+ echo "ServerArgsLocal=-nolisten tcp"
+fi
+if [ "$DISPLAYMANAGER_PASSWORD_LESS_LOGIN" = "yes" ]; then
+ echo "NoPassEnable=true"
+ echo "NoPassAllUsers=true"
+else
+ echo "NoPassEnable=false"
+ echo "NoPassAllUsers=false"
+fi
+
+echo "[X-:*-Core]"
+echo "AllowShutdown=${DISPLAYMANAGER_SHUTDOWN}"
+echo "AllowRootLogin=${ALLOW_ROOT_LOGIN}"
+echo "AllowNullPasswd=${ALLOW_ROOT_LOGIN}"
+
+echo "[X-*-Core]"
+
+if test "$DISPLAYMANAGER_ROOT_LOGIN_REMOTE" = "yes"; then
+ echo "AllowRootLogin=true"
+else
+ echo "AllowRootLogin=false"
+fi
+
+case "$DISPLAYMANAGER_XSERVER" in
+ Xgl)
+ xgl=`type -p Xgl`
+ echo "ServerCmd=$xgl $DISPLAYMANAGER_XGL_OPTS -br"
+ echo "ServerTimeout=50"
+ ;;
+ Xorg)
+ xorg=`type -p Xorg`
+ echo "ServerCmd=$xorg -br"
+ ;;
+ *)
+ echo "#Unknown X server - leaving X"
+ ;;
+esac
+
+echo "[General]"
+if [ "$DISPLAYMANAGER_STARTS_XSERVER" != "yes" ]; then
+ echo "StaticServers="
+fi
+
+) > ${kdmdir}/kdmrc.sysconfig
+
Index: kdm/kfrontend/kdm_config.c
===================================================================
--- kdm/kfrontend/kdm_config.c.orig
+++ kdm/kfrontend/kdm_config.c
@@ -386,7 +386,7 @@ static const char *kdmrc = KDMCONF "/kdm
static Section *rootsec;
static void
-ReadConf()
+ReadConfFile(const char *rcfile)
{
const char *nstr, *dstr, *cstr, *dhost, *dnum, *dclass;
char *s, *e, *st, *en, *ek, *sl, *pt;
@@ -396,14 +396,9 @@ ReadConf()
int nlen, dlen, clen, dhostl, dnuml, dclassl;
int i, line, sectmoan, restl;
File file;
- static int confread;
- if (confread)
- return;
- confread = 1;
-
- Debug( "reading config %s ...\n", kdmrc );
- if (!readFile( &file, kdmrc, "master configuration" ))
+ Debug( "reading config %s ...\n", rcfile );
+ if (!readFile( &file, rcfile, "master configuration" ))
return;
for (s = file.buf, line = 0, cursec = 0, sectmoan = 1; s < file.eof; s++) {
@@ -429,7 +424,7 @@ ReadConf()
e--;
if (*e != ']') {
cursec = 0;
- LogError( "Invalid section header at %s:%d\n", kdmrc, line );
+ LogError( "Invalid section header at %s:%d\n", rcfile, line );
continue;
}
nstr = sl + 1;
@@ -438,8 +433,8 @@ ReadConf()
if (nlen == cursec->nlen &&
!memcmp( nstr, cursec->name, nlen ))
{
- LogInfo( "Multiple occurrences of section [%.*s] in %s. "
- "Consider merging them.\n", nlen, nstr, kdmrc );
+ Debug( "Multiple occurrences of section [%.*s] in %s. "
+ "Consider merging them.\n", nlen, nstr, rcfile );
goto secfnd;
}
if (nstr[0] == 'X' && nstr[1] == '-') {
@@ -495,7 +490,7 @@ ReadConf()
illsec:
cursec = 0;
LogError( "Unrecognized section name [%.*s] at %s:%d\n",
- nlen, nstr, kdmrc, line );
+ nlen, nstr, rcfile, line );
continue;
newsec:
if (!(cursec = Malloc( sizeof(*cursec) )))
@@ -523,7 +518,7 @@ ReadConf()
if (!cursec) {
if (sectmoan) {
sectmoan = 0;
- LogError( "Entry outside any section at %s:%d", kdmrc, line );
+ LogError( "Entry outside any section at %s:%d", rcfile, line );
}
goto sktoeol;
}
@@ -531,13 +526,13 @@ ReadConf()
for (; (s < file.eof) && (*s != '\n'); s++)
if (*s == '=')
goto haveeq;
- LogError( "Invalid entry (missing '=') at %s:%d\n", kdmrc, line );
+ LogError( "Invalid entry (missing '=') at %s:%d\n", rcfile, line );
continue;
haveeq:
for (ek = s - 1; ; ek--) {
if (ek < sl) {
- LogError( "Invalid entry (empty key) at %s:%d\n", kdmrc, line );
+ LogError( "Invalid entry (empty key) at %s:%d\n", rcfile, line );
goto sktoeol;
}
if (!isspace( *ek ))
@@ -551,7 +546,7 @@ ReadConf()
if (*s == '\\') {
s++;
if (s >= file.eof || *s == '\n') {
- LogError( "Trailing backslash at %s:%d\n", kdmrc, line );
+ LogError( "Trailing backslash at %s:%d\n", rcfile, line );
break;
}
switch (*s) {
@@ -580,29 +575,42 @@ ReadConf()
goto keyok;
}
LogError( "Unrecognized key '%.*s' in section [%.*s] at %s:%d\n",
- nlen, nstr, cursec->nlen, cursec->name, kdmrc, line );
+ nlen, nstr, cursec->nlen, cursec->name, rcfile, line );
continue;
keyok:
for (curent = cursec->entries; curent; curent = curent->next)
if (ce == curent->ent) {
LogError( "Multiple occurrences of key '%s' in section [%.*s]"
" of %s\n",
- ce->name, cursec->nlen, cursec->name, kdmrc );
+ ce->name, cursec->nlen, cursec->name, rcfile );
goto keyfnd;
}
if (!(curent = Malloc( sizeof(*curent) )))
return;
+ curent->next = cursec->entries;
+ cursec->entries = curent;
+ keyfnd:
curent->ent = ce;
curent->line = line;
curent->val = st;
curent->vallen = en - st;
- curent->next = cursec->entries;
- cursec->entries = curent;
- keyfnd:
continue;
}
}
+static void ReadConf()
+{
+ static int confread = 0;
+
+ if (confread)
+ return;
+ confread++;
+
+ system("/opt/kde3/share/apps/kdm/read_sysconfig.sh");
+ ReadConfFile("/var/adm/kdm/kdmrc.sysconfig");
+ ReadConfFile(kdmrc);
+}
+
static Entry *
FindGEnt( int id )
{
Index: kdm/kfrontend/genkdmconf.c
===================================================================
--- kdm/kfrontend/genkdmconf.c.orig
+++ kdm/kfrontend/genkdmconf.c
@@ -66,6 +66,7 @@ Foundation, Inc., 51 Franklin Street, Fi
#define stringify(x) __stringify(x)
#define RCVERSTR stringify(RCVERMAJOR) "." stringify(RCVERMINOR)
+#define SUSERCVERSTR "2"
static int old_scripts, no_old_scripts, old_confs, no_old,
no_backup, no_in_notice, use_destdir, mixed_scripts;
@@ -73,7 +74,7 @@ static const char *newdir = KDMCONF, *fa
*oldxdm, *oldkde;
static int oldver;
-
+static int oldsusever;
typedef struct StrList {
struct StrList *next;
@@ -462,6 +463,7 @@ wrconf( FILE *f )
const char *cmt;
putfqval( "General", "ConfigVersion", RCVERSTR );
+ putfqval( "General", "SUSEConfigVersion", SUSERCVERSTR );
for (cs = config; cs; cs = cs->next) {
fprintf( f, "%s[%s]\n",
cs->comment ? cs->comment : "\n", cs->name );
@@ -1363,6 +1365,26 @@ upd_consolettys( Entry *ce, Section *cs
}
#endif
+static void
+reset_sec_0_1( Entry *ce, Section *cs ATTR_UNUSED )
+{
+ if (oldsusever < 1 || !ce->written )
+ {
+ ce->active = 0;
+ }
+ return;
+}
+
+static void
+reset_sec_1_2( Entry *ce, Section *cs ATTR_UNUSED )
+{
+ if (oldsusever < 2 || !ce->written )
+ {
+ ce->active = 0;
+ }
+ return;
+}
+
#ifdef XDMCP
static void
cp_keyfile( Entry *ce, Section *cs ATTR_UNUSED )
@@ -2228,7 +2250,7 @@ static int
mergeKdmRcNewer( const char *path )
{
char *p;
- const char *cp, *sec, *key;
+ const char *cp, *sec, *key, *susever;
RSection *rootsect, *cs;
REntry *ce;
int i, j;
@@ -2291,8 +2313,12 @@ mergeKdmRcNewer( const char *path )
}
#ifdef XDMCP
- applydefs( kdmdefs_all, as(kdmdefs_all), path );
+ /* applydefs( kdmdefs_all, as(kdmdefs_all), path ); */
#endif
+ susever = getfqval( "General", "SUSEConfigVersion", "" );
+ if (sscanf( susever, "%u", &oldsusever ) != 1)
+ oldsusever = 0;
+
if (!*(cp = getfqval( "General", "ConfigVersion", "" ))) { /* < 3.1 */
mod_usebg = 1;
if (is22conf( path )) {
Index: kdm/kfrontend/Makefile.am
===================================================================
--- kdm/kfrontend/Makefile.am.orig
+++ kdm/kfrontend/Makefile.am
@@ -64,3 +64,7 @@ kdm_greet_COMPILE_FIRST = ../config.ci
kdm_config_COMPILE_FIRST = ../config.ci
genkdmconf_COMPILE_FIRST = ../config.ci
+
+appsdir = $(kde_datadir)/kdm
+apps_SCRIPTS = read_sysconfig.sh
+

@ -0,0 +1,29 @@
Index: kdm/backend/Makefile.am
===================================================================
--- kdm/backend/Makefile.am.orig
+++ kdm/backend/Makefile.am
@@ -1,11 +1,6 @@
# forcibly remove thread-related defines & flags
AUTOMAKE_OPTIONS = foreign
-CFLAGS = $(XDM_CFLAGS) -fno-strict-aliasing
-CPPFLAGS = $(USER_INCLUDES) $(X_INCLUDES) $(KRB4_INCS) $(KRB5_INCS) -I.. -I../..
-LDFLAGS = $(USER_LDFLAGS) $(X_LDFLAGS) $(X_RPATH) $(KRB4_RPATH) $(KRB5_RPATH)
-LDADD = $(LIB_X11) -lXau $(LIBXDMCP) $(PASSWDLIBS) $(LIBSHADOW) $(LIBGEN) \
- $(LIB_LIBS) $(KRB4_LIBS) $(KRB5_LIBS) $(LIBSOCKET) $(LIBRESOLV) \
- $(LIBUCB) $(LIBUTIL) $(LIBPOSIX4)
+AM_CPPFLAGS = $(USER_INCLUDES) $(X_INCLUDES) $(KRB4_INCS) $(KRB5_INCS) -I.. -I../..
bin_PROGRAMS = kdm
kdm_SOURCES = \
@@ -39,6 +34,11 @@ kdm_SOURCES = \
xdmauth.c \
xdmcp.c
+kdm_LDFLAGS = $(USER_LDFLAGS) $(X_LDFLAGS) $(X_RPATH) $(KRB4_RPATH) $(KRB5_RPATH)
+kdm_LDADD = $(LIB_X11) -lXau $(LIBXDMCP) $(PASSWDLIBS) \
+ $(LIB_LIBS) $(KRB4_LIBS) $(KRB5_LIBS) $(LIBSOCKET) $(LIBRESOLV) \
+ $(LIBUCB) $(LIBUTIL) $(LIBPOSIX4)
+
EXTRA_DIST = printf.c
noinst_HEADERS = dm.h dm_socket.h dm_error.h dm_auth.h greet.h

@ -0,0 +1,22 @@
Index: kdm/kfrontend/kfdialog.cpp
===================================================================
--- kdm/kfrontend/kfdialog.cpp.orig
+++ kdm/kfrontend/kfdialog.cpp
@@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fi
#include <klocale.h>
#include <kpushbutton.h>
#include <kstdguiitem.h>
+#include <kglobalsettings.h>
#include <qlabel.h>
#include <qlayout.h>
@@ -137,6 +138,9 @@ KFMsgBox::KFMsgBox( QWidget *parent, QMe
QLabel *label1 = new QLabel( this );
label1->setPixmap( QMessageBox::standardIcon( type ) );
QLabel *label2 = new QLabel( text, this );
+ QRect d = KGlobalSettings::desktopGeometry(this);
+ if ( label2->fontMetrics().size( 0, text).width() > d.width() * 3 / 5)
+ label2->setAlignment(Qt::WordBreak | Qt::AlignAuto );
KPushButton *button = new KPushButton( KStdGuiItem::ok(), this );
button->setDefault( true );
button->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) );

@ -0,0 +1,10 @@
--- kcontrol/kfontinst/kfontinst/Main.cpp
+++ kcontrol/kfontinst/kfontinst/Main.cpp 2004/01/27 08:43:25
@@ -80,6 +80,7 @@
QStringList::ConstIterator xftIt;
for(xftIt=CGlobal::cfg().getUserFontsDirs().begin(); xftIt!=CGlobal::cfg().getUserFontsDirs().end(); ++xftIt)
+ CMisc::doCmd("/sbin/conf.d/SuSEconfig.fonts", "--module", "fonts");
CMisc::doCmd(XFT_CACHE_CMD, CMisc::xDirSyntax(*xftIt));
#else
CMisc::doCmd(XFT_CACHE_CMD, CMisc::xDirSyntax(ds));

@ -0,0 +1,172 @@
Index: khelpcenter/searchhandlers/khc_beagle_search.pl
===================================================================
--- /dev/null
+++ khelpcenter/searchhandlers/khc_beagle_search.pl
@@ -0,0 +1,88 @@
+#!/usr/bin/perl -w
+# vim:sw=4:et
+
+use warnings;
+use strict;
+use Getopt::Long;
+
+sub isBeagleRunning()
+{
+ open(IN, "-|") || exec "beagle-ping";
+ while(<IN>) {
+ if (/^Daemon version:/) {
+ close(IN);
+ return 1;
+ }
+ }
+ close(IN);
+ return 0;
+}
+
+sub formatHTML($$)
+{
+ my ($query, $hits) = @_;
+
+ print "<html>\n<body\n<ul>\n";
+
+ foreach my $hit(@$hits) {
+ print "<li>$hit</li>\n";
+ }
+ print "</ul>\n</body>\n</html>\n";
+}
+
+sub beagleQuery($$$)
+{
+ my ($words, $method, $maxnum) = @_;
+
+ my @hits = ();
+
+ open(IN, "-|") || exec "beagle-query", "--type", "DocbookEntry", "--type", "File", "--max-hits", $maxnum, @$words, "ext:docbook";
+ while(<IN>) {
+ chop;
+ next if (/^Debug:/);
+
+ my $uri = $_;
+ $uri = $1 if ($uri =~ /^file:\/\/(.*)$/);
+
+ print "uri: $uri\n";
+ my $helpLink = &makeHelpLink($uri);
+
+ push(@hits, $helpLink) if (!grep { /^$helpLink$/ } @hits);
+ }
+ close(IN);
+ return @hits;
+}
+
+sub makeHelpLink($)
+{
+ # Try to figure out the name of the application from the path to its index.docbook file
+
+ my ($path) = @_;
+ my @pathcomponents = split '/', $path;
+
+ my $appName = $pathcomponents[-2];
+ my $appName2 = $pathcomponents[-3];
+
+ if ($appName eq $appName2 or $appName2 eq "doc"
+ or (-d "/usr/share/locale/$appName2")) {
+ return "<a href=\"help:/$appName\">$appName</a>";
+ }
+ return "<a href=\"help:/$appName2/$appName\">$appName ($appName2)</a>";
+}
+
+my $method = "and";
+my $maxnum = 100;
+
+GetOptions("method=s", \$method, "maxnum=i", \$maxnum);
+
+my @hits = ("The Beagle daemon is not running, search is not available");
+
+my @words = @ARGV;
+
+if (isBeagleRunning()) {
+ @hits = beagleQuery(\@words, $method, $maxnum);
+}
+
+@hits = ("There are no search results") if ($#hits < 0);
+
+formatHTML(\@words, \@hits);
Index: khelpcenter/searchhandlers/khc_beagle_index.pl
===================================================================
--- /dev/null
+++ khelpcenter/searchhandlers/khc_beagle_index.pl
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+# vim:sw=4:et
+
+use warnings;
+
+sub getKDEDocDir()
+{
+ my $prefix = `kde-config --prefix`;
+ chomp $prefix;
+
+ $prefix = "/opt/kde" if (not defined($prefix));
+ return "$prefix/share/doc";
+}
+
+sub addRoot()
+{
+ my $kdedocdir = &getKDEDocDir;
+
+ open (IN, "-|") || exec "beagle-config", "indexing", "ListRoots";
+
+ my $kdedoc_found = 0;
+ while(<IN>) {
+ if (/^$kdedocdir/o) {
+ $kdedoc_found = 1;
+ last;
+ }
+ }
+ close(IN);
+
+ if (not $kdedoc_found) {
+ `beagle-config indexing AddRoot $kdedocdir`;
+ `beagle-config indexing AddRoot $kdedocdir-bundle`;
+ }
+}
+
+sub createExistsFile($$)
+{
+ my ($idir, $ident) = @_;
+
+ open(OUT, ">", "$idir/$idir");
+ close(OUT);
+}
+
+my $idir = $ARGV[0];
+my $ident = $ARGV[1];
+
+if (addRoot) {
+ createExistsFile($idir, $ident);
+}
Index: khelpcenter/searchhandlers/docbook.desktop
===================================================================
--- khelpcenter/searchhandlers/docbook.desktop.orig
+++ khelpcenter/searchhandlers/docbook.desktop
@@ -2,5 +2,5 @@
DocumentTypes=text/docbook
-SearchCommand=khc_htsearch.pl --docbook --indexdir=%d --config=%i --words=%w --method=%o --maxnum=%m --lang=en
-IndexCommand=khc_docbookdig.pl --indexdir=%d --docpath=%p --identifier=%i
+SearchCommand=khc_beagle_search.pl --method=%o --maxnum=%m %w
+IndexCommand=khc_beagle_index.pl %d %i
Index: khelpcenter/searchhandlers/Makefile.am
===================================================================
--- khelpcenter/searchhandlers/Makefile.am.orig
+++ khelpcenter/searchhandlers/Makefile.am
@@ -3,7 +3,7 @@ searchhandlers_DATA = htdig.desktop man.
searchhandlersdir = $(kde_datadir)/khelpcenter/searchhandlers
kde_bin_SCRIPTS = khc_htdig.pl khc_htsearch.pl khc_mansearch.pl \
- khc_docbookdig.pl
+ khc_docbookdig.pl khc_beagle_search.pl khc_beagle_index.pl
htdigdata_DATA = htdig_long.html

@ -0,0 +1,23 @@
Index: khelpcenter/navigator.cpp
===================================================================
--- khelpcenter/navigator.cpp.orig
+++ khelpcenter/navigator.cpp
@@ -121,8 +121,6 @@ Navigator::Navigator( View *view, QWidge
mTabWidget = new QTabWidget( this );
topLayout->addWidget( mTabWidget );
- connect( mTabWidget, SIGNAL( currentChanged( QWidget * ) ),
- SLOT( slotTabChanged( QWidget * ) ) );
setupContentsTab();
setupGlossaryTab();
@@ -136,6 +134,9 @@ Navigator::Navigator( View *view, QWidge
mSearchWidget->updateScopeList();
mSearchWidget->readConfig( KGlobal::config() );
}
+
+ connect( mTabWidget, SIGNAL( currentChanged( QWidget * ) ),
+ SLOT( slotTabChanged( QWidget * ) ) );
}
Navigator::~Navigator()

@ -0,0 +1,327 @@
Index: khelpcenter/table-of-contents.xslt
================================================================================
--- khelpcenter/docentry.cpp
+++ khelpcenter/docentry.cpp
@@ -1,5 +1,6 @@
#include <qregexp.h>
#include <qfileinfo.h>
+#include <stdlib.h>
#include <kdebug.h>
#include <kdesktopfile.h>
@@ -206,6 +207,37 @@
{
KDesktopFile file( fileName );
+ static QString desktop;
+ if (desktop.isNull()) {
+ QString win_man = getenv("WINDOWMANAGER");
+ if (win_man.contains ("gnome", FALSE))
+ desktop = "GNOME";
+ else if (win_man.contains ("kde", FALSE))
+ desktop = "KDE";
+ else
+ desktop = "";
+ kdDebug() << "DocEntry::desktop = " << desktop << endl;
+ };
+
+ QString onlyShowIn = file.readEntry ("OnlyShowIn");
+
+ kdDebug() << "DocEntry::readFromFile(): " << fileName << " onlyShowIn = " << onlyShowIn << endl;
+
+ if ( !onlyShowIn.isNull() ) {
+ if (desktop.isEmpty())
+ return false;
+ QStringList list = QStringList::split (";", onlyShowIn);
+ if ( ! list.contains (desktop) )
+ return false;
+ }
+
+ QString notShowIn = file.readEntry ("NotShowIn");
+ if ( !notShowIn.isNull() ) {
+ QStringList list = QStringList::split (";", notShowIn);
+ if ( list.contains (desktop) )
+ return false;
+ }
+
mName = file.readName();
mSearch = file.readEntry( "X-DOC-Search" );
mIcon = file.readIcon();
--- khelpcenter/navigator.cpp
+++ khelpcenter/navigator.cpp
@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <stdlib.h>
#include <qdir.h>
#include <qfile.h>
@@ -275,6 +276,38 @@
const QString &file )
{
KDesktopFile desktopFile( file );
+
+ static QString desktop;
+ if (desktop.isNull()) {
+ QString win_man = getenv("WINDOWMANAGER");
+ if (win_man.contains ("gnome", FALSE))
+ desktop = "GNOME";
+ else if (win_man.contains ("kde", FALSE))
+ desktop = "KDE";
+ else
+ desktop = "";
+ kdDebug() << "Navigator::desktop = " << desktop << endl;
+ };
+
+ QString onlyShowIn = desktopFile.readEntry ("OnlyShowIn");
+
+ kdDebug() << "Navigator::createItemFromDesktopFile(): " << file << " onlyShowIn = " << onlyShowIn << endl;
+
+ if ( !onlyShowIn.isNull() ) {
+ if (desktop.isEmpty())
+ return;
+ QStringList list = QStringList::split (";", onlyShowIn);
+ if ( ! list.contains (desktop) )
+ return;
+ }
+
+ QString notShowIn = desktopFile.readEntry ("NotShowIn");
+ if ( !notShowIn.isNull() ) {
+ QStringList list = QStringList::split (";", notShowIn);
+ if ( list.contains (desktop) )
+ return;
+ }
+
QString docPath = desktopFile.readDocPath();
if ( !docPath.isNull() ) {
// First parameter is ignored if second is an absolute path
@@ -317,6 +350,9 @@
{
alternativeURL.setQuery("anchor="+url.ref());
alternativeURL.setRef(QString::null);
+ } else if (url.url().endsWith("/index.html"))
+ {
+ alternativeURL = KURL (url.url().left (url.url().length() - strlen ("/index.html")));
}
// If the navigator already has the given URL selected, do nothing.
@@ -401,15 +437,43 @@
TOC *tocTree = item->createTOC();
kdDebug( 1400 ) << "slotItemSelected(): Trying to build TOC for "
<< item->entry()->name() << endl;
- tocTree->setApplication( url.directory() );
+ if (url.directory() != "/")
+ tocTree->setApplication( url.directory() );
+ else
+ tocTree->setApplication( url.path() );
QString doc = View::langLookup( url.path() );
// Enforce the original .docbook version, in case langLookup returns a
// cached version
if ( !doc.isNull() ) {
- int pos = doc.find( ".html" );
- if ( pos >= 0 ) {
- doc.replace( pos, 5, ".docbook" );
- }
+ if (doc.endsWith( ".html" )) {
+ doc = doc.left (doc.length() - 5) + ".docbook";
+ }
+
+ QFileInfo di (doc);
+ if (!di.isFile()) {
+
+ int last_slash = doc.findRev ('/');
+ if (last_slash >= 1) {
+
+ QString filename = doc.right(doc.length() - last_slash - 1);
+ if (filename == "index.html" || filename == "") {
+
+ int slash2 = doc.findRev('/', last_slash -1);
+ if (slash2 != -1 && slash2 != 0) {
+
+ int slash3 = doc.findRev('/', slash2 - 1);
+ if (slash3 != -1) {
+ QString xml_file = doc.left(last_slash) + "/" + doc.mid(slash3 + 1, slash2 - (slash3 + 1)) + ".xml";
+ kdDebug() << "xml_file " << xml_file << endl;
+ QFileInfo fi(xml_file);
+ if (fi.exists())
+ doc = xml_file;
+
+ }
+ }
+ }
+ }
+ }
kdDebug( 1400 ) << "slotItemSelected(): doc = " << doc << endl;
tocTree->build( doc );
--- khelpcenter/navigatorappitem.cpp
+++ khelpcenter/navigatorappitem.cpp
@@ -21,6 +21,8 @@
#include "docentry.h"
+#include <stdlib.h>
+
#include <kdebug.h>
#include <kservicegroup.h>
@@ -134,11 +136,42 @@
QString NavigatorAppItem::documentationURL( KService *s )
{
+ static QString desktop;
+ if (desktop.isNull()) {
+ QString win_man = getenv("WINDOWMANAGER");
+ if (win_man.contains ("gnome", FALSE))
+ desktop = "GNOME";
+ else if (win_man.contains ("kde", FALSE))
+ desktop = "KDE";
+ else
+ desktop = "";
+ kdDebug() << "NavigatorAppItem::desktop = " << desktop << endl;
+ };
+
+ QString onlyShowIn = s->property("OnlyShowIn", QVariant::String).toString();
+
+ kdDebug() << "NavigatorAppItem::onlyShowIn = " << onlyShowIn << endl;
+
+ if ( !onlyShowIn.isNull() ) {
+ if (desktop.isEmpty())
+ return QString::null;
+ QStringList list = QStringList::split (";", onlyShowIn);
+ if ( ! list.contains (desktop) )
+ return QString::null;
+ }
+
+ QString notShowIn = s->property("NotShowIn", QVariant::String).toString();
+ if ( !notShowIn.isNull() ) {
+ QStringList list = QStringList::split (";", notShowIn);
+ if ( list.contains (desktop) )
+ return QString::null;
+ }
+
QString docPath = s->property( "DocPath" ).toString();
if ( docPath.isEmpty() )
return QString::null;
- if ( docPath.startsWith( "file:") || docPath.startsWith( "http:" ) )
+ if ( docPath.startsWith( "file:") || docPath.startsWith( "http:" ) || docPath.startsWith( "ghelp:" ))
return docPath;
return QString( "help:/" ) + docPath;
--- khelpcenter/table-of-contents.xslt
+++ khelpcenter/table-of-contents.xslt
@@ -8,6 +8,12 @@
</table-of-contents>
</xsl:template>
+<xsl:template match="article">
+<table-of-contents>
+<xsl:apply-templates select="sect1"/>
+</table-of-contents>
+</xsl:template>
+
<xsl:template match="chapter">
<chapter>
<title><xsl:value-of select="title"/></title>
@@ -20,7 +26,15 @@
<section>
<title><xsl:value-of select="title"/></title>
<anchor><xsl:value-of select="@id"/></anchor>
+<xsl:apply-templates select="sect2"/>
</section>
</xsl:template>
+<xsl:template match="sect2">
+<subsection>
+<title><xsl:value-of select="title"/></title>
+<anchor><xsl:value-of select="@id"/></anchor>
+</subsection>
+</xsl:template>
+
</xsl:stylesheet>
--- khelpcenter/view.cpp
+++ khelpcenter/view.cpp
@@ -146,21 +146,51 @@
// assemble the local search paths
const QStringList localDoc = KGlobal::dirs()->resourceDirs("html");
+ kdDebug() << "Looking up help for: " << fname << endl;
+
+ QString path;
+ QString file_name;
+ int slash = fname.findRev ('/');
+ if (slash == -1 || slash == 0) {
+ path = fname;
+ file_name = "/";
+ } else {
+ path = fname.left (slash);
+ file_name = fname.right (fname.length() - slash);
+ }
+
+ QStringList langs = KGlobal::locale()->languageList();
+ QStringList::ConstIterator lang;
+ for (lang = langs.begin(); lang != langs.end(); ++lang)
+ if (*lang == "en")
+ search.append(QString("/opt/gnome/share/gnome/help/%1/C%2").arg(path).arg(file_name));
+ else
+ search.append(QString("/opt/gnome/share/gnome/help/%1/%2%3").arg(path).arg(*lang).arg(file_name));
+
+ langs.append( "en" );
+ langs.remove( "C" );
+
+ // this is kind of compat hack as we install our docs in en/ but the
+ // default language is en_US
+ for (QStringList::Iterator it = langs.begin(); it != langs.end(); ++it)
+ if ( *it == "en_US" )
+ *it = "en";
+
// look up the different languages
- for (int id=localDoc.count()-1; id >= 0; --id)
+ int ldCount = localDoc.count();
+ for (int id=0; id < ldCount; id++)
{
- QStringList langs = KGlobal::locale()->languageList();
- langs.append( "en" );
- langs.remove( "C" );
QStringList::ConstIterator lang;
for (lang = langs.begin(); lang != langs.end(); ++lang)
- search.append(QString("%1%2/%3").arg(localDoc[id]).arg(*lang).arg(fname));
+ search.append(QString("%1%2/%3").arg(localDoc[id]).arg(*lang).arg(path + file_name));
}
// try to locate the file
QStringList::Iterator it;
for (it = search.begin(); it != search.end(); ++it)
{
+ kdDebug() << "Looking for help in: " << *it << endl;
+
QFileInfo info(*it);
if (info.exists() && info.isFile() && info.isReadable())
return *it;
@@ -168,7 +198,7 @@
// Fall back to the index.docbook for this language if we couldn't find its
// specific docbook file. If we are not looking up docbook (images,
// css etc) then look in other languages first.
- if ( ( *it ).endsWith( "docbook" ) )
+ if ( ( *it ).endsWith( "docbook" ) || ( *it).endsWith( ".xml") )
{
QString file = (*it).left((*it).findRev('/')) + "/index.docbook";
info.setFile(file);
@@ -176,9 +206,15 @@
{
return *it;
}
+
+ file = (*it).left((*it).findRev('/')) + "/" + path + ".xml";
+ info.setFile(file);
+ if (info.exists() && info.isFile() && info.isReadable())
+ return *it;
}
}
+
return QString::null;
}

@ -0,0 +1,335 @@
Index: khelpcenter/docentry.cpp
===================================================================
--- khelpcenter/docentry.cpp.orig
+++ khelpcenter/docentry.cpp
@@ -1,5 +1,6 @@
#include <qregexp.h>
#include <qfileinfo.h>
+#include <stdlib.h>
#include <kdebug.h>
#include <kdesktopfile.h>
@@ -206,6 +207,37 @@ bool DocEntry::readFromFile( const QStri
{
KDesktopFile file( fileName );
+ static QString desktop;
+ if (desktop.isNull()) {
+ QString win_man = getenv("WINDOWMANAGER");
+ if (win_man.contains ("gnome", FALSE))
+ desktop = "GNOME";
+ else if (win_man.contains ("kde", FALSE))
+ desktop = "KDE";
+ else
+ desktop = "";
+ kdDebug() << "DocEntry::desktop = " << desktop << endl;
+ };
+
+ QString onlyShowIn = file.readEntry ("OnlyShowIn");
+
+ kdDebug() << "DocEntry::readFromFile(): " << fileName << " onlyShowIn = " << onlyShowIn << endl;
+
+ if ( !onlyShowIn.isNull() ) {
+ if (desktop.isEmpty())
+ return false;
+ QStringList list = QStringList::split (";", onlyShowIn);
+ if ( ! list.contains (desktop) )
+ return false;
+ }
+
+ QString notShowIn = file.readEntry ("NotShowIn");
+ if ( !notShowIn.isNull() ) {
+ QStringList list = QStringList::split (";", notShowIn);
+ if ( list.contains (desktop) )
+ return false;
+ }
+
mName = file.readName();
mSearch = file.readEntry( "X-DOC-Search" );
mIcon = file.readIcon();
Index: khelpcenter/navigator.cpp
===================================================================
--- khelpcenter/navigator.cpp.orig
+++ khelpcenter/navigator.cpp
@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+#include <stdlib.h>
#include <qdir.h>
#include <qfile.h>
@@ -275,6 +276,38 @@ void Navigator::createItemFromDesktopFil
const QString &file )
{
KDesktopFile desktopFile( file );
+
+ static QString desktop;
+ if (desktop.isNull()) {
+ QString win_man = getenv("WINDOWMANAGER");
+ if (win_man.contains ("gnome", FALSE))
+ desktop = "GNOME";
+ else if (win_man.contains ("kde", FALSE))
+ desktop = "KDE";
+ else
+ desktop = "";
+ kdDebug() << "Navigator::desktop = " << desktop << endl;
+ };
+
+ QString onlyShowIn = desktopFile.readEntry ("OnlyShowIn");
+
+ kdDebug() << "Navigator::createItemFromDesktopFile(): " << file << " onlyShowIn = " << onlyShowIn << endl;
+
+ if ( !onlyShowIn.isNull() ) {
+ if (desktop.isEmpty())
+ return;
+ QStringList list = QStringList::split (";", onlyShowIn);
+ if ( ! list.contains (desktop) )
+ return;
+ }
+
+ QString notShowIn = desktopFile.readEntry ("NotShowIn");
+ if ( !notShowIn.isNull() ) {
+ QStringList list = QStringList::split (";", notShowIn);
+ if ( list.contains (desktop) )
+ return;
+ }
+
QString docPath = desktopFile.readDocPath();
if ( !docPath.isNull() ) {
// First parameter is ignored if second is an absolute path
@@ -317,6 +350,9 @@ void Navigator::selectItem( const KURL &
{
alternativeURL.setQuery("anchor="+url.ref());
alternativeURL.setRef(QString::null);
+ } else if (url.url().endsWith("/index.html"))
+ {
+ alternativeURL = KURL (url.url().left (url.url().length() - strlen ("/index.html")));
}
// If the navigator already has the given URL selected, do nothing.
@@ -401,15 +437,43 @@ void Navigator::slotItemSelected( QListV
TOC *tocTree = item->createTOC();
kdDebug( 1400 ) << "slotItemSelected(): Trying to build TOC for "
<< item->entry()->name() << endl;
- tocTree->setApplication( url.directory() );
+ if (url.directory() != "/")
+ tocTree->setApplication( url.directory() );
+ else
+ tocTree->setApplication( url.path() );
QString doc = View::langLookup( url.path() );
// Enforce the original .docbook version, in case langLookup returns a
// cached version
if ( !doc.isNull() ) {
- int pos = doc.find( ".html" );
- if ( pos >= 0 ) {
- doc.replace( pos, 5, ".docbook" );
- }
+ if (doc.endsWith( ".html" )) {
+ doc = doc.left (doc.length() - 5) + ".docbook";
+ }
+
+ QFileInfo di (doc);
+ if (!di.isFile()) {
+
+ int last_slash = doc.findRev ('/');
+ if (last_slash >= 1) {
+
+ QString filename = doc.right(doc.length() - last_slash - 1);
+ if (filename == "index.html" || filename == "") {
+
+ int slash2 = doc.findRev('/', last_slash -1);
+ if (slash2 != -1 && slash2 != 0) {
+
+ int slash3 = doc.findRev('/', slash2 - 1);
+ if (slash3 != -1) {
+ QString xml_file = doc.left(last_slash) + "/" + doc.mid(slash3 + 1, slash2 - (slash3 + 1)) + ".xml";
+ kdDebug() << "xml_file " << xml_file << endl;
+ QFileInfo fi(xml_file);
+ if (fi.exists())
+ doc = xml_file;
+
+ }
+ }
+ }
+ }
+ }
kdDebug( 1400 ) << "slotItemSelected(): doc = " << doc << endl;
tocTree->build( doc );
Index: khelpcenter/navigatorappitem.cpp
===================================================================
--- khelpcenter/navigatorappitem.cpp.orig
+++ khelpcenter/navigatorappitem.cpp
@@ -21,6 +21,8 @@
#include "docentry.h"
+#include <stdlib.h>
+
#include <kdebug.h>
#include <kservicegroup.h>
@@ -134,11 +136,42 @@ void NavigatorAppItem::populate( bool re
QString NavigatorAppItem::documentationURL( KService *s )
{
+ static QString desktop;
+ if (desktop.isNull()) {
+ QString win_man = getenv("WINDOWMANAGER");
+ if (win_man.contains ("gnome", FALSE))
+ desktop = "GNOME";
+ else if (win_man.contains ("kde", FALSE))
+ desktop = "KDE";
+ else
+ desktop = "";
+ kdDebug() << "NavigatorAppItem::desktop = " << desktop << endl;
+ };
+
+ QString onlyShowIn = s->property("OnlyShowIn", QVariant::String).toString();
+
+ kdDebug() << "NavigatorAppItem::onlyShowIn = " << onlyShowIn << endl;
+
+ if ( !onlyShowIn.isNull() ) {
+ if (desktop.isEmpty())
+ return QString::null;
+ QStringList list = QStringList::split (";", onlyShowIn);
+ if ( ! list.contains (desktop) )
+ return QString::null;
+ }
+
+ QString notShowIn = s->property("NotShowIn", QVariant::String).toString();
+ if ( !notShowIn.isNull() ) {
+ QStringList list = QStringList::split (";", notShowIn);
+ if ( list.contains (desktop) )
+ return QString::null;
+ }
+
QString docPath = s->property( "DocPath" ).toString();
if ( docPath.isEmpty() )
return QString::null;
- if ( docPath.startsWith( "file:") || docPath.startsWith( "http:" ) )
+ if ( docPath.startsWith( "file:") || docPath.startsWith( "http:" ) || docPath.startsWith( "ghelp:" ))
return docPath;
return QString( "help:/" ) + docPath;
Index: khelpcenter/table-of-contents.xslt
===================================================================
--- khelpcenter/table-of-contents.xslt.orig
+++ khelpcenter/table-of-contents.xslt
@@ -8,6 +8,12 @@
</table-of-contents>
</xsl:template>
+<xsl:template match="article">
+<table-of-contents>
+<xsl:apply-templates select="sect1"/>
+</table-of-contents>
+</xsl:template>
+
<xsl:template match="chapter">
<chapter>
<title><xsl:value-of select="title"/></title>
@@ -20,7 +26,15 @@
<section>
<title><xsl:value-of select="title"/></title>
<anchor><xsl:value-of select="@id"/></anchor>
+<xsl:apply-templates select="sect2"/>
</section>
</xsl:template>
+<xsl:template match="sect2">
+<subsection>
+<title><xsl:value-of select="title"/></title>
+<anchor><xsl:value-of select="@id"/></anchor>
+</subsection>
+</xsl:template>
+
</xsl:stylesheet>
Index: khelpcenter/view.cpp
===================================================================
--- khelpcenter/view.cpp.orig
+++ khelpcenter/view.cpp
@@ -150,21 +150,51 @@ QString View::langLookup( const QString
// assemble the local search paths
const QStringList localDoc = KGlobal::dirs()->resourceDirs("html");
+ kdDebug() << "Looking up help for: " << fname << endl;
+
+ QString path;
+ QString file_name;
+ int slash = fname.findRev ('/');
+ if (slash == -1 || slash == 0) {
+ path = fname;
+ file_name = "/";
+ } else {
+ path = fname.left (slash);
+ file_name = fname.right (fname.length() - slash);
+ }
+
+ QStringList langs = KGlobal::locale()->languageList();
+ QStringList::ConstIterator lang;
+ for (lang = langs.begin(); lang != langs.end(); ++lang)
+ if (*lang == "en")
+ search.append(QString("/usr/share/gnome/help/%1/C%2").arg(path).arg(file_name));
+ else
+ search.append(QString("/usr/share/gnome/help/%1/%2%3").arg(path).arg(*lang).arg(file_name));
+
+ langs.append( "en" );
+ langs.remove( "C" );
+
+ // this is kind of compat hack as we install our docs in en/ but the
+ // default language is en_US
+ for (QStringList::Iterator it = langs.begin(); it != langs.end(); ++it)
+ if ( *it == "en_US" )
+ *it = "en";
+
// look up the different languages
- for (int id=localDoc.count()-1; id >= 0; --id)
+ int ldCount = localDoc.count();
+ for (int id=0; id < ldCount; id++)
{
- QStringList langs = KGlobal::locale()->languageList();
- langs.append( "en" );
- langs.remove( "C" );
QStringList::ConstIterator lang;
for (lang = langs.begin(); lang != langs.end(); ++lang)
- search.append(QString("%1%2/%3").arg(localDoc[id]).arg(*lang).arg(fname));
+ search.append(QString("%1%2/%3").arg(localDoc[id]).arg(*lang).arg(path + file_name));
}
// try to locate the file
QStringList::Iterator it;
for (it = search.begin(); it != search.end(); ++it)
{
+ kdDebug() << "Looking for help in: " << *it << endl;
+
QFileInfo info(*it);
if (info.exists() && info.isFile() && info.isReadable())
return *it;
@@ -172,7 +202,7 @@ QString View::langLookup( const QString
// Fall back to the index.docbook for this language if we couldn't find its
// specific docbook file. If we are not looking up docbook (images,
// css etc) then look in other languages first.
- if ( ( *it ).endsWith( "docbook" ) )
+ if ( ( *it ).endsWith( "docbook" ) || ( *it).endsWith( ".xml") )
{
QString file = (*it).left((*it).findRev('/')) + "/index.docbook";
info.setFile(file);
@@ -180,9 +210,15 @@ QString View::langLookup( const QString
{
return *it;
}
+
+ file = (*it).left((*it).findRev('/')) + "/" + path + ".xml";
+ info.setFile(file);
+ if (info.exists() && info.isFile() && info.isReadable())
+ return *it;
}
}
+
return QString::null;
}

@ -0,0 +1,41 @@
Index: khelpcenter/kcmhelpcenter.cpp
===================================================================
--- khelpcenter/kcmhelpcenter.cpp.orig
+++ khelpcenter/kcmhelpcenter.cpp
@@ -321,6 +321,7 @@ bool KCMHelpCenter::save()
void KCMHelpCenter::load()
{
+ findWriteableIndexDir();
mIndexDirLabel->setText( Prefs::indexDirectory() );
mListView->clear();
@@ -675,6 +676,12 @@ void KCMHelpCenter::checkSelection()
enableButtonOK( count != 0 );
}
+void KCMHelpCenter::findWriteableIndexDir()
+{
+ QFileInfo currentDir( Prefs::indexDirectory() );
+ if ( !currentDir.isWritable() )
+ Prefs::setIndexDirectory( KGlobal::dirs()->saveLocation("data", "khelpcenter/index/") );
+}
#include "kcmhelpcenter.moc"
// vim:ts=2:sw=2:et
Index: khelpcenter/kcmhelpcenter.h
===================================================================
--- khelpcenter/kcmhelpcenter.h.orig
+++ khelpcenter/kcmhelpcenter.h
@@ -146,6 +146,11 @@ class KCMHelpCenter : public KDialogBase
void advanceProgress();
+ /**
+ * Find a user-writeable location for the indices, if the current location
+ * is not.
+ */
+ void findWriteableIndexDir();
private:
KHC::SearchEngine *mEngine;

@ -0,0 +1,25 @@
Index: khelpcenter/navigator.cpp
===================================================================
--- khelpcenter/navigator.cpp.orig
+++ khelpcenter/navigator.cpp
@@ -654,10 +654,16 @@ void Navigator::hideSearch()
bool Navigator::checkSearchIndex()
{
- KConfig *cfg = KGlobal::config();
- cfg->setGroup( "Search" );
- if ( cfg->readBoolEntry( "IndexExists", false ) ) return true;
-
+ // just check that the index dir contains something
+ QDir indexDir( Prefs::indexDirectory() );
+ QStringList dirEntries = indexDir.entryList();
+ QStringList::Iterator it = dirEntries.begin();
+ const QStringList::Iterator end = dirEntries.end();
+ for ( ; it != end; ++it )
+ {
+ if ( *it != "." && *it != ".." )
+ return true;
+ }
if ( mIndexDialog && mIndexDialog->isShown() ) return true;
QString text = i18n( "A search index does not yet exist. Do you want "

@ -0,0 +1,13 @@
Index: kdebase-3.5.10/khelpcenter/khelpcenter.desktop
===================================================================
--- kdebase-3.5.10.orig/khelpcenter/khelpcenter.desktop
+++ kdebase-3.5.10/khelpcenter/khelpcenter.desktop
@@ -127,7 +127,7 @@ Icon=khelpcenter
DocPath=khelpcenter/index.html
Type=Service
Terminal=false
-Exec=khelpcenter %u
+Exec=susehelp %u
SwallowExec=
SwallowTitle=
X-KDE-StartupNotify=true

@ -0,0 +1,345 @@
Index: khotkeys/data/multimedia_keys.khotkeys
===================================================================
--- /dev/null
+++ khotkeys/data/multimedia_keys.khotkeys
@@ -0,0 +1,311 @@
+[Data]
+DataCount=1
+
+[Data_1]
+Comment=This group contains actions that are set up by default.\n
+DataCount=8
+Enabled=true
+Name=Preset Actions
+SystemGroup=0
+Type=ACTION_DATA_GROUP
+AllowMerge=true
+
+[Data_1Conditions]
+Comment=
+ConditionsCount=0
+
+[Data_1_1]
+Comment=Opens the My Computer window when the multimedia My Computer key is pressed.\n
+Enabled=true
+Name=My Computer
+Type=COMMAND_URL_SHORTCUT_ACTION_DATA
+
+[Data_1_1Actions]
+ActionsCount=1
+
+[Data_1_1Actions0]
+CommandURL=sysinfo:/
+Type=COMMAND_URL
+
+[Data_1_1Conditions]
+Comment=
+ConditionsCount=0
+
+[Data_1_1Triggers]
+Comment=Simple_action
+TriggersCount=1
+
+[Data_1_1Triggers0]
+Key=XF86MyComputer
+Type=SHORTCUT
+
+[Data_1_2]
+Comment=Launch or activate Amarok when the multimedia Media key is pressed.\n
+Enabled=true
+Name=Media
+Type=COMMAND_URL_SHORTCUT_ACTION_DATA
+
+[Data_1_2Actions]
+ActionsCount=1
+
+[Data_1_2Actions0]
+CommandURL=amarok
+Type=COMMAND_URL
+
+[Data_1_2Conditions]
+Comment=
+ConditionsCount=0
+
+[Data_1_2Triggers]
+Comment=Simple_action
+TriggersCount=1
+
+[Data_1_2Triggers0]
+Key=XF86AudioMedia
+Type=SHORTCUT
+
+[Data_1_3]
+Comment=When the multimedia Calculator key is pressed, KCalc is either launched or activated if it is already running.\n
+DataCount=2
+Enabled=true
+Name=Calculator
+SystemGroup=0
+Type=ACTION_DATA_GROUP
+
+[Data_1_3Conditions]
+Comment=
+ConditionsCount=0
+
+[Data_1_3_1]
+Comment=Runs KCalc if it is not already running.\n
+Enabled=true
+Name=Run KCalc
+Type=GENERIC_ACTION_DATA
+
+[Data_1_3_1Actions]
+ActionsCount=1
+
+[Data_1_3_1Actions0]
+CommandURL=kcalc
+Type=COMMAND_URL
+
+[Data_1_3_1Conditions]
+Comment=
+ConditionsCount=1
+
+[Data_1_3_1Conditions0]
+ConditionsCount=1
+Type=NOT
+
+[Data_1_3_1Conditions00]
+Type=EXISTING_WINDOW
+
+[Data_1_3_1Conditions00Window]
+Comment=kcalc
+WindowsCount=1
+
+[Data_1_3_1Conditions00Window0]
+Class=kcalc Kcalc
+ClassType=2
+Comment=kcalc
+Role=kcalc-mainwindow#1
+RoleType=0
+Title=KCalc
+TitleType=0
+Type=SIMPLE
+WindowTypes=1
+
+[Data_1_3_1Triggers]
+Comment=
+TriggersCount=1
+
+[Data_1_3_1Triggers0]
+Key=XF86Calculator
+Type=SHORTCUT
+
+[Data_1_3_2]
+Comment=Activates KCalc window if it is already running.\n
+Enabled=true
+Name=Activate KCalc
+Type=GENERIC_ACTION_DATA
+
+[Data_1_3_2Actions]
+ActionsCount=1
+
+[Data_1_3_2Actions0]
+Type=ACTIVATE_WINDOW
+
+[Data_1_3_2Actions0Window]
+Comment=kcalc
+WindowsCount=1
+
+[Data_1_3_2Actions0Window0]
+Class=kcalc Kcalc
+ClassType=2
+Comment=kcalc
+Role=kcalc-mainwindow#1
+RoleType=0
+Title=KCalc
+TitleType=0
+Type=SIMPLE
+WindowTypes=1
+
+[Data_1_3_2Conditions]
+Comment=
+ConditionsCount=1
+
+[Data_1_3_2Conditions0]
+Type=EXISTING_WINDOW
+
+[Data_1_3_2Conditions0Window]
+Comment=kcalc
+WindowsCount=1
+
+[Data_1_3_2Conditions0Window0]
+Class=kcalc Kcalc
+ClassType=2
+Comment=kcalc
+Role=kcalc-mainwindow#1
+RoleType=0
+Title=KCalc
+TitleType=0
+Type=SIMPLE
+WindowTypes=1
+
+[Data_1_3_2Triggers]
+Comment=
+TriggersCount=1
+
+[Data_1_3_2Triggers0]
+Key=XF86Calculator
+Type=SHORTCUT
+
+[Data_1_4]
+Comment=Launches the default terminal application when the multimedia Terminal key is pressed.\n
+Enabled=true
+Name=Terminal
+Type=COMMAND_URL_SHORTCUT_ACTION_DATA
+
+[Data_1_4Actions]
+ActionsCount=1
+
+[Data_1_4Actions0]
+CommandURL=KHOTKEYS_TERMINAL
+Type=COMMAND_URL
+
+[Data_1_4Conditions]
+Comment=
+ConditionsCount=0
+
+[Data_1_4Triggers]
+Comment=Simple_action
+TriggersCount=1
+
+[Data_1_4Triggers0]
+Key=XF86Terminal
+Type=SHORTCUT
+
+[Data_1_5]
+Comment=Opens the default browser when the multimedia WWW key is pressed.\n
+Enabled=true
+Name=Browser (HomePage)
+Type=COMMAND_URL_SHORTCUT_ACTION_DATA
+
+[Data_1_5Actions]
+ActionsCount=1
+
+[Data_1_5Actions0]
+CommandURL=KHOTKEYS_BROWSER
+Type=COMMAND_URL
+
+[Data_1_5Conditions]
+Comment=
+ConditionsCount=0
+
+[Data_1_5Triggers]
+Comment=Simple_action
+TriggersCount=1
+
+[Data_1_5Triggers0]
+Key=XF86WWW
+Type=SHORTCUT
+
+[Data_1_6]
+Comment=Ejecting when the multimedia Eject key is pressed.\n
+Enabled=true
+Name=Eject
+Type=COMMAND_URL_SHORTCUT_ACTION_DATA
+
+[Data_1_6Actions]
+ActionsCount=1
+
+[Data_1_6Actions0]
+CommandURL=kdeeject ""
+Type=COMMAND_URL
+
+[Data_1_6Conditions]
+Comment=
+ConditionsCount=0
+
+[Data_1_6Triggers]
+Comment=Simple_action
+TriggersCount=1
+
+[Data_1_6Triggers0]
+Key=XF86Eject
+Type=SHORTCUT
+
+[Data_1_7]
+Comment=Launches KFind when the multimedia Search key is pressed.\n
+Enabled=true
+Name=Search
+Type=COMMAND_URL_SHORTCUT_ACTION_DATA
+
+[Data_1_7Actions]
+ActionsCount=1
+
+[Data_1_7Actions0]
+CommandURL=kfind
+Type=COMMAND_URL
+
+[Data_1_7Conditions]
+Comment=
+ConditionsCount=0
+
+[Data_1_7Triggers]
+Comment=Simple_action
+TriggersCount=1
+
+[Data_1_7Triggers0]
+Key=XF86Search
+Type=SHORTCUT
+
+[Data_1_8]
+Comment=Opens a new mail composer window when the multimedia Mail key is pressed.\n
+Enabled=true
+Name=Launch Mail
+Type=COMMAND_URL_SHORTCUT_ACTION_DATA
+
+[Data_1_8Actions]
+ActionsCount=1
+
+[Data_1_8Actions0]
+CommandURL=mailto:?
+Type=COMMAND_URL
+
+[Data_1_8Conditions]
+Comment=
+ConditionsCount=0
+
+[Data_1_8Triggers]
+Comment=Simple_action
+TriggersCount=1
+
+[Data_1_8Triggers0]
+Key=XF86Mail
+Type=SHORTCUT
+
+[Main]
+Version=2
+ImportId=multimedia_keys
+
Index: khotkeys/data/Makefile.am
===================================================================
--- khotkeys/data/Makefile.am.orig
+++ khotkeys/data/Makefile.am
@@ -1,7 +1,9 @@
-khotkeys_data_DATA = kde32b1.khotkeys konqueror_gestures_kde321.khotkeys printscreen.khotkeys
+khotkeys_data_DATA = kde32b1.khotkeys konqueror_gestures_kde321.khotkeys printscreen.khotkeys \
+ multimedia_keys.khotkeys
khotkeys_datadir = $(kde_datadir)/khotkeys
-khotkeys_update_DATA = khotkeys_32b1_update.upd konqueror_gestures_kde321_update.upd khotkeys_printscreen.upd
+khotkeys_update_DATA = khotkeys_32b1_update.upd konqueror_gestures_kde321_update.upd khotkeys_printscreen.upd \
+ khotkeys_multimedia_keys.upd
khotkeys_updatedir = $(kde_datadir)/kconf_update
EXTRA_DIST = $(khotkeys_data_DATA) $(khotkeys_update_DATA)
Index: khotkeys/data/khotkeys_multimedia_keys.upd
===================================================================
--- /dev/null
+++ khotkeys/data/khotkeys_multimedia_keys.upd
@@ -0,0 +1,8 @@
+Id=multimedia_keys
+# the file is intentionally a dummy, as the binary will update khotkeysrc,
+# the khotkeys_update will just remember it has been done
+File=khotkeys_update
+Group=Dummy
+Options=overwrite
+ScriptArguments=--id multimedia_keys
+Script=khotkeys_update

@ -0,0 +1,81 @@
Index: khotkeys/shared/actions.cpp
===================================================================
--- khotkeys/shared/actions.cpp.orig
+++ khotkeys/shared/actions.cpp
@@ -29,6 +29,7 @@
#include <kaccel.h>
#include <kservice.h>
#include <kprocess.h>
+#include <qregexp.h>
#include "windows.h"
#include "action_data.h"
@@ -116,7 +117,6 @@ void Command_url_action::execute()
{
if( command_url().isEmpty())
return;
- KURIFilterData uri;
QString cmd = command_url();
static bool sm_ready = false;
if( !sm_ready )
@@ -124,6 +124,9 @@ void Command_url_action::execute()
kapp->propagateSessionManager();
sm_ready = true;
}
+ if( substituteAndHandleSpecial( cmd ))
+ return;
+ KURIFilterData uri;
// int space_pos = command_url().find( ' ' );
// if( command_url()[ 0 ] != '\'' && command_url()[ 0 ] != '"' && space_pos > -1
// && command_url()[ space_pos - 1 ] != '\\' )
@@ -176,6 +179,38 @@ void Command_url_action::execute()
timeout.start( 1000, true ); // 1sec timeout
}
+// do special command substitutions, return true if also already handled
+bool Command_url_action::substituteAndHandleSpecial( QString& cmd )
+ {
+ if( cmd.contains( "KHOTKEYS_BROWSER" ))
+ { // the default browser
+ KConfig config( QString::fromLatin1("kfmclientrc")); // see KRun
+ config.setGroup("General");
+ QString browser = config.readEntry("BrowserApplication");
+ if( browser.startsWith( QString::fromLatin1( "!" )))
+ browser = browser.mid( 1 );
+ else
+ {
+ KService::Ptr service = KService::serviceByStorageId( browser );
+ if( service )
+ {
+ browser = service->exec();
+ browser.replace( QRegExp( " %.?" ), "" ); // remove " %u" and others
+ }
+ }
+ if( browser.isEmpty())
+ browser = QString::fromLatin1( "konqueror" ); // opens in webbrowsing profile by default
+ cmd = cmd.replace( "KHOTKEYS_BROWSER", browser );
+ }
+ if( cmd.contains( "KHOTKEYS_TERMINAL" ))
+ { // the default terminal application
+ KConfigGroup config( KGlobal::config(), "General" );
+ QString terminal = config.readPathEntry( "TerminalApplication", "konsole" );
+ cmd = cmd.replace( "KHOTKEYS_TERMINAL", terminal );
+ }
+ return false;
+ }
+
QString Command_url_action::description() const
{
return i18n( "Command/URL : " ) + command_url();
Index: khotkeys/shared/actions.h
===================================================================
--- khotkeys/shared/actions.h.orig
+++ khotkeys/shared/actions.h
@@ -75,6 +75,7 @@ class KDE_EXPORT Command_url_action
protected:
QTimer timeout;
private:
+ bool substituteAndHandleSpecial( QString& cmd );
QString _command_url;
};

@ -0,0 +1,57 @@
Index: kcontrol/kcontrol/KControl.desktop
===================================================================
--- kcontrol/kcontrol/KControl.desktop.orig
+++ kcontrol/kcontrol/KControl.desktop
@@ -7,7 +7,9 @@ Type=Application
DocPath=kcontrol/index.html
X-KDE-StartupNotify=true
-Name=Control Center
+GenericName=Configure Desktop
+GenericName[de]=Desktop-Einstellungen
+Name=Personal Settings
Name[af]=Beheer Sentrum
Name[ar]=مركز التحكم
Name[az]=İdarə Mərkəzi
@@ -93,3 +95,4 @@ Name[zu]=Indawo Yokulawula
X-DCOP-ServiceType=Unique
Categories=Qt;KDE;Core;
+Keywords=control,center
Index: kicker/libkicker/kickerSettings.kcfg
===================================================================
--- kicker/libkicker/kickerSettings.kcfg.orig
+++ kicker/libkicker/kickerSettings.kcfg
@@ -159,7 +159,7 @@
<entry name="MenuExtensions" key="Extensions" type="StringList" >
<label>Optional Menus</label>
- <default>prefmenu.desktop,systemmenu.desktop</default>
+ <default>recentdocs.desktop,systemmenu.desktop</default>
</entry>
<entry name="RecentAppsStat" type="StringList" >
Index: kicker/menuext/system/systemmenu.desktop
===================================================================
--- kicker/menuext/system/systemmenu.desktop.orig
+++ kicker/menuext/system/systemmenu.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-Name=System Menu
+Name=My System
Name[af]=Stelsel Kieslys
Name[ar]=قائمة النظام
Name[be]=Сістэмнае меню
Index: kcontrol/kicker/hidingtab_impl.cpp
===================================================================
--- kcontrol/kicker/hidingtab_impl.cpp.orig
+++ kcontrol/kicker/hidingtab_impl.cpp
@@ -200,7 +200,7 @@ void HidingTab::defaults()
m_delaySpinBox->setValue( 3 );
m_autoHideSwitch->setChecked( false );
m_lHB->setChecked( false );
- m_rHB->setChecked( true );
+ m_rHB->setChecked( false );
m_animateHiding->setChecked( true );
m_hideSlider->setValue( 10 );
m_delaySpinBox->setValue( 3 );

@ -0,0 +1,63 @@
[ServiceMenuButton_1]
Label=work/
RelPath=work/
[buttons]
EnableIconZoom=false
EnableTileBackground=false
[menus]
DetailedMenuEntries=false
ReduceMenuDepth=true
ShowUnimportantEntries=false
[Applet_1]
DesktopFile=minipagerapplet.desktop
FreeSpace=0.25
[Applet_2]
ConfigFile=taskbar_panelappletrc
DesktopFile=taskbarapplet.desktop
FreeSpace=0.25
[Applet_3]
ConfigFile=systemtray_panelappletrc
DesktopFile=systemtrayapplet.desktop
FreeSpace=1
[Applet_4]
DesktopFile=clockapplet.desktop
FreeSpace=1
[General]
Applets=KMenuButton_1,ServiceMenuButton_1,ServiceButton_2,ServiceButton_1,ServiceButton_6,ServiceButton_3,ServiceButton_4,Applet_1,Applet_2,Applet_3,Applet_4
CustomSize=58
# this size gets converted to "3" via kconf_update
Size=58
[KFileDialog Speedbar]
Speedbar IconSize=32
[KMenuButton_1]
FreeSpace=0
[ServiceButton_1]
DesktopFile=System/konsole.desktop
FreeSpace=0
[ServiceButton_2]
DesktopFile=Home.desktop
FreeSpace=0
[ServiceButton_3]
DesktopFile=Internet/konqbrowser.desktop
FreeSpace=0
[ServiceButton_4]
DesktopFile=Internet/KMail.desktop
FreeSpace=0
[ServiceButton_6]
DesktopFile=Help.desktop
FreeSpace=0

File diff suppressed because it is too large Load Diff

@ -0,0 +1,25 @@
--- kicker/kicker/ui/k_new_mnu.cpp 2007/08/08 15:14:50 1.141
+++ kicker/kicker/ui/k_new_mnu.cpp 2007/08/08 15:39:58
@@ -1345,6 +1345,9 @@
KService::Ptr p = KService::serviceByStorageId("/usr/share/applications/YaST.desktop");
m_systemView->insertMenuItem(p, nId++, index++);
+ p = KService::serviceByStorageId("/usr/share/applications/package-manager.desktop");
+ m_systemView->insertMenuItem(p, nId++, index++);
+
m_systemView->insertItem( "info", i18n( "System Information" ),
"sysinfo:/", "sysinfo:/", nId++, index++ );
--- kicker/kicker/ui/itemview.cpp 2007/08/08 15:14:50 1.141
+++ kicker/kicker/ui/itemview.cpp 2007/08/08 15:59:35
@@ -139,7 +139,9 @@
void KMenuItem::setIcon(const QString& icon, int size)
{
m_icon = icon;
- QListViewItem::setPixmap(0, KGlobal::iconLoader()->loadIcon(icon, KIcon::Panel, size ));
+ QPixmap pixmap = KGlobal::iconLoader()->loadIcon(icon, KIcon::Panel, size, KIcon::DefaultState, 0L, true);
+ if (!pixmap.isNull())
+ QListViewItem::setPixmap(0, pixmap);
}
void KMenuItem::setHasChildren( bool flag )

@ -0,0 +1,217 @@
--- menutab_impl.h (revision 755866)
+++ menutab_impl.h (revision 774645)
@@ -62,6 +62,7 @@ signals:
public slots:
void launchMenuEditor();
+ void menuStyleChanged();
protected:
kSubMenuItem *m_bookmarkMenu;
--- kicker_config_hiding.desktop (revision 755866)
+++ kicker_config_hiding.desktop (revision 774645)
@@ -146,7 +146,7 @@ Keywords[csb]=kicker,panel,kpanel,lëst<73>
Keywords[cy]=ciciwr,kicker,panel,kpanel,bar tasgau,bar cychwyn,bar lansio,lleoliad,maint,awto-guddio,hunan-guddio,cuddio,botymau,animeiddiad,cefndir,themâu,storfa dewislen, storfa,cache,celc,cudd,K-Menu,nodau tudalen,dogfenni diweddar,porydd cyflym,dewislen porydd,dewislen,eiconau,teiliau,rhaglenigion,ymcychwyn,amlygu,carnau,eiconau chwyddo
Keywords[da]=kicker,panel,kpanel,opgavelinje,startlinje,sted,størrelse,autogem,gem,knapper,animering,baggrund,temaer,menucache,cache,skjult,K-Menu,bogmærker,nylige dokumenter,hurtigsøger,søgemenu,menu,ikoner,fliser,panelprogrammer,opstart,markér,håndterer,ikoner
Keywords[de]=Kicker,Panel,Taskbar,Kontrollleiste,Startleiste,Klickstartleiste,Fensterleiste,Autom. ausblenden,Ausblenden, Knöpfe,Animation,Hintergründe,Stile,Design,Themes,Menü-Zwischenspeicher, K-Menü,Zwischenspeicher,Lesezeichen,Zuletzt geöffnete Dateien, Schnellanzeiger,Menüs,Symbole,Icons,Kacheln,Applets,Miniprogramme, Java-Miniprogramme,Hervorhebung,Anfasser,Sicherheitsstufen,Zoom für Symbole
-Keywords[el]=kicker,πίνακας,kpanel,γραμμή εργασιών,γραμμή έναρξης,γραμμή εκκίνησης,τοποθεσία,μέγεθος,αυτόματη απόκρυψη,απόκρυψη,κουμπιά,εφέ κίνησης,φόντο,θέματα,λανθάνουσα μνήμη μενού,λανθάνουσα μνήμη,κρυφό, K-Μενού,σελιδοδείκτες,πρόσφατα έγγραφα,γρήγορος εξερευνητής,μενού εξερευνητή,μενού,εικονίδια,tiles,μικροεφαρμογές,έναρξη,τονισμός,χειριστήρια, μεγέθυνση εικονιδίων
+Keywords[el]=kicker,πίνακας,kpanel,γραμμή εργασιών,γραμμή έναρξης,γραμμή εκκίνησης,τοποθεσία,μέγεθος,αυτόματη απόκρυψη,απόκρυψη,κουμπιά,εφέ κίνησης,φόντο,θέματα,λανθάνουσα μνήμη μενού,λανθάνουσα μνήμη,κρυφό, K-Μενού,σελιδοδείκτες,πρόσφατα έγγραφα,γρήγορος εξερευνητής,μενού εξερευνητή,μενού,εικονίδια,tiles,εφαρμογίδια,έναρξη,τονισμός,χειριστήρια, μεγέθυνση εικονιδίων
Keywords[eo]=lanĉilo,panelo,tasklistelo,situo,grandeco,aŭtokaŝo,kaŝo,butono,fono,etoso,menubufro,K-Menuo,legosigno,lasta dokumento,rapidrigardilo,rigardmenuo,piktogramo,kahelo,aplikaĵo,lanĉo,emfazo,teniloj,pligrandigo,fidindaj aplikaĵetoj,sekurecnivelo
Keywords[es]=kicker,panel,kpanel,barra de tareas,barra de inicio,barra de lanzamiento,dirección,tamaño,auto ocultar,ocultar,botones,animación,fondo,temas,caché de menú,caché,oculto,Menú K,marcadores,documentos recientes,navegador rápido,menú navegador,menú,iconos,mosaicos,miniaplicaciones,arranque,resaltado,asas,iconos ampliados
Keywords[et]=kicker,paneel,kpanel,tegumiriba,käivitusriba,asukoht,suurus,terminal,automaatne peitmine,peitmine,nupud,animatsioon,taust,teemad,menüü vahemälu,vahemälu,peidetud,K-menüü,järjehoidjad,viimati kasutatud dokumendid, kiirbrauser,lehitsemise menüü,menüü,ikoonid,apletid,käivitamine,esiletõstmine,piirded,ikoonide suurendamine,usaldusväärsed apletid,turvatase
--- menutab_impl.cpp (revision 755866)
+++ menutab_impl.cpp (revision 774645)
@@ -16,12 +16,16 @@
*/
#include <qcheckbox.h>
+#include <qgroupbox.h>
#include <qdir.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qpushbutton.h>
#include <qradiobutton.h>
+#include <qcombobox.h>
+#include <qbuttongroup.h>
+#include <dcopref.h>
#include <kapplication.h>
#include <kdebug.h>
#include <kdesktopfile.h>
@@ -123,12 +127,41 @@ void MenuTab::load( bool useDefaults )
}
}
+ c->setGroup("General");
+ m_comboMenuStyle->setCurrentItem( c->readBoolEntry("LegacyKMenu", false) ? 1 : 0 );
+ m_openOnHover->setChecked( c->readBoolEntry("OpenOnHover", true) );
+ menuStyleChanged();
+
+ connect(m_comboMenuStyle, SIGNAL(activated(int)), SIGNAL(changed()));
+ connect(m_comboMenuStyle, SIGNAL(activated(int)), SLOT(menuStyleChanged()));
+ connect(m_openOnHover, SIGNAL(clicked()), SIGNAL(changed()));
+
m_showFrequent->setChecked(true);
if ( useDefaults )
emit changed();
}
+void MenuTab::menuStyleChanged()
+{
+ if (m_comboMenuStyle->currentItem()==1) {
+ m_openOnHover->setEnabled(false);
+ m_subMenus->setEnabled(true);
+ kcfg_UseSidePixmap->setEnabled(true);
+ kcfg_MenuEntryFormat->setEnabled(true);
+ kcfg_RecentVsOften->setEnabled(true);
+ m_showFrequent->setEnabled(true);
+ }
+ else {
+ m_openOnHover->setEnabled(true);
+ m_subMenus->setEnabled(false);
+ kcfg_UseSidePixmap->setEnabled(false);
+ kcfg_MenuEntryFormat->setEnabled(false);
+ kcfg_RecentVsOften->setEnabled(false);
+ m_showFrequent->setEnabled(false);
+ }
+}
+
void MenuTab::save()
{
KSharedConfig::Ptr c = KSharedConfig::openConfig(KickerConfig::the()->configName());
@@ -154,8 +187,17 @@ void MenuTab::save()
}
}
c->writeEntry("Extensions", ext);
+ c->setGroup("General");
+ bool kmenusetting = m_comboMenuStyle->currentItem()==1;
+ bool oldkmenusetting = c->readBoolEntry("LegacyKMenu", false);
+
+ c->writeEntry("LegacyKMenu", kmenusetting);
+ c->writeEntry("OpenOnHover", m_openOnHover->isChecked());
c->sync();
+
+ if (kmenusetting != oldkmenusetting)
+ DCOPRef ("kicker", "default").call("restart()");
}
void MenuTab::defaults()
--- menutab.ui (revision 755866)
+++ menutab.ui (revision 774645)
@@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>410</width>
- <height>437</height>
+ <width>923</width>
+ <height>649</height>
</rect>
</property>
<vbox>
@@ -19,6 +19,59 @@
<property name="margin">
<number>0</number>
</property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Start menu style:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>comboMenuStyle</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <item>
+ <property name="text">
+ <string>SUSE</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>KDE</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>m_comboMenuStyle</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
<widget class="QGroupBox">
<property name="name">
<cstring>m_kmenuGroup</cstring>
@@ -38,6 +91,14 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>m_openOnHover</cstring>
+ </property>
+ <property name="text">
+ <string>Open menu on mouse hover</string>
+ </property>
+ </widget>
<widget class="QButtonGroup">
<property name="name">
<cstring>kcfg_MenuEntryFormat</cstring>
@@ -377,6 +438,8 @@
</widget>
</vbox>
</widget>
+<customwidgets>
+</customwidgets>
<tabstops>
<tabstop>m_formatSimple</tabstop>
<tabstop>m_formatNameDesc</tabstop>
@@ -400,8 +463,5 @@
<includehints>
<includehint>klistview.h</includehint>
<includehint>knuminput.h</includehint>
- <includehint>knuminput.h</includehint>
- <includehint>knuminput.h</includehint>
- <includehint>knuminput.h</includehint>
</includehints>
</UI>
--- kicker_config_menus.desktop (revision 755866)
+++ kicker_config_menus.desktop (revision 774645)
@@ -143,7 +143,7 @@ Keywords[csb]=kicker,panel,kpanel,lëst<73>
Keywords[cy]=ciciwr,kicker,panel,kpanel,bar tasgau,bar cychwyn,bar lansio,lleoliad,maint,awto-guddio,hunan-guddio,cuddio,botymau,animeiddiad,cefndir,themâu,storfa dewislen, storfa,cache,celc,cudd,K-Menu,nodau tudalen,dogfenni diweddar,porydd cyflym,dewislen porydd,dewislen,eiconau,teiliau,rhaglenigion,ymcychwyn,amlygu,carnau,eiconau chwyddo
Keywords[da]=kicker,panel,kpanel,opgavelinje,startlinje,sted,størrelse,autogem,gem,knapper,animering,baggrund,temaer,menucache,cache,skjult,K-Menu,bogmærker,nylige dokumenter,hurtigsøger,søgemenu,menu,ikoner,fliser,panelprogrammer,opstart,markér,håndterer,ikoner
Keywords[de]=Kicker,Panel,Taskbar,Kontrollleiste,Startleiste,Klickstartleiste,Fensterleiste,Autom. ausblenden,Ausblenden, Knöpfe,Animation,Hintergründe,Stile,Design,Themes,Menü-Zwischenspeicher, K-Menü,Zwischenspeicher,Lesezeichen,Zuletzt geöffnete Dateien, Schnellanzeiger,Menüs,Symbole,Icons,Kacheln,Applets,Miniprogramme, Java-Miniprogramme,Hervorhebung,Anfasser,Sicherheitsstufen,Zoom für Symbole
-Keywords[el]=kicker,πίνακας,kpanel,γραμμή εργασιών,γραμμή έναρξης,γραμμή εκκίνησης,τοποθεσία,μέγεθος,αυτόματη απόκρυψη,απόκρυψη,κουμπιά,εφέ κίνησης,φόντο,θέματα,λανθάνουσα μνήμη μενού,λανθάνουσα μνήμη,κρυφό, K-Μενού,σελιδοδείκτες,πρόσφατα έγγραφα,γρήγορος εξερευνητής,μενού εξερευνητή,μενού,εικονίδια,tiles,μικροεφαρμογές,έναρξη,τονισμός,χειριστήρια, μεγέθυνση εικονιδίων
+Keywords[el]=kicker,πίνακας,kpanel,γραμμή εργασιών,γραμμή έναρξης,γραμμή εκκίνησης,τοποθεσία,μέγεθος,αυτόματη απόκρυψη,απόκρυψη,κουμπιά,εφέ κίνησης,φόντο,θέματα,λανθάνουσα μνήμη μενού,λανθάνουσα μνήμη,κρυφό, K-Μενού,σελιδοδείκτες,πρόσφατα έγγραφα,γρήγορος εξερευνητής,μενού εξερευνητή,μενού,εικονίδια,tiles,εφαρμογίδια,έναρξη,τονισμός,χειριστήρια, μεγέθυνση εικονιδίων
Keywords[eo]=lanĉilo,panelo,tasklistelo,situo,grandeco,aŭtokaŝo,kaŝo,butono,fono,etoso,menubufro,K-Menuo,legosigno,lasta dokumento,rapidrigardilo,rigardmenuo,piktogramo,kahelo,aplikaĵo,lanĉo,emfazo,teniloj,pligrandigo,fidindaj aplikaĵetoj,sekurecnivelo
Keywords[es]=kicker,panel,kpanel,barra de tareas,barra de inicio,barra de lanzamiento,dirección,tamaño,auto ocultar,ocultar,botones,animación,fondo,temas,caché de menú,caché,oculto,Menú K,marcadores,documentos recientes,navegador rápido,menú navegador,menú,iconos,mosaicos,miniaplicaciones,arranque,resaltado,asas,iconos ampliados
Keywords[et]=kicker,paneel,kpanel,tegumiriba,käivitusriba,asukoht,suurus,terminal,automaatne peitmine,peitmine,nupud,animatsioon,taust,teemad,menüü vahemälu,vahemälu,peidetud,K-menüü,järjehoidjad,viimati kasutatud dokumendid, kiirbrauser,lehitsemise menüü,menüü,ikoonid,apletid,käivitamine,esiletõstmine,piirded,ikoonide suurendamine,usaldusväärsed apletid,turvatase

File diff suppressed because it is too large Load Diff

@ -0,0 +1,18 @@
Index: kioslave/media/mediaimpl.cpp
===================================================================
--- kioslave/media/mediaimpl.cpp.orig
+++ kioslave/media/mediaimpl.cpp
@@ -274,6 +274,13 @@ bool MediaImpl::ensureMediumMounted(Medi
return m_lastErrorCode==0;
}
+ if (medium.id().isEmpty())
+ {
+ m_lastErrorCode = KIO::ERR_COULD_NOT_MOUNT;
+ m_lastErrorMessage = i18n("No such medium.");
+ return false;
+ }
+
return true;
}

@ -0,0 +1,22 @@
Index: klipper/klipperrc.desktop
===================================================================
--- klipper/klipperrc.desktop.orig
+++ klipper/klipperrc.desktop
@@ -232,7 +232,7 @@ Number of commands=5
Regexp=^https?://.
[Action_1/Command_0]
-Commandline=kfmclient exec %s
+Commandline=kfmclient openURL %s
Description=Open with &Konqueror
Description[af]=Maak oop met Konqueror
Description[ar]=إفتح بــ &Konqueror
@@ -1644,7 +1644,7 @@ Number of commands=5
Regexp=^ftp://.
[Action_6/Command_0]
-Commandline=kfmclient exec %s
+Commandline=kfmclient openURL %s
Description=Open with &Konqueror
Description[af]=Maak oop met Konqueror
Description[ar]=إفتح بــ &Konqueror

@ -0,0 +1,342 @@
Index: kicker/kicker/ui/k_mnu.cpp
===================================================================
--- kicker/kicker/ui/k_mnu.cpp.orig
+++ kicker/kicker/ui/k_mnu.cpp
@@ -26,9 +26,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include <unistd.h>
#include <dmctl.h>
+#include <qhbox.h>
#include <qimage.h>
+#include <qlabel.h>
#include <qpainter.h>
#include <qstyle.h>
+#include <qtimer.h>
+#include <qtooltip.h>
#include <dcopclient.h>
#include <kapplication.h>
@@ -40,9 +44,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kiconloader.h>
+#include <klineedit.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
+#include <ktoolbarbutton.h>
#include <kwin.h>
#include "client_mnu.h"
@@ -58,9 +64,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include "quickbrowser_mnu.h"
#include "recentapps.h"
+
#include "k_mnu.h"
#include "k_mnu.moc"
+const int PanelKMenu::searchLineID(23140 /*whatever*/);
+
PanelKMenu::PanelKMenu()
: PanelServiceMenu(QString::null, QString::null, 0, "KMenu")
, bookmarkMenu(0)
@@ -165,6 +174,26 @@ void PanelKMenu::paletteChanged()
}
}
+
+/* A MenuHBox is supposed to be inserted into a menu.
+ * You can set a special widget in the hbox which will
+ * get the focus if the user moves up or down with the
+ * cursor keys
+ */
+class MenuHBox : public QHBox {
+public:
+ MenuHBox(PanelKMenu* parent) : QHBox(parent)
+ {
+ }
+
+ virtual void keyPressEvent(QKeyEvent *e)
+ {
+
+ }
+private:
+ PanelKMenu *parent;
+};
+
void PanelKMenu::initialize()
{
// kdDebug(1210) << "PanelKMenu::initialize()" << endl;
@@ -191,13 +220,29 @@ void PanelKMenu::initialize()
// add services
PanelServiceMenu::initialize();
+ // Insert search field
+ QHBox* hbox = new QHBox( this );
+ KToolBarButton *clearButton = new KToolBarButton( "locationbar_erase", 0, hbox );
+ searchEdit = new KLineEdit(hbox); searchEdit->setClickMessage(" "+i18n("Press '/' to search..."));
+ hbox->setFocusPolicy(QWidget::StrongFocus);
+ hbox->setFocusProxy(searchEdit);
+ hbox->setSpacing( 3 );
+ connect(clearButton, SIGNAL(clicked()), searchEdit, SLOT(clear()));
+ connect(this, SIGNAL(aboutToHide()), this, SLOT(slotClearSearch()));
+ connect(searchEdit, SIGNAL(textChanged(const QString&)),
+ this, SLOT( slotUpdateSearch( const QString&)));
+ insertItem(hbox, searchLineID, 0);
+
+ //QToolTip::add(clearButton, i18n("Clear Search"));
+ //QToolTip::add(searchEdit, i18n("Enter the name of an application"));
+
if (KickerSettings::showMenuTitles())
{
int id;
id = insertItem(new PopupMenuTitle(i18n("All Applications"), font()), -1 /* id */, 0);
- setItemEnabled( id, false );
+ setItemEnabled(id, false);
id = insertItem(new PopupMenuTitle(i18n("Actions"), font()), -1 /* id */, -1);
- setItemEnabled( id, false );
+ setItemEnabled(id, false);
}
// create recent menu section
@@ -737,3 +782,43 @@ void PanelKMenu::clearRecentMenuItems()
}
+void PanelKMenu::slotUpdateSearch(const QString& searchString)
+{
+ kdDebug() << "Searching for " << searchString << endl;
+ setSearchString(searchString);
+}
+
+void PanelKMenu::slotClearSearch()
+{
+ if (searchEdit && searchEdit->text().isEmpty() == false) {
+ QTimer::singleShot(0, searchEdit, SLOT(clear()));
+ }
+}
+
+void PanelKMenu::keyPressEvent(QKeyEvent* e)
+{
+ // We move the focus to the search field if the
+ // user presses '/'. This is the same shortcut as
+ // konqueror is using, and afaik it's hardcoded both
+ // here and there. This sucks badly for many non-us
+ // keyboard layouts, but for the sake of consistency
+ // we follow konqueror.
+ if (!searchEdit) return KPanelMenu::keyPressEvent(e);
+
+ if (e->key() == Qt::Key_Slash && !searchEdit->hasFocus()) {
+ if (indexOf(searchLineID) >=0 ) {
+ setActiveItem(indexOf(searchLineID));
+ }
+ }
+ else if (e->key() == Qt::Key_Escape && searchEdit->text().isEmpty() == false) {
+ searchEdit->clear();
+ }
+ else if (e->key() == Qt::Key_Delete && !searchEdit->hasFocus() &&
+ searchEdit->text().isEmpty() == false)
+ {
+ searchEdit->clear();
+ }
+ else {
+ KPanelMenu::keyPressEvent(e);
+ }
+}
Index: kicker/kicker/ui/k_mnu.h
===================================================================
--- kicker/kicker/ui/k_mnu.h.orig
+++ kicker/kicker/ui/k_mnu.h
@@ -73,6 +73,8 @@ protected slots:
void slotSaveSession();
void slotRunCommand();
void slotEditUserContact();
+ void slotUpdateSearch(const QString &searchtext);
+ void slotClearSearch();
void paletteChanged();
virtual void configChanged();
void updateRecent();
@@ -89,6 +91,8 @@ protected:
void doNewSession(bool lock);
void createRecentMenuItems();
virtual void clearSubmenus();
+ void filterMenu(PanelServiceMenu* menu, const QString &searchString);
+ void keyPressEvent(QKeyEvent* e);
private:
QPopupMenu *sessionsMenu;
@@ -101,6 +105,8 @@ private:
KActionCollection *actionCollection;
KBookmarkOwner *bookmarkOwner;
PopupMenuList dynamicSubMenus;
+ KLineEdit *searchEdit;
+ static const int searchLineID;
};
#endif
Index: kicker/kicker/ui/service_mnu.cpp
===================================================================
--- kicker/kicker/ui/service_mnu.cpp.orig
+++ kicker/kicker/ui/service_mnu.cpp
@@ -26,6 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include <qbitmap.h>
#include <qpixmap.h>
#include <qimage.h>
+#include <qmap.h>
#include <dcopclient.h>
#include <kapplication.h>
@@ -100,6 +101,8 @@ void PanelServiceMenu::initialize()
clear();
clearSubmenus();
+ searchSubMenuIDs.clear();
+ searchMenuItems.clear();
doInitialize();
}
@@ -296,6 +299,10 @@ void PanelServiceMenu::fillMenu(KService
int newId = insertItem(iconset, groupCaption, m, id++);
entryMap_.insert(newId, static_cast<KSycocaEntry*>(g));
+ // This submenu will be searched when applying a search string
+ searchSubMenuIDs[m] = newId;
+ // Also search the submenu name itself
+ searchMenuItems.insert(newId);
// We have to delete the sub menu our selves! (See Qt docs.)
subMenus.append(m);
}
@@ -308,6 +315,7 @@ void PanelServiceMenu::fillMenu(KService
}
KService::Ptr s(static_cast<KService *>(e));
+ searchMenuItems.insert(id);
insertMenuItem(s, id++, -1, &suppressGenericNames, QString::null, specialTitle[s->name()], categoryIcon[s->name()] );
}
else if (e->isType(KST_KServiceSeparator))
@@ -900,6 +908,8 @@ void PanelServiceMenu::slotClear()
delete *it;
}
subMenus.clear();
+ searchSubMenuIDs.clear();
+ searchMenuItems.clear();
}
void PanelServiceMenu::selectFirstItem()
@@ -924,3 +934,72 @@ void PanelServiceMenu::updateRecentlyUse
RecentlyLaunchedApps::the().m_bNeedToUpdate = true;
}
+void PanelServiceMenu::setSearchString(const QString &searchString)
+{
+ // We must initialize the menu, because it might have not been opened before
+ initialize();
+
+ bool foundSomething = false;
+ std::set<int> nonemptyMenus;
+ std::set<int>::const_iterator menuItemIt(searchMenuItems.begin());
+ // Apply the filter on this menu
+ for (; menuItemIt != searchMenuItems.end(); ++menuItemIt) {
+ int id = *menuItemIt;
+ KService* s = dynamic_cast< KService* >( static_cast< KSycocaEntry* >( entryMap_[ id ]));
+ QString menuText = text(id);
+ if (menuText.contains(searchString, false) > 0
+ || ( s != NULL && ( s->name().contains(searchString, false) > 0
+ || s->exec().contains(searchString, false) > 0
+ || s->comment().contains(searchString, false) > 0
+ || s->genericName().contains(searchString, false) > 0
+ || s->exec().contains(searchString, false) > 0 )
+ )) {
+ setItemEnabled(id, true);
+ foundSomething = true;
+ nonemptyMenus.insert(id);
+ }
+ else {
+ setItemEnabled(id, false);
+ }
+ }
+ // Apply the filter on this menu
+ /*for (int i=count()-1; i>=0; --i) {
+ int id = idAt(i);
+ QString menuText = text(id);
+ if (menuText.contains(searchString, false) > 0) {
+ setItemEnabled(id, true);
+ foundSomething = true;
+ nonemptyMenus.insert(id);
+ }
+ else {
+ setItemEnabled(id, false);
+ }
+ }*/
+
+ PanelServiceMenuMap::iterator it(searchSubMenuIDs.begin());
+ // Apply the search filter on submenus
+ for (; it != searchSubMenuIDs.end(); ++it) {
+ it.key()->setSearchString(searchString);
+ if (nonemptyMenus.find(it.data()) != nonemptyMenus.end()) {
+ // if the current menu is a match already, we don't
+ // block access to the contained items
+ setItemEnabled(it.data(), true);
+ it.key()->setSearchString(QString());
+ foundSomething = true;
+ }
+ else if (it.key()->hasSearchResults()) {
+ setItemEnabled(it.data(), true);
+ foundSomething = true;
+ }
+ else {
+ setItemEnabled(it.data(), false);
+ }
+ }
+
+ hasSearchResults_ = foundSomething;
+}
+
+bool PanelServiceMenu::hasSearchResults()
+{
+ return hasSearchResults_;
+}
Index: kicker/kicker/ui/service_mnu.h
===================================================================
--- kicker/kicker/ui/service_mnu.h.orig
+++ kicker/kicker/ui/service_mnu.h
@@ -26,6 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include <qmap.h>
#include <qvaluevector.h>
+#include <set>
#include <ksycocaentry.h>
#include <kservice.h>
@@ -41,8 +42,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE
* @author Rik Hemsley <rik@kde.org>
*/
+class KLineEdit;
typedef QMap<int, KSycocaEntry::Ptr> EntryMap;
typedef QValueVector<QPopupMenu*> PopupMenuList;
+class PanelServiceMenu;
+typedef QMap<PanelServiceMenu*,int> PanelServiceMenuMap;
class KDE_EXPORT PanelServiceMenu : public KPanelMenu
{
@@ -63,6 +67,8 @@ public:
virtual void showMenu();
bool highlightMenuItem( const QString &menuId );
void selectFirstItem();
+ void setSearchString(const QString& searchString);
+ bool hasSearchResults();
private:
void fillMenu( KServiceGroup::Ptr &_root, KServiceGroup::List &_list,
@@ -115,6 +121,9 @@ protected:
bool addmenumode_;
QPoint startPos_;
PopupMenuList subMenus;
+ PanelServiceMenuMap searchSubMenuIDs;
+ bool hasSearchResults_;
+ std::set<int> searchMenuItems;
private slots:
void slotContextMenu(int);

@ -0,0 +1,129 @@
Index: kicker/kicker/ui/k_mnu.cpp
===================================================================
--- kicker/kicker/ui/k_mnu.cpp.orig
+++ kicker/kicker/ui/k_mnu.cpp
@@ -771,6 +771,7 @@ void PanelKMenu::updateRecent()
insertSeparator(RecentlyLaunchedApps::the().m_nNumMenuItems);
}
}
+ iconsLoaded_ = false;
}
void PanelKMenu::clearRecentMenuItems()
Index: kicker/kicker/ui/service_mnu.cpp
===================================================================
--- kicker/kicker/ui/service_mnu.cpp.orig
+++ kicker/kicker/ui/service_mnu.cpp
@@ -63,13 +63,20 @@ PanelServiceMenu::PanelServiceMenu(const
insertInlineHeader_( insertInlineHeader ),
clearOnClose_(false),
addmenumode_(addmenumode),
- popupMenu_(0)
+ popupMenu_(0),
+ iconsLoaded_(false)
{
excludeNoDisplay_=true;
connect(KSycoca::self(), SIGNAL(databaseChanged()),
SLOT(slotClearOnClose()));
connect(this, SIGNAL(aboutToHide()), this, SLOT(slotClose()));
+
+ const int iconSize = KickerSettings::menuEntryHeight();
+ QPixmap pix(iconSize,iconSize);
+ QBitmap map(iconSize,iconSize,true);
+ pix.setMask(map);
+ emptyiconset = QIconSet(pix,pix);
}
PanelServiceMenu::~PanelServiceMenu()
@@ -103,6 +110,7 @@ void PanelServiceMenu::initialize()
clearSubmenus();
searchSubMenuIDs.clear();
searchMenuItems.clear();
+ iconsLoaded_ = false;
doInitialize();
}
@@ -289,15 +297,13 @@ void PanelServiceMenu::fillMenu(KService
newSubMenu(g->name(), g->relPath(), this, g->name().utf8(), inlineHeaderName);
m->setCaption(groupCaption);
- QIconSet iconset = KickerLib::menuIconSet(g->icon());
-
if (separatorNeeded)
{
insertSeparator();
separatorNeeded = false;
}
- int newId = insertItem(iconset, groupCaption, m, id++);
+ int newId = insertItem(emptyiconset,groupCaption, m, id++);
entryMap_.insert(newId, static_cast<KSycocaEntry*>(g));
// This submenu will be searched when applying a search string
searchSubMenuIDs[m] = newId;
@@ -392,6 +398,12 @@ void PanelServiceMenu::doInitialize()
void PanelServiceMenu::configChanged()
{
+ const int iconSize = KickerSettings::menuEntryHeight();
+ QPixmap pix(iconSize,iconSize);
+ QBitmap map(iconSize,iconSize,true);
+ pix.setMask(map);
+ emptyiconset = QIconSet(pix,pix);
+
deinitialize();
}
@@ -456,9 +468,9 @@ void PanelServiceMenu::insertMenuItem(KS
int newId;
if ( label.isEmpty() )
- newId = insertItem(KickerLib::menuIconSet(s->icon()), serviceName, nId, nIndex);
+ newId = insertItem(emptyiconset, serviceName, nId, nIndex);
else
- newId = insertItem(KickerLib::menuIconSet(s->icon()), label, nId, nIndex);
+ newId = insertItem(emptyiconset, label, nId, nIndex);
entryMap_.insert(newId, static_cast<KSycocaEntry*>(s));
}
@@ -1003,3 +1015,23 @@ bool PanelServiceMenu::hasSearchResults(
{
return hasSearchResults_;
}
+
+void PanelServiceMenu::slotAboutToShow()
+{
+ KPanelMenu::slotAboutToShow();
+
+ if (!iconsLoaded_) {
+ EntryMap::Iterator mapIt;
+ for ( mapIt = entryMap_.begin(); mapIt != entryMap_.end(); ++mapIt ) {
+ KService *s = dynamic_cast<KService *>(static_cast<KSycocaEntry*>(mapIt.data()));
+ if (s)
+ changeItem(mapIt.key(),KickerLib::menuIconSet(s->icon()),text(mapIt.key()));
+ else {
+ KServiceGroup *g = dynamic_cast<KServiceGroup *>(static_cast<KSycocaEntry*>(mapIt.data()));
+ if (g)
+ changeItem(mapIt.key(),KickerLib::menuIconSet(g->icon()),text(mapIt.key()));
+ }
+ }
+ iconsLoaded_ = true;
+ }
+}
Index: kicker/kicker/ui/service_mnu.h
===================================================================
--- kicker/kicker/ui/service_mnu.h.orig
+++ kicker/kicker/ui/service_mnu.h
@@ -124,9 +124,12 @@ protected:
PanelServiceMenuMap searchSubMenuIDs;
bool hasSearchResults_;
std::set<int> searchMenuItems;
+ QIconSet emptyiconset;
+ bool iconsLoaded_;
private slots:
void slotContextMenu(int);
+ void slotAboutToShow();
private:
enum ContextMenuEntry { AddItemToPanel, EditItem, AddMenuToPanel, EditMenu,

@ -0,0 +1,7 @@
--- knetattach/knetattach.desktop 2008/12/02 13:49:00 1.1
+++ knetattach/knetattach.desktop 2008/12/02 14:06:16
@@ -80,3 +80,4 @@
X-KDE-StartupNotify=true
Categories=Qt;KDE;Network;
DocPath=knetattach/index.html
+OnlyShowIn=KDE;

@ -0,0 +1,34 @@
Index: kwin/kcmkwin/kwinoptions/windows.cpp
===================================================================
--- kwin/kcmkwin/kwinoptions/windows.cpp.orig
+++ kwin/kcmkwin/kwinoptions/windows.cpp
@@ -46,6 +46,7 @@
#include <kprocess.h>
#include <qtabwidget.h>
+#include <stdlib.h>
#include <X11/X.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -1524,6 +1525,8 @@ void KTranslucencyConfig::load( void )
movingWindowOpacity->setEnabled(movingWindowTransparency->isChecked());
dockWindowOpacity->setEnabled(dockWindowTransparency->isChecked());
+ if( !QFile::exists( QDir::homeDirPath() + "/.xcompmgrrc" ))
+ system( "/bin/cp /etc/opt/kde3/share/config/xcompmgrrc $HOME/.xcompmgrrc" );
KConfig conf_(QDir::homeDirPath() + "/.xcompmgrrc");
conf_.setGroup("xcompmgr");
Index: kwin/kompmgr/kompmgr.c
===================================================================
--- kwin/kompmgr/kompmgr.c.orig
+++ kwin/kompmgr/kompmgr.c
@@ -2431,6 +2431,8 @@ loadConfig(char *filename){
strcat(filename, home);
strcat(filename, configfile);
+ if( access( filename, R_OK ) != 0 )
+ system( "/bin/cp /etc/opt/kde3/share/config/xcompmgrrc $HOME/.xcompmgrrc" );
}
printf("trying '%s' as configfile\n\n", filename);

@ -0,0 +1,42 @@
Index: konqueror/konq_combo.h
===================================================================
--- konqueror/konq_combo.h.orig
+++ konqueror/konq_combo.h
@@ -87,6 +87,7 @@ signals:
private slots:
void slotCleared();
+ void slotRemoved( const QString& item );
void slotSetIcon( int index );
void slotActivated( const QString& text );
Index: konqueror/konq_combo.cc
===================================================================
--- konqueror/konq_combo.cc.orig
+++ konqueror/konq_combo.cc
@@ -128,6 +128,9 @@ KonqCombo::KonqCombo( QWidget *parent, c
connect( this, SIGNAL(activated( const QString& )),
SLOT(slotActivated( const QString& )) );
+ setHistoryEditorEnabled( true );
+ connect( this, SIGNAL(removed( const QString&) ), SLOT(slotRemoved( const QString& )) );
+
if ( !kapp->dcopClient()->isAttached() )
kapp->dcopClient()->attach();
}
@@ -506,6 +509,15 @@ void KonqCombo::slotCleared()
kapp->dcopClient()->send( "konqueror*", "KonquerorIface", "comboCleared(QCString)", data);
}
+void KonqCombo::slotRemoved( const QString& item )
+{
+ QByteArray data;
+ QDataStream s( data, IO_WriteOnly );
+ s << item << kapp->dcopClient()->defaultObject();
+ kapp->dcopClient()->send( "konqueror*", "KonquerorIface",
+ "removeFromCombo(QString,QCString)", data);
+}
+
void KonqCombo::removeURL( const QString& url )
{
setUpdatesEnabled( false );

@ -0,0 +1,33 @@
Index: konsole/other/BlackOnWhite.schema
===================================================================
--- konsole/other/BlackOnWhite.schema.orig
+++ konsole/other/BlackOnWhite.schema
@@ -18,11 +18,11 @@ color 1 255 255 255 1 0 # regular b
color 2 0 0 0 0 0 # regular color 0 Black
color 3 178 24 24 0 0 # regular color 1 Red
-color 4 24 178 24 0 0 # regular color 2 Green
+color 4 0 128 0 0 0 # regular color 2 Green
color 5 178 104 24 0 0 # regular color 3 Yellow
color 6 24 24 178 0 0 # regular color 4 Blue
-color 7 178 24 178 0 0 # regular color 5 Magenta
-color 8 24 178 178 0 0 # regular color 6 Cyan
+color 7 128 0 128 0 0 # regular color 5 Magenta
+color 8 16 128 128 0 0 # regular color 6 Cyan
color 9 178 178 178 0 0 # regular color 7 White
# intensive colors
@@ -34,9 +34,9 @@ color 11 255 255 255 1 0 # intensive b
color 12 104 104 104 0 0 # intensive color 0
color 13 255 84 84 0 0 # intensive color 1
-color 14 84 255 84 0 0 # intensive color 2
-color 15 255 255 84 0 0 # intensive color 3
+color 14 0 178 0 0 0 # intensive color 2
+color 15 192 193 64 0 0 # intensive color 3
color 16 84 84 255 0 0 # intensive color 4
-color 17 255 84 255 0 0 # intensive color 5
-color 18 84 255 255 0 0 # intensive color 6
+color 17 178 0 178 0 0 # intensive color 5
+color 18 55 178 178 0 0 # intensive color 6
color 19 255 255 255 0 0 # intensive color 7

@ -0,0 +1,17 @@
Index: konsole/other/x11r5.keytab
===================================================================
--- konsole/other/x11r5.keytab.orig
+++ konsole/other/x11r5.keytab
@@ -32,10 +32,10 @@ key Left -Shift : "\EOD"
key Enter : "\r"
-key Home : "\E[1~"
+key Home : "\E[H"
key Insert-Shift : "\E[2~"
key Delete : "\E[3~"
-key End : "\E[4~"
+key End : "\E[F"
key Prior -Shift : "\E[5~"
key Next -Shift : "\E[6~"

@ -0,0 +1,852 @@
Index: kdm/backend/client.c
===================================================================
--- kdm/backend/client.c.orig
+++ kdm/backend/client.c
@@ -547,6 +547,9 @@ Verify( GConvFunc gconv, int rootok )
} else
psrv = PAMService;
pdata.usecur = TRUE;
+ } else if (!strcmp( curtype, "pam" )) {
+ psrv = PAMService;
+ pdata.usecur = FALSE;
} else {
sprintf( psrvb, "%.31s-%.31s", PAMService, curtype );
psrv = psrvb;
@@ -616,7 +619,7 @@ Verify( GConvFunc gconv, int rootok )
free( msg );
V_RET_FAIL( 0 );
}
- } else if (!strcmp( curtype, "generic" )) {
+ } else if (!strcmp( curtype, "generic" ) || !strcmp(curtype, "pam")) {
if (!gconv( GCONV_USER, 0 ))
return 0;
for (curret = 0;;) {
Index: kdm/kfrontend/themer/kdmlabel.h
===================================================================
--- kdm/kfrontend/themer/kdmlabel.h.orig
+++ kdm/kfrontend/themer/kdmlabel.h
@@ -50,6 +50,7 @@ protected:
// handle switching between normal / active / prelight configurations
virtual void statusChanged();
+public:
struct LabelStruct {
QString text;
bool isTimer;
Index: kdmlib/kgreet_pam.cpp
===================================================================
--- /dev/null
+++ kdmlib/kgreet_pam.cpp
@@ -0,0 +1,668 @@
+/*
+
+Conversation widget for kdm greeter
+
+Copyright (C) 2008 Dirk Mueller <mueller@kde.org>
+
+based on classic kdm greeter:
+
+ Copyright (C) 1997, 1998, 2000 Steffen Hansen <hansen@kde.org>
+ Copyright (C) 2000-2003 Oswald Buddenhagen <ossi@kde.org>
+
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+#include "kgreet_pam.h"
+#include "themer/kdmthemer.h"
+#include "themer/kdmlabel.h"
+
+#include <klocale.h>
+#include <klineedit.h>
+#include <kpassdlg.h>
+#include <kuser.h>
+
+#include <qregexp.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qtimer.h>
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <syslog.h>
+
+//#define PAM_GREETER_DEBUG
+
+class KDMPasswordEdit : public KPasswordEdit {
+public:
+ KDMPasswordEdit( QWidget *parent ) : KPasswordEdit( parent, 0 ) {}
+ KDMPasswordEdit( KPasswordEdit::EchoModes echoMode, QWidget *parent ) : KPasswordEdit( echoMode, parent, 0 ) {}
+protected:
+ virtual void contextMenuEvent( QContextMenuEvent * ) {}
+};
+
+static FILE* log;
+static void debug(const char* fmt, ...)
+{
+ va_list lst;
+ va_start(lst, fmt);
+
+#ifdef PAM_GREETER_DEBUG
+#if 0
+ vfprintf(log, fmt, lst);
+ fflush(log);
+#else
+ char buf[6000];
+ sprintf(buf, "*** %s\n", fmt);
+ vsyslog(LOG_WARNING, buf, lst);
+#endif
+#endif
+ va_end(lst);
+}
+
+static KPasswordEdit::EchoModes echoMode;
+
+KPamGreeter::KPamGreeter( KGreeterPluginHandler *_handler,
+ KdmThemer *themer,
+ QWidget *parent, QWidget *pred,
+ const QString &_fixedEntity,
+ Function _func, Context _ctx ) :
+ QObject(),
+ KGreeterPlugin( _handler ),
+ fixedUser( _fixedEntity ),
+ func( _func ),
+ ctx( _ctx ),
+ exp( -1 ),
+ pExp( -1 ),
+ running( false )
+{
+ ctx = Login;
+
+ debug("KPamGreeter constructed\n");
+
+ m_parentWidget = parent;
+
+ KdmItem *user_entry = 0, *pw_entry = 0;
+ int line = 0;
+
+ layoutItem = 0;
+
+ if (themer &&
+ (!(user_entry = themer->findNode( "user-entry" )) ||
+ !(pw_entry = themer->findNode( "pw-entry" ))))
+ themer = 0;
+
+ m_themer = themer;
+
+ if (!themer)
+ layoutItem = new QGridLayout( 0, 0, 10 );
+
+ loginLabel = 0;
+ authLabel.clear();
+ authEdit.clear();
+ loginLabel = 0;
+ loginEdit = 0;
+ if (ctx == ExUnlock || ctx == ExChangeTok)
+ fixedUser = KUser().loginName();
+ if (func != ChAuthTok) {
+ debug("func != ChAuthTok\n");
+ debug("fixedUser: *%s*\n", fixedUser.latin1());
+
+ if (fixedUser.isEmpty()) {
+ loginEdit = new KLineEdit( parent );
+ loginEdit->setContextMenuEnabled( false );
+ connect( loginEdit, SIGNAL(lostFocus()), SLOT(slotLoginLostFocus()) );
+ connect( loginEdit, SIGNAL(lostFocus()), SLOT(slotActivity()) );
+ connect( loginEdit, SIGNAL(textChanged( const QString & )), SLOT(slotActivity()) );
+ connect( loginEdit, SIGNAL(selectionChanged()), SLOT(slotActivity()) );
+ if (pred) {
+ parent->setTabOrder( pred, loginEdit );
+ pred = loginEdit;
+ }
+ if (!getLayoutItem()) {
+ loginEdit->adjustSize();
+ user_entry->setWidget( loginEdit );
+ } else {
+ loginLabel = new QLabel( loginEdit, i18n("Username:"), parent );
+ getLayoutItem()->addWidget( loginLabel, line, 0 );
+ getLayoutItem()->addWidget( loginEdit, line++, 1 );
+ }
+ } else if (ctx != Login && ctx != Shutdown && getLayoutItem()) {
+ loginLabel = new QLabel( i18n("Username:"), parent );
+ getLayoutItem()->addWidget( loginLabel, line, 0 );
+ getLayoutItem()->addWidget( new QLabel( fixedUser, parent ), line++, 1 );
+ }
+#if 0
+ if (echoMode == -1)
+ passwdEdit = new KDMPasswordEdit( parent );
+ else
+ passwdEdit = new KDMPasswordEdit( echoMode,
+ parent );
+ connect( passwdEdit, SIGNAL(textChanged( const QString & )),
+ SLOT(slotActivity()) );
+ connect( passwdEdit, SIGNAL(lostFocus()), SLOT(slotActivity()) );
+ if (pred) {
+ parent->setTabOrder( pred, passwdEdit );
+ pred = passwdEdit;
+ }
+ if (!getLayoutItem()) {
+ passwdEdit->adjustSize();
+ pw_entry->setWidget( passwdEdit );
+ } else {
+ passwdLabel = new QLabel( passwdEdit,
+ func == Authenticate ?
+ i18n("hello &Password:") :
+ i18n("Current &password:"),
+ parent );
+ getLayoutItem()->addWidget( passwdLabel, line, 0 );
+ getLayoutItem()->addWidget( passwdEdit, line++, 1 );
+ }
+#endif
+ if (loginEdit)
+ loginEdit->setFocus();
+ }
+ if (func != Authenticate) {
+ if (echoMode == -1) {
+ authEdit << new KDMPasswordEdit( echoMode, parent );
+ authEdit << new KDMPasswordEdit( echoMode, parent );
+ } else {
+ authEdit << new KDMPasswordEdit( parent );
+ authEdit << new KDMPasswordEdit( parent );
+ }
+ authLabel << new QLabel( authEdit[0], i18n("&New password:"), parent );
+ authLabel << new QLabel( authEdit[1], i18n("Con&firm password:"), parent );
+ if (pred) {
+ parent->setTabOrder( pred, authEdit[0] );
+ parent->setTabOrder( authEdit[0], authEdit[1] );
+ }
+ if (getLayoutItem()) {
+ getLayoutItem()->addWidget( authLabel[0], line, 0 );
+ getLayoutItem()->addWidget( authEdit[0], line++, 1 );
+ getLayoutItem()->addWidget( authLabel[1], line, 0 );
+ getLayoutItem()->addWidget( authEdit[1], line, 1 );
+ }
+ if (authEdit.size() >= 2)
+ authEdit[1]->setFocus();
+ }
+}
+
+// virtual
+KPamGreeter::~KPamGreeter()
+{
+ debug("KPamGreeter::~KPamGreeter");
+ abort();
+ if (!layoutItem) {
+ delete loginEdit;
+ return;
+ }
+ QLayoutIterator it = static_cast<QLayout *>(layoutItem)->iterator();
+ for (QLayoutItem *itm = it.current(); itm; itm = ++it)
+ delete itm->widget();
+ delete layoutItem;
+ debug("destructor finished, good bye");
+}
+
+void // virtual
+KPamGreeter::loadUsers( const QStringList &users )
+{
+ KCompletion *userNamesCompletion = new KCompletion;
+ userNamesCompletion->setItems( users );
+ loginEdit->setCompletionObject( userNamesCompletion );
+ loginEdit->setAutoDeleteCompletionObject( true );
+ loginEdit->setCompletionMode( KGlobalSettings::CompletionAuto );
+}
+
+void // virtual
+KPamGreeter::presetEntity( const QString &entity, int field )
+{
+ debug("presetEntity(%s,%d) called!\n", entity.latin1(), field);
+ loginEdit->setText( entity );
+ if (field == 1 && authEdit.size() >= 1)
+ authEdit[0]->setFocus();
+ else {
+ loginEdit->setFocus();
+ loginEdit->selectAll();
+ if (field == -1 && authEdit.size() >= 1) {
+ authEdit[0]->setText( " " );
+ authEdit[0]->setEnabled( false );
+ authTok = false;
+ }
+ }
+ curUser = entity;
+}
+
+QString // virtual
+KPamGreeter::getEntity() const
+{
+ return fixedUser.isEmpty() ? loginEdit->text() : fixedUser;
+}
+
+void // virtual
+KPamGreeter::setUser( const QString &user )
+{
+ // assert( fixedUser.isEmpty() );
+ curUser = user;
+ loginEdit->setText( user );
+ if (authEdit.size() >= 1) {
+ authEdit[0]->setFocus();
+ authEdit[0]->selectAll();
+ }
+}
+
+void // virtual
+KPamGreeter::setEnabled(bool enable)
+{
+ // assert( !passwd1Label );
+ // assert( func == Authenticate && ctx == Shutdown );
+// if (loginLabel)
+// loginLabel->setEnabled( enable );
+ authEdit[0]->setEnabled( enable );
+ setActive( enable );
+ if (enable)
+ authEdit[0]->setFocus();
+ }
+
+void // private
+KPamGreeter::returnData()
+{
+ debug("*************** returnData called with exp %d\n", exp);
+
+
+ switch (exp) {
+ case 0:
+ handler->gplugReturnText( (loginEdit ? loginEdit->text() :
+ fixedUser).local8Bit(),
+ KGreeterPluginHandler::IsUser );
+ break;
+ case 1:
+ handler->gplugReturnText( authEdit[0]->password(),
+ KGreeterPluginHandler::IsPassword |
+ KGreeterPluginHandler::IsSecret );
+ break;
+ case 2:
+ handler->gplugReturnText( authEdit[1]->password(),
+ KGreeterPluginHandler::IsSecret );
+ break;
+ default: // case 3:
+ handler->gplugReturnText( authEdit[2]->password(),
+ KGreeterPluginHandler::IsNewPassword |
+ KGreeterPluginHandler::IsSecret );
+ break;
+ }
+}
+
+bool // virtual
+KPamGreeter::textMessage( const char *text, bool err )
+{
+ debug(" ************** textMessage(%s, %d)\n", text, err);
+
+ if (!authEdit.size())
+ return false;
+
+ if (getLayoutItem()) {
+ QLabel* label = new QLabel(QString::fromUtf8(text), m_parentWidget);
+ getLayoutItem()->addWidget(label, state+1, 0, 0);
+ }
+
+ return true;
+}
+
+void // virtual
+KPamGreeter::textPrompt( const char *prompt, bool echo, bool nonBlocking )
+{
+ debug("textPrompt called with prompt %s echo %d nonBlocking %d", prompt, echo, nonBlocking);
+ debug("state is %d, authEdit.size is %d\n", state, authEdit.size());
+
+ if (state == 0 && echo) {
+ if (loginLabel)
+ loginLabel->setText(QString::fromUtf8(prompt));
+ else if (m_themer) {
+ KdmLabel *kdmlabel = static_cast<KdmLabel*>(m_themer->findNode("user-label"));
+ if (kdmlabel) {
+ //userLabel->setText(QString::fromUtf8(prompt));
+ kdmlabel->label.text = QString::fromUtf8(prompt);
+ QTimer::singleShot(0, kdmlabel, SLOT(update()));
+ }
+ }
+ }
+ else if (state >= authEdit.size()) {
+ if (getLayoutItem()) {
+ QLabel* label = new QLabel(QString::fromUtf8(prompt), m_parentWidget);
+ getLayoutItem()->addWidget(label, state+1, 0, 0);
+ debug("added label widget to layout");
+ }
+ else if (m_themer) {
+ debug("themer found!");
+ KdmItem *pw_label = 0;
+
+ KdmLabel *kdmlabel = static_cast<KdmLabel*>(m_themer->findNode("pw-label"));
+ if (kdmlabel) {
+ //userLabel->setText(QString::fromUtf8(prompt));
+ QString str = QString::fromUtf8(prompt);
+ kdmlabel->label.text = str;
+ QTimer::singleShot(0, kdmlabel, SLOT(update()));
+ }
+ }
+
+ KDMPasswordEdit* passwdEdit;
+
+ if (echoMode == -1)
+ passwdEdit = new KDMPasswordEdit( m_parentWidget );
+ else
+ passwdEdit = new KDMPasswordEdit( echoMode, m_parentWidget);
+ connect( passwdEdit, SIGNAL(textChanged( const QString & )),
+ SLOT(slotActivity()) );
+ connect( passwdEdit, SIGNAL(lostFocus()), SLOT(slotActivity()) );
+ authEdit << passwdEdit;
+
+#if 1
+ for(QValueList<KPasswordEdit*>::iterator it = authEdit.begin();
+ it != authEdit.end();
+ ++it) {
+ if ((*it)->isEnabled() && (*it)->text().isEmpty()) {
+ (*it)->setFocus();
+ break;
+ }
+ }
+#endif
+ if (getLayoutItem())
+ getLayoutItem()->addWidget(passwdEdit, state+1, 1, 0);
+
+ if (m_themer) {
+ debug("themer found!");
+ KdmItem *pw_entry = 0;
+
+ pw_entry = m_themer->findNode("pw-entry");
+
+ if (pw_entry && passwdEdit)
+ pw_entry->setWidget(passwdEdit);
+
+ if (0) {
+ //userLabel->setText(QString::fromUtf8(prompt));
+ //kdmlabel->label.text = QString::fromUtf8(prompt);
+ //QTimer::singleShot(0, kdmlabel, SLOT(update()));
+ }
+ }
+ else
+ debug("no themer found!");
+ }
+ ++state;
+ pExp = exp;
+
+ exp = authEdit.size();
+ debug("state %d exp: %d, has %d\n", state, exp, has);
+
+ if (has >= exp || nonBlocking)
+ returnData();
+}
+
+bool // virtual
+KPamGreeter::binaryPrompt( const char *, bool )
+{
+ // this simply cannot happen ... :}
+ return true;
+}
+
+void // virtual
+KPamGreeter::start()
+{
+ debug("******* start() called\n");
+
+ while(authEdit.begin() != authEdit.end()) {
+ KPasswordEdit* item = *authEdit.remove(authEdit.begin());
+ delete item;
+ }
+
+ while(authLabel.begin() != authLabel.end()) {
+ QLabel* item = *authLabel.remove(authLabel.begin());
+ delete item;
+ }
+
+ authTok = !(authEdit.size() >= 2 && authEdit[1]->isEnabled());
+ exp = has = -1;
+ state = 0;
+ running = true;
+ handler->gplugStart();
+}
+
+void // virtual
+KPamGreeter::suspend()
+{
+}
+
+void // virtual
+KPamGreeter::resume()
+{
+}
+
+void // virtual
+KPamGreeter::next()
+{
+ debug("********* next() called state %d\n", state);
+
+ if (state == 0 && running && handler) {
+ debug(" **** returned text!\n");
+ handler->gplugReturnText( (loginEdit ? loginEdit->text() :
+ fixedUser).local8Bit(),
+ KGreeterPluginHandler::IsUser );
+ setActive(false);
+ }
+
+ has = 0;
+
+ for(QValueList<KPasswordEdit*>::iterator it = authEdit.begin();
+ it != authEdit.end();
+ ++it) {
+
+ has++;
+ if ((*it)->hasFocus()) {
+ ++it;
+ if (it != authEdit.end())
+ (*it)->setFocus();
+ break;
+ }
+ if (it == authEdit.end())
+ has = -1;
+ }
+
+ debug(" has %d and exp %d\n", has, exp);
+
+#if 0
+ // assert( running );
+ if (loginEdit && loginEdit->hasFocus()) {
+ passwdEdit->setFocus(); // will cancel running login if necessary
+ has = 0;
+ } else if (passwdEdit && passwdEdit->hasFocus()) {
+ if (passwd1Edit)
+ passwd1Edit->setFocus();
+ has = 1;
+ } else if (passwd1Edit) {
+ if (passwd1Edit->hasFocus()) {
+ passwd2Edit->setFocus();
+ has = 1; // sic!
+ } else
+ has = 3;
+ } else
+ has = 1;
+ if (exp < 0)
+ handler->gplugStart();
+#endif
+ if (has >= exp)
+ returnData();
+}
+
+void // virtual
+KPamGreeter::abort()
+{
+ debug("***** abort() called\n");
+
+ running = false;
+ if (exp >= 0) {
+ exp = -1;
+ handler->gplugReturnText( 0, 0 );
+ }
+}
+
+void // virtual
+KPamGreeter::succeeded()
+{
+ debug("**** succeeded() called\n");
+
+ // assert( running || timed_login );
+ if (!authTok)
+ setActive( false );
+ else
+ setAllActive( false );
+ exp = -1;
+ running = false;
+}
+
+void // virtual
+KPamGreeter::failed()
+{
+ // assert( running || timed_login );
+ setActive( false );
+ setAllActive( false );
+ exp = -1;
+ running = false;
+}
+
+#include<assert.h>
+void // virtual
+KPamGreeter::revive()
+{
+ // assert( !running );
+ setAllActive( true );
+
+#if 1
+ if (authEdit.size() < 1)
+ return;
+#endif
+
+ assert(authEdit.size() >= 1);
+ if (authTok) {
+ authEdit[0]->erase();
+ if(authEdit.size() >= 2)
+ authEdit[1]->erase();
+ authEdit[0]->setFocus();
+ } else {
+ authEdit[0]->erase();
+ if (loginEdit && loginEdit->isEnabled())
+ authEdit[0]->setEnabled( true );
+ else {
+ setActive( true );
+ if (loginEdit && loginEdit->text().isEmpty())
+ loginEdit->setFocus();
+ else
+ authEdit[0]->setFocus();
+ }
+ }
+}
+
+void // virtual
+KPamGreeter::clear()
+{
+ // assert( !running && !passwd1Edit );
+ authEdit[0]->erase();
+ if (loginEdit) {
+ loginEdit->clear();
+ loginEdit->setFocus();
+ curUser = QString::null;
+ } else
+ authEdit[0]->setFocus();
+}
+
+
+// private
+
+void
+KPamGreeter::setActive( bool enable )
+{
+ if (loginEdit)
+ loginEdit->setEnabled( enable );
+}
+
+void
+KPamGreeter::setAllActive( bool enable )
+{
+ for(QValueList<KPasswordEdit*>::iterator it = authEdit.begin();
+ it != authEdit.end();
+ ++it)
+ (*it)->setEnabled( enable );
+}
+
+void
+KPamGreeter::slotLoginLostFocus()
+{
+ if (!running)
+ return;
+ if (exp > 0) {
+ if (curUser == loginEdit->text())
+ return;
+ exp = -1;
+ handler->gplugReturnText( 0, 0 );
+ }
+ curUser = loginEdit->text();
+ debug("curUser is %s", curUser.latin1());
+ handler->gplugSetUser( curUser );
+}
+
+void
+KPamGreeter::slotActivity()
+{
+ debug("slotActivity");
+
+ if (running)
+ handler->gplugActivity();
+}
+
+// factory
+
+static bool init( const QString &,
+ QVariant (*getConf)( void *, const char *, const QVariant & ),
+ void *ctx )
+{
+ echoMode = (KPasswordEdit::EchoModes) getConf( ctx, "EchoMode", QVariant( -1 ) ).toInt();
+ KGlobal::locale()->insertCatalogue( "kgreet_pam" );
+ return true;
+}
+
+static void done( void )
+{
+ KGlobal::locale()->removeCatalogue( "kgreet_pam" );
+ if (log && log != stderr)
+ fclose(log);
+ log = 0;
+}
+
+static KGreeterPlugin *
+create( KGreeterPluginHandler *handler, KdmThemer *themer,
+ QWidget *parent, QWidget *predecessor,
+ const QString &fixedEntity,
+ KGreeterPlugin::Function func,
+ KGreeterPlugin::Context ctx )
+{
+ return new KPamGreeter( handler, themer, parent, predecessor, fixedEntity, func, ctx );
+}
+
+KDE_EXPORT kgreeterplugin_info kgreeterplugin_info = {
+ I18N_NOOP("Pam conversation plugin"), "pam",
+ kgreeterplugin_info::Local | kgreeterplugin_info::Presettable,
+ init, done, create
+};
+
+#include "kgreet_pam.moc"
Index: kdmlib/kgreet_pam.h
===================================================================
--- /dev/null
+++ kdmlib/kgreet_pam.h
@@ -0,0 +1,93 @@
+/*
+
+Conversation widget for kdm greeter
+
+Copyright (C) 2008 Dirk Mueller <mueller@kde.org>
+
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+*/
+
+
+#ifndef KGREET_CLASSIC_H
+#define KGREET_CLASSIC_H
+
+#include "kgreeterplugin.h"
+
+#include <qobject.h>
+#include <qlayout.h>
+
+class KLineEdit;
+class KPasswordEdit;
+class KSimpleConfig;
+class QGridLayout;
+class QLabel;
+
+class KPamGreeter : public QObject, public KGreeterPlugin {
+ Q_OBJECT
+
+ public:
+ KPamGreeter( KGreeterPluginHandler *handler,
+ KdmThemer *themer,
+ QWidget *parent, QWidget *predecessor,
+ const QString &fixedEntitiy,
+ Function func, Context ctx );
+ ~KPamGreeter();
+ virtual void loadUsers( const QStringList &users );
+ virtual void presetEntity( const QString &entity, int field );
+ virtual QString getEntity() const;
+ virtual void setUser( const QString &user );
+ virtual void setEnabled( bool on );
+ virtual bool textMessage( const char *message, bool error );
+ virtual void textPrompt( const char *prompt, bool echo, bool nonBlocking );
+ virtual bool binaryPrompt( const char *prompt, bool nonBlocking );
+ virtual void start();
+ virtual void suspend();
+ virtual void resume();
+ virtual void next();
+ virtual void abort();
+ virtual void succeeded();
+ virtual void failed();
+ virtual void revive();
+ virtual void clear();
+
+ QGridLayout *getLayoutItem() const { return static_cast<QGridLayout*>(layoutItem); }
+
+ public slots:
+ void slotLoginLostFocus();
+ void slotActivity();
+
+ private:
+ void setActive( bool enable );
+ void setAllActive( bool enable );
+ void returnData();
+
+ QLabel *loginLabel;
+ QValueList<QLabel*> authLabel;
+ KLineEdit *loginEdit;
+ QWidget* m_parentWidget;
+ QValueList<KPasswordEdit*> authEdit;
+ KSimpleConfig *stsFile;
+ KdmThemer *m_themer;
+ QString fixedUser, curUser;
+ Function func;
+ Context ctx;
+ int exp, pExp, has;
+ unsigned state;
+ bool running, authTok;
+};
+
+#endif /* KGREET_CLASSIC_H */
Index: kdmlib/Makefile.am
===================================================================
--- kdmlib/Makefile.am.orig
+++ kdmlib/Makefile.am
@@ -1,11 +1,15 @@
AM_CPPFLAGS = -I$(top_srcdir)/kdm/kfrontend $(all_includes)
-kde_module_LTLIBRARIES = kgreet_classic.la kgreet_winbind.la
+kde_module_LTLIBRARIES = kgreet_classic.la kgreet_pam.la kgreet_winbind.la
kgreet_classic_la_SOURCES = kgreet_classic.cpp
kgreet_classic_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries)
kgreet_classic_la_LIBADD = $(LIB_KDEUI)
+kgreet_pam_la_SOURCES = kgreet_pam.cpp
+kgreet_pam_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries)
+kgreet_pam_la_LIBADD = $(LIB_KDEUI)
+
kgreet_winbind_la_SOURCES = kgreet_winbind.cpp
kgreet_winbind_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries)
kgreet_winbind_la_LIBADD = $(LIB_KDEUI)
Index: kcheckpass/checkpass_pam.c
===================================================================
--- kcheckpass/checkpass_pam.c.orig
+++ kcheckpass/checkpass_pam.c
@@ -140,13 +140,16 @@ AuthReturn Authenticate(const char *call
openlog("kcheckpass", LOG_PID, LOG_AUTH);
PAM_data.conv = conv;
- if (strcmp(method, "classic")) {
- sprintf(pservb, "%.31s-%.31s", caller, method);
- pam_service = pservb;
- } else {
+ if (!strcmp(method, "classic")) {
PAM_data.classic = 1;
pam_service = caller;
}
+ else if (!strcmp(method, "pam")) {
+ pam_service = caller;
+ } else {
+ sprintf(pservb, "%.31s-%.31s", caller, method);
+ pam_service = pservb;
+ }
pam_error = pam_start(pam_service, user, &PAM_conversation, &pamh);
if (pam_error != PAM_SUCCESS)
return AuthError;

@ -0,0 +1,189 @@
Index: kscreensaver/random.cpp
===================================================================
--- kscreensaver/random.cpp.orig
+++ kscreensaver/random.cpp
@@ -1,4 +1,4 @@
-//-----------------------------------------------------------------------------
+ //-----------------------------------------------------------------------------
//
// Screen savers for KDE
//
@@ -19,6 +19,7 @@
#include <qframe.h>
#include <qcheckbox.h>
#include <qwidget.h>
+#include <qfileinfo.h>
#include <kapplication.h>
#include <kstandarddirs.h>
@@ -36,7 +37,7 @@
#define MAX_ARGS 20
-void usage(char *name)
+static void usage(char *name)
{
puts(i18n("Usage: %1 [-setup] [args]\n"
"Starts a random screen saver.\n"
@@ -60,6 +61,43 @@ static const KCmdLineOptions options[] =
//----------------------------------------------------------------------------
+#ifdef HAVE_GLXCHOOSEVISUAL
+#include <GL/glx.h>
+#endif
+
+//-------------------------------------
+bool hasDirectRendering () {
+ Display *dpy = QApplication::desktop()->x11Display();
+
+#ifdef HAVE_GLXCHOOSEVISUAL
+ int attribSingle[] = {
+ GLX_RGBA,
+ GLX_RED_SIZE, 1,
+ GLX_GREEN_SIZE, 1,
+ GLX_BLUE_SIZE, 1,
+ None
+ };
+ XVisualInfo* visinfo = glXChooseVisual (
+ dpy, QApplication::desktop()->primaryScreen(), attribSingle
+ );
+ if (visinfo) {
+ GLXContext ctx = glXCreateContext ( dpy, visinfo, NULL, True );
+ if (glXIsDirect(dpy, ctx)) {
+ glXDestroyContext (dpy,ctx);
+ return true;
+ }
+ glXDestroyContext (dpy,ctx);
+ return false;
+ } else {
+ return false;
+ }
+#else
+#error no GL?
+ return false;
+#endif
+
+}
+
int main(int argc, char *argv[])
{
KLocale::setMainCatalogue("kscreensaver");
@@ -103,55 +141,63 @@ int main(int argc, char *argv[])
KConfig type("krandom.kssrc");
type.setGroup("Settings");
- bool opengl = type.readBoolEntry("OpenGL");
+ bool opengl = type.readBoolEntry("OpenGL", hasDirectRendering());
+ kdDebug() << "hasOPEN " << opengl << endl;
bool manipulatescreen = type.readBoolEntry("ManipulateScreen");
bool fortune = !KStandardDirs::findExe("fortune").isEmpty();
+ QStringList defaults = type.readListEntry( "Defaults" );
+ QMap<QString, int> def_numbers;
+ for ( QStringList::ConstIterator it = defaults.begin(); it != defaults.end(); ++it ) {
+ int index = ( *it ).find( ':' );
+ if ( index == -1 )
+ def_numbers[*it] = 1;
+ else
+ def_numbers[( *it ).left( index )] = ( *it ).mid( index + 1 ).toInt();
+ }
for (uint i = 0; i < tempSaverFileList.count(); i++)
{
- kdDebug() << "Looking at " << tempSaverFileList[i] << endl;
+ int howoften = 1;
+ if ( defaults.count() != 0 ) {
+ QFileInfo fi( tempSaverFileList[i] );
+ if ( def_numbers.contains( fi.fileName() ) )
+ howoften = def_numbers[fi.fileName()];
+ else
+ howoften = 0;
+ }
+
KDesktopFile saver(tempSaverFileList[i], true);
- if(!saver.tryExec())
- continue;
- kdDebug() << "read X-KDE-Type" << endl;
+ if (!saver.tryExec())
+ continue;
QString saverType = saver.readEntry("X-KDE-Type");
-
- if (saverType.isEmpty()) // no X-KDE-Type defined so must be OK
- {
- saverFileList.append(tempSaverFileList[i]);
- }
- else
- {
+ if (!saverType.isEmpty()) // no X-KDE-Type defined so must be OK
+ {
QStringList saverTypes = QStringList::split(";", saverType);
for (QStringList::ConstIterator it = saverTypes.begin(); it != saverTypes.end(); ++it )
{
- kdDebug() << "saverTypes is "<< *it << endl;
if (*it == "ManipulateScreen")
{
- if (manipulatescreen)
- {
- saverFileList.append(tempSaverFileList[i]);
- }
+ if (!manipulatescreen)
+ howoften = 0;
}
else
if (*it == "OpenGL")
{
- if (opengl)
- {
- saverFileList.append(tempSaverFileList[i]);
- }
+ if (!opengl)
+ howoften = 0;
}
if (*it == "Fortune")
{
- if (fortune)
- {
- saverFileList.append(tempSaverFileList[i]);
- }
+ if (!fortune)
+ howoften = 0;
}
}
}
+ for ( int j = 0; j < howoften; ++j )
+ saverFileList.append(tempSaverFileList[i]);
}
+ kdDebug() << "final " << saverFileList << endl;
KRandomSequence rnd;
int indx = rnd.getLong(saverFileList.count());
@@ -229,7 +275,7 @@ KRandomSetup::KRandomSetup( QWidget *par
KConfig config("krandom.kssrc");
config.setGroup("Settings");
- openGL->setChecked(config.readBoolEntry("OpenGL", true));
+ openGL->setChecked(config.readBoolEntry("OpenGL", hasDirectRendering()));
manipulateScreen->setChecked(config.readBoolEntry("ManipulateScreen", true));
}
Index: kscreensaver/Makefile.am
===================================================================
--- kscreensaver/Makefile.am.orig
+++ kscreensaver/Makefile.am
@@ -3,13 +3,13 @@
AM_CPPFLAGS = -UQT_NO_ASCII_CAST
-INCLUDES = $(all_includes)
+INCLUDES = $(GLINC) $(all_includes)
AM_LDFLAGS = $(all_libraries) $(KDE_RPATH)
bin_PROGRAMS = krandom.kss kblankscrn.kss
krandom_kss_SOURCES = random.cpp
-krandom_kss_LDADD = $(LIB_KDEUI) -lm
+krandom_kss_LDADD = $(LIB_KDEUI) $(GLLIB) -lm
kblankscrn_kss_SOURCES = blankscrn.cpp
kblankscrn_kss_LDADD = $(LIB_KDEUI) -lkscreensaver -lm

@ -0,0 +1,13 @@
Index: ksmserver/shutdowndlg.cpp
===================================================================
--- ksmserver/shutdowndlg.cpp.orig
+++ ksmserver/shutdowndlg.cpp
@@ -222,7 +222,7 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
btnHalt->setFont( btnFont );
buttonlay->addWidget( btnHalt );
connect(btnHalt, SIGNAL(clicked()), SLOT(slotHalt()));
- if ( sdtype == KApplication::ShutdownTypeHalt )
+ if ( sdtype == KApplication::ShutdownTypeHalt || getenv("KDM_AUTOLOGIN") )
btnHalt->setFocus();
// Reboot

@ -0,0 +1,67 @@
--- ksmserver/server.h.sav 2009-07-23 11:44:55.000000000 +0200
+++ ksmserver/server.h 2009-07-23 11:47:52.000000000 +0200
@@ -145,7 +145,8 @@ private:
KProcess* startApplication( QStringList command,
const QString& clientMachine = QString::null,
- const QString& userId = QString::null );
+ const QString& userId = QString::null,
+ bool wm = false );
void executeCommand( const QStringList& command );
bool isWM( const KSMClient* client ) const;
--- ksmserver/startup.cpp.sav 2009-07-23 11:44:54.000000000 +0200
+++ ksmserver/startup.cpp 2009-07-23 11:45:49.000000000 +0200
@@ -168,7 +168,7 @@ void KSMServer::launchWM( const QValueLi
// when we have a window manager, we start it first and give
// it some time before launching other processes. Results in a
// visually more appealing startup.
- wmProcess = startApplication( wmStartCommands[ 0 ] );
+ wmProcess = startApplication( wmStartCommands[ 0 ], QString(), QString(), true );
connect( wmProcess, SIGNAL( processExited( KProcess* )), SLOT( wmProcessChange()));
// there can be possibly more wm's (because of forking for multihead),
// but in such case care only about the process of the first one
--- ksmserver/server.cpp.sav 2009-07-23 11:51:33.000000000 +0200
+++ ksmserver/server.cpp 2009-07-23 11:49:02.000000000 +0200
@@ -101,7 +101,7 @@ KSMServer* KSMServer::self()
* to restart applications.
*/
KProcess* KSMServer::startApplication( QStringList command, const QString& clientMachine,
- const QString& userId )
+ const QString& userId, bool wm )
{
if ( command.isEmpty() )
return NULL;
@@ -118,12 +118,26 @@ KProcess* KSMServer::startApplication( Q
command.prepend( clientMachine );
command.prepend( xonCommand ); // "xon" by default
}
- KProcess* process = new KProcess( this );
- *process << command;
- // make it auto-delete
- connect( process, SIGNAL( processExited( KProcess* )), process, SLOT( deleteLater()));
- process->start();
- return process;
+// TODO this function actually should not use KProcess at all and use klauncher (kdeinit) instead.
+// Klauncher should also have support for tracking whether the launched process is still alive
+// or not, so this should be redone. For now, use KProcess for wm's, as they need to be tracked,
+// klauncher for the rest where ksmserver doesn't care.
+ if( wm ) {
+ KProcess* process = new KProcess( this );
+ *process << command;
+ // make it auto-delete
+ connect( process, SIGNAL( processExited( KProcess* )), process, SLOT( deleteLater()));
+ process->start();
+ return process;
+ } else {
+ int n = command.count();
+ QCString app = command[0].latin1();
+ QValueList<QCString> argList;
+ for ( int i=1; i < n; i++)
+ argList.append( QCString(command[i].latin1()));
+ DCOPRef( launcher ).send( "exec_blind", app, DCOPArg( argList, "QValueList<QCString>" ) );
+ return NULL;
+ }
}
/*! Utility function to execute a command on the local machine. Used

@ -0,0 +1,233 @@
Index: ksmserver/Makefile.am
===================================================================
--- ksmserver/Makefile.am.orig
+++ ksmserver/Makefile.am
@@ -17,7 +17,7 @@
SUBDIRS = .
-INCLUDES= -I$(top_srcdir)/kdmlib $(all_includes)
+INCLUDES= -I$(top_srcdir)/kdmlib $(all_includes) $(DBUS_INCS)
bin_PROGRAMS =
lib_LTLIBRARIES =
@@ -31,7 +31,7 @@ ksmserver_la_SOURCES = main.cpp server.c
KSMServerInterface.skel server.skel
ksmserver_la_LDFLAGS = $(all_libraries) -avoid-version -module
-ksmserver_la_LIBADD = ../kdmlib/libdmctl.la $(LIB_KDEUI)
+ksmserver_la_LIBADD = ../kdmlib/libdmctl.la $(LIB_KDEUI) -llazy $(DBUS_LIBS)
picsdir = $(kde_datadir)/ksmserver/pics
pics_DATA = shutdownkonq.png
@@ -44,7 +44,7 @@ updatedir = $(kde_datadir)/kconf_update
EXTRA_PROGRAMS = testsh
testsh_SOURCES = test.cpp
testsh_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-testsh_LDADD = $(LIB_KDEUI) shutdowndlg.lo ../kdmlib/libdmctl.la
+testsh_LDADD = $(LIB_KDEUI) shutdowndlg.lo ../kdmlib/libdmctl.la -llazy $(DBUS_LIBS)
messages:
$(XGETTEXT) *.cpp -o $(podir)/ksmserver.pot
Index: ksmserver/shutdowndlg.cpp
===================================================================
--- ksmserver/shutdowndlg.cpp.orig
+++ ksmserver/shutdowndlg.cpp
@@ -38,17 +38,23 @@ Copyright (C) 2000 Matthias Ettrich <ett
#include <kpixmapeffect.h>
#include <kdialog.h>
#include <kseparator.h>
+#include <kmessagebox.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <unistd.h>
#include <stdlib.h>
#include <dmctl.h>
+#include <liblazy.h>
#include <X11/Xlib.h>
#include "shutdowndlg.moc"
+#define DBUS_HAL_INTERFACE "org.freedesktop.Hal"
+#define DBUS_HAL_SYSTEM_POWER_INTERFACE "org.freedesktop.Hal.Device.SystemPowerManagement"
+#define HAL_UDI_COMPUTER "/org/freedesktop/Hal/devices/computer"
+
static const int max_faded = 2300;
static const int slice = 20;
@@ -215,8 +221,8 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
connect(btnLogout, SIGNAL(clicked()), SLOT(slotLogout()));
if (maysd) {
-
- // Shutdown
+
+ // Shutdown
KPushButton* btnHalt = new KPushButton( KGuiItem( i18n("&Turn Off Computer"), "exit"), frame );
QToolTip::add( btnHalt, i18n( "<qt><h3>Turn Off Computer</h3><p>Log out of the current session and turn off the computer</p></qt>" ) );
btnHalt->setFont( btnFont );
@@ -251,13 +257,58 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
else
targets->insertItem( label, index );
}
-
+
btnReboot->setPopup(targets);
connect( targets, SIGNAL(activated(int)), SLOT(slotReboot(int)) );
} else
QToolTip::add( btnReboot, i18n( "<qt><h3>Restart Computer</h3><p>Log out of the current session and restart the computer</p></qt>" ) );
- }
+ int supported = -1;
+ liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_suspend", &supported);
+ if (supported == 1)
+ suspend_ram = true;
+ else
+ suspend_ram = false;
+ liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_standby", &supported);
+ if (supported == 1)
+ standby = true;
+ else
+ standby = false;
+ liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_hibernate", &supported);
+ if (supported == 1)
+ suspend_disk = true;
+ else
+ suspend_disk = false;
+
+ if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.hibernate") != 1)
+ suspend_disk = false;
+ if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.suspend") != 1)
+ suspend_ram = false;
+ if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.standby") != 1)
+ standby = false;
+
+ int sum = standby + suspend_ram + suspend_disk;
+ if ( sum ) {
+ QButton *btnSuspend;
+ if (sum > 1) {
+ btnSuspend = new KSMDelayedPushButton( KGuiItem( i18n("&Suspend Computer"), "player_pause"), frame );
+ QPopupMenu *suspends = new QPopupMenu(frame);
+ if (suspend_disk)
+ suspends->insertItem(i18n("Suspend to Disk"), 1);
+ if (suspend_ram)
+ suspends->insertItem(i18n("Suspend to RAM"), 2);
+ if (standby)
+ suspends->insertItem(i18n("Standby"), 3);
+ connect(suspends, SIGNAL(activated(int)), SLOT(slotSuspend(int)));
+ static_cast<KSMDelayedPushButton*>(btnSuspend)->setPopup(suspends);
+ } else {
+ btnSuspend = new KPushButton( KGuiItem( i18n("&Suspend Computer"), "player_pause"), frame );
+ }
+ btnSuspend->setFont( btnFont );
+ buttonlay->addWidget( btnSuspend );
+ connect(btnSuspend, SIGNAL(clicked()), SLOT(slotSuspend()));
+ }
+ }
buttonlay->addStretch( 1 );
// Separator
@@ -270,6 +321,80 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
}
+void KSMShutdownDlg::slotSuspend()
+{
+ int error = 0;
+ int wake = 0;
+ DBusMessage *reply;
+
+ if (suspend_disk)
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Hibernate",
+ &reply,
+ DBUS_TYPE_INVALID);
+ else if (suspend_ram)
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Suspend",
+ &reply,
+ DBUS_TYPE_INT32,
+ &wake,
+ DBUS_TYPE_INVALID);
+ else
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Standby",
+ &reply,
+ DBUS_TYPE_INVALID);
+
+ if (error)
+ KMessageBox::error(this, i18n("Suspend failed"));
+
+ // possibly after resume :)
+ reject();
+}
+
+void KSMShutdownDlg::slotSuspend(int id)
+{
+ int error = 0;
+ int wake = 0;
+ DBusMessage *reply;
+
+ if (suspend_disk && id == 1) {
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Hibernate",
+ &reply,
+ DBUS_TYPE_INVALID);
+ } else if (suspend_ram && id == 2)
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Suspend",
+ &reply,
+ DBUS_TYPE_INT32,
+ &wake,
+ DBUS_TYPE_INVALID);
+ else if (standby && id == 3)
+ error = liblazy_dbus_system_send_method_call(DBUS_HAL_INTERFACE,
+ HAL_UDI_COMPUTER,
+ DBUS_HAL_SYSTEM_POWER_INTERFACE,
+ "Standby",
+ &reply,
+ DBUS_TYPE_INVALID);
+ else
+ return;
+ if (error)
+ KMessageBox::error(this, i18n("Suspend failed"));
+
+ // possibly after resume :)
+ reject();
+}
void KSMShutdownDlg::slotLogout()
{
Index: ksmserver/shutdowndlg.h
===================================================================
--- ksmserver/shutdowndlg.h.orig
+++ ksmserver/shutdowndlg.h
@@ -60,6 +60,8 @@ public slots:
void slotHalt();
void slotReboot();
void slotReboot(int);
+ void slotSuspend();
+ void slotSuspend(int);
protected:
~KSMShutdownDlg() {};
@@ -70,6 +72,7 @@ private:
QString m_bootOption;
QPopupMenu *targets;
QStringList rebootOptions;
+ bool suspend_disk, suspend_ram, standby;
};
class KSMDelayedPushButton : public KPushButton

@ -0,0 +1,700 @@
Index: ksmserver/KSMServerInterface.h
===================================================================
--- ksmserver/KSMServerInterface.h.orig
+++ ksmserver/KSMServerInterface.h
@@ -22,6 +22,8 @@ k_dcop:
virtual void suspendStartup( QCString ) = 0;
virtual void resumeStartup( QCString ) = 0;
+
+ virtual void logoutTimed( int, int, QString ) = 0;
};
#endif
Index: ksmserver/Makefile.am
===================================================================
--- ksmserver/Makefile.am.orig
+++ ksmserver/Makefile.am
@@ -28,7 +28,7 @@ ksmserver_la_METASOURCES = AUTO
# Order is important for --enable-final!
ksmserver_la_SOURCES = main.cpp server.cpp shutdowndlg.cpp \
legacy.cpp startup.cpp shutdown.cpp client.cpp \
- KSMServerInterface.skel server.skel
+ KSMServerInterface.skel server.skel timed.ui
ksmserver_la_LDFLAGS = $(all_libraries) -avoid-version -module
ksmserver_la_LIBADD = ../kdmlib/libdmctl.la $(LIB_KDEUI) -llazy $(DBUS_LIBS)
@@ -42,7 +42,7 @@ updatedir = $(kde_datadir)/kconf_update
EXTRA_PROGRAMS = testsh
-testsh_SOURCES = test.cpp
+testsh_SOURCES = test.cpp timed.ui
testsh_LDFLAGS = $(all_libraries) $(KDE_RPATH)
testsh_LDADD = $(LIB_KDEUI) shutdowndlg.lo ../kdmlib/libdmctl.la -llazy $(DBUS_LIBS)
Index: ksmserver/server.h
===================================================================
--- ksmserver/server.h.orig
+++ ksmserver/server.h
@@ -85,6 +85,7 @@ public:
// public API
void restoreSession( QString sessionName );
void startDefaultSession();
+
void shutdown( KApplication::ShutdownConfirm confirm,
KApplication::ShutdownType sdtype,
KApplication::ShutdownMode sdmode );
@@ -92,6 +93,11 @@ public:
virtual void suspendStartup( QCString app );
virtual void resumeStartup( QCString app );
+ bool checkStatus( bool &logoutConfirmed, bool &maysd,
+ KApplication::ShutdownConfirm confirm,
+ KApplication::ShutdownType sdtype,
+ KApplication::ShutdownMode sdmode );
+
public slots:
void cleanUp();
@@ -142,6 +148,11 @@ private:
bool defaultSession() const; // empty session
void setupXIOErrorHandler();
+ void shutdownInternal( KApplication::ShutdownConfirm confirm,
+ KApplication::ShutdownType sdtype,
+ KApplication::ShutdownMode sdmode,
+ QString bootOption = QString::null );
+
void performLegacySessionSave();
void storeLegacySession( KConfig* config );
void restoreLegacySession( KConfig* config );
@@ -157,6 +168,7 @@ private:
// public dcop interface
void logout( int, int, int );
+ virtual void logoutTimed( int, int, QString );
QStringList sessionList();
QString currentSession();
void saveCurrentSession();
Index: ksmserver/shutdown.cpp
===================================================================
--- ksmserver/shutdown.cpp.orig
+++ ksmserver/shutdown.cpp
@@ -93,14 +93,16 @@ void KSMServer::logout( int confirm, int
(KApplication::ShutdownMode)sdmode );
}
-void KSMServer::shutdown( KApplication::ShutdownConfirm confirm,
- KApplication::ShutdownType sdtype, KApplication::ShutdownMode sdmode )
+bool KSMServer::checkStatus( bool &logoutConfirmed, bool &maysd,
+ KApplication::ShutdownConfirm confirm,
+ KApplication::ShutdownType sdtype,
+ KApplication::ShutdownMode sdmode )
{
pendingShutdown.stop();
if( dialogActive )
- return;
+ return false;
if( state >= Shutdown ) // already performing shutdown
- return;
+ return false;
if( state != Idle ) // performing startup
{
// perform shutdown as soon as startup is finished, in order to avoid saving partial session
@@ -111,25 +113,44 @@ void KSMServer::shutdown( KApplication::
pendingShutdown_sdtype = sdtype;
pendingShutdown_sdmode = sdmode;
}
- return;
+ return false;
}
KConfig *config = KGlobal::config();
config->reparseConfiguration(); // config may have changed in the KControl module
config->setGroup("General" );
- bool logoutConfirmed =
+ logoutConfirmed =
(confirm == KApplication::ShutdownConfirmYes) ? false :
- (confirm == KApplication::ShutdownConfirmNo) ? true :
- !config->readBoolEntry( "confirmLogout", true );
- bool maysd = false;
+ (confirm == KApplication::ShutdownConfirmNo) ? true :
+ !config->readBoolEntry( "confirmLogout", true );
+ maysd = false;
if (config->readBoolEntry( "offerShutdown", true ) && DM().canShutdown())
maysd = true;
if (!maysd) {
if (sdtype != KApplication::ShutdownTypeNone &&
sdtype != KApplication::ShutdownTypeDefault &&
logoutConfirmed)
- return; /* unsupported fast shutdown */
+ return false; /* unsupported fast shutdown */
+ }
+
+ return true;
+}
+
+void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm,
+ KApplication::ShutdownType sdtype,
+ KApplication::ShutdownMode sdmode,
+ QString bopt )
+{
+ bool maysd = false;
+ bool logoutConfirmed = false;
+ if ( !checkStatus( logoutConfirmed, maysd, confirm, sdtype, sdmode ) )
+ return;
+
+ KConfig *config = KGlobal::config();
+
+ config->setGroup("General" );
+ if (!maysd) {
sdtype = KApplication::ShutdownTypeNone;
} else if (sdtype == KApplication::ShutdownTypeDefault)
sdtype = (KApplication::ShutdownType)
@@ -138,7 +159,6 @@ void KSMServer::shutdown( KApplication::
sdmode = KApplication::ShutdownModeInteractive;
dialogActive = true;
- QString bopt;
if ( !logoutConfirmed ) {
KSMShutdownFeedback::start(); // make the screen gray
logoutConfirmed =
@@ -204,6 +224,42 @@ void KSMServer::shutdown( KApplication::
dialogActive = false;
}
+void KSMServer::shutdown( KApplication::ShutdownConfirm confirm,
+ KApplication::ShutdownType sdtype, KApplication::ShutdownMode sdmode )
+{
+ shutdownInternal( confirm, sdtype, sdmode );
+}
+
+#include <kmessagebox.h>
+
+void KSMServer::logoutTimed( int sdtype, int sdmode, QString bootOption )
+{
+ int confirmDelay;
+
+ KConfig* config = KGlobal::config();
+ config->setGroup( "General" );
+
+ if ( sdtype == KApplication::ShutdownTypeHalt )
+ confirmDelay = config->readNumEntry( "confirmShutdownDelay", 31 );
+ else if ( sdtype == KApplication::ShutdownTypeReboot )
+ confirmDelay = config->readNumEntry( "confirmRebootDelay", 31 );
+ else
+ confirmDelay = config->readNumEntry( "confirmLogoutDelay", 31 );
+
+ bool result = true;
+ if (confirmDelay) {
+ KSMShutdownFeedback::start(); // make the screen gray
+ result = KSMDelayedMessageBox::showTicker( (KApplication::ShutdownType)sdtype, bootOption, confirmDelay );
+ KSMShutdownFeedback::stop(); // make the screen become normal again
+ }
+
+ if ( result )
+ shutdownInternal( KApplication::ShutdownConfirmNo,
+ (KApplication::ShutdownType)sdtype,
+ (KApplication::ShutdownMode)sdmode,
+ bootOption );
+}
+
void KSMServer::pendingShutdownTimeout()
{
shutdown( pendingShutdown_confirm, pendingShutdown_sdtype, pendingShutdown_sdmode );
Index: ksmserver/shutdowndlg.cpp
===================================================================
--- ksmserver/shutdowndlg.cpp.orig
+++ ksmserver/shutdowndlg.cpp
@@ -25,6 +25,7 @@ Copyright (C) 2000 Matthias Ettrich <ett
#include <qimage.h>
#include <klocale.h>
+#include <kconfig.h>
#include <kapplication.h>
#include <kdebug.h>
#include <kpushbutton.h>
@@ -488,3 +489,67 @@ void KSMDelayedPushButton::slotTimeout()
popt->stop();
setDown(false);
}
+
+KSMDelayedMessageBox::KSMDelayedMessageBox( KApplication::ShutdownType sdtype, const QString &bootOption, int confirmDelay )
+ : TimedLogoutDlg( 0, 0, true, WType_Popup ), m_remaining(confirmDelay)
+{
+ if ( sdtype == KApplication::ShutdownTypeHalt )
+ {
+ m_title->setText( i18n( "Would you like to turn off your computer?" ) );
+ m_template = i18n( "This computer will turn off automatically\n"
+ "after %1 seconds." );
+ m_logo->setPixmap( BarIcon( "exit", 48 ) );
+ } else if ( sdtype == KApplication::ShutdownTypeReboot )
+ {
+ if (bootOption.isEmpty())
+ m_title->setText( i18n( "Would you like to reboot your computer?" ) );
+ else
+ m_title->setText( i18n( "Would you like to reboot to \"%1\"?" ).arg(bootOption) );
+ m_template = i18n( "This computer will reboot automatically\n"
+ "after %1 seconds." );
+ m_logo->setPixmap( BarIcon( "reload", 48 ) );
+ } else {
+ m_title->setText( i18n( "Would you like to end your current session?" ) );
+ m_template = i18n( "This session will end\n"
+ "after %1 seconds automatically." );
+ m_logo->setPixmap( BarIcon( "previous", 48 ) );
+ }
+
+ updateText();
+ adjustSize();
+ if ( double( height() ) / width() < 0.25 )
+ {
+ setFixedHeight( qRound( width() * 0.3 ) );
+ adjustSize();
+ }
+ QTimer *timer = new QTimer( this );
+ timer->start( 1000 );
+ connect( timer, SIGNAL( timeout() ), SLOT( updateText() ) );
+ KDialog::centerOnScreen(this);
+}
+
+void KSMDelayedMessageBox::updateText()
+{
+ m_remaining--;
+ if ( m_remaining == 0 )
+ {
+ accept();
+ return;
+ }
+ m_text->setText( m_template.arg( m_remaining ) );
+}
+
+bool KSMDelayedMessageBox::showTicker( KApplication::ShutdownType sdtype, const QString &bootOption, int confirmDelay )
+{
+ kapp->enableStyles();
+ KSMDelayedMessageBox msg( sdtype, bootOption, confirmDelay );
+ QSize sh = msg.sizeHint();
+ QRect rect = KGlobalSettings::desktopGeometry(QCursor::pos());
+
+ msg.move(rect.x() + (rect.width() - sh.width())/2,
+ rect.y() + (rect.height() - sh.height())/2);
+ bool result = msg.exec();
+
+ kapp->disableStyles();
+ return result;
+}
Index: ksmserver/shutdowndlg.h
===================================================================
--- ksmserver/shutdowndlg.h.orig
+++ ksmserver/shutdowndlg.h
@@ -17,6 +17,7 @@ class QVButtonGroup;
class QPopupMenu;
class QTimer;
+#include "timed.h"
#include <kapplication.h>
// The (singleton) widget that makes the desktop gray.
@@ -94,4 +95,22 @@ private:
QTimer *popt;
};
+class QLabel;
+
+class KSMDelayedMessageBox : public TimedLogoutDlg
+{
+ Q_OBJECT
+
+public:
+ KSMDelayedMessageBox( KApplication::ShutdownType sdtype, const QString &bootOption, int confirmDelay );
+ static bool showTicker( KApplication::ShutdownType sdtype, const QString &bootOption, int confirmDelay );
+
+protected slots:
+ void updateText();
+
+private:
+ QString m_template;
+ int m_remaining;
+};
+
#endif
Index: ksmserver/test.cpp
===================================================================
--- ksmserver/test.cpp.orig
+++ ksmserver/test.cpp
@@ -14,11 +14,16 @@ main(int argc, char *argv[])
a.iconLoader()->addAppDir("ksmserver");
KSMShutdownFeedback::start();
+ // ShutdownTypeNone == Logout == 0
+ // ShutdownTypeReboot == 1
+ // ShutdownTypeHalt == 2
KApplication::ShutdownType sdtype = KApplication::ShutdownTypeNone;
QString bopt;
+ KSMDelayedMessageBox::showTicker( sdtype );
+ /*
(void)KSMShutdownDlg::confirmShutdown( true,
sdtype,
- bopt );
+ bopt );*/
/* (void)KSMShutdownDlg::confirmShutdown( false,
sdtype,
bopt ); */
Index: ksmserver/timed.ui
===================================================================
--- /dev/null
+++ ksmserver/timed.ui
@@ -0,0 +1,352 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>TimedLogoutDlg</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>TimedLogoutDlg</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>381</width>
+ <height>131</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Confirmation</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QFrame">
+ <property name="name">
+ <cstring>frame3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ <property name="lineWidth">
+ <number>2</number>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="midLineWidth">
+ <number>0</number>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_logo</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>48</width>
+ <height>48</height>
+ </size>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>2</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>7</number>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_title</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="font">
+ <font>
+ <bold>1</bold>
+ </font>
+ </property>
+ <property name="text">
+ <string>Would you like to shutdown your computer?</string>
+ </property>
+ <property name="textFormat">
+ <enum>PlainText</enum>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignLeft</set>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>m_text</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>If you do not act, your computer will shutdown
+after X automatically.</string>
+ </property>
+ <property name="textFormat">
+ <enum>RichText</enum>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Preferred</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>30</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>90</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>pushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>Confirm</string>
+ </property>
+ <property name="on">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>90</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>pushButton2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Cancel</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>90</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>pushButton1</sender>
+ <signal>clicked()</signal>
+ <receiver>TimedLogoutDlg</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>pushButton2</sender>
+ <signal>clicked()</signal>
+ <receiver>TimedLogoutDlg</receiver>
+ <slot>reject()</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>

@ -0,0 +1,38 @@
Index: ksmserver/shutdowndlg.cpp
===================================================================
--- ksmserver/shutdowndlg.cpp.orig
+++ ksmserver/shutdowndlg.cpp
@@ -126,6 +126,7 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
// End session
KPushButton* btnLogout = new KPushButton( KGuiItem( i18n("&End Current Session"), "undo"), frame );
+ QToolTip::add( btnLogout, i18n( "<qt><h3>End Current Session</h3><p>Log out of the current session to login with a different user</p></qt>" ) );
QFont btnFont = btnLogout->font();
buttonlay->addWidget( btnLogout );
connect(btnLogout, SIGNAL(clicked()), SLOT(slotLogout()));
@@ -134,6 +135,7 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
// Shutdown
KPushButton* btnHalt = new KPushButton( KGuiItem( i18n("&Turn Off Computer"), "exit"), frame );
+ QToolTip::add( btnHalt, i18n( "<qt><h3>Turn Off Computer</h3><p>Log out of the current session and turn off the computer</p></qt>" ) );
btnHalt->setFont( btnFont );
buttonlay->addWidget( btnHalt );
connect(btnHalt, SIGNAL(clicked()), SLOT(slotHalt()));
@@ -142,6 +144,7 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
// Reboot
KSMDelayedPushButton* btnReboot = new KSMDelayedPushButton( KGuiItem( i18n("&Restart Computer"), "reload"), frame );
+ QToolTip::add( btnReboot, i18n( "<qt><h3>Restart Computer</h3><p>Log out of the current session and restart the computer</p><p>Hold the mouse button or the space bar for a short while to get a list of options what to boot</p></qt>" ) );
btnReboot->setFont( btnFont );
buttonlay->addWidget( btnReboot );
@@ -168,7 +171,8 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
btnReboot->setPopup(targets);
connect( targets, SIGNAL(activated(int)), SLOT(slotReboot(int)) );
- }
+ } else
+ QToolTip::add( btnReboot, i18n( "<qt><h3>Restart Computer</h3><p>Log out of the current session and restart the computer</p></qt>" ) );
}
buttonlay->addStretch( 1 );

@ -0,0 +1,19 @@
Index: ksplashml/kcmksplash/installer.cpp
===================================================================
--- ksplashml/kcmksplash/installer.cpp.orig
+++ ksplashml/kcmksplash/installer.cpp
@@ -474,6 +474,14 @@ void SplashInstaller::slotTest()
KMessageBox::error(this,i18n("Unable to start ksplashsimple."));
return;
}
+ if( themeName.startsWith( "ksplashx-" ))
+ {
+ KProcess proc;
+ proc << "ksplashx" << themeName.mid( 9 ) << "--test";
+ if (!proc.start(KProcess::Block))
+ KMessageBox::error(this,i18n("Unable to start ksplashx."));
+ return;
+ }
KProcess proc;
proc << "ksplash" << "--test" << "--theme" << themeName;
if (!proc.start(KProcess::Block))

@ -0,0 +1,15 @@
--- ksysguard/gui/ksysguard.cc
+++ ksysguard/gui/ksysguard.cc
@@ -407,7 +407,11 @@
}
#if HAVE_SLP
- rescanSLP();
+ static int rate;
+ if (++rate > 100) {
+ rate = 0;
+ rescanSLP();
+ }
#endif
}

@ -0,0 +1,288 @@
--- ksysguard/configure.in.in
+++ ksysguard/configure.in.in
@@ -45,5 +45,34 @@
AC_SUBST(LIBHOSTS)
AC_SUBST(LIBSENSORS)
+# check for SLP
+dnl define the configure option that disables slp
+AC_ARG_ENABLE(slp, [ --disable-slp don't require libslp (ksysguard do not find daemons) ], with_slp=$enableval, with_slp=yes)
+if test "$with_slp" = "yes"; then
+AC_MSG_CHECKING(for SLP support)
+save_slptest_LIBS="$LIBS"
+save_slptest_LDFLAGS="$LDFLAGS"
+save_slptest_CPPFLAGS="$CPPFLAGS"
+LDFLAGS="$all_libraries $LDFLAGS"
+CPPFLAGS="$CPPFLAGS $all_includes"
+LIBS="-lslp"
+AC_TRY_LINK( [
+ #include <slp.h>
+ ],[
+ SLPOpen(0, SLP_FALSE, (SLPHandle*) 0);
+ ],[
+ AC_DEFINE(HAVE_SLP,1,[Define if SLP is available])
+ LIB_SLP="-lslp"
+ AC_MSG_RESULT(yes)
+ ],[
+ AC_MSG_RESULT(no)
+ LIB_SLP=""
+])
+CPPFLAGS=$save_slptest_CPPFLAGS
+LDFLAGS=$save_slptest_LDFLAGS
+LIBS=$save_slptest_LIBS
+fi
+AC_SUBST(LIB_SLP)
+
dnl Check for dell laptop support
AM_CONDITIONAL(supports_i8k, test -f /proc/i8k)
--- ksysguard/example/ksysguarddrc
+++ ksysguard/example/ksysguarddrc
@@ -1,5 +1,8 @@
# /etc/ksysguardd.conf
+# refresh SLP registration
+SLPrefresh=1800
+
# LogFiles: the list of all available logfiles
LogFiles=messages:/var/log/messages,kern:/var/log/kern.log,daemon:/var/log/daemon.log
--- ksysguard/gui/Makefile.am
+++ ksysguard/gui/Makefile.am
@@ -31,7 +31,7 @@
ksysguard_LDADD = \
ksgrd/libksgrd.la \
SensorDisplayLib/libsensordisplays.la \
- $(LIB_KDEUI) $(LIB_KIO) $(LIB_KDNSSD)
+ $(LIB_KDEUI) $(LIB_KIO) $(LIB_KDNSSD) $(LIB_SLP)
ksysguard_LDFLAGS = $(all_libraries) $(KDE_RPATH)
kpm_SOURCES = kpm.c
--- ksysguard/gui/ksysguard.cc
+++ ksysguard/gui/ksysguard.cc
@@ -34,6 +34,8 @@
#include <stdlib.h>
#include <unistd.h>
+#include <qregexp.h>
+
#include <kaboutdata.h>
#include <kaction.h>
#include <kapplication.h>
@@ -280,6 +282,46 @@
mSplitter->setSizes( sizes );
}
+#if HAVE_SLP
+
+SLPBoolean MySLPSrvURLCallback( SLPHandle phslp,
+ const char* srvurl,
+ unsigned short lifetime,
+ SLPError errcode,
+ void* cookie )
+{
+ QRegExp r("^service:ksysguardd.kde://(\\w+):(.*)$");
+
+ if ( r.search(srvurl) >= 0 ){
+ QString host( r.cap(1) );
+ int port = r.cap(2).toInt() ;
+
+ if ( !host.isEmpty() && port > 0 )
+ KSGRD::SensorMgr->engage( host, "", "", port );
+ };
+ return SLP_TRUE;
+}
+
+void TopLevel::rescanSLP( bool enableErrorPopup )
+{
+ SLPHandle phslp;
+ SLPError result;
+ result = SLPOpen( NULL, SLP_FALSE, &phslp);
+ if (result != SLP_OK)
+ qWarning( "SLPOpen failed" ); // TODO: KMessagebox
+ else {
+ result = SLPFindSrvs( phslp,
+ "service:ksysguardd.kde",
+ "", // TODO: Scope selector
+ "", // all services
+ MySLPSrvURLCallback,
+ this );
+ if (result != SLP_OK)
+ qWarning( "unable to register SLP service" ); // TODO: KMessageBox
+ }
+}
+#endif
+
void TopLevel::initStatusBar()
{
KSGRD::SensorMgr->engage( "localhost", "", "ksysguardd" );
@@ -363,6 +405,10 @@
KSGRD::SensorMgr->sendRequest( "localhost", "mem/swap/used",
(KSGRD::SensorClient*)this, 4 );
}
+
+#if HAVE_SLP
+ rescanSLP();
+#endif
}
bool TopLevel::queryClose()
--- ksysguard/gui/ksysguard.h
+++ ksysguard/gui/ksysguard.h
@@ -24,6 +24,8 @@
#ifndef KSG_KSYSGUARD_H
#define KSG_KSYSGUARD_H
+#include <config.h>
+
#include <qevent.h>
#include <dcopclient.h>
@@ -34,6 +36,10 @@
#include <ksgrd/SensorClient.h>
+#if HAVE_SLP
+#include <slp.h>
+#endif
+
class KRecentFilesAction;
class KToggleAction;
@@ -77,6 +83,9 @@
virtual void customEvent( QCustomEvent* );
virtual void timerEvent( QTimerEvent* );
virtual bool queryClose();
+#if HAVE_SLP
+ virtual void rescanSLP( bool enableErrorPopup = FALSE );
+#endif
protected slots:
void connectHost();
--- ksysguard/ksysguardd/Makefile.am
+++ ksysguard/ksysguardd/Makefile.am
@@ -31,5 +31,5 @@
bin_PROGRAMS = ksysguardd
ksysguardd_SOURCES = Command.c conf.c ksysguardd.c PWUIDCache.c
-ksysguardd_LDFLAGS = $(all_libraries)
+ksysguardd_LDFLAGS = $(all_libraries) $(LIB_SLP)
ksysguardd_LDADD = $(top_builddir)/ksysguard/ksysguardd/$(UNAME)/libksysguardd.a ../CContLib/libccont.a -lkdefakes_nonpic $(LIBHOSTS) $(LIB_DNSSD) $(LIB_KINFO)
--- ksysguard/ksysguardd/conf.c
+++ ksysguard/ksysguardd/conf.c
@@ -56,6 +56,7 @@
char *begin, *token, *tmp;
ConfigLogFile *confLog;
+ confSLPrefresh = 0;
LogFileList = new_ctnr();
SensorList = new_ctnr();
@@ -93,6 +94,10 @@
if ( line[ strlen( line ) - 1 ] == '\n' )
line[ strlen( line ) - 1 ] = '\0';
+ if ( !strncmp( line, "SLPrefresh=", 11 ) ) {
+ confSLPrefresh = atoi( line + 11 );
+ };
+
if ( !strncmp( line, "RegisterDomain",14) && (begin = strchr( line, '=' )) ) RegisterDomain=strdup(begin+1);
if ( !strncmp( line, "LogFiles", 8 ) && (begin = strchr( line, '=' )) ) {
--- ksysguard/ksysguardd/conf.h
+++ ksysguard/ksysguardd/conf.h
@@ -30,6 +30,8 @@
extern char* RegisterDomain;
+short confSLPrefresh;
+
void parseConfigFile( const char *filename );
void freeConfigFile();
--- ksysguard/ksysguardd/ksysguardd.c
+++ ksysguard/ksysguardd/ksysguardd.c
@@ -43,6 +43,10 @@
#ifdef HAVE_DNSSD
#include <dns_sd.h>
#endif
+#if HAVE_SLP
+#include <slp.h>
+#endif
+
#include "modules.h"
#include "ksysguardd.h"
@@ -348,6 +352,62 @@
#endif
+#if HAVE_SLP
+void mySLPRegReport(SLPHandle hslp, SLPError errcode, void *cookie)
+{
+ if (errcode)
+ log_error( "SLP (de)registration error" );
+}
+
+void register_slp();
+
+void refresh_slp()
+{
+ register_slp();
+}
+
+void register_slp()
+{
+ SLPHandle phslp;
+ SLPError result;
+ int slp_timeout = confSLPrefresh;
+ struct sigaction act, oact;
+
+ if ( slp_timeout < 120 ) /* do not bomb the slp server with wrong config */
+ slp_timeout = 120 ;
+ if ( slp_timeout > SLP_LIFETIME_MAXIMUM )
+ slp_timeout = SLP_LIFETIME_MAXIMUM;
+
+ result = SLPOpen( NULL, SLP_FALSE, &phslp);
+ if (result != SLP_OK)
+ log_error( "SLPOpen failed" );
+ else {
+ char hostname[1024];
+ char SLPServiceUrl[2048];
+ gethostname( hostname, 1023 );
+ snprintf( SLPServiceUrl, 1023, "service:ksysguardd.kde://%s:%i", hostname, SocketPort );
+
+ result = SLPReg( phslp,
+ SLPServiceUrl,
+ slp_timeout,
+ 0,
+ "",
+ SLP_TRUE,
+ mySLPRegReport,
+ 0 );
+
+ if (result != SLP_OK)
+ log_error( "unable to register SLP service" );
+ SLPClose( phslp );
+
+ act.sa_handler = refresh_slp;
+ if (0 != sigaction(SIGALRM, &act, &oact))
+ log_error("Error establishing signal handler for SLP");
+ alarm(slp_timeout - 15);
+ }
+}
+#endif
+
int createServerSocket()
{
int i = 1;
@@ -402,6 +462,10 @@
ServiceSocket = DNSServiceRefSockFD(Ref);
#endif
+#if HAVE_SLP
+ if ( BindToAllInterfaces )
+ register_slp();
+#endif
return newSocket;
}

@ -0,0 +1,80 @@
#! /bin/sh
# Copyright (c) 1995-2001 SuSE GmbH Nuernberg, Germany.
#
# Author: adrian@suse.de
#
# /etc/init.d/ksysguardd
# and its symbolic link
# /usr/sbin/rcksysguardd
#
### BEGIN INIT INFO
# Provides: ksysguardd
# Required-Start: $time $named
# Should-Start: $syslog slpd
# Required-Stop: $null
# Default-Start: 3 5
# Default-Stop: 0 1 2 4 6
# Description: remote monitor daemon for ksysguard
# Short-Description: remote monitor daemon for ksysguard
### END INIT INFO
. /etc/rc.status
test -e /etc/rc.config && source /etc/rc.config
# Determine the base and follow a runlevel link name.
base=${0##*/}
link=${base#*[SK][0-9][0-9]}
# Force execution if not called by a runlevel directory.
test -x /usr/bin/ksysguardd || exit 0
rc_reset
case "$1" in
start)
echo -n "Starting remote monitor daemon for ksysguard "
/usr/bin/ksysguardd -d -i >/dev/null
rc_status -v
;;
stop)
if [ -e /var/run/ksysguardd.pid ]; then
echo -n "Shutting down remote monitor daemon for ksysguard "
killproc -p /var/run/ksysguardd.pid -TERM /usr/bin/ksysguardd
rc_status -v
fi
;;
try-restart|condrestart)
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
# Remember status and be quiet
rc_status
;;
restart|force-reload)
## If first returns OK call the second, if first or
## second command fails, set echo return value.
$0 stop; sleep 1 && $0 start
rc_status
;;
reload)
$0 stop && $0 start
rc_status
;;
status)
echo -n "Checking for remote monitor daemon for ksysguard "
checkproc -p /var/run/ksysguardd.pid /usr/bin/ksysguardd
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload|try-restart|force-reload}"
exit 1
;;
esac
rc_exit

@ -0,0 +1,12 @@
#############################################################################
#
# OpenSLP registration file
#
# register ksysguard daemon
#
#############################################################################
service:ksysguardd.kde://$HOSTNAME:3112,en,65535
watch-port-udp=3112
description=KDE ksysguard daemon

@ -0,0 +1,43 @@
Index: kwin/kwinbindings.cpp
===================================================================
--- kwin/kwinbindings.cpp.orig
+++ kwin/kwinbindings.cpp
@@ -119,22 +119,22 @@
DEF( I18N_NOOP("Switch to Desktop 2"), CTRL+Qt::Key_F2, WIN+Qt::Key_F2, slotSwitchToDesktop(int) );
DEF( I18N_NOOP("Switch to Desktop 3"), CTRL+Qt::Key_F3, WIN+Qt::Key_F3, slotSwitchToDesktop(int) );
DEF( I18N_NOOP("Switch to Desktop 4"), CTRL+Qt::Key_F4, WIN+Qt::Key_F4, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 5"), CTRL+Qt::Key_F5, WIN+Qt::Key_F5, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 6"), CTRL+Qt::Key_F6, WIN+Qt::Key_F6, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 7"), CTRL+Qt::Key_F7, WIN+Qt::Key_F7, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 8"), CTRL+Qt::Key_F8, WIN+Qt::Key_F8, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 9"), CTRL+Qt::Key_F9, WIN+Qt::Key_F9, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 10"), CTRL+Qt::Key_F10, WIN+Qt::Key_F10, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 11"), CTRL+Qt::Key_F11, 0, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 12"), CTRL+Qt::Key_F12, 0, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 13"), CTRL+SHIFT+Qt::Key_F1, 0, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 14"), CTRL+SHIFT+Qt::Key_F2, 0, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 15"), CTRL+SHIFT+Qt::Key_F3, 0, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 16"), CTRL+SHIFT+Qt::Key_F4, 0, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 17"), CTRL+SHIFT+Qt::Key_F5, 0, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 18"), CTRL+SHIFT+Qt::Key_F6, 0, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 19"), CTRL+SHIFT+Qt::Key_F7, 0, slotSwitchToDesktop(int) );
- DEF( I18N_NOOP("Switch to Desktop 20"), CTRL+SHIFT+Qt::Key_F8, 0, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 5"), 0, WIN+Qt::Key_F5, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 6"), 0, WIN+Qt::Key_F6, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 7"), 0, WIN+Qt::Key_F7, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 8"), 0, WIN+Qt::Key_F8, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 9"), 0, WIN+Qt::Key_F9, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 10"), 0, WIN+Qt::Key_F10, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 11"), 0, 0, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 12"), 0, 0, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 13"), 0, 0, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 14"), 0, 0, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 15"), 0, 0, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 16"), 0, 0, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 17"), 0, 0, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 18"), 0, 0, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 19"), 0, 0, slotSwitchToDesktop(int) );
+ DEF( I18N_NOOP("Switch to Desktop 20"), 0, 0, slotSwitchToDesktop(int) );
DEF( I18N_NOOP("Switch to Next Desktop"), 0, 0, slotSwitchDesktopNext() );
DEF( I18N_NOOP("Switch to Previous Desktop"), 0, 0, slotSwitchDesktopPrevious() );
DEF( I18N_NOOP("Switch One Desktop to the Right"), 0, 0, slotSwitchDesktopRight() );

@ -0,0 +1,14 @@
Index: kxkb/kcmlayout.cpp
===================================================================
--- kxkb/kcmlayout.cpp.orig
+++ kxkb/kcmlayout.cpp
@@ -352,6 +352,9 @@ void LayoutConfig::add()
// Create a copy of the sel widget, as one might add the same layout more
// than one time, with different variants.
QListViewItem* toadd = copyLVI(sel, widget->listLayoutsDst);
+
+ // Turn on "Include Latin layout" for new language by default (bnc:204402)
+ toadd->setText(LAYOUT_COLUMN_INCLUDE, "us");
widget->listLayoutsDst->insertItem(toadd);
if( widget->listLayoutsDst->childCount() > 1 )

@ -0,0 +1,26 @@
Index: kdesu/kdesu/sudlg.cpp
===================================================================
--- kdesu/kdesu/sudlg.cpp.orig
+++ kdesu/kdesu/sudlg.cpp
@@ -29,18 +29,10 @@ KDEsuDialog::KDEsuDialog(QCString user,
setCaption(i18n("Run as %1").arg(user));
QString prompt;
- if (superUserCommand == "sudo" && m_User == "root") {
- prompt = i18n("Please enter your password." );
+ if (m_User == "root") {
+ prompt = i18n("Please enter the Administrator (root) password to continue.");
} else {
- if (m_User == "root") {
- prompt = i18n("The action you requested needs root privileges. "
- "Please enter root's password below or click "
- "Ignore to continue with your current privileges.");
- } else {
- prompt = i18n("The action you requested needs additional privileges. "
- "Please enter the password for \"%1\" below or click "
- "Ignore to continue with your current privileges.").arg(m_User);
- }
+ prompt = i18n("Please enter password for \"%1\" to continue.").arg(m_User);
}
setPrompt(prompt);

@ -0,0 +1,117 @@
Index: libkonq/Makefile.am
===================================================================
--- libkonq/Makefile.am.orig
+++ libkonq/Makefile.am
@@ -53,14 +53,10 @@ include_HEADERS = konq_popupmenu.h knewm
konq_faviconmgr.h konq_xmlguiclient.h konqbookmarkmanager.h konq_filetip.h
-if include_ARTS
-ARTS_MODULE = konq_sound.la
-endif
-
-kde_module_LTLIBRARIES = $(ARTS_MODULE)
+kde_module_LTLIBRARIES = konq_sound.la
konq_sound_la_SOURCES = konq_sound.cc
konq_sound_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
-konq_sound_la_LIBADD = -lsoundserver_idl -lartskde
+konq_sound_la_LIBADD = -lkdemm
noinst_HEADERS = konq_sound.h
Index: libkonq/konq_sound.cc
===================================================================
--- libkonq/konq_sound.cc.orig
+++ libkonq/konq_sound.cc
@@ -16,10 +16,9 @@
Boston, MA 02110-1301, USA.
*/
-#include <kartsdispatcher.h>
#include <kdebug.h>
-#include <kplayobjectfactory.h>
-#include <soundserver.h>
+#include <kdemm/simpleplayer.h>
+#include <kdemm/factory.h>
#include "konq_sound.h"
@@ -39,71 +38,38 @@ public:
private:
QStringList m_mimeTypes;
- KArtsDispatcher m_dispatcher;
- Arts::SoundServerV2 m_soundServer;
- KDE::PlayObjectFactory *m_factory;
- KDE::PlayObject *m_player;
+ KDE::Multimedia::SimplePlayer m_player;
};
KonqSoundPlayerImpl::KonqSoundPlayerImpl()
- : m_player(0)
{
- m_soundServer = Arts::Reference("global:Arts_SoundServerV2");
- m_factory = new KDE::PlayObjectFactory(m_soundServer);
}
KonqSoundPlayerImpl::~KonqSoundPlayerImpl()
{
- delete m_player;
- delete m_factory;
}
const QStringList &KonqSoundPlayerImpl::mimeTypes()
{
- if (m_mimeTypes.isEmpty())
- {
- Arts::TraderQuery query;
- vector<Arts::TraderOffer> *offers = query.query();
-
- for (vector<Arts::TraderOffer>::iterator it = offers->begin();
- it != offers->end(); ++it)
- {
- vector<string> *prop = (*it).getProperty("MimeType");
- for (vector<string>::iterator mt = prop->begin();
- mt != prop->end(); ++mt)
- if ((*mt).length()) // && (*mt).find("video/") == string::npos)
- m_mimeTypes << (*mt).c_str();
- delete prop;
- }
- delete offers;
- }
+ if( m_mimeTypes.isEmpty() )
+ m_mimeTypes = KDE::Multimedia::Factory::self()->playableMimeTypes();
+
return m_mimeTypes;
}
void KonqSoundPlayerImpl::play(const QString &fileName)
{
- if (m_soundServer.isNull())
- return;
-
- delete m_player;
- if ((m_player = m_factory->createPlayObject(fileName, true)))
- {
- if (m_player->isNull())
- stop();
- else
- m_player->play();
- }
+ m_player.play( KURL( fileName ) );
}
void KonqSoundPlayerImpl::stop()
{
- delete m_player;
- m_player = 0;
+ m_player.stop();
}
bool KonqSoundPlayerImpl::isPlaying()
{
- return m_player ? (m_player->state() == Arts::posPlaying) : false;
+ return m_player.isPlaying();
}
class KonqSoundFactory : public KLibFactory

@ -0,0 +1,33 @@
Index: kcontrol/locale/kcmlocale.cpp
===================================================================
--- kcontrol/locale/kcmlocale.cpp.orig
+++ kcontrol/locale/kcmlocale.cpp
@@ -292,9 +292,13 @@ void KLocaleConfig::loadCountryList()
QString map( locate( "locale",
QString::fromLatin1( "l10n/%1.png" )
.arg(tag) ) );
+#if 0
QIconSet icon;
if ( !map.isNull() )
icon = KGlobal::iconLoader()->loadIconSet(map, KIcon::Small);
+#else
+ QIconSet icon;
+#endif
m_comboCountry->insertSubmenu( icon, name, tag, sub, -2 );
}
@@ -318,10 +322,14 @@ void KLocaleConfig::loadCountryList()
tag = tag.mid(index + 1);
int menu_index = submenu.isEmpty() ? -1 : -2;
+#if 0
QString flag( locate( "locale",
QString::fromLatin1( "l10n/%1/flag.png" )
.arg(tag) ) );
QIconSet icon( KGlobal::iconLoader()->loadIconSet(flag, KIcon::Small) );
+#else
+ QIconSet icon;
+#endif
m_comboCountry->insertItem( icon, name, tag, submenu, menu_index );
}

@ -0,0 +1,380 @@
Index: kdesktop/lock/lockprocess.cc
===================================================================
--- kdesktop/lock/lockprocess.cc.orig
+++ kdesktop/lock/lockprocess.cc
@@ -36,6 +36,8 @@
#include <kstdguiitem.h>
#include <kpixmapeffect.h>
#include <kpixmap.h>
+#include <kwin.h>
+#include <kwinmodule.h>
#include <qframe.h>
#include <qlabel.h>
@@ -93,6 +95,8 @@ static Window gVRootData = 0;
static Atom gXA_VROOT;
static Atom gXA_SCREENSAVER_VERSION;
+extern Atom qt_wm_state;
+
//===========================================================================
//
// Screen saver handling process. Handles screensaver window,
@@ -108,7 +112,9 @@ LockProcess::LockProcess(bool child, boo
mVisibility(false),
mRestoreXF86Lock(false),
mForbidden(false),
- mAutoLogout(false)
+ mAutoLogout(false),
+ mVkbdProcess(NULL),
+ mKWinModule(NULL)
{
setupSignals();
@@ -909,10 +915,14 @@ bool LockProcess::checkPass()
{
if (mAutoLogout)
killTimer(mAutoLogoutTimerId);
+
+ showVkbd();
PasswordDlg passDlg( this, &greetPlugin);
int ret = execDialog( &passDlg );
+
+ hideVkbd();
XWindowAttributes rootAttr;
XGetWindowAttributes(qt_xdisplay(), RootWindow(qt_xdisplay(),
@@ -992,9 +1002,13 @@ bool LockProcess::x11Event(XEvent *event
{
switch (event->type)
{
- case KeyPress:
case ButtonPress:
case MotionNotify:
+ case ButtonRelease:
+ if( forwardVkbdEvent( event ))
+ return true; // filter out
+ // fall through
+ case KeyPress:
if (mBusy || !mDialogs.isEmpty())
break;
mBusy = true;
@@ -1031,11 +1045,30 @@ bool LockProcess::x11Event(XEvent *event
case ConfigureNotify: // from SubstructureNotifyMask on the root window
if(event->xconfigure.event == qt_xrootwin())
stayOnTop();
+ for( QValueList< VkbdWindow >::Iterator it = mVkbdWindows.begin();
+ it != mVkbdWindows.end();
+ ++it ) {
+ if( (*it).id == event->xconfigure.window ) {
+ (*it).rect = QRect( event->xconfigure.x, event->xconfigure.y,
+ event->xconfigure.width, event->xconfigure.height );
+ break;
+ }
+ }
break;
case MapNotify: // from SubstructureNotifyMask on the root window
+ windowAdded( event->xmap.window, false );
if( event->xmap.event == qt_xrootwin())
stayOnTop();
break;
+ case DestroyNotify:
+ for( QValueList< VkbdWindow >::Iterator it = mVkbdWindows.begin();
+ it != mVkbdWindows.end();
+ ++it )
+ if( (*it).id == event->xdestroywindow.window ) {
+ mVkbdWindows.remove( it );
+ break;
+ }
+ break;
}
// We have grab with the grab window being the root window.
@@ -1060,17 +1093,24 @@ bool LockProcess::x11Event(XEvent *event
void LockProcess::stayOnTop()
{
- if(!mDialogs.isEmpty())
+ if(!mDialogs.isEmpty() || !mVkbdWindows.isEmpty())
{
// this restacking is written in a way so that
// if the stacking positions actually don't change,
// all restacking operations will be no-op,
// and no ConfigureNotify will be generated,
// thus avoiding possible infinite loops
- XRaiseWindow( qt_xdisplay(), mDialogs.first()->winId()); // raise topmost
+ if( !mVkbdWindows.isEmpty())
+ XRaiseWindow( qt_xdisplay(), mVkbdWindows.first().id );
+ else
+ XRaiseWindow( qt_xdisplay(), mDialogs.first()->winId()); // raise topmost
// and stack others below it
- Window* stack = new Window[ mDialogs.count() + 1 ];
+ Window* stack = new Window[ mDialogs.count() + mVkbdWindows.count() + 1 ];
int count = 0;
+ for( QValueList< VkbdWindow >::ConstIterator it = mVkbdWindows.begin();
+ it != mVkbdWindows.end();
+ ++it )
+ stack[ count++ ] = (*it).id;
for( QValueList< QWidget* >::ConstIterator it = mDialogs.begin();
it != mDialogs.end();
++it )
@@ -1169,4 +1209,200 @@ void LockProcess::msgBox( QMessageBox::I
execDialog( &box );
}
+static int run_vkbd = -1;
+void LockProcess::showVkbd()
+{
+ if( run_vkbd == - 1 ) {
+ int status = system( "hal-find-by-property --key system.formfactor.subtype --string tabletpc" );
+// status = 0; // enable for testing
+ run_vkbd = ( WIFEXITED( status ) && WEXITSTATUS( status ) == 0
+ && !KStandardDirs::findExe( "xvkbd" ).isEmpty()) ? 1 : 0;
+ }
+ if( run_vkbd ) {
+ mVkbdWindows.clear();
+ mVkbdLastEventWindow = None;
+ mKWinModule = new KWinModule( NULL, KWinModule::INFO_WINDOWS );
+ connect( mKWinModule, SIGNAL( windowAdded( WId )), SLOT( windowAdded( WId )));
+ mVkbdProcess = new KProcess;
+ *mVkbdProcess << "xvkbd" << "-compact" << "-geometry" << "-0-0" << "-xdm";
+ mVkbdProcess->start();
+ }
+}
+
+void LockProcess::hideVkbd()
+{
+ if( mVkbdProcess != NULL ) {
+ mVkbdProcess->kill();
+ delete mVkbdProcess;
+ mVkbdProcess = NULL;
+ delete mKWinModule;
+ mKWinModule = NULL;
+ mVkbdWindows.clear();
+ }
+}
+
+void LockProcess::windowAdded( WId w )
+{
+ windowAdded( w, true );
+}
+
+void LockProcess::windowAdded( WId w, bool managed )
+{
+ KWin::WindowInfo info = KWin::windowInfo( w, 0, NET::WM2WindowClass );
+ if( info.windowClassClass().lower() != "xvkbd" )
+ return;
+ // Unmanaged windows (i.e. popups) don't currently work anyway, since they
+ // don't have WM_CLASS set anyway. I could perhaps try tricks with X id
+ // ranges if really needed.
+ if( managed ) {
+ // withdraw the window, wait for it to be withdrawn, reparent it directly
+ // to root at the right position
+ XWithdrawWindow( qt_xdisplay(), w, qt_xscreen());
+ for(;;) {
+ Atom type;
+ int format;
+ unsigned long length, after;
+ unsigned char *data;
+ int r = XGetWindowProperty( qt_xdisplay(), w, qt_wm_state, 0, 2,
+ false, AnyPropertyType, &type, &format,
+ &length, &after, &data );
+ bool withdrawn = true;
+ if ( r == Success && data && format == 32 ) {
+ Q_UINT32 *wstate = (Q_UINT32*)data;
+ withdrawn = (*wstate == WithdrawnState );
+ XFree( (char *)data );
+ }
+ if( withdrawn )
+ break;
+ }
+ }
+ XSelectInput( qt_xdisplay(), w, StructureNotifyMask );
+ XWindowAttributes attr_geom;
+ if( !XGetWindowAttributes( qt_xdisplay(), w, &attr_geom ))
+ return;
+ int x = XDisplayWidth( qt_xdisplay(), qt_xscreen()) - attr_geom.width;
+ int y = XDisplayHeight( qt_xdisplay(), qt_xscreen()) - attr_geom.height;
+ if( managed ) {
+ XSetWindowAttributes attr;
+ attr.override_redirect = True;
+ XChangeWindowAttributes( qt_xdisplay(), w, CWOverrideRedirect, &attr );
+ XReparentWindow( qt_xdisplay(), w, qt_xrootwin(), x, y );
+ XMapWindow( qt_xdisplay(), w );
+ }
+ VkbdWindow data;
+ data.id = w;
+ data.rect = QRect( x, y, attr_geom.width, attr_geom.height );
+ mVkbdWindows.prepend( data );
+}
+
+bool LockProcess::forwardVkbdEvent( XEvent* event )
+{
+ if( mVkbdProcess == NULL )
+ return false;
+ QPoint pos;
+ Time time;
+ switch( event->type )
+ {
+ case ButtonPress:
+ case ButtonRelease:
+ pos = QPoint( event->xbutton.x, event->xbutton.y );
+ time = event->xbutton.time;
+ break;
+ case MotionNotify:
+ pos = QPoint( event->xmotion.x, event->xmotion.y );
+ time = event->xmotion.time;
+ break;
+ default:
+ return false;
+ }
+ // vkbd windows are kept topmost, so just find the first one in the position
+ for( QValueList< VkbdWindow >::ConstIterator it = mVkbdWindows.begin();
+ it != mVkbdWindows.end();
+ ++it ) {
+ if( (*it).rect.contains( pos )) {
+ // Find the subwindow where the event should actually go.
+ // Not exactly cheap in the number of X roundtrips but oh well.
+ Window window = (*it).id;
+ Window root, child;
+ int root_x, root_y, x, y;
+ unsigned int mask;
+ for(;;) {
+ if( !XQueryPointer( qt_xdisplay(), window, &root, &child, &root_x, &root_y, &x, &y, &mask ))
+ return false;
+ if( child == None )
+ break;
+ window = child;
+ }
+ switch( event->type )
+ {
+ case ButtonPress:
+ case ButtonRelease:
+ event->xbutton.x = x;
+ event->xbutton.y = y;
+ event->xbutton.subwindow = None;
+ break;
+ case MotionNotify:
+ event->xmotion.x = x;
+ event->xmotion.y = y;
+ event->xmotion.subwindow = None;
+ break;
+ }
+ event->xany.window = window;
+ sendVkbdFocusInOut( window, time );
+ XSendEvent( qt_xdisplay(), window, False, 0, event );
+ return true;
+ }
+ }
+ sendVkbdFocusInOut( None, time );
+ return false;
+}
+
+// Fake EnterNotify/LeaveNotify events as the mouse moves. They're not sent by X
+// because of the grab and having them makes xvkbd highlight the buttons (but
+// not needed otherwise it seems).
+void LockProcess::sendVkbdFocusInOut( WId window, Time t )
+{
+ if( mVkbdLastEventWindow == window )
+ return;
+ if( mVkbdLastEventWindow != None ) {
+ XEvent e;
+ e.xcrossing.type = LeaveNotify;
+ e.xcrossing.display = qt_xdisplay();
+ e.xcrossing.window = mVkbdLastEventWindow;
+ e.xcrossing.root = qt_xrootwin();
+ e.xcrossing.subwindow = None;
+ e.xcrossing.time = t;
+ e.xcrossing.x = 0;
+ e.xcrossing.y = 0;
+ e.xcrossing.x_root = -1;
+ e.xcrossing.y_root = -1;
+ e.xcrossing.mode = NotifyNormal;
+ e.xcrossing.detail = NotifyAncestor;
+ e.xcrossing.same_screen = True;
+ e.xcrossing.focus = False;
+ e.xcrossing.state = 0;
+ XSendEvent( qt_xdisplay(), mVkbdLastEventWindow, False, 0, &e );
+ }
+ mVkbdLastEventWindow = window;
+ if( mVkbdLastEventWindow != None ) {
+ XEvent e;
+ e.xcrossing.type = EnterNotify;
+ e.xcrossing.display = qt_xdisplay();
+ e.xcrossing.window = mVkbdLastEventWindow;
+ e.xcrossing.root = qt_xrootwin();
+ e.xcrossing.subwindow = None;
+ e.xcrossing.time = t;
+ e.xcrossing.x = 0;
+ e.xcrossing.y = 0;
+ e.xcrossing.x_root = 0;
+ e.xcrossing.y_root = 0;
+ e.xcrossing.mode = NotifyNormal;
+ e.xcrossing.detail = NotifyAncestor;
+ e.xcrossing.same_screen = True;
+ e.xcrossing.focus = False;
+ e.xcrossing.state = 0;
+ XSendEvent( qt_xdisplay(), mVkbdLastEventWindow, False, 0, &e );
+ }
+}
+
#include "lockprocess.moc"
Index: kdesktop/lock/lockprocess.h
===================================================================
--- kdesktop/lock/lockprocess.h.orig
+++ kdesktop/lock/lockprocess.h
@@ -23,6 +23,7 @@
#include <X11/Xlib.h>
class KLibrary;
+class KWinModule;
struct GreeterPluginHandle {
KLibrary *library;
@@ -53,7 +54,7 @@ public:
void msgBox( QMessageBox::Icon type, const QString &txt );
int execDialog( QDialog* dlg );
-
+
public slots:
void quitSaver();
void preparePopup();
@@ -70,6 +71,7 @@ private slots:
void suspend();
void checkDPMSActive();
void slotDeadTimePassed();
+ void windowAdded( WId );
private:
void configure();
@@ -93,6 +95,11 @@ private:
void stayOnTop();
void lockXF86();
void unlockXF86();
+ void showVkbd();
+ void hideVkbd();
+ bool forwardVkbdEvent( XEvent* event );
+ void sendVkbdFocusInOut( WId window, Time t );
+ void windowAdded( WId window, bool managed );
void resume( bool force );
static QVariant getConf(void *ctx, const char *key, const QVariant &dflt);
@@ -125,6 +132,15 @@ private:
int mAutoLogoutTimerId;
int mAutoLogoutTimeout;
bool mAutoLogout;
+ KProcess* mVkbdProcess;
+ KWinModule* mKWinModule;
+ struct VkbdWindow
+ {
+ WId id;
+ QRect rect;
+ };
+ QValueList< VkbdWindow > mVkbdWindows;
+ WId mVkbdLastEventWindow;
};
#endif

@ -0,0 +1,413 @@
Subject: Dialog notifying about running low on disk space
From: Lubos Lunak
Feature: bnc#199054
Patch-upstream: no
Index: kioslave/media/medianotifier/Makefile.am
===================================================================
--- kioslave/media/medianotifier/Makefile.am.orig
+++ kioslave/media/medianotifier/Makefile.am
@@ -5,7 +5,8 @@ kded_medianotifier_la_LDFLAGS = -module
kded_medianotifier_la_LIBADD = ../libmediacommon/libmediacommon.la $(LIB_KDECORE) \
$(LIB_KDEUI) $(LIB_KIO)
kded_medianotifier_la_SOURCES = medianotifier.cpp medianotifier.skel \
- notificationdialog.cpp notificationdialogview.ui
+ notificationdialog.cpp notificationdialogview.ui \
+ freespacenotifier.cpp freespacewidget.ui
noinst_HEADERS = medianotifier.h notificationdialog.h
Index: kioslave/media/medianotifier/medianotifier.h
===================================================================
--- kioslave/media/medianotifier/medianotifier.h.orig
+++ kioslave/media/medianotifier/medianotifier.h
@@ -27,6 +27,8 @@
#include <qstring.h>
#include <qmap.h>
+class FreeSpaceNotifier;
+
class MediaNotifier: public KDEDModule
{
Q_OBJECT
@@ -52,6 +54,8 @@ private:
const QString &autoopenFile );
QMap<KIO::Job*,bool> m_allowNotificationMap;
+ FreeSpaceNotifier* m_freeSpaceNotifier;
};
+
#endif
Index: kioslave/media/medianotifier/medianotifier.cpp
===================================================================
--- kioslave/media/medianotifier/medianotifier.cpp.orig
+++ kioslave/media/medianotifier/medianotifier.cpp
@@ -36,6 +36,7 @@
#include "notifiersettings.h"
#include "notifieraction.h"
#include "mediamanagersettings.h"
+#include "freespacenotifier.h"
MediaNotifier::MediaNotifier(const QCString &name) : KDEDModule(name)
{
@@ -44,6 +45,8 @@ MediaNotifier::MediaNotifier(const QCStr
connectDCOPSignal( "kded", "mediamanager", "mediumChanged(QString, bool)",
"onMediumChange(QString, bool)", true );
+
+ m_freeSpaceNotifier = new FreeSpaceNotifier( this );
}
MediaNotifier::~MediaNotifier()
@@ -53,6 +56,7 @@ MediaNotifier::~MediaNotifier()
disconnectDCOPSignal( "kded", "mediamanager", "mediumChanged(QString, bool)",
"onMediumChange(QString, bool)" );
+ delete m_freeSpaceNotifier;
}
void MediaNotifier::onMediumChange( const QString &name, bool allowNotification )
Index: kioslave/media/medianotifier/freespacenotifier.cpp
===================================================================
--- /dev/null
+++ kioslave/media/medianotifier/freespacenotifier.cpp
@@ -0,0 +1,159 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2006 Lukas Tinkl <ltinkl@suse.cz>
+ Copyright (c) 2008 Lubos Lunak <l.lunak@suse.cz>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "freespacenotifier.h"
+
+#include <sys/vfs.h>
+#include <unistd.h>
+
+#include <qdir.h>
+#include <qfile.h>
+#include <qlabel.h>
+#include <qspinbox.h>
+
+#include <kconfig.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <krun.h>
+
+#include "freespacewidget.h"
+
+
+FreeSpaceNotifier::FreeSpaceNotifier( QObject* parent )
+ : QObject( parent )
+ , lastAvailTimer( NULL )
+ , dialog( NULL )
+ , lastAvail( -1 )
+{
+ connect( &timer, SIGNAL( timeout() ), SLOT( checkFreeDiskSpace() ) );
+ KConfig cfg( "lowspacesuse", true ); // read only
+ KConfigGroup group( &cfg, "General" );
+ limit = group.readNumEntry( "WarnMinimumFreeSpace", 200 ); // MiB
+ if( limit != 0 )
+ timer.start( 1000 * 60 /* 1 minute */ );
+}
+
+FreeSpaceNotifier::~FreeSpaceNotifier()
+{
+ delete dialog;
+}
+
+void FreeSpaceNotifier::checkFreeDiskSpace()
+{
+ if ( dialog )
+ return;
+ struct statfs sfs;
+ if ( statfs( QFile::encodeName( QDir::homeDirPath() ), &sfs ) == 0 )
+ {
+ long avail = ( getuid() ? sfs.f_bavail : sfs.f_bfree );
+
+ if (avail < 0 || sfs.f_blocks <= 0)
+ return; // we better do not say anything about it
+
+ int availpct = int( 100 * avail / sfs.f_blocks );
+ avail = ((long long)avail) * sfs.f_bsize / ( 1024 * 1024 ); // to MiB
+ bool warn = false;
+ if( avail < limit ) // avail disk space dropped under a limit
+ {
+ if( lastAvail < 0 ) // always warn the first time
+ {
+ lastAvail = avail;
+ warn = true;
+ }
+ else if( avail > lastAvail ) // the user freed some space
+ lastAvail = avail; // so warn if it goes low again
+ else if( avail < lastAvail * 0.5 ) // available dropped to a half of previous one, warn again
+ {
+ warn = true;
+ lastAvail = avail;
+ }
+ // do not change lastAvail otherwise, to handle free space slowly going down
+ }
+ if ( warn )
+ {
+ dialog = new KDialogBase(
+ i18n( "Low Disk Space" ),
+ KDialogBase::Yes | KDialogBase::No | KDialogBase::Cancel,
+ KDialogBase::Yes, KDialogBase::No,
+ 0, "lowdiskspacedialog", false, true,
+ i18n( "Open File Manager" ), i18n( "Do Nothing" ), i18n( "Disable Warning" ));
+ widget = new FreeSpaceWidget( dialog );
+ dialog->setMainWidget( widget );
+
+ QString text = i18n( "You are running low on disk space on your home partition (currently %2%, %1 MiB free)." )
+ .arg( avail ).arg( availpct );
+ widget->warningLabel->setText( text );
+ widget->spinbox->setMinValue( 0 );
+ widget->spinbox->setMaxValue( 100000 );
+ widget->spinbox->setValue( limit );
+ connect( dialog, SIGNAL( yesClicked() ), SLOT( slotYes() ) );
+ connect( dialog, SIGNAL( noClicked() ), SLOT( slotNo() ) );
+ connect( dialog, SIGNAL( cancelClicked() ), SLOT( slotCancel() ) );
+ dialog->show();
+ }
+ }
+}
+
+void FreeSpaceNotifier::slotYes()
+{
+ ( void ) new KRun( KURL::fromPathOrURL( QDir::homeDirPath() ) );
+ cleanupDialog( widget->spinbox->value());
+}
+
+void FreeSpaceNotifier::slotNo()
+{
+ cleanupDialog( widget->spinbox->value());
+}
+
+void FreeSpaceNotifier::slotCancel()
+{
+ cleanupDialog( 0 ); // set limit to zero
+}
+
+void FreeSpaceNotifier::cleanupDialog( long newLimit )
+{
+ dialog->deleteLater();
+ dialog = NULL;
+ if( limit != newLimit )
+ {
+ KConfig cfg( "lowspacesuse" );
+ KConfigGroup group( &cfg, "General" );
+ limit = newLimit;
+ group.writeEntry( "WarnMinimumFreeSpace", limit );
+ if( limit == 0 )
+ timer.stop();
+ }
+ if( limit != 0 )
+ { // warn again if constanly below limit for too long
+ if( lastAvailTimer == NULL )
+ {
+ lastAvailTimer = new QTimer( this );
+ connect( lastAvailTimer, SIGNAL( timeout()), SLOT( resetLastAvailable()));
+ }
+ lastAvailTimer->start( 1000 * 60 * 60 /* 1 hour*/ );
+ }
+}
+
+void FreeSpaceNotifier::resetLastAvailable()
+{
+ lastAvail = -1;
+ lastAvailTimer->deleteLater();
+ lastAvailTimer = NULL;
+}
+
+#include "freespacenotifier.moc"
Index: kioslave/media/medianotifier/freespacenotifier.h
===================================================================
--- /dev/null
+++ kioslave/media/medianotifier/freespacenotifier.h
@@ -0,0 +1,51 @@
+/* This file is part of the KDE Project
+ Copyright (c) 2006 Lukas Tinkl <ltinkl@suse.cz>
+ Copyright (c) 2008 Lubos Lunak <l.lunak@suse.cz>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _FREESPACENOTIFIER_H_
+#define _FREESPACENOTIFIER_H_
+
+#include <qtimer.h>
+
+#include <kdialogbase.h>
+
+class FreeSpaceWidget;
+
+class FreeSpaceNotifier
+: public QObject
+{
+ Q_OBJECT
+ public:
+ FreeSpaceNotifier( QObject* parent = NULL );
+ virtual ~FreeSpaceNotifier();
+ private slots:
+ void checkFreeDiskSpace();
+ void resetLastAvailable();
+ void slotYes();
+ void slotNo();
+ void slotCancel();
+ private:
+ void cleanupDialog( long newLimit );
+ QTimer timer;
+ QTimer* lastAvailTimer;
+ KDialogBase* dialog;
+ FreeSpaceWidget* widget;
+ long limit;
+ long lastAvail; // used to supress repeated warnings when available space hasn't changed
+};
+
+#endif
Index: kioslave/media/medianotifier/freespacewidget.ui
===================================================================
--- /dev/null
+++ kioslave/media/medianotifier/freespacewidget.ui
@@ -0,0 +1,118 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>FreeSpaceWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>Form1</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>489</width>
+ <height>108</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Form1</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>warningLabel</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Would you like to run a file manager to free some disk space and fix the problem?</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Warn again when the free space is below</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>spinbox</cstring>
+ </property>
+ <property name="suffix">
+ <string> MiB</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>30</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>

@ -0,0 +1,160 @@
Index: ksmserver/shutdowndlg.cpp
===================================================================
--- ksmserver/shutdowndlg.cpp.orig
+++ ksmserver/shutdowndlg.cpp
@@ -35,6 +35,7 @@ Copyright (C) 2000 Matthias Ettrich <ett
#include <kuser.h>
#include <kpixmap.h>
#include <kimageeffect.h>
+#include <kpixmapeffect.h>
#include <kdialog.h>
#include <kseparator.h>
@@ -48,6 +49,9 @@ Copyright (C) 2000 Matthias Ettrich <ett
#include "shutdowndlg.moc"
+static const int max_faded = 2300;
+static const int slice = 20;
+
KSMShutdownFeedback * KSMShutdownFeedback::s_pSelf = 0L;
KSMShutdownFeedback::KSMShutdownFeedback()
@@ -56,12 +60,22 @@ KSMShutdownFeedback::KSMShutdownFeedback
{
setBackgroundMode( QWidget::NoBackground );
setGeometry( QApplication::desktop()->geometry() );
- QTimer::singleShot( 10, this, SLOT( slotPaintEffect() ) );
- m_root.resize( width(), height() );
-}
+ if( QPixmap::defaultDepth() > 8 )
+ {
+ grabbed.create( size(), 32 );
+ QTimer::singleShot( 0, this, SLOT( slotGrab() ) );
+ }
+ else
+ {
+ QTimer::singleShot( 10, this, SLOT( slotPaintEffectOld() ) );
+ m_root.resize( width(), height() );
+ }
-void KSMShutdownFeedback::slotPaintEffect()
+}
+
+// the upstream KDE effect
+void KSMShutdownFeedback::slotPaintEffectOld()
{
if ( m_currentY >= height() ) {
if ( backgroundMode() == QWidget::NoBackground ) {
@@ -80,7 +94,76 @@ void KSMShutdownFeedback::slotPaintEffec
bitBlt( this, 0, m_currentY, &pixmap );
bitBlt( &m_root, 0, m_currentY, &pixmap );
m_currentY += 10;
- QTimer::singleShot( 1, this, SLOT( slotPaintEffect() ) );
+ QTimer::singleShot( 1, this, SLOT( slotPaintEffectOld() ) );
+}
+
+// the SUSE effect
+void KSMShutdownFeedback::slotGrab()
+{
+ // we start the passed early
+ if ( m_currentY * 4 >= height() * 3 && passed.isNull())
+ passed.start();
+
+ if ( m_currentY >= height() ) {
+ slotPaintEffectNew();
+ return;
+ }
+
+ QImage img;
+ img = QPixmap::grabWindow( qt_xrootwin(), 0,
+ m_currentY, width(),
+ slice );
+ bitBlt(&grabbed, 0, m_currentY, &img);
+ m_currentY += slice;
+ QTimer::singleShot(0, this, SLOT(slotGrab()));
+}
+
+void KSMShutdownFeedback::slotPaintEffectNew()
+{
+ const unsigned int shift_scale = 10;
+ const unsigned int scale = 1 << shift_scale;
+
+ //kdDebug() << "passed before paint " << passed.elapsed() << endl;
+ unsigned int current_fade = QMIN(scale, passed.elapsed() * scale / max_faded);
+ QImage copy;
+ copy.create( grabbed.size(), grabbed.depth() );
+ unsigned int pixels = grabbed.width()*grabbed.height();
+ QRgb *orig = ( QRgb* )grabbed.bits();
+ QRgb *dest = ( QRgb* )copy.bits();
+ QColor clr;
+
+ int r, g, b, tg;
+
+ for ( unsigned int i = 0; i < pixels; ++i )
+ {
+ r = qRed( orig[i] );
+ g = qGreen( orig[i] );
+ b = qBlue( orig[i] );
+
+ // qGray formla
+ tg = (r*11 + g*16 + b*5)/32;
+ // make it a bit darker than gray
+ tg = tg - tg / 5;
+
+ r = ( ( r << shift_scale ) + current_fade * ( tg - r ) ) >> shift_scale;
+ g = ( ( g << shift_scale ) + current_fade * ( tg - g ) ) >> shift_scale;
+ b = ( ( b << shift_scale ) + current_fade * ( tg - b ) ) >> shift_scale;
+
+ dest[i] = qRgb(r, g, b);
+ }
+ //kdDebug() << "passed before bitBlt " << passed.elapsed() << endl;
+ bitBlt( this, 0, 0, &copy);
+ //kdDebug() << "passed after bitBlt " << passed.elapsed() << endl;
+
+ if ( current_fade >= scale ) {
+ if ( backgroundMode() == QWidget::NoBackground ) {
+ setBackgroundMode( QWidget::NoBackground );
+ setBackgroundPixmap( copy );
+ }
+ return;
+ }
+
+ QTimer::singleShot( 0, this, SLOT( slotPaintEffectNew() ) );
}
//////
Index: ksmserver/shutdowndlg.h
===================================================================
--- ksmserver/shutdowndlg.h.orig
+++ ksmserver/shutdowndlg.h
@@ -9,7 +9,9 @@ Copyright (C) 2000 Matthias Ettrich <ett
#include <qpixmap.h>
#include <qdialog.h>
+#include <qdatetime.h>
#include <kpushbutton.h>
+#include <qimage.h>
class QPushButton;
class QVButtonGroup;
class QPopupMenu;
@@ -31,13 +33,17 @@ protected:
~KSMShutdownFeedback() {}
private slots:
- void slotPaintEffect();
+ void slotPaintEffectOld();
+ void slotPaintEffectNew();
+ void slotGrab();
private:
static KSMShutdownFeedback * s_pSelf;
KSMShutdownFeedback();
int m_currentY;
QPixmap m_root;
+ QTime passed;
+ QImage grabbed;
};

@ -0,0 +1,48 @@
Index: kcontrol/background/bgdialog.cpp
===================================================================
--- kcontrol/background/bgdialog.cpp.orig
+++ kcontrol/background/bgdialog.cpp
@@ -477,14 +477,23 @@ void BGDialog::loadWallpaperFilesList()
//search for .desktop files before searching for images without .desktop files
QStringList lst = m_pDirs->findAllResources("wallpaper", "*desktop", false, true);
QStringList files;
+ QStringList hiddenfiles;
for (QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it)
{
KSimpleConfig fileConfig(*it);
fileConfig.setGroup("Wallpaper");
+ int slash = (*it).findRev('/') + 1;
+ QString directory = (*it).left(slash);
+
QString imageCaption = fileConfig.readEntry("Name");
QString fileName = fileConfig.readEntry("File");
+ if (fileConfig.readBoolEntry("Hidden",false)) {
+ hiddenfiles.append(directory + fileName);
+ continue;
+ }
+
if (imageCaption.isEmpty())
{
imageCaption = fileName;
@@ -500,9 +509,8 @@ void BGDialog::loadWallpaperFilesList()
rs = imageCaption + " (" + QString::number(n) + ')';
lrs = rs.lower();
}
- int slash = (*it).findRev('/') + 1;
- QString directory = (*it).left(slash);
bool canLoadScaleable = false;
+
#ifdef HAVE_LIBART
canLoadScaleable = true;
#endif
@@ -516,7 +524,7 @@ void BGDialog::loadWallpaperFilesList()
lst = m_pDirs->findAllResources("wallpaper", "*", false, true);
for (QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it)
{
- if ( !(*it).endsWith(".desktop") && files.grep(*it).empty() ) {
+ if ( !(*it).endsWith(".desktop") && files.grep(*it).empty() && hiddenfiles.grep(*it).empty() ) {
// First try to see if we have a comment describing the image. If we do
// just use the first line of said comment.
KFileMetaInfo metaInfo(*it);

@ -0,0 +1,31 @@
Index: kioslave/media/mediamanager/halbackend.cpp
===================================================================
--- kioslave/media/mediamanager/halbackend.cpp.orig
+++ kioslave/media/mediamanager/halbackend.cpp
@@ -214,10 +214,26 @@ void HALBackend::AddDevice(const char *u
{
/* We only list volume that have a filesystem or volume that have an audio track*/
if ( libhal_device_get_property_QString(m_halContext, udi, "volume.fsusage") != "filesystem" &&
+ libhal_device_get_property_QString(m_halContext, udi, "volume.fsusage") != "crypto" &&
!libhal_device_get_property_bool(m_halContext, udi, "volume.disc.has_audio", NULL) &&
!libhal_device_get_property_bool(m_halContext, udi, "volume.disc.is_blank", NULL) )
return;
+ /* For crypto_LUKS devices check its dm-device, if it is already mounted*/
+ if ( libhal_device_get_property_QString(m_halContext, udi, "volume.fstype") == "crypto_LUKS" &&
+ !libhal_device_get_property_bool(m_halContext, udi, "volume.ignore", NULL) ) {
+ int num;
+ char **dm_uuid = libhal_manager_find_device_string_match(m_halContext, "volume.crypto_luks.clear.backing_volume",udi,&num,NULL);
+ /* if a dm device is found the volume is already decrypted */
+ if (num == 0) {
+ // TODO: Check for kryptomedia binary.
+ KProcess proc;
+ proc << "kryptomedia" << udi;
+ proc.start(KProcess::DontCare);
+ return;
+ }
+ }
+
/* Query drive udi */
QString driveUdi = libhal_device_get_property_QString(m_halContext, udi, "block.storage_device");
if ( driveUdi.isNull() ) // no storage - no fun

@ -0,0 +1,26 @@
Index: kioslave/media/mediamanager/halbackend.cpp
===================================================================
--- kioslave/media/mediamanager/halbackend.cpp.orig
+++ kioslave/media/mediamanager/halbackend.cpp
@@ -33,6 +33,7 @@
#include <kmountpoint.h>
#include <kmessagebox.h>
#include <kio/job.h>
+#include <kprotocolinfo.h>
#define MOUNT_SUFFIX (libhal_volume_is_mounted(halVolume) ? QString("_mounted") : QString("_unmounted"))
#define MOUNT_ICON_SUFFIX (libhal_volume_is_mounted(halVolume) ? QString("_mount") : QString("_unmount"))
@@ -532,6 +533,13 @@ void HALBackend::setVolumeProperties(Med
case LIBHAL_DRIVE_TYPE_PORTABLE_AUDIO_PLAYER:
{
medium->setIconName("ipod" + MOUNT_ICON_SUFFIX);
+
+ if (libhal_device_get_property_QString(m_halContext, driveUdi.latin1(), "info.product") == "iPod" &&
+ KProtocolInfo::isKnownProtocol( QString("ipod") ) )
+ {
+ medium->unmountableState( "ipod:/" );
+ medium->mountableState( libhal_volume_is_mounted(halVolume) );
+ }
break;
}
case LIBHAL_DRIVE_TYPE_CAMERA:

@ -0,0 +1,175 @@
Index: kioslave/media/mediamanager/halbackend.cpp
===================================================================
--- kioslave/media/mediamanager/halbackend.cpp.orig 2011-05-31 13:41:55.000000000 +0200
+++ kioslave/media/mediamanager/halbackend.cpp 2011-05-31 13:42:48.317334543 +0200
@@ -1379,4 +1379,54 @@ QString HALBackend::unmount(const QStrin
return QString();
}
+bool HALBackend::teardown(const QString &_udi)
+{
+ const char* dm_udi = _udi.latin1();
+ const QString blockudi = libhal_device_get_property_QString(m_halContext, dm_udi, "volume.crypto_luks.clear.backing_volume");
+ if (!blockudi.isEmpty()) {
+ const char* udi = blockudi.latin1();
+ DBusMessage *dmesg, *reply;
+ DBusError error;
+ const char *options[2];
+
+ kdDebug() << "tearDown " << udi << "..." << endl;
+
+ dbus_error_init(&error);
+ DBusConnection *dbus_connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
+ if (dbus_error_is_set(&error))
+ {
+ dbus_error_free(&error);
+ return false;
+ }
+
+ if (!(dmesg = dbus_message_new_method_call ("org.freedesktop.Hal", udi,
+ "org.freedesktop.Hal.Device.Volume.Crypto",
+ "Teardown"))) {
+ kdDebug() << "teardown failed for " << udi << ": could not create dbus message\n";
+ return false;
+ }
+
+ dbus_error_init (&error);
+ if (!(reply = dbus_connection_send_with_reply_and_block (dbus_connection, dmesg, -1, &error)))
+ {
+ QString qerror;
+
+ kdDebug() << "teardown failed for " << udi << ": " << error.name << " " << error.message << endl;
+ qerror = QString("teardown failed for %1 because: %2").arg(udi).arg(error.name);
+ dbus_message_unref (dmesg);
+ dbus_error_free (&error);
+ return false;
+ }
+
+ kdDebug() << "teardown queued for " << udi << endl;
+
+ dbus_message_unref (dmesg);
+ dbus_message_unref (reply);
+ return true;
+ }
+
+ return false;
+}
+
+
#include "halbackend.moc"
Index: kioslave/media/mediamanager/halbackend.h
===================================================================
--- kioslave/media/mediamanager/halbackend.h.orig 2011-05-31 13:39:05.000000000 +0200
+++ kioslave/media/mediamanager/halbackend.h 2011-05-31 13:42:48.317334543 +0200
@@ -85,6 +85,7 @@ public:
QString mount(const QString &id);
QString mount(const Medium *medium);
QString unmount(const QString &id);
+ bool teardown(const QString &_udi);
static bool isHotplug( const QString & id );
Index: kioslave/media/mediamanager/mediamanager.cpp
===================================================================
--- kioslave/media/mediamanager/mediamanager.cpp.orig 2011-05-31 13:39:05.000000000 +0200
+++ kioslave/media/mediamanager/mediamanager.cpp 2011-05-31 13:43:07.916484054 +0200
@@ -232,6 +232,17 @@ QString MediaManager::unmount(const QStr
#endif
}
+bool MediaManager::teardown(const QString &name)
+{
+#ifdef COMPILE_HALBACKEND
+ if (!m_halbackend)
+ return false;
+ return m_halbackend->teardown(name);
+#else
+ return false;
+#endif
+}
+
QString MediaManager::nameForLabel(const QString &label)
{
const QPtrList<Medium> media = m_mediaList.list();
Index: kioslave/media/mediamanager/mediamanager.h
===================================================================
--- kioslave/media/mediamanager/mediamanager.h.orig 2011-05-31 13:39:05.000000000 +0200
+++ kioslave/media/mediamanager/mediamanager.h 2011-05-31 13:42:48.318334448 +0200
@@ -47,6 +47,7 @@ k_dcop:
QString mount(const QString &uid);
QString unmount(const QString &uid);
+ bool teardown(const QString &uid);
QString nameForLabel(const QString &label);
ASYNC setUserLabel(const QString &name, const QString &label);
Index: kioslave/media/mounthelper/kio_media_mounthelper.h
===================================================================
--- kioslave/media/mounthelper/kio_media_mounthelper.h.orig 2007-01-15 12:31:31.000000000 +0100
+++ kioslave/media/mounthelper/kio_media_mounthelper.h 2011-05-31 13:42:48.318334448 +0200
@@ -40,6 +40,8 @@ private:
QString m_errorStr;
QString m_device;
bool m_isCdrom;
+ bool isCryptMedia(QString);
+ bool teardown(QString);
private slots:
void ejectFinished(KProcess* proc);
Index: kioslave/media/mounthelper/kio_media_mounthelper.cpp
===================================================================
--- kioslave/media/mounthelper/kio_media_mounthelper.cpp.orig 2007-05-14 09:55:40.000000000 +0200
+++ kioslave/media/mounthelper/kio_media_mounthelper.cpp 2011-05-31 13:42:48.319334353 +0200
@@ -27,6 +27,7 @@
#include <dcopclient.h>
#include <dcopref.h>
#include <qtimer.h>
+#include <qregexp.h>
#include <stdlib.h>
#include <kdebug.h>
#include <kglobal.h>
@@ -117,14 +118,17 @@ MountHelper::MountHelper() : KApplicatio
DCOPRef mediamanager("kded", "mediamanager");
DCOPReply reply = mediamanager.call( "unmount", medium.id());
if (reply.isValid())
- reply.get(m_errorStr);
- if (m_errorStr.isNull())
- invokeEject(device, true);
- else
- error();
+ reply.get(m_errorStr);
+ if (m_errorStr.isNull()) {
+ if (!teardown(medium.id()))
+ invokeEject(device, true);
+ } else
+ error();
m_device = device;
- } else
- invokeEject(device, true);
+ } else {
+ if (!teardown(medium.id()))
+ invokeEject(device, true);
+ }
}
else
{
@@ -139,6 +143,19 @@ MountHelper::MountHelper() : KApplicatio
}
}
+bool MountHelper::teardown(QString id)
+{
+ DCOPRef mediamanager("kded", "mediamanager");
+ DCOPReply reply = mediamanager.call( "teardown", id);
+ if (reply.isValid()) {
+ bool rep;
+ reply.get(rep);
+ kdDebug() << "reply from teardown: " << rep << endl;
+ return rep;
+ }
+ return false;
+}
+
void MountHelper::invokeEject(const QString &device, bool quiet)
{
KProcess *proc = new KProcess(this);

@ -0,0 +1,49 @@
Index: kioslave/media/mediamanager/halbackend.cpp
===================================================================
--- kioslave/media/mediamanager/halbackend.cpp.orig
+++ kioslave/media/mediamanager/halbackend.cpp
@@ -248,14 +248,15 @@ void HALBackend::AddDevice(const char *u
return;
}
}
+ m_mediaList.addMedium(medium, allowNotification);
+
QMap<QString,QString> options = MediaManagerUtils::splitOptions(mountoptions(udi));
kdDebug() << "automount " << options["automount"] << endl;
- if (options["automount"] == "true" && allowNotification ) {
+ if (options["automount"] == "true" ) {
QString error = mount(medium);
if (!error.isEmpty())
kdDebug() << "error " << error << endl;
}
- m_mediaList.addMedium(medium, allowNotification);
return;
}
@@ -292,6 +293,12 @@ void HALBackend::AddDevice(const char *u
m_mediaList.addMedium(medium, allowNotification);
return;
}
+
+ if ( allowNotification ) {
+ KProcess proc;
+ proc << "suseplugger" << udi;
+ proc.start(KProcess::DontCare);
+ }
}
void HALBackend::RemoveDevice(const char *udi)
@@ -816,8 +823,12 @@ QStringList HALBackend::mountoptions(con
removable = libhal_device_get_property_bool(m_halContext, drive_udi.latin1(), "storage.removable", NULL)
|| libhal_device_get_property_bool(m_halContext, drive_udi.latin1(), "storage.hotpluggable", NULL);
+ bool value = removable;
+ QString drive_type = libhal_device_get_property_QString( m_halContext, drive_udi.latin1(), "storage.drive_type" );
+ value |= ( drive_type == "cdrom" );
+
config.setGroup(drive_udi);
- bool value = config.readBoolEntry("automount", false);
+ value = config.readBoolEntry("automount", value);
config.setGroup(name);
if (libhal_device_get_property_bool(m_halContext, name.latin1(), "volume.disc.is_blank", NULL)

@ -0,0 +1,13 @@
Index: kioslave/media/mediamanager/halbackend.cpp
===================================================================
--- kioslave/media/mediamanager/halbackend.cpp.orig
+++ kioslave/media/mediamanager/halbackend.cpp
@@ -471,7 +471,7 @@ void HALBackend::setVolumeProperties(Med
medium->mountableState(
libhal_volume_get_device_file(halVolume), /* Device node */
- libhal_volume_get_mount_point(halVolume), /* Mount point */
+ QString::fromUtf8(libhal_volume_get_mount_point(halVolume)), /* Mount point */
libhal_volume_get_fstype(halVolume), /* Filesystem type */
libhal_volume_is_mounted(halVolume) ); /* Mounted ? */

@ -0,0 +1,34 @@
Index: kdesktop/minicli.h
===================================================================
--- kdesktop/minicli.h.orig
+++ kdesktop/minicli.h
@@ -52,12 +52,14 @@ public:
void setCommand(const QString& command);
void reset();
- void saveConfig();
void clearHistory();
virtual void show();
virtual QSize sizeHint() const;
+public slots:
+ void saveConfig();
+
protected slots:
virtual void accept();
virtual void reject();
Index: kdesktop/minicli.cpp
===================================================================
--- kdesktop/minicli.cpp.orig
+++ kdesktop/minicli.cpp
@@ -133,6 +133,9 @@ Minicli::Minicli( QWidget *parent, const
connect( m_dlg->cbCommand, SIGNAL( returnPressed() ),
m_dlg->pbRun, SLOT( animateClick() ) );
+ m_dlg->cbCommand->setHistoryEditorEnabled( true );
+ connect( m_dlg->cbCommand, SIGNAL(removed( const QString&) ), SLOT(saveConfig()) );
+
// Advanced group box...
connect(m_dlg->cbPriority, SIGNAL(toggled(bool)), SLOT(slotChangeScheduler(bool)));
connect(m_dlg->slPriority, SIGNAL(valueChanged(int)), SLOT(slotPriority(int)));

Binary file not shown.

@ -0,0 +1,153 @@
diff -wruN kdebase-3.5.10.orig/kioslave/media/mediamanager/fstabbackend.cpp kdebase-3.5.10/kioslave/media/mediamanager/fstabbackend.cpp
--- kdebase-3.5.10.orig/kioslave/media/mediamanager/fstabbackend.cpp 2006-10-01 21:31:54.000000000 +0400
+++ kdebase-3.5.10/kioslave/media/mediamanager/fstabbackend.cpp 2011-08-17 14:51:34.697199962 +0400
@@ -50,7 +50,7 @@
#define MTAB "/etc/mnttab"
#else
#define FSTAB "/etc/fstab"
-#define MTAB "/etc/mtab"
+#define MTAB "/proc/self/mounts"
#endif
@@ -58,7 +58,7 @@
FstabBackend::FstabBackend(MediaList &list, bool networkSharesOnly)
: QObject(), BackendBase(list), m_networkSharesOnly(networkSharesOnly)
{
- KDirWatch::self()->addFile(MTAB);
+ KDirWatch::self()->addDir("/media",0);
KDirWatch::self()->addFile(FSTAB);
connect( KDirWatch::self(), SIGNAL( dirty(const QString&) ),
@@ -94,7 +94,7 @@
m_mediaList.removeMedium(*it, false);
}
KDirWatch::self()->removeFile(FSTAB);
- KDirWatch::self()->removeFile(MTAB);
+ KDirWatch::self()->removeDir("/media");
}
QString FstabBackend::mount( const QString &_udi )
@@ -119,8 +119,9 @@
void FstabBackend::slotDirty(const QString &path)
{
- if (path==MTAB)
+ if (path=="/media")
{
+ sleep(1);
handleMtabChange();
}
else if (path==FSTAB)
@@ -136,18 +137,23 @@
|| mount->mountType() == "sysfs"
|| mount->mountType() == "fdescfs"
|| mount->mountType() == "kernfs"
+ || mount->mountType() == "devtmpfs"
+ || mount->mountType() == "rootfs"
|| mount->mountType() == "usbfs"
|| mount->mountType().contains( "proc" )
+ || mount->mountType().contains( "gvfs" )
|| mount->mountType() == "unknown"
|| mount->mountType() == "none"
|| mount->mountType() == "sunrpc"
|| mount->mountedFrom() == "none"
|| mount->mountedFrom() == "tmpfs"
|| mount->mountedFrom().find("shm") != -1
- || mount->mountPoint() == "/dev/swap"
+ || !(mount->mountPoint() == "/" || mount->mountPoint().find("/media") == 0 )
+/* || mount->mountPoint() == "/dev/swap"
+ || mount->mountPoint() == "/dev"
|| mount->mountPoint() == "/dev/pts"
|| mount->mountPoint().find("/proc") == 0
- || mount->mountPoint().find("/sys") == 0
+ || mount->mountPoint().find("/sys") == 0 */
// We might want to display only network shares
// since HAL doesn't handle them
@@ -187,10 +193,12 @@
nothing has changed, do not stat the mount point. Avoids
hang if network shares are stalling */
QString mtabEntry = dev + "*" + mp + "*" + fs;
+#if 0
if(m_mtabEntries.contains(mtabEntry)) {
new_mtabIds += m_mtabEntries[mtabEntry];
continue;
}
+#endif
QString id = generateId(dev, mp);
new_mtabIds+=id;
@@ -203,7 +211,6 @@
m_mediaList.changeMediumState(id, true, false,
mime, icon, label);
}
-#if 0
else if ( !m_mtabIds.contains(id) )
{
QString name = generateName(dev, fs);
@@ -219,9 +226,8 @@
m->setIconName(icon);
m->setLabel(label);
- m_mediaList.addMedium(m, notificationAllowed);
+ m_mediaList.addMedium(m, allowNotification);
}
-#endif
}
QStringList::iterator it2 = m_mtabIds.begin();
@@ -247,12 +253,10 @@
m_mediaList.changeMediumState(*it2, false, false,
mime, icon, label);
}
-#if 0
else if ( !new_mtabIds.contains(*it2) )
{
m_mediaList.removeMedium(*it2, allowNotification);
}
-#endif
}
m_mtabIds = new_mtabIds;
diff -wruN kdebase-3.5.10.orig/kioslave/media/mediamanager/removablebackend.cpp kdebase-3.5.10/kioslave/media/mediamanager/removablebackend.cpp
--- kdebase-3.5.10.orig/kioslave/media/mediamanager/removablebackend.cpp 2006-03-17 13:17:33.000000000 +0300
+++ kdebase-3.5.10/kioslave/media/mediamanager/removablebackend.cpp 2011-08-17 14:51:51.854357476 +0400
@@ -27,7 +27,7 @@
#ifdef _OS_SOLARIS_
#define MTAB "/etc/mnttab"
#else
-#define MTAB "/etc/mtab"
+#define MTAB "/proc/self/mounts"
#endif
@@ -35,7 +35,7 @@
RemovableBackend::RemovableBackend(MediaList &list)
: QObject(), BackendBase(list)
{
- KDirWatch::self()->addFile(MTAB);
+ KDirWatch::self()->addDir("/media",0);
connect( KDirWatch::self(), SIGNAL( dirty(const QString&) ),
this, SLOT( slotDirty(const QString&) ) );
@@ -52,7 +52,7 @@
m_mediaList.removeMedium(*it, false);
}
- KDirWatch::self()->removeFile(MTAB);
+ KDirWatch::self()->removeDir("/media");
}
bool RemovableBackend::plug(const QString &devNode, const QString &label)
@@ -116,8 +116,9 @@
void RemovableBackend::slotDirty(const QString &path)
{
- if (path==MTAB)
+ if (path=="/media")
{
+ sleep(1);
handleMtabChange();
}
}

@ -0,0 +1,15 @@
--- konqueror/konq_mainwindow.cc
+++ konqueror/konq_mainwindow.cc 2003/05/30 13:19:04
@@ -4550,9 +4550,9 @@
int usage_sum = 0;
#if defined(KDE_MALLINFO_STDLIB) || defined(KDE_MALLINFO_MALLOC)
// ugly hack for kdecore/malloc
- extern int kde_malloc_is_used;
- free( calloc( 4, 4 )); // trigger setting kde_malloc_is_used
- if( kde_malloc_is_used )
+// extern int kde_malloc_is_used;
+// free( calloc( 4, 4 )); // trigger setting kde_malloc_is_used
+ if( 0 )
{
struct mallinfo m = mallinfo();
usage_sum = m.hblkhd + m.uordblks;

@ -0,0 +1,13 @@
Index: nsplugins/pluginscan.cpp
===================================================================
--- nsplugins/pluginscan.cpp.orig
+++ nsplugins/pluginscan.cpp
@@ -463,7 +463,7 @@ void writeServicesFile( QStringList mime
ts << "Icon=netscape" << endl;
ts << "Comment=" << i18n("Netscape plugin viewer") << endl;
ts << "X-KDE-Library=libnsplugin" << endl;
- ts << "InitialPreference=0" << endl;
+ ts << "InitialPreference=7" << endl;
ts << "ServiceTypes=KParts/ReadOnlyPart,Browser/View" << endl;
ts << "X-KDE-BrowserView-PluginsInfo=nsplugins/pluginsinfo" << endl;

@ -0,0 +1,49 @@
--- nsplugins/viewer/nsplugin.h~ 2008-02-13 10:40:38.000000000 +0100
+++ nsplugins/viewer/nsplugin.h 2010-09-22 23:31:58.721961990 +0200
@@ -315,6 +315,10 @@ private:
QPtrList<NSPluginInstance> _trash;
QCString _app;
+
+ // If plugins use gtk, we call the gtk_init function for them ---
+ // but only do it once.
+ static bool s_initedGTK;
};
--- nsplugins/viewer/nsplugin.cpp~ 2008-02-13 10:40:38.000000000 +0100
+++ nsplugins/viewer/nsplugin.cpp 2010-09-22 23:31:58.775909705 +0200
@@ -1330,6 +1330,9 @@ DCOPRef NSPluginViewer::newClass( QStrin
/****************************************************************************/
+bool NSPluginClass::s_initedGTK = false;
+
+typedef void gtkInitFunc(int *argc, char ***argv);
NSPluginClass::NSPluginClass( const QString &library,
QObject *parent, const char *name )
@@ -1377,6 +1380,23 @@ NSPluginClass::NSPluginClass( const QStr
// initialize plugin
kdDebug(1431) << "Plugin library " << library << " loaded!" << endl;
+
+ // see if it uses gtk
+ if (!s_initedGTK) {
+ gtkInitFunc* gtkInit = (gtkInitFunc*)_handle->symbol("gtk_init");
+ if (gtkInit) {
+ kdDebug(1431) << "Calling gtk_init for the plugin" << endl;
+ // Prevent gtk_init() from replacing the X error handlers, since the Gtk
+ // handlers abort when they receive an X error, thus killing the viewer.
+ int (*old_error_handler)(Display*,XErrorEvent*) = XSetErrorHandler(0);
+ int (*old_io_error_handler)(Display*) = XSetIOErrorHandler(0);
+ gtkInit(0, 0);
+ XSetErrorHandler(old_error_handler);
+ XSetIOErrorHandler(old_io_error_handler);
+ s_initedGTK = true;
+ }
+ }
+
_constructed = true;
_error = initialize()!=NPERR_NO_ERROR;
}

@ -0,0 +1,40 @@
--- kcontrol/crypto/crypto.cpp.orig 2006-10-02 06:31:49.000000000 +1300
+++ kcontrol/crypto/crypto.cpp
@@ -2321,7 +2321,11 @@ bool KCryptoConfig::loadCiphers() {
unsigned int i;
SSL_CTX *ctx;
SSL *ssl;
+#if OPENSSL_VERSION_NUMBER < 0x00909000L
SSL_METHOD *meth;
+#else
+const SSL_METHOD *meth;
+#endif
SSLv2Box->clear();
SSLv3Box->clear();
@@ -2337,8 +2341,10 @@ SSL_METHOD *meth;
CipherItem *item;
for (i=0; ; i++) {
int j, k;
- SSL_CIPHER *sc;
- sc = (meth->get_cipher)(i);
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10000000L
+ const
+#endif
+ SSL_CIPHER *sc = (meth->get_cipher)(i);
if (!sc)
break;
// Leak of sc*?
@@ -2365,8 +2371,10 @@ SSL_METHOD *meth;
for (i=0; ; i++) {
int j, k;
- SSL_CIPHER *sc;
- sc = (meth->get_cipher)(i);
+#if defined(OPENSSL_VERSION_NUMBER) && OPENSSL_VERSION_NUMBER >= 0x10000000L
+ const
+#endif
+ SSL_CIPHER *sc = (meth->get_cipher)(i);
if (!sc)
break;
// Leak of sc*?

@ -0,0 +1,32 @@
Index: kwin/workspace.cpp
===================================================================
--- kwin/workspace.cpp.orig
+++ kwin/workspace.cpp
@@ -59,6 +59,17 @@ KSelectionOwner* kompmgr_selection;
bool allowKompmgrRestart = TRUE;
+bool supportsCompMgr()
+{
+ int i;
+
+ bool damageExt = XQueryExtension(qt_xdisplay(), "DAMAGE", &i, &i, &i);
+ bool compositeExt = XQueryExtension(qt_xdisplay(), "Composite", &i, &i, &i);
+ bool xfixesExt = XQueryExtension(qt_xdisplay(), "XFIXES", &i, &i, &i);
+
+ return damageExt && compositeExt && xfixesExt;
+}
+
// Rikkus: This class is too complex. It needs splitting further.
// It's a nightmare to understand, especially with so few comments :(
@@ -199,6 +210,9 @@ Workspace::Workspace( bool restore )
connect( kapp->desktop(), SIGNAL( resized( int )), SLOT( desktopResized()));
#endif
+ if (!supportsCompMgr())
+ options->useTranslucency = false;
+
// start kompmgr - i wanted to put this into main.cpp, but that would prevent dcop support, as long as Application was no dcop_object
if (options->useTranslucency)
{

@ -0,0 +1,30 @@
Index: kicker/kicker/ui/browser_mnu.cpp
===================================================================
--- kicker/kicker/ui/browser_mnu.cpp.orig
+++ kicker/kicker/ui/browser_mnu.cpp
@@ -31,6 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include <kfileitem.h>
#include <kglobal.h>
#include <kglobalsettings.h>
+#include <kconfig.h>
#include <kiconloader.h>
#include <kio/global.h>
#include <klocale.h>
@@ -148,12 +149,14 @@ void PanelBrowserMenu::initialize()
// only the first part menu got them
if(_startid == 0 && !_filesOnly) {
insertTitle(path());
+ KConfig *c = KGlobal::config();
+ c->setGroup("menus");
insertItem(CICON("kfm"), i18n("Open in File Manager"), this, SLOT(slotOpenFileManager()));
- if (kapp->authorize("shell_access"))
- insertItem(CICON("terminal"), i18n("Open in Terminal"), this, SLOT(slotOpenTerminal()));
+ if (kapp->authorize("shell_access") && c->readBoolEntry("kickerOpenInTerminalIsVisible",false))
+ insertItem(CICON("terminal"), i18n("Open in Terminal"), this, SLOT(slotOpenTerminal()));
+ insertSeparator();
}
-
bool first_entry = true;
bool dirfile_separator = false;
unsigned int item_count = 0;

@ -0,0 +1,34 @@
a "make it compile " patch from Stephan Binner
--- kicker/kicker/plugins/beaglesearch.cpp
+++ kicker/kicker/plugins/beaglesearch.cpp
@@ -291,11 +291,11 @@
beagle_query_set_max_hits (beagle_query, max_hits_per_source); // this is per source!
kdDebug () << "Creating query from \"" << query_str << "\"" << endl;
- for ( QStringList::Iterator it = sources_menu.begin(); it != sources_menu.end(); ++it )
+ /* for ( QStringList::Iterator it = sources_menu.begin(); it != sources_menu.end(); ++it )
beagle_query_add_source (beagle_query, g_strdup ((*it).utf8 ()));
for ( QStringList::Iterator it = types_menu.begin(); it != types_menu.end(); ++it )
- beagle_query_add_hit_type (beagle_query, g_strdup ((*it).utf8 ()));
+ beagle_query_add_hit_type (beagle_query, g_strdup ((*it).utf8 ()));*/
QStringList query_terms;
QString start_date, end_date;
@@ -307,13 +307,13 @@
else if (key_value_pair.count () == 2) {
QString key = key_value_pair [0].lower ();
QString value = key_value_pair [1];
- if (key == "mime")
+ if /*(key == "mime")
beagle_query_add_mime_type (beagle_query, g_strdup (value.utf8 ()));
else if (key == "type")
beagle_query_add_hit_type (beagle_query, g_strdup (value.utf8 ()));
else if (key == "source")
beagle_query_add_source (beagle_query, g_strdup (value.utf8 ()));
- else if (key == "start")
+ else if */ (key == "start")
start_date = value;
else if (key == "end")
end_date = value;

@ -0,0 +1,13 @@
Index: kicker/kicker/ui/service_mnu.cpp
===================================================================
--- kicker/kicker/ui/service_mnu.cpp.orig
+++ kicker/kicker/ui/service_mnu.cpp
@@ -426,7 +426,7 @@ void PanelServiceMenu::insertMenuItem(KS
{
if (comment.find(serviceName, 0, true) == -1)
{
- serviceName = i18n("Entries in K-menu: %1 app name, %2 description", "%1 - %2").arg(serviceName, comment);
+ serviceName = i18n("Entries in K-menu: %1 app name, %2 description", "%1 (%2)").arg(serviceName, comment);
}
else
{

@ -0,0 +1,291 @@
--- kcontrol/randr/legacyrandrscreen.cpp
+++ kcontrol/randr/legacyrandrscreen.cpp
@@ -30,6 +30,8 @@
#include <kiconloader.h>
#include <qlabel.h>
#include <qdesktopwidget.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
#include "ktimerdialog.h"
#include "legacyrandrscreen.h"
@@ -103,12 +105,55 @@ bool LegacyRandRScreen::applyProposed()
m_currentSize = m_proposedSize;
m_currentRotation = m_proposedRotation;
m_currentRefreshRate = m_proposedRefreshRate;
+
+ // search wacom utility and set orientation for available wacom pointers
+ QString xsetwacom = KStandardDirs::findExe("xsetwacom");
+ if (!xsetwacom.isEmpty()) {
+ m_wacomPointers.clear();
+ KProcess *proc = new KProcess;
+ connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), SLOT(gotAvailablePointers(KProcess *, char *, int)));
+ *proc << "xsetwacom" << "list";
+ if (!proc->start(KProcess::Block,KProcess::Stdout))
+ kdError("Could not ask xsetwacom for available pointers.");
+ else {
+ for ( QStringList::Iterator it = m_wacomPointers.begin(); it != m_wacomPointers.end(); ++it ) {
+ KProcess *set = new KProcess;
+ *set << "xsetwacom" << "set" << (*it) << "Rotate";
+ switch (m_currentRotation) {
+ case RR_Rotate_90:
+ *set << "CW";
+ break;
+ case RR_Rotate_180:
+ *set << "HALF";
+ break;
+ case RR_Rotate_270:
+ *set << "CCW";
+ break;
+ default:
+ *set << "NONE";
+ }
+ if (!set->start())
+ kdError("Could not set orientation for wacom pointers.");
+ }
+ }
+ }
+
return true;
}
return false;
}
+void LegacyRandRScreen::gotAvailablePointers(KProcess*, char *buffer, int len)
+{
+ QString myBuf = QString::fromLatin1(buffer, len);
+ QStringList lines = QStringList::split('\n', myBuf);
+ for ( QStringList::Iterator it = lines.begin(); it != lines.end(); it++) {
+ QStringList split = QStringList::split(' ', (*it));
+ m_wacomPointers+=split.first();
+ }
+}
+
bool LegacyRandRScreen::applyProposedAndConfirm()
{
if (proposedChanged()) {
--- kcontrol/randr/legacyrandrscreen.h
+++ kcontrol/randr/legacyrandrscreen.h
@@ -30,6 +30,7 @@
#include "randr.h"
class KTimerDialog;
+class KProcess;
class LegacyRandRScreen : public QObject
{
@@ -135,6 +136,9 @@ public:
void load(KConfig& config);
void save(KConfig& config) const;
+private slots:
+ void gotAvailablePointers(KProcess*, char *buffer, int len);
+
private:
XRRScreenConfiguration* m_config;
@@ -156,6 +160,8 @@ private:
int m_proposedSize;
int m_proposedRefreshRate;
+ QStringList m_wacomPointers;
+
KTimerDialog* m_shownDialog;
};
--- kcontrol/randr/randrscreen.cpp
+++ kcontrol/randr/randrscreen.cpp
@@ -18,6 +18,8 @@
#include <kdebug.h>
#include <kconfig.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
#include "randrscreen.h"
#include "randrcrtc.h"
#include "randroutput.h"
@@ -429,6 +431,40 @@ bool RandRScreen::applyProposed(bool confirm)
if (succeed && confirm)
succeed = RandR::confirm(r);
+ if (succeed) {
+ // search wacom utility and set orientation for available wacom pointers
+ QString xsetwacom = KStandardDirs::findExe("xsetwacom");
+ if (!xsetwacom.isEmpty()) {
+ m_wacomPointers.clear();
+ KProcess *proc = new KProcess;
+ connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), SLOT(gotAvailablePointers(KProcess *, char *, int)));
+ *proc << "xsetwacom" << "list";
+ if (!proc->start(KProcess::Block,KProcess::Stdout))
+ kdError("Could not ask xsetwacom for available pointers.");
+ else {
+ for ( QStringList::Iterator it = m_wacomPointers.begin(); it != m_wacomPointers.end(); ++it ) {
+ KProcess *set = new KProcess;
+ *set << "xsetwacom" << "set" << (*it) << "Rotate";
+ switch (m_unifiedRotation) {
+ case RR_Rotate_90:
+ *set << "CW";
+ break;
+ case RR_Rotate_180:
+ *set << "HALF";
+ break;
+ case RR_Rotate_270:
+ *set << "CCW";
+ break;
+ default:
+ *set << "NONE";
+ }
+ if (!set->start())
+ kdError("Could not set orientation for wacom pointers.");
+ }
+ }
+ }
+ }
+
// if we succeded applying and the user confirmer the changes,
// just return from here
if (succeed)
@@ -447,6 +483,16 @@ bool RandRScreen::applyProposed(bool confirm)
return false;
}
+void RandRScreen::gotAvailablePointers(KProcess*, char *buffer, int len)
+{
+ QString myBuf = QString::fromLatin1(buffer, len);
+ QStringList lines = QStringList::split('\n', myBuf);
+ for ( QStringList::Iterator it = lines.begin(); it != lines.end(); it++) {
+ QStringList split = QStringList::split(' ', (*it));
+ m_wacomPointers+=split.first();
+ }
+}
+
void RandRScreen::unifyOutputs()
{
SizeList sizes = unifiedSizes();
--- kcontrol/randr/randrscreen.h
+++ kcontrol/randr/randrscreen.h
@@ -29,6 +29,7 @@
class QAction;
class KConfig;
+class KProcess;
class RandRScreen : public QObject
{
@@ -95,6 +96,9 @@ public slots:
void save();
void load();
+private slots:
+ void gotAvailablePointers(KProcess*, char *buffer, int len);
+
signals:
void configChanged();
@@ -119,7 +123,7 @@ private:
CrtcMap m_crtcs;
OutputMap m_outputs;
ModeMap m_modes;
-
+ QStringList m_wacomPointers;
};
#endif
--- kcontrol/randr/randrcrtc.cpp
+++ kcontrol/randr/randrcrtc.cpp
@@ -17,6 +17,8 @@
*/
#include <kdebug.h>
+#include <kprocess.h>
+#include <kstandarddirs.h>
#include "randrcrtc.h"
#include "randrscreen.h"
#include "randroutput.h"
@@ -298,6 +300,38 @@
m_currentRate = mode.refreshRate();
emit crtcChanged(m_id, RandR::ChangeMode);
ret = true;
+
+ // search wacom utility and set orientation for available wacom pointers
+ QString xsetwacom = KStandardDirs::findExe("xsetwacom");
+ if (!xsetwacom.isEmpty()) {
+ m_wacomPointers.clear();
+ KProcess *proc = new KProcess;
+ connect(proc, SIGNAL(receivedStdout(KProcess *, char *, int)), SLOT(gotAvailablePointers(KProcess *, char *, int)));
+ *proc << "xsetwacom" << "list";
+ if (!proc->start(KProcess::Block,KProcess::Stdout))
+ kdError("Could not ask xsetwacom for available pointers.");
+ else {
+ for ( QStringList::Iterator it = m_wacomPointers.begin(); it != m_wacomPointers.end(); ++it ) {
+ KProcess *set = new KProcess;
+ *set << "xsetwacom" << "set" << (*it) << "Rotate";
+ switch (m_currentRotation) {
+ case RR_Rotate_90:
+ *set << "CW";
+ break;
+ case RR_Rotate_180:
+ *set << "HALF";
+ break;
+ case RR_Rotate_270:
+ *set << "CCW";
+ break;
+ default:
+ *set << "NONE";
+ }
+ if (!set->start())
+ kdError("Could not set orientation for wacom pointers.");
+ }
+ }
+ }
}
else
{
@@ -309,6 +343,16 @@
return ret;
}
+void RandRCrtc::gotAvailablePointers(KProcess*, char *buffer, int len)
+{
+ QString myBuf = QString::fromLatin1(buffer, len);
+ QStringList lines = QStringList::split('\n', myBuf);
+ for ( QStringList::Iterator it = lines.begin(); it != lines.end(); it++) {
+ QStringList split = QStringList::split(' ', (*it));
+ m_wacomPointers+=split.first();
+ }
+}
+
bool RandRCrtc::proposeSize(QSize s)
{
m_proposedRect.setSize(s);
--- kcontrol/randr/randrcrtc.h
+++ kcontrol/randr/randrcrtc.h
@@ -26,6 +26,8 @@
#ifdef HAS_RANDR_1_2
+class KProcess;
+
class RandRCrtc : public QObject
{
Q_OBJECT
@@ -62,6 +64,9 @@
ModeList modes() const;
+private slots:
+ void gotAvailablePointers(KProcess*, char *buffer, int len);
+
signals:
void crtcChanged(RRCrtc c, int changes);
@@ -86,6 +91,8 @@
float m_currentRate;
RandRScreen *m_screen;
+
+ QStringList m_wacomPointers;
};
#endif

@ -0,0 +1,133 @@
Index: runupdater/runupdater.desktop
===================================================================
--- /dev/null
+++ runupdater/runupdater.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Type=Application
+Exec=runupdater
+Terminal=false
+Name=Run Updater Tool
+Icon=www
+
+X-KDE-StartupNotify=false
+OnlyShowIn=KDE;
Index: runupdater/runupdater.cpp
===================================================================
--- /dev/null
+++ runupdater/runupdater.cpp
@@ -0,0 +1,96 @@
+/*
+ Run either opensuseupdater or zen-updater but not both.
+ For opensuseupdater its autostart condition is checked, for zen-updater
+ it's checked whether its autostart file is enabled.
+*/
+
+#include <kapplication.h>
+#include <kconfig.h>
+#include <ksimpleconfig.h>
+#include <kstandarddirs.h>
+
+static bool disabledOSU()
+ {
+ KConfig osu( "opensuseupdaterrc", true );
+ osu.setGroup( "General" );
+// fprintf( stderr, "OSU:%d\n", osu.readBoolEntry ("Autostart", true ));
+ return !osu.readBoolEntry( "Autostart", true );
+ }
+
+static bool availableOSU()
+ {
+ return !KStandardDirs::findExe( "opensuseupdater" ).isEmpty();
+ }
+
+static bool runOSU()
+ {
+ return KApplication::kdeinitExec( "opensuseupdater", QStringList(), NULL, NULL, "0" ) == 0;
+ }
+
+static bool disabledZU()
+ {
+ KConfig zu( "zen-updater-auto.desktop", true, false, "xdgconf-autostart" );
+ zu.setGroup( "Desktop Entry" );
+// fprintf( stderr, "ZU %d\n", zu.readBoolEntry( "Hidden", false ) );
+ return zu.readBoolEntry( "Hidden", false );
+ }
+
+static bool availableZU()
+ {
+ return !KStandardDirs::findExe( "zen-updater" ).isEmpty();
+ }
+
+static bool runZU()
+ {
+ return KApplication::kdeinitExec( "zen-updater", QStringList(), NULL, NULL, "0" ) == 0;
+ }
+
+extern "C"
+int kdemain()
+ {
+ KInstance inst( "runupdater" );
+ // KSimpleConfig should parse this one just fine, with entries in the default group
+ KSimpleConfig sysconfig( "/etc/sysconfig/sw_management", true );
+ QString preferred = sysconfig.readEntry( "PREFERRED_SW_MANAGER_STACK" );
+// fprintf( stderr, "SC1: %s\n", preferred.latin1());
+ if( preferred.startsWith( "\"" ) && preferred.endsWith( "\"" )) // strip ""
+ preferred = preferred.mid( 1, preferred.length() - 2 );
+// fprintf( stderr, "SC2: %s\n", preferred.latin1());
+ if( preferred.lower() == "opensuse" )
+ {
+ // opensuseupdater preferred - it's it's available, run it if it's enabled,
+ // try zen-updater only if opensuseupdater is not available at all
+ if( availableOSU())
+ {
+ if( !disabledOSU())
+ return runOSU();
+ return 0;
+ }
+ else if( availableZU() && !disabledZU())
+ return runZU();
+ return 0;
+ }
+ else if( preferred.lower() == "zlm" )
+ {
+ // similar like above, just the other way around
+ if( availableZU())
+ {
+ if( !disabledZU())
+ return runZU();
+ return 0;
+ }
+ else if( availableOSU() && !disabledOSU())
+ return runOSU();
+ return 0;
+ }
+ else
+ {
+ // prefer opensuseupdater, but try to run zen-updater if opensuseupdater is not run
+ // the difference is that zen-updater is still run if opensuseupdater is disabled
+ if( availableOSU() && !disabledOSU() && runOSU())
+ return 0;
+ if( availableZU() && !disabledZU() && runZU())
+ return 0;
+ return 0;
+ }
+ }
Index: runupdater/Makefile.am
===================================================================
--- /dev/null
+++ runupdater/Makefile.am
@@ -0,0 +1,13 @@
+INCLUDES = $(all_includes)
+
+bin_PROGRAMS =
+lib_LTLIBRARIES =
+kdeinit_LTLIBRARIES = runupdater.la
+
+runupdater_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN)
+runupdater_la_LIBADD = $(LIB_KDECORE)
+
+runupdater_la_SOURCES = runupdater.cpp
+
+autostart_DATA = runupdater.desktop
+autostartdir = $(datadir)/autostart

@ -0,0 +1,635 @@
Subject: GUI configuration for selecting WM
From: Lubos Lunak
Feature: bnc#332079
Patch-upstream: no
Index: ksmserver/startup.cpp
===================================================================
--- ksmserver/startup.cpp.orig
+++ ksmserver/startup.cpp
@@ -103,38 +103,39 @@ void KSMServer::restoreSession( QString
config->setGroup( sessionGroup );
int count = config->readNumEntry( "count" );
appsToStart = count;
-
- QValueList<QStringList> wmCommands;
- if ( !wm.isEmpty() ) {
- for ( int i = 1; i <= count; i++ ) {
- QString n = QString::number(i);
- if ( wm == config->readEntry( QString("program")+n ) ) {
- wmCommands << config->readListEntry( QString("restartCommand")+n );
- }
- }
- }
- if ( wmCommands.isEmpty() )
- wmCommands << ( QStringList() << wm );
-
publishProgress( appsToStart, true );
+ upAndRunning( "ksmserver" );
connectDCOPSignal( launcher, launcher, "autoStart0Done()",
"autoStart0Done()", true);
connectDCOPSignal( launcher, launcher, "autoStart1Done()",
"autoStart1Done()", true);
connectDCOPSignal( launcher, launcher, "autoStart2Done()",
"autoStart2Done()", true);
- upAndRunning( "ksmserver" );
- if ( !wmCommands.isEmpty() ) {
- // when we have a window manager, we start it first and give
- // it some time before launching other processes. Results in a
- // visually more appealing startup.
- for (uint i = 0; i < wmCommands.count(); i++)
- startApplication( wmCommands[i] );
- QTimer::singleShot( 4000, this, SLOT( autoStart0() ) );
- } else {
- autoStart0();
+ // find all commands to launch the wm in the session
+ QValueList<QStringList> wmStartCommands;
+ if ( !wm.isEmpty() ) {
+ for ( int i = 1; i <= count; i++ ) {
+ QString n = QString::number(i);
+ // special hack for it, both kde3(=native) and kde4 kwin have the same program,
+ // but the command for kde4 kwin starts with the kde4 wrapper
+ if( config->readEntry( QString("program")+n ) == "kwin" ) {
+ QStringList command = config->readListEntry( QString("restartCommand")+n );
+ if( wmCommands.count() > 1 && wmCommands[ 0 ].endsWith( "kde4" )
+ && command.count() > 1 && command[ 0 ].endsWith( "kde4" )) {
+ wmStartCommands << command; // kde4 wanted, kde4 found
+ } else if(!( wmCommands.count() > 1 && wmCommands[ 0 ].endsWith( "kde4" ))
+ && !( command.count() > 1 && command[ 0 ].endsWith( "kde4" ))) {
+ wmStartCommands << command; // native wanted, native found
+ }
+ } else if ( wm == config->readEntry( QString("program")+n ) ) {
+ wmStartCommands << config->readListEntry( QString("restartCommand")+n );
+ }
+ }
}
+ if( wmStartCommands.isEmpty()) // otherwise use the configured default
+ wmStartCommands << wmCommands;
+ launchWM( wmStartCommands );
}
/*!
@@ -157,17 +158,53 @@ void KSMServer::startDefaultSession()
"autoStart1Done()", true);
connectDCOPSignal( launcher, launcher, "autoStart2Done()",
"autoStart2Done()", true);
- startApplication( wm );
+ launchWM( QValueList< QStringList >() << wmCommands );
+}
+
+void KSMServer::launchWM( const QValueList< QStringList >& wmStartCommands )
+{
+ assert( state == LaunchingWM );
+
+ // when we have a window manager, we start it first and give
+ // it some time before launching other processes. Results in a
+ // visually more appealing startup.
+ wmProcess = startApplication( wmStartCommands[ 0 ] );
+ connect( wmProcess, SIGNAL( processExited( KProcess* )), SLOT( wmProcessChange()));
+ // there can be possibly more wm's (because of forking for multihead),
+ // but in such case care only about the process of the first one
+ for (unsigned int i = 1; i < wmStartCommands.count(); i++)
+ startApplication( wmStartCommands[i] );
QTimer::singleShot( 4000, this, SLOT( autoStart0() ) );
}
void KSMServer::clientSetProgram( KSMClient* client )
{
- if ( !wm.isEmpty() && client->program() == wm )
+ if ( client->program() == wm )
autoStart0();
}
+void KSMServer::wmProcessChange()
+{
+ if( state != LaunchingWM )
+ { // don't care about the process when not in the wm-launching state anymore
+ wmProcess = NULL;
+ return;
+ }
+ if( !wmProcess->isRunning())
+ { // wm failed to launch for some reason, go with kwin instead
+ kdWarning( 1218 ) << "Window manager '" << wm << "' failed to launch" << endl;
+ if( wm == "kwin" )
+ return; // uhoh, kwin itself failed
+ kdDebug( 1218 ) << "Launching KWin" << endl;
+ wm = "kwin";
+ wmCommands = ( QStringList() << "kwin" );
+ // launch it
+ launchWM( QValueList< QStringList >() << wmCommands );
+ return;
+ }
+}
+
void KSMServer::autoStart0()
{
if( state != LaunchingWM )
Index: ksmserver/server.h
===================================================================
--- ksmserver/server.h.orig
+++ ksmserver/server.h
@@ -30,6 +30,8 @@ Copyright (C) 2000 Matthias Ettrich <ett
#define SESSION_PREVIOUS_LOGOUT "saved at previous logout"
#define SESSION_BY_USER "saved by user"
+class KProcess;
+
typedef QValueList<QCString> QCStringList;
class KSMListener;
class KSMConnection;
@@ -98,6 +100,8 @@ public:
KApplication::ShutdownType sdtype,
KApplication::ShutdownMode sdmode );
+ void launchWM( const QValueList< QStringList >& wmStartCommands );
+
public slots:
void cleanUp();
@@ -120,6 +124,7 @@ private slots:
void autoStart2();
void tryRestoreNext();
void startupSuspendTimeout();
+ void wmProcessChange();
private:
void handlePendingInteractions();
@@ -138,13 +143,14 @@ private:
void startProtection();
void endProtection();
- void startApplication( QStringList command,
+ KProcess* startApplication( QStringList command,
const QString& clientMachine = QString::null,
const QString& userId = QString::null );
void executeCommand( const QStringList& command );
bool isWM( const KSMClient* client ) const;
bool isWM( const QString& program ) const;
+ void selectWm( const QString& kdewm );
bool defaultSession() const; // empty session
void setupXIOErrorHandler();
@@ -223,6 +229,8 @@ private:
int lastAppStarted;
QString lastIdStarted;
+ QStringList wmCommands;
+ KProcess* wmProcess;
QStringList excludeApps;
WindowMap legacyWindows;
Index: ksmserver/Makefile.am
===================================================================
--- ksmserver/Makefile.am.orig
+++ ksmserver/Makefile.am
@@ -15,7 +15,7 @@
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-SUBDIRS = .
+SUBDIRS = . windowmanagers
INCLUDES= -I$(top_srcdir)/kdmlib $(all_includes) $(DBUS_INCS)
Index: ksmserver/main.cpp
===================================================================
--- ksmserver/main.cpp.orig
+++ ksmserver/main.cpp
@@ -203,8 +203,6 @@ extern "C" KDE_EXPORT int kdemain( int a
}
QCString wm = args->getOption("windowmanager");
- if ( wm.isEmpty() )
- wm = "kwin";
bool only_local = args->isSet("local");
#ifndef HAVE__ICETRANSNOLISTEN
Index: ksmserver/server.cpp
===================================================================
--- ksmserver/server.cpp.orig
+++ ksmserver/server.cpp
@@ -77,6 +77,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE
#include <kprocess.h>
#include <dcopclient.h>
#include <dcopref.h>
+#include <kdesktopfile.h>
+#include <kshell.h>
#include "server.h"
#include "global.h"
@@ -98,11 +100,11 @@ KSMServer* KSMServer::self()
/*! Utility function to execute a command on the local machine. Used
* to restart applications.
*/
-void KSMServer::startApplication( QStringList command, const QString& clientMachine,
+KProcess* KSMServer::startApplication( QStringList command, const QString& clientMachine,
const QString& userId )
{
if ( command.isEmpty() )
- return;
+ return NULL;
if ( !userId.isEmpty()) {
struct passwd* pw = getpwuid( getuid());
if( pw != NULL && userId != QString::fromLocal8Bit( pw->pw_name )) {
@@ -116,12 +118,12 @@ void KSMServer::startApplication( QStrin
command.prepend( clientMachine );
command.prepend( xonCommand ); // "xon" by default
}
- int n = command.count();
- QCString app = command[0].latin1();
- QValueList<QCString> argList;
- for ( int i=1; i < n; i++)
- argList.append( QCString(command[i].latin1()));
- DCOPRef( launcher ).send( "exec_blind", app, DCOPArg( argList, "QValueList<QCString>" ) );
+ KProcess* process = new KProcess( this );
+ *process << command;
+ // make it auto-delete
+ connect( process, SIGNAL( processExited( KProcess* )), process, SLOT( deleteLater()));
+ process->start();
+ return process;
}
/*! Utility function to execute a command on the local machine. Used
@@ -580,10 +582,10 @@ extern "C" int _IceTransNoListen(const c
KSMServer::KSMServer( const QString& windowManager, bool _only_local )
: DCOPObject("ksmserver"), sessionGroup( "" )
+ , wmProcess( NULL )
{
the_server = this;
clean = false;
- wm = windowManager;
shutdownType = KApplication::ShutdownTypeNone;
@@ -595,6 +597,9 @@ KSMServer::KSMServer( const QString& win
config->setGroup("General" );
clientInteracting = 0;
xonCommand = config->readEntry( "xonCommand", "xon" );
+
+ KGlobal::dirs()->addResourceType( "windowmanagers", "share/apps/ksmserver/windowmanagers" );
+ selectWm( windowManager );
connect( &knotifyTimeoutTimer, SIGNAL( timeout()), SLOT( knotifyTimeout()));
connect( &startupSuspendTimeoutTimer, SIGNAL( timeout()), SLOT( startupSuspendTimeout()));
@@ -851,14 +856,12 @@ void KSMServer::storeSession()
config->setGroup( sessionGroup );
count = 0;
- if ( !wm.isEmpty() ) {
- // put the wm first
- for ( KSMClient* c = clients.first(); c; c = clients.next() )
- if ( c->program() == wm ) {
- clients.prepend( clients.take() );
- break;
- }
- }
+ // put the wm first
+ for ( KSMClient* c = clients.first(); c; c = clients.next() )
+ if ( c->program() == wm ) {
+ clients.prepend( clients.take() );
+ break;
+ }
for ( KSMClient* c = clients.first(); c; c = clients.next() ) {
int restartHint = c->restartStyleHint();
@@ -909,14 +912,65 @@ bool KSMServer::isWM( const KSMClient* c
bool KSMServer::isWM( const QString& program ) const
{
- // KWin relies on ksmserver's special treatment in phase1,
- // therefore make sure it's recognized even if ksmserver
- // was initially started with different WM, and kwin replaced
- // it later
- return program == wm || program == "kwin";
+ return program == wm;
}
bool KSMServer::defaultSession() const
{
return sessionGroup.isEmpty();
}
+
+static bool noDisplay( KDesktopFile& f )
+{
+ KConfigGroup gr( &f, "Desktop Entry" );
+ if (gr.readBoolEntry("NoDisplay", false)) {
+ return true;
+ }
+ if (gr.hasKey("OnlyShowIn")) {
+ if (!gr.readListEntry("OnlyShowIn", ';').contains("KDE"))
+ return true;
+ }
+ if (gr.hasKey("NotShowIn")) {
+ if (gr.readListEntry("NotShowIn", ';').contains("KDE"))
+ return true;
+ }
+ return false;
+}
+
+// selection logic:
+// - $KDEWM is set - use that
+// - a wm is selected using the kcm - use that
+// - if that fails, just use KWin
+void KSMServer::selectWm( const QString& kdewm )
+{
+ wm = "kwin"; // defaults
+ wmCommands = ( QStringList() << "kwin" );
+ if( !kdewm.isEmpty())
+ {
+ wmCommands = ( QStringList() << kdewm );
+ wm = kdewm;
+ return;
+ }
+ KConfigGroup config(KGlobal::config(), "General");
+ QString cfgwm = config.readEntry( "windowManager", "kwin" );
+ KDesktopFile file( cfgwm + ".desktop", true, "windowmanagers" );
+ if( noDisplay( file ))
+ return;
+ if( !file.tryExec())
+ return;
+ file.setDesktopGroup();
+ QString testexec = file.readEntry( "X-KDE-WindowManagerTestExec" );
+ if( !testexec.isEmpty())
+ {
+ int ret = system( QFile::encodeName( testexec ));
+ if( !WIFEXITED( ret ) || WEXITSTATUS( ret ) != 0 )
+ return;
+ }
+ QStringList cfgWmCommands = KShell::splitArgs( file.readEntry( "Exec" ));
+ if( cfgWmCommands.isEmpty())
+ return;
+ QString smname = file.readEntry( "X-KDE-WindowManagerId" );
+ // ok
+ wm = smname.isEmpty() ? cfgwm : smname;
+ wmCommands = cfgWmCommands;
+}
Index: ksmserver/windowmanagers/openbox.desktop
===================================================================
--- /dev/null
+++ ksmserver/windowmanagers/openbox.desktop
@@ -0,0 +1,5 @@
+[Desktop Entry]
+Name=Openbox
+Exec=openbox
+TryExec=openbox
+
Index: ksmserver/windowmanagers/Makefile.am
===================================================================
--- /dev/null
+++ ksmserver/windowmanagers/Makefile.am
@@ -0,0 +1,2 @@
+windowmanager_DATA = compiz-custom.desktop compiz.desktop kwin4.desktop metacity.desktop openbox.desktop
+windowmanagerdir = $(kde_datadir)/ksmserver/windowmanagers
Index: ksmserver/windowmanagers/compiz.desktop
===================================================================
--- /dev/null
+++ ksmserver/windowmanagers/compiz.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+Name=Compiz
+Exec=compiz ccp
+TryExec=compiz
Index: ksmserver/windowmanagers/compiz-custom.desktop
===================================================================
--- /dev/null
+++ ksmserver/windowmanagers/compiz-custom.desktop
@@ -0,0 +1,5 @@
+[Desktop Entry]
+Name=Compiz custom (create wrapper script 'compiz-kde-launcher' to launch it)
+Exec=compiz-kde-launcher
+TryExec=compiz
+X-KDE-WindowManagerId=compiz
Index: ksmserver/windowmanagers/kwin4.desktop
===================================================================
--- /dev/null
+++ ksmserver/windowmanagers/kwin4.desktop
@@ -0,0 +1,6 @@
+[Desktop Entry]
+Name=KWin (KDE4)
+Exec=kde4 /usr/bin/kwin
+TryExec=/usr/bin/kwin
+X-KDE-WindowManagerId=kwin
+
Index: ksmserver/windowmanagers/metacity.desktop
===================================================================
--- /dev/null
+++ ksmserver/windowmanagers/metacity.desktop
@@ -0,0 +1,4 @@
+[Desktop Entry]
+Name=Metacity (GNOME)
+Exec=metacity
+TryExec=metacity
Index: kcontrol/smserver/smserverconfigdlg.ui
===================================================================
--- kcontrol/smserver/smserverconfigdlg.ui.orig
+++ kcontrol/smserver/smserverconfigdlg.ui
@@ -1,4 +1,4 @@
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>SMServerConfigDlg</class>
<widget class="QWidget">
<property name="name">
@@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>325</width>
- <height>366</height>
+ <width>334</width>
+ <height>476</height>
</rect>
</property>
<property name="caption">
@@ -148,6 +148,24 @@
</widget>
</vbox>
</widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>windowManagerGroup</cstring>
+ </property>
+ <property name="title">
+ <string>Window Manager</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>windowManagerCombo</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
<widget class="QButtonGroup">
<property name="name">
<cstring>advancedGroup</cstring>
@@ -236,6 +254,12 @@
<receiver>SMServerConfigDlg</receiver>
<slot>configChanged()</slot>
</connection>
+ <connection>
+ <sender>windowManagerCombo</sender>
+ <signal>activated(int)</signal>
+ <receiver>SMServerConfigDlg</receiver>
+ <slot>configChanged()</slot>
+ </connection>
</connections>
<includes>
<include location="global" impldecl="in implementation">kdialog.h</include>
Index: kcontrol/smserver/kcmsmserver.cpp
===================================================================
--- kcontrol/smserver/kcmsmserver.cpp.orig
+++ kcontrol/smserver/kcmsmserver.cpp
@@ -22,6 +22,8 @@
#include <qcheckbox.h>
#include <qlayout.h>
#include <qradiobutton.h>
+#include <qcombobox.h>
+#include <qfile.h>
#include <dcopclient.h>
@@ -29,6 +31,12 @@
#include <kconfig.h>
#include <kgenericfactory.h>
#include <klineedit.h>
+#include <kstandarddirs.h>
+#include <qregexp.h>
+#include <kdesktopfile.h>
+#include <kdebug.h>
+#include <kprocess.h>
+#include <kmessagebox.h>
#include "kcmsmserver.h"
#include "smserverconfigimpl.h"
@@ -52,6 +60,7 @@ SMServerConfig::SMServerConfig( QWidget
dialog->show();
topLayout->add(dialog);
+ KGlobal::dirs()->addResourceType( "windowmanagers", "share/apps/ksmserver/windowmanagers" );
load();
}
@@ -90,6 +99,7 @@ void SMServerConfig::load(bool useDefaul
dialog->logoutRadio->setChecked(true);
break;
}
+ loadWMs(c->readEntry("windowManager", "kwin"));
dialog->excludeLineedit->setText( c->readEntry("excludeApps"));
delete c;
@@ -116,6 +126,7 @@ void SMServerConfig::save()
dialog->rebootRadio->isChecked() ?
int(KApplication::ShutdownTypeReboot) :
int(KApplication::ShutdownTypeNone));
+ c->writeEntry("windowManager", currentWM());
c->writeEntry("excludeApps", dialog->excludeLineedit->text());
c->sync();
delete c;
@@ -123,6 +134,12 @@ void SMServerConfig::save()
// update the k menu if necessary
QByteArray data;
kapp->dcopClient()->send( "kicker", "kicker", "configure()", data );
+ if( oldwm != currentWM())
+ { // TODO switch it already in the session instead and tell ksmserver
+ KMessageBox::information( this,
+ i18n( "The new window manager will be used when KDE is started the next time." ),
+ i18n( "Window manager change" ), "windowmanagerchange" );
+ }
}
void SMServerConfig::defaults()
@@ -130,5 +147,72 @@ void SMServerConfig::defaults()
load( true );
}
+static bool noDisplay( KDesktopFile& f )
+{
+ KConfigGroup gr( &f, "Desktop Entry" );
+ if (gr.readBoolEntry("NoDisplay", false)) {
+ return true;
+ }
+ if (gr.hasKey("OnlyShowIn")) {
+ if (!gr.readListEntry("OnlyShowIn", ';').contains("KDE"))
+ return true;
+ }
+ if (gr.hasKey("NotShowIn")) {
+ if (gr.readListEntry("NotShowIn", ';').contains("KDE"))
+ return true;
+ }
+ return false;
+}
+
+void SMServerConfig::loadWMs( const QString& current )
+{
+ QString kwinname = i18n( "KWin (KDE default)" );
+ dialog->windowManagerCombo->insertItem( kwinname );
+ dialog->windowManagerCombo->setCurrentItem( 0 );
+ wms[ kwinname ] = "kwin";
+ oldwm = "kwin";
+ QStringList list = KGlobal::dirs()->findAllResources( "windowmanagers", QString(), false, true );
+ QRegExp reg( ".*/([^/\\.]*)\\.[^/\\.]*" );
+ for( QStringList::ConstIterator it = list.begin();
+ it != list.end();
+ ++it )
+ {
+ QString wmfile = *it;
+ KDesktopFile file( wmfile );
+ if( noDisplay( file ))
+ continue;
+ if( !file.tryExec())
+ continue;
+ file.setDesktopGroup();
+ QString testexec = file.readEntry( "X-KDE-WindowManagerTestExec" );
+ if( !testexec.isEmpty())
+ {
+ int ret = system( QFile::encodeName( testexec ));
+ if( !WIFEXITED( ret ) || WEXITSTATUS( ret ) != 0 )
+ continue;
+ }
+ QString name = file.readName();
+ if( name.isEmpty())
+ continue;
+ if( !reg.exactMatch( wmfile ))
+ continue;
+ QString wm = reg.cap( 1 );
+ if( wms.values().contains( wm ))
+ continue;
+ wms[ name ] = wm;
+ dialog->windowManagerCombo->insertItem( name );
+ if( wms[ name ] == current ) // make it selected
+ {
+ dialog->windowManagerCombo->setCurrentItem( dialog->windowManagerCombo->count() - 1 );
+ oldwm = wm;
+ }
+ }
+}
+
+QString SMServerConfig::currentWM() const
+{
+ return wms[ dialog->windowManagerCombo->currentText() ];
+}
+
#include "kcmsmserver.moc"
Index: kcontrol/smserver/kcmsmserver.h
===================================================================
--- kcontrol/smserver/kcmsmserver.h.orig
+++ kcontrol/smserver/kcmsmserver.h
@@ -40,6 +40,10 @@ public:
private:
SMServerConfigImpl* dialog;
+ void loadWMs( const QString& current );
+ QString currentWM() const;
+ QMap< QString, QString > wms; // i18n text -> internal name
+ QString oldwm; // the original value
};

@ -0,0 +1,209 @@
Index: kdesktop/Makefile.am
===================================================================
--- kdesktop/Makefile.am.orig
+++ kdesktop/Makefile.am
@@ -6,6 +6,8 @@ kdesktop_la_LIBADD = libkdesktopsettin
SUBDIRS = . lock pics patterns programs init kwebdesktop
+KDE_OPTIONS = nofinal
+
####### Files
bin_PROGRAMS = kcheckrunning
Index: kicker/kicker/ui/service_mnu.cpp
===================================================================
--- kicker/kicker/ui/service_mnu.cpp.orig
+++ kicker/kicker/ui/service_mnu.cpp
@@ -111,6 +111,11 @@ void PanelServiceMenu::fillMenu(KService
QStringList suppressGenericNames = _root->suppressGenericNames();
KServiceGroup::List::ConstIterator it = _list.begin();
+ KSortableValueList<KSharedPtr<KSycocaEntry>,QCString> slist;
+ KSortableValueList<KSharedPtr<KSycocaEntry>,QCString> glist;
+ QMap<QString,QString> specialTitle;
+ QMap<QString,QString> categoryIcon;
+
bool separatorNeeded = false;
for (; it != _list.end(); ++it)
{
@@ -118,19 +123,108 @@ void PanelServiceMenu::fillMenu(KService
if (e->isType(KST_KServiceGroup))
{
+ KServiceGroup::Ptr g(static_cast<KServiceGroup *>(e));
+ if ( KickerSettings::reduceMenuDepth() && g->SuSEshortMenu() ){
+ KServiceGroup::List l = g->entries(true, excludeNoDisplay_ );
+ if ( l.count() == 1 ) {
+ // the special case, we want to short the menu.
+ // TOFIX? : this works only for one level
+ KServiceGroup::List::ConstIterator _it=l.begin();
+ KSycocaEntry *_e = *_it;
+ if (_e->isType(KST_KService)) {
+ KService::Ptr s(static_cast<KService *>(_e));
+ QString key;
+ if ( g->SuSEgeneralDescription() ) {
+ // we use the application name
+ key = s->name();
+ if( !s->genericName().isEmpty()) {
+ if (KickerSettings::menuEntryFormat() == KickerSettings::NameAndDescription)
+ key = s->name() + " (" + s->genericName() + ")";
+ else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionAndName)
+ key = s->genericName() + " (" + s->name() + ")";
+ else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionOnly)
+ key = s->genericName();
+ }
+ }
+ else {
+ // we use the normal menu description
+ key = s->name();
+ if( !s->genericName().isEmpty()) {
+ if (KickerSettings::menuEntryFormat() == KickerSettings::NameAndDescription)
+ key = s->name() + " (" + g->caption() + ")";
+ else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionAndName)
+ key = g->caption() + " (" + s->name() + ")";
+ else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionOnly)
+ key = g->caption();
+ }
+ }
+ specialTitle.insert( _e->name(), key );
+ categoryIcon.insert( _e->name(), g->icon() );
+ slist.insert( key.local8Bit(), _e );
+ // and escape from here
+ continue;
+ }
+ }
+ }
+ glist.insert( g->caption().local8Bit(), e );
+ }else if( e->isType(KST_KService)) {
+ KService::Ptr s(static_cast<KService *>(e));
+ QString name = s->name();
+ if( !s->genericName().isEmpty()) {
+ if (KickerSettings::menuEntryFormat() == KickerSettings::NameAndDescription)
+ name = s->name() + " (" + s->genericName() + ")";
+ else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionAndName)
+ name = s->genericName() + " (" + s->name() + ")";
+ else if (KickerSettings::menuEntryFormat() == KickerSettings::DescriptionOnly)
+ name = s->genericName();
+ }
+ slist.insert( name.local8Bit(), e );
+ } else
+ slist.insert( e->name().local8Bit(), e );
+ }
+
+ _list = _root->SuSEsortEntries( slist, glist, excludeNoDisplay_, true );
+ it = _list.begin();
+ for (; it != _list.end(); ++it) {
+
+ KSycocaEntry * e = *it;
+
+ if (e->isType(KST_KServiceGroup)) {
KServiceGroup::Ptr g(static_cast<KServiceGroup *>(e));
+ if ( KickerSettings::reduceMenuDepth() && g->SuSEshortMenu() ){
+ KServiceGroup::List l = g->entries(true, excludeNoDisplay_ );
+ if ( l.count() == 1 ) {
+ /* // the special case, we want to short the menu.
+ // TOFIX? : this works only for one level
+ KServiceGroup::List::ConstIterator _it=l.begin();
+ KSycocaEntry *_e = *_it;
+ if (_e->isType(KST_KService)) {
+ KService::Ptr s(static_cast<KService *>(_e));
+ if ( g->SuSEgeneralDescription() )
+ // we use the application name
+ insertMenuItem(s, id++, -1, 0, QString::null, QString::null, g->icon() );
+ else
+ // we use the normal menu description
+ insertMenuItem(s, id++, -1, 0, QString::null, g->caption(), g->icon() );
+ // and escape from here */
+ continue;
+ // }
+ }
+ }
+ // standard sub menu
+
QString groupCaption = g->caption();
-
+
// Avoid adding empty groups.
KServiceGroup::Ptr subMenuRoot = KServiceGroup::group(g->relPath());
-
+
int nbChildCount = subMenuRoot->childCount();
if (nbChildCount == 0 && !g->showEmptyMenu())
- {
+ {
continue;
- }
-
+ }
+
QString inlineHeaderName = g->showInlineHeader() ? groupCaption : "";
// Item names may contain ampersands. To avoid them being converted
// to accelerators, replace them with two ampersands.
@@ -214,7 +308,7 @@ void PanelServiceMenu::fillMenu(KService
}
KService::Ptr s(static_cast<KService *>(e));
- insertMenuItem(s, id++, -1, &suppressGenericNames);
+ insertMenuItem(s, id++, -1, &suppressGenericNames, QString::null, specialTitle[s->name()], categoryIcon[s->name()] );
}
else if (e->isType(KST_KServiceSeparator))
{
@@ -296,7 +390,8 @@ void PanelServiceMenu::configChanged()
void PanelServiceMenu::insertMenuItem(KService::Ptr & s, int nId,
int nIndex/*= -1*/,
const QStringList *suppressGenericNames /* = 0 */,
- const QString & aliasname)
+ const QString & aliasname, const QString & label /*=QString::NULL*/,
+ const QString & categoryIcon /*=QString::null*/)
{
QString serviceName = (aliasname.isEmpty() ? s->name() : aliasname).simplifyWhiteSpace();
QString comment = s->genericName().simplifyWhiteSpace();
@@ -347,7 +442,15 @@ void PanelServiceMenu::insertMenuItem(KS
// to accelerators, replace them with two ampersands.
serviceName.replace("&", "&&");
- int newId = insertItem(KickerLib::menuIconSet(s->icon()), serviceName, nId, nIndex);
+ QString icon = s->icon();
+ if (icon=="unknown")
+ icon = categoryIcon;
+
+ int newId;
+ if ( label.isEmpty() )
+ newId = insertItem(KickerLib::menuIconSet(s->icon()), serviceName, nId, nIndex);
+ else
+ newId = insertItem(KickerLib::menuIconSet(s->icon()), label, nId, nIndex);
entryMap_.insert(newId, static_cast<KSycocaEntry*>(s));
}
Index: kicker/kicker/ui/service_mnu.h
===================================================================
--- kicker/kicker/ui/service_mnu.h.orig
+++ kicker/kicker/ui/service_mnu.h
@@ -83,7 +83,8 @@ protected slots:
protected:
void insertMenuItem(KService::Ptr & s, int nId, int nIndex = -1,
const QStringList *suppressGenericNames=0,
- const QString &aliasname = QString::null);
+ const QString &aliasname = QString::null,
+ const QString &label = QString::null, const QString &categoryIcon = QString::null);
virtual PanelServiceMenu * newSubMenu(const QString & label,
const QString & relPath,
QWidget * parent, const char * name,
Index: kicker/libkicker/kickerSettings.kcfg
===================================================================
--- kicker/libkicker/kickerSettings.kcfg.orig
+++ kicker/libkicker/kickerSettings.kcfg
@@ -126,6 +126,11 @@
<default>true</default>
</entry>
+<entry name="ReduceMenuDepth" type="Bool" >
+ <label>Simplify menus with only a single item inside</label>
+ <default>false</default>
+ </entry>
+
<entry name="MenuEntryHeight" type="Int" >
<label>Height of menu entries in pixels</label>
<default>0</default>

@ -0,0 +1,30 @@
Index: konqueror/konqfilemgr.desktop
===================================================================
--- konqueror/konqfilemgr.desktop.orig
+++ konqueror/konqfilemgr.desktop
@@ -4,7 +4,8 @@ Exec=kfmclient openProfile filemanagemen
Icon=kfm
DocPath=konqueror/index.html
-Name=File Manager
+Name=Konqueror
+GenericName=File Manager
Name[af]=Lêer Bestuurder
Name[ar]=مدبّر الملفات
Name[az]=Fayl İdarəcisi
Index: konqueror/Makefile.am
===================================================================
--- konqueror/Makefile.am.orig
+++ konqueror/Makefile.am
@@ -69,10 +69,7 @@ messages: rc.cpp
$(XGETTEXT) -kaliasLocal rc.cpp *.h *.cc *view/*h *view/*cc kedit*/*.h kedit*/*.cpp about/*.h about/*.cc remoteencodingplugin/*.cpp remoteencodingplugin/*.h shellcmdplugin/*.cpp -o `find sidebar -name "*.cpp"` `find sidebar -name "*.h"` -o $(podir)/konqueror.pot
xdg_apps_DATA = kfmclient.desktop kfmclient_dir.desktop kfmclient_html.desktop \
- kfmclient_war.desktop konqbrowser.desktop konquerorsu.desktop Home.desktop
-
-konq_data4_DATA = konqfilemgr.desktop
-konq_data4dir = $(kde_appsdir)/.hidden
+ kfmclient_war.desktop konqbrowser.desktop konquerorsu.desktop Home.desktop konqfilemgr.desktop
kde_kcfg_DATA = konqueror.kcfg

@ -0,0 +1,91 @@
--- kcontrol/randr/krandrmodule.cpp
+++ kcontrol/randr/krandrmodule.cpp
@@ -114,23 +114,15 @@ KRandRModule::KRandRModule(QWidget *parent, const char *name, const QStringList&
m_rotationGroup->setRadioButtonExclusive(true);
QWhatsThis::add(m_rotationGroup, i18n("The options in this section allow you to change the rotation of your screen."));
- m_applyOnStartup = new QCheckBox(i18n("Apply settings on KDE startup"), this);
- topLayout->addWidget(m_applyOnStartup);
- QWhatsThis::add(m_applyOnStartup, i18n("If this option is enabled the size and orientation settings will be used when KDE starts."));
- connect(m_applyOnStartup, SIGNAL(clicked()), SLOT(setChanged()));
-
- QHBox* syncBox = new QHBox(this);
- syncBox->layout()->addItem(new QSpacerItem(20, 1, QSizePolicy::Maximum));
- m_syncTrayApp = new QCheckBox(i18n("Allow tray application to change startup settings"), syncBox);
- topLayout->addWidget(syncBox);
- QWhatsThis::add(m_syncTrayApp, i18n("If this option is enabled, options set by the system tray applet will be saved and loaded when KDE starts instead of being temporary."));
- connect(m_syncTrayApp, SIGNAL(clicked()), SLOT(setChanged()));
+ m_applyOnlySession = new QCheckBox(i18n("Change settings only for current session"), this);
+ topLayout->addWidget(m_applyOnlySession);
+ QWhatsThis::add(m_applyOnlySession, i18n("If this option is enabled the size and orientation settings will be only changed for the current session."));
+ connect(m_applyOnlySession, SIGNAL(clicked()), SLOT(setChanged()));
topLayout->addStretch(1);
// just set the "apply settings on startup" box
load();
- m_syncTrayApp->setEnabled(m_applyOnStartup->isChecked());
slotScreenChanged(QApplication::desktop()->primaryScreen());
@@ -272,8 +264,7 @@ void KRandRModule::load( bool useDefaults )
m_oldApply = loadDisplay(config, false);
m_oldSyncTrayApp = syncTrayApp(config);
- m_applyOnStartup->setChecked(m_oldApply);
- m_syncTrayApp->setChecked(m_oldSyncTrayApp);
+ m_applyOnlySession->setChecked(!m_oldApply);
emit changed( useDefaults );
}
@@ -291,8 +282,7 @@ void KRandRModule::save()
apply();
- m_oldApply = m_applyOnStartup->isChecked();
- m_oldSyncTrayApp = m_syncTrayApp->isChecked();
+ m_oldApply = !m_applyOnlySession->isChecked();
KConfig config("kcmrandrrc");
saveDisplay(config, m_oldApply, m_oldSyncTrayApp);
@@ -308,8 +298,7 @@ void KRandRModule::setChanged()
#endif
- bool isChanged = (m_oldApply != m_applyOnStartup->isChecked()) || (m_oldSyncTrayApp != m_syncTrayApp->isChecked());
- m_syncTrayApp->setEnabled(m_applyOnStartup->isChecked());
+ bool isChanged = (m_oldApply != !m_applyOnlySession->isChecked());
if (!isChanged)
for (int screenIndex = 0; screenIndex < numScreens(); screenIndex++) {
--- kcontrol/randr/krandrmodule.h
+++ kcontrol/randr/krandrmodule.h
@@ -79,8 +79,7 @@ protected:
KComboBox* m_sizeCombo;
QButtonGroup* m_rotationGroup;
KComboBox* m_refreshRates;
- QCheckBox* m_applyOnStartup;
- QCheckBox* m_syncTrayApp;
+ QCheckBox* m_applyOnlySession;
bool m_oldApply;
bool m_oldSyncTrayApp;
--- kcontrol/randr/randrdisplay.cpp
+++ kcontrol/randr/randrdisplay.cpp
@@ -241,7 +241,7 @@ bool RandRDisplay::loadDisplay(KConfig& config, bool loadScreens)
bool RandRDisplay::applyOnStartup(KConfig& config)
{
config.setGroup("Display");
- return config.readBoolEntry("ApplyOnStartup", false);
+ return config.readBoolEntry("ApplyOnStartup", true);
}
bool RandRDisplay::syncTrayApp(KConfig& config)
@@ -254,7 +254,6 @@ void RandRDisplay::saveDisplay(KConfig& config, bool applyOnStartup, bool syncTr
{
config.setGroup("Display");
config.writeEntry("ApplyOnStartup", applyOnStartup);
- config.writeEntry("SyncTrayApp", syncTrayApp);
#ifdef HAS_RANDR_1_2
if (RandR::has_1_2)

@ -0,0 +1,7 @@
[Desktop Entry]
Encoding=UTF-8
Type=Service
Name=SourceForge Tracker
ServiceTypes=SearchProvider
Keys=sft
Query=https://sourceforge.net/support/tracker.php?aid=\{@}

@ -0,0 +1,13 @@
Index: kcontrol/spellchecking/spellchecking.cpp
===================================================================
--- kcontrol/spellchecking/spellchecking.cpp.orig
+++ kcontrol/spellchecking/spellchecking.cpp
@@ -67,7 +67,7 @@ void KSpellCheckingConfig::defaults()
spellConfig->setRunTogether(0);
spellConfig->setDictionary("");
spellConfig->setDictFromList(FALSE);
- spellConfig->setEncoding (KS_E_ASCII);
+ spellConfig->setEncoding (KS_E_UTF8);
spellConfig->setClient (KS_CLIENT_ISPELL);
}

@ -0,0 +1,80 @@
Index: startkde
===================================================================
--- startkde.orig
+++ startkde
@@ -3,6 +3,9 @@
# DEFAULT KDE STARTUP SCRIPT ( KDE-3.5.10 )
#
+PATH=/opt/kde3/bin:${PATH/:\/opt\/kde3\/bin}
+export PATH
+test -x /usr/bin/xrandr && /usr/bin/xrandr --auto
# When the X server dies we get a HUP signal from xinit. We must ignore it
# because we still need to do some cleanup.
trap 'echo GOT SIGHUP' HUP
@@ -19,7 +22,7 @@ fi
# people's heads. We use colours from the standard KDE palette for those with
# palettised displays.
if test -z "$XDM_MANAGED" || echo "$XDM_MANAGED" | grep ",auto" > /dev/null; then
- xsetroot -solid "#000000"
+ : # xsetroot -solid "#C0C0C0"
fi
# we have to unset this for Darwin since it will screw up KDE's dynamic-loading
@@ -62,7 +65,7 @@ cat >$kdehome/share/config/startupconfig
kcminputrc Mouse cursorTheme ''
kcminputrc Mouse cursorSize ''
kpersonalizerrc General FirstLogin true
-ksplashrc KSplash Theme Default
+ksplashrc KSplash Theme ksplashx-suse
kcmrandrrc Display ApplyOnStartup false
kcmrandrrc [Screen0]
kcmrandrrc [Screen1]
@@ -160,6 +163,16 @@ Xft.dpi: 96
EOF
fi
+case "$ksplashrc_ksplash_theme" in
+ ksplashx-*)
+ if test -x /opt/kde3/bin/ksplashx; then
+ /opt/kde3/bin/ksplashx ${ksplashrc_ksplash_theme#ksplashx-}
+ else
+ ksplashrc_ksplash_theme=Default
+ fi
+ ;;
+esac
+
# Source scripts found in <localprefix>/env/*.sh and <prefixes>/env/*.sh
# (where <localprefix> is $KDEHOME or ~/.kde, and <prefixes> is where KDE is installed)
#
@@ -286,7 +299,7 @@ dcopserver_shutdown
echo 'startkde: Starting up...' 1>&2
# run KPersonalizer before the session, if this is the first login
-if test "$kpersonalizerrc_general_firstlogin" = "true"; then
+if false && test "$kpersonalizerrc_general_firstlogin" = "true"; then
# start only dcopserver, don't start whole kdeinit (takes too long)
echo 'startkde: Running kpersonalizer...' 1>&2
dcopserver
@@ -305,6 +318,8 @@ if test -z "$dl"; then
case "$ksplashrc_ksplash_theme" in
None)
;; # nothing
+ ksplashx-*)
+ ;; # started earlier
Simple)
if test "$kpersonalizerrc_general_firstlogin" = "true"; then
ksplashsimple
@@ -384,9 +399,11 @@ done
echo 'startkde: Shutting down...' 1>&2
# Clean up
+if test -e /opt/kde3/bin/artsshell; then
+ artsshell -q terminate
+fi
kdeinit_shutdown
dcopserver_shutdown --wait
-artsshell -q terminate
# KDE4 support
kde4 kdeinit4_shutdown 2>/dev/null

@ -0,0 +1,140 @@
#
# do we run in a prelinked system ?
#
if test -f /etc/sysconfig/prelink; then
. /etc/sysconfig/prelink
if test "$USE_PRELINK" = "yes" ; then
KDE_IS_PRELINKED=1
export KDE_IS_PRELINKED
else
unset KDE_IS_PRELINKED
fi
fi
#
# Do we have a special Gtk theming for our Qt widget theme ?
#
if [ ! -e $HOME/.no-qtrc-to-gtkrc-mapping ]; then
SUSE_VERSION="`cat /etc/SuSE-release | sed -n 's/VERSION = //p'`"
# Defaults for SuSE 9.0
GTK2_SYSCONFDIR=/etc/opt/gnome
GTK2_DATADIR=/opt/gnome/share/themes/
# use general gtk-qt-engine
if [ -e "$GTK2_DATADIR/Qt/gtk-2.0/gtkrc" ] ; then
GTK2_THEME_RC="$GTK2_DATADIR/Qt/gtk-2.0/gtkrc"
fi
# GTK2
# NOTE: ~/.gtkrc-2.0-kde is added later (in latest KDE only)
if [ "$GTK2_RC_FILES" ]; then
export GTK2_RC_FILES="$GTK2_RC_FILES:$GTK2_THEME_RC:$HOME/.gtkrc-2.0-qtengine:$HOME/.gtkrc-2.0"
else
export GTK2_RC_FILES="$GTK2_SYSCONFDIR/gtk-2.0/gtkrc:$GTK2_THEME_RC:$HOME/.gtkrc-2.0-qtengine:$HOME/.gtkrc-2.0"
fi
fi
#
# use optimized libs, if your CPU has the needed support
# (kdemultimedia package has some SSE optimized libs)
[ -z "$LD_HWCAP_MASK" ] && export LD_HWCAP_MASK=0x20000000
if [ -r /etc/sysconfig/windowmanager ]; then
# Do the user want the SuSE theme ?
source /etc/sysconfig/windowmanager
# Should we really enable FAM support for KDE ?
export USE_FAM="$KDE_USE_FAM"
# Disable IPv6 ?
if [ "$KDE_USE_IPV6" = "no" ]; then
export KDE_NO_IPV6=1
fi
# Disable IDN ?
if [ "$KDE_USE_IDN" = "no" ]; then
export KDE_NO_IDN=1
fi
else
if [ -r /etc/rc.config ]; then
# Do the user want the SuSE theme ?
INSTALL_DESKTOP_EXTENSIONS=`bash -c "source /etc/rc.config && echo \\$INSTALL_DESKTOP_EXTENSIONS"`
# Should we really enable FAM support for KDE ?
USE_FAM=`bash -c "source /etc/rc.config && echo \\$KDE_USE_FAM"`
export USE_FAM
fi
fi
#
# create SuSE defaults
#
if [ "$INSTALL_DESKTOP_EXTENSIONS" == "yes" ]; then
if [ -x /opt/kde3/bin/kde-open ]; then
export DESKTOP_LAUNCH=kde-open
fi
if [ "$USER" == "root" ]; then
if [ ! -e "$HOME/.skel/kdebase3" -a ! -e "$KDEHOME/share/config/kdeglobals" ]; then
if [ -e "/opt/kde3/bin/startkde.theme.unitedlinux" ]; then
. /opt/kde3/bin/startkde.theme.unitedlinux
copy_default_root_ul "$KDEHOME"
create_default_desktop_ul "$HOME/Desktop/"
fi
if [ -e "/opt/kde3/bin/startkde.theme" ]; then
. /opt/kde3/bin/startkde.theme
fi
copy_default_root "$KDEHOME"
create_default_desktop "$HOME/Desktop/"
mkdir -p $HOME/.skel/
touch $HOME/.skel/kdebase3 $HOME/.skel/kdebase3.91
fi
else
if [ ! -e "$HOME/.skel/kdebase3" -a ! -e "$KDEHOME/share/config/kdeglobals" ]; then
if [ -e "/opt/kde3/bin/startkde.theme.unitedlinux" ]; then
. /opt/kde3/bin/startkde.theme.unitedlinux
copy_default_user_ul "$KDEHOME"
create_default_desktop_ul "$HOME/Desktop/"
fi
if [ -e "/opt/kde3/bin/startkde.theme" ]; then
. /opt/kde3/bin/startkde.theme
fi
copy_default_user "$KDEHOME"
create_default_desktop "$HOME/Desktop/"
mkdir -p $HOME/.skel/
touch $HOME/.skel/kdebase3 $HOME/.skel/kdebase3.91
fi
fi
if [ -e /opt/kde3/bin/startkde.update93 -a ! -e "$HOME/.skel/kdebase3.93" ]; then
. /opt/kde3/bin/startkde.update93
mkdir -p $HOME/.skel/
touch $HOME/.skel/kdebase3.93
fi
for i in /opt/kde3/share/UnitedLinux/addon-scripts/*; do
[ -r "$i" ] && \
. "$i"
done
fi
# check if any rpms have been (un)installed since ksycoca
# had been built, if yes, trigger ksycoca rebuild immediatelly
# instead of delayed
kdehome=$HOME/.kde
test -n "$KDEHOME" && kdehome=`echo "$KDEHOME"|sed "s,^~/,$HOME/,"`
host=$HOSTNAME
test -n "$XAUTHLOCALHOSTNAME" && host=$XAUTHLOCALHOSTNAME
ksycoca="$kdehome/cache-$host/ksycoca"
if test -f "$ksycoca"; then
if test -f /var/lib/rpm/Packages; then
if test /var/lib/rpm/Packages -nt "$ksycoca"; then
rm -f "$ksycoca"
fi
fi
fi

@ -0,0 +1,13 @@
#! /bin/sh
if test -n "$SSH_AGENT_PID"; then
ssh-agent -k
fi
if test -n "$GPG_AGENT_INFO"; then
pid=`echo "$GPG_AGENT_INFO" | cut -d: -f2`
if test -n "$pid"; then
kill $pid
fi
fi

@ -0,0 +1,83 @@
Index: empty/Makefile.am
===================================================================
--- /dev/null
+++ empty/Makefile.am
@@ -0,0 +1,17 @@
+# set the include path for X, qt and KDE
+INCLUDES= $(all_includes)
+
+# you can add here more. This one gets installed
+bin_PROGRAMS = default_desktop_aligning
+
+# Which sources should be compiled
+default_desktop_aligning_SOURCES = moving.cpp KDesktopIface.stub
+
+# the library search path.
+default_desktop_aligning_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+
+# the libraries to link against. Be aware of the order. First the libraries,
+# that depend on the following ones.
+default_desktop_aligning_LDADD = $(LIB_KDEUI)
+
+KDesktopIface_DIR = $(srcdir)/../kdesktop
Index: empty/moving.cpp
===================================================================
--- /dev/null
+++ empty/moving.cpp
@@ -0,0 +1,56 @@
+#include <kstandarddirs.h>
+#include <kglobalsettings.h>
+#include <kapplication.h>
+#include "KDesktopIface_stub.h"
+#include <kdebugclasses.h>
+#include <kcmdlineargs.h>
+#include <kconfig.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <qfileinfo.h>
+
+int main(int argc, char **argv)
+{
+ KCmdLineArgs::init(argc, argv, "default_desktop_moving",
+ "move the icons on the correct place on initial boot",
+ "0.1");
+ KApplication app;
+ QStringList icons = KGlobal::dirs()->findAllResources("data", "default_desktop/*.desktop");
+ char buffer[PATH_MAX];
+ strcpy(buffer, "/tmp/suse_desktop_XXXXXX");
+ mkdtemp(buffer);
+ QString tname = QString::fromLatin1(buffer);
+
+ icons.sort();
+
+ KDesktopIface_stub stub("kdesktop", "KDesktopIface");
+ KConfig c( "kdesktoprc" );
+ c.setGroup( "General" );
+
+ if ( c.readBoolEntry( "CopyDesktopLinks", true ) )
+ for (QStringList::ConstIterator it = icons.begin(); it != icons.end(); ++it)
+ {
+ QString name = *it;
+ QPoint t;
+ bool col = (name.mid(name.findRev('/') + 1, 4) == "COL_");
+ name = name.mid(name.findRev('/') + 5, name.length());
+ int index = name.find('_');
+ int num = name.left(index).toInt();
+
+ if (col)
+ t = stub.findPlaceForIcon(num, -1);
+ else
+ t = stub.findPlaceForIcon(-1, num);
+ QFileInfo f(*it);
+
+ name = name.mid(name.find('_', index + 1) + 1, name.length());
+
+ if ( 0 == system(QString("mv '%1' '%1'").arg(*it).arg(tname + "/" + name).local8Bit()) )
+ stub.addIcon( tname + "/" + name, t.x(), t.y());
+
+ sleep(2); // only need to make sure kdesktop goes back in event loop
+ }
+ stub.lineupIcons();
+ system(QString("rm -f %1/moving_desktop.desktop").arg(KGlobalSettings::autostartPath()).latin1());
+ system(QString("rm -rf '%1'").arg(tname).local8Bit());
+}

@ -0,0 +1,178 @@
Subject: Use KPowersave for suspend if available
From: Lubos Lunak
Bug: bnc#326848
Patch-upstream: No
--- kicker/kicker/ui/k_new_mnu.cpp.sav 2008-11-20 10:12:42.000000000 +0100
+++ kicker/kicker/ui/k_new_mnu.cpp 2008-11-20 13:49:20.000000000 +0100
@@ -3691,6 +3691,9 @@ int KMenu::max_items(int category) const
#ifdef KDELIBS_SUSE
#include <liblazy.h>
+
+#include <X11/Xlib.h>
+#include <fixx11h.h>
#endif
void KMenu::insertSuspendOption( int &nId, int &index )
@@ -3699,6 +3702,14 @@ void KMenu::insertSuspendOption( int &nI
int supported = -1;
bool suspend_ram, suspend_disk, standby;
+ DCOPRef kpowersave( "kpowersave", "KPowersaveIface" );
+ DCOPReply reply = kpowersave.call( "allowed_sleepingStates" );
+ if( reply.isValid()) {
+ QStringList supported = reply;
+ suspend_ram = supported.contains( "suspendToRAM" );
+ suspend_disk = supported.contains( "suspendToDisk" );
+ standby = supported.contains( "standBy" );
+ } else {
liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_suspend", &supported);
if (supported == 1)
suspend_ram = true;
@@ -3721,6 +3732,7 @@ void KMenu::insertSuspendOption( int &nI
suspend_ram = false;
if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.standby") != 1)
standby = false;
+ }
if ( ! ( standby + suspend_ram + suspend_disk ) )
return;
@@ -3745,6 +3757,25 @@ void KMenu::slotSuspend(int id)
{
#ifdef KDELIBS_SUSE
int error = 0;
+
+ DCOPRef kpowersave( "kpowersave", "KPowersaveIface" );
+ DCOPReply reply = kpowersave.call( "allowed_sleepingStates" );
+ if( reply.isValid()) {
+ bool ok;
+ extern Time qt_x_time;
+ XUngrabKeyboard( qt_xdisplay(), qt_x_time );
+ XUngrabPointer( qt_xdisplay(), qt_x_time );
+ XSync( qt_xdisplay(), False );
+ if( id == 1 )
+ ok = kpowersave.call( "do_suspendToDisk" );
+ else if( id == 2 )
+ ok = kpowersave.call( "do_suspendToRAM" );
+ else if( id == 3 )
+ ok = kpowersave.call( "do_standBy" );
+ else
+ return;
+ error = ok ? 0 : 1;
+ } else {
int wake = 0;
DBusMessage *reply = 0;
@@ -3773,6 +3804,8 @@ void KMenu::slotSuspend(int id)
DBUS_TYPE_INVALID);
else
return;
+ }
+
if (error)
#endif
KMessageBox::error(this, i18n("Suspend failed"));
--- ksmserver/shutdowndlg.cpp.sav 2008-11-20 10:12:41.000000000 +0100
+++ ksmserver/shutdowndlg.cpp 2008-11-20 13:34:19.000000000 +0100
@@ -40,6 +40,7 @@ Copyright (C) 2000 Matthias Ettrich <ett
#include <kdialog.h>
#include <kseparator.h>
#include <kmessagebox.h>
+#include <dcopref.h>
#include <sys/types.h>
#include <sys/utsname.h>
@@ -264,6 +265,14 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
} else
QToolTip::add( btnReboot, i18n( "<qt><h3>Restart Computer</h3><p>Log out of the current session and restart the computer</p></qt>" ) );
+ DCOPRef kpowersave( "kpowersave", "KPowersaveIface" );
+ DCOPReply reply = kpowersave.call( "allowed_sleepingStates" );
+ if( reply.isValid()) {
+ QStringList supported = reply;
+ suspend_ram = supported.contains( "suspendToRAM" );
+ suspend_disk = supported.contains( "suspendToDisk" );
+ standby = supported.contains( "standBy" );
+ } else {
int supported = -1;
liblazy_hal_get_property_bool(HAL_UDI_COMPUTER, "power_management.can_suspend", &supported);
if (supported == 1)
@@ -287,6 +296,7 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
suspend_ram = false;
if (liblazy_hal_is_caller_privileged("org.freedesktop.hal.power-management.standby") != 1)
standby = false;
+ }
int sum = standby + suspend_ram + suspend_disk;
if ( sum ) {
@@ -325,6 +335,24 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
void KSMShutdownDlg::slotSuspend()
{
int error = 0;
+ DCOPRef kpowersave( "kpowersave", "KPowersaveIface" );
+ DCOPReply reply = kpowersave.call( "allowed_sleepingStates" );
+ if( reply.isValid()) {
+ bool ok;
+ // so that screen locking can take place
+ extern Time qt_x_time;
+ XUngrabKeyboard( qt_xdisplay(), qt_x_time );
+ XUngrabPointer( qt_xdisplay(), qt_x_time );
+ XSync( qt_xdisplay(), False );
+ if( suspend_disk )
+ ok = kpowersave.call( "do_suspendToDisk" );
+ else if( suspend_ram )
+ ok = kpowersave.call( "do_suspendToRAM" );
+ else
+ ok = kpowersave.call( "do_standBy" );
+ error = ok ? 0 : 1;
+ } else {
+
int wake = 0;
DBusMessage *reply;
@@ -351,6 +379,7 @@ void KSMShutdownDlg::slotSuspend()
"Standby",
&reply,
DBUS_TYPE_INVALID);
+ }
if (error)
KMessageBox::error(this, i18n("Suspend failed"));
@@ -362,6 +391,27 @@ void KSMShutdownDlg::slotSuspend()
void KSMShutdownDlg::slotSuspend(int id)
{
int error = 0;
+
+ DCOPRef kpowersave( "kpowersave", "KPowersaveIface" );
+ DCOPReply reply = kpowersave.call( "allowed_sleepingStates" );
+ if( reply.isValid()) {
+ bool ok;
+ extern Time qt_x_time;
+ XUngrabKeyboard( qt_xdisplay(), qt_x_time );
+ XUngrabPointer( qt_xdisplay(), qt_x_time );
+ XSync( qt_xdisplay(), False );
+ if( suspend_disk && id == 1 )
+ ok = kpowersave.call( "do_suspendToDisk" );
+ else if( suspend_ram && id == 2 )
+ ok = kpowersave.call( "do_suspendToRAM" );
+ else if( standby && id == 3 )
+ ok = kpowersave.call( "do_standBy" );
+ else
+ return;
+ error = ok ? 0 : 1;
+ } else {
+
+
int wake = 0;
DBusMessage *reply;
@@ -390,6 +440,8 @@ void KSMShutdownDlg::slotSuspend(int id)
DBUS_TYPE_INVALID);
else
return;
+ }
+
if (error)
KMessageBox::error(this, i18n("Suspend failed"));

@ -0,0 +1,179 @@
Index: kioslave/media/libmediacommon/medium.cpp
===================================================================
--- kioslave/media/libmediacommon/medium.cpp.orig
+++ kioslave/media/libmediacommon/medium.cpp
@@ -42,6 +42,7 @@ Medium::Medium(const QString &id, const
loadUserLabel();
m_halmounted = false;
+ m_isHotplug = false;
}
Medium::Medium()
@@ -59,8 +60,9 @@ Medium::Medium()
m_properties+= QString::null; /* BASE_URL */
m_properties+= QString::null; /* MIME_TYPE */
m_properties+= QString::null; /* ICON_NAME */
-
+
m_halmounted = false;
+ m_isHotplug = false;
}
const Medium Medium::create(const QStringList &properties)
Index: kioslave/media/libmediacommon/medium.h
===================================================================
--- kioslave/media/libmediacommon/medium.h.orig
+++ kioslave/media/libmediacommon/medium.h
@@ -82,18 +82,22 @@ public:
void setHalMounted(bool flag) const { m_halmounted = flag; }
bool halMounted() const { return m_halmounted; }
+ void setIsHotplug( bool state ) { m_isHotplug = state; }
+ bool isHotplug() const { return m_isHotplug; }
+
private:
Medium();
void loadUserLabel();
QStringList m_properties;
mutable bool m_halmounted;
-
+ bool m_isHotplug;
+
friend class QValueListNode<const Medium>;
};
namespace MediaManagerUtils {
- static inline QMap<QString,QString> splitOptions(const QStringList & options)
+ static inline QMap<QString,QString> splitOptions(const QStringList & options)
{
QMap<QString,QString> valids;
Index: kioslave/media/mediamanager/mediamanager.cpp
===================================================================
--- kioslave/media/mediamanager/mediamanager.cpp.orig
+++ kioslave/media/mediamanager/mediamanager.cpp
@@ -330,6 +330,54 @@ void MediaManager::slotMediumChanged(con
emit mediumChanged(name);
}
+QString MediaManager::unmountAllSuspend()
+{
+ QPtrList<Medium> list = m_mediaList.list();
+
+ QPtrList<Medium>::const_iterator it = list.begin();
+ QPtrList<Medium>::const_iterator end = list.end();
+
+ QString result;
+
+ for (; it!=end; ++it)
+ {
+ if ( (*it)->isMounted() && (*it)->isHotplug() )
+ {
+ QString tmp = unmount( (*it)->id() );
+ if ( !tmp.isEmpty() ) // umount failed
+ result = tmp;
+ else
+ m_suspendResumeMountList.append( (*it)->id() );
+ }
+ }
+
+ // return last error
+ return result;
+}
+
+QString MediaManager::remountAllResume()
+{
+ QString result;
+
+ for (QStringList::const_iterator it = m_suspendResumeMountList.begin();
+ it != m_suspendResumeMountList.end();
+ ++it)
+ {
+ const Medium *m = m_mediaList.findById(*it);
+
+ if ( m && m->needMounting() )
+ {
+ QString tmp = mount( *it );
+ if ( !tmp.isEmpty() ) // mount failed
+ result = tmp;
+ }
+ }
+
+ m_suspendResumeMountList.clear();
+
+ // return last error
+ return result;
+}
extern "C" {
KDE_EXPORT KDEDModule *create_mediamanager(const QCString &obj)
Index: kioslave/media/mediamanager/mediamanager.h
===================================================================
--- kioslave/media/mediamanager/mediamanager.h.orig
+++ kioslave/media/mediamanager/mediamanager.h
@@ -58,6 +58,20 @@ k_dcop:
bool removableUnplug(const QString &devNode);
bool removableCamera(const QString &devNode);
+ /**
+ * Unmount manually all partitions when going to suspend
+ *
+ * @return last error if any
+ */
+ QString unmountAllSuspend();
+
+ /**
+ * Remount previously unmounted partitions in unmountAllSuspend()
+ *
+ * @return last error if any
+ */
+ QString remountAllResume();
+
k_dcop_signals:
void mediumAdded(const QString &name, bool allowNotification);
void mediumRemoved(const QString &name, bool allowNotification);
@@ -70,7 +84,7 @@ k_dcop_signals:
private slots:
void loadBackends();
-
+
void slotMediumAdded(const QString &id, const QString &name,
bool allowNotification);
void slotMediumRemoved(const QString &id, const QString &name,
@@ -85,6 +99,7 @@ private:
HALBackend *m_halbackend;
MediaDirNotify m_dirNotify;
FstabBackend *m_fstabbackend;
+ QStringList m_suspendResumeMountList;
};
#endif
Index: kioslave/media/mediamanager/halbackend.cpp
===================================================================
--- kioslave/media/mediamanager/halbackend.cpp.orig
+++ kioslave/media/mediamanager/halbackend.cpp
@@ -459,6 +459,8 @@ void HALBackend::setVolumeProperties(Med
libhal_volume_get_fstype(halVolume), /* Filesystem type */
libhal_volume_is_mounted(halVolume) ); /* Mounted ? */
+ medium->setIsHotplug( libhal_drive_is_hotpluggable(halDrive) );
+
char* name = libhal_volume_policy_compute_display_name(halDrive, halVolume, m_halStoragePolicy);
QString volume_name = QString::fromUtf8(name);
QString media_name = volume_name;
Index: kioslave/media/mediamanager/halbackend.h
===================================================================
--- kioslave/media/mediamanager/halbackend.h.orig
+++ kioslave/media/mediamanager/halbackend.h
@@ -86,6 +86,8 @@ public:
QString mount(const Medium *medium);
QString unmount(const QString &id);
+ static bool isHotplug( const QString & id );
+
private:
/**
* Append a device in the media list. This function will check if the device

@ -0,0 +1,13 @@
Index: kioslave/system/entries/documents.desktop
===================================================================
--- kioslave/system/entries/documents.desktop.orig
+++ kioslave/system/entries/documents.desktop
@@ -1,7 +1,7 @@
[Desktop Entry]
Type=Link
Path[$e]=$( kio_system_documenthelper )
-Icon=folder_important
+Icon=folder_man
Name=Documents Folder
Name[af]=Dokument Gids
Name[ar]=مستنداتي

@ -0,0 +1,162 @@
Index: kicker/applets/systemtray/systemtrayapplet.cpp
===================================================================
--- kicker/applets/systemtray/systemtrayapplet.cpp.orig
+++ kicker/applets/systemtray/systemtrayapplet.cpp
@@ -187,6 +187,7 @@ bool SystemTrayApplet::x11Event( XEvent
if( isWinManaged( (WId)e->xclient.data.l[2] ) ) // we already manage it
return true;
embedWindow( e->xclient.data.l[2], false );
+ updateVisibleWins();
layoutTray();
return true;
}
@@ -213,13 +214,12 @@ void SystemTrayApplet::preferences()
connect(m_settingsDialog, SIGNAL(finished()), this, SLOT(settingsDialogFinished()));
m_iconSelector = new KActionSelector(m_settingsDialog);
- m_iconSelector->setAvailableLabel(i18n("Visible icons:"));
- m_iconSelector->setSelectedLabel(i18n("Hidden icons:"));
- m_iconSelector->setShowUpDownButtons(false);
+ m_iconSelector->setAvailableLabel(i18n("Hidden icons:"));
+ m_iconSelector->setSelectedLabel(i18n("Visible icons:"));
m_settingsDialog->setMainWidget(m_iconSelector);
- QListBox *shownListBox = m_iconSelector->availableListBox();
- QListBox *hiddenListBox = m_iconSelector->selectedListBox();
+ QListBox *hiddenListBox = m_iconSelector->availableListBox();
+ QListBox *shownListBox = m_iconSelector->selectedListBox();
TrayEmbedList::const_iterator it = m_shownWins.begin();
TrayEmbedList::const_iterator itEnd = m_shownWins.end();
@@ -261,26 +261,48 @@ void SystemTrayApplet::applySettings()
}
KConfig *conf = config();
- conf->setGroup("HiddenTrayIcons");
- QString name;
- // use the following snippet of code someday to implement ordering
- // of icons
- /*
- m_visibleIconList.clear();
- QListBoxItem* item = m_iconSelector->availableListBox()->firstItem();
- for (; item; item = item->next())
+ // Save the sort order and hidden status using the window class (WM_CLASS) rather
+ // than window name (caption) - window name is i18n-ed, so it's for example
+ // not possible to create default settings.
+ // For backwards compatibility, name is kept as it is, class is preceded by '!'.
+ QMap< QString, QString > windowNameToClass;
+ for( TrayEmbedList::ConstIterator it = m_shownWins.begin();
+ it != m_shownWins.end();
+ ++it ) {
+ KWin::WindowInfo info = KWin::windowInfo( (*it)->embeddedWinId(), NET::WMName, NET::WM2WindowClass);
+ windowNameToClass[ info.name() ] = '!' + info.windowClassClass();
+ }
+ for( TrayEmbedList::ConstIterator it = m_hiddenWins.begin();
+ it != m_hiddenWins.end();
+ ++it ) {
+ KWin::WindowInfo info = KWin::windowInfo( (*it)->embeddedWinId(), NET::WMName, NET::WM2WindowClass);
+ windowNameToClass[ info.name() ] = '!' + info.windowClassClass();
+ }
+
+ conf->setGroup("SortedTrayIcons");
+ m_sortOrderIconList.clear();
+ for(QListBoxItem* item = m_iconSelector->selectedListBox()->firstItem();
+ item;
+ item = item->next())
{
- m_visibleIconList.append(item->text());
+ if( windowNameToClass.contains(item->text()))
+ m_sortOrderIconList.append(windowNameToClass[item->text()]);
+ else
+ m_sortOrderIconList.append(item->text());
}
- conf->writeEntry("Visible", m_visibleIconList);
- selection.clear();*/
+ conf->writeEntry("SortOrder", m_sortOrderIconList);
+ conf->setGroup("HiddenTrayIcons");
m_hiddenIconList.clear();
- QListBoxItem* item = m_iconSelector->selectedListBox()->firstItem();
- for (; item; item = item->next())
+ for(QListBoxItem* item = m_iconSelector->availableListBox()->firstItem();
+ item;
+ item = item->next())
{
- m_hiddenIconList.append(item->text());
+ if( windowNameToClass.contains(item->text()))
+ m_hiddenIconList.append(windowNameToClass[item->text()]);
+ else
+ m_hiddenIconList.append(item->text());
}
conf->writeEntry("Hidden", m_hiddenIconList);
conf->sync();
@@ -416,6 +438,9 @@ void SystemTrayApplet::loadSettings()
conf->setGroup("HiddenTrayIcons");
m_hiddenIconList = conf->readListEntry("Hidden");
+ conf->setGroup("SortedTrayIcons");
+ m_sortOrderIconList = conf->readListEntry("SortOrder");
+
//Note This setting comes from kdeglobal.
conf->setGroup("System Tray");
m_iconSize = conf->readNumEntry("systrayIconWidth", 22);
@@ -505,7 +530,9 @@ bool SystemTrayApplet::isWinManaged(WId
bool SystemTrayApplet::shouldHide(WId w)
{
- return m_hiddenIconList.find(KWin::windowInfo(w).name()) != m_hiddenIconList.end();
+ return m_hiddenIconList.find(KWin::windowInfo(w).name()) != m_hiddenIconList.end()
+ || m_hiddenIconList.find('!'+KWin::windowInfo(w,0,NET::WM2WindowClass).windowClassClass())
+ != m_hiddenIconList.end();
}
void SystemTrayApplet::updateVisibleWins()
@@ -529,6 +556,35 @@ void SystemTrayApplet::updateVisibleWins
(*emb)->hide();
}
}
+
+ QMap< QXEmbed*, QString > names; // cache window names and classes
+ QMap< QXEmbed*, QString > classes;
+ for( TrayEmbedList::const_iterator it = m_shownWins.begin();
+ it != m_shownWins.end();
+ ++it ) {
+ KWin::WindowInfo info = KWin::windowInfo((*it)->embeddedWinId(),NET::WMName,NET::WM2WindowClass);
+ names[ *it ] = info.name();
+ classes[ *it ] = '!'+info.windowClassClass();
+ }
+ TrayEmbedList newList;
+ for( QStringList::const_iterator it1 = m_sortOrderIconList.begin();
+ it1 != m_sortOrderIconList.end();
+ ++it1 ) {
+ for( TrayEmbedList::iterator it2 = m_shownWins.begin();
+ it2 != m_shownWins.end();
+ ) {
+ if( (*it1).startsWith("!") ? classes[ *it2 ] == *it1 : names[ *it2 ] == *it1 ) {
+ newList.append( *it2 ); // don't bail out, there may be multiple ones
+ it2 = m_shownWins.erase( it2 );
+ } else
+ ++it2;
+ }
+ }
+ for( TrayEmbedList::const_iterator it = m_shownWins.begin();
+ it != m_shownWins.end();
+ ++it )
+ newList.append( *it ); // append unsorted items
+ m_shownWins = newList;
}
void SystemTrayApplet::toggleExpanded()
Index: kicker/applets/systemtray/systemtrayapplet.h
===================================================================
--- kicker/applets/systemtray/systemtrayapplet.h.orig
+++ kicker/applets/systemtray/systemtrayapplet.h
@@ -97,6 +97,7 @@ private:
TrayEmbedList m_shownWins;
TrayEmbedList m_hiddenWins;
QStringList m_hiddenIconList;
+ QStringList m_sortOrderIconList;
KWinModule *kwin_module;
Atom net_system_tray_selection;
Atom net_system_tray_opcode;

@ -0,0 +1,29 @@
--- kicker/taskbar/taskcontainer.cpp.orig 2011-02-12 00:40:57.060389620 +0300
+++ kicker/taskbar/taskcontainer.cpp 2011-02-12 02:03:08.345389684 +0300
@@ -576,9 +576,9 @@
// draw button background
if (drawButton)
{
- style().drawPrimitive(QStyle::PE_HeaderSection, p,
- QRect(0, 0, width(), height()),
- colors);
+ style().drawPrimitive(QStyle::PE_HeaderSection, p,
+ QRect(1, 1, width()-2, height()-2),
+ colors, sunken ? QStyle::Style_Down : QStyle::Style_Raised);
}
// shift button label on sunken buttons
@@ -674,11 +674,11 @@
}
else
{
- textPen = p->pen();
+ textPen = QPen(colors.buttonText()); //textPen = p->pen();
}
}
- int availableWidth = width() - (br.x() * 2) - textPos;
+ int availableWidth = width() - (br.x() * 2) - textPos - 4;
if (m_filteredTasks.count() > 1)
{
availableWidth -= 8;

File diff suppressed because it is too large Load Diff

@ -0,0 +1,25 @@
## Type: yesno
## Default: no
## Path: Desktop/KDE
## Description: KDE uses fam support
#
# KDE use the fam daemon
# (makes only sense on NFS mounted directorys)
#
KDE_USE_FAM="no"
## Type: string
## Default:
#
# space separated list of users for which icons should be shown in KDM
# if empty, then take system defaults
#
KDM_USERS=""
## Type: string
## Default:
#
# Special greeting words in kdm
#
KDM_GREETSTRING=""

File diff suppressed because it is too large Load Diff

@ -0,0 +1,30 @@
Index: kdesktop/minicli.cpp
===================================================================
--- kdesktop/minicli.cpp.orig
+++ kdesktop/minicli.cpp
@@ -265,7 +265,9 @@ void Minicli::accept()
}
bool logout = (cmd == "logout");
- if( !logout && runCommand() == 1 )
+ bool lock = (cmd == "lock");
+
+ if( !logout && !lock && runCommand() == 1 )
return;
m_dlg->cbCommand->addToHistory( m_dlg->cbCommand->currentText().stripWhiteSpace() );
@@ -278,6 +280,14 @@ void Minicli::accept()
kapp->propagateSessionManager();
kapp->requestShutDown();
}
+ if ( lock )
+ {
+ QCString appname( "kdesktop" );
+ int kicker_screen_number = qt_xscreen();
+ if ( kicker_screen_number )
+ appname.sprintf("kdesktop-screen-%d", kicker_screen_number);
+ kapp->dcopClient()->send(appname, "KScreensaverIface", "lock()", "");
+ }
}
void Minicli::reject()

@ -0,0 +1,10 @@
--- kcontrol/randr/randroutput.cpp
+++ kcontrol/randr/randroutput.cpp
@@ -383,6 +383,7 @@ RandRCrtc *RandROutput::findEmptyCrtc()
if (crtc->connectedOutputs().count() == 0)
return crtc;
}
+ return crtc;
}
bool RandROutput::tryCrtc(RandRCrtc *crtc, int changes)

@ -0,0 +1,35 @@
Index: kcontrol/fonts/fonts.cpp
===================================================================
--- kcontrol/fonts/fonts.cpp.orig
+++ kcontrol/fonts/fonts.cpp
@@ -332,7 +332,7 @@ bool FontAASettings::load( bool useDefau
kglobals.setReadDefaults( useDefaults );
kglobals.setGroup("General");
- hStyle=KXftConfig::Hint::Medium;
+ hStyle=KXftConfig::Hint::Full;
xft.setHintStyle(hStyle);
xft.apply(); // Save this setting
kglobals.writeEntry("XftHintStyle", KXftConfig::toStr(hStyle));
@@ -450,7 +450,7 @@ KXftConfig::Hint::Style FontAASettings::
if(hintingStyle->currentText()==KXftConfig::description((KXftConfig::Hint::Style)s))
return (KXftConfig::Hint::Style)s;
- return KXftConfig::Hint::Medium;
+ return KXftConfig::Hint::Full;
}
#endif
Index: kcontrol/krdb/krdb.cpp
===================================================================
--- kcontrol/krdb/krdb.cpp.orig
+++ kcontrol/krdb/krdb.cpp
@@ -524,7 +524,7 @@ void runRdb( uint flags )
if (kglobals.hasKey("XftHintStyle"))
{
- QString hintStyle = kglobals.readEntry("XftHintStyle", "hintmedium");
+ QString hintStyle = kglobals.readEntry("XftHintStyle", "hintfull");
contents += "Xft.hinting: ";
if(hintStyle.isEmpty())
contents += "-1\n";

@ -0,0 +1,17 @@
Index: kdesktop/lock/lockprocess.cc
===================================================================
--- kdesktop/lock/lockprocess.cc.orig
+++ kdesktop/lock/lockprocess.cc
@@ -364,8 +364,10 @@ void LockProcess::configure()
readSaver();
mPlugins = KDesktopSettings::pluginsUnlock();
- if (mPlugins.isEmpty())
- mPlugins = QStringList("classic");
+ if (mMethod == "pam")
+ mPlugins << mMethod;
+ if (mMethod == "pam" || mPlugins.isEmpty())
+ mPlugins << "classic";
mPluginOptions = KDesktopSettings::pluginOptions();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

@ -0,0 +1,44 @@
Index: nsplugins/nspluginloader.cpp
===================================================================
--- nsplugins/nspluginloader.cpp.orig
+++ nsplugins/nspluginloader.cpp
@@ -322,7 +322,7 @@ QString NSPluginLoader::lookup(const QSt
}
-bool NSPluginLoader::loadViewer()
+bool NSPluginLoader::loadViewer(const QString &mimeType)
{
kdDebug() << "NSPluginLoader::loadViewer" << endl;
@@ -346,7 +346,7 @@ bool NSPluginLoader::loadViewer()
}
// find the external artsdsp process
- if( _useArtsdsp ) {
+ if( _useArtsdsp && mimeType != "application/pdf" ) {
kdDebug() << "trying to use artsdsp" << endl;
QString artsdsp = KGlobal::dirs()->findExe("artsdsp");
if (!artsdsp)
@@ -460,7 +460,7 @@ NSPluginInstance *NSPluginLoader::newIns
if ( !_viewer )
{
// load plugin viewer process
- loadViewer();
+ loadViewer(mimeType);
if ( !_viewer )
{
Index: nsplugins/nspluginloader.h
===================================================================
--- nsplugins/nspluginloader.h.orig
+++ nsplugins/nspluginloader.h
@@ -100,7 +100,7 @@ protected:
QString lookup(const QString &mimeType);
QString lookupMimeType(const QString &url);
- bool loadViewer();
+ bool loadViewer(const QString &mimeType);
void unloadViewer();
protected slots:

@ -0,0 +1,36 @@
Index: kcontrol/input/xcursor/themepage.cpp
===================================================================
--- kcontrol/input/xcursor/themepage.cpp.orig
+++ kcontrol/input/xcursor/themepage.cpp
@@ -73,6 +73,13 @@ struct ThemeInfo {
};
+static QString defaultThemeDescription( const QString& theme )
+{
+ if( theme == "redglass" || theme == "whiteglass" || theme == "pseudocore" || theme == "handhelds" )
+ return i18n( "XFree theme %1 - incomplete for KDE" ).arg( theme );
+ return i18n( "No description available" );;
+}
+
ThemePage::ThemePage( QWidget* parent, const char* name )
: QWidget( parent, name ), selectedTheme( NULL ), currentTheme( NULL )
{
@@ -333,7 +340,7 @@ void ThemePage::insertTheme( const QStri
// Defaults in case there's no name or comment field.
QString name = dirName;
- QString desc = i18n( "No description available" );
+ QString desc = defaultThemeDescription( name );
QString sample = "left_ptr";
KSimpleConfig c( path + "/index.theme", true ); // Open read-only
@@ -480,7 +487,7 @@ void ThemePage::insertThemes()
// Defaults in case there's no index.theme file or it lacks
// a name and a comment field.
QString name = *it;
- QString desc = i18n( "No description available" );
+ QString desc = defaultThemeDescription( name );
QString sample = "left_ptr";
// Parse the index.theme file if the theme has one.

@ -0,0 +1,951 @@
Index: kdesktop/minicli.cpp
===================================================================
--- kdesktop/minicli.cpp.orig
+++ kdesktop/minicli.cpp
@@ -379,6 +379,17 @@ int Minicli::runCommand()
cmd = uri.path();
else
cmd = uri.url();
+
+ QCString asn;
+ if( qApp->desktop()->isVirtualDesktop())
+ {
+ asn = KStartupInfo::createNewStartupId();
+ KStartupInfoId id;
+ id.initId( asn );
+ KStartupInfoData data;
+ data.setXinerama( qApp->desktop()->screenNumber( this ));
+ KStartupInfo::sendChange( id, data );
+ }
// Determine whether the application should be run through
// the command line (terminal) interface...
@@ -514,7 +525,7 @@ int Minicli::runCommand()
case KURIFilterData::HELP:
{
// No need for kfmclient, KRun does it all (David)
- (void) new KRun( m_filterData->uri(), parentWidget());
+ (void) new KRun( m_filterData->uri(), parentWidget(), asn );
return 0;
}
case KURIFilterData::EXECUTABLE:
@@ -526,7 +537,7 @@ int Minicli::runCommand()
if (service && service->isValid() && service->type() == "Application")
{
notifyServiceStarted(service);
- KRun::run(*service, KURL::List());
+ KRun::run(*service, KURL::List(), parentWidget(), asn );
return 0;
}
}
@@ -561,7 +572,7 @@ int Minicli::runCommand()
if (service && service->isValid() && service->type() == "Application")
{
notifyServiceStarted(service);
- KRun::run(*service, KURL::List(), this);
+ KRun::run(*service, KURL::List(), parentWidget(), asn );
return 0;
}
@@ -569,7 +580,7 @@ int Minicli::runCommand()
if (service && service->isValid() && service->type() == "Application")
{
notifyServiceStarted(service);
- KRun::run(*service, KURL::List(), this);
+ KRun::run(*service, KURL::List(), parentWidget(), asn );
return 0;
}
@@ -581,7 +592,7 @@ int Minicli::runCommand()
}
}
- if ( KRun::runCommand( cmd, exec, m_iconName ) )
+ if ( KRun::runCommand( cmd, exec, m_iconName, parentWidget(), asn ) )
return 0;
else
{
Index: kdesktop/desktop.cc
===================================================================
--- kdesktop/desktop.cc.orig
+++ kdesktop/desktop.cc
@@ -520,9 +520,12 @@ void KDesktop::popupExecuteCommand(const
if ( m_miniCli->isVisible() ) {
KWin::forceActiveWindow( m_miniCli->winId() );
} else {
- QRect rect = KGlobalSettings::desktopGeometry(QCursor::pos());
- m_miniCli->move(rect.x() + (rect.width() - m_miniCli->width())/2,
- rect.y() + (rect.height() - m_miniCli->height())/2);
+ NETRootInfo i( qt_xdisplay(), NET::Supported );
+ if( !i.isSupported( NET::WM2FullPlacement )) {
+ QRect rect = KGlobalSettings::desktopGeometry(QCursor::pos());
+ m_miniCli->move(rect.x() + (rect.width() - m_miniCli->width())/2,
+ rect.y() + (rect.height() - m_miniCli->height())/2);
+ }
m_miniCli->show(); // non-modal
}
}
Index: kwin/useractions.cpp
===================================================================
--- kwin/useractions.cpp.orig
+++ kwin/useractions.cpp
@@ -482,27 +482,33 @@ bool Client::performMouseCommand( Option
case Options::MouseActivateAndRaise:
replay = isActive(); // for clickraise mode
workspace()->takeActivity( this, ActivityFocus | ActivityRaise, handled && replay );
+ workspace()->setActiveScreenMouse( globalPos );
break;
case Options::MouseActivateAndLower:
workspace()->requestFocus( this );
workspace()->lowerClient( this );
+ workspace()->setActiveScreenMouse( globalPos );
break;
case Options::MouseActivate:
replay = isActive(); // for clickraise mode
workspace()->takeActivity( this, ActivityFocus, handled && replay );
+ workspace()->setActiveScreenMouse( globalPos );
break;
case Options::MouseActivateRaiseAndPassClick:
workspace()->takeActivity( this, ActivityFocus | ActivityRaise, handled );
+ workspace()->setActiveScreenMouse( globalPos );
replay = TRUE;
break;
case Options::MouseActivateAndPassClick:
workspace()->takeActivity( this, ActivityFocus, handled );
+ workspace()->setActiveScreenMouse( globalPos );
replay = TRUE;
break;
case Options::MouseActivateRaiseAndMove:
case Options::MouseActivateRaiseAndUnrestrictedMove:
workspace()->raiseClient( this );
workspace()->requestFocus( this );
+ workspace()->setActiveScreenMouse( globalPos );
if( options->moveMode == Options::Transparent && isMovable())
move_faked_activity = workspace()->fakeRequestedActivity( this );
// fallthrough
@@ -709,6 +715,40 @@ void Workspace::slotWindowToDesktop( int
sendClientToDesktop( c, i, true );
}
+void Workspace::slotSwitchToScreen( int i )
+ {
+ setCurrentScreen( i );
+ }
+
+void Workspace::slotSwitchToNextScreen()
+ {
+ slotSwitchToScreen(( activeScreen() + 1 ) % numScreens());
+ }
+
+void Workspace::slotWindowToScreen( int i )
+ {
+ Client* c = active_popup_client ? active_popup_client : active_client;
+ if( i >= 0 && i <= numScreens() && c
+ && !c->isDesktop()
+ && !c->isDock()
+ && !c->isTopMenu())
+ {
+ sendClientToScreen( c, i );
+ }
+ }
+
+void Workspace::slotWindowToNextScreen()
+ {
+ Client* c = active_popup_client ? active_popup_client : active_client;
+ if( c
+ && !c->isDesktop()
+ && !c->isDock()
+ && !c->isTopMenu())
+ {
+ sendClientToScreen( c, ( c->screen() + 1 ) % numScreens());
+ }
+ }
+
/*!
Maximizes the popup client
*/
Index: kwin/options.h
===================================================================
--- kwin/options.h.orig
+++ kwin/options.h
@@ -124,6 +124,11 @@ class Options : public KDecorationOption
*/
enum AltTabStyle { KDE, CDE };
AltTabStyle altTabStyle;
+
+ // whether to see Xinerama screens separately for focus (in Alt+Tab, when activating next client)
+ bool separateScreenFocus;
+ // whether active Xinerama screen is the one with mouse (or with the active window)
+ bool activeMouseScreen;
/**
* Xinerama options
@@ -133,6 +138,9 @@ class Options : public KDecorationOption
bool xineramaMovementEnabled;
bool xineramaMaximizeEnabled;
bool xineramaFullscreenEnabled;
+
+ // number, or -1 = active screen (Workspace::activeScreen())
+ int xineramaPlacementScreen;
/**
MoveResizeMode, either Tranparent or Opaque.
Index: kwin/workspace.h
===================================================================
--- kwin/workspace.h.orig
+++ kwin/workspace.h
@@ -91,6 +91,7 @@ class Workspace : public QObject, public
QRect clientArea( clientAreaOption, const QPoint& p, int desktop ) const;
QRect clientArea( clientAreaOption, const Client* c ) const;
+ QRect clientArea( clientAreaOption, int screen, int desktop ) const;
/**
* @internal
@@ -161,6 +162,13 @@ class Workspace : public QObject, public
*/
int numberOfDesktops() const;
void setNumberOfDesktops( int n );
+
+ int activeScreen() const;
+ int numScreens() const;
+ void checkActiveScreen( const Client* c );
+ void setActiveScreenMouse( QPoint mousepos );
+ QRect screenGeometry( int screen ) const;
+ int screenNumber( QPoint pos ) const;
QWidget* desktopWidget();
@@ -186,6 +194,7 @@ class Workspace : public QObject, public
void sendClientToDesktop( Client* c, int desktop, bool dont_activate );
void windowToPreviousDesktop( Client* c );
void windowToNextDesktop( Client* c );
+ void sendClientToScreen( Client* c, int screen );
// KDE4 remove me - and it's also in the DCOP interface :(
void showWindowMenuAt( unsigned long id, int x, int y );
@@ -224,6 +233,7 @@ class Workspace : public QObject, public
void nextDesktop();
void previousDesktop();
void circulateDesktopApplications();
+ void setCurrentScreen( int new_screen );
QString desktopName( int desk ) const;
virtual void setDesktopLayout(int , int , int );
@@ -301,6 +311,10 @@ class Workspace : public QObject, public
//void slotSwitchToWindow( int );
void slotWindowToDesktop( int );
//void slotWindowToListPosition( int );
+ void slotSwitchToScreen( int );
+ void slotWindowToScreen( int );
+ void slotSwitchToNextScreen();
+ void slotWindowToNextScreen();
void slotWindowMaximize();
void slotWindowMaximizeVertical();
@@ -481,6 +495,7 @@ class Workspace : public QObject, public
int current_desktop;
int number_of_desktops;
QMemArray<int> desktop_focus_chain;
+ int active_screen;
QWidget* active_popup;
Client* active_popup_client;
Index: kwin/tabbox.cpp
===================================================================
--- kwin/tabbox.cpp.orig
+++ kwin/tabbox.cpp
@@ -23,7 +23,6 @@ License. See the file "COPYING" for the
#include <klocale.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
-#include <qcursor.h>
#include <kstringhandler.h>
#include <stdarg.h>
#include <kdebug.h>
@@ -110,26 +109,36 @@ void TabBox::createClientList(ClientList
while ( c )
{
+ Client* add = NULL;
if ( ((desktop == -1) || c->isOnDesktop(desktop))
&& c->wantsTabFocus() )
+ { // don't add windows that have modal dialogs
+ Client* modal = c->findModal();
+ if( modal == NULL || modal == c )
+ add = c;
+ else if( !list.contains( modal ))
+ add = modal;
+ else
+ {
+ // nothing
+ }
+ }
+
+ if( options->separateScreenFocus && options->xineramaEnabled )
{
- if ( start == c )
+ if( c->screen() != workspace()->activeScreen())
+ add = NULL;
+ }
+
+ if( add != NULL )
+ {
+ if ( start == add )
{
- list.remove( c );
- list.prepend( c );
+ list.remove( add );
+ list.prepend( add );
}
else
- { // don't add windows that have modal dialogs
- Client* modal = c->findModal();
- if( modal == NULL || modal == c )
- list += c;
- else if( !list.contains( modal ))
- list += modal;
- else
- {
- // nothing
- }
- }
+ list += add;
}
if ( chain )
@@ -156,7 +165,7 @@ void TabBox::reset()
{
int w, h, cw = 0, wmax = 0;
- QRect r = KGlobalSettings::desktopGeometry(QCursor::pos());
+ QRect r = workspace()->screenGeometry( workspace()->activeScreen());
// calculate height of 1 line
// fontheight + 1 pixel above + 1 pixel below, or 32x32 icon + 2 pixel above + below
Index: kwin/kcmkwin/kwinoptions/windows.h
===================================================================
--- kwin/kcmkwin/kwinoptions/windows.h.orig
+++ kwin/kcmkwin/kwinoptions/windows.h
@@ -86,6 +86,7 @@ private slots:
void delayFocusOnTog(bool);
void clickRaiseOnTog(bool);
void updateAltTabMode();
+ void updateActiveMouseScreen();
void changed() { emit KCModule::changed(true); }
@@ -101,6 +102,8 @@ private:
void setDelayFocusInterval(int);
void setDelayFocus(bool);
void setClickRaise(bool);
+ void setSeparateScreenFocus(bool);
+ void setActiveMouseScreen(bool);
void setAltTabMode(bool);
void setTraverseAll(bool);
void setRollOverDesktops(bool);
@@ -113,6 +116,8 @@ private:
QCheckBox *clickRaiseOn;
KIntNumInput *autoRaise;
KIntNumInput *delayFocus;
+ QCheckBox *separateScreenFocus;
+ QCheckBox *activeMouseScreen;
QButtonGroup *kbdBox;
QCheckBox *altTabPopup;
Index: kwin/kcmkwin/kwinoptions/windows.cpp
===================================================================
--- kwin/kcmkwin/kwinoptions/windows.cpp.orig
+++ kwin/kcmkwin/kwinoptions/windows.cpp
@@ -76,6 +76,8 @@
#define KWIN_SHADEHOVER_INTERVAL "ShadeHoverInterval"
#define KWIN_FOCUS_STEALING "FocusStealingPreventionLevel"
#define KWIN_HIDE_UTILITY "HideUtilityWindowsForInactive"
+#define KWIN_SEPARATE_SCREEN_FOCUS "SeparateScreenFocus"
+#define KWIN_ACTIVE_MOUSE_SCREEN "ActiveMouseScreen"
// kwm config keywords
#define KWM_ELECTRIC_BORDER "ElectricBorders"
@@ -209,6 +211,27 @@ KFocusConfig::KFocusConfig (bool _standA
QWhatsThis::add( delayFocus, i18n("This is the delay after which the window the mouse pointer is over"
" will automatically receive focus.") );
+ separateScreenFocus = new QCheckBox( i18n( "S&eparate screen focus" ), fcsBox );
+ fLay->addWidget( separateScreenFocus );
+ wtstr = i18n( "When this option is enabled, focus operations are limited only to the active Xinerama screen" );
+ QWhatsThis::add( separateScreenFocus, wtstr );
+
+ activeMouseScreen = new QCheckBox( i18n( "Active &mouse screen" ), fcsBox );
+ fLay->addWidget( activeMouseScreen );
+ wtstr = i18n( "When this option is enabled, active Xinerama screen (where for example new windows appear)"
+ " is the screen with the mouse pointer. When disabled, the active Xinerama screen is the screen"
+ " with the focused window. This option is by default disabled for Click to focus and"
+ " enabled for other focus policies." );
+ QWhatsThis::add( activeMouseScreen, wtstr );
+ connect(focusCombo, SIGNAL(activated(int)), this, SLOT(updateActiveMouseScreen()));
+
+ if (!QApplication::desktop()->isVirtualDesktop() ||
+ QApplication::desktop()->numScreens() == 1) // No Ximerama
+ {
+ separateScreenFocus->hide();
+ activeMouseScreen->hide();
+ }
+
lay->addWidget(fcsBox);
kbdBox = new QButtonGroup(i18n("Navigation"), this);
@@ -260,6 +283,8 @@ KFocusConfig::KFocusConfig (bool _standA
connect(fcsBox, SIGNAL(clicked(int)), SLOT(changed()));
connect(autoRaise, SIGNAL(valueChanged(int)), SLOT(changed()));
connect(delayFocus, SIGNAL(valueChanged(int)), SLOT(changed()));
+ connect(separateScreenFocus, SIGNAL(clicked()), SLOT(changed()));
+ connect(activeMouseScreen, SIGNAL(clicked()), SLOT(changed()));
connect(altTabPopup, SIGNAL(clicked()), SLOT(changed()));
connect(traverseAll, SIGNAL(clicked()), SLOT(changed()));
connect(rollOverDesktops, SIGNAL(clicked()), SLOT(changed()));
@@ -366,6 +391,22 @@ void KFocusConfig::delayFocusOnTog(bool
void KFocusConfig::clickRaiseOnTog(bool ) {
}
+void KFocusConfig::setSeparateScreenFocus(bool s) {
+ separateScreenFocus->setChecked(s);
+}
+
+void KFocusConfig::setActiveMouseScreen(bool a) {
+ activeMouseScreen->setChecked(a);
+}
+
+void KFocusConfig::updateActiveMouseScreen()
+{
+ // on by default for non click to focus policies
+ KConfigGroup cfg( config, "Windows" );
+ if( !cfg.hasKey( KWIN_ACTIVE_MOUSE_SCREEN ))
+ setActiveMouseScreen( focusCombo->currentItem() != 0 );
+}
+
void KFocusConfig::setAltTabMode(bool a) {
altTabPopup->setChecked(a);
}
@@ -412,6 +453,10 @@ void KFocusConfig::load( void )
setClickRaise(key != "off");
setAutoRaiseEnabled(); // this will disable/hide the auto raise delay widget if focus==click
setDelayFocusEnabled();
+
+ setSeparateScreenFocus( config->readBoolEntry(KWIN_SEPARATE_SCREEN_FOCUS, false));
+ // on by default for non click to focus policies
+ setActiveMouseScreen( config->readBoolEntry(KWIN_ACTIVE_MOUSE_SCREEN, focusCombo->currentItem() != 0 ));
key = config->readEntry(KWIN_ALTTABMODE, "KDE");
setAltTabMode(key == "KDE");
@@ -467,6 +512,9 @@ void KFocusConfig::save( void )
else
config->writeEntry(KWIN_CLICKRAISE, "off");
+ config->writeEntry(KWIN_SEPARATE_SCREEN_FOCUS, separateScreenFocus->isChecked());
+ config->writeEntry(KWIN_ACTIVE_MOUSE_SCREEN, activeMouseScreen->isChecked());
+
if (altTabPopup->isChecked())
config->writeEntry(KWIN_ALTTABMODE, "KDE");
else
@@ -500,6 +548,9 @@ void KFocusConfig::defaults()
setAutoRaise(false);
setDelayFocus(false);
setClickRaise(true);
+ setSeparateScreenFocus( false );
+ // on by default for non click to focus policies
+ setActiveMouseScreen( focusCombo->currentItem() != 0 );
setAltTabMode(true);
setTraverseAll( false );
setRollOverDesktops(true);
Index: kwin/popupinfo.h
===================================================================
--- kwin/popupinfo.h.orig
+++ kwin/popupinfo.h
@@ -24,7 +24,7 @@ class PopupInfo : public QWidget
{
Q_OBJECT
public:
- PopupInfo( const char *name=0 );
+ PopupInfo( Workspace* ws, const char *name=0 );
~PopupInfo();
void reset();
@@ -43,6 +43,7 @@ class PopupInfo : public QWidget
bool m_show;
bool m_shown;
QString m_infoString;
+ Workspace* workspace;
};
} // namespace
Index: kwin/options.cpp
===================================================================
--- kwin/options.cpp.orig
+++ kwin/options.cpp
@@ -71,6 +71,9 @@ unsigned long Options::updateSettings()
altTabStyle = KDE; // what a default :-)
if ( val == "CDE" )
altTabStyle = CDE;
+
+ separateScreenFocus = config->readBoolEntry( "SeparateScreenFocus", false );
+ activeMouseScreen = config->readBoolEntry( "ActiveMouseScreen", focusPolicy != ClickToFocus );
rollOverDesktops = config->readBoolEntry("RollOverDesktops", TRUE);
@@ -91,9 +94,10 @@ unsigned long Options::updateSettings()
delete gc;
placement = Placement::policyFromString( config->readEntry("Placement"), true );
+ xineramaPlacementScreen = KCLAMP( config->readNumEntry( "XineramaPlacementScreen", -1 ),
+ -1, qApp->desktop()->numScreens() - 1 );
animateShade = config->readBoolEntry("AnimateShade", TRUE );
-
animateMinimize = config->readBoolEntry("AnimateMinimize", TRUE );
animateMinimizeSpeed = config->readNumEntry("AnimateMinimizeSpeed", 5 );
Index: kwin/placement.cpp
===================================================================
--- kwin/placement.cpp.orig
+++ kwin/placement.cpp
@@ -473,7 +473,7 @@ void Placement::placeOnMainWindow(Client
it != mainwindows.end();
++it )
{
- if( (*it)->isSpecialWindow())
+ if( mainwindows.count() > 1 && (*it)->isSpecialWindow())
continue; // don't consider toolbars etc when placing
++mains_count;
place_on2 = *it;
@@ -502,6 +502,11 @@ void Placement::placeOnMainWindow(Client
}
place_on = place_on2; // use the only window filtered together with 'mains_count'
}
+ if( place_on->isDesktop())
+ {
+ place( c, area, Centered );
+ return;
+ }
QRect geom = c->geometry();
geom.moveCenter( place_on->geometry().center());
c->move( geom.topLeft());
Index: kwin/client.cpp
===================================================================
--- kwin/client.cpp.orig
+++ kwin/client.cpp
@@ -1255,6 +1255,20 @@ bool Client::isOnCurrentDesktop() const
return isOnDesktop( workspace()->currentDesktop());
}
+int Client::screen() const
+ {
+ if( !options->xineramaEnabled )
+ return 0;
+ return workspace()->screenNumber( geometry().center());
+ }
+
+bool Client::isOnScreen( int screen ) const
+ {
+ if( !options->xineramaEnabled )
+ return screen == 0;
+ return workspace()->screenGeometry( screen ).intersects( geometry());
+ }
+
// performs activation and/or raising of the window
void Client::takeActivity( int flags, bool handled, allowed_t )
{
Index: kwin/popupinfo.cpp
===================================================================
--- kwin/popupinfo.cpp.orig
+++ kwin/popupinfo.cpp
@@ -25,7 +25,6 @@ License. See the file "COPYING" for the
#include <klocale.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
-#include <qcursor.h>
#include <kstringhandler.h>
#include <kglobalsettings.h>
@@ -34,8 +33,8 @@ License. See the file "COPYING" for the
namespace KWinInternal
{
-PopupInfo::PopupInfo( const char *name )
- : QWidget( 0, name )
+PopupInfo::PopupInfo( Workspace* ws, const char *name )
+ : QWidget( 0, name ), workspace( ws )
{
m_infoString = "";
m_shown = false;
@@ -60,7 +59,7 @@ PopupInfo::~PopupInfo()
*/
void PopupInfo::reset()
{
- QRect r = KGlobalSettings::desktopGeometry(QCursor::pos());
+ QRect r = workspace->screenGeometry( workspace->activeScreen());
int w = fontMetrics().width( m_infoString ) + 30;
Index: kwin/geometry.cpp
===================================================================
--- kwin/geometry.cpp.orig
+++ kwin/geometry.cpp
@@ -211,14 +211,11 @@ void Workspace::updateClientArea()
\sa geometry()
*/
-QRect Workspace::clientArea( clientAreaOption opt, const QPoint& p, int desktop ) const
+QRect Workspace::clientArea( clientAreaOption opt, int screen, int desktop ) const
{
if( desktop == NETWinInfo::OnAllDesktops || desktop == 0 )
desktop = currentDesktop();
QDesktopWidget *desktopwidget = KApplication::desktop();
- int screen = desktopwidget->isVirtualDesktop() ? desktopwidget->screenNumber( p ) : desktopwidget->primaryScreen();
- if( screen < 0 )
- screen = desktopwidget->primaryScreen();
QRect sarea = screenarea // may be NULL during KWin initialization
? screenarea[ desktop ][ screen ]
: desktopwidget->screenGeometry( screen );
@@ -263,11 +260,21 @@ QRect Workspace::clientArea( clientAreaO
return QRect();
}
+QRect Workspace::clientArea( clientAreaOption opt, const QPoint& p, int desktop ) const
+ {
+ QDesktopWidget *desktopwidget = KApplication::desktop();
+ int screen = desktopwidget->screenNumber( p );
+ if( screen < 0 )
+ screen = desktopwidget->primaryScreen();
+ return clientArea( opt, screen, desktop );
+ }
+
QRect Workspace::clientArea( clientAreaOption opt, const Client* c ) const
{
return clientArea( opt, c->geometry().center(), c->desktop());
}
+
/*!
Client \a c is moved around to position \a pos. This gives the
workspace the opportunity to interveniate and to implement
@@ -896,10 +903,6 @@ void Client::checkWorkspacePosition()
setGeometry( area );
return;
}
- if( maximizeMode() != MaximizeRestore )
- // TODO update geom_restore?
- changeMaximize( false, false, true ); // adjust size
-
if( isFullScreen())
{
QRect area = workspace()->clientArea( FullScreenArea, this );
@@ -926,6 +929,10 @@ void Client::checkWorkspacePosition()
return;
}
+ if( maximizeMode() != MaximizeRestore )
+ // TODO update geom_restore?
+ changeMaximize( false, false, true ); // adjust size
+
if( !isShade()) // TODO
{
int old_diff_x = workarea_diff_x;
@@ -1722,6 +1729,7 @@ void Client::setGeometry( int x, int y,
sendSyntheticConfigureNotify();
updateWindowRules();
checkMaximizeGeometry();
+ workspace()->checkActiveScreen( this );
}
void Client::plainResize( int w, int h, ForceGeometry_t force )
@@ -1775,6 +1783,7 @@ void Client::plainResize( int w, int h,
sendSyntheticConfigureNotify();
updateWindowRules();
checkMaximizeGeometry();
+ workspace()->checkActiveScreen( this );
}
/*!
@@ -1795,6 +1804,7 @@ void Client::move( int x, int y, ForceGe
sendSyntheticConfigureNotify();
updateWindowRules();
checkMaximizeGeometry();
+ workspace()->checkActiveScreen( this );
}
Index: kwin/kwin.kcfg
===================================================================
--- kwin/kwin.kcfg.orig
+++ kwin/kwin.kcfg
@@ -60,6 +60,9 @@
<entry key="IgnorePositionClasses" type="StringList" />
<entry key="KillPingTimeout" type="Int" />
<entry key="ShowDesktopIsMinimizeAll" type="Bool" />
+ <entry key="SeparateScreenFocus" type="Bool" />
+ <entry key="ActiveMouseScreen" type="Bool" />
+ <entry key="XineramaPlacementScreen" type="Int" />
</group>
<group name="WM" >
Index: kwin/client.h
===================================================================
--- kwin/client.h.orig
+++ kwin/client.h
@@ -118,6 +118,9 @@ class Client : public QObject, public KD
bool isOnCurrentDesktop() const;
bool isOnAllDesktops() const;
void setOnAllDesktops( bool set );
+
+ bool isOnScreen( int screen ) const; // true if it's at least partially there
+ int screen() const; // the screen where the center is
// !isMinimized() && not hidden, i.e. normally visible on some virtual desktop
bool isShown( bool shaded_is_shown ) const;
Index: kwin/manage.cpp
===================================================================
--- kwin/manage.cpp.orig
+++ kwin/manage.cpp
@@ -166,7 +166,7 @@ bool Client::manage( Window w, bool isMa
it != mainclients.end();
++it )
{
- if( (*it)->isSpecialWindow())
+ if( mainclients.count() > 1 && (*it)->isSpecialWindow())
continue; // don't consider toolbars etc when placing
maincl = *it;
if( (*it)->isOnCurrentDesktop())
@@ -202,9 +202,14 @@ bool Client::manage( Window w, bool isMa
if( isMapped || session )
area = workspace()->clientArea( FullArea, geom.center(), desktop());
else if( options->xineramaPlacementEnabled )
- area = workspace()->clientArea( PlacementArea, QCursor::pos(), desktop());
+ {
+ int screen = options->xineramaPlacementScreen;
+ if( screen == -1 ) // active screen
+ screen = asn_data.xinerama() == -1 ? workspace()->activeScreen() : asn_data.xinerama();
+ area = workspace()->clientArea( PlacementArea, workspace()->screenGeometry( screen ).center(), desktop());
+ }
else
- area = workspace()->clientArea( PlacementArea, geom.center(), desktop());
+ area = workspace()->clientArea( PlacementArea, QCursor::pos(), desktop());
if( int type = checkFullScreenHack( geom ))
{
Index: kwin/workspace.cpp
===================================================================
--- kwin/workspace.cpp.orig
+++ kwin/workspace.cpp
@@ -82,6 +82,7 @@ Workspace::Workspace( bool restore )
QObject (0, "workspace"),
current_desktop (0),
number_of_desktops(0),
+ active_screen (0),
active_popup( NULL ),
active_popup_client( NULL ),
desktop_widget (0),
@@ -202,7 +203,7 @@ Workspace::Workspace( bool restore )
client_keys = new KGlobalAccel( this );
initShortcuts();
tab_box = new TabBox( this );
- popupinfo = new PopupInfo( );
+ popupinfo = new PopupInfo( this );
init();
@@ -304,6 +305,7 @@ void Workspace::init()
NET::WM2ExtendedStrut |
NET::WM2KDETemporaryRules |
NET::WM2ShowingDesktop |
+ NET::WM2FullPlacement |
NET::WM2DesktopLayout |
0
,
@@ -1541,6 +1543,83 @@ void Workspace::setDesktopLayout( int, i
{ // DCOP-only, unused
}
+int Workspace::numScreens() const
+ {
+ if( !options->xineramaEnabled )
+ return 0;
+ return qApp->desktop()->numScreens();
+ }
+
+int Workspace::activeScreen() const
+ {
+ if( !options->xineramaEnabled )
+ return 0;
+ if( !options->activeMouseScreen )
+ {
+ if( activeClient() != NULL && !activeClient()->isOnScreen( active_screen ))
+ return qApp->desktop()->screenNumber( activeClient()->geometry().center());
+ return active_screen;
+ }
+ return qApp->desktop()->screenNumber( QCursor::pos());
+ }
+
+// check whether a client moved completely out of what's considered the active screen,
+// if yes, set a new active screen
+void Workspace::checkActiveScreen( const Client* c )
+ {
+ if( !options->xineramaEnabled )
+ return;
+ if( !c->isActive())
+ return;
+ if( !c->isOnScreen( active_screen ))
+ active_screen = c->screen();
+ }
+
+// called e.g. when a user clicks on a window, set active screen to be the screen
+// where the click occured
+void Workspace::setActiveScreenMouse( QPoint mousepos )
+ {
+ if( !options->xineramaEnabled )
+ return;
+ active_screen = qApp->desktop()->screenNumber( mousepos );
+ }
+
+QRect Workspace::screenGeometry( int screen ) const
+ {
+ if( !options->xineramaEnabled )
+ return qApp->desktop()->geometry();
+ return qApp->desktop()->screenGeometry( screen );
+ }
+
+int Workspace::screenNumber( QPoint pos ) const
+ {
+ if( !options->xineramaEnabled )
+ return 0;
+ return qApp->desktop()->screenNumber( pos );
+ }
+
+
+void Workspace::sendClientToScreen( Client* c, int screen )
+ {
+ if( c->screen() == screen ) // don't use isOnScreen(), that's true even when only parti
+ // ally
+ return;
+ GeometryUpdatesPostponer blocker( c );
+ QRect old_sarea = clientArea( MaximizeArea, c );
+ QRect sarea = clientArea( MaximizeArea, screen, c->desktop());
+ c->setGeometry( sarea.x() - old_sarea.x() + c->x(), sarea.y() - old_sarea.y() + c->y(),
+ c->size().width(), c->size().height());
+ c->checkWorkspacePosition();
+ ClientList transients_stacking_order = ensureStackingOrder( c->transients());
+ for( ClientList::ConstIterator it = transients_stacking_order.begin();
+ it != transients_stacking_order.end();
+ ++it )
+ sendClientToScreen( *it, screen );
+ if( c->isActive())
+ active_screen = screen;
+ }
+
+
void Workspace::updateDesktopLayout()
{
// rootInfo->desktopLayoutCorner(); // I don't find this worth bothering, feel free to
Index: kwin/activation.cpp
===================================================================
--- kwin/activation.cpp.orig
+++ kwin/activation.cpp
@@ -360,6 +360,8 @@ void Workspace::takeActivity( Client* c,
return;
}
c->takeActivity( flags, handled, Allowed );
+ if( !c->isOnScreen( active_screen ))
+ active_screen = c->screen();
}
void Workspace::handleTakeActivity( Client* c, Time /*timestamp*/, int flags )
@@ -413,6 +415,13 @@ bool Workspace::activateNextClient( Clie
{
if( !(*it)->isShown( false ) || !(*it)->isOnCurrentDesktop())
continue;
+ if( options->separateScreenFocus )
+ {
+ if( c != NULL && !(*it)->isOnScreen( c->screen()))
+ continue;
+ if( c == NULL && !(*it)->isOnScreen( activeScreen()))
+ continue;
+ }
if( mainwindows.contains( *it ))
{
get_focus = *it;
@@ -438,6 +447,31 @@ bool Workspace::activateNextClient( Clie
return true;
}
+void Workspace::setCurrentScreen( int new_screen )
+ {
+ if (new_screen < 0 || new_screen > numScreens())
+ return;
+ if ( !options->focusPolicyIsReasonable())
+ return;
+ closeActivePopup();
+ Client* get_focus = NULL;
+ for( ClientList::ConstIterator it = focus_chain[currentDesktop()].fromLast();
+ it != focus_chain[currentDesktop()].end();
+ --it )
+ {
+ if( !(*it)->isShown( false ) || !(*it)->isOnCurrentDesktop())
+ continue;
+ if( !(*it)->screen() == new_screen )
+ continue;
+ get_focus = *it;
+ break;
+ }
+ if( get_focus == NULL )
+ get_focus = findDesktop( true, currentDesktop());
+ if( get_focus != NULL && get_focus != mostRecentlyActivatedClient())
+ requestFocus( get_focus );
+ active_screen = new_screen;
+ }
void Workspace::gotFocusIn( const Client* c )
{
@@ -860,6 +894,8 @@ void Client::startupIdChanged()
desktop = asn_data.desktop();
if( !isOnAllDesktops())
workspace()->sendClientToDesktop( this, desktop, true );
+ if( asn_data.xinerama() != -1 )
+ workspace()->sendClientToScreen( this, asn_data.xinerama());
Time timestamp = asn_id.timestamp();
if( timestamp == 0 && asn_data.timestamp() != -1U )
timestamp = asn_data.timestamp();
Index: kwin/kwinbindings.cpp
===================================================================
--- kwin/kwinbindings.cpp.orig
+++ kwin/kwinbindings.cpp
@@ -104,6 +104,15 @@
DEF( I18N_NOOP("Window One Desktop to the Left"), 0, 0, slotWindowToDesktopLeft() );
DEF( I18N_NOOP("Window One Desktop Up"), 0, 0, slotWindowToDesktopUp() );
DEF( I18N_NOOP("Window One Desktop Down"), 0, 0, slotWindowToDesktopDown() );
+ DEF( I18N_NOOP("Window to Screen 0"), 0, 0, slotWindowToScreen(int) );
+ DEF( I18N_NOOP("Window to Screen 1"), 0, 0, slotWindowToScreen(int) );
+ DEF( I18N_NOOP("Window to Screen 2"), 0, 0, slotWindowToScreen(int) );
+ DEF( I18N_NOOP("Window to Screen 3"), 0, 0, slotWindowToScreen(int) );
+ DEF( I18N_NOOP("Window to Screen 4"), 0, 0, slotWindowToScreen(int) );
+ DEF( I18N_NOOP("Window to Screen 5"), 0, 0, slotWindowToScreen(int) );
+ DEF( I18N_NOOP("Window to Screen 6"), 0, 0, slotWindowToScreen(int) );
+ DEF( I18N_NOOP("Window to Screen 7"), 0, 0, slotWindowToScreen(int) );
+ DEF( I18N_NOOP("Window to Next Screen"), 0, 0, slotWindowToNextScreen() );
keys->insert( "Group:Desktop Switching", i18n("Desktop Switching") );
DEF( I18N_NOOP("Switch to Desktop 1"), CTRL+Qt::Key_F1, WIN+Qt::Key_F1, slotSwitchToDesktop(int) );
@@ -132,6 +141,15 @@
DEF( I18N_NOOP("Switch One Desktop to the Left"), 0, 0, slotSwitchDesktopLeft() );
DEF( I18N_NOOP("Switch One Desktop Up"), 0, 0, slotSwitchDesktopUp() );
DEF( I18N_NOOP("Switch One Desktop Down"), 0, 0, slotSwitchDesktopDown() );
+ DEF( I18N_NOOP("Switch to Screen 0"), 0, 0, slotSwitchToScreen(int) );
+ DEF( I18N_NOOP("Switch to Screen 1"), 0, 0, slotSwitchToScreen(int) );
+ DEF( I18N_NOOP("Switch to Screen 2"), 0, 0, slotSwitchToScreen(int) );
+ DEF( I18N_NOOP("Switch to Screen 3"), 0, 0, slotSwitchToScreen(int) );
+ DEF( I18N_NOOP("Switch to Screen 4"), 0, 0, slotSwitchToScreen(int) );
+ DEF( I18N_NOOP("Switch to Screen 5"), 0, 0, slotSwitchToScreen(int) );
+ DEF( I18N_NOOP("Switch to Screen 6"), 0, 0, slotSwitchToScreen(int) );
+ DEF( I18N_NOOP("Switch to Screen 7"), 0, 0, slotSwitchToScreen(int) );
+ DEF( I18N_NOOP("Switch to Next Screen"), 0, 0, slotSwitchToNextScreen() );
keys->insert( "Group:Miscellaneous", i18n("Miscellaneous") );
DEF( I18N_NOOP("Mouse Emulation"), ALT+Qt::Key_F12, 0, slotMouseEmulation() );

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

@ -197,8 +197,7 @@ License: BSD3c(or similar) ; GPLv2+ ; LGPLv2.1+
Requires: libtqt4-devel libvorbis-devel tdelibs = %version autoconf automake libxslt-devel libxml2-devel libart_lgpl-devel libjpeg-devel tde-filesystem
# next line from tde-devel-packages macro
Requires: tdelibs-doc libtiff-devel openssl-devel update-desktop-files
# FIXME dbus-1-qt3-devel to what?
Requires: libdrm-devel dbus-1-qt3-devel
Requires: libdrm-devel dbus-1-tqt-devel
Requires: libattr-devel libacl-devel
Requires: tdelibs-arts
Summary: Trinity Base Package: Build Environment

Loading…
Cancel
Save