From: Dirk H Bartley Date: Fri, 2 Jan 2009 21:43:47 +0000 (+0000) Subject: Found an issue with the canceling of jobs not functioning correctly. This removes X-Git-Tag: Release-7.0.0~3539 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ab565ac9c8521ef4defb66a7ae59d3cd6d4e12ea;p=bacula%2Fbacula Found an issue with the canceling of jobs not functioning correctly. This removes the feature of showing in the popup the number of jobs to be canceled because it just was not functioning as expected. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8275 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/status/dirstat.cpp b/bacula/src/qt-console/status/dirstat.cpp index e3bda8bec1..573ed304ae 100644 --- a/bacula/src/qt-console/status/dirstat.cpp +++ b/bacula/src/qt-console/status/dirstat.cpp @@ -310,9 +310,6 @@ void DirStat::createConnections() SLOT(consoleCancelJob())); connect(actionDisableScheduledJob, SIGNAL(triggered()), this, SLOT(consoleDisableJob())); - connect(runningTable, SIGNAL( - currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)), - this, SLOT(runningTableItemChanged(QTableWidgetItem *, QTableWidgetItem *))); scheduledTable->setContextMenuPolicy(Qt::ActionsContextMenu); scheduledTable->addAction(actionRefresh); @@ -353,7 +350,21 @@ void DirStat::readSettings() */ void DirStat::consoleCancelJob() { - foreach( QString job, m_selectedJobsList ) + QList rowList; + QList sitems = runningTable->selectedItems(); + foreach (QTableWidgetItem *sitem, sitems) { + int row = sitem->row(); + if (!rowList.contains(row)) { + rowList.append(row); + } + } + + QStringList selectedJobsList; + foreach(int row, rowList) { + QTableWidgetItem * sitem = runningTable->item(row, 0); + selectedJobsList.append(sitem->text()); + } + foreach( QString job, selectedJobsList ) { QString cmd("cancel jobid="); cmd += job; @@ -375,28 +386,3 @@ void DirStat::consoleDisableJob() consoleCommand(cmd); } } -/* - * Function to fill m_selectedJobsList with selected values - */ -void DirStat::runningTableItemChanged(QTableWidgetItem * /*currentItem*/, QTableWidgetItem * /*previousItem*/) -{ - QList rowList; - QList sitems = runningTable->selectedItems(); - foreach (QTableWidgetItem *sitem, sitems) { - int row = sitem->row(); - if (!rowList.contains(row)) { - rowList.append(row); - } - } - - m_selectedJobsList.clear(); - foreach(int row, rowList) { - QTableWidgetItem * sitem = runningTable->item(row, 0); - m_selectedJobsList.append(sitem->text()); - } - if (m_selectedJobsList.count() > 1) { - actionCancelRunning->setText(tr("Cancel list of %1 Jobs").arg(m_selectedJobsList.count())); - } else { - actionCancelRunning->setText(tr("Cancel Single Job")); - } -} diff --git a/bacula/src/qt-console/status/dirstat.h b/bacula/src/qt-console/status/dirstat.h index f0f8e23ec2..1887dd9149 100644 --- a/bacula/src/qt-console/status/dirstat.h +++ b/bacula/src/qt-console/status/dirstat.h @@ -59,7 +59,6 @@ private slots: void timerTriggered(); void consoleCancelJob(); void consoleDisableJob(); - void runningTableItemChanged(QTableWidgetItem *, QTableWidgetItem *); private: void createConnections(); @@ -70,7 +69,6 @@ private: void getFont(); QString m_groupText, m_splitText; QTimer *m_timer; - QStringList m_selectedJobsList; }; #endif /* _DIRSTAT_H_ */ diff --git a/bacula/src/qt-console/status/dirstat.ui b/bacula/src/qt-console/status/dirstat.ui index 22ad3ed333..edc0657288 100644 --- a/bacula/src/qt-console/status/dirstat.ui +++ b/bacula/src/qt-console/status/dirstat.ui @@ -225,7 +225,7 @@ p, li { white-space: pre-wrap; } :/images/utilities-terminal.png - Cancel Running Job + Cancel Selected Running Jobs