SOURCES: kdebase-branch.diff - updated; fixes kde bug 121087
arekm
arekm at pld-linux.org
Fri Feb 3 10:03:07 CET 2006
Author: arekm Date: Fri Feb 3 09:03:07 2006 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- updated; fixes kde bug 121087
---- Files affected:
SOURCES:
kdebase-branch.diff (1.24 -> 1.25)
---- Diffs:
================================================================
Index: SOURCES/kdebase-branch.diff
diff -u SOURCES/kdebase-branch.diff:1.24 SOURCES/kdebase-branch.diff:1.25
--- SOURCES/kdebase-branch.diff:1.24 Sat Jan 21 23:55:02 2006
+++ SOURCES/kdebase-branch.diff Fri Feb 3 10:03:00 2006
@@ -1,53270 +1,3074 @@
-Index: ksmserver/shutdown.h
-===================================================================
---- ksmserver/shutdown.h (.../tags/KDE/3.5.0/kdebase) (revision 501051)
-+++ ksmserver/shutdown.h (.../branches/KDE/3.5/kdebase) (revision 501051)
-@@ -1,87 +0,0 @@
--/*****************************************************************
--ksmserver - the KDE session management server
--
--Copyright (C) 2000 Matthias Ettrich <ettrich at kde.org>
--******************************************************************/
--
--#ifndef SHUTDOWN_H
--#define SHUTDOWN_H
--
--#include <qpixmap.h>
--#include <qdialog.h>
--#include <kpushbutton.h>
--class QPushButton;
--class QVButtonGroup;
--class QPopupMenu;
--class QTimer;
--
--#include <kapplication.h>
--
--// The (singleton) widget that makes the desktop gray.
--class KSMShutdownFeedback : public QWidget
--{
-- Q_OBJECT
--
--public:
-- static void start() { s_pSelf = new KSMShutdownFeedback(); s_pSelf->show(); }
-- static void stop() { delete s_pSelf; s_pSelf = 0L; }
-- static KSMShutdownFeedback * self() { return s_pSelf; }
--
--protected:
-- ~KSMShutdownFeedback() {}
--
--private slots:
-- void slotPaintEffect();
--
--private:
-- static KSMShutdownFeedback * s_pSelf;
-- KSMShutdownFeedback();
-- int m_currentY;
--};
--
--
--// The confirmation dialog
--class KSMShutdownDlg : public QDialog
--{
-- Q_OBJECT
--
--public:
-- static bool confirmShutdown( bool maysd, KApplication::ShutdownType& sdtype, QString& bopt );
--
--public slots:
-- void slotLogout();
-- void slotHalt();
-- void slotReboot();
-- void slotReboot(int);
--
--protected:
-- ~KSMShutdownDlg() {};
--
--private:
-- KSMShutdownDlg( QWidget* parent, bool maysd, KApplication::ShutdownType sdtype );
-- KApplication::ShutdownType m_shutdownType;
-- QString m_bootOption;
-- QPopupMenu *targets;
-- QStringList rebootOptions;
--};
--
--class KSMDelayedPushButton : public KPushButton
--{
-- Q_OBJECT
--
--public:
--
-- KSMDelayedPushButton( const KGuiItem &item, QWidget *parent, const char *name = 0 );
-- void setPopup( QPopupMenu *pop);
--
--private slots:
-- void slotTimeout();
-- void slotPressed();
-- void slotReleased();
--
--private:
-- QPopupMenu *pop;
-- QTimer *popt;
--};
--
--#endif
-Index: ksmserver/shutdowndlg.cpp
-===================================================================
---- ksmserver/shutdowndlg.cpp (.../tags/KDE/3.5.0/kdebase) (revision 0)
-+++ ksmserver/shutdowndlg.cpp (.../branches/KDE/3.5/kdebase) (revision 501051)
-@@ -0,0 +1,273 @@
-+/*****************************************************************
-+ksmserver - the KDE session management server
-+
-+Copyright (C) 2000 Matthias Ettrich <ettrich at kde.org>
-+******************************************************************/
-+
-+#include <config.h>
-+
-+#include "shutdowndlg.h"
-+#include <qapplication.h>
-+#include <qlayout.h>
-+#include <qgroupbox.h>
-+#include <qvbuttongroup.h>
-+#include <qlabel.h>
-+#include <qvbox.h>
-+#include <qtimer.h>
-+#include <qstyle.h>
-+#include <qcombobox.h>
-+#include <qcursor.h>
-+#include <qmessagebox.h>
-+#include <qbuttongroup.h>
-+#include <qiconset.h>
-+#include <qpopupmenu.h>
-+#include <qtooltip.h>
-+
-+#include <klocale.h>
-+#include <kapplication.h>
-+#include <kdebug.h>
-+#include <kpushbutton.h>
-+#include <kstdguiitem.h>
-+#include <kiconloader.h>
-+#include <kglobalsettings.h>
-+#include <kwin.h>
-+#include <kuser.h>
-+#include <kpixmap.h>
-+#include <kpixmapeffect.h>
-+#include <kdialog.h>
-+#include <kseparator.h>
-+
-+#include <sys/types.h>
-+#include <sys/utsname.h>
-+#include <unistd.h>
-+#include <stdlib.h>
-+#include <dmctl.h>
-+
-+#include <X11/Xlib.h>
-+
-+#include "shutdowndlg.moc"
-+
-+KSMShutdownFeedback * KSMShutdownFeedback::s_pSelf = 0L;
-+
-+KSMShutdownFeedback::KSMShutdownFeedback()
-+ : QWidget( 0L, "feedbackwidget", WType_Popup ),
-+ m_currentY( 0 )
-+{
-+ setBackgroundMode( QWidget::NoBackground );
-+ setGeometry( QApplication::desktop()->geometry() );
-+ QTimer::singleShot( 10, this, SLOT( slotPaintEffect() ) );
-+ m_root.resize( width(), height() );
-+}
-+
-+
-+void KSMShutdownFeedback::slotPaintEffect()
-+{
-+ if ( m_currentY >= height() ) {
-+ if ( backgroundMode() == QWidget::NoBackground ) {
-+ setBackgroundMode( QWidget::NoBackground );
-+ setBackgroundPixmap( m_root );
-+ }
-+ return;
-+ }
-+
-+ KPixmap pixmap;
-+ pixmap = QPixmap::grabWindow( qt_xrootwin(), 0, m_currentY, width(), 10 );
-+ pixmap = KPixmapEffect::fade( pixmap, 0.4, Qt::black );
-+ pixmap = KPixmapEffect::toGray( pixmap, true );
-+ bitBlt( this, 0, m_currentY, &pixmap );
-+ bitBlt( &m_root, 0, m_currentY, &pixmap );
-+ m_currentY += 10;
-+ QTimer::singleShot( 1, this, SLOT( slotPaintEffect() ) );
-+}
-+
-+//////
-+
-+KSMShutdownDlg::KSMShutdownDlg( QWidget* parent,
-+ bool maysd, KApplication::ShutdownType sdtype )
-+ : QDialog( parent, 0, TRUE, WType_Popup ), targets(0)
-+ // this is a WType_Popup on purpose. Do not change that! Not
-+ // having a popup here has severe side effects.
-+{
-+ QVBoxLayout* vbox = new QVBoxLayout( this );
-+ QFrame* frame = new QFrame( this );
-+ frame->setFrameStyle( QFrame::StyledPanel | QFrame::Raised );
-+ frame->setLineWidth( style().pixelMetric( QStyle::PM_DefaultFrameWidth, frame ) );
-+ vbox->addWidget( frame );
-+ vbox = new QVBoxLayout( frame, 2 * KDialog::marginHint(),
-+ 2 * KDialog::spacingHint() );
-+
-+ QLabel* label = new QLabel( i18n("End Session for \"%1\"").arg(KUser().loginName()), frame );
-+ QFont fnt = label->font();
-+ fnt.setBold( true );
-+ fnt.setPointSize( fnt.pointSize() * 3 / 2 );
-+ label->setFont( fnt );
-+ vbox->addWidget( label, 0, AlignHCenter );
-+
-+ QHBoxLayout* hbox = new QHBoxLayout( vbox, 2 * KDialog::spacingHint() );
-+
-+ // konqy
-+ QFrame* lfrm = new QFrame( frame );
-+ lfrm->setFrameStyle( QFrame::Panel | QFrame::Sunken );
-+ hbox->addWidget( lfrm, AlignCenter );
-+
-+ QLabel* icon = new QLabel( lfrm );
-+ icon->setPixmap( UserIcon( "shutdownkonq" ) );
-+ lfrm->setFixedSize( icon->sizeHint());
-+ icon->setFixedSize( icon->sizeHint());
-+
-+ // right column (buttons)
-+ QVBoxLayout* buttonlay = new QVBoxLayout( hbox, 2 * KDialog::spacingHint() );
-+ buttonlay->setAlignment( Qt::AlignHCenter );
-+
-+ buttonlay->addStretch( 1 );
-+
-+ // End session
-+ KPushButton* btnLogout = new KPushButton( KGuiItem( i18n("&End Current Session"), "undo"), frame );
-+ QFont btnFont = btnLogout->font();
-+ buttonlay->addWidget( btnLogout );
-+ connect(btnLogout, SIGNAL(clicked()), SLOT(slotLogout()));
-+
-+ if (maysd) {
-+
-+ // Shutdown
-+ KPushButton* btnHalt = new KPushButton( KGuiItem( i18n("&Turn Off Computer"), "exit"), frame );
-+ btnHalt->setFont( btnFont );
-+ buttonlay->addWidget( btnHalt );
-+ connect(btnHalt, SIGNAL(clicked()), SLOT(slotHalt()));
-+ if ( sdtype == KApplication::ShutdownTypeHalt )
-+ btnHalt->setFocus();
-+
-+ // Reboot
-+ KSMDelayedPushButton* btnReboot = new KSMDelayedPushButton( KGuiItem( i18n("&Restart Computer"), "reload"), frame );
-+ btnReboot->setFont( btnFont );
-+ buttonlay->addWidget( btnReboot );
-+
-+ connect(btnReboot, SIGNAL(clicked()), SLOT(slotReboot()));
-+ if ( sdtype == KApplication::ShutdownTypeReboot )
-+ btnReboot->setFocus();
-+
-+ int def, cur;
-+ if ( DM().bootOptions( rebootOptions, def, cur ) ) {
-+ targets = new QPopupMenu( frame );
-+ if ( cur == -1 )
-+ cur = def;
-+
-+ int index = 0;
-+ for (QStringList::ConstIterator it = rebootOptions.begin(); it != rebootOptions.end(); ++it, ++index)
-+ {
-+ if (index == cur)
-+ targets->insertItem( *it + i18n("current option in boot loader", " (current)"), index);
-+ else
-+ targets->insertItem( *it, index );
-+ }
-+
-+ btnReboot->setPopup(targets);
-+ connect( targets, SIGNAL(activated(int)), SLOT(slotReboot(int)) );
-+ }
-+ }
-+
-+ buttonlay->addStretch( 1 );
-+
-+ // Separator
-+ buttonlay->addWidget( new KSeparator( frame ) );
-+
-+ // Back to Desktop
-+ KPushButton* btnBack = new KPushButton( KStdGuiItem::cancel(), frame );
-+ buttonlay->addWidget( btnBack );
-+ connect(btnBack, SIGNAL(clicked()), SLOT(reject()));
-+
-+}
-+
-+
-+void KSMShutdownDlg::slotLogout()
-+{
-+ m_shutdownType = KApplication::ShutdownTypeNone;
-+ accept();
-+}
-+
-+
-+void KSMShutdownDlg::slotReboot()
-+{
-+ // no boot option selected -> current
-+ m_bootOption = QString::null;
-+ m_shutdownType = KApplication::ShutdownTypeReboot;
-+ accept();
-+}
-+
-+void KSMShutdownDlg::slotReboot(int opt)
-+{
-+ if (int(rebootOptions.size()) > opt)
-+ m_bootOption = rebootOptions[opt];
-+ m_shutdownType = KApplication::ShutdownTypeReboot;
-+ accept();
-+}
-+
-+
-+void KSMShutdownDlg::slotHalt()
-+{
-+ m_bootOption = QString::null;
-+ m_shutdownType = KApplication::ShutdownTypeHalt;
-+ accept();
-+}
-+
-+
-+bool KSMShutdownDlg::confirmShutdown( bool maysd, KApplication::ShutdownType& sdtype, QString& bootOption )
-+{
-+ kapp->enableStyles();
-+ KSMShutdownDlg* l = new KSMShutdownDlg( 0,
-+ //KSMShutdownFeedback::self(),
-+ maysd, sdtype );
-+
-+ // Show dialog (will save the background in showEvent)
-+ QSize sh = l->sizeHint();
-+ QRect rect = KGlobalSettings::desktopGeometry(QCursor::pos());
-+
-+ l->move(rect.x() + (rect.width() - sh.width())/2,
-+ rect.y() + (rect.height() - sh.height())/2);
-+ bool result = l->exec();
-+ sdtype = l->m_shutdownType;
-+ bootOption = l->m_bootOption;
-+
-+ delete l;
-+
-+ kapp->disableStyles();
-+ return result;
-+}
-+
-+KSMDelayedPushButton::KSMDelayedPushButton( const KGuiItem &item,
-+ QWidget *parent,
-+ const char *name)
-+ : KPushButton( item, parent, name), pop(0), popt(0)
-+{
-+ connect(this, SIGNAL(pressed()), SLOT(slotPressed()));
-+ connect(this, SIGNAL(released()), SLOT(slotReleased()));
-+ popt = new QTimer(this);
-+ connect(popt, SIGNAL(timeout()), SLOT(slotTimeout()));
-+}
-+
-+void KSMDelayedPushButton::setPopup(QPopupMenu *p)
-+{
-+ pop = p;
-+ setIsMenuButton(p != 0);
-+}
-+
-+void KSMDelayedPushButton::slotPressed()
-+{
-+ if (pop)
-+ popt->start(QApplication::startDragTime());
-+}
-+
-+void KSMDelayedPushButton::slotReleased()
-+{
-+ popt->stop();
-+}
-+
-+void KSMDelayedPushButton::slotTimeout()
-+{
-+ QPoint bl = mapToGlobal(rect().bottomLeft());
-+ QWidget *par = (QWidget*)parent();
-+ QPoint br = par->mapToGlobal(par->rect().bottomRight());
-+ pop->popup( bl );
-+ popt->stop();
-+ setDown(false);
-+}
-
-Property changes on: ksmserver/shutdowndlg.cpp
-___________________________________________________________________
-Name: svn:mime-type
- + text/x-c++src
-Name: svn:keywords
- + Author Date Id Revision
-Name: svn:eol-style
- + native
-
-Index: ksmserver/startup.cpp
-===================================================================
---- ksmserver/startup.cpp (.../tags/KDE/3.5.0/kdebase) (revision 0)
-+++ ksmserver/startup.cpp (.../branches/KDE/3.5/kdebase) (revision 501051)
-@@ -0,0 +1,289 @@
-+/*****************************************************************
-+ksmserver - the KDE session management server
-+
-+Copyright (C) 2000 Matthias Ettrich <ettrich at kde.org>
-+Copyright (C) 2005 Lubos Lunak <l.lunak at kde.org>
-+
-+relatively small extensions by Oswald Buddenhagen <ob6 at inf.tu-dresden.de>
-+
-+some code taken from the dcopserver (part of the KDE libraries), which is
-+Copyright (c) 1999 Matthias Ettrich <ettrich at kde.org>
-+Copyright (c) 1999 Preston Brown <pbrown at kde.org>
-+
-+Permission is hereby granted, free of charge, to any person obtaining a copy
-+of this software and associated documentation files (the "Software"), to deal
-+in the Software without restriction, including without limitation the rights
-+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-+copies of the Software, and to permit persons to whom the Software is
-+furnished to do so, subject to the following conditions:
-+
-+The above copyright notice and this permission notice shall be included in
-+all copies or substantial portions of the Software.
-+
-+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-+AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-+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.
-+
-+******************************************************************/
-+
-+
-+#ifdef HAVE_CONFIG_H
-+#include <config.h>
-+#endif
-+
-+#include <pwd.h>
-+#include <sys/types.h>
-+#include <sys/param.h>
-+#include <sys/stat.h>
-+#ifdef HAVE_SYS_TIME_H
-+#include <sys/time.h>
-+#endif
-+#include <sys/socket.h>
-+#include <sys/un.h>
-+
-+#include <unistd.h>
-+#include <stdlib.h>
-+#include <signal.h>
-+#include <time.h>
-+#include <errno.h>
-+#include <string.h>
-+#include <assert.h>
-+
-+#ifdef HAVE_LIMITS_H
-+#include <limits.h>
-+#endif
-+
-+#include <qfile.h>
-+#include <qtextstream.h>
-+#include <qdatastream.h>
-+#include <qptrstack.h>
-+#include <qpushbutton.h>
-+#include <qmessagebox.h>
-+#include <qguardedptr.h>
-+#include <qtimer.h>
-+
-+#include <klocale.h>
-+#include <kglobal.h>
-+#include <kconfig.h>
-+#include <kstandarddirs.h>
-+#include <unistd.h>
-+#include <kapplication.h>
-+#include <kstaticdeleter.h>
-+#include <ktempfile.h>
-+#include <kprocess.h>
-+#include <dcopclient.h>
-+#include <dcopref.h>
-+#include <kwinmodule.h>
-+#include <knotifyclient.h>
-+
-+#include "server.h"
-+#include "global.h"
-+#include "client.h"
-+
-+#include <kdebug.h>
-+
-+/*! Restores the previous session. Ensures the window manager is
-+ running (if specified).
-+ */
-+void KSMServer::restoreSession( QString sessionName )
-+{
-+ kdDebug( 1218 ) << "KSMServer::restoreSession " << sessionName << endl;
-+ upAndRunning( "restore session");
-+ KConfig* config = KGlobal::config();
-+
-+ sessionGroup = "Session: " + sessionName;
-+
-+ 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 );
-+ connectDCOPSignal( launcher, launcher, "autoStartDone()",
-+ "restoreSessionInternal()", true);
-+ connectDCOPSignal( launcher, launcher, "autoStart2Done()",
-+ "restoreSessionDoneInternal()", 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( autoStart() ) );
-+ } else {
-+ autoStart();
-+ }
-+}
-+
-+/*!
-+ Starts the default session.
-+
-+ Currently, that's the window manager only (if specified).
-+ */
-+void KSMServer::startDefaultSession()
-+{
-+ sessionGroup = "";
-+ publishProgress( 0, true );
-+ upAndRunning( "ksmserver" );
-+ connectDCOPSignal( launcher, launcher, "autoStartDone()",
-+ "autoStart2()", true);
-+ connectDCOPSignal( launcher, launcher, "autoStart2Done()",
-+ "restoreSessionDoneInternal()", true);
-+ startApplication( wm );
-+ QTimer::singleShot( 4000, this, SLOT( autoStart() ) );
-+}
-+
-+
-+void KSMServer::autoStart()
-+{
-+ static bool beenThereDoneThat = false;
-+ if ( beenThereDoneThat )
-+ return;
-+ beenThereDoneThat = true;
-+ DCOPRef( launcher ).send( "autoStart", (int) 1 );
-+}
-+
-+void KSMServer::autoStart2()
-+{
-+ static bool beenThereDoneThat = false;
-+ if ( beenThereDoneThat )
-+ return;
-+ beenThereDoneThat = true;
-+ DCOPRef( launcher ).send( "autoStart", (int) 2 );
-+}
-+
-+
-+void KSMServer::clientSetProgram( KSMClient* client )
-+{
-+ if ( !wm.isEmpty() && client->program() == wm )
-+ autoStart();
-+}
-+
-+void KSMServer::clientRegistered( const char* previousId )
-+{
-+ if ( previousId && lastIdStarted == previousId )
-+ tryRestoreNext();
-+}
-+
-+
-+void KSMServer::suspendStartup()
-+{
-+ ++startupSuspendCount;
-+}
-+
-+void KSMServer::resumeStartup()
-+{
-+ if( startupSuspendCount > 0 ) {
-+ --startupSuspendCount;
-+ if( startupSuspendCount == 0 && startupSuspendTimeoutTimer.isActive())
-+ restoreNext();
-+ }
-+}
-+
-+void KSMServer::startupSuspendTimeout()
-+{
-+ kdDebug( 1218 ) << "Startup suspend timeout" << endl;
-+ startupSuspendCount = 0;
-+ restoreNext();
-+}
-+
-+void KSMServer::restoreSessionInternal()
<<Diff was trimmed, longer than 597 lines>>
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/kdebase-branch.diff?r1=1.24&r2=1.25&f=u
More information about the pld-cvs-commit
mailing list