[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r1539: Change the "area graph" checkbox into a graph style dropdown (in trunk: . src/gui/bwgraph src/gui/res src/gui/res/16x16)



Author: edmanm
Date: 2006-12-16 23:13:16 -0500 (Sat, 16 Dec 2006)
New Revision: 1539

Added:
   trunk/src/gui/res/16x16/graph-area.png
   trunk/src/gui/res/16x16/graph-line.png
Modified:
   trunk/AUTHORS
   trunk/src/gui/bwgraph/bwgraph.cpp
   trunk/src/gui/bwgraph/bwgraph.ui
   trunk/src/gui/res/vidalia_common.qrc
Log:
Change the "area graph" checkbox into a graph style dropdown box with opello's
graph icons. This involved shimmying a few other widgets around.


Modified: trunk/AUTHORS
===================================================================
--- trunk/AUTHORS	2006-12-17 00:48:18 UTC (rev 1538)
+++ trunk/AUTHORS	2006-12-17 04:13:16 UTC (rev 1539)
@@ -17,9 +17,11 @@
   the Vidalia-Project website.
 
   Matt Hanson <http://www.zuerchertech.com/> tweaked Corinna's images a bit
-  and created some .icos based off of them. Dan Christensen
-  <http://opello.org/> added additional image formats to the .ico files to
-  support more Windowses.
+  and created some .icos based off of them. 
+  
+  Dan Christensen <http://opello.org/> added additional image formats to 
+  the .ico files to support more Windowses. He also created the graph style
+  icons in the bandwidth graph settings.
 
   Geoff Goodell <http://afs.eecs.harvard.edu/~goodell/> supplied us with
   nearly all of the flag icons that we use in the Appearance configuration

Modified: trunk/src/gui/bwgraph/bwgraph.cpp
===================================================================
--- trunk/src/gui/bwgraph/bwgraph.cpp	2006-12-17 00:48:18 UTC (rev 1538)
+++ trunk/src/gui/bwgraph/bwgraph.cpp	2006-12-17 04:13:16 UTC (rev 1539)
@@ -45,7 +45,11 @@
 /* Define the format used for displaying the date and time */
 #define DATETIME_FMT  "MMM dd hh:mm:ss"
 
+/* Images used in the graph style drop-down */
+#define IMG_AREA_GRAPH    ":/images/16x16/graph-area.png"
+#define IMG_LINE_GRAPH    ":/images/16x16/graph-line.png"
 
+
 /** Default constructor */
 BandwidthGraph::BandwidthGraph(QWidget *parent, Qt::WFlags flags)
   : VidaliaWindow("BandwidthGraph", parent, flags)
@@ -146,8 +150,11 @@
   ui.chkSendRate->setChecked(filter & BWGRAPH_LINE_SEND);
 
   /* Set whether we are plotting bandwidth as area graphs or not */
-  uint graphStyle = getSetting(SETTING_STYLE, DEFAULT_STYLE).toUInt();
-  ui.chkAreaGraph->setChecked(graphStyle == GraphFrame::AreaGraph);
+  int graphStyle = getSetting(SETTING_STYLE, DEFAULT_STYLE).toInt();
+  if (graphStyle < 0 || graphStyle >= ui.cmbGraphStyle->count()) {
+    graphStyle = DEFAULT_STYLE;
+  }
+  ui.cmbGraphStyle->setCurrentIndex(graphStyle);
   ui.frmGraph->setGraphStyle((GraphFrame::GraphStyle)graphStyle);
 
   /* Set graph frame settings */
@@ -176,9 +183,7 @@
   
   /* Save the opacity and graph style */
   saveSetting(SETTING_OPACITY, ui.sldrOpacity->value());
-  saveSetting(SETTING_STYLE,   ui.chkAreaGraph->isChecked() 
-                                          ? GraphFrame::AreaGraph
-                                          : GraphFrame::SolidLine);
+  saveSetting(SETTING_STYLE, ui.cmbGraphStyle->currentIndex());
 
   /* Save the Always On Top setting */
   saveSetting(SETTING_ALWAYS_ON_TOP, ui.chkAlwaysOnTop->isChecked());
@@ -199,9 +204,7 @@
   /* Update the graph frame settings */
   ui.frmGraph->setShowCounters(ui.chkReceiveRate->isChecked(),
                                ui.chkSendRate->isChecked());
-  ui.frmGraph->setGraphStyle(ui.chkAreaGraph->isChecked() ? 
-                                                GraphFrame::AreaGraph
-                                              : GraphFrame::SolidLine);
+  ui.frmGraph->setGraphStyle((GraphFrame::GraphStyle)ui.cmbGraphStyle->currentIndex());
   
   /* A change in window flags causes the window to disappear, so make sure
    * it's still visible. */

Modified: trunk/src/gui/bwgraph/bwgraph.ui
===================================================================
--- trunk/src/gui/bwgraph/bwgraph.ui	2006-12-17 00:48:18 UTC (rev 1538)
+++ trunk/src/gui/bwgraph/bwgraph.ui	2006-12-17 04:13:16 UTC (rev 1539)
@@ -659,17 +659,12 @@
           </widget>
          </item>
          <item>
-          <widget class="QCheckBox" name="chkAreaGraph" >
-           <property name="font" >
-            <font>
-             <pointsize>10</pointsize>
-            </font>
-           </property>
+          <widget class="QCheckBox" name="chkAlwaysOnTop" >
            <property name="layoutDirection" >
             <enum>Qt::RightToLeft</enum>
            </property>
            <property name="text" >
-            <string>Area Graph</string>
+            <string>Always on Top</string>
            </property>
           </widget>
          </item>
@@ -712,45 +707,51 @@
              <number>0</number>
             </property>
             <property name="spacing" >
-             <number>0</number>
+             <number>6</number>
             </property>
             <item>
-             <widget class="QLabel" name="lblPercentOpacity" >
-              <property name="minimumSize" >
+             <spacer>
+              <property name="orientation" >
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" >
                <size>
-                <width>25</width>
-                <height>0</height>
+                <width>20</width>
+                <height>20</height>
                </size>
               </property>
+             </spacer>
+            </item>
+            <item>
+             <widget class="QLabel" name="label_2" >
               <property name="font" >
                <font>
                 <pointsize>10</pointsize>
                </font>
               </property>
-              <property name="contextMenuPolicy" >
-               <enum>Qt::NoContextMenu</enum>
-              </property>
-              <property name="layoutDirection" >
-               <enum>Qt::RightToLeft</enum>
-              </property>
               <property name="text" >
-               <string>100</string>
+               <string>Style</string>
               </property>
              </widget>
             </item>
             <item>
-             <widget class="QLabel" name="label" >
-              <property name="font" >
-               <font>
-                <pointsize>10</pointsize>
-               </font>
-              </property>
-              <property name="contextMenuPolicy" >
-               <enum>Qt::NoContextMenu</enum>
-              </property>
-              <property name="text" >
-               <string>% Opaque</string>
-              </property>
+             <widget class="QComboBox" name="cmbGraphStyle" >
+              <item>
+               <property name="text" >
+                <string/>
+               </property>
+               <property name="icon" >
+                <iconset resource="../res/vidalia_common.qrc" >:/images/16x16/graph-line.png</iconset>
+               </property>
+              </item>
+              <item>
+               <property name="text" >
+                <string/>
+               </property>
+               <property name="icon" >
+                <iconset resource="../res/vidalia_common.qrc" >:/images/16x16/graph-area.png</iconset>
+               </property>
+              </item>
              </widget>
             </item>
            </layout>
@@ -793,38 +794,91 @@
            </widget>
           </item>
           <item>
-           <layout class="QVBoxLayout" >
+           <spacer>
+            <property name="orientation" >
+             <enum>Qt::Vertical</enum>
+            </property>
+            <property name="sizeHint" >
+             <size>
+              <width>20</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+          <item>
+           <layout class="QHBoxLayout" >
             <property name="margin" >
              <number>0</number>
             </property>
             <property name="spacing" >
-             <number>6</number>
+             <number>0</number>
             </property>
             <item>
-             <widget class="QCheckBox" name="chkAlwaysOnTop" >
+             <spacer>
+              <property name="orientation" >
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" >
+               <size>
+                <width>21</width>
+               </size>
+              </property>
+             </spacer>
+            </item>
+            <item>
+             <widget class="QLabel" name="lblPercentOpacity" >
+              <property name="minimumSize" >
+               <size>
+                <width>25</width>
+                <height>0</height>
+               </size>
+              </property>
+              <property name="font" >
+               <font>
+                <pointsize>10</pointsize>
+               </font>
+              </property>
+              <property name="contextMenuPolicy" >
+               <enum>Qt::NoContextMenu</enum>
+              </property>
               <property name="layoutDirection" >
                <enum>Qt::RightToLeft</enum>
               </property>
               <property name="text" >
-               <string>Always on Top</string>
+               <string>100</string>
               </property>
              </widget>
             </item>
+            <item>
+             <widget class="QLabel" name="label" >
+              <property name="font" >
+               <font>
+                <pointsize>10</pointsize>
+               </font>
+              </property>
+              <property name="contextMenuPolicy" >
+               <enum>Qt::NoContextMenu</enum>
+              </property>
+              <property name="text" >
+               <string>% Opaque</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <spacer>
+              <property name="orientation" >
+               <enum>Qt::Horizontal</enum>
+              </property>
+              <property name="sizeHint" >
+               <size>
+                <width>21</width>
+               </size>
+              </property>
+             </spacer>
+            </item>
            </layout>
           </item>
-          <item>
-           <spacer>
-            <property name="orientation" >
-             <enum>Qt::Vertical</enum>
-            </property>
-            <property name="sizeHint" >
-             <size>
-              <width>20</width>
-              <height>20</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
          </layout>
         </widget>
        </item>

Added: trunk/src/gui/res/16x16/graph-area.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/gui/res/16x16/graph-area.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/gui/res/16x16/graph-line.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/gui/res/16x16/graph-line.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/src/gui/res/vidalia_common.qrc
===================================================================
--- trunk/src/gui/res/vidalia_common.qrc	2006-12-17 00:48:18 UTC (rev 1538)
+++ trunk/src/gui/res/vidalia_common.qrc	2006-12-17 04:13:16 UTC (rev 1539)
@@ -11,6 +11,8 @@
         <file>16x16/format-justify-fill.png</file>
         <file>16x16/go-next.png</file>
         <file>16x16/go-previous.png</file>
+        <file>16x16/graph-area.png</file>
+        <file>16x16/graph-line.png</file>
         <file>16x16/help-browser.png</file>
         <file>16x16/msg-debug.png</file>
         <file>16x16/msg-error.png</file>