summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-16 21:26:13 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-09-16 21:26:13 +0000
commitda658e720570ba6f38b7607831c80fc9364b2787 (patch)
tree2d620b3fa606037788e2c4ae2d2a9373f2f75e71
parent7b1017d0013a2900b82cdf36bd2a9ef387c9aec5 (diff)
downloadtdebase-da658e720570ba6f38b7607831c80fc9364b2787.tar.gz
tdebase-da658e720570ba6f38b7607831c80fc9364b2787.zip
Fix KDM shutdown dialog not appearing under Debian
Fix kdmtsak failure on tsak daemon exit git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1254046 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--kdm/kfrontend/kdmshutdown.cpp34
-rw-r--r--kdmlib/kdmtsak.cpp7
2 files changed, 26 insertions, 15 deletions
diff --git a/kdm/kfrontend/kdmshutdown.cpp b/kdm/kfrontend/kdmshutdown.cpp
index 9222f69ee..692a15a3e 100644
--- a/kdm/kfrontend/kdmshutdown.cpp
+++ b/kdm/kfrontend/kdmshutdown.cpp
@@ -57,6 +57,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <stdlib.h>
+extern bool has_kwin;
+
int KDMShutdownBase::curPlugin = -1;
PluginList KDMShutdownBase::pluginList;
@@ -242,6 +244,8 @@ doShutdown( int type, const char *os )
KDMShutdown::KDMShutdown( int _uid, TQWidget *_parent )
: inherited( _uid, _parent )
{
+ setCaption(i18n("Shutdown TDE"));
+
TQSizePolicy fp( TQSizePolicy::Fixed, TQSizePolicy::Fixed );
TQHBoxLayout *hlay = new TQHBoxLayout( box, KDsh );
@@ -466,20 +470,23 @@ KDMSlimShutdown::KDMSlimShutdown( TQWidget *_parent )
: inherited( _parent )
, targetList( 0 )
{
+ setCaption(i18n("Shutdown TDE"));
bool doUbuntuLogout = KConfigGroup(KGlobal::config(), "Shutdown").readBoolEntry("doUbuntuLogout", false);
- TQVBoxLayout* vbox = new TQVBoxLayout( this );
- TQHBoxLayout *hbox = new TQHBoxLayout( this, KDmh, KDsh );
TQFrame* lfrm = new TQFrame( this );
TQHBoxLayout* hbuttonbox;
if(doUbuntuLogout)
- {
- lfrm->setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised );
+ {
+ TQVBoxLayout* vbox = new TQVBoxLayout( this );
+ if (has_kwin)
+ lfrm->setFrameStyle( TQFrame::NoFrame );
+ else
+ lfrm->setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised );
lfrm->setLineWidth( tqstyle().tqpixelMetric( TQStyle::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
+ // gets too small if there all options are not available
lfrm->setMinimumSize(300,120);
vbox->addWidget( lfrm );
vbox = new TQVBoxLayout( lfrm, 2 * KDialog::marginHint(),
@@ -536,14 +543,19 @@ KDMSlimShutdown::KDMSlimShutdown( TQWidget *_parent )
// Back to kdm
KSMPushButton* btnBack = new KSMPushButton( KStdGuiItem::cancel(), lfrm );
hbuttonbox2->addWidget( btnBack );
- connect(btnBack, TQT_SIGNAL(clicked()), TQT_SLOT(reject()));
-
-
+ connect(btnBack, TQT_SIGNAL(clicked()), TQT_SLOT(reject()));
}
else
{
- lfrm->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
+ TQHBoxLayout *hbox = new TQHBoxLayout( this, KDmh, KDsh );
+ if (has_kwin)
+ lfrm->setFrameStyle( TQFrame::NoFrame );
+ else
+ lfrm->setFrameStyle( TQFrame::Panel | TQFrame::Sunken );
hbox->addWidget( lfrm, AlignCenter );
+ // we need to set the minimum size for the logout box, since it
+ // gets too small if there all options are not available
+ lfrm->setMinimumSize(300,120);
TQLabel *icon = new TQLabel( lfrm );
icon->setPixmap( TQPixmap( locate( "data", "kdm/pics/shutdown.jpg" ) ) );
TQVBoxLayout *iconlay = new TQVBoxLayout( lfrm );
@@ -603,9 +615,7 @@ KDMSlimShutdown::KDMSlimShutdown( TQWidget *_parent )
buttonlay->addWidget( btnBack );
connect( btnBack, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) );
- buttonlay->addSpacing( KDialog::spacingHint() );
-
-
+ buttonlay->addSpacing( KDialog::spacingHint() );
}
}
diff --git a/kdmlib/kdmtsak.cpp b/kdmlib/kdmtsak.cpp
index e1ed9ddc9..967e54855 100644
--- a/kdmlib/kdmtsak.cpp
+++ b/kdmlib/kdmtsak.cpp
@@ -40,18 +40,19 @@ int main (int argc, char *argv[])
}
// Now wait for SAK press
mPipe_fd = open(FIFO_FILE, O_RDONLY);
- if (mPipe_fd > -1) {
+ while (mPipe_fd > -1) {
numread = read(mPipe_fd, readbuf, 6);
readbuf[numread] = 0;
readbuf[127] = 0;
- close(mPipe_fd);
if (strcmp(readbuf, "SAK\n\r") == 0) {
+ close(mPipe_fd);
return 0;
}
else {
- return 1;
+ usleep(100);
}
}
+ close(mPipe_fd);
return 6;
}
else {