00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If you 00004 ** did not receive the LICENSE file with this file, you may obtain it from the 00005 ** Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to the 00008 ** terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file networkpage.h 00013 ** \version $Id: networkpage.h 2362 2008-02-29 04:30:11Z edmanm $ 00014 ** \brief Network and firewall configuration options 00015 */ 00016 00017 #ifndef _NETWORKPAGE_H 00018 #define _NETWORKPAGE_H 00019 00020 #include <QPoint> 00021 #include <vidalia.h> 00022 00023 #include "configpage.h" 00024 #include "ui_networkpage.h" 00025 00026 00027 class NetworkPage : public ConfigPage 00028 { 00029 Q_OBJECT 00030 00031 public: 00032 /** Default Constructor */ 00033 NetworkPage(QWidget *parent = 0); 00034 00035 /** Saves the changes on this page */ 00036 bool save(QString &errmsg); 00037 /** Loads the settings for this page */ 00038 void load(); 00039 00040 /** Applies the network configuration settings to Tor. Returns true if the 00041 * settings were applied successfully. Otherwise, <b>errmsg</b> is set and 00042 * false is returned. */ 00043 bool apply(QString &errmsg); 00044 /** Reverts the server configuration settings to their values at the last 00045 * time they were successfully applied to Tor. */ 00046 void revert(); 00047 /** Returns true if the user has changed their server settings since the 00048 * last time they were applied to Tor. */ 00049 bool changedSinceLastApply(); 00050 00051 private slots: 00052 /** Adds a bridge to the bridge list box. */ 00053 void addBridge(); 00054 /** Removes one or more selected bridges from the bridge list box. */ 00055 void removeBridge(); 00056 /** Copies all selected bridges to the clipboard. */ 00057 void copySelectedBridgesToClipboard(); 00058 /** Called when the user right-clicks on a bridge and displays a context 00059 * menu. */ 00060 void bridgeContextMenuRequested(const QPoint &pos); 00061 /** Called when the user changes which bridges they have selected. */ 00062 void bridgeSelectionChanged(); 00063 /** Called when Vidalia has connected and authenticated to Tor. This will 00064 * check Tor's version number and, if it's too old, will disable the bridge 00065 * settings UI and show a message indicating the user's Tor is too old. */ 00066 void onAuthenticated(); 00067 /** Called when Vidalia disconnects from Tor. This will reenable the bridge 00068 * settings (if they were previously disabled) and hide the warning message 00069 * indicating the user's Tor does not support bridges. */ 00070 void onDisconnected(); 00071 /** Called when a link in a label is clicked. <b>url</b> is the target of 00072 * the clicked link.*/ 00073 void onLinkActivated(const QString &url); 00074 00075 private: 00076 /** Verifies that <b>bridge</b> is a valid bridge identifier and places a 00077 * normalized identifier in <b>out</b>. The normalized identifier will have 00078 * all spaces removed from the fingerprint portion (if any) and all 00079 * hexadecimal characters converted to uppercase. Returns true if 00080 * <b>bridge</b> is a valid bridge identifier, false otherwise. */ 00081 bool validateBridge(const QString &bridge, QString *out); 00082 00083 /** Qt Designer generated object */ 00084 Ui::NetworkPage ui; 00085 }; 00086 00087 #endif 00088