2 Bacula(R) - The Network Backup Solution
4 Copyright (C) 2000-2015 Kern Sibbald
5 Copyright (C) 2007-2010 Free Software Foundation Europe e.V.
7 The original author of Bacula is Kern Sibbald, with contributions
8 from many others, a complete list can be found in the file AUTHORS.
10 You may use this file and others of this release according to the
11 license defined in the LICENSE file, which includes the Affero General
12 Public License, v3.0 ("AGPLv3") and some additional permissions and
13 terms pursuant to its AGPLv3 Section 7.
15 This notice must be preserved when any source code is
16 conveyed and/or propagated.
18 Bacula(R) is a registered trademark of Kern Sibbald.
24 * Kern Sibbald, March MMVII
32 * Read the items for the selection
34 selectDialog::selectDialog(Console *console, int conn) : QDialog()
39 QListWidgetItem *item;
43 m_console->notify(m_conn, false);
45 connect(listBox, SIGNAL(currentRowChanged(int)), this, SLOT(index_change(int)));
46 setAttribute(Qt::WA_DeleteOnClose);
47 m_console->read(m_conn); /* get title */
48 labelWidget->setText(m_console->msg(m_conn));
49 while ((stat=m_console->read(m_conn)) > 0) {
50 item = new QListWidgetItem;
51 item->setText(m_console->msg(m_conn));
52 listBox->insertItem(row++, item);
54 m_console->displayToPrompt(m_conn);
58 void selectDialog::accept()
63 bsnprintf(cmd, sizeof(cmd), "%d", m_index+1);
64 m_console->write_dir(m_conn, cmd);
65 m_console->displayToPrompt(m_conn);
67 mainWin->resetFocus();
68 m_console->displayToPrompt(m_conn);
69 m_console->notify(m_conn, true);
73 void selectDialog::reject()
76 mainWin->set_status(tr(" Canceled"));
78 mainWin->resetFocus();
79 m_console->beginNewCommand(m_conn);
80 m_console->notify(m_conn, true);
84 * Called here when the jobname combo box is changed.
85 * We load the default values for the new job in the
88 void selectDialog::index_change(int index)
94 * Handle yesno PopUp when Bacula asks a yes/no question.
97 * Read the items for the selection
99 yesnoPopUp::yesnoPopUp(Console *console, int conn) : QDialog()
103 setAttribute(Qt::WA_DeleteOnClose);
104 console->read(conn); /* get yesno question */
105 msgBox.setWindowTitle(tr("Bat Question"));
106 msgBox.setText(console->msg(conn));
107 msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
108 console->displayToPrompt(conn);
109 switch (msgBox.exec()) {
110 case QMessageBox::Yes:
111 console->write_dir(conn, "yes");
113 case QMessageBox::No:
114 console->write_dir(conn, "no");
117 console->displayToPrompt(conn);
118 mainWin->resetFocus();