Add cancel button to alternative wm dialog and start kwin again unless Ok is pressed

svn path=/trunk/KDE/kdebase/workspace/; revision=717824
This commit is contained in:
Rivo Laks 2007-09-27 16:45:48 +00:00
parent 26ce55a738
commit 9606247f8a

View file

@ -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";