#include <math.h>
#include "medialist.h"
#include "mediaedit/mediaedit.h"
+#include "mediainfo/mediainfo.h"
#include "joblist/joblist.h"
#include "relabel/relabel.h"
#include "run/run.h"
MediaList::MediaList()
{
setupUi(this);
- m_name = tr("Media");
+ m_name = tr("Pools");
pgInitialize();
QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/cartridge.png")));
/* add context sensitive menu items specific to this classto the page
* selector tree. m_contextActions is QList of QActions */
m_contextActions.append(actionRefreshMediaList);
- dockPage();
}
MediaList::~MediaList()
<< tr("Volume Name") << tr("Id") << tr("Status") << tr("Enabled") << tr("Bytes") << tr("Files")
<< tr("Jobs") << tr("Retention") << tr("Media Type") << tr("Slot") << tr("Use Duration")
<< tr("Max Jobs") << tr("Max Files") << tr("Max Bytes") << tr("Recycle")
- << tr("RecyclePool") << tr("Last Written"));
+ << tr("Last Written") << tr("First Written") << tr("Read Time")
+ << tr("Write Time") << tr("Recycle Count") << tr("Recycle Pool"));
m_checkcurwidget = false;
mp_treeWidget->clear();
" Media.VolUseDuration AS UseDuration,"
" Media.MaxVolJobs AS MaxJobs, Media.MaxVolFiles AS MaxFiles,"
" Media.MaxVolBytes AS MaxBytes, Media.Recycle AS Recycle,"
- " Pol.Name AS RecyclePool, Media.LastWritten AS LastWritten"
+ " Media.LastWritten AS LastWritten,"
+ " Media.FirstWritten AS FirstWritten,"
+ " (VolReadTime/1000000) AS ReadTime, (VolWriteTime/1000000) AS WriteTime,"
+ " RecycleCount AS ReCyCount,"
+ " RecPool.Name AS RecyclePool"
" FROM Media"
" JOIN Pool ON (Media.PoolId=Pool.PoolId)"
- " LEFT OUTER JOIN Pool AS Pol ON (Media.RecyclePoolId=Pol.PoolId)"
+ " LEFT OUTER JOIN Pool AS RecPool ON (Media.RecyclePoolId=RecPool.PoolId)"
" WHERE ";
query += " Pool.Name IN (" + pool_comsep + ")";
query += " ORDER BY Pool.Name, Media";
/* recycle */
mediaitem.setBoolFld(index++, fld.next());
- /* recycle pool */
+ /* last written */
mediaitem.setTextFld(index++, fld.next());
- /* last written */
+ /* first written */
+ mediaitem.setTextFld(index++, fld.next());
+
+ /* read time */
+ mediaitem.setDurationFld(index++, fld.next());
+
+ /* write time */
+ mediaitem.setDurationFld(index++, fld.next());
+
+ /* Recycle Count */
+ mediaitem.setNumericFld(index++, fld.next());
+
+ /* recycle pool */
mediaitem.setTextFld(index++, fld.next());
} /* foreach resultline */
mainWin->createPageJobList(m_currentVolumeName, "", "", "", parentItem);
}
+/*
+ * Called from the signal of the context sensitive menu!
+ */
+void MediaList::viewVolume()
+{
+ QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
+ MediaInfo* view = new MediaInfo(parentItem, m_currentVolumeName);
+ connect(view, SIGNAL(destroyed()), this, SLOT(populateTree()));
+
+}
+
/*
* When the treeWidgetItem in the page selector tree is singleclicked, Make sure
* The tree has been populated.
populateTree();
createContextMenu();
}
+ dockPage();
}
/*
void MediaList::createContextMenu()
{
mp_treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu);
+ connect(mp_treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(viewVolume()));
connect(actionEditVolume, SIGNAL(triggered()), this, SLOT(editVolume()));
connect(actionListJobsOnVolume, SIGNAL(triggered()), this, SLOT(showJobs()));
connect(actionDeleteVolume, SIGNAL(triggered()), this, SLOT(deleteVolume()));