2 Bacula® - The Network Backup Solution
4 Copyright (C) 2007-2009 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, March MMVII
41 * Read the items for the selection
43 selectDialog::selectDialog(Console *console, int conn)
48 QListWidgetItem *item;
52 m_console->notify(m_conn, false);
54 connect(listBox, SIGNAL(currentRowChanged(int)), this, SLOT(index_change(int)));
55 setAttribute(Qt::WA_DeleteOnClose);
56 m_console->read(m_conn); /* get title */
57 labelWidget->setText(m_console->msg(m_conn));
58 while ((stat=m_console->read(m_conn)) > 0) {
59 item = new QListWidgetItem;
60 item->setText(m_console->msg(m_conn));
61 listBox->insertItem(row++, item);
63 m_console->displayToPrompt(m_conn);
67 void selectDialog::accept()
72 bsnprintf(cmd, sizeof(cmd), "%d", m_index+1);
73 m_console->write_dir(m_conn, cmd);
74 m_console->displayToPrompt(m_conn);
76 mainWin->resetFocus();
77 m_console->displayToPrompt(m_conn);
78 m_console->notify(m_conn, true);
82 void selectDialog::reject()
85 mainWin->set_status(tr(" Canceled"));
87 mainWin->resetFocus();
88 m_console->beginNewCommand(m_conn);
89 m_console->notify(m_conn, true);
93 * Called here when the jobname combo box is changed.
94 * We load the default values for the new job in the
97 void selectDialog::index_change(int index)
103 * Handle yesno PopUp when Bacula asks a yes/no question.
106 * Read the items for the selection
108 yesnoPopUp::yesnoPopUp(Console *console, int conn)
112 setAttribute(Qt::WA_DeleteOnClose);
113 console->read(conn); /* get yesno question */
114 msgBox.setWindowTitle(tr("Bat Question"));
115 msgBox.setText(console->msg(conn));
116 msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
117 console->displayToPrompt(conn);
118 switch (msgBox.exec()) {
119 case QMessageBox::Yes:
120 console->write_dir(conn, "yes");
122 case QMessageBox::No:
123 console->write_dir(conn, "no");
126 console->displayToPrompt(conn);
127 mainWin->resetFocus();