[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    [PATCH] ksmserver
From:       Martijn Klingens <mklingens () yahoo ! com>
Date:       2002-01-29 20:56:41
[Download RAW message or body]

Hiya,

Attached patch makes the ksmserver logout dialog look more like KDialogBase, 
i.e. use KPushButton and have a horizontal line above the buttons. It also 
makes 'make check' actually compile.

As the patch itself is pretty much trivial I'd probably commit right away, 
save for one thing: I needed to add '$(LIB_KDEUI)' to the Makefile.am, which 
I don't consider trivial. Is there a reason for ksmserver not using kdeui, or 
is it safe to commit this? It seems to work fine here, but I don't know if 
that sais a lot...

Martijn

["ksmserver.diff" (text/x-diff)]

Index: Makefile.am
===================================================================
RCS file: /home/kde/kdebase/ksmserver/Makefile.am,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile.am
--- Makefile.am	2002/01/15 12:24:01	1.12
+++ Makefile.am	2002/01/29 20:52:28
@@ -30,14 +30,14 @@ ksmserver_SOURCES = dummy.cpp
 
 ksmserver_la_LDFLAGS = $(all_libraries) -avoid-version -module
 ksmserver_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-ksmserver_la_LIBADD = $(LIB_KDECORE)
+ksmserver_la_LIBADD = $(LIB_KDECORE) $(LIB_KDEUI)
 ksmserver_LDADD = ksmserver.la
 
 check_PROGRAMS = testsh
 testsh_SOURCES = test.cpp shutdown.cpp
 
 testsh_LDFLAGS = $(all_libraries) $(KDE_RPATH)
-testsh_LDADD = $(LIB_KDECORE)
+testsh_LDADD = $(LIB_KDECORE) $(LIB_KDEUI)
 
 messages:
 	$(XGETTEXT) *.cpp -o $(podir)/ksmserver.pot
Index: shutdown.cpp
===================================================================
RCS file: /home/kde/kdebase/ksmserver/shutdown.cpp,v
retrieving revision 1.18
diff -u -p -r1.18 shutdown.cpp
--- shutdown.cpp	2002/01/04 22:44:59	1.18
+++ shutdown.cpp	2002/01/29 20:52:29
@@ -13,7 +13,6 @@ Copyright (C) 2000 Matthias Ettrich <ett
 #include <qcheckbox.h>
 #include <qradiobutton.h>
 #include <qvbuttongroup.h>
-#include <qpushbutton.h>
 #include <qlabel.h>
 #include <qvbox.h>
 #include <qpainter.h>
@@ -24,6 +23,8 @@ Copyright (C) 2000 Matthias Ettrich <ett
 #include <klocale.h>
 #include <kapplication.h>
 #include <kdebug.h>
+#include <kpushbutton.h>
+#include <kstdguiitem.h>
 #include <kwin.h>
 
 #include <X11/Xlib.h>
@@ -111,17 +112,22 @@ KSMShutdownDlg::KSMShutdownDlg( QWidget*
     vbox->addWidget( checkbox, 0, AlignLeft  );
     vbox->addStretch();
 
+    QFrame *line = new QFrame( frame );
+    line->setFrameShape( QFrame::HLine );
+    line->setFrameShadow( QFrame::Sunken );
+    vbox->addWidget( line );
+
     QHBoxLayout* hbox = new QHBoxLayout( vbox );
     hbox->addStretch();
-    QPushButton* yes = new QPushButton(maysd ? i18n("&OK") : i18n("&Logout"), frame );
+    KGuiItem logoutItem( i18n( "&Logout" ), "exit" );
+    KPushButton* yes = new KPushButton( maysd ? KStdGuiItem::ok() : logoutItem,
+                                        frame );
     connect( yes, SIGNAL( clicked() ), SLOT( accept() ) );
     yes->setDefault( TRUE );
     hbox->addWidget( yes );
-    hbox->addStretch();
-    QPushButton* cancel = new QPushButton(i18n("&Cancel"), frame );
+    KPushButton* cancel = new KPushButton( KStdGuiItem::cancel(), frame );
     connect( cancel, SIGNAL( clicked() ), SLOT( reject() ) );
     hbox->addWidget( cancel );
-    hbox->addStretch();
 
     QTimer::singleShot( 0, this, SLOT( requestFocus() ) );
     checkbox->setFocus();
Index: test.cpp
===================================================================
RCS file: /home/kde/kdebase/ksmserver/test.cpp,v
retrieving revision 1.2
diff -u -p -r1.2 test.cpp
--- test.cpp	2001/12/29 17:25:04	1.2
+++ test.cpp	2002/01/29 20:52:29
@@ -14,6 +14,9 @@ main(int argc, char *argv[])
    QObject::connect( KSMShutdownFeedback::self(), SIGNAL( aborted() ), &a, SLOT( quit() ) );
 
    bool saveSession;
-   (void)KSMShutdownDlg::confirmShutdown( saveSession );
+    KApplication::ShutdownType sdtype = KApplication::ShutdownTypeNone;
+    KApplication::ShutdownMode sdmode = KApplication::ShutdownModeDefault;
+   (void)KSMShutdownDlg::confirmShutdown( saveSession, false, false,
+        sdtype, sdmode );
    a.exec();
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic