From 9606247f8a46a5e239dbc2c7cbb216d09c4de3bc Mon Sep 17 00:00:00 2001 From: Rivo Laks Date: Thu, 27 Sep 2007 16:45:48 +0000 Subject: [PATCH] Add cancel button to alternative wm dialog and start kwin again unless Ok is pressed svn path=/trunk/KDE/kdebase/workspace/; revision=717824 --- main.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 1c87f866a8..7de377536e 100644 --- a/main.cpp +++ b/main.cpp @@ -96,7 +96,7 @@ class AlternativeWMDialog : public KDialog public: AlternativeWMDialog() : KDialog() { - setButtons( KDialog::Ok ); + setButtons( KDialog::Ok | KDialog::Cancel ); QWidget* mainWidget = new QWidget( this ); QVBoxLayout* layout = new QVBoxLayout( mainWidget ); @@ -160,8 +160,11 @@ Application::Application( ) { // Something has gone seriously wrong AlternativeWMDialog dialog; - dialog.exec(); - QString cmd = dialog.selectedWM(); + QString cmd = "kwin"; + if( dialog.exec() == KDialog::Ok ) + { + cmd = dialog.selectedWM(); + } if( cmd.length() > 500 ) { kDebug() << "Command is too long, truncating";