2 Bacula® - The Network Backup Solution
4 Copyright (C) 2007-2007 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 two of the GNU 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 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()
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)
58 * moved the constructor code here for the overload.
60 void labelPage::showPage(QString &defString)
65 m_conn = m_console->notifyOff();
66 QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
67 thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/label.png")));
69 storageCombo->addItems(m_console->storage_list);
70 int index = storageCombo->findText(defString, Qt::MatchExactly);
72 storageCombo->setCurrentIndex(index);
74 poolCombo->addItems(m_console->pool_list);
75 connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
76 connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
77 connect(automountOnButton, SIGNAL(pressed()), this, SLOT(automountOnButtonPushed()));
78 connect(automountOffButton, SIGNAL(pressed()), this, SLOT(automountOffButtonPushed()));
85 void labelPage::okButtonPushed()
88 if (volumeName->text().toUtf8().data()[0] == 0) {
89 QMessageBox::warning(this, "No Volume name", "No Volume name given",
90 QMessageBox::Ok, QMessageBox::Ok);
94 scmd = QString("label volume=\"%1\" pool=\"%2\" storage=\"%3\" slot=%4\n")
95 .arg(volumeName->text())
96 .arg(poolCombo->currentText())
97 .arg(storageCombo->currentText())
98 .arg(slotSpin->value());
99 if (mainWin->m_commandDebug) {
100 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 mainWin->resetFocus();
109 void labelPage::cancelButtonPushed()
112 m_console->notify(m_conn, true);
114 mainWin->resetFocus();
117 /* turn automount on */
118 void labelPage::automountOnButtonPushed()
120 QString cmd("automount on");
124 /* turn automount off */
125 void labelPage::automountOffButtonPushed()
127 QString cmd("automount off");