diff --git a/shell/launchconfigurationdialog.cpp b/shell/launchconfigurationdialog.cpp --- a/shell/launchconfigurationdialog.cpp +++ b/shell/launchconfigurationdialog.cpp @@ -70,7 +70,6 @@ splitter->setSizes(QList() << 260 << 620); addConfig->setIcon( QIcon::fromTheme(QStringLiteral("list-add")) ); - addConfig->setEnabled( false ); addConfig->setToolTip(i18nc("@info:tooltip", "Add a new launch configuration.")); deleteConfig->setIcon( QIcon::fromTheme(QStringLiteral("list-remove")) ); deleteConfig->setEnabled( false ); @@ -183,6 +182,12 @@ m->addAction(action); } addConfig->setMenu(m); + addConfig->setEnabled( !m->isEmpty() ); + + messageWidget->setCloseButtonVisible( false ); + messageWidget->setMessageType( KMessageWidget::Warning ); + messageWidget->setText( i18n("No launch configurations available. (Is any of the Execute plugins loaded?)") ); + messageWidget->setVisible( m->isEmpty() ); connect(debugger, static_cast(&QComboBox::currentIndexChanged), this, &LaunchConfigurationDialog::launchModeChanged); @@ -361,14 +366,14 @@ tab->setLaunchConfiguration( l ); stack->setCurrentWidget( tab ); - addConfig->setEnabled( true ); + addConfig->setEnabled( addConfig->menu() && !addConfig->menu()->isEmpty() ); deleteConfig->setEnabled( true ); debugger->setVisible( false ); debugLabel->setVisible( false ); } } else { - addConfig->setEnabled( true ); + addConfig->setEnabled( addConfig->menu() && !addConfig->menu()->isEmpty() ); deleteConfig->setEnabled( false ); stack->setCurrentIndex( 0 ); QLabel* l = new QLabel(i18n("Select a configuration to edit from the left,
" diff --git a/shell/launchconfigurationdialog.ui b/shell/launchconfigurationdialog.ui --- a/shell/launchconfigurationdialog.ui +++ b/shell/launchconfigurationdialog.ui @@ -133,14 +133,25 @@ + + + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + KMessageWidget + QFrame +
kmessagewidget.h
+ 1 +
+