2 Bacula® - The Network Backup Solution
4 Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
6 The main author of Bacula is Kern Sibbald, with contributions from
7 many others, a complete list can be found in the file AUTHORS.
8 This program is Free Software; you can redistribute it and/or
9 modify it under the terms of version two of the GNU General Public
10 License as published by the Free Software Foundation and included
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 Bacula® is a registered trademark of John Walker.
24 The licensor of Bacula is the Free Software Foundation Europe
25 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
26 Switzerland, email:ftf@fsfeurope.org.
32 * Main Window control for bat (qt-console)
34 * Kern Sibbald, January MMVII
39 #include "joblist/joblist.h"
40 #include "storage/storage.h"
41 #include "fileset/fileset.h"
42 #include "label/label.h"
45 #include "restore/restore.h"
46 #include "medialist/medialist.h"
47 #include "joblist/joblist.h"
48 #include "clients/clients.h"
49 #include "restore/restoretree.h"
50 #include "help/help.h"
51 #include "jobs/jobs.h"
52 #include "jobgraphs/jobplot.h"
55 * Daemon message callback
57 void message_callback(int /* type */, char *msg)
59 QMessageBox::warning(mainWin, "Bat", msg, QMessageBox::Ok);
62 MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
65 m_dtformat = "yyyy-MM-dd HH:mm:ss";
67 setupUi(this); /* Setup UI defined by main.ui (designer) */
68 register_message_callback(message_callback);
71 treeWidget->setColumnCount(1);
72 treeWidget->setHeaderLabel("Select Page");
73 treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu);
85 foreach(Console *console, m_consoleHash) {
86 console->connect_dir();
88 m_currentConsole = (Console*)getFromHash(m_firstItem);
89 m_currentConsole->setCurrent();
91 QString directoryResourceName;
92 m_currentConsole->getDirResName(directoryResourceName);
93 Pmsg1(000, "Setting initial window to %s\n", directoryResourceName.toUtf8().data());
97 void MainWin::createPages()
100 QTreeWidgetItem *item, *topItem;
104 foreach_res(dir, R_DIRECTOR) {
106 /* Create console tree stacked widget item */
107 m_currentConsole = new Console(stackedWidget);
108 m_currentConsole->setDirRes(dir);
109 m_currentConsole->readSettings();
111 /* The top tree item representing the director */
112 topItem = new QTreeWidgetItem(treeWidget);
113 topItem->setText(0, dir->name());
114 topItem->setIcon(0, QIcon(":images/server.png"));
115 /* Set background to grey for ease of identification of inactive Director */
116 QBrush greyBrush(Qt::lightGray);
117 topItem->setBackground(0, greyBrush);
118 m_currentConsole->setDirectorTreeItem(topItem);
119 m_consoleHash.insert(topItem, m_currentConsole);
121 /* Create Tree Widget Item */
122 item = new QTreeWidgetItem(topItem);
123 item->setText(0, "Console");
124 if (!m_firstItem){ m_firstItem = item; }
125 item->setIcon(0,QIcon(QString::fromUtf8(":images/utilities-terminal.png")));
127 /* insert the cosole and tree widget item into the hashes */
128 hashInsert(item, m_currentConsole);
130 /* Set Color of treeWidgetItem for the console
131 * It will be set to green in the console class if the connection is made.
133 QBrush redBrush(Qt::red);
134 item->setForeground(0, redBrush);
135 m_currentConsole->dockPage();
138 * Create instances in alphabetic order of the rest
139 * of the classes that will by default exist under each Director.
145 createPageJobList("", "", "", "", NULL);
148 new JobPlot(NULL, pass);
153 treeWidget->expandItem(topItem);
154 stackedWidget->setCurrentWidget(m_currentConsole);
160 * create an instance of the the joblist class on the stack
162 void MainWin::createPageJobList(const QString &media, const QString &client,
163 const QString &job, const QString &fileset, QTreeWidgetItem *parentTreeWidgetItem)
165 QTreeWidgetItem *holdItem;
167 /* save current tree widget item in case query produces no results */
168 holdItem = treeWidget->currentItem();
169 JobList* joblist = new JobList(media, client, job, fileset, parentTreeWidgetItem);
170 /* If this is a query of jobs on a specific media */
171 if ((media != "") || (client != "") || (job != "") || (fileset != "")) {
172 joblist->setCurrent();
173 /* did query produce results, if not close window and set back to hold */
174 if (joblist->m_resultCount == 0) {
175 joblist->closeStackPage();
176 treeWidget->setCurrentItem(holdItem);
182 * Handle up and down arrow keys for the command line
185 void MainWin::keyPressEvent(QKeyEvent *event)
187 if (m_cmd_history.size() == 0) {
191 switch (event->key()) {
193 if (m_cmd_last < 0 || m_cmd_last >= (m_cmd_history.size()-1)) {
200 if (m_cmd_last == 0) {
204 if (m_cmd_last < 0 || m_cmd_last > (m_cmd_history.size()-1)) {
205 m_cmd_last = m_cmd_history.size() - 1;
214 lineEdit->setText(m_cmd_history[m_cmd_last]);
217 void MainWin::createConnections()
219 /* Connect signals to slots */
220 connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(input_line()));
221 connect(actionAbout_bat, SIGNAL(triggered()), this, SLOT(about()));
222 connect(actionBat_Help, SIGNAL(triggered()), this, SLOT(help()));
223 connect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this,
224 SLOT(treeItemClicked(QTreeWidgetItem *, int)));
225 connect(treeWidget, SIGNAL(
226 currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
227 this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
228 connect(stackedWidget, SIGNAL(currentChanged(int)),
229 this, SLOT(stackItemChanged(int)));
230 connect(actionQuit, SIGNAL(triggered()), app, SLOT(closeAllWindows()));
231 connect(actionLabel, SIGNAL(triggered()), this, SLOT(labelButtonClicked()));
232 connect(actionRun, SIGNAL(triggered()), this, SLOT(runButtonClicked()));
233 connect(actionEstimate, SIGNAL(triggered()), this, SLOT(estimateButtonClicked()));
234 connect(actionBrowse, SIGNAL(triggered()), this, SLOT(browseButtonClicked()));
235 connect(actionJobPlot, SIGNAL(triggered()), this, SLOT(jobPlotButtonClicked()));
236 connect(actionRestore, SIGNAL(triggered()), this, SLOT(restoreButtonClicked()));
237 connect(actionUndock, SIGNAL(triggered()), this, SLOT(undockWindowButton()));
238 connect(actionToggleDock, SIGNAL(triggered()), this, SLOT(toggleDockContextWindow()));
239 connect(actionClosePage, SIGNAL(triggered()), this, SLOT(closePage()));
240 connect(actionPreferences, SIGNAL(triggered()), this, SLOT(setPreferences()));
244 * Reimplementation of QWidget closeEvent virtual function
246 void MainWin::closeEvent(QCloseEvent *event)
251 * Close the console pages before non-console pages so that
252 * the notifier is turned off. Otherwise it prints an error when
253 * the page it is using gets destroyed.
255 foreach(Console *console, m_consoleHash){
256 console->writeSettings();
257 console->terminate();
258 console->closeStackPage();
260 /* close all non console pages, this will call settings in destructors */
261 while (m_consoleHash.count() < m_pagehash.count()) {
262 foreach(Pages *page, m_pagehash) {
263 if (page != page->console()) {
264 QTreeWidgetItem* pageSelectorTreeWidgetItem = mainWin->getFromHash(page);
265 if (pageSelectorTreeWidgetItem->childCount() == 0) {
266 page->console()->setCurrent();
267 page->closeStackPage();
275 void MainWin::writeSettings()
277 QSettings settings("bacula.org", "bat");
279 settings.beginGroup("MainWin");
280 settings.setValue("winSize", size());
281 settings.setValue("winPos", pos());
282 settings.setValue("state", saveState());
286 void MainWin::readSettings()
288 QSettings settings("bacula.org", "bat");
290 settings.beginGroup("MainWin");
291 resize(settings.value("winSize", QSize(1041, 801)).toSize());
292 move(settings.value("winPos", QPoint(200, 150)).toPoint());
293 restoreState(settings.value("state").toByteArray());
298 * This subroutine is called with an item in the Page Selection window
301 void MainWin::treeItemClicked(QTreeWidgetItem *item, int /*column*/)
303 /* Is this a page that has been inserted into the hash */
304 if (getFromHash(item)) {
305 Pages* page = getFromHash(item);
306 int stackindex=stackedWidget->indexOf(page);
308 if (stackindex >= 0) {
309 stackedWidget->setCurrentWidget(page);
311 /* run the virtual function in case this class overrides it */
312 page->PgSeltreeWidgetClicked();
317 * Called with a change of the highlighed tree widget item in the page selector.
319 void MainWin::treeItemChanged(QTreeWidgetItem *currentitem, QTreeWidgetItem *previousitem)
321 if (m_isClosing) return; /* if closing the application, do nothing here */
323 Pages *previousPage, *nextPage;
324 Console *previousConsole = NULL;
325 Console *nextConsole;
327 /* remove all actions before adding actions appropriate for new page */
328 foreach(QAction* pageAction, treeWidget->actions()) {
329 treeWidget->removeAction(pageAction);
332 /* first determine the next item */
334 /* knowing the treeWidgetItem, get the page from the hash */
335 nextPage = getFromHash(currentitem);
336 nextConsole = m_consoleHash.value(currentitem);
337 /* Is this a page that has been inserted into the hash */
339 nextConsole = nextPage->console();
340 /* then is it a treeWidgetItem representing a director */
341 } else if (nextConsole) {
342 /* let the next page BE the console */
343 nextPage = nextConsole;
345 /* Should never get here */
350 /* The Previous item */
352 /* this condition prevents a segfault. The first time there is no previousitem*/
354 /* knowing the treeWidgetItem, get the page from the hash */
355 previousPage = getFromHash(previousitem);
356 previousConsole = m_consoleHash.value(previousitem);
358 previousConsole = previousPage->console();
359 } else if (previousConsole) {
360 previousPage = previousConsole;
362 if ((previousPage) || (previousConsole)) {
363 if (nextConsole != previousConsole) {
364 /* remove connections to the current console */
365 disconnect(actionConnect, SIGNAL(triggered()), previousConsole, SLOT(connect_dir()));
366 disconnect(actionStatusDir, SIGNAL(triggered()), previousConsole, SLOT(status_dir()));
367 disconnect(actionMessages, SIGNAL(triggered()), previousConsole, SLOT(messages()));
368 disconnect(actionSelectFont, SIGNAL(triggered()), previousConsole, SLOT(set_font()));
369 QTreeWidgetItem *dirItem = previousConsole->directorTreeItem();
370 QBrush greyBrush(Qt::lightGray);
371 dirItem->setBackground(0, greyBrush);
376 /* process the current (next) item */
378 if ((nextPage) || (nextConsole)) {
379 if (nextConsole != previousConsole) {
380 /* make connections to the current console */
381 m_currentConsole = nextConsole;
382 connect(actionConnect, SIGNAL(triggered()), m_currentConsole, SLOT(connect_dir()));
383 connect(actionSelectFont, SIGNAL(triggered()), m_currentConsole, SLOT(set_font()));
384 connect(actionStatusDir, SIGNAL(triggered()), m_currentConsole, SLOT(status_dir()));
385 connect(actionMessages, SIGNAL(triggered()), m_currentConsole, SLOT(messages()));
386 /* Set director's tree widget background to magenta for ease of identification */
387 QTreeWidgetItem *dirItem = m_currentConsole->directorTreeItem();
388 QBrush magentaBrush(Qt::magenta);
389 dirItem->setBackground(0, magentaBrush);
391 /* set the value for the currently active console */
392 int stackindex = stackedWidget->indexOf(nextPage);
394 /* Is this page currently on the stack or is it undocked */
395 if (stackindex >= 0) {
396 /* put this page on the top of the stack */
397 stackedWidget->setCurrentIndex(stackindex);
399 /* it is undocked, raise it to the front */
402 /* for the page selectors menu action to dock or undock, set the text */
403 nextPage->setContextMenuDockText();
405 treeWidget->addAction(actionToggleDock);
406 /* if this page is closeable, and it has no childern, then add that action */
407 if ((nextPage->isCloseable()) && (currentitem->child(0) == NULL))
408 treeWidget->addAction(actionClosePage);
410 /* Add the actions to the Page Selectors tree widget that are part of the
411 * current items list of desired actions regardless of whether on top of stack*/
412 treeWidget->addActions(nextPage->m_contextActions);
416 void MainWin::labelButtonClicked()
421 void MainWin::runButtonClicked()
426 void MainWin::estimateButtonClicked()
431 void MainWin::browseButtonClicked()
436 void MainWin::restoreButtonClicked()
438 new prerestorePage();
441 void MainWin::jobPlotButtonClicked()
445 new JobPlot(NULL, pass);
449 * The user just finished typing a line in the command line edit box
451 void MainWin::input_line()
453 QString cmdStr = lineEdit->text(); /* Get the text */
454 lineEdit->clear(); /* clear the lineEdit box */
455 if (m_currentConsole->is_connected()) {
456 /* Use consoleInput to allow typing anything */
457 m_currentConsole->consoleInput(cmdStr);
459 set_status("Director not connected. Click on connect button.");
461 m_cmd_history.append(cmdStr);
463 if (treeWidget->currentItem() != getFromHash(m_currentConsole))
464 m_currentConsole->setCurrent();
468 void MainWin::about()
470 QMessageBox::about(this, tr("About bat"),
471 tr("<br><h2>bat 1.0, by Dirk H Bartley and Kern Sibbald</h2>"
472 "<p>Copyright © " BYEAR " Free Software Foundation Europe e.V."
473 "<p>The <b>bat</b> is an administrative console"
474 " interface to the Director."));
479 Help::displayFile("index.html");
482 void MainWin::set_statusf(const char *fmt, ...)
487 va_start(arg_ptr, fmt);
488 len = bvsnprintf(buf, sizeof(buf), fmt, arg_ptr);
493 void MainWin::set_status_ready()
495 set_status(" Ready");
498 void MainWin::set_status(const char *buf)
500 statusBar()->showMessage(buf);
504 * Function to respond to the button bar button to undock
506 void MainWin::undockWindowButton()
508 Pages* page = (Pages*)stackedWidget->currentWidget();
509 page->togglePageDocking();
513 * Function to respond to action on page selector context menu to toggle the
514 * dock status of the window associated with the page selectors current
517 void MainWin::toggleDockContextWindow()
519 QTreeWidgetItem *currentitem = treeWidget->currentItem();
521 /* Is this a page that has been inserted into the hash */
522 if (getFromHash(currentitem)) {
523 Pages* page = getFromHash(currentitem);
524 page->togglePageDocking();
529 * This function is called when the stack item is changed. Call
530 * the virtual function here. Avoids a window being undocked leaving
531 * a window at the top of the stack unpopulated.
533 void MainWin::stackItemChanged(int)
535 if (m_isClosing) return; /* if closing the application, do nothing here */
536 Pages* page = (Pages*)stackedWidget->currentWidget();
537 /* run the virtual function in case this class overrides it */
538 page->currentStackItem();
542 * Function to simplify insertion of QTreeWidgetItem <-> Page association
543 * into a double direction hash.
545 void MainWin::hashInsert(QTreeWidgetItem *item, Pages *page)
547 m_pagehash.insert(item, page);
548 m_widgethash.insert(page, item);
552 * Function to simplify removal of QTreeWidgetItem <-> Page association
553 * into a double direction hash.
555 void MainWin::hashRemove(QTreeWidgetItem *item, Pages *page)
557 /* I had all sorts of return status checking code here. Do we have a log
558 * level capability in bat. I would have left it in but it used printf's
559 * and it should really be some kind of log level facility ???
560 * ******FIXME********/
561 m_pagehash.remove(item);
562 m_widgethash.remove(page);
566 * Function to retrieve a Page* when the item in the page selector's tree is
569 Pages* MainWin::getFromHash(QTreeWidgetItem *item)
571 return m_pagehash.value(item);
575 * Function to retrieve the page selectors tree widget item when the page is
578 QTreeWidgetItem* MainWin::getFromHash(Pages *page)
580 return m_widgethash.value(page);
584 * Function to respond to action on page selector context menu to close the
587 void MainWin::closePage()
589 QTreeWidgetItem *currentitem = treeWidget->currentItem();
591 /* Is this a page that has been inserted into the hash */
592 if (getFromHash(currentitem)) {
593 Pages* page = getFromHash(currentitem);
594 if (page->isCloseable()) {
595 page->closeStackPage();
600 /* Quick function to return the current console */
601 Console *MainWin::currentConsole()
603 return m_currentConsole;
605 /* Quick function to return the tree item for the director */
606 QTreeWidgetItem *MainWin::currentTopItem()
608 return m_currentConsole->directorTreeItem();
611 /* Preferences menu item clicked */
612 void MainWin::setPreferences()
615 prefs.commDebug->setCheckState(m_commDebug ? Qt::Checked : Qt::Unchecked);
616 prefs.displayAll->setCheckState(m_displayAll ? Qt::Checked : Qt::Unchecked);
617 prefs.sqlDebug->setCheckState(m_sqlDebug ? Qt::Checked : Qt::Unchecked);
618 prefs.commandDebug->setCheckState(m_commandDebug ? Qt::Checked : Qt::Unchecked);
619 prefs.miscDebug->setCheckState(m_miscDebug ? Qt::Checked : Qt::Unchecked);
620 prefs.recordLimit->setCheckState(m_recordLimitCheck ? Qt::Checked : Qt::Unchecked);
621 prefs.recordSpinBox->setValue(m_recordLimitVal);
622 prefs.daysLimit->setCheckState(m_daysLimitCheck ? Qt::Checked : Qt::Unchecked);
623 prefs.daysSpinBox->setValue(m_daysLimitVal);
624 prefs.checkMessages->setCheckState(m_checkMessages ? Qt::Checked : Qt::Unchecked);
625 prefs.checkMessagesSpin->setValue(m_checkMessagesInterval);
626 prefs.executeLongCheckBox->setCheckState(m_longList ? Qt::Checked : Qt::Unchecked);
627 prefs.rtPopDirCheckBox->setCheckState(m_rtPopDirDebug ? Qt::Checked : Qt::Unchecked);
628 prefs.rtDirCurICCheckBox->setCheckState(m_rtDirCurICDebug ? Qt::Checked : Qt::Unchecked);
629 prefs.rtDirICCheckBox->setCheckState(m_rtDirICDebug ? Qt::Checked : Qt::Unchecked);
630 prefs.rtFileTabICCheckBox->setCheckState(m_rtFileTabICDebug ? Qt::Checked : Qt::Unchecked);
631 prefs.rtVerTabICCheckBox->setCheckState(m_rtVerTabICDebug ? Qt::Checked : Qt::Unchecked);
632 prefs.rtUpdateFTCheckBox->setCheckState(m_rtUpdateFTDebug ? Qt::Checked : Qt::Unchecked);
633 prefs.rtUpdateVTCheckBox->setCheckState(m_rtUpdateVTDebug ? Qt::Checked : Qt::Unchecked);
634 prefs.rtChecksCheckBox->setCheckState(m_rtChecksDebug ? Qt::Checked : Qt::Unchecked);
635 prefs.rtIconStateCheckBox->setCheckState(m_rtIconStateDebug ? Qt::Checked : Qt::Unchecked);
636 prefs.rtRestore1CheckBox->setCheckState(m_rtRestore1Debug ? Qt::Checked : Qt::Unchecked);
637 prefs.rtRestore2CheckBox->setCheckState(m_rtRestore2Debug ? Qt::Checked : Qt::Unchecked);
638 prefs.rtRestore3CheckBox->setCheckState(m_rtRestore3Debug ? Qt::Checked : Qt::Unchecked);
642 /* Preferences dialog */
643 prefsDialog::prefsDialog()
648 void prefsDialog::accept()
651 mainWin->m_commDebug = this->commDebug->checkState() == Qt::Checked;
652 mainWin->m_displayAll = this->displayAll->checkState() == Qt::Checked;
653 mainWin->m_sqlDebug = this->sqlDebug->checkState() == Qt::Checked;
654 mainWin->m_commandDebug = this->commandDebug->checkState() == Qt::Checked;
655 mainWin->m_miscDebug = this->miscDebug->checkState() == Qt::Checked;
656 mainWin->m_recordLimitCheck = this->recordLimit->checkState() == Qt::Checked;
657 mainWin->m_recordLimitVal = this->recordSpinBox->value();
658 mainWin->m_daysLimitCheck = this->daysLimit->checkState() == Qt::Checked;
659 mainWin->m_daysLimitVal = this->daysSpinBox->value();
660 mainWin->m_checkMessages = this->checkMessages->checkState() == Qt::Checked;
661 mainWin->m_checkMessagesInterval = this->checkMessagesSpin->value();
662 mainWin->m_longList = this->executeLongCheckBox->checkState() == Qt::Checked;
664 mainWin->m_rtPopDirDebug = this->rtPopDirCheckBox->checkState() == Qt::Checked;
665 mainWin->m_rtDirCurICDebug = this->rtDirCurICCheckBox->checkState() == Qt::Checked;
666 mainWin->m_rtDirICDebug = this->rtDirICCheckBox->checkState() == Qt::Checked;
667 mainWin->m_rtFileTabICDebug = this->rtFileTabICCheckBox->checkState() == Qt::Checked;
668 mainWin->m_rtVerTabICDebug = this->rtVerTabICCheckBox->checkState() == Qt::Checked;
669 mainWin->m_rtUpdateFTDebug = this->rtUpdateFTCheckBox->checkState() == Qt::Checked;
670 mainWin->m_rtUpdateVTDebug = this->rtUpdateVTCheckBox->checkState() == Qt::Checked;
671 mainWin->m_rtChecksDebug = this->rtChecksCheckBox->checkState() == Qt::Checked;
672 mainWin->m_rtIconStateDebug = this->rtIconStateCheckBox->checkState() == Qt::Checked;
673 mainWin->m_rtRestore1Debug = this->rtRestore1CheckBox->checkState() == Qt::Checked;
674 mainWin->m_rtRestore2Debug = this->rtRestore2CheckBox->checkState() == Qt::Checked;
675 mainWin->m_rtRestore3Debug = this->rtRestore3CheckBox->checkState() == Qt::Checked;
677 QSettings settings("www.bacula.org", "bat");
678 settings.beginGroup("Debug");
679 settings.setValue("commDebug", mainWin->m_commDebug);
680 settings.setValue("displayAll", mainWin->m_displayAll);
681 settings.setValue("sqlDebug", mainWin->m_sqlDebug);
682 settings.setValue("commandDebug", mainWin->m_commandDebug);
683 settings.setValue("miscDebug", mainWin->m_miscDebug);
685 settings.beginGroup("JobList");
686 settings.setValue("recordLimitCheck", mainWin->m_recordLimitCheck);
687 settings.setValue("recordLimitVal", mainWin->m_recordLimitVal);
688 settings.setValue("daysLimitCheck", mainWin->m_daysLimitCheck);
689 settings.setValue("daysLimitVal", mainWin->m_daysLimitVal);
691 settings.beginGroup("Messages");
692 settings.setValue("checkMessages", mainWin->m_checkMessages);
693 settings.setValue("checkMessagesInterval", mainWin->m_checkMessagesInterval);
695 settings.beginGroup("Misc");
696 settings.setValue("longList", mainWin->m_longList);
698 settings.beginGroup("RestoreTree");
699 settings.setValue("rtPopDirDebug", mainWin->m_rtPopDirDebug);
700 settings.setValue("rtDirCurICDebug", mainWin->m_rtDirCurICDebug);
701 settings.setValue("rtDirCurICRetDebug", mainWin->m_rtDirICDebug);
702 settings.setValue("rtFileTabICDebug", mainWin->m_rtFileTabICDebug);
703 settings.setValue("rtVerTabICDebug", mainWin->m_rtVerTabICDebug);
704 settings.setValue("rtUpdateFTDebug", mainWin->m_rtUpdateFTDebug);
705 settings.setValue("rtUpdateVTDebug", mainWin->m_rtUpdateVTDebug);
706 settings.setValue("rtChecksDebug", mainWin->m_rtChecksDebug);
707 settings.setValue("rtIconStateDebug", mainWin->m_rtIconStateDebug);
708 settings.setValue("rtRestore1Debug", mainWin->m_rtRestore1Debug);
709 settings.setValue("rtRestore2Debug", mainWin->m_rtRestore2Debug);
710 settings.setValue("rtRestore3Debug", mainWin->m_rtRestore3Debug);
712 foreach(Console *console, mainWin->m_consoleHash) {
713 console->startTimer();
717 void prefsDialog::reject()
720 mainWin->set_status("Canceled");
723 /* read preferences for the prefences dialog box */
724 void MainWin::readPreferences()
726 QSettings settings("www.bacula.org", "bat");
727 settings.beginGroup("Debug");
728 m_commDebug = settings.value("commDebug", false).toBool();
729 m_displayAll = settings.value("displayAll", false).toBool();
730 m_sqlDebug = settings.value("sqlDebug", false).toBool();
731 m_commandDebug = settings.value("commandDebug", false).toBool();
732 m_miscDebug = settings.value("miscDebug", false).toBool();
734 settings.beginGroup("JobList");
735 m_recordLimitCheck = settings.value("recordLimitCheck", true).toBool();
736 m_recordLimitVal = settings.value("recordLimitVal", 150).toInt();
737 m_daysLimitCheck = settings.value("daysLimitCheck", false).toBool();
738 m_daysLimitVal = settings.value("daysLimitVal", 28).toInt();
740 settings.beginGroup("Messages");
741 m_checkMessages = settings.value("checkMessages", false).toBool();
742 m_checkMessagesInterval = settings.value("checkMessagesInterval", 28).toInt();
744 settings.beginGroup("Misc");
745 m_longList = settings.value("longList", false).toBool();
747 settings.beginGroup("RestoreTree");
748 m_rtPopDirDebug = settings.value("rtPopDirDebug", false).toBool();
749 m_rtDirCurICDebug = settings.value("rtDirCurICDebug", false).toBool();
750 m_rtDirICDebug = settings.value("rtDirCurICRetDebug", false).toBool();
751 m_rtFileTabICDebug = settings.value("rtFileTabICDebug", false).toBool();
752 m_rtVerTabICDebug = settings.value("rtVerTabICDebug", false).toBool();
753 m_rtUpdateFTDebug = settings.value("rtUpdateFTDebug", false).toBool();
754 m_rtUpdateVTDebug = settings.value("rtUpdateVTDebug", false).toBool();
755 m_rtChecksDebug = settings.value("rtChecksDebug", false).toBool();
756 m_rtIconStateDebug = settings.value("rtIconStateDebug", false).toBool();
757 m_rtRestore1Debug = settings.value("rtRestore1Debug", false).toBool();
758 m_rtRestore2Debug = settings.value("rtRestore2Debug", false).toBool();
759 m_rtRestore3Debug = settings.value("rtRestore3Debug", false).toBool();