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

[vidalia-svn] r3938: Added back animated pixmap class. Beginning of statusbar imp (in vidalia/branches/extension-api/src/vidalia: . HomePlugin NetworkMapPlugin)



Author: tyree731
Date: 2009-07-06 14:09:06 -0400 (Mon, 06 Jul 2009)
New Revision: 3938

Added:
   vidalia/branches/extension-api/src/vidalia/HomePlugin/AnimatedPixmap.cpp
   vidalia/branches/extension-api/src/vidalia/HomePlugin/AnimatedPixmap.h
Modified:
   vidalia/branches/extension-api/src/vidalia/MainWindow.cpp
   vidalia/branches/extension-api/src/vidalia/MainWindow.h
   vidalia/branches/extension-api/src/vidalia/MainWindow.ui
   vidalia/branches/extension-api/src/vidalia/NetworkMapPlugin/NetViewer.ui
   vidalia/branches/extension-api/src/vidalia/VidaliaPanel.h
Log:
Added back animated pixmap class. Beginning of statusbar implementation. Tried multiple ideas but never seems to be exactly what we want.


Added: vidalia/branches/extension-api/src/vidalia/HomePlugin/AnimatedPixmap.cpp
===================================================================
--- vidalia/branches/extension-api/src/vidalia/HomePlugin/AnimatedPixmap.cpp	                        (rev 0)
+++ vidalia/branches/extension-api/src/vidalia/HomePlugin/AnimatedPixmap.cpp	2009-07-06 18:09:06 UTC (rev 3938)
@@ -0,0 +1,92 @@
+/*
+**  This file is part of Vidalia, and is subject to the license terms in the
+**  LICENSE file, found in the top level directory of this distribution. If you
+**  did not receive the LICENSE file with this file, you may obtain it from the
+**  Vidalia source package distributed by the Vidalia Project at
+**  http://www.vidalia-project.net/. No part of Vidalia, including this file,
+**  may be copied, modified, propagated, or distributed except according to the
+**  terms described in the LICENSE file.
+*/
+
+/** 
+ * \file AnimatedPixmap.cpp
+ * \version $Id$
+ */
+
+#include <QSize>
+#include <QRect>
+
+#include "AnimatedPixmap.h"
+
+
+/** Default constructor. */
+AnimatedPixmap::AnimatedPixmap()
+: _frameNumber(-1)
+{
+  _frameTimer.setInterval(100);
+  connect(&_frameTimer, SIGNAL(timeout()), this, SLOT(frameTimeout()));
+}
+
+/** Creates an animated pixmap from the specified file. */
+AnimatedPixmap::AnimatedPixmap(const QString &fileName, int frameDelay)
+{
+  _frameTimer.setInterval(frameDelay);
+  setPixmap(QPixmap(fileName));
+  connect(&_frameTimer, SIGNAL(timeout()), this, SLOT(frameTimeout()));
+}
+
+/** Starts the animation. */
+void
+AnimatedPixmap::start()
+{
+  _frameTimer.start();
+  _frameNumber = 0;
+}
+
+/** Stops the animated image. */
+void
+AnimatedPixmap::stop()
+{
+  _frameTimer.stop();
+}
+
+/** Sets the duration of each animation frame to <b>frameDelay</b>. */
+void
+AnimatedPixmap::setFrameDelay(int frameDelay)
+{
+  _frameTimer.setInterval(frameDelay);
+}
+
+/** Sets the source image for the animation to <b>pixmap</b>. */
+void
+AnimatedPixmap::setPixmap(const QPixmap &pixmap)
+{
+  _pixmap = pixmap;
+  _frameNumber = 0;
+}
+
+/** Returns the number of frames in the animation. */
+int
+AnimatedPixmap::frameCount() const
+{
+  return (_pixmap.width()/_pixmap.height());
+}
+
+/** Called when the current animation frame should be changed. */
+void
+AnimatedPixmap::frameTimeout()
+{
+  _frameNumber = (_frameNumber + 1) % frameCount();
+  emit frameChanged(_frameNumber);  
+}
+
+/** Returns the current animation frame. */
+QPixmap
+AnimatedPixmap::currentFrame() const
+{
+  return _pixmap.copy(_frameNumber * _pixmap.height(),
+                      0,
+                      _pixmap.height(),
+                      _pixmap.height());
+}
+


