GUI: Improve Settings-dialog layout.

This commit is contained in:
Kimmo Varis 2009-06-04 17:20:01 +03:00
parent c9ceccfd3d
commit 0fe601a1c9
1 changed files with 3 additions and 11 deletions

View File

@ -42,6 +42,7 @@ SettingsDialog::SettingsDialog(QSettings &programSettings, ApplicationList &list
//Add a layout for ok/cancel buttons //Add a layout for ok/cancel buttons
QHBoxLayout *buttonLayout = new QHBoxLayout(); QHBoxLayout *buttonLayout = new QHBoxLayout();
buttonLayout->addStretch();
buttonLayout->addWidget(ok); buttonLayout->addWidget(ok);
buttonLayout->addWidget(cancel); buttonLayout->addWidget(cancel);
//Add button layout to the main dialog layout //Add button layout to the main dialog layout
@ -53,18 +54,15 @@ SettingsDialog::SettingsDialog(QSettings &programSettings, ApplicationList &list
connect(cancel, SIGNAL(clicked()), connect(cancel, SIGNAL(clicked()),
this, SLOT(reject())); this, SLOT(reject()));
//Begin adding tabs and tab content //Begin adding tabs and tab content
//General tab //General tab
QWidget *general = new QWidget(); QWidget *general = new QWidget();
tabs->addTab(general, tr("General")); tabs->addTab(general, tr("General"));
//layout for general tab //layout for general tab
QVBoxLayout *layout = new QVBoxLayout(); QVBoxLayout *layout = new QVBoxLayout();
//Number of jobs //Number of jobs
QHBoxLayout *jobsLayout = new QHBoxLayout(); QHBoxLayout *jobsLayout = new QHBoxLayout();
mJobs = new QLineEdit(programSettings.value(tr("Check threads"), 1).toString()); mJobs = new QLineEdit(programSettings.value(tr("Check threads"), 1).toString());
@ -73,8 +71,6 @@ SettingsDialog::SettingsDialog(QSettings &programSettings, ApplicationList &list
jobsLayout->addWidget(new QLabel(tr("Number of threads: "))); jobsLayout->addWidget(new QLabel(tr("Number of threads: ")));
jobsLayout->addWidget(mJobs); jobsLayout->addWidget(mJobs);
layout->addLayout(jobsLayout); layout->addLayout(jobsLayout);
//Force //Force
@ -88,6 +84,7 @@ SettingsDialog::SettingsDialog(QSettings &programSettings, ApplicationList &list
tr("Show full path"), tr("Show full path"),
false); false);
layout->addStretch();
general->setLayout(layout); general->setLayout(layout);
//Add tab for setting user startable applications //Add tab for setting user startable applications
@ -125,12 +122,10 @@ SettingsDialog::SettingsDialog(QSettings &programSettings, ApplicationList &list
mListWidget->setSortingEnabled(false); mListWidget->setSortingEnabled(false);
PopulateListWidget(); PopulateListWidget();
//report tab //report tab
QWidget *report = new QWidget(); QWidget *report = new QWidget();
tabs->addTab(report, tr("Reports")); tabs->addTab(report, tr("Reports"));
QVBoxLayout *reportlayout = new QVBoxLayout(); QVBoxLayout *reportlayout = new QVBoxLayout();
mSaveAllErrors = AddCheckbox(reportlayout, mSaveAllErrors = AddCheckbox(reportlayout,
tr("Save all errors when creating report"), tr("Save all errors when creating report"),
@ -141,8 +136,8 @@ SettingsDialog::SettingsDialog(QSettings &programSettings, ApplicationList &list
tr("Save full path to files in reports"), tr("Save full path to files in reports"),
tr("Save full path"), tr("Save full path"),
false); false);
reportlayout->addStretch();
report->setLayout(reportlayout); report->setLayout(reportlayout);
setLayout(dialoglayout); setLayout(dialoglayout);
setWindowTitle(tr("Settings")); setWindowTitle(tr("Settings"));
LoadSettings(); LoadSettings();
@ -298,6 +293,3 @@ bool SettingsDialog::SaveAllErrors()
{ {
return CheckStateToBool(mSaveAllErrors->checkState()); return CheckStateToBool(mSaveAllErrors->checkState());
} }