From: Kern Sibbald Date: Thu, 17 May 2007 10:55:00 +0000 (+0000) Subject: Move radio buttons to more intuitive location X-Git-Tag: Release-7.0.0~6326 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b825682d2bc97c3b9611b2a3b175d38d421851b2;p=bacula%2Fbacula Move radio buttons to more intuitive location git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4806 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/restore/prerestore.cpp b/bacula/src/qt-console/restore/prerestore.cpp index c16b07b14c..bca6c1e6c1 100644 --- a/bacula/src/qt-console/restore/prerestore.cpp +++ b/bacula/src/qt-console/restore/prerestore.cpp @@ -79,24 +79,27 @@ void prerestorePage::buildPage() beforeDateTime->setEnabled(false); selectFilesRadio->setChecked(true); if (m_dataInType == R_NONE) { - selectJobsRadio->setChecked(true); + selectJobRadio->setChecked(true); + selectJobIdsRadio->setChecked(false); jobIdEdit->setText("Comma separted list of jobs id's"); jobIdEdit->setEnabled(false); } else if (m_dataInType == R_JOBIDLIST) { - listJobsRadio->setChecked(true); + selectJobIdsRadio->setChecked(true); + selectJobRadio->setChecked(false); jobIdEdit->setText(m_dataIn); - jobsRadioClicked(false); + jobRadioClicked(false); QStringList fieldlist; jobdefsFromJob(fieldlist,m_dataIn); filesetCombo->setCurrentIndex(filesetCombo->findText(fieldlist[2], Qt::MatchExactly)); clientCombo->setCurrentIndex(clientCombo->findText(fieldlist[1], Qt::MatchExactly)); jobCombo->setCurrentIndex(jobCombo->findText(fieldlist[0], Qt::MatchExactly)); } else if (m_dataInType == R_JOBDATETIME) { - selectJobsRadio->setChecked(true); + selectJobRadio->setChecked(true); + selectJobIdsRadio->setChecked(false); jobIdEdit->setText("Comma separted list of jobs id's"); jobIdEdit->setEnabled(false); recentCheckBox->setCheckState(Qt::Unchecked); - jobsRadioClicked(true); + jobRadioClicked(true); QStringList fieldlist; jobdefsFromJob(fieldlist,m_dataIn); filesetCombo->setCurrentIndex(filesetCombo->findText(fieldlist[2], Qt::MatchExactly)); @@ -109,7 +112,8 @@ void prerestorePage::buildPage() connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed())); connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed())); connect(recentCheckBox, SIGNAL(stateChanged(int)), this, SLOT(recentChanged(int))); - connect(selectJobsRadio, SIGNAL(toggled(bool)), this, SLOT(jobsRadioClicked(bool))); + connect(selectJobRadio, SIGNAL(clicked(bool)), this, SLOT(jobRadioClicked(bool))); + connect(selectJobIdsRadio, SIGNAL(clicked(bool)), this, SLOT(jobidsRadioClicked(bool))); connect(jobIdEdit, SIGNAL(editingFinished()), this, SLOT(jobIdEditFinished())); dockPage(); @@ -124,7 +128,7 @@ void prerestorePage::buildPage() */ void prerestorePage::okButtonPushed() { - if (!selectJobsRadio->isChecked()) { + if (!selectJobRadio->isChecked()) { if (!checkJobIdList()) return; } @@ -135,7 +139,7 @@ void prerestorePage::okButtonPushed() cmd = QString("restore"); cmd += " fileset=\"" + filesetCombo->currentText() + "\""; cmd += " client=\"" + clientCombo->currentText() + "\""; - if (selectJobsRadio->isChecked()) { + if (selectJobRadio->isChecked()) { if (poolCombo->currentText() != "Any" ){ cmd += " pool=\"" + poolCombo->currentText() + "\""; } @@ -151,7 +155,7 @@ void prerestorePage::okButtonPushed() cmd += " jobid=\"" + jobIdEdit->text() + "\""; } if (selectFilesRadio->isChecked()) { - if (!listJobsRadio->isChecked()) + if (!selectJobIdsRadio->isChecked()) cmd += " select"; } else { cmd += " all done"; @@ -208,41 +212,13 @@ void prerestorePage::job_name_change(int index) */ void prerestorePage::recentChanged(int state) { - if ((state == Qt::Unchecked) && (selectJobsRadio->isChecked())) { + if ((state == Qt::Unchecked) && (selectJobRadio->isChecked())) { beforeDateTime->setEnabled(true); } else { beforeDateTime->setEnabled(false); } } -/* - * Handle the change of enabled of input widgets when the job radio buttons - * are changed. - */ -void prerestorePage::jobsRadioClicked(bool checked) -{ - if (checked) { - jobCombo->setEnabled(true); - filesetCombo->setEnabled(true); - clientCombo->setEnabled(true); - poolCombo->setEnabled(true); - storageCombo->setEnabled(true); - recentCheckBox->setEnabled(true); - if (!recentCheckBox->isChecked()) { - beforeDateTime->setEnabled(true); - } - jobIdEdit->setEnabled(false); - } else { - jobCombo->setEnabled(false); - filesetCombo->setEnabled(false); - clientCombo->setEnabled(false); - poolCombo->setEnabled(false); - storageCombo->setEnabled(false); - recentCheckBox->setEnabled(false); - beforeDateTime->setEnabled(false); - jobIdEdit->setEnabled(true); - } -} /* * For when jobs list is to be used, return a list which is the needed items from @@ -335,3 +311,69 @@ bool prerestorePage::checkJobIdList() } return true; } + +/* + * Handle the change of enabled of input widgets when the job radio buttons + * are changed. + */ +void prerestorePage::jobRadioClicked(bool checked) +{ + if (checked) { + jobCombo->setEnabled(true); + filesetCombo->setEnabled(true); + clientCombo->setEnabled(true); + poolCombo->setEnabled(true); + storageCombo->setEnabled(true); + recentCheckBox->setEnabled(true); + if (!recentCheckBox->isChecked()) { + beforeDateTime->setEnabled(true); + } + jobIdEdit->setEnabled(false); + selectJobRadio->setChecked(true); + selectJobIdsRadio->setChecked(false); + } else { + jobCombo->setEnabled(false); + filesetCombo->setEnabled(false); + clientCombo->setEnabled(false); + poolCombo->setEnabled(false); + storageCombo->setEnabled(false); + recentCheckBox->setEnabled(false); + beforeDateTime->setEnabled(false); + jobIdEdit->setEnabled(true); + selectJobRadio->setChecked(false); + selectJobIdsRadio->setChecked(true); + } + Dmsg2(200, "jobRadio=%d jobidsRadio=%d\n", selectJobRadio->isChecked(), + selectJobIdsRadio->isChecked()); +} + +void prerestorePage::jobidsRadioClicked(bool checked) +{ + if (checked) { + jobCombo->setEnabled(false); + filesetCombo->setEnabled(false); + clientCombo->setEnabled(false); + poolCombo->setEnabled(false); + storageCombo->setEnabled(false); + recentCheckBox->setEnabled(false); + beforeDateTime->setEnabled(false); + jobIdEdit->setEnabled(true); + selectJobRadio->setChecked(false); + selectJobIdsRadio->setChecked(true); + } else { + jobCombo->setEnabled(true); + filesetCombo->setEnabled(true); + clientCombo->setEnabled(true); + poolCombo->setEnabled(true); + storageCombo->setEnabled(true); + recentCheckBox->setEnabled(true); + if (!recentCheckBox->isChecked()) { + beforeDateTime->setEnabled(true); + } + jobIdEdit->setEnabled(false); + selectJobRadio->setChecked(true); + selectJobIdsRadio->setChecked(false); + } + Dmsg2(200, "jobRadio=%d jobidsRadio=%d\n", selectJobRadio->isChecked(), + selectJobIdsRadio->isChecked()); +} diff --git a/bacula/src/qt-console/restore/prerestore.ui b/bacula/src/qt-console/restore/prerestore.ui index 96876736f5..5f375b2ea0 100644 --- a/bacula/src/qt-console/restore/prerestore.ui +++ b/bacula/src/qt-console/restore/prerestore.ui @@ -6,7 +6,7 @@ 0 0 589 - 458 + 897 @@ -22,59 +22,7 @@ 6 - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 93 - 301 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - + 0 @@ -82,57 +30,14 @@ 6 - - - - Before: - - - beforeDateTime - - - - - - - - - - Pool: - - - poolCombo - - - - - - - - 2000 - 1 - 1 - - - - yyyy-mm-dd h:mm:ss - - - true - - - - - + + QFrame::NoFrame QFrame::Plain - - 0 - 0 @@ -140,33 +45,20 @@ 6 - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + - Select Jobs + All Files false - - + + - List Jobs + Select Files false @@ -186,262 +78,333 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + - - - - - - - - - - Job: - - - jobCombo - - - - - - - - - - Qt::RightToLeft + + + + 0 - - Use Most Recent + + 6 - + + + + + 7 + 0 + 0 + 0 + + + + + 600 + 600 + + + + + + + + Job + + + + + + + + + + JobIds + + + + - + - Qt::Horizontal + Qt::Vertical + + + QSizePolicy::Fixed - 221 - 20 + 20 + 21 - - - - Storage: - - - storageCombo - - - - - - JobIds: - - - jobCombo - - - - - - - File Set: - - - filesetCombo - - - - - - - - 7 - 0 - 0 - 0 - - - - - 600 - 600 - - - - - - + 0 6 - - - - Qt::Horizontal + + + + + 2000 + 1 + 1 + - - - 171 - 20 - + + yyyy-mm-dd h:mm:ss - + + true + + - - + + + + Qt::LeftToRight + - OK + Use Most Recent - - + + - Cancel + File Set: + + + filesetCombo - - - - - - - - - 0 - - - 6 - - - - - Qt::Horizontal + + + + Client: - - - 71 - 21 - + + clientCombo - + - - - - - 16777215 - 30 - + + + + + + + Storage: + + + storageCombo + + + + + + + + + + Before: + + beforeDateTime + + + + + + + + - <h3>Select Jobs</h3> + Pool: + + + poolCombo - + + + + Qt::Horizontal - 81 - 20 + 262 + 21 + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 171 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + + - - - - QFrame::NoFrame + + + + + + Qt::Vertical + + + + 71 + 41 + + + + + + + + Qt::Vertical + + + + 387 + 161 + + + + + + + + Qt::Horizontal + + + + 41 + 139 + + + + + + + + Qt::Horizontal + + + + 21 + 139 + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal - - QFrame::Plain + + + 71 + 21 + - - - 0 - - - 6 - - - - - All Files - - - false - - - - - - - Select Files - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + - - - - Client: + + + + + 16777215 + 30 + - - clientCombo + + <h3>Select Jobs</h3> + + + + Qt::Horizontal + + + + 81 + 20 + + + + diff --git a/bacula/src/qt-console/restore/restore.h b/bacula/src/qt-console/restore/restore.h index 39150a3cc8..7fe23641b3 100644 --- a/bacula/src/qt-console/restore/restore.h +++ b/bacula/src/qt-console/restore/restore.h @@ -63,7 +63,8 @@ private slots: void cancelButtonPushed(); void job_name_change(int index); void recentChanged(int); - void jobsRadioClicked(bool); + void jobRadioClicked(bool); + void jobidsRadioClicked(bool); void jobIdEditFinished(); private: