2 Bacula® - The Network Backup Solution
4 Copyright (C) 2007-2010 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 three of the GNU Affero 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 Affero 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
46 runPage::runPage(const QString &defJob)
48 m_dockOnFirstUse = false;
51 jobCombo->setCurrentIndex(jobCombo->findText(defJob, Qt::MatchExactly));
56 runPage::runPage(const QString &defJob, const QString &level,
57 const QString &pool, const QString &storage,
58 const QString &client, const QString &fileset)
60 m_dockOnFirstUse = false;
62 jobCombo->setCurrentIndex(jobCombo->findText(defJob, Qt::MatchExactly));
64 filesetCombo->setCurrentIndex(filesetCombo->findText(fileset,
66 levelCombo->setCurrentIndex(levelCombo->findText(level, Qt::MatchExactly));
67 clientCombo->setCurrentIndex(clientCombo->findText(client,Qt::MatchExactly));
68 poolCombo->setCurrentIndex(poolCombo->findText(pool, Qt::MatchExactly));
70 if (storage != "") { // TODO: enable storage
71 storageCombo->setCurrentIndex(storageCombo->findText(storage,
79 * Setup all the combo boxes and display the dialog
88 QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
89 thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/run.png")));
90 m_conn = m_console->notifyOff();
92 m_console->beginNewCommand(m_conn);
93 jobCombo->addItems(m_console->job_list);
94 filesetCombo->addItems(m_console->fileset_list);
95 levelCombo->addItems(m_console->level_list);
96 clientCombo->addItems(m_console->client_list);
97 poolCombo->addItems(m_console->pool_list);
98 storageCombo->addItems(m_console->storage_list);
99 dateTimeEdit->setDisplayFormat(mainWin->m_dtformat);
100 dateTimeEdit->setDateTime(dt.currentDateTime());
101 /*printf("listing messages resources"); ***FIME ***
102 foreach(QString mes, m_console->messages_list) {
103 printf("%s\n", mes.toUtf8().data());
105 messagesCombo->addItems(m_console->messages_list);
106 messagesCombo->setEnabled(false);
108 connect(jobCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(job_name_change(int)));
109 connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
110 connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
112 // find a way to place the new window at the cursor position
113 // or in the middle of the page
118 void runPage::okButtonPushed()
122 QTextStream(&cmd) << "run" <<
123 " job=\"" << jobCombo->currentText() << "\"" <<
124 " fileset=\"" << filesetCombo->currentText() << "\"" <<
125 " level=\"" << levelCombo->currentText() << "\"" <<
126 " client=\"" << clientCombo->currentText() << "\"" <<
127 " pool=\"" << poolCombo->currentText() << "\"" <<
128 " storage=\"" << storageCombo->currentText() << "\"" <<
129 " priority=\"" << prioritySpin->value() << "\""
130 " when=\"" << dateTimeEdit->dateTime().toString(mainWin->m_dtformat) << "\"";
132 " messages=\"" << messagesCombo->currentText() << "\"";
133 /* FIXME when there is an option to modify the messages resoruce associated
136 if (bootstrap->text() != "") {
137 cmd += " bootstrap=\"" + bootstrap->text() + "\"";
141 if (mainWin->m_commandDebug) {
142 Pmsg1(000, "command : %s\n", cmd.toUtf8().data());
146 m_console->notify(m_conn, true);
148 mainWin->resetFocus();
152 void runPage::cancelButtonPushed()
154 mainWin->set_status(tr(" Canceled"));
156 m_console->notify(m_conn, true);
158 mainWin->resetFocus();
162 * Called here when the jobname combo box is changed.
163 * We load the default values for the new job in the
166 void runPage::job_name_change(int index)
168 job_defaults job_defs;
171 job_defs.job_name = jobCombo->currentText();
172 if (m_console->get_job_defaults(job_defs)) {
173 typeLabel->setText("<H3>"+job_defs.type+"</H3>");
174 filesetCombo->setCurrentIndex(filesetCombo->findText(job_defs.fileset_name, Qt::MatchExactly));
175 levelCombo->setCurrentIndex(levelCombo->findText(job_defs.level, Qt::MatchExactly));
176 clientCombo->setCurrentIndex(clientCombo->findText(job_defs.client_name, Qt::MatchExactly));
177 poolCombo->setCurrentIndex(poolCombo->findText(job_defs.pool_name, Qt::MatchExactly));
178 storageCombo->setCurrentIndex(storageCombo->findText(job_defs.store_name, Qt::MatchExactly));
179 messagesCombo->setCurrentIndex(messagesCombo->findText(job_defs.messages_name, Qt::MatchExactly));