Property changes on: vidalia/branches/extension-api/src/vidalia/HomePlugin/AnimatedPixmap.cpp
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: vidalia/branches/extension-api/src/vidalia/HomePlugin/AnimatedPixmap.h
===================================================================
--- vidalia/branches/extension-api/src/vidalia/HomePlugin/AnimatedPixmap.h	                        (rev 0)
+++ vidalia/branches/extension-api/src/vidalia/HomePlugin/AnimatedPixmap.h	2009-07-06 18:09:06 UTC (rev 3938)
@@ -0,0 +1,65 @@
+/*
+**  This file is part of Vidalia, and is subject to the license terms in the
+**  LICENSE file, found in the top level directory of this distribution. If you
+**  did not receive the LICENSE file with this file, you may obtain it from the
+**  Vidalia source package distributed by the Vidalia Project at
+**  http://www.vidalia-project.net/. No part of Vidalia, including this file,
+**  may be copied, modified, propagated, or distributed except according to the
+**  terms described in the LICENSE file.
+*/
+
+/** 
+ * \file AnimatedPixmap.h
+ * \version $Id$
+ */
+
+#ifndef _ANIMATEDPIXMAP_H
+#define _ANIMATEDPIXMAP_H
+
+#include <QTimer>
+#include <QPixmap>
+
+/** Provides an animated pixmap that can be used even if Qt was compiled 
+ * without GIF support (which it is, by default) or the system doesn't have a 
+ * libmng available by default (OS X, for example, usually doesn't). Animated 
+ * pixmaps should have a series of square frames adjoined horizontally in a 
+ * single image file. */
+class AnimatedPixmap : public QObject
+{
+  Q_OBJECT
+
+public:
+  /** Default constructor. */
+  AnimatedPixmap();
+  /** Creates an animated pixmap from the specified file. */
+  AnimatedPixmap(const QString &fileName, int frameDelay = 100);
+
+  /** Starts the animation. */
+  void start();
+  /** Stops the animated image. */
+  void stop();
+  /** Returns the number of frames in the animation. */
+  int frameCount() const;
+  /** Returns the current animation frame. */
+  QPixmap currentFrame() const;
+  /** Sets the duration of each animation frame to <b>frameDelay</b>. */
+  void setFrameDelay(int frameDelay);
+  /** Sets the source image for the animation to <b>pixmap</b>. */
+  void setPixmap(const QPixmap &pixmap);
+
+signals:
+  /** Emitted when the current frame has changed. <b>frameNumber</b> contains
+   * the current frame number. */
+  void frameChanged(int frameNumber);
+
+private slots:
+  /** Called when the current animation frame should be changed. */
+  void frameTimeout();
+
+private:
+  QPixmap _pixmap;    /**< Source image for the animation frames. */
+  int _frameNumber;   /**< Current animation frame number. */
+  QTimer _frameTimer; /**< Timer to control the delay between frames. */
+};
+
+#endif


Property changes on: vidalia/branches/extension-api/src/vidalia/HomePlugin/AnimatedPixmap.h
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Modified: vidalia/branches/extension-api/src/vidalia/MainWindow.cpp
===================================================================
--- vidalia/branches/extension-api/src/vidalia/MainWindow.cpp	2009-07-05 20:44:12 UTC (rev 3937)
+++ vidalia/branches/extension-api/src/vidalia/MainWindow.cpp	2009-07-06 18:09:06 UTC (rev 3938)
@@ -40,7 +40,9 @@
 
 #include <QDir>
 #include <QMenuBar>
+#include <QPixmap>
 #include <QPluginLoader>
+#include <QSizePolicy>
 #include <QStringList>
 #include <QTimer>
 #include <QTextStream>
@@ -86,6 +88,12 @@
 #define IMG_TOR_STOPPING   ":/images/22x22/tor-stopping.png"
 #endif
 
+/* For all systems, use 16x16 for status bar icons. */
+#define IMG_TOR_STOPPED_16  ":/images/16x16/tor-off.png"
+#define IMG_TOR_RUNNING_16  ":/images/16x16/tor-on.png"
+#define IMG_TOR_STARTING_16 ":/images/16x16/tor-starting.png"
+#define IMG_TOR_STOPPING_16 ":/images/16x16/tor-stopping.png"
+
 /** Only allow 'New Identity' to be clicked once every 10 seconds. */
 #define MIN_NEWIDENTITY_INTERVAL   (10*1000)
 
@@ -121,6 +129,8 @@
 
   /* Create the actions that will go in the tray menu */
   createActions();
+  /* Create the statusbar and its permanant widget */
+  createStatusBar();
   /* Creates a tray icon with a context menu and adds it to the system's
    * notification area. */
   createTrayIcon();
