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
7 many others, a complete list can be found in the file AUTHORS.
8 This program is Free Software; you can redistribute it and/or
9 modify it under the terms of version three of the GNU Affero General Public
10 License as published by the Free Software Foundation and included
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
18 You should have received a copy of the GNU Affero General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
23 Bacula® is a registered trademark of Kern Sibbald.
24 The licensor of Bacula is the Free Software Foundation Europe
25 (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
26 Switzerland, email:ftf@fsfeurope.org.
32 * Kern Sibbald, February MMVII
38 #include <QMessageBox>
40 labelPage::labelPage() : Pages()
48 * An overload of the constructor to have a default storage show in the
49 * combobox on start. Used from context sensitive in storage class.
51 labelPage::labelPage(QString &defString) : Pages()
57 * moved the constructor code here for the overload.
59 void labelPage::showPage(QString &defString)
64 m_conn = m_console->notifyOff();
65 QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
66 thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/label.png")));
68 storageCombo->addItems(m_console->storage_list);
69 int index = storageCombo->findText(defString, Qt::MatchExactly);
71 storageCombo->setCurrentIndex(index);
73 poolCombo->addItems(m_console->pool_list);
74 connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
75 connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
76 connect(automountOnButton, SIGNAL(pressed()), this, SLOT(automountOnButtonPushed()));
77 connect(automountOffButton, SIGNAL(pressed()), this, SLOT(automountOffButtonPushed()));
84 void labelPage::okButtonPushed()
87 if (volumeName->text().toUtf8().data()[0] == 0) {
88 QMessageBox::warning(this, "No Volume name", "No Volume name given",
89 QMessageBox::Ok, QMessageBox::Ok);
93 scmd = QString("label volume=\"%1\" pool=\"%2\" storage=\"%3\" slot=%4\n")
94 .arg(volumeName->text())
95 .arg(poolCombo->currentText())
96 .arg(storageCombo->currentText())
97 .arg(slotSpin->value());
98 if (mainWin->m_commandDebug) {
99 Pmsg1(000, "sending command : %s\n", scmd.toUtf8().data());
102 m_console->write_dir(scmd.toUtf8().data());
103 m_console->displayToPrompt(m_conn);
104 m_console->notify(m_conn, true);
106 Pmsg0(000, "m_console==NULL !!!!!!\n");
109 mainWin->resetFocus();
112 void labelPage::cancelButtonPushed()
116 m_console->notify(m_conn, true);
118 Pmsg0(000, "m_console==NULL !!!!!!\n");
121 mainWin->resetFocus();
124 /* turn automount on */
125 void labelPage::automountOnButtonPushed()
127 QString cmd("automount on");
131 /* turn automount off */
132 void labelPage::automountOffButtonPushed()
134 QString cmd("automount off");