[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [vidalia/alpha] Make Bandwidth graph persistent
commit 9fd6057d6890155ece03d97754039404268a402d
Author: Tomas Touceda <chiiph@xxxxxxxxxx>
Date: Tue May 3 10:45:15 2011 -0300
Make Bandwidth graph persistent
---
src/vidalia/MainWindow.cpp | 11 +++++++----
src/vidalia/MainWindow.h | 2 ++
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/vidalia/MainWindow.cpp b/src/vidalia/MainWindow.cpp
index 97f9877..a3d3ae6 100644
--- a/src/vidalia/MainWindow.cpp
+++ b/src/vidalia/MainWindow.cpp
@@ -23,7 +23,6 @@
#include "VMessageBox.h"
#include "TorSettings.h"
#include "ServerSettings.h"
-#include "BandwidthGraph.h"
#include "AboutDialog.h"
#include "HelpBrowser.h"
#ifdef USE_AUTOUPDATE
@@ -122,6 +121,7 @@ MainWindow::createGUI()
// We need to create this tab at the beggining
// and we must specify the statusBar
_messageLog = new MessageLog(this->statusBar());
+ _graph = new BandwidthGraph(this->statusBar());
addTab(&_statusTab);
ui.tabWidget->pinTab(0);
@@ -1544,7 +1544,11 @@ MainWindow::delTab(int index)
index = ui.tabWidget->currentIndex();
VidaliaTab *tab = qobject_cast<VidaliaTab*>(ui.tabWidget->widget(index));
- if(tab != _messageLog && tab != &_statusTab && tab != &_netViewer) {
+ // if it isn't one of the tabs that's supposed to be open at every moment
+ if (tab != _messageLog &&
+ tab != &_statusTab &&
+ tab != &_netViewer &&
+ tab != _graph) {
QObject::disconnect(ui.tabWidget->widget(index), 0, 0, 0);
tab->deleteLater();
}
@@ -1568,8 +1572,7 @@ MainWindow::showMessageLogTab()
void
MainWindow::showBandwithTab()
{
- BandwidthGraph *graph = new BandwidthGraph(this->statusBar());
- addTab(graph);
+ addTab(_graph);
}
/** Creates and displays Vidalia's About dialog. */
diff --git a/src/vidalia/MainWindow.h b/src/vidalia/MainWindow.h
index a11dffc..a6dd309 100644
--- a/src/vidalia/MainWindow.h
+++ b/src/vidalia/MainWindow.h
@@ -24,6 +24,7 @@
#include "ConfigDialog.h"
#include "MessageLog.h"
#include "NetViewer.h"
+#include "BandwidthGraph.h"
#include "HelperProcess.h"
#if defined(USE_AUTOUPDATE)
#include "UpdateProcess.h"
@@ -304,6 +305,7 @@ private:
MessageLog *_messageLog; /**< Message log that displays a more detailed log from Tor */
NetViewer _netViewer; /**< Network map that draws circuits */
QStringList _tabMap; /**< Map to handle opened tabs */
+ BandwidthGraph *_graph; /**< Graph that draws bandwidth usage */
};
#endif
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits