2 Bacula® - The Network Backup Solution
4 Copyright (C) 2007-2008 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 Kern Sibbald.
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 * Kern Sibbald, February MMVII
41 * Setup all the combo boxes and display the dialog
43 estimatePage::estimatePage()
47 m_name = tr("Estimate");
50 m_conn = m_console->notifyOff();
52 m_console->beginNewCommand(m_conn);
53 jobCombo->addItems(m_console->job_list);
54 filesetCombo->addItems(m_console->fileset_list);
55 levelCombo->addItems(m_console->level_list);
56 clientCombo->addItems(m_console->client_list);
58 Pmsg1(000, "connecting estimate buttons : %i\n", m_conn);
59 connect(jobCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(job_name_change(int)));
60 connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
61 connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
62 QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
63 thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/estimate-job.png")));
68 m_aButtonPushed = false;
71 void estimatePage::okButtonPushed()
73 if (m_aButtonPushed) return;
74 m_aButtonPushed = true;
77 QTextStream(&cmd) << "estimate" <<
78 " job=\"" << jobCombo->currentText() << "\"" <<
79 " fileset=\"" << filesetCombo->currentText() << "\"" <<
80 " level=\"" << levelCombo->currentText() << "\"" <<
81 " client=\"" << clientCombo->currentText() << "\"";
82 if (listingCheckBox->checkState() == Qt::Checked) {
86 if (mainWin->m_commandDebug) {
87 Pmsg1(000, "command : %s\n", cmd.toUtf8().data());
90 consoleCommand(cmd, m_conn);
91 m_console->notify(m_conn, true);
93 mainWin->resetFocus();
97 void estimatePage::cancelButtonPushed()
99 if (m_aButtonPushed) return;
100 m_aButtonPushed = true;
101 mainWin->set_status(" Canceled");
103 m_console->notify(m_conn, true);
105 mainWin->resetFocus();
109 * Called here when the jobname combo box is changed.
110 * We load the default values for the new job in the
113 void estimatePage::job_name_change(int index)
115 job_defaults job_defs;
118 job_defs.job_name = jobCombo->currentText();
119 if (m_console->get_job_defaults(m_conn, job_defs)) {
120 filesetCombo->setCurrentIndex(filesetCombo->findText(job_defs.fileset_name, Qt::MatchExactly));
121 levelCombo->setCurrentIndex(levelCombo->findText(job_defs.level, Qt::MatchExactly));
122 clientCombo->setCurrentIndex(clientCombo->findText(job_defs.client_name, Qt::MatchExactly));