status dir on page select director item
All items with jobid= that I thought could work from joblist are done.
-relabel storage=DDS3 oldvolume=ddsvol003 volume=dds3vol003 slot=3 pool=dds3_hope
-in label slot spinner, limit the upper to the value of slots for that storage.
-
Create list of what does not work.
Ask Kern about bRestore and what to do with it in terms of priorities. Should
============================================================
DONE:
============================================================
+relabel storage=DDS3 oldvolume=ddsvol003 volume=dds3vol003 slot=3 pool=dds3_hope
+in label slot spinner, limit the upper to the value of slots for that storage.
+
Fix bug in myth box not working with .sql query="" command.
This was a fix in mysql
# Main window
FORMS += main.ui
FORMS += label/label.ui
+FORMS += relabel/relabel.ui
FORMS += mount/mount.ui
FORMS += console/console.ui
FORMS += restore/restore.ui restore/prerestore.ui restore/brestore.ui
HEADERS += label/label.h
SOURCES += label/label.cpp
+# Relabel dialog
+HEADERS += relabel/relabel.h
+SOURCES += relabel/relabel.cpp
+
# Mount dialog
HEADERS += mount/mount.h
SOURCES += mount/mount.cpp
#include "medialist.h"
#include "mediaedit/mediaedit.h"
#include "joblist/joblist.h"
+#include "relabel/relabel.h"
MediaList::MediaList()
{
mp_treeWidget->removeAction(actionListJobsOnVolume);
mp_treeWidget->removeAction(actionDeleteVolume);
mp_treeWidget->removeAction(actionPurgeVolume);
+ mp_treeWidget->removeAction(actionRelabelVolume);
}
}
mp_treeWidget->addAction(actionListJobsOnVolume);
mp_treeWidget->addAction(actionDeleteVolume);
mp_treeWidget->addAction(actionPurgeVolume);
+ mp_treeWidget->addAction(actionRelabelVolume);
}
}
}
connect(actionListJobsOnVolume, SIGNAL(triggered()), this, SLOT(showJobs()));
connect(actionDeleteVolume, SIGNAL(triggered()), this, SLOT(deleteVolume()));
connect(actionPurgeVolume, SIGNAL(triggered()), this, SLOT(purgeVolume()));
+ connect(actionRelabelVolume, SIGNAL(triggered()), this, SLOT(relabelVolume()));
connect(mp_treeWidget, SIGNAL(
currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
QString cmd("purge volume=");
cmd += m_currentVolumeName;
consoleCommand(cmd);
+ populateTree();
+}
+/*
+ * Called from the signal of the context sensitive menu!
+ */
+void MediaList::relabelVolume()
+{
+ placeConsoleOnTop();
+ new relabelDialog(m_console, m_currentVolumeName);
}
void editVolume();
void deleteVolume();
void purgeVolume();
+ void relabelVolume();
private:
void createContextMenu();
<string>Purge Volume</string>
</property>
</action>
+ <action name="actionRelabelVolume" >
+ <property name="icon" >
+ <iconset>../images/unmark.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Relabel Volume</string>
+ </property>
+ </action>
</widget>
<resources/>
<connections/>
--- /dev/null
+/*
+ Bacula® - The Network Backup Solution
+
+ Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+
+ The main author of Bacula is Kern Sibbald, with contributions from
+ many others, a complete list can be found in the file AUTHORS.
+ This program is Free Software; you can redistribute it and/or
+ modify it under the terms of version two of the GNU General Public
+ License as published by the Free Software Foundation plus additions
+ that are listed in the file LICENSE.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+ Bacula® is a registered trademark of John Walker.
+ The licensor of Bacula is the Free Software Foundation Europe
+ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+ Switzerland, email:ftf@fsfeurope.org.
+*/
+
+/*
+ * Label Dialog class
+ *
+ * Kern Sibbald, February MMVII
+ *
+ */
+
+#include "bat.h"
+#include "relabel.h"
+#include <QMessageBox>
+
+/*
+ * An overload of the constructor to have a default storage show in the
+ * combobox on start. Used from context sensitive in storage class.
+ */
+relabelDialog::relabelDialog(Console *console, QString &fromVolume)
+{
+ m_console = console;
+ m_fromVolume = fromVolume;
+ m_console->notify(false);
+ setupUi(this);
+ storageCombo->addItems(console->storage_list);
+ poolCombo->addItems(console->pool_list);
+ volumeName->setText(fromVolume);
+ QString fromText("From Volume : ");
+ fromText += fromVolume;
+ fromLabel->setText(fromText);
+ this->show();
+}
+
+
+void relabelDialog::accept()
+{
+ QString scmd;
+ if (volumeName->text().toUtf8().data()[0] == 0) {
+ QMessageBox::warning(this, "No Volume name", "No Volume name given",
+ QMessageBox::Ok, QMessageBox::Ok);
+ return;
+ }
+ if (m_fromVolume == volumeName->text().toUtf8()) {
+ QMessageBox::warning(this, "New name must be different", "New name must be different",
+ QMessageBox::Ok, QMessageBox::Ok);
+ return;
+ }
+
+ this->hide();
+ scmd = QString("relabel storage=\"%1\" oldvolume=\"%2\" volume=\"%3\" pool=\"%4\" slot=%5")
+ .arg(storageCombo->currentText())
+ .arg(m_fromVolume)
+ .arg(volumeName->text())
+ .arg(poolCombo->currentText())
+ .arg(slotSpin->value());
+ /* FIXME Make this a user configurable logging action and dont use printf */
+ //printf("sending command : %s\n",scmd.toUtf8().data());
+ m_console->write_dir(scmd.toUtf8().data());
+ m_console->displayToPrompt();
+ m_console->notify(true);
+ delete this;
+ mainWin->resetFocus();
+}
+
+void relabelDialog::reject()
+{
+ this->hide();
+ m_console->notify(true);
+ delete this;
+ mainWin->resetFocus();
+}
--- /dev/null
+/*
+ Bacula® - The Network Backup Solution
+
+ Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+
+ The main author of Bacula is Kern Sibbald, with contributions from
+ many others, a complete list can be found in the file AUTHORS.
+ This program is Free Software; you can redistribute it and/or
+ modify it under the terms of version two of the GNU General Public
+ License as published by the Free Software Foundation plus additions
+ that are listed in the file LICENSE.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+ Bacula® is a registered trademark of John Walker.
+ The licensor of Bacula is the Free Software Foundation Europe
+ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+ Switzerland, email:ftf@fsfeurope.org.
+*/
+/*
+ * Kern Sibbald, February MMVII
+ */
+
+#ifndef _RELABEL_H_
+#define _RELABEL_H_
+
+#include <QtGui>
+#include "ui_relabel.h"
+#include "console.h"
+
+class relabelDialog : public QDialog, public Ui::relabelForm
+{
+ Q_OBJECT
+
+public:
+ relabelDialog(Console *console, QString &fromVolume);
+
+private slots:
+ void accept();
+ void reject();
+
+private:
+ Console *m_console;
+ QString m_fromVolume;
+};
+
+#endif /* _RELABEL_H_ */
--- /dev/null
+<ui version="4.0" >
+ <class>relabelForm</class>
+ <widget class="QDialog" name="relabelForm" >
+ <property name="windowModality" >
+ <enum>Qt::WindowModal</enum>
+ </property>
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>212</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Label</string>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="fromLabel" >
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>20</height>
+ </size>
+ </property>
+ <property name="text" >
+ <string>From Volume :</string>
+ </property>
+ <property name="alignment" >
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Maximum</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>382</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="0" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Maximum</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>21</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="5" column="0" >
+ <widget class="QDialogButtonBox" name="buttonBox" >
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons" >
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0" >
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="3" column="1" >
+ <widget class="QSpinBox" name="slotSpin" >
+ <property name="maximum" >
+ <number>10000</number>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_3" >
+ <property name="text" >
+ <string>Pool:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>poolCombo</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Storage:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>storageCombo</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1" >
+ <widget class="QLineEdit" name="volumeName" >
+ <property name="minimumSize" >
+ <size>
+ <width>200</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <widget class="QComboBox" name="poolCombo" />
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="label_5" >
+ <property name="text" >
+ <string>New Volume Name:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>volumeName</cstring>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1" >
+ <widget class="QComboBox" name="storageCombo" />
+ </item>
+ <item row="3" column="0" >
+ <widget class="QLabel" name="label_4" >
+ <property name="text" >
+ <string>Slot:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>slotSpin</cstring>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>71</width>
+ <height>21</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="maximumSize" >
+ <size>
+ <width>16777215</width>
+ <height>30</height>
+ </size>
+ </property>
+ <property name="text" >
+ <string><html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">Relabel a Volume</span></p></body></html></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>81</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>relabelForm</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>248</x>
+ <y>254</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>relabelForm</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel" >
+ <x>316</x>
+ <y>260</y>
+ </hint>
+ <hint type="destinationlabel" >
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>