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 QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
51 thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/run.png")));
52 m_console->notify(false);
54 m_console->beginNewCommand();
55 jobCombo->addItems(m_console->job_list);
56 filesetCombo->addItems(m_console->fileset_list);
57 levelCombo->addItems(m_console->level_list);
58 clientCombo->addItems(m_console->client_list);
59 poolCombo->addItems(m_console->pool_list);
60 storageCombo->addItems(m_console->storage_list);
61 dateTimeEdit->setDisplayFormat(mainWin->m_dtformat);
62 dateTimeEdit->setDateTime(dt.currentDateTime());
63 /*printf("listing messages resources"); ***FIME ***
64 foreach(QString mes, m_console->messages_list) {
65 printf("%s\n", mes.toUtf8().data());
67 messagesCombo->addItems(m_console->messages_list);
68 messagesCombo->setEnabled(false);
70 connect(jobCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(job_name_change(int)));
71 connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
72 connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
79 void runPage::okButtonPushed()
83 QTextStream(&cmd) << "run" <<
84 " job=\"" << jobCombo->currentText() << "\"" <<
85 " fileset=\"" << filesetCombo->currentText() << "\"" <<
86 " level=\"" << levelCombo->currentText() << "\"" <<
87 " client=\"" << clientCombo->currentText() << "\"" <<
88 " pool=\"" << poolCombo->currentText() << "\"" <<
89 " storage=\"" << storageCombo->currentText() << "\"" <<
90 " priority=\"" << prioritySpin->value() << "\""
91 " when=\"" << dateTimeEdit->dateTime().toString(mainWin->m_dtformat) << "\"";
93 " messages=\"" << messagesCombo->currentText() << "\"";
94 /* FIXME when there is an option to modify the messages resoruce associated
97 if (bootstrap->text() != "") {
98 cmd += " bootstrap=\"" + bootstrap->text() + "\"";
102 if (mainWin->m_commandDebug) {
103 Pmsg1(000, "command : %s\n", cmd.toUtf8().data());
107 m_console->notify(true);
109 mainWin->resetFocus();
113 void runPage::cancelButtonPushed()
115 mainWin->set_status(" Canceled");
117 m_console->notify(true);
119 mainWin->resetFocus();
123 * Called here when the jobname combo box is changed.
124 * We load the default values for the new job in the
127 void runPage::job_name_change(int index)
129 job_defaults job_defs;
132 job_defs.job_name = jobCombo->currentText();
133 if (m_console->get_job_defaults(job_defs)) {
134 filesetCombo->setCurrentIndex(filesetCombo->findText(job_defs.fileset_name, Qt::MatchExactly));
135 levelCombo->setCurrentIndex(levelCombo->findText(job_defs.level, Qt::MatchExactly));
136 clientCombo->setCurrentIndex(clientCombo->findText(job_defs.client_name, Qt::MatchExactly));
137 poolCombo->setCurrentIndex(poolCombo->findText(job_defs.pool_name, Qt::MatchExactly));
138 storageCombo->setCurrentIndex(storageCombo->findText(job_defs.store_name, Qt::MatchExactly));
139 messagesCombo->setCurrentIndex(messagesCombo->findText(job_defs.messages_name, Qt::MatchExactly));