#include <QMessageBox>
labelDialog::labelDialog(Console *console)
+{
+ QString deflt("");
+ showDialog(console, deflt);
+}
+
+/*
+ * An overload of the constructor to have a default storage show in the
+ * combobox on start. Used from context sensitive in storage class.
+ */
+labelDialog::labelDialog(Console *console, QString &defString)
+{
+ showDialog(console, defString);
+}
+
+/*
+ * moved the constructor code here for the overload.
+ */
+void labelDialog::showDialog(Console *console, QString &defString)
{
m_console = console;
m_console->notify(false);
setupUi(this);
storageCombo->addItems(console->storage_list);
+ int index = storageCombo->findText(defString, Qt::MatchExactly);
+ if (index != -1) {
+ storageCombo->setCurrentIndex(index);
+ }
poolCombo->addItems(console->pool_list);
this->show();
}
+
void labelDialog::accept()
{
QString scmd;
{
if (!m_console->is_connectedGui())
return;
+ /* Bring this directors console to the front of the stack */
+ mainWin->treeWidget->setCurrentItem(mainWin->getFromHash(m_console));
m_console->display_text("Context sensitive command :\n\n");
m_console->display_text("**** ");
m_console->display_text(command + " ****\n");
m_console->display_text("Director Response :\n\n");
m_console->write_dir(command.toUtf8().data());
m_console->displayToPrompt();
- /* Bring this directors console to the front of the stack */
- mainWin->treeWidget->setCurrentItem(mainWin->getFromHash(m_console));
}
/*
m_populated = false;
m_checkcurwidget = true;
m_closeable = false;
+ m_currentStorage = "";
setTitle();
}
int treedepth = previouswidgetitem->data(0, Qt::UserRole).toInt();
if (treedepth == 1){
mp_treeWidget->removeAction(actionStatusStorageInConsole);
+ mp_treeWidget->removeAction(actionLabelStorage);
+ mp_treeWidget->removeAction(actionMountStorage);
+ mp_treeWidget->removeAction(actionUnMountStorage);
}
}
if (treedepth == 1){
/* set a hold variable to the storage name in case the context sensitive
* menu is used */
- m_currentlyselected=currentwidgetitem->text(0);
+ m_currentStorage=currentwidgetitem->text(0);
mp_treeWidget->addAction(actionStatusStorageInConsole);
+ mp_treeWidget->addAction(actionLabelStorage);
+ mp_treeWidget->addAction(actionMountStorage);
+ mp_treeWidget->addAction(actionUnMountStorage);
+ QString text;
+ text = "Status Storage " + m_currentStorage;
+ actionStatusStorageInConsole->setText(text);
+ text = "Label media in Storage " + m_currentStorage;
+ actionLabelStorage->setText(text);
+ text = "Mount media in Storage " + m_currentStorage;
+ actionMountStorage->setText(text);
+ text = "\"UN\" Mount media in Storage " + m_currentStorage;
+ actionUnMountStorage->setText(text);
}
}
}
SLOT(populateTree()));
connect(actionStatusStorageInConsole, SIGNAL(triggered()), this,
SLOT(consoleStatusStorage()));
-}
-
-/*
- * Function responding to actionListJobsofStorage which calls mainwin function
- * to create a window of a list of jobs of this storage.
- */
-void Storage::consoleStatusStorage()
-{
- QString cmd("status storage=");
- cmd += m_currentlyselected;
- consoleCommand(cmd);
-// m_console->write_dir(cmd.toUtf8().data());
-// m_console->displayToPrompt();
- /* Bring this directors console to the front of the stack */
-// mainWin->treeWidget->setCurrentItem(mainWin->getFromHash(m_console));
+ connect(actionLabelStorage, SIGNAL(triggered()), this,
+ SLOT(consoleLabelStorage()));
+ connect(actionMountStorage, SIGNAL(triggered()), this,
+ SLOT(consoleMountStorage()));
+ connect(actionUnMountStorage, SIGNAL(triggered()), this,
+ SLOT(consoleUnMountStorage()));
}
/*
m_populated=true;
}
}
+
+/*
+ * Functions to respond to local context sensitive menu sending console commands
+ * If I could figure out how to make these one function passing a string, Yaaaaaa
+ */
+void Storage::consoleStatusStorage()
+{
+ QString cmd("status storage=");
+ cmd += m_currentStorage;
+ consoleCommand(cmd);
+}
+void Storage::consoleLabelStorage()
+{
+ new labelDialog(m_console, m_currentStorage);
+}
+void Storage::consoleMountStorage()
+{
+ QString cmd("mount storage=");
+ cmd += m_currentStorage;
+ consoleCommand(cmd);
+}
+void Storage::consoleUnMountStorage()
+{
+ QString cmd("umount storage=");
+ cmd += m_currentStorage;
+ consoleCommand(cmd);
+}
<rect>
<x>0</x>
<y>0</y>
- <width>763</width>
- <height>650</height>
+ <width>791</width>
+ <height>644</height>
</rect>
</property>
<property name="windowTitle" >
<string>Status Storage In Console</string>
</property>
</action>
+ <action name="actionLabelStorage" >
+ <property name="icon" >
+ <iconset>../images/unmark.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Label Storage</string>
+ </property>
+ </action>
+ <action name="actionMountStorage" >
+ <property name="icon" >
+ <iconset>../images/unmark.png</iconset>
+ </property>
+ <property name="text" >
+ <string>MountStorage</string>
+ </property>
+ </action>
+ <action name="actionUnMountStorage" >
+ <property name="icon" >
+ <iconset>../images/unmark.png</iconset>
+ </property>
+ <property name="text" >
+ <string>UnMount Storage</string>
+ </property>
+ </action>
</widget>
<resources/>
<connections/>