void Clients::showJobs()
{
QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
- mainWin->createPageJobList("", m_currentlyselected, "", parentItem);
+ mainWin->createPageJobList("", m_currentlyselected, "", "", parentItem);
}
/*
int treedepth = previouswidgetitem->data(0, Qt::UserRole).toInt();
if (treedepth == 1) {
mp_treeWidget->removeAction(actionStatusFileSetInConsole);
+ mp_treeWidget->removeAction(actionShowJobs);
}
}
* menu is used */
m_currentlyselected=currentwidgetitem->text(0);
mp_treeWidget->addAction(actionStatusFileSetInConsole);
+ mp_treeWidget->addAction(actionShowJobs);
}
}
}
SLOT(populateTree()));
connect(actionStatusFileSetInConsole, SIGNAL(triggered()), this,
SLOT(consoleStatusFileSet()));
+ connect(actionShowJobs, SIGNAL(triggered()), this,
+ SLOT(showJobs()));
}
/*
restoreGeometry(settings.value("geometry").toByteArray());
settings.endGroup();
}
+
+/*
+ * Create a JobList object pre-populating a fileset
+ */
+void FileSet::showJobs()
+{
+ QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
+ mainWin->createPageJobList("", "", "", m_currentlyselected, parentItem);
+}
private slots:
void populateTree();
void consoleStatusFileSet();
+ void showJobs();
private:
void writeSettings();
<rect>
<x>0</x>
<y>0</y>
- <width>763</width>
- <height>650</height>
+ <width>318</width>
+ <height>246</height>
</rect>
</property>
<property name="windowTitle" >
</layout>
<action name="actionRefreshFileSet" >
<property name="icon" >
- <iconset>:images/view-refresh.svg</iconset>
+ <iconset resource="../main.qrc" >:/images/view-refresh.svg</iconset>
</property>
<property name="text" >
<string>Refresh FileSet List</string>
</action>
<action name="actionStatusFileSetInConsole" >
<property name="icon" >
- <iconset>:images/status.png</iconset>
+ <iconset resource="../main.qrc" >:/images/status.png</iconset>
</property>
<property name="text" >
<string>Status FileSet In Console</string>
</property>
</action>
+ <action name="actionShowJobs" >
+ <property name="icon" >
+ <iconset resource="../main.qrc" >:/images/emblem-system.svg</iconset>
+ </property>
+ <property name="text" >
+ <string>ShowJobs</string>
+ </property>
+ </action>
</widget>
- <resources/>
+ <resources>
+ <include location="../main.qrc" />
+ </resources>
<connections/>
</ui>
* Constructor for the class
*/
JobList::JobList(const QString &mediaName, const QString &clientName,
- const QString &jobName, QTreeWidgetItem *parentTreeWidgetItem)
+ const QString &jobName, const QString &filesetName, QTreeWidgetItem *parentTreeWidgetItem)
{
setupUi(this);
m_name = ""; /* treeWidgetName has a virtual override in this class */
m_mediaName = mediaName;
m_clientName = clientName;
m_jobName = jobName;
+ m_filesetName = filesetName;
+ m_filesetName = filesetName;
pgInitialize(parentTreeWidgetItem);
QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/emblem-system.svg")));
m_resultCount = 0;
m_populated = false;
m_closeable = false;
- if ((m_mediaName != "") || (m_clientName != "") || (m_jobName != ""))
+ if ((m_mediaName != "") || (m_clientName != "") || (m_jobName != "") || (m_filesetName != ""))
m_closeable=true;
m_checkCurrentWidget = true;
createConnections();
statusComboBox->addItem("Any");
fileSetComboBox->addItem("Any");
fileSetComboBox->addItems(m_console->fileset_list);
+ int filesetIndex = fileSetComboBox->findText(m_filesetName, Qt::MatchExactly);
+ if (filesetIndex != -1) {
+ fileSetComboBox->setCurrentIndex(filesetIndex);
+ }
QString statusQuery("SELECT JobStatusLong FROM Status");
if (mainWin->m_sqlDebug) {
Pmsg1(000, "Query cmd : %s\n",query.toUtf8().data());
conditions.append("Job.PurgedFiles='" + purgedComboBox->itemText(purgedIndex) + "'");
}
int fileSetIndex = fileSetComboBox->currentIndex();
+ if (fileSetIndex != -1)
+ m_filesetName = fileSetComboBox->itemText(fileSetIndex);
if ((fileSetIndex != -1) && (fileSetComboBox->itemText(fileSetIndex) != "Any")) {
conditions.append("FileSet.FileSet='" + fileSetComboBox->itemText(fileSetIndex) + "'");
}
*/
void JobList::treeWidgetName(QString &desc)
{
- if ((m_mediaName == "") && (m_clientName == "") && (m_jobName == "")) {
+ if ((m_mediaName == "") && (m_clientName == "") && (m_jobName == "") && (m_filesetName == "")) {
desc = "JobList";
} else {
desc = "JobList ";
if (m_jobName != "" ) {
desc += "of Job " + m_jobName;
}
+ if (m_filesetName != "" ) {
+ desc += "of fileset " + m_filesetName;
+ }
}
}
public:
JobList(const QString &medianame, const QString &clientname,
- const QString &jobname, QTreeWidgetItem *);
+ const QString &jobname, const QString &filesetname, QTreeWidgetItem *);
virtual void PgSeltreeWidgetClicked();
virtual void currentStackItem();
int m_resultCount;
QString m_mediaName;
QString m_clientName;
QString m_jobName;
+ QString m_filesetName;
QString m_currentJob;
bool m_populated;
bool m_checkCurrentWidget;
void Jobs::listJobs()
{
QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
- mainWin->createPageJobList("", "", m_currentlyselected, parentItem);
+ mainWin->createPageJobList("", "", m_currentlyselected, "", parentItem);
}
* Create instances in alphabetic order of the rest
* of the classes that will by default exist under each Director.
*/
-// new new bRestore();
+// new bRestore();
new Clients();
new FileSet();
new Jobs();
- createPageJobList("", "", "", NULL);
+ createPageJobList("", "", "", "", NULL);
new MediaList();
new Storage();
* create an instance of the the joblist class on the stack
*/
void MainWin::createPageJobList(const QString &media, const QString &client,
- const QString &job, QTreeWidgetItem *parentTreeWidgetItem)
+ const QString &job, const QString &fileset, QTreeWidgetItem *parentTreeWidgetItem)
{
QTreeWidgetItem *holdItem;
/* save current tree widget item in case query produces no results */
holdItem = treeWidget->currentItem();
- JobList* joblist = new JobList(media, client, job, parentTreeWidgetItem);
+ JobList* joblist = new JobList(media, client, job, fileset, parentTreeWidgetItem);
/* If this is a query of jobs on a specific media */
- if ((media != "") || (client != "") || (job != "")) {
+ if ((media != "") || (client != "") || (job != "") || (fileset != "")) {
joblist->setCurrent();
/* did query produce results, if not close window and set back to hold */
if (joblist->m_resultCount == 0) {
/* This is a list of consoles */
QHash<QTreeWidgetItem*,Console*> m_consoleHash;
void createPageJobList(const QString &, const QString &,
- const QString &, QTreeWidgetItem *);
+ const QString &, const QString &, QTreeWidgetItem *);
QString m_dtformat;
/* Begin Preferences variables */
bool m_commDebug;
void MediaList::showJobs()
{
QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
- mainWin->createPageJobList(m_currentVolumeName, "", "", parentItem);
+ mainWin->createPageJobList(m_currentVolumeName, "", "", "", parentItem);
}
/*