2 Bacula® - The Network Backup Solution
4 Copyright (C) 2007-2011 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, February MMVII
26 #include <QMessageBox>
28 labelPage::labelPage() : Pages()
36 * An overload of the constructor to have a default storage show in the
37 * combobox on start. Used from context sensitive in storage class.
39 labelPage::labelPage(QString &defString) : Pages()
45 * moved the constructor code here for the overload.
47 void labelPage::showPage(QString &defString)
52 m_conn = m_console->notifyOff();
53 QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
54 thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/label.png")));
56 storageCombo->addItems(m_console->storage_list);
57 int index = storageCombo->findText(defString, Qt::MatchExactly);
59 storageCombo->setCurrentIndex(index);
61 poolCombo->addItems(m_console->pool_list);
62 connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
63 connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
64 connect(automountOnButton, SIGNAL(pressed()), this, SLOT(automountOnButtonPushed()));
65 connect(automountOffButton, SIGNAL(pressed()), this, SLOT(automountOffButtonPushed()));
72 void labelPage::okButtonPushed()
75 if (volumeName->text().toUtf8().data()[0] == 0) {
76 QMessageBox::warning(this, "No Volume name", "No Volume name given",
77 QMessageBox::Ok, QMessageBox::Ok);
81 scmd = QString("label volume=\"%1\" pool=\"%2\" storage=\"%3\" slot=%4\n")
82 .arg(volumeName->text())
83 .arg(poolCombo->currentText())
84 .arg(storageCombo->currentText())
85 .arg(slotSpin->value());
86 if (mainWin->m_commandDebug) {
87 Pmsg1(000, "sending command : %s\n", scmd.toUtf8().data());
90 m_console->write_dir(scmd.toUtf8().data());
91 m_console->displayToPrompt(m_conn);
92 m_console->notify(m_conn, true);
94 Pmsg0(000, "m_console==NULL !!!!!!\n");
97 mainWin->resetFocus();
100 void labelPage::cancelButtonPushed()
104 m_console->notify(m_conn, true);
106 Pmsg0(000, "m_console==NULL !!!!!!\n");
109 mainWin->resetFocus();
112 /* turn automount on */
113 void labelPage::automountOnButtonPushed()
115 QString cmd("automount on");
119 /* turn automount off */
120 void labelPage::automountOffButtonPushed()
122 QString cmd("automount off");