From: Dirk H Bartley Date: Sat, 12 May 2007 15:32:10 +0000 (+0000) Subject: No reason to show purge files option in context sensitive menu of a job that X-Git-Tag: Release-7.0.0~6368 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=374b8aa4d16d87c0d754962a7f7d445b92efe021;p=bacula%2Fbacula No reason to show purge files option in context sensitive menu of a job that has already been purged. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4763 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/TODO b/bacula/src/qt-console/TODO index 21b36caba1..384f1dc0f9 100644 --- a/bacula/src/qt-console/TODO +++ b/bacula/src/qt-console/TODO @@ -10,8 +10,6 @@ Test left pane of restore with 2 windows drives in one backup job. User preferences. With log to stdout options. Have settings for defaults of limits on joblist -show purged flag in joblist. Don't have purge option show if already purged. - 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. @@ -83,6 +81,8 @@ global one defined in the mainWin class (if I remember right). ============================================================ DONE: ============================================================ +show purged flag in joblist. Don't have purge option show if already purged. + move behavior of: MainWin::setContextMenuDockText MainWin::setTreeWidgetItemDockColor diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index 48b864d96e..c69704c09c 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -166,6 +166,7 @@ void JobList::populateTable() QStringList headerlist = (QStringList() << "Job Id" << "Job Name" << "Client" << "Job Starttime" << "Job Type" << "Job Level" << "Job Files" << "Job Bytes" << "Job Status" << "Purged" ); + m_purgedIndex = headerlist.indexOf("Purged"); /* Initialize the QTableWidget */ m_checkCurrentWidget = false; @@ -267,6 +268,12 @@ void JobList::tableItemChanged(QTableWidgetItem *currentItem, QTableWidgetItem * int row = currentItem->row(); QTableWidgetItem* jobitem = mp_tableWidget->item(row, 0); m_currentJob = jobitem->text(); + jobitem = mp_tableWidget->item(row, m_purgedIndex); + QString purged = jobitem->text(); + mp_tableWidget->removeAction(actionPurgeFiles); + if (purged == "0") { + mp_tableWidget->addAction(actionPurgeFiles); + } } } diff --git a/bacula/src/qt-console/joblist/joblist.h b/bacula/src/qt-console/joblist/joblist.h index cacc930d4f..0b6bfb9aae 100644 --- a/bacula/src/qt-console/joblist/joblist.h +++ b/bacula/src/qt-console/joblist/joblist.h @@ -71,6 +71,7 @@ private: QString m_currentJob; bool m_populated; bool m_checkCurrentWidget; + int m_purgedIndex; }; #endif /* _JOBLIST_H_ */