Make the custom executable dialog only resizable in the width

This commit is contained in:
dt
2010-03-29 16:19:09 +02:00
parent c0e2370fb1
commit 255206db6b

View File

@@ -340,14 +340,18 @@ QString CustomExecutableRunConfiguration::executable() const
if (m_executable.isEmpty() || !QFileInfo(exec).exists()) { if (m_executable.isEmpty() || !QFileInfo(exec).exists()) {
// Oh the executable doesn't exists, ask the user. // Oh the executable doesn't exists, ask the user.
QWidget *confWidget = const_cast<CustomExecutableRunConfiguration *>(this)->configurationWidget(); QWidget *confWidget = const_cast<CustomExecutableRunConfiguration *>(this)->configurationWidget();
confWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
QDialog dialog(Core::ICore::instance()->mainWindow()); QDialog dialog(Core::ICore::instance()->mainWindow());
dialog.setLayout(new QVBoxLayout()); dialog.setLayout(new QVBoxLayout());
dialog.layout()->addWidget(new QLabel(tr("Could not find the executable, please specify one."))); QLabel *label = new QLabel(tr("Could not find the executable, please specify one."));
label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
dialog.layout()->addWidget(label);
dialog.layout()->addWidget(confWidget); dialog.layout()->addWidget(confWidget);
QDialogButtonBox *dbb = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox *dbb = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(dbb, SIGNAL(accepted()), &dialog, SLOT(accept())); connect(dbb, SIGNAL(accepted()), &dialog, SLOT(accept()));
connect(dbb, SIGNAL(rejected()), &dialog, SLOT(reject())); connect(dbb, SIGNAL(rejected()), &dialog, SLOT(reject()));
dialog.layout()->addWidget(dbb); dialog.layout()->addWidget(dbb);
dialog.layout()->setSizeConstraint(QLayout::SetMinAndMaxSize);
QString oldExecutable = m_executable; QString oldExecutable = m_executable;
QString oldWorkingDirectory = m_workingDirectory; QString oldWorkingDirectory = m_workingDirectory;
@@ -367,6 +371,7 @@ QString CustomExecutableRunConfiguration::executable() const
return exec; return exec;
} }
LocalApplicationRunConfiguration::RunMode CustomExecutableRunConfiguration::runMode() const LocalApplicationRunConfiguration::RunMode CustomExecutableRunConfiguration::runMode() const
{ {
return m_runMode; return m_runMode;