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 many
7 others, a complete list can be found in the file AUTHORS.
9 You may use this file and others of this release according to the
10 license defined in the LICENSE file, which includes the Affero General
11 Public License, v3.0 ("AGPLv3") and some additional permissions and
12 terms pursuant to its AGPLv3 Section 7.
14 Bacula® is a registered trademark of Kern Sibbald.
20 * Kern Sibbald, March MMVII
28 * Read the items for the selection
30 selectDialog::selectDialog(Console *console, int conn) : QDialog()
35 QListWidgetItem *item;
39 m_console->notify(m_conn, false);
41 connect(listBox, SIGNAL(currentRowChanged(int)), this, SLOT(index_change(int)));
42 setAttribute(Qt::WA_DeleteOnClose);
43 m_console->read(m_conn); /* get title */
44 labelWidget->setText(m_console->msg(m_conn));
45 while ((stat=m_console->read(m_conn)) > 0) {
46 item = new QListWidgetItem;
47 item->setText(m_console->msg(m_conn));
48 listBox->insertItem(row++, item);
50 m_console->displayToPrompt(m_conn);
54 void selectDialog::accept()
59 bsnprintf(cmd, sizeof(cmd), "%d", m_index+1);
60 m_console->write_dir(m_conn, cmd);
61 m_console->displayToPrompt(m_conn);
63 mainWin->resetFocus();
64 m_console->displayToPrompt(m_conn);
65 m_console->notify(m_conn, true);
69 void selectDialog::reject()
72 mainWin->set_status(tr(" Canceled"));
74 mainWin->resetFocus();
75 m_console->beginNewCommand(m_conn);
76 m_console->notify(m_conn, true);
80 * Called here when the jobname combo box is changed.
81 * We load the default values for the new job in the
84 void selectDialog::index_change(int index)
90 * Handle yesno PopUp when Bacula asks a yes/no question.
93 * Read the items for the selection
95 yesnoPopUp::yesnoPopUp(Console *console, int conn) : QDialog()
99 setAttribute(Qt::WA_DeleteOnClose);
100 console->read(conn); /* get yesno question */
101 msgBox.setWindowTitle(tr("Bat Question"));
102 msgBox.setText(console->msg(conn));
103 msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
104 console->displayToPrompt(conn);
105 switch (msgBox.exec()) {
106 case QMessageBox::Yes:
107 console->write_dir(conn, "yes");
109 case QMessageBox::No:
110 console->write_dir(conn, "no");
113 console->displayToPrompt(conn);
114 mainWin->resetFocus();