@@ -130,12 +140,16 @@
   updateTorStatus(Stopped);
 
   /* Make the layout flush with the window */
-  setContentsMargins(-12, -12, -12, -12);
-  ui.vboxLayout->setContentsMargins(-12, -12, -12, -12);
+  setContentsMargins(-12, -12, -12, 0);
+  ui.vboxLayout->setContentsMargins(-12, -12, -12, 0);
 
   /* Populate the tab bar with plugins */
   populateTabs(_pluginManager->plugins());
 
+  /* When a tab changes, update the statusbar to give that tab control of it. */
+  connect(ui.tabMainPanel, SIGNAL(currentChanged(int)),
+	  this, SLOT(updateStatusControl(int)));
+
   /* Create a new TorControl object, used to communicate with Tor */
   _torControl = Vidalia::torControl(); 
   connect(_torControl, SIGNAL(started()), this, SLOT(started()));
@@ -585,8 +599,59 @@
 #endif
 }
 
-/** Start a web browser when given the directory containing the executable and profile */
+/** Creates the statusbar and its permanent widget */
 void
+MainWindow::createStatusBar()
+{
+  /* Create the status bar */
+  _statusBar = new QStatusBar(this);
+
+  /* Create the widget to be inserted in the statusbar */
+  QWidget* statusWidget = new QWidget(_statusBar);
+  statusWidget->setMaximumHeight(32);
+  statusWidget->setMinimumHeight(32);
+  QHBoxLayout* hLayout = new QHBoxLayout(statusWidget);
+  QSpacerItem* hSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding);
+
+  /* Progress bar */
+  _progressBar = new QProgressBar(statusWidget);
+  _progressBar->setMaximum(130);
+  _progressBar->setTextVisible(false);
+  _progressBar->setMaximumWidth(100);
+
+  /* Progress bar status */
+  _lblStartupProgress = new QLabel(tr("Starting Tor"), statusWidget);
+  _lblStartupProgress->setVisible(false);
+  _lblStartupProgress->setWordWrap(false);
+
+  /* Tor status image */
+  _lblTorStatusImg = new QLabel(statusWidget);
+  _lblTorStatusImg->setPixmap(QPixmap(IMG_TOR_STOPPED_16));
+
+  /* Tor status text */
+  _lblTorStatus = new QLabel(tr("Tor is not running"), statusWidget);
+  _lblTorStatus->setWordWrap(false);
+
+  /* Add the widgets */
+  hLayout->addSpacerItem(hSpacer);
+  hLayout->addWidget(_progressBar);
+  hLayout->addWidget(_lblStartupProgress);
+  hLayout->addWidget(_lblTorStatusImg);
+  hLayout->addWidget(_lblTorStatus);
+  
+  /* Set statusbar widget layout to hLayout */
+  statusWidget->setLayout(hLayout);
+
+  /* Add widget to statusbar */
+  _statusBar->addPermanentWidget(statusWidget);
+
+  /* Set window statusbar */
+  setStatusBar(_statusBar);
+}
+
+/** Start a web browser when given the directory containing the executable and 
+ * profile */
+void
 MainWindow::launchBrowserFromDirectory()
 {
   VidaliaSettings settings;
@@ -888,7 +953,7 @@
       statusText = tr("Tor is not running");
       actionText = tr("Start Tor");
       trayIconFile = IMG_TOR_STOPPED;
-      statusIconFile = IMG_TOR_STOPPED_48;
+      statusIconFile = IMG_TOR_STOPPED_16;
       _startStopAct->setEnabled(true);
       _startStopAct->setText(actionText);
       _startStopAct->setIcon(QIcon(IMG_START_TOR_16));
@@ -906,7 +971,7 @@
         statusText = tr("Tor is shutting down");
       }
       trayIconFile = IMG_TOR_STOPPING;
-      statusIconFile = IMG_TOR_STOPPING_48;
+      statusIconFile = IMG_TOR_STOPPING_16;
   } else if (status == Started) {
       actionText = tr("Stop Tor");
       _startStopAct->setEnabled(true);
@@ -920,14 +985,14 @@
   } else if (status == Starting)  {
       statusText = tr("Starting the Tor software");
       trayIconFile = IMG_TOR_STARTING;
-      statusIconFile = IMG_TOR_STARTING_48;
+      statusIconFile = IMG_TOR_STARTING_16;
       _startStopAct->setEnabled(false);
       setStartupProgressVisible(true);
       setStartupProgress(STARTUP_PROGRESS_STARTING, statusText);
   } else if (status == CircuitEstablished) {
       statusText = tr("Connected to the Tor network!");
       trayIconFile = IMG_TOR_RUNNING;
-      statusIconFile = IMG_TOR_RUNNING_48;
+      statusIconFile = IMG_TOR_RUNNING_16;
       setStartupProgressVisible(false);
   }
 
