m_closeable = true;
m_currentStorage = storage;
+ connect(pbUpdate, SIGNAL(clicked()), this,
+ SLOT(consoleUpdateSlots()));
+
+ connect(pbLabel, SIGNAL(clicked()), this,
+ SLOT(consoleLabelStorage()));
+
+ connect(pbMount, SIGNAL(clicked()), this,
+ SLOT(consoleMountStorage()));
+
+ connect(pbUnmount, SIGNAL(clicked()), this,
+ SLOT(consoleUnMountStorage()));
+
+ connect(pbStatus, SIGNAL(clicked()), this,
+ SLOT(statusStorageWindow()));
+
+ connect(pbRelease, SIGNAL(clicked()), this,
+ SLOT(consoleRelease()));
+
dockPage();
setCurrent();
}
+/* Label Media populating current storage by default */
+void Content::consoleLabelStorage()
+{
+ new labelPage(m_currentStorage);
+}
+
+/* Mount currently selected storage */
+void Content::consoleMountStorage()
+{
+ setConsoleCurrent();
+ /* if this storage is an autochanger, lets ask for the slot */
+ new mountDialog(m_console, m_currentStorage);
+}
+
+/* Unmount Currently selected storage */
+void Content::consoleUnMountStorage()
+{
+ QString cmd("umount storage=");
+ cmd += m_currentStorage;
+ consoleCommand(cmd);
+}
+
+void Content::statusStorageWindow()
+{
+ /* if one exists, then just set it current */
+ bool found = false;
+ foreach(Pages *page, mainWin->m_pagehash) {
+ if (mainWin->currentConsole() == page->console()) {
+ if (page->name() == tr("Storage Status %1").arg(m_currentStorage)) {
+ found = true;
+ page->setCurrent();
+ }
+ }
+ }
+ if (!found) {
+ QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
+ new StorStat(m_currentStorage, parentItem);
+ }
+}
+
/*
* The main meat of the class!! The function that querries the director and
* creates the widgets with appropriate values.
}
}
-/*
- * 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 Content::consoleStatusStorage()
-{
- QString cmd("status storage=");
- cmd += m_currentStorage;
- consoleCommand(cmd);
-}
-
-/* Label Media populating current storage by default */
-void Content::consoleLabelStorage()
-{
- new labelPage(m_currentStorage);
-}
-
void Content::treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)
{
}
-/* Mount currently selected storage */
-void Content::consoleMountStorage()
-{
- if (m_currentAutoChanger == 0){
- /* no autochanger, just execute the command in the console */
- QString cmd("mount storage=");
- cmd += m_currentStorage;
- consoleCommand(cmd);
- } else {
- setConsoleCurrent();
- /* if this storage is an autochanger, lets ask for the slot */
- new mountDialog(m_console, m_currentStorage);
- }
-}
-
-/* Unmount Currently selected storage */
-void Content::consoleUnMountStorage()
-{
- QString cmd("umount storage=");
- cmd += m_currentStorage;
- consoleCommand(cmd);
-}
-
/* Update Slots */
void Content::consoleUpdateSlots()
{
+ // TODO: get selected slots
QString cmd("update slots storage=");
cmd += m_currentStorage;
consoleCommand(cmd);
}
-/* Update Slots Scan*/
-void Content::consoleUpdateSlotsScan()
-{
- QString cmd("update slots scan storage=");
- cmd += m_currentStorage;
- consoleCommand(cmd);
-}
-
/* Release a tape in the drive */
void Content::consoleRelease()
{
cmd += m_currentStorage;
consoleCommand(cmd);
}
-
-/*
- * Open a status storage window
- */
-void Content::statusStorageWindow()
-{
- /* if one exists, then just set it current */
- bool found = false;
- foreach(Pages *page, mainWin->m_pagehash) {
- if (mainWin->currentConsole() == page->console()) {
- if (page->name() == tr("Storage Status %1").arg(m_currentStorage)) {
- found = true;
- page->setCurrent();
- }
- }
- }
- if (!found) {
- QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
- new StorStat(m_currentStorage, parentItem);
- }
-}
<item row="0" column="0" >
<widget class="QPushButton" name="pbUpdate" >
<property name="text" >
- <string>Update</string>
+ <string>Update slots</string>
</property>
<property name="icon" >
<iconset resource="../main.qrc" >:/images/view-refresh.png</iconset>
</item>
<item row="1" column="0" >
<widget class="QPushButton" name="pbMoveToTray" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
<property name="text" >
<string>Move to tray</string>
</property>
</item>
<item row="1" column="1" >
<widget class="QPushButton" name="pbEmptyTray" >
+ <property name="enabled" >
+ <bool>false</bool>
+ </property>
<property name="text" >
<string>Empty tray</string>
</property>
</widget>
</item>
<item row="2" column="0" >
- <widget class="QPushButton" name="pushButton" >
+ <widget class="QPushButton" name="pbMount" >
<property name="text" >
<string>Mount</string>
</property>
</widget>
</item>
<item row="2" column="1" >
- <widget class="QPushButton" name="pushButton_2" >
+ <widget class="QPushButton" name="pbUnmount" >
<property name="text" >
<string>Unmount</string>
</property>
</widget>
</item>
+ <item row="3" column="0" >
+ <widget class="QPushButton" name="pbStatus" >
+ <property name="text" >
+ <string>Status</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="1" >
+ <widget class="QPushButton" name="pbRelease" >
+ <property name="text" >
+ <string>Release</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>