From 0f036827212b939ce66c799b15e93771d07732ab Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Sun, 6 May 2007 13:27:14 +0000 Subject: [PATCH] Moved dialogs to be pages on the stack. label, run and runcmd. All still have buttons and show up in the page selector as a direct descendent of the director widget. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4711 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/TODO | 2 + bacula/src/qt-console/console/console.cpp | 2 +- bacula/src/qt-console/label/label.cpp | 36 +- bacula/src/qt-console/label/label.h | 14 +- bacula/src/qt-console/label/label.ui | 277 +++---- bacula/src/qt-console/mainwin.cpp | 14 +- bacula/src/qt-console/mainwin.h | 4 +- bacula/src/qt-console/pages.cpp | 2 +- bacula/src/qt-console/restore/prerestore.cpp | 25 +- bacula/src/qt-console/restore/prerestore.ui | 271 ++++--- bacula/src/qt-console/restore/restore.cpp | 14 +- bacula/src/qt-console/restore/restore.h | 6 +- bacula/src/qt-console/restore/restore.ui | 719 +++++++++---------- bacula/src/qt-console/run/run.cpp | 35 +- bacula/src/qt-console/run/run.h | 22 +- bacula/src/qt-console/run/run.ui | 663 +++++++++-------- bacula/src/qt-console/run/runcmd.cpp | 23 +- bacula/src/qt-console/run/runcmd.ui | 670 ++++++++--------- bacula/src/qt-console/storage/storage.cpp | 2 +- 19 files changed, 1460 insertions(+), 1341 deletions(-) diff --git a/bacula/src/qt-console/TODO b/bacula/src/qt-console/TODO index 09334799d0..07027166ef 100644 --- a/bacula/src/qt-console/TODO +++ b/bacula/src/qt-console/TODO @@ -1,5 +1,7 @@ dhb ==================================================== +Test left pane of restore with 2 windows drives in one backup job. + Color code Media Red->Error Append->green Full/Used->Yellow Resolve issue of connection during restore selection. Could go with preempt of diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index a1d7b27aff..94d4cffc96 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -575,7 +575,7 @@ int Console::read() new selectDialog(this); break; case BNET_RUN_CMD: - new runCmdDialog(this); + new runCmdPage(); break; case BNET_ERROR_MSG: m_sock->recv(); /* get the message */ diff --git a/bacula/src/qt-console/label/label.cpp b/bacula/src/qt-console/label/label.cpp index 9f5556c8c7..6185c5ba62 100644 --- a/bacula/src/qt-console/label/label.cpp +++ b/bacula/src/qt-console/label/label.cpp @@ -27,7 +27,7 @@ */ /* - * Label Dialog class + * Label Page class * * Kern Sibbald, February MMVII * @@ -37,40 +37,48 @@ #include "label.h" #include -labelDialog::labelDialog(Console *console) +labelPage::labelPage() { QString deflt(""); - showDialog(console, deflt); + m_closeable = false; + showPage(deflt); } /* * An overload of the constructor to have a default storage show in the * combobox on start. Used from context sensitive in storage class. */ -labelDialog::labelDialog(Console *console, QString &defString) +labelPage::labelPage(QString &defString) { - showDialog(console, defString); + m_closeable = true; + showPage(defString); } /* * moved the constructor code here for the overload. */ -void labelDialog::showDialog(Console *console, QString &defString) +void labelPage::showPage(QString &defString) { - m_console = console; - m_console->notify(false); + m_name = "Label"; + pgInitialize(); setupUi(this); - storageCombo->addItems(console->storage_list); + m_console->notify(false); + + storageCombo->addItems(m_console->storage_list); int index = storageCombo->findText(defString, Qt::MatchExactly); if (index != -1) { storageCombo->setCurrentIndex(index); } - poolCombo->addItems(console->pool_list); + poolCombo->addItems(m_console->pool_list); + connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed())); + connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed())); + dockPage(); + setCurrent(); this->show(); } -void labelDialog::accept() +void labelPage::okButtonPushed() { QString scmd; if (volumeName->text().toUtf8().data()[0] == 0) { @@ -89,14 +97,14 @@ void labelDialog::accept() m_console->write_dir(scmd.toUtf8().data()); m_console->displayToPrompt(); m_console->notify(true); - delete this; + closeStackPage(); mainWin->resetFocus(); } -void labelDialog::reject() +void labelPage::cancelButtonPushed() { this->hide(); m_console->notify(true); - delete this; + closeStackPage(); mainWin->resetFocus(); } diff --git a/bacula/src/qt-console/label/label.h b/bacula/src/qt-console/label/label.h index 533d109a69..ac97c8f7fd 100644 --- a/bacula/src/qt-console/label/label.h +++ b/bacula/src/qt-console/label/label.h @@ -35,22 +35,22 @@ #include #include "ui_label.h" #include "console.h" +#include "pages.h" -class labelDialog : public QDialog, public Ui::labelForm +class labelPage : public Pages, public Ui::labelForm { Q_OBJECT public: - labelDialog(Console *console); - labelDialog(Console *console, QString &defString); - void showDialog(Console *console, QString &defString); + labelPage(); + labelPage(QString &defString); + void showPage(QString &defString); private slots: - void accept(); - void reject(); + void okButtonPushed(); + void cancelButtonPushed(); private: - Console *m_console; }; #endif /* _LABEL_H_ */ diff --git a/bacula/src/qt-console/label/label.ui b/bacula/src/qt-console/label/label.ui index a627f5c376..cc245bd957 100644 --- a/bacula/src/qt-console/label/label.ui +++ b/bacula/src/qt-console/label/label.ui @@ -1,80 +1,25 @@ labelForm - - - Qt::WindowModal - + 0 0 - 400 - 300 + 498 + 308 - Label + Form - + 9 6 - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - - 71 - 21 - - - - - - - - - 16777215 - 30 - - - - <html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Label a Volume</span></p></body></html> - - - - - - - Qt::Horizontal - - - - 81 - 20 - - - - - - - + Qt::Vertical @@ -84,13 +29,26 @@ p, li { white-space: pre-wrap; } - 20 - 10 + 351 + 20 - + + + + Qt::Horizontal + + + + 40 + 131 + + + + + 0 @@ -98,34 +56,126 @@ p, li { white-space: pre-wrap; } 6 - + 10000 + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 71 + 21 + + + + + + + + + 16777215 + 30 + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Label a Volume</span></p></body></html> + + + + + + + Qt::Horizontal + + + + 81 + 20 + + + + + + + + + - + - Pool: + Storage: - poolCombo + storageCombo - - + + - Storage: + Slot: - storageCombo + slotSpin - + @@ -136,94 +186,61 @@ p, li { white-space: pre-wrap; } - + - + - Volume Name: + Pool: - volumeName + poolCombo - - - - + - Slot: + Volume Name: - slotSpin + volumeName - + - Qt::Vertical - - - QSizePolicy::Maximum + Qt::Horizontal - 21 - 16 + 40 + 121 - - + + - Qt::Horizontal + Qt::Vertical - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + QSizePolicy::Maximum - + + + 331 + 20 + + + - - - buttonBox - accepted() - labelForm - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - labelForm - reject() - - - 316 - 260 - - - 286 - 274 - - - - + diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index a11c38a5d3..68e2d81ce2 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -265,8 +265,8 @@ void MainWin::createConnections() connect(stackedWidget, SIGNAL(currentChanged(int)), this, SLOT(stackItemChanged(int))); connect(actionQuit, SIGNAL(triggered()), app, SLOT(closeAllWindows())); - connect(actionLabel, SIGNAL(triggered()), this, SLOT(labelDialogClicked())); - connect(actionRun, SIGNAL(triggered()), this, SLOT(runDialogClicked())); + connect(actionLabel, SIGNAL(triggered()), this, SLOT(labelButtonClicked())); + connect(actionRun, SIGNAL(triggered()), this, SLOT(runButtonClicked())); connect(actionRestore, SIGNAL(triggered()), this, SLOT(restoreButtonClicked())); connect(actionUndock, SIGNAL(triggered()), this, SLOT(undockWindowButton())); connect(actionToggleDock, SIGNAL(triggered()), this, SLOT(toggleDockContextWindow())); @@ -431,19 +431,19 @@ void MainWin::treeItemChanged(QTreeWidgetItem *currentitem, QTreeWidgetItem *pre } } -void MainWin::labelDialogClicked() +void MainWin::labelButtonClicked() { - new labelDialog(m_currentConsole); + new labelPage(); } -void MainWin::runDialogClicked() +void MainWin::runButtonClicked() { - new runDialog(m_currentConsole); + new runPage(); } void MainWin::restoreButtonClicked() { - new prerestorePage(m_currentConsole); + new prerestorePage(); } /* diff --git a/bacula/src/qt-console/mainwin.h b/bacula/src/qt-console/mainwin.h index 6a659ffc9f..19da0df74f 100644 --- a/bacula/src/qt-console/mainwin.h +++ b/bacula/src/qt-console/mainwin.h @@ -78,8 +78,8 @@ public slots: void input_line(); void about(); void treeItemClicked(QTreeWidgetItem *item, int column); - void labelDialogClicked(); - void runDialogClicked(); + void labelButtonClicked(); + void runButtonClicked(); void restoreButtonClicked(); void undockWindowButton(); void treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *); diff --git a/bacula/src/qt-console/pages.cpp b/bacula/src/qt-console/pages.cpp index efee0781cf..592649e632 100644 --- a/bacula/src/qt-console/pages.cpp +++ b/bacula/src/qt-console/pages.cpp @@ -135,7 +135,7 @@ void Pages::closeEvent(QCloseEvent* event) /* Set the current tree widget item in the Page Selector window to the item * which represents "this" */ - setCurrent(); + setCurrent(); } /* diff --git a/bacula/src/qt-console/restore/prerestore.cpp b/bacula/src/qt-console/restore/prerestore.cpp index 43897d769b..a1a8423ecb 100644 --- a/bacula/src/qt-console/restore/prerestore.cpp +++ b/bacula/src/qt-console/restore/prerestore.cpp @@ -39,26 +39,19 @@ #include "restore.h" -prerestorePage::prerestorePage(Console *console) +prerestorePage::prerestorePage() { - console->notify(false); m_name = "Pre-Restore"; setupUi(this); - QTreeWidgetItem *parent = mainWin->getFromHash(console); - if (!parent) { - /* ***FIXME*** */ - printf("Error retrieving tree widget."); - return; - } - pgInitialize(parent); + pgInitialize(); + m_console->notify(false); m_closeable = true; - jobCombo->addItems(console->job_list); - filesetCombo->addItems(console->fileset_list); - clientCombo->addItems(console->client_list); - poolCombo->addItems(console->pool_list); - storageCombo->addItems(console->storage_list); - //beforeDateTime->setDate(QDateTime::currentDateTime().toUTC().date()); + jobCombo->addItems(m_console->job_list); + filesetCombo->addItems(m_console->fileset_list); + clientCombo->addItems(m_console->client_list); + poolCombo->addItems(m_console->pool_list); + storageCombo->addItems(m_console->storage_list); beforeDateTime->setDateTime(QDateTime::currentDateTime()); beforeDateTime->setEnabled(false); job_name_change(0); @@ -90,7 +83,7 @@ void prerestorePage::okButtonPushed() m_console->write(cmd); m_console->display_text(cmd); /* Note, do not turn notifier back on here ... */ - new restorePage(m_console); + new restorePage(); closeStackPage(); } diff --git a/bacula/src/qt-console/restore/prerestore.ui b/bacula/src/qt-console/restore/prerestore.ui index 98218744ab..b230563350 100644 --- a/bacula/src/qt-console/restore/prerestore.ui +++ b/bacula/src/qt-console/restore/prerestore.ui @@ -5,8 +5,8 @@ 0 0 - 561 - 408 + 578 + 406 @@ -19,33 +19,7 @@ 6 - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - + Qt::Horizontal @@ -58,7 +32,7 @@ - + Qt::Horizontal @@ -74,22 +48,65 @@ - 8 + 0 6 + + + - + - Pool: + File Set: - poolCombo + filesetCombo - + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 171 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + Client: @@ -99,46 +116,82 @@ - - + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 71 + 21 + + + + + + + + + 16777215 + 30 + + + + <h3>Pre - Restore</h3> + + + + + + + Qt::Horizontal + + + + 81 + 20 + + + + + - - + + + + Pool: + + + poolCombo + + - + - - - - - - - 2000 - 1 - 1 - - - - yyyy-mm-dd h:mm:ss - - - true - - + - - + + - File Set: + Before: - filesetCombo + beforeDateTime - + Job: @@ -148,27 +201,24 @@ - - - - Storage: - - - storageCombo + + + + + 2000 + 1 + 1 + - - - - - - Before: + + yyyy-mm-dd h:mm:ss - - beforeDateTime + + true - + @@ -186,45 +236,44 @@ - - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - - 171 - 20 - - - - - - + + - OK + Storage: - - - - - - Cancel + + storageCombo + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + diff --git a/bacula/src/qt-console/restore/restore.cpp b/bacula/src/qt-console/restore/restore.cpp index 4cdb7470fe..b6e8f8d36d 100644 --- a/bacula/src/qt-console/restore/restore.cpp +++ b/bacula/src/qt-console/restore/restore.cpp @@ -38,19 +38,13 @@ #include "bat.h" #include "restore.h" -restorePage::restorePage(Console *console) +restorePage::restorePage() { QStringList titles; setupUi(this); - QTreeWidgetItem *parent = mainWin->getFromHash(console); - if (!parent) { - /* Make this a user configurable stdout msg *** FIXME ****/ - printf("Error retrieving tree widget."); - return; - } - m_name = "Restore"; - pgInitialize(parent); + m_name = "Restore Select"; + pgInitialize(); m_console->notify(false); /* this should already be off */ m_closeable = true; @@ -72,8 +66,6 @@ restorePage::restorePage(Console *console) get_cwd(); - //QString root(""); - //addDirectory(root); fillDirectory(); dockPage(); setCurrent(); diff --git a/bacula/src/qt-console/restore/restore.h b/bacula/src/qt-console/restore/restore.h index 1eab7e45b4..c4eabc69aa 100644 --- a/bacula/src/qt-console/restore/restore.h +++ b/bacula/src/qt-console/restore/restore.h @@ -40,8 +40,6 @@ #include "ui_restore.h" #include "ui_prerestore.h" -class Console; - /* * The pre-restore dialog selects the Job/Client to be restored * It really could use considerable enhancement. @@ -51,7 +49,7 @@ class prerestorePage : public Pages, public Ui::prerestoreForm Q_OBJECT public: - prerestorePage(Console *parent); + prerestorePage(); private slots: void okButtonPushed(); @@ -71,7 +69,7 @@ class restorePage : public Pages, public Ui::restoreForm Q_OBJECT public: - restorePage(Console *parent); + restorePage(); void fillDirectory(); char *get_cwd(); bool cwd(const char *); diff --git a/bacula/src/qt-console/restore/restore.ui b/bacula/src/qt-console/restore/restore.ui index 27682cd971..ed4af5bcbc 100644 --- a/bacula/src/qt-console/restore/restore.ui +++ b/bacula/src/qt-console/restore/restore.ui @@ -5,8 +5,8 @@ 0 0 - 824 - 660 + 689 + 504 @@ -20,6 +20,130 @@ 6 + + + Qt::Horizontal + + + + + 5 + 7 + 1 + 1 + + + + + 200 + 0 + + + + + 16777215 + 16777215 + + + + + 1 + 0 + + + + + 50 + 0 + + + + true + + + 1 + + + + 1 + + + + + + + 7 + 5 + 144 + 1 + + + + + 400 + 0 + + + + + 0 + 0 + + + + true + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::ScrollPerItem + + + true + + + 7 + + + + 1 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + + 0 @@ -28,31 +152,135 @@ 6 - + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 50 + 30 + + + + + + + + <h2>Directories</h2> + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 16 + 30 + + + + + + + + + 16777215 + 15 + + + + <h3>Restore Select</h3> + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 16 + 20 + + + + + + - 0 - 5 + 5 + 0 0 0 + + + 35 + 0 + + - Current Dir: + Up - - lineEdit + + :images/up.png - + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 16 + 20 + + + + + + + + + 5 + 0 + 0 + 0 + + - 100 + 35 0 + + Mark + + + :images/mark.png + @@ -61,33 +289,79 @@ Qt::Horizontal - QSizePolicy::Fixed + QSizePolicy::Expanding - 30 - 32 + 16 + 20 - + + + + 5 + 0 + 0 + 0 + + + + + 50 + 0 + + - Cancel + Unmark + + + :images/unmark.png - + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 61 + 20 + + + + + + - OK + <h2>Files</h2> + + + + Qt::Horizontal + + + + 100 + 30 + + + + - + 0 @@ -127,350 +401,73 @@ - - - - Qt::Horizontal + + + + 0 - - - - 0 - - - 6 - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 50 - 30 - - - - - - - - <h2>Directories</h2> - - - - - - - Qt::Horizontal - - - QSizePolicy::Preferred - - - - 50 - 30 - - - - - - - - - - - 5 - 7 - 1 - 1 - - - - - 60 - 0 - - - - - 16777215 - 16777215 - - - - - 1 - 0 - - - - - 50 - 0 - - - - true - - - 1 - - - - 1 - - - - - - - - - - 0 - - - 6 - - - - - 0 - - - 6 - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 16 - 20 - - - - - - - - - 5 - 0 - 0 - 0 - - - - Up - - - :images/up.png - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 16 - 20 - - - - - - - - - 5 - 0 - 0 - 0 - - - - Mark - - - :images/mark.png - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 16 - 20 - - - - - - - - - 5 - 0 - 0 - 0 - - - - Unmark - - - :images/unmark.png - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 61 - 20 - - - - - - - - <h2>Files</h2> - - - - - - - Qt::Horizontal - - - - 100 - 30 - - - - - - - - - - - 7 - 5 - 144 - 1 - - - - - 400 - 0 - - - - - 0 - 0 - - - - true - - - QAbstractItemView::ExtendedSelection - - - QAbstractItemView::ScrollPerItem - - - true - - - 7 - - - - 1 - - - - - 1 - - - - - 2 - - - - - 3 - - - - - 4 - - - - - 5 - - - - - 6 - - - - - - - + + 6 + + + + + + 0 + 5 + 0 + 0 + + + + Current Dir: + + + lineEdit + + + + + + + + 100 + 0 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 30 + 32 + + + + + + + + Cancel + + + + + + + OK + + + + diff --git a/bacula/src/qt-console/run/run.cpp b/bacula/src/qt-console/run/run.cpp index 2124c0bdd2..35e654e0a1 100644 --- a/bacula/src/qt-console/run/run.cpp +++ b/bacula/src/qt-console/run/run.cpp @@ -40,27 +40,34 @@ /* * Setup all the combo boxes and display the dialog */ -runDialog::runDialog(Console *console) +runPage::runPage() { QDateTime dt; - m_console = console; - m_console->notify(false); + m_name = "Run"; + pgInitialize(); setupUi(this); + m_console->notify(false); + m_console->beginNewCommand(); - jobCombo->addItems(console->job_list); - filesetCombo->addItems(console->fileset_list); - levelCombo->addItems(console->level_list); - clientCombo->addItems(console->client_list); - poolCombo->addItems(console->pool_list); - storageCombo->addItems(console->storage_list); + jobCombo->addItems(m_console->job_list); + filesetCombo->addItems(m_console->fileset_list); + levelCombo->addItems(m_console->level_list); + clientCombo->addItems(m_console->client_list); + poolCombo->addItems(m_console->pool_list); + storageCombo->addItems(m_console->storage_list); dateTimeEdit->setDateTime(dt.currentDateTime()); job_name_change(0); connect(jobCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(job_name_change(int))); + connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed())); + connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed())); + + dockPage(); + setCurrent(); this->show(); } -void runDialog::accept() +void runPage::okButtonPushed() { char cmd[1000]; @@ -83,17 +90,17 @@ void runDialog::accept() m_console->display_text(cmd); m_console->displayToPrompt(); m_console->notify(true); - delete this; + closeStackPage(); mainWin->resetFocus(); } -void runDialog::reject() +void runPage::cancelButtonPushed() { mainWin->set_status(" Canceled"); this->hide(); m_console->notify(true); - delete this; + closeStackPage(); mainWin->resetFocus(); } @@ -102,7 +109,7 @@ void runDialog::reject() * We load the default values for the new job in the * other combo boxes. */ -void runDialog::job_name_change(int index) +void runPage::job_name_change(int index) { job_defaults job_defs; diff --git a/bacula/src/qt-console/run/run.h b/bacula/src/qt-console/run/run.h index 5628331992..9a8796aba8 100644 --- a/bacula/src/qt-console/run/run.h +++ b/bacula/src/qt-console/run/run.h @@ -7,38 +7,34 @@ #include "ui_runcmd.h" #include "console.h" -class runDialog : public QDialog, public Ui::runForm +class runPage : public Pages, public Ui::runForm { Q_OBJECT public: - runDialog(Console *console); + runPage(); public slots: - void accept(); - void reject(); + void okButtonPushed(); + void cancelButtonPushed(); void job_name_change(int index); private: - Console *m_console; - }; -class runCmdDialog : public QDialog, public Ui::runCmdForm +class runCmdPage : public Pages, public Ui::runCmdForm { Q_OBJECT public: - runCmdDialog(Console *console); + runCmdPage(); public slots: - void accept(); - void reject(); + void okButtonPushed(); + void cancelButtonPushed(); private: - void fillRunDialog(); - - Console *m_console; + void fill(); }; diff --git a/bacula/src/qt-console/run/run.ui b/bacula/src/qt-console/run/run.ui index 87c16237b3..02679a1deb 100644 --- a/bacula/src/qt-console/run/run.ui +++ b/bacula/src/qt-console/run/run.ui @@ -1,93 +1,70 @@ runForm - - - Qt::WindowModal - + 0 0 - 590 - 393 + 777 + 429 - Run Dialog + Form - + 9 6 - - - - 0 + + + + Qt::Horizontal - - 6 + + + 40 + 20 + - - - - Qt::Horizontal - - - - 71 - 21 - - - - - - - - - 16777215 - 30 - - - - <h3>Run a Job</h3> - - - - - - - Qt::Horizontal - - - - 81 - 20 - - - - - + + + + + + Qt::Vertical + + + QSizePolicy::Expanding + + + + 351 + 16 + + + - + Qt::Vertical - QSizePolicy::Maximum + QSizePolicy::Expanding - 572 + 351 16 - + 0 @@ -95,283 +72,333 @@ 6 - - - - Type: - - - typeCombo - - - - - - - Messages: - - - messagesCombo - - - - - - - Qt::Vertical - - - - 20 - 171 - - - - - - - - - - - - - - When: - - - dateTimeEdit - - - - - - - FileSet: - - - filesetCombo - - - - - - - false - - - - 200 - 0 - - - - false - - - - - - - - 0 - 2 - 0 - 2000 - 1 - 1 - - - - yyyy-mm-dd hh:mm:ss - - - true - - - - - - - 10000 - - - 1 - - - 10 - - - - - - - - - - - - - - - - Pool: - - - poolCombo - - - - - - - Bootstrap: - - - true - - - bootstrap - - - - - - - - 5 - 0 - 0 - 0 - - - - - 150 - 0 - - - - - - - - Client: - - - clientCombo - - - - - - Job: - - - jobCombo - - + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 71 + 21 + + + + + + + + + 16777215 + 30 + + + + <h3>Run a Job</h3> + + + + + + + Qt::Horizontal + + + + 81 + 20 + + + + + - - - - Storage: - - - storageCombo - - + + + + 0 + + + 6 + + + + + Type: + + + typeCombo + + + + + + + Messages: + + + messagesCombo + + + + + + + Qt::Vertical + + + + 20 + 171 + + + + + + + + + + + + + + When: + + + dateTimeEdit + + + + + + + FileSet: + + + filesetCombo + + + + + + + false + + + + 200 + 0 + + + + false + + + + + + + + 0 + 2 + 0 + 2000 + 1 + 1 + + + + yyyy-mm-dd hh:mm:ss + + + true + + + + + + + 10000 + + + 1 + + + 10 + + + + + + + + + + + + + + + + Pool: + + + poolCombo + + + + + + + Bootstrap: + + + true + + + bootstrap + + + + + + + + 5 + 0 + 0 + 0 + + + + + 150 + 0 + + + + + + + + Client: + + + clientCombo + + + + + + + Job: + + + jobCombo + + + + + + + Storage: + + + storageCombo + + + + + + + Level: + + + levelCombo + + + + + + + Priority: + + + prioritySpin + + + + + + + + + + - - - Level: - - - levelCombo - - - - - - - Priority: - - - prioritySpin - - - - - - - - + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + - + - Qt::Vertical - - - QSizePolicy::Maximum + Qt::Horizontal - 572 - 16 + 40 + 20 - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok - - - - - - buttonBox - accepted() - runForm - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - runForm - reject() - - - 316 - 260 - - - 286 - 274 - - - - + diff --git a/bacula/src/qt-console/run/runcmd.cpp b/bacula/src/qt-console/run/runcmd.cpp index b867695390..847d00c3b4 100644 --- a/bacula/src/qt-console/run/runcmd.cpp +++ b/bacula/src/qt-console/run/runcmd.cpp @@ -44,17 +44,24 @@ /* * Setup all the combo boxes and display the dialog */ -runCmdDialog::runCmdDialog(Console *console) +runCmdPage::runCmdPage() { - m_console = console; - m_console->notify(false); + m_name = "Restore Run"; + pgInitialize(); setupUi(this); - fillRunDialog(); - this->show(); + m_console->notify(false); + + fill(); m_console->discardToPrompt(); + + connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed())); + connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed())); + dockPage(); + setCurrent(); + this->show(); } -void runCmdDialog::fillRunDialog() +void runCmdPage::fill() { QString item, val; QStringList items; @@ -110,7 +117,7 @@ void runCmdDialog::fillRunDialog() } } -void runCmdDialog::accept() +void runCmdPage::okButtonPushed() { this->hide(); @@ -123,7 +130,7 @@ void runCmdDialog::accept() } -void runCmdDialog::reject() +void runCmdPage::cancelButtonPushed() { mainWin->set_status(" Canceled"); this->hide(); diff --git a/bacula/src/qt-console/run/runcmd.ui b/bacula/src/qt-console/run/runcmd.ui index d14cc9be00..3176d9650e 100644 --- a/bacula/src/qt-console/run/runcmd.ui +++ b/bacula/src/qt-console/run/runcmd.ui @@ -1,19 +1,16 @@ runCmdForm - - - Qt::NonModal - + 0 0 - 590 - 395 + 678 + 386 - Run Job Command + Form @@ -22,50 +19,273 @@ 6 - - - - Qt::Horizontal + + + + 0 - - QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok + + 6 - + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 131 + 25 + + + + + + + + + 16777215 + 30 + + + + <h3>Restore Run</h3> + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 131 + 25 + + + + + - - - - Qt::Vertical - - - QSizePolicy::Maximum + + + + 0 - - - 572 - 16 - + + 6 - + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + OK + + + + + + + Cancel + + + + - - - - Qt::Vertical - - - QSizePolicy::Maximum + + + + 0 - - - 572 - 16 - + + 6 - + + + + + 0 + 2 + 0 + 2000 + 1 + 1 + + + + yyyy-mm-dd hh:mm:ss + + + true + + + + + + + When: + + + dateTimeEdit + + + + + + + Where: + + + true + + + where + + + + + + + Bootstrap: + + + bootstrap + + + + + + + + + + + + + Job: + + + jobCombo + + + + + + + false + + + + 200 + 0 + + + + false + + + + + + + Storage: + + + storageCombo + + + + + + + FileSet: + + + filesetCombo + + + + + + + false + + + + 200 + 0 + + + + false + + + + + + + + + + + + + + + + Replace: + + + + + + + + + + Client: + + + clientCombo + + + + + + + Catalog: + + + catalogCombo + + + + - - + + 0 @@ -80,328 +300,134 @@ 6 - - - - - 0 - 2 - 0 - 2000 - 1 - 1 - - - - yyyy-mm-dd hh:mm:ss - - - true - - - - - - - When: - - - dateTimeEdit - - - - - - - Where: - - - true - - - where - - - - - - - Bootstrap: - - - bootstrap - - - - - - - - - - - - Job: + + + 10000 - - jobCombo + + 1 - - - - - - false - - - - 200 - 0 - - - - false + + 10 - - - - Storage: - - - storageCombo - - - - - - - FileSet: - - - filesetCombo - - - - - - - false + + + + + 5 + 0 + 0 + 0 + - 200 + 150 0 - - false - - - - - - - - - - - - - - - - Replace: - - - - - + - Client: + Priority: - clientCombo + prioritySpin - - + + - Catalog: + Type: - catalogCombo + typeCombo - - - - 0 - - - 6 - - - - - 0 - - - 6 - - - - - 10000 - - - 1 - - - 10 - - - - - - - - 5 - 0 - 0 - 0 - - - - - 150 - 0 - - - - - - - - Priority: - - - prioritySpin - - - - - - - Type: - - - typeCombo - - - - - - - - - Qt::Vertical - - - - 20 - 171 - - - - - - - - - - - - 0 - - - 6 - - Qt::Horizontal - - - QSizePolicy::Fixed + Qt::Vertical - 131 - 25 + 20 + 171 - - - - - 16777215 - 30 - - - - - - - + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 572 + 16 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 572 + 16 + + + + - - - buttonBox - accepted() - runCmdForm - accept() - - - 258 - 480 - - - 157 - 274 - - - - - buttonBox - rejected() - runCmdForm - reject() - - - 326 - 480 - - - 286 - 274 - - - - + diff --git a/bacula/src/qt-console/storage/storage.cpp b/bacula/src/qt-console/storage/storage.cpp index 2de0b05365..7d63e15cf8 100644 --- a/bacula/src/qt-console/storage/storage.cpp +++ b/bacula/src/qt-console/storage/storage.cpp @@ -239,7 +239,7 @@ void Storage::consoleStatusStorage() /* Label Media populating current storage by default */ void Storage::consoleLabelStorage() { - new labelDialog(m_console, m_currentStorage); + new labelPage(m_currentStorage); } /* Mount currently selected storage */ -- 2.39.5