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 plus additions
11 that are listed in the file LICENSE.
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 * Kern Sibbald, February MMVII
41 * Setup all the combo boxes and display the dialog
50 m_console->notify(false);
52 m_console->beginNewCommand();
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);
57 poolCombo->addItems(m_console->pool_list);
58 storageCombo->addItems(m_console->storage_list);
59 dateTimeEdit->setDateTime(dt.currentDateTime());
61 connect(jobCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(job_name_change(int)));
62 connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
63 connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
70 void runPage::okButtonPushed()
76 // ***FIXME** add date/time from dateTimeEdit.
77 bsnprintf(cmd, sizeof(cmd),
78 "run job=\"%s\" fileset=\"%s\" level=%s client=\"%s\" pool=\"%s\" "
79 "storage=\"%s\" priority=\"%d\" yes\n",
80 jobCombo->currentText().toUtf8().data(),
81 filesetCombo->currentText().toUtf8().data(),
82 levelCombo->currentText().toUtf8().data(),
83 clientCombo->currentText().toUtf8().data(),
84 poolCombo->currentText().toUtf8().data(),
85 storageCombo->currentText().toUtf8().data(),
86 prioritySpin->value());
88 m_console->write_dir(cmd);
89 m_console->display_text(cmd);
90 m_console->displayToPrompt();
91 m_console->notify(true);
93 mainWin->resetFocus();
97 void runPage::cancelButtonPushed()
99 mainWin->set_status(" Canceled");
101 m_console->notify(true);
103 mainWin->resetFocus();
107 * Called here when the jobname combo box is changed.
108 * We load the default values for the new job in the
111 void runPage::job_name_change(int index)
113 job_defaults job_defs;
116 job_defs.job_name = jobCombo->currentText();
117 if (m_console->get_job_defaults(job_defs)) {
118 filesetCombo->setCurrentIndex(filesetCombo->findText(job_defs.fileset_name, Qt::MatchExactly));
119 levelCombo->setCurrentIndex(levelCombo->findText(job_defs.level, Qt::MatchExactly));
120 clientCombo->setCurrentIndex(clientCombo->findText(job_defs.client_name, Qt::MatchExactly));
121 poolCombo->setCurrentIndex(poolCombo->findText(job_defs.pool_name, Qt::MatchExactly));
122 storageCombo->setCurrentIndex(storageCombo->findText(job_defs.store_name, Qt::MatchExactly));
124 typeCombo->addItem(job_defs.type);