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

[vidalia-svn] r3463: Make the "Zoom In" and "Zoom Out" buttons work again, and no (vidalia/branches/marble/src/vidalia/network)



Author: edmanm
Date: 2009-01-19 02:44:02 -0500 (Mon, 19 Jan 2009)
New Revision: 3463

Modified:
   vidalia/branches/marble/src/vidalia/network/netviewer.cpp
   vidalia/branches/marble/src/vidalia/network/netviewer.h
Log:
Make the "Zoom In" and "Zoom Out" buttons work again, and note why this is
currently a hack to get around the fact that every zoom-related function in
MarbleWidget forces a repaint except zoomIn() and zoomOut(). Go figure.


Modified: vidalia/branches/marble/src/vidalia/network/netviewer.cpp
===================================================================
--- vidalia/branches/marble/src/vidalia/network/netviewer.cpp	2009-01-19 07:05:55 UTC (rev 3462)
+++ vidalia/branches/marble/src/vidalia/network/netviewer.cpp	2009-01-19 07:44:02 UTC (rev 3463)
@@ -73,8 +73,8 @@
           this, SLOT(displayRouterInfo(QString)));
 
   /* Connect zoom buttons to TorMapWidget zoom slots */
-  connect(ui.actionZoomIn, SIGNAL(triggered()), _map, SLOT(zoomIn()));
-  connect(ui.actionZoomOut, SIGNAL(triggered()), _map, SLOT(zoomOut()));
+  connect(ui.actionZoomIn, SIGNAL(triggered()), this, SLOT(zoomIn()));
+  connect(ui.actionZoomOut, SIGNAL(triggered()), this, SLOT(zoomOut()));
   connect(ui.actionZoomToFit, SIGNAL(triggered()), _map, SLOT(zoomToFit()));
 
   /* Create the timer that will be used to update the router list once every
@@ -520,3 +520,25 @@
   dlg.exec();
 }
 
+/* XXX: The following zoomIn() and zoomOut() slots are a hack. MarbleWidget
+ *      does have zoomIn() and zoomOut() slots to which we could connect the
+ *      buttons, but these slots currently don't force a repaint. So to see
+ *      the zoom effect, the user has to click on the map after clicking one
+ *      of the zoom buttons. Instead, we use the zoomViewBy() method, which
+ *      DOES force a repaint.
+ */
+/** Called when the user clicks the "Zoom In" button. */
+void
+NetViewer::zoomIn()
+{
+  _map->zoomViewBy(40);
+}
+
+/** Called when the user clicks the "Zoom Out" button. */
+void
+NetViewer::zoomOut()
+{
+  _map->zoomViewBy(-40);
+}
+
+

Modified: vidalia/branches/marble/src/vidalia/network/netviewer.h
===================================================================
--- vidalia/branches/marble/src/vidalia/network/netviewer.h	2009-01-19 07:05:55 UTC (rev 3462)
+++ vidalia/branches/marble/src/vidalia/network/netviewer.h	2009-01-19 07:44:02 UTC (rev 3463)
@@ -78,6 +78,10 @@
    * dialog with detailed information for the router specified by
    * <b>id</b>.*/
   void displayRouterInfo(const QString &id);
+  /** Called when the user clicks the "Zoom In" button. */
+  void zoomIn();
+  /** Called when the user clicks the "Zoom Out" button. */
+  void zoomOut();
 
 private:
   /** Adds an IP address to the resolve queue and updates the queue timers. */