diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-11 20:21:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-12-11 20:21:27 +0000 |
commit | 10e41144596fc9ced40fc349d9ecd099b1c2ea19 (patch) | |
tree | 88ab04e475ff5a4cd889cb082f5760b6e0bf5e4e /kdm/kfrontend | |
parent | 4aed2c8219774f5d797760606b8489a92ddc5163 (diff) | |
download | tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.tar.gz tdebase-10e41144596fc9ced40fc349d9ecd099b1c2ea19.zip |
Initial import of Trinity 3.5.11 to kdebase
Extends krandrtray, adds iccconfig kcontrol module, adds run dialog autocomplete and lots of bugfixes
Will need to check for commit warnings and repair as encountered
Also needs full compile test
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1061475 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdm/kfrontend')
-rw-r--r-- | kdm/kfrontend/Makefile.am | 2 | ||||
-rw-r--r-- | kdm/kfrontend/genkdmconf.c | 118 | ||||
-rw-r--r-- | kdm/kfrontend/kdmctl.c | 2 | ||||
-rw-r--r-- | kdm/kfrontend/kdmshutdown.cpp | 320 | ||||
-rw-r--r-- | kdm/kfrontend/kdmshutdown.h | 44 | ||||
-rw-r--r-- | kdm/kfrontend/kgapp.cpp | 14 | ||||
-rw-r--r-- | kdm/kfrontend/kgreeter.cpp | 25 | ||||
-rw-r--r-- | kdm/kfrontend/sessions/kde.desktop.in | 2 | ||||
-rw-r--r-- | kdm/kfrontend/sessions/matchbox.desktop | 4 | ||||
-rw-r--r-- | kdm/kfrontend/sessions/olvwm.desktop | 4 | ||||
-rw-r--r-- | kdm/kfrontend/sessions/olwm.desktop | 4 | ||||
-rw-r--r-- | kdm/kfrontend/sessions/pwm.desktop | 4 | ||||
-rw-r--r-- | kdm/kfrontend/sessions/ude.desktop | 4 |
13 files changed, 377 insertions, 170 deletions
diff --git a/kdm/kfrontend/Makefile.am b/kdm/kfrontend/Makefile.am index 8f123509d..5c5dfd61a 100644 --- a/kdm/kfrontend/Makefile.am +++ b/kdm/kfrontend/Makefile.am @@ -1,5 +1,5 @@ # use 'make GENKDMCONF_FLAGS=... install' to override -GENKDMCONF_FLAGS = +GENKDMCONF_FLAGS = --no-old SUBDIRS = themer themes pics sessions diff --git a/kdm/kfrontend/genkdmconf.c b/kdm/kfrontend/genkdmconf.c index 5c0cb91e0..631561d17 100644 --- a/kdm/kfrontend/genkdmconf.c +++ b/kdm/kfrontend/genkdmconf.c @@ -322,7 +322,8 @@ static char * locate( const char *exe ) { int len; - char *path, *pathe, *name, *thenam, nambuf[PATH_MAX+1]; + char *path, *name, *thenam, nambuf[PATH_MAX+1]; + char *pathe; if (!(path = getenv( "PATH" ))) return 0; @@ -331,7 +332,7 @@ locate( const char *exe ) memcpy( name, exe, len + 1 ); *--name = '/'; do { - if (!(pathe = strchr( path, ':' ))) + if (!(pathe = (char*)strchr( path, ':' ))) pathe = path + strlen( path ); len = pathe - path; if (len && !(len == 1 && *path == '.')) { @@ -531,7 +532,7 @@ static const char def_xaccess[] = "# right hand sides can match.\n" "#\n" "\n" -"* #any host can get a login window\n" +"#* #any host can get a login window\n" "\n" "#\n" "# To hardwire a specific terminal to a specific host, you can\n" @@ -549,7 +550,7 @@ static const char def_xaccess[] = "# so this may not work in all environments.\n" "#\n" "\n" -"* CHOOSER BROADCAST #any indirect host can get a chooser\n" +"#* CHOOSER BROADCAST #any indirect host can get a chooser\n" "\n" "#\n" "# If you'd prefer to configure the set of hosts each terminal sees,\n" @@ -585,35 +586,25 @@ static const char def_startup[] = "#! /bin/sh\n" "# Xstartup - run as root before session starts\n" "\n" -"# By convention, both xconsole and xterm -C check that the\n" -"# console is owned by the invoking user and is readable before attaching\n" -"# the console output. This way a random user can invoke xterm -C without\n" -"# causing serious grief; still, it can cause havoc, so xconsole is started\n" -"# by Xsetup usually.\n" -"# This is not required if you use PAM with the pam_console module.\n" -"#\n" -"#chown $USER /dev/console\n" "\n" -#ifdef _AIX -"# We create a pseudodevice for finger. (host:0 becomes xdm/host_0)\n" -"# Without it, finger errors out with \"Can't stat /dev/host:0\".\n" -"#\n" -"#devname=`echo $DISPLAY | cut -c1-8`\n" -"#if [ ! -d /dev/xdm ]; then\n" -"# mkdir /dev/xdm\n" -"# chmod 755 /dev/xdm\n" -"#fi\n" -"#touch /dev/xdm/$devname\n" -"#chmod 644 /dev/xdm/$devname\n" -"#exec sessreg -a -l xdm/$devname -h \"`echo $DISPLAY | cut -d: -f1`\"" -#else -"#exec sessreg -a -l $DISPLAY -h \"`echo $DISPLAY | cut -d: -f1`\"" -# ifdef BSD -" -x " KDMCONF "/Xservers" -# endif -#endif /* _AIX */ -" $USER\n" -"\n# NOTE: The session is aborted if the last command returns non-zero.\n"; +"\n" +"if [ -e /etc/nologin ]; then\n" +" # always display the nologin message, if possible\n" +" if [ -s /etc/nologin ] && which xmessage > /dev/null 2>&1; then\n" +" xmessage -file /etc/nologin -geometry 640x480\n" +" fi\n" +" if [ \"$(id -u)\" != \"0\" ] && \\\n" +" ! grep -qs '^ignore-nologin' /etc/kde3/kdm/kdm.options; then\n" +" exit 1\n" +" fi\n" +"fi\n" +"\n" +"if grep -qs '^use-sessreg' /etc/kde3/kdm/kdm.options && \\\n" +" which sessreg > /dev/null 2>&1; then\n" +" exec sessreg -a -l \"$DISPLAY\" -u /var/run/utmp \\\n" +" -h \"`echo $DISPLAY | cut -d: -f1`\" \"$USER\"\n" +" # NOTREACHED\n" +"fi\n"; static const char def_reset[] = "#! /bin/sh\n" @@ -629,12 +620,13 @@ static const char def_reset[] = "#devname=`echo $DISPLAY | cut -c1-8`\n" "#exec sessreg -d -l xdm/$devname -h \"`echo $DISPLAY | cut -d: -f1`\"" #else -"#exec sessreg -d -l $DISPLAY -h \"`echo $DISPLAY | cut -d: -f1`\"" -# ifdef BSD -" -x " KDMCONF "/Xservers" -# endif +"if grep -qs '^use-sessreg' /etc/kde3/kdm/kdm.options && \\\n" +" which sessreg > /dev/null 2>&1; then\n" +" exec sessreg -d -l \"$DISPLAY\" -u /var/run/utmp \\\n" +" -h \"`echo $DISPLAY | cut -d: -f1`\" \"$USER\"\n" +" # NOTREACHED\n" +"fi\n"; #endif /* _AIX */ -" $USER\n"; static const char def_session1[] = "#! /bin/sh\n" @@ -666,6 +658,7 @@ static const char def_session1[] = " [ -f $zhome/.zprofile ] && . $zhome/.zprofile\n" " [ -f $zdir/zlogin ] && . $zdir/zlogin\n" " [ -f $zhome/.zlogin ] && . $zhome/.zlogin\n" +" setopt shwordsplit noextendedglob\n" " ;;\n" " */csh|*/tcsh)\n" " # [t]cshrc is always sourced automatically.\n" @@ -682,28 +675,8 @@ static const char def_session2[] = " [ -f $HOME/.profile ] && . $HOME/.profile\n" " ;;\n" "esac\n" -"\n" -"[ -f /etc/xprofile ] && . /etc/xprofile\n" -"[ -f $HOME/.xprofile ] && . $HOME/.xprofile\n" -"\n" -"case $session in\n" -" \"\")\n" -" exec xmessage -center -buttons OK:0 -default OK \"Sorry, $DESKTOP_SESSION is no valid session.\"\n" -" ;;\n" -" failsafe)\n" -" exec xterm -geometry 80x24-0-0\n" -" ;;\n" -" custom)\n" -" exec $HOME/.xsession\n" -" ;;\n" -" default)\n" -" exec " KDE_BINDIR "/startkde\n" -" ;;\n" -" *)\n" -" eval exec \"$session\"\n" -" ;;\n" -"esac\n" -"exec xmessage -center -buttons OK:0 -default OK \"Sorry, cannot execute $session. Check $DESKTOP_SESSION.desktop.\"\n"; +"# invoke global X session script\n" +". /etc/X11/Xsession\n"; static const char def_background[] = "[Desktop0]\n" @@ -978,29 +951,6 @@ getInitTab( void ) if (maxTTY) return; - if (readFile( &it, "/etc/inittab" )) { - usedFile( "/etc/inittab" ); - for (p = it.buf; p < it.eof; p = eol + 1) { - for (eol = p; eol < it.eof && *eol != '\n'; eol++); - if (*p != '#') { - if ((ep = mem_mem( p, eol - p, " tty", 4 )) && - ep < eol && isdigit( *ep )) - { - if (ep + 1 == eol || isspace( *(ep + 1) )) - tty = *ep - '0'; - else if (isdigit( *(ep + 1) ) && - (ep + 2 == eol || isspace( *(ep + 2) ))) - tty = (*ep - '0') * 10 + (*(ep + 1) - '0'); - else - continue; - TTYmask |= 1 << (tty - 1); - if (tty > maxTTY) - maxTTY = tty; - } - } - } - freeBuf( &it ); - } if (!maxTTY) { maxTTY = 6; TTYmask = 0x3f; @@ -1390,12 +1340,12 @@ mk_xaccess( Entry *ce, Section *cs ATTR_UNUSED ) static void mk_willing( Entry *ce, Section *cs ATTR_UNUSED ) { - const char *fname; + char *fname; if (!ce->active) /* there is only the Global one */ goto dflt; else { - if (!(fname = strchr( ce->value, '/' ))) + if (!(fname = (char*)strchr( ce->value, '/' ))) return; /* obviously in-line (or empty) */ if (old_scripts || inNewDir( fname )) dlinkfile( fname ); diff --git a/kdm/kfrontend/kdmctl.c b/kdm/kfrontend/kdmctl.c index 72e133162..82a12e653 100644 --- a/kdm/kfrontend/kdmctl.c +++ b/kdm/kfrontend/kdmctl.c @@ -219,7 +219,7 @@ main( int argc, char **argv ) fprintf( stderr, "Cannot create UNIX socket\n" ); return 1; } - if (dpy && (ptr = strchr( dpy, ':' )) && (ptr = strchr( ptr, '.' ))) + if (dpy && (ptr = (char*)strchr( dpy, ':' )) && (ptr = (char*)strchr( ptr, '.' ))) *ptr = 0; if (ctl && *ctl) { if (!openctl( fd, 1, ctl, dpy )) diff --git a/kdm/kfrontend/kdmshutdown.cpp b/kdm/kfrontend/kdmshutdown.cpp index dfd8558e2..74f62550e 100644 --- a/kdm/kfrontend/kdmshutdown.cpp +++ b/kdm/kfrontend/kdmshutdown.cpp @@ -34,6 +34,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <kdialog.h> #include <kstandarddirs.h> #include <kuser.h> +#include <kconfig.h> +#include <kiconloader.h> #include <qcombobox.h> #include <qvbuttongroup.h> @@ -48,6 +50,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <qlistview.h> #include <qheader.h> #include <qdatetime.h> +#include <qregexp.h> #define KDmh KDialog::marginHint() #define KDsh KDialog::spacingHint() @@ -459,76 +462,152 @@ void KDMDelayedPushButton::slotTimeout() setDown( false ); } - KDMSlimShutdown::KDMSlimShutdown( QWidget *_parent ) : inherited( _parent ) , targetList( 0 ) { - QHBoxLayout *hbox = new QHBoxLayout( this, KDmh, KDsh ); - - QFrame *lfrm = new QFrame( this ); - lfrm->setFrameStyle( QFrame::Panel | QFrame::Sunken ); - hbox->addWidget( lfrm, AlignCenter ); - QLabel *icon = new QLabel( lfrm ); - icon->setPixmap( QPixmap( locate( "data", "kdm/pics/shutdown.jpg" ) ) ); - QVBoxLayout *iconlay = new QVBoxLayout( lfrm ); - iconlay->addWidget( icon ); - - QVBoxLayout *buttonlay = new QVBoxLayout( hbox, KDsh ); - - buttonlay->addStretch( 1 ); - - KPushButton *btnHalt = new - KPushButton( KGuiItem( i18n("&Turn Off Computer"), "exit" ), this ); - buttonlay->addWidget( btnHalt ); - connect( btnHalt, SIGNAL(clicked()), SLOT(slotHalt()) ); - - buttonlay->addSpacing( KDialog::spacingHint() ); - KDMDelayedPushButton *btnReboot = new - KDMDelayedPushButton( KGuiItem( i18n("&Restart Computer"), "reload" ), this ); - buttonlay->addWidget( btnReboot ); - connect( btnReboot, SIGNAL(clicked()), SLOT(slotReboot()) ); + bool doUbuntuLogout = KConfigGroup(KGlobal::config(), "Shutdown").readBoolEntry("doUbuntuLogout", false); - GSet( 1 ); - GSendInt( G_ListBootOpts ); - if (GRecvInt() == BO_OK) { - targetList = GRecvStrArr( 0 ); - /*int def =*/ GRecvInt(); - int cur = GRecvInt(); - QPopupMenu *targets = new QPopupMenu( this ); - for (int i = 0; targetList[i]; i++) { - QString t( QString::fromLocal8Bit( targetList[i] ) ); - targets->insertItem( i == cur ? - i18n("current option in boot loader", - "%1 (current)").arg( t ) : - t, i ); + QVBoxLayout* vbox = new QVBoxLayout( this ); + QHBoxLayout *hbox = new QHBoxLayout( this, KDmh, KDsh ); + QFrame* lfrm = new QFrame( this ); + QHBoxLayout* hbuttonbox; + + if(doUbuntuLogout) + { + lfrm->setFrameStyle( QFrame::StyledPanel | QFrame::Raised ); + lfrm->setLineWidth( style().pixelMetric( QStyle::PM_DefaultFrameWidth, lfrm ) ); + // we need to set the minimum size for the logout box, since it + // gets too small if there isn't all options available + lfrm->setMinimumSize(300,120); + vbox->addWidget( lfrm ); + vbox = new QVBoxLayout( lfrm, 2 * KDialog::marginHint(), + 2 * KDialog::spacingHint() ); + + // first line of buttons + hbuttonbox = new QHBoxLayout( vbox, 8 * KDialog::spacingHint() ); + hbuttonbox->setAlignment( Qt::AlignHCenter ); + + // Reboot + FlatButton* btnReboot = new FlatButton( lfrm ); + btnReboot->setTextLabel( i18n("&Restart"), false ); + btnReboot->setPixmap( DesktopIcon( "reload") ); + int i = btnReboot->textLabel().find( QRegExp("\\&"), 0 ); // i == 1 + btnReboot->setAccel( "ALT+" + btnReboot->textLabel().lower()[i+1] ) ; + hbuttonbox->addWidget ( btnReboot); + connect(btnReboot, SIGNAL(clicked()), SLOT(slotReboot())); + + // Copied completely from the standard restart/shutdown dialog + GSet( 1 ); + GSendInt( G_ListBootOpts ); + if (GRecvInt() == BO_OK) { + targetList = GRecvStrArr( 0 ); + /*int def =*/ GRecvInt(); + int cur = GRecvInt(); + QPopupMenu *targets = new QPopupMenu( this ); + btnReboot->setPopupDelay(300); // visually add dropdown + for (int i = 0; targetList[i]; i++) { + QString t( QString::fromLocal8Bit( targetList[i] ) ); + targets->insertItem( i == cur ? + i18n("current option in boot loader", + "%1 (current)").arg( t ) : + t, i ); + } + btnReboot->setPopup( targets ); + connect( targets, SIGNAL(activated(int)), SLOT(slotReboot(int)) ); } - btnReboot->setPopup( targets ); - connect( targets, SIGNAL(activated(int)), SLOT(slotReboot(int)) ); + GSet( 0 ); + // Copied completely from the standard restart/shutdown dialog + + // Shutdown + FlatButton* btnHalt = new FlatButton( lfrm ); + btnHalt->setTextLabel( i18n("&Turn Off"), false ); + btnHalt->setPixmap( DesktopIcon( "exit") ); + i = btnHalt->textLabel().find( QRegExp("\\&"), 0 ); // i == 1 + btnHalt->setAccel( "ALT+" + btnHalt->textLabel().lower()[i+1] ) ; + hbuttonbox->addWidget ( btnHalt ); + connect(btnHalt, SIGNAL(clicked()), SLOT(slotHalt())); + + // cancel buttonbox + QHBoxLayout* hbuttonbox2 = new QHBoxLayout( vbox, 8 * KDialog::spacingHint() ); + hbuttonbox2->setAlignment( Qt::AlignRight ); + + // Back to kdm + KSMPushButton* btnBack = new KSMPushButton( KStdGuiItem::cancel(), lfrm ); + hbuttonbox2->addWidget( btnBack ); + connect(btnBack, SIGNAL(clicked()), SLOT(reject())); + + } - GSet( 0 ); - - buttonlay->addStretch( 1 ); - - if (_scheduledSd != SHUT_NEVER) { - KPushButton *btnSched = new - KPushButton( KGuiItem( i18n("&Schedule...") ), this ); - buttonlay->addWidget( btnSched ); - connect( btnSched, SIGNAL(clicked()), SLOT(slotSched()) ); - + else + { + lfrm->setFrameStyle( QFrame::Panel | QFrame::Sunken ); + hbox->addWidget( lfrm, AlignCenter ); + QLabel *icon = new QLabel( lfrm ); + icon->setPixmap( QPixmap( locate( "data", "kdm/pics/shutdown.jpg" ) ) ); + QVBoxLayout *iconlay = new QVBoxLayout( lfrm ); + iconlay->addWidget( icon ); + + QVBoxLayout *buttonlay = new QVBoxLayout( hbox, KDsh ); + + buttonlay->addStretch( 1 ); + + KPushButton *btnHalt = new + KPushButton( KGuiItem( i18n("&Turn Off Computer"), "exit" ), this ); + buttonlay->addWidget( btnHalt ); + connect( btnHalt, SIGNAL(clicked()), SLOT(slotHalt()) ); + + buttonlay->addSpacing( KDialog::spacingHint() ); + + KDMDelayedPushButton *btnReboot = new + KDMDelayedPushButton( KGuiItem( i18n("&Restart Computer"), "reload" ), this ); + buttonlay->addWidget( btnReboot ); + connect( btnReboot, SIGNAL(clicked()), SLOT(slotReboot()) ); + + GSet( 1 ); + GSendInt( G_ListBootOpts ); + if (GRecvInt() == BO_OK) { + targetList = GRecvStrArr( 0 ); + /*int def =*/ GRecvInt(); + int cur = GRecvInt(); + QPopupMenu *targets = new QPopupMenu( this ); + for (int i = 0; targetList[i]; i++) { + QString t( QString::fromLocal8Bit( targetList[i] ) ); + targets->insertItem( i == cur ? + i18n("current option in boot loader", + "%1 (current)").arg( t ) : + t, i ); + } + btnReboot->setPopup( targets ); + connect( targets, SIGNAL(activated(int)), SLOT(slotReboot(int)) ); + } + GSet( 0 ); + buttonlay->addStretch( 1 ); + + if (_scheduledSd != SHUT_NEVER) { + KPushButton *btnSched = new + KPushButton( KGuiItem( i18n("&Schedule...") ), this ); + buttonlay->addWidget( btnSched ); + connect( btnSched, SIGNAL(clicked()), SLOT(slotSched()) ); + + buttonlay->addStretch( 1 ); + } + + buttonlay->addWidget( new KSeparator( this ) ); + + buttonlay->addSpacing( 0 ); + + KPushButton *btnBack = new KPushButton( KStdGuiItem::cancel(), this ); + buttonlay->addWidget( btnBack ); + connect( btnBack, SIGNAL(clicked()), SLOT(reject()) ); + + buttonlay->addSpacing( KDialog::spacingHint() ); + + } - buttonlay->addWidget( new KSeparator( this ) ); - - buttonlay->addSpacing( 0 ); - - KPushButton *btnBack = new KPushButton( KStdGuiItem::cancel(), this ); - buttonlay->addWidget( btnBack ); - connect( btnBack, SIGNAL(clicked()), SLOT(reject()) ); - - buttonlay->addSpacing( KDialog::spacingHint() ); } KDMSlimShutdown::~KDMSlimShutdown() @@ -593,6 +672,129 @@ KDMSlimShutdown::externShutdown( int type, const char *os, int uid ) } +KSMPushButton::KSMPushButton( const KGuiItem &item, + QWidget *parent, + const char *name) + : KPushButton( item, parent, name), + m_pressed(false) +{ + setDefault( false ); + setAutoDefault ( false ); +} + +void KSMPushButton::keyPressEvent( QKeyEvent* e ) +{ + switch ( e->key() ) + { + case Key_Enter: + case Key_Return: + case Key_Space: + m_pressed = TRUE; + setDown(true); + emit pressed(); + break; + case Key_Escape: + e->ignore(); + break; + default: + e->ignore(); + } + + QPushButton::keyPressEvent(e); +} + + +void KSMPushButton::keyReleaseEvent( QKeyEvent* e ) +{ + switch ( e->key() ) + { + case Key_Space: + case Key_Enter: + case Key_Return: + if ( m_pressed ) + { + setDown(false); + m_pressed = FALSE; + emit released(); + emit clicked(); + } + break; + case Key_Escape: + e->ignore(); + break; + default: + e->ignore(); + + } +} + +FlatButton::FlatButton( QWidget *parent, const char *name ) + : QToolButton( parent, name/*, WNoAutoErase*/ ), + m_pressed(false) +{ + init(); +} + + +FlatButton::~FlatButton() {} + +void FlatButton::init() +{ + setUsesTextLabel(true); + setUsesBigPixmap(true); + setAutoRaise(true); + setTextPosition( QToolButton::Under ); + setFocusPolicy(QWidget::StrongFocus); + } + + +void FlatButton::keyPressEvent( QKeyEvent* e ) +{ + switch ( e->key() ) + { + case Key_Enter: + case Key_Return: + case Key_Space: + m_pressed = TRUE; + setDown(true); + emit pressed(); + break; + case Key_Escape: + e->ignore(); + break; + default: + e->ignore(); + } + + QToolButton::keyPressEvent(e); +} + +void FlatButton::keyReleaseEvent( QKeyEvent* e ) +{ + switch ( e->key() ) + { + case Key_Space: + case Key_Enter: + case Key_Return: + if ( m_pressed ) + { + setDown(false); + m_pressed = FALSE; + emit released(); + emit clicked(); + } + break; + case Key_Escape: + e->ignore(); + break; + default: + e->ignore(); + } + +} + + + KDMConfShutdown::KDMConfShutdown( int _uid, dpySpec *sess, int type, const char *os, QWidget *_parent ) : inherited( _uid, _parent ) diff --git a/kdm/kfrontend/kdmshutdown.h b/kdm/kfrontend/kdmshutdown.h index 9020b1513..98877fcbb 100644 --- a/kdm/kfrontend/kdmshutdown.h +++ b/kdm/kfrontend/kdmshutdown.h @@ -32,6 +32,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <kpushbutton.h> #include <qradiobutton.h> +#include <qtoolbutton.h> +#include <qpixmap.h> class QLabel; class KPushButton; @@ -193,4 +195,46 @@ class KDMCancelShutdown : public KDMShutdownBase { const char *os, QWidget *_parent ); }; +class KSMPushButton : public KPushButton +{ + Q_OBJECT + +public: + + KSMPushButton( const KGuiItem &item, QWidget *parent, const char *name = 0 ); + +protected: + virtual void keyPressEvent(QKeyEvent*e); + virtual void keyReleaseEvent(QKeyEvent*e); + +private: + + bool m_pressed; + +}; + +class FlatButton : public QToolButton +{ + Q_OBJECT + + public: + + FlatButton( QWidget *parent = 0, const char *name = 0 ); + ~FlatButton(); + + protected: + virtual void keyPressEvent(QKeyEvent*e); + virtual void keyReleaseEvent(QKeyEvent*e); + + private slots: + + private: + void init(); + + bool m_pressed; + QString m_text; + QPixmap m_pixmap; + +}; + #endif /* KDMSHUTDOWN_H */ diff --git a/kdm/kfrontend/kgapp.cpp b/kdm/kfrontend/kgapp.cpp index 711853c37..a5bb667ef 100644 --- a/kdm/kfrontend/kgapp.cpp +++ b/kdm/kfrontend/kgapp.cpp @@ -38,6 +38,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <ksimpleconfig.h> #include <qtimer.h> +#include <qstring.h> #include <qcursor.h> #include <qpalette.h> @@ -124,6 +125,8 @@ xIOErr( Display * ) exit( EX_RESERVER_DPY ); } +//KSimpleConfig *iccconfig; + void kg_main( const char *argv0 ) { @@ -141,6 +144,17 @@ kg_main( const char *argv0 ) if (!_GUIStyle.isEmpty()) app.setStyle( _GUIStyle ); + // Load up the systemwide ICC profile + QString iccConfigFile = QString(KDE_CONFDIR); + iccConfigFile += "/kicc/kiccconfigrc"; + KSimpleConfig iccconfig(iccConfigFile, true); + if (iccconfig.readBoolEntry("EnableICC", false) == true) { + QString iccCommand = QString("/usr/bin/xcalib "); + iccCommand += iccconfig.readEntry("ICCFile"); + iccCommand += QString(" &"); + system(iccCommand.ascii()); + } + _colorScheme = locate( "data", "kdisplay/color-schemes/" + _colorScheme + ".kcsrc" ); if (!_colorScheme.isEmpty()) { KSimpleConfig config( _colorScheme, true ); diff --git a/kdm/kfrontend/kgreeter.cpp b/kdm/kfrontend/kgreeter.cpp index 574f4e340..407b3d879 100644 --- a/kdm/kfrontend/kgreeter.cpp +++ b/kdm/kfrontend/kgreeter.cpp @@ -55,6 +55,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <qpushbutton.h> #include <qtooltip.h> #include <qaccel.h> +#include <qstring.h> #include <qeventloop.h> #include <pwd.h> @@ -173,6 +174,13 @@ void KGreeter::insertUser( const QImage &default_pix, const QString &username, struct passwd *ps ) { + if (setegid( ps->pw_gid )) + return; + if (seteuid( ps->pw_uid )) { + setegid(0); + return; + } + if (userList) userList->append( username ); if (!userView) @@ -236,6 +244,9 @@ KGreeter::insertUser( const QImage &default_pix, realname.append( "\n" ).append( username ); new UserListViewItem( userView, realname, QPixmap( p ), username ); } + + seteuid( 0 ); + setegid( 0 ); } class KCStringList : public QValueList<QCString> { @@ -282,15 +293,8 @@ KGreeter::insertUsers() { struct passwd *ps; - // XXX remove seteuid-voodoo when we run as nobody if (!(ps = getpwnam( "nobody" ))) return; - if (setegid( ps->pw_gid )) - return; - if (seteuid( ps->pw_uid )) { - setegid(0); - return; - } QImage default_pix; if (userView) { @@ -354,17 +358,12 @@ KGreeter::insertUsers() if (userList) userList->sort(); } - - // XXX remove seteuid-voodoo when we run as nobody - seteuid( 0 ); - setegid( 0 ); } void KGreeter::putSession( const QString &type, const QString &name, bool hid, const char *exe ) { int prio = exe ? (!strcmp( exe, "default" ) ? 0 : - !strcmp( exe, "custom" ) ? 1 : !strcmp( exe, "failsafe" ) ? 3 : 2) : 2; for (uint i = 0; i < sessionTypes.size(); i++) if (sessionTypes[i].type == type) { @@ -392,7 +391,6 @@ KGreeter::insertSessions() } } putSession( "default", i18n("Default"), false, "default" ); - putSession( "custom", i18n("Custom"), false, "custom" ); putSession( "failsafe", i18n("Failsafe"), false, "failsafe" ); qBubbleSort( sessionTypes ); for (uint i = 0; i < sessionTypes.size() && !sessionTypes[i].hid; i++) { @@ -610,7 +608,6 @@ KGreeter::verifySetUser( const QString &user ) slotUserEntered(); } - KStdGreeter::KStdGreeter() : KGreeter() , clock( 0 ) diff --git a/kdm/kfrontend/sessions/kde.desktop.in b/kdm/kfrontend/sessions/kde.desktop.in index b032d395a..cf91472ae 100644 --- a/kdm/kfrontend/sessions/kde.desktop.in +++ b/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ஏற்றக் காவலன் diff --git a/kdm/kfrontend/sessions/matchbox.desktop b/kdm/kfrontend/sessions/matchbox.desktop index 8c6e2fd52..3bec343b0 100644 --- a/kdm/kfrontend/sessions/matchbox.desktop +++ b/kdm/kfrontend/sessions/matchbox.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=XSession -Exec=matchbox -TryExec=matchbox +Exec=matchbox-window-manager +TryExec=matchbox-window-manager Name=Matchbox Name[bn]=ম্যাচবক্স Name[eo]=Alumetujo diff --git a/kdm/kfrontend/sessions/olvwm.desktop b/kdm/kfrontend/sessions/olvwm.desktop index e181331bc..23dee1169 100644 --- a/kdm/kfrontend/sessions/olvwm.desktop +++ b/kdm/kfrontend/sessions/olvwm.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=XSession -Exec= -TryExec= +Exec=olvwm-x-window-manager +TryExec=olvwm-x-window-manager Name=OLVWM Name[br]=OVLWM Name[eo]=OLVFA diff --git a/kdm/kfrontend/sessions/olwm.desktop b/kdm/kfrontend/sessions/olwm.desktop index e3368af74..32612eaa3 100644 --- a/kdm/kfrontend/sessions/olwm.desktop +++ b/kdm/kfrontend/sessions/olwm.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=XSession -Exec=olwm -TryExec=olwm +Exec=olwm-x-window-manager +TryExec=olwm-x-window-manager Name=OLWM Name[eo]=OLFA Name[hi]=ओएलडबल्यूएम diff --git a/kdm/kfrontend/sessions/pwm.desktop b/kdm/kfrontend/sessions/pwm.desktop index 036c9bff4..5d967c0c0 100644 --- a/kdm/kfrontend/sessions/pwm.desktop +++ b/kdm/kfrontend/sessions/pwm.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=XSession -Exec=pwm -TryExec=pwm +Exec=pwm1 +TryExec=pwm1 Name=PWM Name[eo]=UnuFA Name[hi]=पीडबल्यूएम diff --git a/kdm/kfrontend/sessions/ude.desktop b/kdm/kfrontend/sessions/ude.desktop index fb451da1a..108a493e4 100644 --- a/kdm/kfrontend/sessions/ude.desktop +++ b/kdm/kfrontend/sessions/ude.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=XSession -Exec=ude -TryExec=ude +Exec=uwm +TryExec=uwm Name=UDE Name[eo]=ULĈ Name[hi]=यूडीई |