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
v3.5.13-sru
tpearson 13 years ago
parent 7b1017d001
commit da658e7205

@ -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)
{
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(),
@ -537,13 +544,18 @@ KDMSlimShutdown::KDMSlimShutdown( TQWidget *_parent )
KSMPushButton* btnBack = new KSMPushButton( KStdGuiItem::cancel(), lfrm );
hbuttonbox2->addWidget( btnBack );
connect(btnBack, TQT_SIGNAL(clicked()), TQT_SLOT(reject()));
}
else
{
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 );
@ -604,8 +616,6 @@ KDMSlimShutdown::KDMSlimShutdown( TQWidget *_parent )
connect( btnBack, TQT_SIGNAL(clicked()), TQT_SLOT(reject()) );
buttonlay->addSpacing( KDialog::spacingHint() );
}
}

@ -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 {

Loading…
Cancel
Save