dhb
====================================================
-joblist cancel a running job.
-
-Fixes to final restore widgets.
- all but messages done.
-
Add context sensitive options for most commands
status dir on page select director item
All items with jobid= that I thought could work from joblist are done.
============================================================
DONE:
============================================================
+joblist cancel a running job.
+
+Fixes to final restore widgets.
+
Set default for replace in run restore job to "always"??????
Option in joblist like with restore from jobid but restore populating timestamp
<< "Job Level" << "Job Files" << "Job Bytes" << "Job Status" << "Purged" << "File Set" );
m_purgedIndex = headerlist.indexOf("Purged");
m_typeIndex = headerlist.indexOf("Job Type");
- statusIndex = headerlist.indexOf("Job Status");
+ m_statusIndex = headerlist.indexOf("Job Status");
/* Initialize the QTableWidget */
m_checkCurrentWidget = false;
foreach (resultline, results) {
fieldlist = resultline.split("\t");
int column = 0;
- bool statusIndexDone = false;
+ bool m_statusIndexDone = false;
QString statusCode("");
/* Iterate through fields in the record */
foreach (field, fieldlist) {
field = field.trimmed(); /* strip leading & trailing spaces */
- if ((column == statusIndex) && (!statusIndexDone)){
- statusIndexDone = true;
+ if ((column == m_statusIndex) && (!m_statusIndexDone)){
+ m_statusIndexDone = true;
statusCode = field;
} else {
p_tableitem = new QTableWidgetItem(field,1);
p_tableitem->setFlags(0);
p_tableitem->setForeground(blackBrush);
mp_tableWidget->setItem(row, column, p_tableitem);
- if (column == statusIndex)
+ if (column == m_statusIndex)
setStatusColor(p_tableitem, statusCode);
column++;
}
int row = currentItem->row();
QTableWidgetItem* jobitem = mp_tableWidget->item(row, 0);
m_currentJob = jobitem->text();
+
+ /* include purged action or not */
jobitem = mp_tableWidget->item(row, m_purgedIndex);
QString purged = jobitem->text();
mp_tableWidget->removeAction(actionPurgeFiles);
if (purged == "0") {
mp_tableWidget->addAction(actionPurgeFiles);
}
+ /* include restore from time and job action or not */
jobitem = mp_tableWidget->item(row, m_typeIndex);
- QString status = jobitem->text();
+ QString type = jobitem->text();
mp_tableWidget->removeAction(actionRestoreFromJob);
mp_tableWidget->removeAction(actionRestoreFromTime);
- if (status == "B") {
+ if (type == "B") {
mp_tableWidget->addAction(actionRestoreFromJob);
mp_tableWidget->addAction(actionRestoreFromTime);
}
+ /* include cancel action or not */
+ jobitem = mp_tableWidget->item(row, m_statusIndex);
+ QString status = jobitem->text();
+ mp_tableWidget->removeAction(actionCancelJob);
+ if (status == "Running") {
+ mp_tableWidget->addAction(actionCancelJob);
+ }
}
}
SLOT(preRestoreFromTime()));
connect(actionShowLogForJob, SIGNAL(triggered()), this,
SLOT(showLogForJob()));
+ connect(actionCancelJob, SIGNAL(triggered()), this,
+ SLOT(consoleCancelJob()));
}
/*
QTreeWidgetItem* pageSelectorTreeWidgetItem = mainWin->getFromHash(this);
new JobLog(m_currentJob, pageSelectorTreeWidgetItem);
}
+
+/*
+ * Cancel a running job
+ */
+void JobList::consoleCancelJob()
+{
+ QString cmd("cancel jobid=");
+ cmd += m_currentJob;
+ consoleCommand(cmd);
+}
void preRestoreFromJob();
void preRestoreFromTime();
void showLogForJob();
+ void consoleCancelJob();
private:
void createConnections();
bool m_checkCurrentWidget;
int m_purgedIndex;
int m_typeIndex;
+ int m_statusIndex;
};
#endif /* _JOBLIST_H_ */
</layout>
<action name="actionRefreshJobList" >
<property name="icon" >
- <iconset>../../../../../../../:images/run.png</iconset>
+ <iconset>:images/run.png</iconset>
</property>
<property name="text" >
<string>Refresh Job List</string>
</action>
<action name="actionListJobid" >
<property name="icon" >
- <iconset>../../../../../../../:images/unmark.png</iconset>
+ <iconset>:images/unmark.png</iconset>
</property>
<property name="text" >
<string>ListJobid</string>
</action>
<action name="actionListFilesOnJob" >
<property name="icon" >
- <iconset>../../../../../../../:images/unmark.png</iconset>
+ <iconset>:images/unmark.png</iconset>
</property>
<property name="text" >
<string>List Files On Job</string>
</action>
<action name="actionListJobMedia" >
<property name="icon" >
- <iconset>../../../../../../../:images/unmark.png</iconset>
+ <iconset>:images/unmark.png</iconset>
</property>
<property name="text" >
<string>ListJobMedia</string>
</action>
<action name="actionListVolumes" >
<property name="icon" >
- <iconset>../../../../../../../:images/unmark.png</iconset>
+ <iconset>:images/unmark.png</iconset>
</property>
<property name="text" >
<string>ListVolumes</string>
</action>
<action name="actionLongListJob" >
<property name="icon" >
- <iconset>../../../../../../../:images/unmark.png</iconset>
+ <iconset>:images/unmark.png</iconset>
</property>
<property name="text" >
<string>LongListJob</string>
</action>
<action name="actionDeleteJob" >
<property name="icon" >
- <iconset>../../../../../../../:images/unmark.png</iconset>
+ <iconset>:images/unmark.png</iconset>
</property>
<property name="text" >
<string>DeleteJob</string>
</action>
<action name="actionPurgeFiles" >
<property name="icon" >
- <iconset>../../../../../../../:images/unmark.png</iconset>
+ <iconset>:images/unmark.png</iconset>
</property>
<property name="text" >
<string>PurgeFiles</string>
</action>
<action name="actionRestoreFromJob" >
<property name="icon" >
- <iconset>../../../../../../../:images/unmark.png</iconset>
+ <iconset>:images/unmark.png</iconset>
</property>
<property name="text" >
<string>Restore From Job</string>
</action>
<action name="actionRestoreFromTime" >
<property name="icon" >
- <iconset>../../../../../../../:images/unmark.png</iconset>
+ <iconset>:images/unmark.png</iconset>
</property>
<property name="text" >
<string>Restore From Time</string>
</action>
<action name="actionShowLogForJob" >
<property name="icon" >
- <iconset>../../../../../../../:images/unmark.png</iconset>
+ <iconset>:images/unmark.png</iconset>
</property>
<property name="text" >
<string>Show Log for Job</string>
</property>
</action>
+ <action name="actionCancelJob" >
+ <property name="icon" >
+ <iconset>:images/unmark.png</iconset>
+ </property>
+ <property name="text" >
+ <string>Cancel Currently Running Job</string>
+ </property>
+ </action>
</widget>
<resources/>
<connections/>