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:
parent
26ce55a738
commit
9606247f8a
1 changed files with 6 additions and 3 deletions
9
main.cpp
9
main.cpp
|
@ -96,7 +96,7 @@ class AlternativeWMDialog : public KDialog
|
||||||
public:
|
public:
|
||||||
AlternativeWMDialog() : KDialog()
|
AlternativeWMDialog() : KDialog()
|
||||||
{
|
{
|
||||||
setButtons( KDialog::Ok );
|
setButtons( KDialog::Ok | KDialog::Cancel );
|
||||||
|
|
||||||
QWidget* mainWidget = new QWidget( this );
|
QWidget* mainWidget = new QWidget( this );
|
||||||
QVBoxLayout* layout = new QVBoxLayout( mainWidget );
|
QVBoxLayout* layout = new QVBoxLayout( mainWidget );
|
||||||
|
@ -160,8 +160,11 @@ Application::Application( )
|
||||||
{
|
{
|
||||||
// Something has gone seriously wrong
|
// Something has gone seriously wrong
|
||||||
AlternativeWMDialog dialog;
|
AlternativeWMDialog dialog;
|
||||||
dialog.exec();
|
QString cmd = "kwin";
|
||||||
QString cmd = dialog.selectedWM();
|
if( dialog.exec() == KDialog::Ok )
|
||||||
|
{
|
||||||
|
cmd = dialog.selectedWM();
|
||||||
|
}
|
||||||
if( cmd.length() > 500 )
|
if( cmd.length() > 500 )
|
||||||
{
|
{
|
||||||
kDebug() << "Command is too long, truncating";
|
kDebug() << "Command is too long, truncating";
|
||||||
|
|
Loading…
Reference in a new issue