[Openvas-commits] r10583 - in trunk/gsd: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 18 12:57:00 CET 2011


Author: raimund
Date: 2011-03-18 12:56:58 +0100 (Fri, 18 Mar 2011)
New Revision: 10583

Modified:
   trunk/gsd/ChangeLog
   trunk/gsd/src/dock_performance.cpp
   trunk/gsd/src/dock_performance.h
   trunk/gsd/src/dock_performance.ui
Log:
Retain the current performance chart on refresh.

* src/dock_performance.cpp (dock_performance): Initialize the current index
with 0.
(selectionChanged): Retain current chart if time has changed, else use the
selected chart.
(timeChanged, load): Save current chart index.

* src/dock_performance.h: Updated prototypes.

* src/dock_performance.ui: Resized combobox for chart selection.



Modified: trunk/gsd/ChangeLog
===================================================================
--- trunk/gsd/ChangeLog	2011-03-18 10:48:10 UTC (rev 10582)
+++ trunk/gsd/ChangeLog	2011-03-18 11:56:58 UTC (rev 10583)
@@ -1,5 +1,19 @@
 2011-03-18  Raimund Renkert <raimund.renkert at greenbone.net>
 
+	Retain the current performance chart on refresh.
+
+	* src/dock_performance.cpp (dock_performance): Initialize the current index
+	with 0.
+	(selectionChanged): Retain current chart if time has changed, else use the
+	selected chart.
+	(timeChanged, load): Save current chart index.
+
+	* src/dock_performance.h: Updated prototypes.
+
+	* src/dock_performance.ui: Resized combobox for chart selection.
+
+2011-03-18  Raimund Renkert <raimund.renkert at greenbone.net>
+
 	Prepared dashboard for translation.
 
 	* src/gsd_mw.cpp (updatedashboard): Replace dummies in html documents with

Modified: trunk/gsd/src/dock_performance.cpp
===================================================================
--- trunk/gsd/src/dock_performance.cpp	2011-03-18 10:48:10 UTC (rev 10582)
+++ trunk/gsd/src/dock_performance.cpp	2011-03-18 11:56:58 UTC (rev 10583)
@@ -37,6 +37,7 @@
 dock_performance::dock_performance ()
 {
   setupUi (this);
+  currentIndex = 0;
   comboBox->addItem (tr ("hour(s)"));
   comboBox->addItem (tr ("day(s)"));
   comboBox->addItem (tr ("month(s)"));
@@ -91,7 +92,15 @@
 void
 dock_performance::selectionChanged ()
 {
-  QDomElement e = reportModel->getEntity(comboBox_2->currentIndex ());
+  pushButton_2->setEnabled (true);
+  QDomElement e;
+  if (time_changed)
+    {
+      e = reportModel->getEntity (currentIndex);
+      time_changed = false;
+    }
+  else
+    e = reportModel->getEntity (comboBox_2->currentIndex ());
   QString name = e.firstChildElement ("name").text ();
   graphicsModel->setFilterType (model_omp_entity::VALUE_FILTER);
   graphicsModel->setFilter ("report name " + name);
@@ -163,6 +172,9 @@
   if (spinBox->value () == 0)
     return;
 
+  time_changed = true;
+  currentIndex = comboBox_2->currentIndex ();
+
   if (comboBox->currentText ().compare (tr ("hour(s)")) == 0)
     duration = spinBox->value () * 3600;
   if (comboBox->currentText ().compare (tr ("day(s)")) == 0)
@@ -170,6 +182,7 @@
   if (comboBox->currentText ().compare (tr ("month(s)")) == 0)
     duration = spinBox->value () * 3600 * 24 *30;
 
+  pushButton_2->setEnabled (false);
   emit sig_request_system_reports ( NULL, duration);
 }
 
@@ -201,6 +214,7 @@
       QString s = reportModel->getValue (reportModel->getEntity (i), "system_report title");
       comboBox_2->addItem (reportModel->getValue (reportModel->getEntity (i), "title"));
     }
+  comboBox_2->setCurrentIndex (currentIndex);
 }
 
 

Modified: trunk/gsd/src/dock_performance.h
===================================================================
--- trunk/gsd/src/dock_performance.h	2011-03-18 10:48:10 UTC (rev 10582)
+++ trunk/gsd/src/dock_performance.h	2011-03-18 11:56:58 UTC (rev 10583)
@@ -61,6 +61,8 @@
     int sizeX;
     int sizeY;
     QPixmap shownPixmap;
+    int currentIndex;
+    bool time_changed;
 };
 #endif
 

Modified: trunk/gsd/src/dock_performance.ui
===================================================================
--- trunk/gsd/src/dock_performance.ui	2011-03-18 10:48:10 UTC (rev 10582)
+++ trunk/gsd/src/dock_performance.ui	2011-03-18 11:56:58 UTC (rev 10583)
@@ -14,7 +14,7 @@
   </property>
   <widget class="QWidget" name="dockWidgetContents" >
    <layout class="QGridLayout" name="gridLayout" >
-    <item row="3" column="11" >
+    <item row="3" column="10" >
      <widget class="QPushButton" name="pushButton" >
       <property name="text" >
        <string>Save image as</string>
@@ -28,22 +28,9 @@
       </property>
      </widget>
     </item>
-    <item row="3" column="10" >
+    <item row="3" column="8" colspan="2" >
      <widget class="QComboBox" name="comboBox_2" />
     </item>
-    <item row="3" column="4" colspan="6" >
-     <spacer name="horizontalSpacer_2" >
-      <property name="orientation" >
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <property name="sizeHint" stdset="0" >
-       <size>
-        <width>40</width>
-        <height>20</height>
-       </size>
-      </property>
-     </spacer>
-    </item>
     <item row="0" column="2" >
      <widget class="QSpinBox" name="spinBox_2" />
     </item>
@@ -54,7 +41,7 @@
       </property>
      </widget>
     </item>
-    <item row="1" column="0" colspan="12" >
+    <item row="1" column="0" colspan="11" >
      <widget class="QScrollArea" name="scrollArea" >
       <property name="frameShape" >
        <enum>QFrame::NoFrame</enum>
@@ -74,7 +61,7 @@
          <x>0</x>
          <y>0</y>
          <width>799</width>
-         <height>273</height>
+         <height>277</height>
         </rect>
        </property>
        <layout class="QFormLayout" name="formLayout" >
@@ -137,7 +124,7 @@
       </property>
      </widget>
     </item>
-    <item row="0" column="5" >
+    <item row="0" column="4" >
      <widget class="QLabel" name="label_5" >
       <property name="text" >
        <string>Height:</string>
@@ -147,10 +134,10 @@
       </property>
      </widget>
     </item>
-    <item row="0" column="6" >
+    <item row="0" column="5" >
      <widget class="QSpinBox" name="spinBox_3" />
     </item>
-    <item row="0" column="7" >
+    <item row="0" column="6" >
      <widget class="QLabel" name="label_6" >
       <property name="text" >
        <string>px</string>
@@ -164,6 +151,19 @@
       </property>
      </widget>
     </item>
+    <item row="0" column="7" >
+     <spacer name="horizontalSpacer_2" >
+      <property name="orientation" >
+       <enum>Qt::Horizontal</enum>
+      </property>
+      <property name="sizeHint" stdset="0" >
+       <size>
+        <width>40</width>
+        <height>20</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
    </layout>
   </widget>
  </widget>



More information about the Openvas-commits mailing list