2 Bacula(R) - The Network Backup Solution
4 Copyright (C) 2000-2015 Kern Sibbald
5 Copyright (C) 2007-2011 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, February MMVII
30 #include <QMessageBox>
32 labelPage::labelPage() : Pages()
40 * An overload of the constructor to have a default storage show in the
41 * combobox on start. Used from context sensitive in storage class.
43 labelPage::labelPage(QString &defString) : Pages()
49 * moved the constructor code here for the overload.
51 void labelPage::showPage(QString &defString)
56 m_conn = m_console->notifyOff();
57 QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
58 thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/label.png")));
60 storageCombo->addItems(m_console->storage_list);
61 int index = storageCombo->findText(defString, Qt::MatchExactly);
63 storageCombo->setCurrentIndex(index);
65 poolCombo->addItems(m_console->pool_list);
66 connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
67 connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
68 connect(automountOnButton, SIGNAL(pressed()), this, SLOT(automountOnButtonPushed()));
69 connect(automountOffButton, SIGNAL(pressed()), this, SLOT(automountOffButtonPushed()));
76 void labelPage::okButtonPushed()
79 if (volumeName->text().toUtf8().data()[0] == 0) {
80 QMessageBox::warning(this, "No Volume name", "No Volume name given",
81 QMessageBox::Ok, QMessageBox::Ok);
85 scmd = QString("label volume=\"%1\" pool=\"%2\" storage=\"%3\" slot=%4\n")
86 .arg(volumeName->text())
87 .arg(poolCombo->currentText())
88 .arg(storageCombo->currentText())
89 .arg(slotSpin->value());
90 if (mainWin->m_commandDebug) {
91 Pmsg1(000, "sending command : %s\n", scmd.toUtf8().data());
94 m_console->write_dir(scmd.toUtf8().data());
95 m_console->displayToPrompt(m_conn);
96 m_console->notify(m_conn, true);
98 Pmsg0(000, "m_console==NULL !!!!!!\n");
101 mainWin->resetFocus();
104 void labelPage::cancelButtonPushed()
108 m_console->notify(m_conn, true);
110 Pmsg0(000, "m_console==NULL !!!!!!\n");
113 mainWin->resetFocus();
116 /* turn automount on */
117 void labelPage::automountOnButtonPushed()
119 QString cmd("automount on");
123 /* turn automount off */
124 void labelPage::automountOffButtonPushed()
126 QString cmd("automount off");