@@ -936,9 +1001,14 @@
     _trayIcon.setIcon(trayIconFile);
   }
 
+  /* Update the status banner on the control panel */
+  if (!statusIconFile.isEmpty())
+    _lblTorStatusImg->setPixmap(QPixmap(statusIconFile));
   if (!statusText.isEmpty()) {
     _trayIcon.setToolTip(statusText);
+    _lblTorStatus->setText(statusText);
   }
+
   return prevStatus;
 }
 
@@ -951,10 +1021,24 @@
 }
 
 /** Sets the visibility of the startup status description and progress bar to
- * <b>visible</b>. */
+ * <b>visible</b> for the status bar. */
 void
 MainWindow::setStartupProgressVisible(bool visible)
 {
+  if (visible) {
+    _lblTorStatus->setVisible(false);
+    _lblTorStatusImg->setVisible(false);
+    repaint(_statusBar->rect());
+    _lblStartupProgress->setVisible(true);
+    _progressBar->setVisible(true);
+  } else {
+    _lblStartupProgress->setVisible(false);
+    _progressBar->setVisible(false);
+    repaint(_statusBar->rect());
+    _lblTorStatus->setVisible(true);
+    _lblTorStatusImg->setVisible(true);
+  }
+
 }
 
 /** Sets the progress bar completion value to <b>progressValue</b> and sets
@@ -963,6 +1047,8 @@
 MainWindow::setStartupProgress(int progressValue,
                                const QString &description)
 {
+  _progressBar->setValue(progressValue);
+  _lblStartupProgress->setText(description);
   _trayIcon.setToolTip(description);
 }
 
@@ -1201,6 +1287,17 @@
   }
 }
 
+void
+MainWindow::updateStatusControl(int index)
+{
+  VidaliaPanel* selectedPanel = dynamic_cast<VidaliaPanel*>
+    (ui.tabMainPanel->widget(index));
+  if (selectedPanel) {
+    QWidget* statusWidget = selectedPanel->statusWidget();
+    /* Do something! */
+  }
+}
+
 /** Called when the control socket has successfully connected to Tor. */
 void
 MainWindow::connected()

Modified: vidalia/branches/extension-api/src/vidalia/MainWindow.h
===================================================================
--- vidalia/branches/extension-api/src/vidalia/MainWindow.h	2009-07-05 20:44:12 UTC (rev 3937)
+++ vidalia/branches/extension-api/src/vidalia/MainWindow.h	2009-07-06 18:09:06 UTC (rev 3938)
@@ -42,11 +42,14 @@
 #include "UPNPControl.h"
 #endif
 
+#include <QLabel>
 #include <QList>
 #include <QMainWindow>
+#include <QProgressBar>
 #include <QTimer>
 #include <QTabBar>
 #include <QStackedWidget>
