void Clients::showJobs()
{
QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
- mainWin->createPageJobList("", m_currentlyselected, parentItem);
+ mainWin->createPageJobList("", m_currentlyselected, "", parentItem);
}
/*
/*
* Constructor for the class
*/
-JobList::JobList(const QString &mediaName, const QString &clientname,
- QTreeWidgetItem *parentTreeWidgetItem)
+JobList::JobList(const QString &mediaName, const QString &clientName,
+ const QString &jobName, QTreeWidgetItem *parentTreeWidgetItem)
{
setupUi(this);
m_name = ""; /* treeWidgetName has a virtual override in this class */
m_mediaName = mediaName;
- m_clientName = clientname;
+ m_clientName = clientName;
+ m_jobName = jobName;
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_closeable=true; }
+ if ((m_mediaName != "") || (m_clientName != "") || (m_jobName != ""))
+ m_closeable=true;
m_checkCurrentWidget = true;
createConnections();
}
jobComboBox->addItem("Any");
jobComboBox->addItems(m_console->job_list);
+ int jobIndex = jobComboBox->findText(m_jobName, Qt::MatchExactly);
+ if (jobIndex != -1) {
+ jobComboBox->setCurrentIndex(jobIndex);
+ }
levelComboBox->addItem("Any");
levelComboBox->addItems( QStringList() << "F" << "D" << "I");
purgedComboBox->addItem("Any");
conditions.append("Client.Name='" + m_clientName + "'");
}
int jobIndex = jobComboBox->currentIndex();
+ if (jobIndex != -1)
+ m_jobName = jobComboBox->itemText(jobIndex);
if ((jobIndex != -1) && (jobComboBox->itemText(jobIndex) != "Any")) {
conditions.append("Job.Name='" + jobComboBox->itemText(jobIndex) + "'");
}
*/
void JobList::treeWidgetName(QString &desc)
{
- if ((m_mediaName == "") && (m_clientName == "")) {
+ if ((m_mediaName == "") && (m_clientName == "") && (m_jobName == "")) {
desc = "JobList";
} else {
desc = "JobList ";
if (m_clientName != "" ) {
desc += "of Client " + m_clientName;
}
+ if (m_jobName != "" ) {
+ desc += "of Job " + m_jobName;
+ }
}
}
Q_OBJECT
public:
- JobList(const QString &medianame, const QString &clientname, QTreeWidgetItem *);
+ JobList(const QString &medianame, const QString &clientname,
+ const QString &jobname, QTreeWidgetItem *);
virtual void PgSeltreeWidgetClicked();
virtual void currentStackItem();
int m_resultCount;
void setStatusColor(QTableWidgetItem *item, QString &field);
QString m_mediaName;
QString m_clientName;
+ QString m_jobName;
QString m_currentJob;
bool m_populated;
bool m_checkCurrentWidget;
void Jobs::listJobs()
{
printf("In Jobs::listJobs\n");
+ QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
+ mainWin->createPageJobList("", "", m_currentlyselected, parentItem);
}
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,
- QTreeWidgetItem *parentTreeWidgetItem)
+ const QString &job, QTreeWidgetItem *parentTreeWidgetItem)
{
QTreeWidgetItem *holdItem;
/* save current tree widget item in case query produces no results */
holdItem = treeWidget->currentItem();
- JobList* joblist = new JobList(media, client, parentTreeWidgetItem);
+ JobList* joblist = new JobList(media, client, job, parentTreeWidgetItem);
/* If this is a query of jobs on a specific media */
- if ((media != "") || (client != "")) {
+ if ((media != "") || (client != "") || (job != "")) {
joblist->setCurrent();
/* did query produce results, if not close window and set back to hold */
if (joblist->m_resultCount == 0) {
QHash<Pages*,QTreeWidgetItem*> m_widgethash;
/* This is a list of consoles */
QHash<QTreeWidgetItem*,Console*> m_consoleHash;
- void createPageJobList(const QString &, const QString &, QTreeWidgetItem *);
+ void createPageJobList(const QString &, 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);
}
/*