]> git.sur5r.net Git - bacula/bacula/commitdiff
Found an issue with the canceling of jobs not functioning correctly. This removes
authorDirk H Bartley <dbartley@schupan.com>
Fri, 2 Jan 2009 21:43:47 +0000 (21:43 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Fri, 2 Jan 2009 21:43:47 +0000 (21:43 +0000)
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

bacula/src/qt-console/status/dirstat.cpp
bacula/src/qt-console/status/dirstat.h
bacula/src/qt-console/status/dirstat.ui

index e3bda8bec13f3595fb0fa711154cb87b5c322d40..573ed304ae3e14955fe582bb0ccd1902408891f7 100644 (file)
@@ -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<int> rowList;
+   QList<QTableWidgetItem *> 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<int> rowList;
-   QList<QTableWidgetItem *> 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"));
-   }
-}
index f0f8e23ec27cd0c17a2afa11f35b60efe19571d9..1887dd91499af4a09c4581e1be88e2f6fc46fa09 100644 (file)
@@ -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_ */
index 22ad3ed33325ff3c3294c3b72512df182ff56b12..edc065728827618a70f09421b0d971efdab59fb2 100644 (file)
@@ -225,7 +225,7 @@ p, li { white-space: pre-wrap; }
     <iconset resource="../main.qrc" >:/images/utilities-terminal.png</iconset>
    </property>
    <property name="text" >
-    <string>Cancel Running Job</string>
+    <string>Cancel Selected Running Jobs</string>
    </property>
   </action>
   <action name="actionDisableScheduledJob" >