[vidalia/alpha] Add comments and clean up a bit

commit 3db72ba0776c8ec42a4601f9b3e6f4e7302a3525 Author: Tomas Touceda <chiiph@gentoo.org> Date: Fri May 27 20:53:58 2011 -0300 Add comments and clean up a bit --- src/vidalia/MainWindow.cpp | 3 --- src/vidalia/MainWindow.h | 17 +++++++++-------- src/vidalia/VAttachButton.cpp | 15 +++++++++++++++ src/vidalia/VAttachButton.h | 20 ++++++++++++++++++++ 4 files changed, 44 insertions(+), 11 deletions(-) diff --git a/src/vidalia/MainWindow.cpp b/src/vidalia/MainWindow.cpp index 3e9ce40..4c4359e 100644 --- a/src/vidalia/MainWindow.cpp +++ b/src/vidalia/MainWindow.cpp @@ -115,8 +115,6 @@ MainWindow::MainWindow() _status = Unset; _isVidaliaRunningTor = false; updateTorStatus(Stopped); - - setAcceptDrops(true); } /** Destructor */ @@ -197,7 +195,6 @@ MainWindow::createMenuBar() pluginsMenu->addAction(_actionDebugDialog); menu->addMenu(&_reattachMenu); - _dummy->setText(tr("No detached tabs")); _reattachMenu.addAction(_dummy); _dummy->setEnabled(false); diff --git a/src/vidalia/MainWindow.h b/src/vidalia/MainWindow.h index b7874fd..d30c059 100644 --- a/src/vidalia/MainWindow.h +++ b/src/vidalia/MainWindow.h @@ -60,10 +60,6 @@ protected: /** Called when the user changes the UI translation. */ virtual void retranslateUi(); -// void dropEvent(QDropEvent *de); -// void dragMoveEvent(QDragMoveEvent *de); -// void dragEnterEvent(QDragEnterEvent *event); - private slots: /** Respond to a double-click on the tray icon by opening the Control Panel * window. */ @@ -151,9 +147,14 @@ private slots: /** Deletes the tab at index if it exists and it isn't the Status tab */ void delTab(int index = -1); + /** Attaches a tab to the tabwidget */ void attachTab(); + /** Detaches a tab from the tabwidget */ void detachTab(); + /** Called when trying to close a tab that has been detached */ + void handleAttachedClose(); + #if defined(USE_AUTOUPDATE) /** Called when the user clicks the 'Check Now' button in the General * settings page. */ @@ -284,19 +285,19 @@ private: QAction *_actionExit; QAction *_actionDebugDialog; - QMenu _reattachMenu; - QAction *_dummy; + QMenu _reattachMenu; /**< Menu used to handle tab re-attaching */ + QAction *_dummy; /**< Dummy action to display when there are no more tabs */ Ui::MainWindow ui; /**< Qt Designer generated object. */ StatusTab _statusTab; /**< Status tab that displays the load progress and a short log */ 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 */ - QStringList _detachedTabMap; BandwidthGraph *_graph; /**< Graph that draws bandwidth usage */ PluginEngine *_engine; + QStringList _tabMap; /**< Map to handle opened tabs */ + QStringList _detachedTabMap; /**< Map to handle detached tabs */ }; #endif diff --git a/src/vidalia/VAttachButton.cpp b/src/vidalia/VAttachButton.cpp index 6d9991b..b5a5bab 100644 --- a/src/vidalia/VAttachButton.cpp +++ b/src/vidalia/VAttachButton.cpp @@ -1,3 +1,18 @@ +/* +** 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.torproject.org/projects/vidalia.html. 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 VAttachButton.cpp +** \brief Button that handles detaching of tabs +*/ + #include "VAttachButton.h" #define IMG_DETACH ":/images/16x16/detach-arrow.png" diff --git a/src/vidalia/VAttachButton.h b/src/vidalia/VAttachButton.h index bdced09..038eef9 100644 --- a/src/vidalia/VAttachButton.h +++ b/src/vidalia/VAttachButton.h @@ -1,3 +1,18 @@ +/* +** 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.torproject.org/projects/vidalia.html. 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 VAttachButton.cpp +** \brief Button that handles detaching of tabs +*/ + #ifndef VATTACHBUTTON_H #define VATTACHBUTTON_H @@ -12,14 +27,19 @@ class VAttachButton : public QPushButton { VAttachButton(QWidget *parent = 0); ~VAttachButton(); + /** Sets the parent tab for this button */ void setTab(VidaliaTab *tab); + /** Returns the parent tab for this button */ VidaliaTab *getTab(); signals: + /** Emitted when the button is pressed and the tab is detached */ void attachTab(); + /** Emitted when the button is pressed and the tab is attached */ void detachTab(); public slots: + /** Handles the onClicked signal */ void toggleAttach(); private:
participants (1)
-
chiiph@torproject.org