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, February MMVII
29 #include <QMessageBox>
31 labelPage::labelPage() : Pages()
39 * An overload of the constructor to have a default storage show in the
40 * combobox on start. Used from context sensitive in storage class.
42 labelPage::labelPage(QString &defString) : Pages()
48 * moved the constructor code here for the overload.
50 void labelPage::showPage(QString &defString)
55 m_conn = m_console->notifyOff();
56 QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
57 thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/label.png")));
59 storageCombo->addItems(m_console->storage_list);
60 int index = storageCombo->findText(defString, Qt::MatchExactly);
62 storageCombo->setCurrentIndex(index);
64 poolCombo->addItems(m_console->pool_list);
65 connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
66 connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
67 connect(automountOnButton, SIGNAL(pressed()), this, SLOT(automountOnButtonPushed()));
68 connect(automountOffButton, SIGNAL(pressed()), this, SLOT(automountOffButtonPushed()));
75 void labelPage::okButtonPushed()
78 if (volumeName->text().toUtf8().data()[0] == 0) {
79 QMessageBox::warning(this, "No Volume name", "No Volume name given",
80 QMessageBox::Ok, QMessageBox::Ok);
84 scmd = QString("label volume=\"%1\" pool=\"%2\" storage=\"%3\" slot=%4\n")
85 .arg(volumeName->text())
86 .arg(poolCombo->currentText())
87 .arg(storageCombo->currentText())
88 .arg(slotSpin->value());
89 if (mainWin->m_commandDebug) {
90 Pmsg1(000, "sending command : %s\n", scmd.toUtf8().data());
93 m_console->write_dir(scmd.toUtf8().data());
94 m_console->displayToPrompt(m_conn);
95 m_console->notify(m_conn, true);
97 Pmsg0(000, "m_console==NULL !!!!!!\n");
100 mainWin->resetFocus();
103 void labelPage::cancelButtonPushed()
107 m_console->notify(m_conn, true);
109 Pmsg0(000, "m_console==NULL !!!!!!\n");
112 mainWin->resetFocus();
115 /* turn automount on */
116 void labelPage::automountOnButtonPushed()
118 QString cmd("automount on");
122 /* turn automount off */
123 void labelPage::automountOffButtonPushed()
125 QString cmd("automount off");