]> git.sur5r.net Git - bacula/bacula/commitdiff
Add a label to describe whether pushing the refresh button will refresh from
authorDirk H Bartley <dbartley@schupan.com>
Sun, 29 Jul 2007 15:01:22 +0000 (15:01 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Sun, 29 Jul 2007 15:01:22 +0000 (15:01 +0000)
the selection criterion or from the any changes in the check boxes in the job
table.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5264 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/qt-console/restore/restoretree.cpp
bacula/src/qt-console/restore/restoretree.h
bacula/src/qt-console/restore/restoretree.ui

index 8d51d087c6b30fc29c5a69c2b050c03c63ba2ddf..b2e5b7b3f8d2b3f3589bdfeb37d8ed8be279b10b 100644 (file)
@@ -99,6 +99,13 @@ void restoreTree::setupPage()
    connect(refreshButton, SIGNAL(pressed()), this, SLOT(refreshButtonPushed()));
    connect(restoreButton, SIGNAL(pressed()), this, SLOT(restoreButtonPushed()));
    connect(jobCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(jobComboChanged(int)));
+   connect(jobCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateRefresh()));
+   connect(clientCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateRefresh()));
+   connect(fileSetCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(updateRefresh()));
+   connect(limitCheckBox, SIGNAL(stateChanged(int)), this, SLOT(updateRefresh()));
+   connect(daysCheckBox, SIGNAL(stateChanged(int)), this, SLOT(updateRefresh()));
+   connect(daysSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateRefresh()));
+   connect(limitSpinBox, SIGNAL(valueChanged(int)), this, SLOT(updateRefresh()));
    connect(directoryTree, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
            this, SLOT(directoryCurrentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
    connect(directoryTree, SIGNAL(itemExpanded(QTreeWidgetItem *)),
@@ -119,6 +126,26 @@ void restoreTree::setupPage()
    directoryTree->setContextMenuPolicy(Qt::ActionsContextMenu);
 }
 
+void restoreTree::updateRefresh()
+{
+   if (mainWin->m_rtPopDirDebug) Pmsg2(000, "testing prev=\"%s\" current=\"%s\"\n", m_prevJobCombo.toUtf8().data(), jobCombo->currentText().toUtf8().data());
+   m_dropdownChanged = (m_prevJobCombo != jobCombo->currentText())
+                       || (m_prevClientCombo != clientCombo->currentText())
+                       || (m_prevFileSetCombo != fileSetCombo->currentText()
+                       || (m_prevLimitSpinBox != limitSpinBox->value())
+                       || (m_prevDaysSpinBox != daysSpinBox->value())
+                       || (m_prevLimitCheckState != limitCheckBox->checkState())
+                       || (m_prevDaysCheckState != daysCheckBox->checkState())
+   );
+   if (m_dropdownChanged) {
+      if (mainWin->m_rtPopDirDebug) Pmsg0(000, "In restoreTree::updateRefresh Is CHANGED\n");
+      refreshLabel->setText("Refresh From Re-Select");
+   } else {
+      if (mainWin->m_rtPopDirDebug) Pmsg0(000, "In restoreTree::updateRefresh Is not Changed\n");
+      refreshLabel->setText("Refresh From JobChecks");
+   }
+}
+
 /*
  * When refresh button is pushed, perform a query getting the directories and
  * use parseDirectory and addDirectory to populate the directory tree with items.
@@ -142,11 +169,9 @@ void restoreTree::populateDirectoryTree()
    QString jobComboText = jobCombo->currentText();
    QString clientComboText = clientCombo->currentText();
    QString fileSetComboText = fileSetCombo->currentText();
-   if (mainWin->m_rtPopDirDebug) Pmsg2(000, "testing prev=\"%s\" current=\"%s\"\n", m_prevJobCombo.toUtf8().data(), jobComboText.toUtf8().data());
-   bool dropdownChanged = (m_prevJobCombo != jobComboText) || (m_prevClientCombo != clientComboText) || (m_prevFileSetCombo != fileSetComboText);
+   updateRefresh();
    int taskcount = 2, ontask = 1;
-   if (dropdownChanged) taskcount += 1;
-//   QString taskCountString = QString("%1").arg(taskcount);
+   if (m_dropdownChanged) taskcount += 1;
    
    /* Set progress bars and repaint */
    prBar1->setVisible(true);
@@ -160,10 +185,15 @@ void restoreTree::populateDirectoryTree()
    prLabel2->setVisible(true);
    repaint();
 
-   if (dropdownChanged) {
+   if (m_dropdownChanged) {
       m_prevJobCombo =  jobComboText;
       m_prevClientCombo = clientComboText;
       m_prevFileSetCombo = fileSetComboText;
+      m_prevLimitSpinBox = limitSpinBox->value();
+      m_prevDaysSpinBox = daysSpinBox->value();
+      m_prevLimitCheckState = limitCheckBox->checkState();
+      m_prevDaysCheckState = daysCheckBox->checkState();
+      updateRefresh();
       if (mainWin->m_rtPopDirDebug) Pmsg0(000, "Repopulating the Job Table\n");
 
       QString condition = " Client.Name='" + clientCombo->itemText(clientCombo->currentIndex()) + "'";
@@ -206,6 +236,7 @@ void restoreTree::populateDirectoryTree()
       populateJobTable();
       setJobsCheckedList();
    } else {
+      if (mainWin->m_rtPopDirDebug) Pmsg0(000, "Repopulating from checks in Job Table\n");
       setJobsCheckedList();
    }
 
index 9311ddeb727139c18393a7bf37e80dcbb36e8d85..4a9785df49b9ca70948c428ca120039d301dc21b 100644 (file)
@@ -69,6 +69,7 @@ private slots:
    void directoryItemChanged(QTreeWidgetItem *, int);
    void fileTableItemChanged(QTableWidgetItem *);
    void versionTableItemChanged(QTableWidgetItem *);
+   void updateRefresh();
 
 private:
    void populateDirectoryTree();
@@ -94,6 +95,7 @@ private:
    int queryFileIndex(QString &fullPath, int jobID);
 
    bool m_populated;
+   bool m_dropdownChanged;
    QRegExp m_winRegExpDrive;
    QRegExp m_winRegExpPath;
    QRegExp m_slashregex;
@@ -104,6 +106,10 @@ private:
    QString m_prevJobCombo;
    QString m_prevClientCombo;
    QString m_prevFileSetCombo;
+   int m_prevLimitSpinBox;
+   int m_prevDaysSpinBox;
+   Qt::CheckState m_prevLimitCheckState;
+   Qt::CheckState m_prevDaysCheckState;
    QString m_JobsCheckedList;
    int m_debugCnt;
    bool m_debugTrap;
index 053e31eaa112fefcb5d1328102ccf8f8bbb72efc..9cb45a7706f4130331d0ba5c2bc21c76d2ec88f5 100644 (file)
   <widget class="QWidget" native="1" name="widget" >
    <property name="geometry" >
     <rect>
-     <x>10</x>
-     <y>57</y>
-     <width>791</width>
+     <x>20</x>
+     <y>23</y>
+     <width>661</width>
      <height>79</height>
     </rect>
    </property>
    <property name="maximumSize" >
     <size>
-     <width>950</width>
-     <height>16777215</height>
+     <width>900</width>
+     <height>79</height>
     </size>
    </property>
    <layout class="QGridLayout" >
     <property name="margin" >
-     <number>0</number>
+     <number>6</number>
     </property>
     <property name="spacing" >
-     <number>6</number>
+     <number>0</number>
     </property>
     <item row="1" column="0" >
      <layout class="QHBoxLayout" >
       <property name="margin" >
-       <number>3</number>
+       <number>0</number>
       </property>
       <property name="spacing" >
-       <number>9</number>
+       <number>6</number>
       </property>
       <item>
-       <widget class="QPushButton" name="refreshButton" >
-        <property name="text" >
-         <string>Refresh</string>
-        </property>
-        <property name="icon" >
-         <iconset resource="../main.qrc" >:/images/view-refresh.svg</iconset>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QPushButton" name="restoreButton" >
-        <property name="text" >
-         <string>Restore</string>
+       <layout class="QGridLayout" >
+        <property name="margin" >
+         <number>0</number>
         </property>
-        <property name="icon" >
-         <iconset resource="../main.qrc" >:/images/restore.png</iconset>
+        <property name="spacing" >
+         <number>6</number>
         </property>
-       </widget>
+        <item row="0" column="0" >
+         <widget class="QPushButton" name="refreshButton" >
+          <property name="text" >
+           <string>Refresh</string>
+          </property>
+          <property name="icon" >
+           <iconset resource="../main.qrc" >:/images/view-refresh.svg</iconset>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0" colspan="2" >
+         <widget class="QLabel" name="refreshLabel" >
+          <property name="text" >
+           <string>TextLabel</string>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1" >
+         <widget class="QPushButton" name="restoreButton" >
+          <property name="text" >
+           <string>Restore</string>
+          </property>
+          <property name="icon" >
+           <iconset resource="../main.qrc" >:/images/restore.png</iconset>
+          </property>
+         </widget>
+        </item>
+       </layout>
       </item>
       <item>
        <layout class="QVBoxLayout" >