2 Bacula(R) - The Network Backup Solution
4 Copyright (C) 2000-2016 Kern Sibbald
6 The original author of Bacula is Kern Sibbald, with contributions
7 from many 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 This notice must be preserved when any source code is
15 conveyed and/or propagated.
17 Bacula(R) is a registered trademark of Kern Sibbald.
23 * Kern Sibbald, March MMVII
31 * Read the items for the selection
33 selectDialog::selectDialog(Console *console, int conn) : QDialog()
38 QListWidgetItem *item;
42 m_console->notify(m_conn, false);
44 connect(listBox, SIGNAL(currentRowChanged(int)), this, SLOT(index_change(int)));
45 setAttribute(Qt::WA_DeleteOnClose);
46 m_console->read(m_conn); /* get title */
47 labelWidget->setText(m_console->msg(m_conn));
48 while ((stat=m_console->read(m_conn)) > 0) {
49 item = new QListWidgetItem;
50 item->setText(m_console->msg(m_conn));
51 listBox->insertItem(row++, item);
53 m_console->displayToPrompt(m_conn);
57 void selectDialog::accept()
62 bsnprintf(cmd, sizeof(cmd), "%d", m_index+1);
63 m_console->write_dir(m_conn, cmd);
64 m_console->displayToPrompt(m_conn);
66 mainWin->resetFocus();
67 m_console->displayToPrompt(m_conn);
68 m_console->notify(m_conn, true);
72 void selectDialog::reject()
75 mainWin->set_status(tr(" Canceled"));
77 mainWin->resetFocus();
78 m_console->beginNewCommand(m_conn);
79 m_console->notify(m_conn, true);
83 * Called here when the jobname combo box is changed.
84 * We load the default values for the new job in the
87 void selectDialog::index_change(int index)
93 * Handle yesno PopUp when Bacula asks a yes/no question.
96 * Read the items for the selection
98 yesnoPopUp::yesnoPopUp(Console *console, int conn) : QDialog()
102 setAttribute(Qt::WA_DeleteOnClose);
103 console->read(conn); /* get yesno question */
104 msgBox.setWindowTitle(tr("Bat Question"));
105 msgBox.setText(console->msg(conn));
106 msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
107 console->displayToPrompt(conn);
108 switch (msgBox.exec()) {
109 case QMessageBox::Yes:
110 console->write_dir(conn, "yes");
112 case QMessageBox::No:
113 console->write_dir(conn, "no");
116 console->displayToPrompt(conn);
117 mainWin->resetFocus();