[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r2625: First commit. Hacked a network out by copying from the apper (in vidalia/branches/exit-country/src/vidalia: . config)
Author: cviecco
Date: 2008-05-30 08:10:49 -0400 (Fri, 30 May 2008)
New Revision: 2625
Added:
vidalia/branches/exit-country/src/vidalia/config/networkoutpage.cpp
vidalia/branches/exit-country/src/vidalia/config/networkoutpage.h
vidalia/branches/exit-country/src/vidalia/config/networkoutpage.ui
Modified:
vidalia/branches/exit-country/src/vidalia/CMakeLists.txt
vidalia/branches/exit-country/src/vidalia/config/configdialog.cpp
vidalia/branches/exit-country/src/vidalia/config/configdialog.h
Log:
First commit. Hacked a network out by copying from the apperance section.
Nothing fancy, just placeholders for future.
A config/networkoutpage.ui -> ui
A config/networkoutpage.h -> headers
M config/configdialog.cpp -> added new page
A config/networkoutpage.cpp -> config
M config/configdialog.h -> modified for correct compiling
M CMakeLists.txt -> modified for automation
Modified: vidalia/branches/exit-country/src/vidalia/CMakeLists.txt
===================================================================
--- vidalia/branches/exit-country/src/vidalia/CMakeLists.txt 2008-05-30 03:58:17 UTC (rev 2624)
+++ vidalia/branches/exit-country/src/vidalia/CMakeLists.txt 2008-05-30 12:10:49 UTC (rev 2625)
@@ -65,6 +65,7 @@
config/servicelist.cpp
config/servicepage.cpp
config/servicesettings.cpp
+ config/networkoutpage.cpp
config/torsettings.cpp
config/vidaliasettings.cpp
config/vsettings.cpp
@@ -85,6 +86,7 @@
config/serverpage.h
config/serversettings.h
config/servicepage.h
+ config/networkoutpage.h
config/torsettings.h
config/vidaliasettings.h
config/vsettings.h
@@ -198,6 +200,7 @@
config/networkpage.ui
config/serverpage.ui
config/servicepage.ui
+ config/networkoutpage.ui
help/browser/helpbrowser.ui
log/messagelog.ui
network/netviewer.ui
Modified: vidalia/branches/exit-country/src/vidalia/config/configdialog.cpp
===================================================================
--- vidalia/branches/exit-country/src/vidalia/config/configdialog.cpp 2008-05-30 03:58:17 UTC (rev 2624)
+++ vidalia/branches/exit-country/src/vidalia/config/configdialog.cpp 2008-05-30 12:10:49 UTC (rev 2625)
@@ -92,6 +92,12 @@
ui.stackPages->add(new ServicePage(ui.stackPages),
createPageAction(QIcon(IMAGE_SERVICE),
tr("Services"), grp));
+
+ ui.stackPages->add(new NetworkoutPage(ui.stackPages),
+ createPageAction(QIcon(IMAGE_NETWORK),
+ tr("Network out"), grp));
+
+
foreach (ConfigPage *page, ui.stackPages->pages()) {
connect(page, SIGNAL(helpRequested(QString)),
this, SLOT(help(QString)));
Modified: vidalia/branches/exit-country/src/vidalia/config/configdialog.h
===================================================================
--- vidalia/branches/exit-country/src/vidalia/config/configdialog.h 2008-05-30 03:58:17 UTC (rev 2624)
+++ vidalia/branches/exit-country/src/vidalia/config/configdialog.h 2008-05-30 12:10:49 UTC (rev 2625)
@@ -27,6 +27,7 @@
#include "advancedpage.h"
#include "appearancepage.h"
#include "servicepage.h"
+#include "networkoutpage.h"
#include "ui_configdialog.h"
Added: vidalia/branches/exit-country/src/vidalia/config/networkoutpage.cpp
===================================================================
--- vidalia/branches/exit-country/src/vidalia/config/networkoutpage.cpp (rev 0)
+++ vidalia/branches/exit-country/src/vidalia/config/networkoutpage.cpp 2008-05-30 12:10:49 UTC (rev 2625)
@@ -0,0 +1,73 @@
+/*
+** 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 appearancepage.cpp
+** \version $Id: appearancepage.cpp 2362 2008-02-29 04:30:11Z edmanm $
+** \brief Displays Vidalia language and style settings
+*/
+
+#include <vidalia.h>
+#include "networkoutpage.h"
+
+
+/** Default Constructor */
+NetworkoutPage::NetworkoutPage(QWidget *parent)
+: ConfigPage(parent, tr("Appearance"))
+{
+ /* Invoke Designer-generated object setup routine */
+ ui.setupUi(this);
+
+ /* Create VidaliaSettings object */
+ _settings = new VidaliaSettings();
+
+ /* Populate combo boxes */
+ foreach (QString code, LanguageSupport::languageCodes()) {
+ ui.cmboLanguage->addItem(LanguageSupport::languageName(code),
+ code);
+ }
+ foreach (QString style, QStyleFactory::keys()) {
+ ui.cmboStyle->addItem(style, style.toLower());
+ }
+}
+
+/** Destructor */
+NetworkoutPage::~NetworkoutPage()
+{
+ delete _settings;
+}
+
+/** Saves the changes on this page */
+bool
+NetworkoutPage::save(QString &errmsg)
+{
+ Q_UNUSED(errmsg);
+ QString languageCode =
+ LanguageSupport::languageCode(ui.cmboLanguage->currentText());
+
+ _settings->setLanguageCode(languageCode);
+ _settings->setInterfaceStyle(ui.cmboStyle->currentText());
+
+ /* Set to new style */
+ Vidalia::setStyle(ui.cmboStyle->currentText());
+ return true;
+}
+
+/** Loads the settings for this page */
+void
+NetworkoutPage::load()
+{
+ int index = ui.cmboLanguage->findData(_settings->getLanguageCode());
+ ui.cmboLanguage->setCurrentIndex(index);
+
+ index = ui.cmboStyle->findData(Vidalia::style().toLower());
+ ui.cmboStyle->setCurrentIndex(index);
+}
+
Added: vidalia/branches/exit-country/src/vidalia/config/networkoutpage.h
===================================================================
--- vidalia/branches/exit-country/src/vidalia/config/networkoutpage.h (rev 0)
+++ vidalia/branches/exit-country/src/vidalia/config/networkoutpage.h 2008-05-30 12:10:49 UTC (rev 2625)
@@ -0,0 +1,51 @@
+/*
+** 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 appearancepage.h
+** \version $Id: appearancepage.h 2362 2008-02-29 04:30:11Z edmanm $
+** \brief Displays Vidalia language and style settings
+*/
+
+#ifndef _NETWORKOUTPAGE_H
+#define _NETWORKOUTPAGE_H
+
+#include <QStyleFactory>
+#include <QLineEdit>
+
+#include <vidaliasettings.h>
+#include <languagesupport.h>
+
+#include "configpage.h"
+#include "ui_appearancepage.h"
+
+class NetworkoutPage : public ConfigPage
+{
+ Q_OBJECT
+
+public:
+ /** Default Constructor */
+ NetworkoutPage(QWidget *parent = 0);
+ /** Default Destructor */
+ ~NetworkoutPage();
+ /** Saves the changes on this page */
+ bool save(QString &errmsg);
+ /** Loads the settings for this page */
+ void load();
+
+private:
+ /** A VidaliaSettings object used for saving/loading settings */
+ VidaliaSettings* _settings;
+
+ /** Qt Designer generated object */
+ Ui::AppearancePage ui;
+};
+
+#endif
Added: vidalia/branches/exit-country/src/vidalia/config/networkoutpage.ui
===================================================================
--- vidalia/branches/exit-country/src/vidalia/config/networkoutpage.ui (rev 0)
+++ vidalia/branches/exit-country/src/vidalia/config/networkoutpage.ui 2008-05-30 12:10:49 UTC (rev 2625)
@@ -0,0 +1,162 @@
+<ui version="4.0" >
+ <author></author>
+ <comment></comment>
+ <exportmacro></exportmacro>
+ <class>NetworkoutPage</class>
+ <widget class="QWidget" name="AppearancePage" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>494</width>
+ <height>395</height>
+ </rect>
+ </property>
+ <property name="contextMenuPolicy" >
+ <enum>Qt::NoContextMenu</enum>
+ </property>
+ <layout class="QVBoxLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QGroupBox" name="grpLanguage" >
+ <property name="contextMenuPolicy" >
+ <enum>Qt::NoContextMenu</enum>
+ </property>
+ <property name="title" >
+ <string>Language</string>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="1" column="0" >
+ <widget class="QComboBox" name="cmboLanguage" >
+ <property name="minimumSize" >
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="contextMenuPolicy" >
+ <enum>Qt::NoContextMenu</enum>
+ </property>
+ <property name="toolTip" >
+ <string>Choose the language used in Vidalia</string>
+ </property>
+ <property name="editable" >
+ <bool>false</bool>
+ </property>
+ <property name="iconSize" >
+ <size>
+ <width>24</width>
+ <height>16</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>300</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="0" colspan="2" >
+ <widget class="QLabel" name="label" >
+ <property name="contextMenuPolicy" >
+ <enum>Qt::NoContextMenu</enum>
+ </property>
+ <property name="text" >
+ <string>Changes to language will only take effect after restarting Vidalia!</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="grpStyle" >
+ <property name="contextMenuPolicy" >
+ <enum>Qt::NoContextMenu</enum>
+ </property>
+ <property name="toolTip" >
+ <string/>
+ </property>
+ <property name="title" >
+ <string>Style</string>
+ </property>
+ <layout class="QGridLayout" >
+ <property name="margin" >
+ <number>9</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item row="0" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="0" >
+ <widget class="QComboBox" name="cmboStyle" >
+ <property name="minimumSize" >
+ <size>
+ <width>150</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="contextMenuPolicy" >
+ <enum>Qt::NoContextMenu</enum>
+ </property>
+ <property name="toolTip" >
+ <string>Choose Vidalia's interface style</string>
+ </property>
+ <property name="editable" >
+ <bool>false</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>476</width>
+ <height>161</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <pixmapfunction></pixmapfunction>
+ <resources/>
+ <connections/>
+</ui>