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 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, March MMVII
41 * Read the items for the selection
43 selectDialog::selectDialog(Console *console)
47 QListWidgetItem *item;
52 connect(listBox, SIGNAL(currentRowChanged(int)), this, SLOT(index_change(int)));
53 setAttribute(Qt::WA_DeleteOnClose);
54 m_console->read(); /* get title */
55 labelWidget->setText(m_console->msg());
56 while ((stat=m_console->read()) > 0) {
57 item = new QListWidgetItem;
58 item->setText(m_console->msg());
59 listBox->insertItem(row++, item);
61 m_console->displayToPrompt();
65 void selectDialog::accept()
70 bsnprintf(cmd, sizeof(cmd), "%d", m_index+1);
71 m_console->write_dir(cmd);
72 m_console->displayToPrompt();
74 mainWin->resetFocus();
75 m_console->displayToPrompt();
80 void selectDialog::reject()
83 mainWin->set_status(tr(" Canceled"));
85 mainWin->resetFocus();
86 m_console->beginNewCommand();
90 * Called here when the jobname combo box is changed.
91 * We load the default values for the new job in the
94 void selectDialog::index_change(int index)
100 * Handle yesno PopUp when Bacula asks a yes/no question.
103 * Read the items for the selection
105 yesnoPopUp::yesnoPopUp(Console *console)
109 setAttribute(Qt::WA_DeleteOnClose);
110 console->read(); /* get yesno question */
111 msgBox.setWindowTitle(tr("Bat Question"));
112 msgBox.setText(console->msg());
113 msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
114 console->displayToPrompt();
115 switch (msgBox.exec()) {
116 case QMessageBox::Yes:
117 console->write_dir("yes");
119 case QMessageBox::No:
120 console->write_dir("no");
123 console->displayToPrompt();
124 mainWin->resetFocus();