+#include <QStatusBar>
 
 class MainWindow : public VidaliaWindow
 {
@@ -84,6 +87,9 @@
   bool stop();
   /** Called when the Tor process has exited, either expectedly or not. */
   void stopped(int errorCode, QProcess::ExitStatus exitStatus);
+  /** When the tab in the main window changes, update the statusbar to change
+   * control to the newly selected tab. */
+  void updateStatusControl(int index);
   /** Called when the control socket has connected to Tor. */
   void connected();
   /** Called when the control connection fails. */
@@ -178,6 +184,8 @@
   QMenu* createTrayMenu();
   /** Creates a default menubar on Mac */
   void createMenuBar();
+  /** Creates the status bar with the permanent Tor Status */
+  void createStatusBar();
   /** Updates the UI to reflect Tor's current <b>status</b>. Returns the
    * previously set TorStatus value. */
   TorStatus updateTorStatus(TorStatus status);
@@ -266,6 +274,13 @@
 #endif
   /** The menubar (Mac OS X only). */
   QMenuBar *_menuBar;
+  /** The statusbar */
+  QStatusBar *_statusBar;
+  /** The statusbar variables */
+  QProgressBar *_progressBar;
+  QLabel *_lblStartupProgress;
+  QLabel *_lblTorStatusImg;
+  QLabel *_lblTorStatus;
 
   /** Defines the actions for the tray menu */
   QAction* _controlPanelAct;

Modified: vidalia/branches/extension-api/src/vidalia/MainWindow.ui
===================================================================
--- vidalia/branches/extension-api/src/vidalia/MainWindow.ui	2009-07-05 20:44:12 UTC (rev 3937)
+++ vidalia/branches/extension-api/src/vidalia/MainWindow.ui	2009-07-06 18:09:06 UTC (rev 3938)
@@ -34,7 +34,7 @@
   </property>
   <widget class="QWidget" name="centralwidget">
    <layout class="QGridLayout" name="gridLayout">
-    <item row="0" column="0" colspan="2">
+    <item row="0" column="0">
      <layout class="QVBoxLayout" name="vboxLayout">
       <property name="spacing">
        <number>-1</number>
@@ -42,9 +42,6 @@
       <property name="sizeConstraint">
        <enum>QLayout::SetDefaultConstraint</enum>
       </property>
-      <property name="margin">
-       <number>0</number>
-      </property>
       <item>
        <widget class="QTabWidget" name="tabMainPanel">
         <property name="usesScrollButtons">
@@ -59,7 +56,6 @@
     </item>
    </layout>
   </widget>
-  <widget class="QStatusBar" name="statusbar"/>
   <widget class="QMenuBar" name="menubar">
    <property name="geometry">
     <rect>

Modified: vidalia/branches/extension-api/src/vidalia/NetworkMapPlugin/NetViewer.ui
===================================================================
--- vidalia/branches/extension-api/src/vidalia/NetworkMapPlugin/NetViewer.ui	2009-07-05 20:44:12 UTC (rev 3937)
+++ vidalia/branches/extension-api/src/vidalia/NetworkMapPlugin/NetViewer.ui	2009-07-06 18:09:06 UTC (rev 3938)
@@ -1,201 +1,180 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>NetViewer</class>
- <widget class="QMainWindow" name="NetViewer" >
-  <property name="geometry" >
+ <widget class="QMainWindow" name="NetViewer">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <width>844</width>
-    <height>596</height>
+    <height>607</height>
    </rect>
   </property>
-  <property name="sizePolicy" >
-   <sizepolicy>
-    <hsizetype>5</hsizetype>
-    <vsizetype>5</vsizetype>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
   </property>
-  <property name="contextMenuPolicy" >
+  <property name="contextMenuPolicy">
    <enum>Qt::NoContextMenu</enum>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>Tor Network Map</string>
   </property>
-  <property name="windowIcon" >
-   <iconset resource="../res/vidalia.qrc" >:/images/32x32/applications-internet.png</iconset>
+  <property name="windowIcon">
+   <iconset resource="../res/vidalia.qrc">
+    <normaloff>:/images/32x32/applications-internet.png</normaloff>:/images/32x32/applications-internet.png</iconset>
   </property>
-  <property name="toolButtonStyle" >
+  <property name="toolButtonStyle">
    <enum>Qt::ToolButtonTextUnderIcon</enum>
   </property>
-  <widget class="QWidget" name="centralwidget" >
-   <layout class="QVBoxLayout" >
-    <property name="margin" >
-     <number>9</number>
-    </property>
-    <property name="spacing" >
-     <number>6</number>
-    </property>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QVBoxLayout">
     <item>
-     <widget class="QSplitter" name="splitter" >
-      <property name="contextMenuPolicy" >
+     <widget class="QSplitter" name="splitter">
+      <property name="contextMenuPolicy">
        <enum>Qt::NoContextMenu</enum>
       </property>
-      <property name="orientation" >
+      <property name="orientation">
        <enum>Qt::Horizontal</enum>
       </property>
-      <property name="childrenCollapsible" >
+      <property name="childrenCollapsible">
        <bool>false</bool>
       </property>
-      <widget class="RouterListWidget" name="treeRouterList" >
-       <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>5</hsizetype>
-         <vsizetype>7</vsizetype>
+      <widget class="RouterListWidget" name="treeRouterList">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
          <horstretch>1</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-       <property name="minimumSize" >
+       <property name="minimumSize">
         <size>
          <width>175</width>
          <height>0</height>
         </size>
        </property>
-       <property name="contextMenuPolicy" >
+       <property name="contextMenuPolicy">
         <enum>Qt::DefaultContextMenu</enum>
        </property>
-       <property name="statusTip" >
+       <property name="statusTip">
         <string/>
        </property>
-       <property name="indentation" >
+       <property name="selectionMode">
+        <enum>QAbstractItemView::ExtendedSelection</enum>
+       </property>
+       <property name="indentation">
         <number>0</number>
        </property>
-       <property name="sortingEnabled" >
+       <property name="sortingEnabled">
         <bool>true</bool>
        </property>
-       <property name="selectionMode" >
-        <enum>QAbstractItemView::ExtendedSelection</enum>
-       </property>
+       <column>
+        <property name="text">
+         <string notr="true">1</string>
+        </property>
+       </column>
       </widget>
-      <widget class="QSplitter" name="splitter3" >
-       <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>5</hsizetype>
-         <vsizetype>5</vsizetype>
+      <widget class="QSplitter" name="splitter3">
+       <property name="sizePolicy">
+        <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
          <horstretch>100</horstretch>
          <verstretch>0</verstretch>
         </sizepolicy>
        </property>
-       <property name="contextMenuPolicy" >
+       <property name="contextMenuPolicy">
         <enum>Qt::NoContextMenu</enum>
        </property>
-       <property name="orientation" >
+       <property name="orientation">
         <enum>Qt::Vertical</enum>
        </property>
-       <property name="childrenCollapsible" >
+       <property name="childrenCollapsible">
         <bool>false</bool>
        </property>
-       <widget class="QFrame" name="frmMap" >
-        <property name="sizePolicy" >
-         <sizepolicy>
-          <hsizetype>7</hsizetype>
-          <vsizetype>7</vsizetype>
+       <widget class="QFrame" name="frmMap">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
           <horstretch>100</horstretch>
           <verstretch>100</verstretch>
          </sizepolicy>
         </property>
-        <property name="minimumSize" >
+        <property name="minimumSize">
          <size>
           <width>400</width>
           <height>300</height>
          </size>
         </property>
-        <property name="contextMenuPolicy" >
+        <property name="contextMenuPolicy">
          <enum>Qt::NoContextMenu</enum>
         </property>
-        <property name="frameShape" >
+        <property name="frameShape">
          <enum>QFrame::StyledPanel</enum>
         </property>
-        <property name="frameShadow" >
+        <property name="frameShadow">
          <enum>QFrame::Raised</enum>
         </property>
-        <layout class="QHBoxLayout" >
-         <property name="margin" >
-          <number>9</number>
-         </property>
-         <property name="spacing" >
-          <number>6</number>
-         </property>
+        <layout class="QHBoxLayout">
          <item>
-          <layout class="QGridLayout" >
-           <property name="margin" >
-            <number>0</number>
-           </property>
-           <property name="spacing" >
-            <number>6</number>
-           </property>
-          </layout>
+          <layout class="QGridLayout"/>
          </item>
         </layout>
        </widget>
-       <widget class="QSplitter" name="splitter2" >
-        <property name="sizePolicy" >
-         <sizepolicy>
-          <hsizetype>7</hsizetype>
-          <vsizetype>1</vsizetype>
+       <widget class="QSplitter" name="splitter2">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
           <horstretch>100</horstretch>
           <verstretch>1</verstretch>
          </sizepolicy>
         </property>
-        <property name="contextMenuPolicy" >
+        <property name="contextMenuPolicy">
          <enum>Qt::NoContextMenu</enum>
         </property>
-        <property name="orientation" >
+        <property name="orientation">
          <enum>Qt::Horizontal</enum>
         </property>
-        <property name="childrenCollapsible" >
+        <property name="childrenCollapsible">
          <bool>false</bool>
         </property>
-        <widget class="CircuitListWidget" name="treeCircuitList" >
-         <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>5</hsizetype>
-           <vsizetype>5</vsizetype>
+        <widget class="CircuitListWidget" name="treeCircuitList">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
            <horstretch>100</horstretch>
            <verstretch>100</verstretch>
           </sizepolicy>
          </property>
-         <property name="minimumSize" >
+         <property name="minimumSize">
           <size>
            <width>300</width>
            <height>0</height>
           </size>
          </property>
-         <property name="contextMenuPolicy" >
+         <property name="contextMenuPolicy">
           <enum>Qt::CustomContextMenu</enum>
          </property>
-         <property name="statusTip" >
+         <property name="statusTip">
           <string/>
          </property>
-         <property name="sortingEnabled" >
+         <property name="sortingEnabled">
           <bool>false</bool>
          </property>
+         <column>
+          <property name="text">
+           <string notr="true">1</string>
+          </property>
+         </column>
         </widget>
-        <widget class="RouterDescriptorView" name="textRouterInfo" >
-         <property name="sizePolicy" >
-          <sizepolicy>
-           <hsizetype>5</hsizetype>
-           <vsizetype>5</vsizetype>
+        <widget class="RouterDescriptorView" name="textRouterInfo">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
            <horstretch>100</horstretch>
            <verstretch>100</verstretch>
           </sizepolicy>
          </property>
-         <property name="contextMenuPolicy" >
+         <property name="contextMenuPolicy">
           <enum>Qt::DefaultContextMenu</enum>
          </property>
-         <property name="readOnly" >
+         <property name="readOnly">
           <bool>true</bool>
          </property>
         </widget>
@@ -205,131 +184,139 @@
     </item>
    </layout>
   </widget>
-  <widget class="QStatusBar" name="statusbar" />
-  <widget class="QToolBar" name="toolBar" >
-   <property name="contextMenuPolicy" >
+  <widget class="QToolBar" name="toolBar">
+   <property name="contextMenuPolicy">
     <enum>Qt::NoContextMenu</enum>
    </property>
-   <property name="movable" >
+   <property name="movable">
     <bool>false</bool>
    </property>
-   <property name="orientation" >
+   <property name="orientation">
     <enum>Qt::Horizontal</enum>
    </property>
-   <attribute name="toolBarArea" >
-    <number>4</number>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
    </attribute>
-   <addaction name="actionRefresh" />
-   <addaction name="separator" />
-   <addaction name="actionZoomIn" />
-   <addaction name="actionZoomOut" />
-   <addaction name="actionZoomToFit" />
-   <addaction name="actionZoomFullScreen" />
-   <addaction name="separator" />
-   <addaction name="actionHelp" />
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+   <addaction name="actionRefresh"/>
+   <addaction name="separator"/>
+   <addaction name="actionZoomIn"/>
+   <addaction name="actionZoomOut"/>
+   <addaction name="actionZoomToFit"/>
+   <addaction name="actionZoomFullScreen"/>
+   <addaction name="separator"/>
+   <addaction name="actionHelp"/>
   </widget>
-  <action name="actionRefresh" >
-   <property name="enabled" >
+  <action name="actionRefresh">
+   <property name="enabled">
     <bool>false</bool>
    </property>
-   <property name="icon" >
-    <iconset resource="../res/vidalia.qrc" >:/images/32x32/view-refresh.png</iconset>
+   <property name="icon">
+    <iconset resource="../res/vidalia.qrc">
+     <normaloff>:/images/32x32/view-refresh.png</normaloff>:/images/32x32/view-refresh.png</iconset>
    </property>
-   <property name="text" >
+   <property name="text">
     <string>Refresh</string>
    </property>
-   <property name="toolTip" >
+   <property name="toolTip">
     <string>Refresh the list of Tor relays and connections</string>
    </property>
-   <property name="statusTip" >
+   <property name="statusTip">
     <string>Refresh the list of Tor relays and connections</string>
    </property>
-   <property name="shortcut" >
+   <property name="shortcut">
     <string>Ctrl+R</string>
    </property>
   </action>
-  <action name="actionHelp" >
-   <property name="icon" >
-    <iconset resource="../res/vidalia.qrc" >:/images/32x32/system-help.png</iconset>
+  <action name="actionHelp">
+   <property name="icon">
+    <iconset resource="../res/vidalia.qrc">
+     <normaloff>:/images/32x32/system-help.png</normaloff>:/images/32x32/system-help.png</iconset>
    </property>
-   <property name="text" >
+   <property name="text">
     <string>Help</string>
    </property>
-   <property name="toolTip" >
+   <property name="toolTip">
     <string>Show the network map help</string>
    </property>
-   <property name="statusTip" >
+   <property name="statusTip">
     <string>Show network map help</string>
    </property>
-   <property name="shortcut" >
+   <property name="shortcut">
     <string>F1</string>
    </property>
   </action>
-  <action name="actionZoomIn" >
-   <property name="icon" >
-    <iconset resource="../res/vidalia.qrc" >:/images/32x32/zoom-in.png</iconset>
+  <action name="actionZoomIn">
+   <property name="icon">
+    <iconset resource="../res/vidalia.qrc">
+     <normaloff>:/images/32x32/zoom-in.png</normaloff>:/images/32x32/zoom-in.png</iconset>
    </property>
-   <property name="text" >
+   <property name="text">
     <string>Zoom In</string>
    </property>
-   <property name="toolTip" >
+   <property name="toolTip">
     <string>Zoom in on the network map</string>
    </property>
-   <property name="statusTip" >
+   <property name="statusTip">
     <string>Zoom in on the network map</string>
    </property>
-   <property name="shortcut" >
+   <property name="shortcut">
     <string>+</string>
    </property>
   </action>
-  <action name="actionZoomOut" >
-   <property name="icon" >
-    <iconset resource="../res/vidalia.qrc" >:/images/32x32/zoom-out.png</iconset>
+  <action name="actionZoomOut">
+   <property name="icon">
+    <iconset resource="../res/vidalia.qrc">
+     <normaloff>:/images/32x32/zoom-out.png</normaloff>:/images/32x32/zoom-out.png</iconset>
    </property>
-   <property name="text" >
+   <property name="text">
     <string>Zoom Out</string>
    </property>
-   <property name="toolTip" >
+   <property name="toolTip">
     <string>Zoom out on the network map</string>
    </property>
-   <property name="statusTip" >
+   <property name="statusTip">
     <string>Zoom out on the network map</string>
    </property>
-   <property name="shortcut" >
+   <property name="shortcut">
     <string>-</string>
    </property>
   </action>
-  <action name="actionZoomToFit" >
-   <property name="icon" >
-    <iconset resource="../res/vidalia.qrc" >:/images/32x32/zoom-fit-best.png</iconset>
+  <action name="actionZoomToFit">
+   <property name="icon">
+    <iconset resource="../res/vidalia.qrc">
+     <normaloff>:/images/32x32/zoom-fit-best.png</normaloff>:/images/32x32/zoom-fit-best.png</iconset>
    </property>
-   <property name="text" >
+   <property name="text">
     <string>Zoom To Fit</string>
    </property>
-   <property name="toolTip" >
+   <property name="toolTip">
     <string>Zooms to fit all currently displayed circuits</string>
    </property>
-   <property name="statusTip" >
+   <property name="statusTip">
     <string>Zooms to fit all currently displayed circuits</string>
    </property>
-   <property name="shortcut" >
+   <property name="shortcut">
     <string>Ctrl+Z</string>
    </property>
   </action>
-  <action name="actionZoomFullScreen" >
-   <property name="icon" >
-    <iconset resource="../res/vidalia.qrc" >:/images/32x32/view-fullscreen.png</iconset>
+  <action name="actionZoomFullScreen">
+   <property name="icon">
+    <iconset resource="../res/vidalia.qrc">
+     <normaloff>:/images/32x32/view-fullscreen.png</normaloff>:/images/32x32/view-fullscreen.png</iconset>
    </property>
-   <property name="text" >
+   <property name="text">
     <string>Full Screen</string>
    </property>
-   <property name="toolTip" >
+   <property name="toolTip">
     <string>View the network map as a full screen window</string>
    </property>
-   <property name="statusTip" >
+   <property name="statusTip">
     <string>View the network map as a full screen window</string>
    </property>
-   <property name="shortcut" >
+   <property name="shortcut">
     <string>Ctrl+F</string>
    </property>
   </action>
@@ -352,24 +339,7 @@
   </customwidget>
  </customwidgets>
  <resources>
-  <include location="../res/vidalia.qrc" />
+  <include location="../res/vidalia.qrc"/>
  </resources>
- <connections>
-  <connection>
-   <sender>actionClose</sender>
-   <signal>triggered()</signal>
-   <receiver>NetViewer</receiver>
-   <slot>close()</slot>
-   <hints>
-    <hint type="sourcelabel" >
-     <x>-1</x>
-     <y>-1</y>
-    </hint>
-    <hint type="destinationlabel" >
-     <x>403</x>
-     <y>322</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
+ <connections/>
 </ui>

Modified: vidalia/branches/extension-api/src/vidalia/VidaliaPanel.h
===================================================================
--- vidalia/branches/extension-api/src/vidalia/VidaliaPanel.h	2009-07-05 20:44:12 UTC (rev 3937)
+++ vidalia/branches/extension-api/src/vidalia/VidaliaPanel.h	2009-07-06 18:09:06 UTC (rev 3938)
@@ -42,6 +42,8 @@
   virtual QString tabLabel() const = 0;
   /** Returns the icon to be displayed adjacent to the tabLabel. */
   virtual QIcon tabIcon() const = 0;
+  /** Returns the status widget to be displayed when panel is in focus */
+  virtual QWidget* statusWidget() const {return 0;}
 signals:
   void helpRequested(const QString& topic);
 protected: