summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/aqpkg/datamgr.cpp28
-rw-r--r--noncore/settings/aqpkg/datamgr.h18
-rw-r--r--noncore/settings/aqpkg/settings.ui245
-rw-r--r--noncore/settings/aqpkg/settingsimpl.cpp21
-rw-r--r--noncore/settings/aqpkg/settingsimpl.h2
5 files changed, 298 insertions, 16 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp
index 96c28c0..3933a22 100644
--- a/noncore/settings/aqpkg/datamgr.cpp
+++ b/noncore/settings/aqpkg/datamgr.cpp
@@ -125,25 +125,37 @@ void DataManager :: loadServers()
QString key = alias;
key += "_linkToRoot";
linkToRoot = cfg.readBoolEntry( key, true );
#endif
d.linkToRoot( linkToRoot );
destList.push_back( d );
}
- else if ( lineStr.startsWith( "option" ) )
+ else if ( lineStr.startsWith( "option" ) || lineStr.startsWith( "#option" ) )
{
char type[20];
char val[100];
sscanf( lineStr, "%*[^ ] %s %s", type, val );
if ( stricmp( type, "http_proxy" ) == 0 )
+ {
httpProxy = val;
+ if ( lineStr.startsWith( "#" ) )
+ httpProxyEnabled = false;
+ else
+ httpProxyEnabled = true;
+ }
if ( stricmp( type, "ftp_proxy" ) == 0 )
+ {
ftpProxy = val;
+ if ( lineStr.startsWith( "#" ) )
+ ftpProxyEnabled = false;
+ else
+ ftpProxyEnabled = true;
+ }
if ( stricmp( type, "proxy_username" ) == 0 )
proxyUsername = val;
if ( stricmp( type, "proxy_password" ) == 0 )
proxyPassword = val;
}
}
}
fclose( fp );
@@ -213,28 +225,36 @@ void DataManager :: writeOutIpkgConf()
// Write out destinations
vector<Destination>::iterator it2 = destList.begin();
while ( it2 != destList.end() )
{
out << "dest " << it2->getDestinationName() << " " << it2->getDestinationPath() << endl;
it2++;
}
+ out << endl;
out << "# Proxy Support" << endl;
- out << "#" << endl;
- if ( httpProxy == "" )
+ if ( !httpProxyEnabled && httpProxy == "" )
out << "#option http_proxy http://proxy.tld:3128" << endl;
else
+ {
+ if ( !httpProxyEnabled )
+ out << "#";
out << "option http_proxy " << httpProxy << endl;
+ }
- if ( ftpProxy == "" )
+ if ( !ftpProxyEnabled && ftpProxy == "" )
out << "#option ftp_proxy http://proxy.tld:3128" << endl;
else
+ {
+ if ( !ftpProxyEnabled )
+ out << "#";
out << "option ftp_proxy " << ftpProxy << endl;
+ }
if ( proxyUsername == "" )
out << "#option proxy_username <username>" << endl;
else
out << "option proxy_username " << proxyUsername << endl;
if ( proxyPassword == "" )
out << "#option proxy_password <password>" << endl << endl;
else
out << "option proxy_password " << proxyPassword << endl<< endl;
diff --git a/noncore/settings/aqpkg/datamgr.h b/noncore/settings/aqpkg/datamgr.h
index 41833df..0a7467f 100644
--- a/noncore/settings/aqpkg/datamgr.h
+++ b/noncore/settings/aqpkg/datamgr.h
@@ -53,21 +53,39 @@ public:
void loadServers();
void reloadServerData( );
void writeOutIpkgConf();
static QString getAvailableCategories() { return availableCategories; }
static void setAvailableCategories( QString section );
+ QString getHttpProxy() { return httpProxy; }
+ QString getFtpProxy() { return ftpProxy; }
+ QString getProxyUsername() { return proxyUsername; }
+ QString getProxyPassword() { return proxyPassword; }
+
+ bool getHttpProxyEnabled() { return httpProxyEnabled; }
+ bool getFtpProxyEnabled() { return ftpProxyEnabled; }
+
+ void setHttpProxy( QString proxy ) { httpProxy = proxy; }
+ void setFtpProxy( QString proxy ) { ftpProxy = proxy; }
+ void setProxyUsername( QString name ) { proxyUsername = name; }
+ void setProxyPassword( QString pword ) { proxyPassword = pword; }
+
+ void setHttpProxyEnabled( bool val ) { httpProxyEnabled = val; }
+ void setFtpProxyEnabled( bool val ) { ftpProxyEnabled = val; }
private:
static QString availableCategories;
QString activeServer;
QString httpProxy;
QString ftpProxy;
QString proxyUsername;
QString proxyPassword;
+ bool httpProxyEnabled;
+ bool ftpProxyEnabled;
+
vector<Server> serverList;
vector<Destination> destList;
};
#endif
diff --git a/noncore/settings/aqpkg/settings.ui b/noncore/settings/aqpkg/settings.ui
index 44e8fd9..b39d358 100644
--- a/noncore/settings/aqpkg/settings.ui
+++ b/noncore/settings/aqpkg/settings.ui
@@ -6,49 +6,49 @@
<name>name</name>
<cstring>Settings</cstring>
</property>
<property stdset="1">
<name>geometry</name>
<rect>
<x>0</x>
<y>0</y>
- <width>235</width>
+ <width>211</width>
<height>390</height>
</rect>
</property>
<property stdset="1">
<name>caption</name>
<string>Package Servers</string>
</property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
- <grid>
- <property stdset="1">
- <name>margin</name>
- <number>11</number>
- </property>
- <property stdset="1">
- <name>spacing</name>
- <number>6</number>
- </property>
- <widget row="0" column="0" >
+ <widget>
<class>QTabWidget</class>
<property stdset="1">
<name>name</name>
<cstring>TabWidget</cstring>
</property>
<property stdset="1">
<name>enabled</name>
<bool>true</bool>
</property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>11</x>
+ <y>11</y>
+ <width>209</width>
+ <height>368</height>
+ </rect>
+ </property>
<property>
<name>layoutMargin</name>
</property>
<property>
<name>layoutSpacing</name>
</property>
<widget>
<class>QWidget</class>
@@ -500,16 +500,231 @@
<widget>
<class>QWidget</class>
<property stdset="1">
<name>name</name>
<cstring>tab</cstring>
</property>
<attribute>
<name>title</name>
+ <string>Proxys</string>
+ </attribute>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>1</x>
+ <y>19</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>HTTP Proxy</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>txtFtpProxy</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>74</x>
+ <y>72</y>
+ <width>110</width>
+ <height>22</height>
+ </rect>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>txtHttpProxy</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>74</x>
+ <y>19</y>
+ <width>110</width>
+ <height>22</height>
+ </rect>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel4</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>1</x>
+ <y>153</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Password</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>txtUsername</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>74</x>
+ <y>125</y>
+ <width>110</width>
+ <height>22</height>
+ </rect>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>txtPassword</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>74</x>
+ <y>153</y>
+ <width>110</width>
+ <height>22</height>
+ </rect>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>chkFtpProxyEnabled</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>74</x>
+ <y>100</y>
+ <width>110</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Enabled</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>1</x>
+ <y>72</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>FTP Proxy</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>1</x>
+ <y>125</y>
+ <width>67</width>
+ <height>22</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Username</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>chkHttpProxyEnabled</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>74</x>
+ <y>47</y>
+ <width>110</width>
+ <height>19</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Enabled</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>btnProxyApply</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>74</x>
+ <y>181</y>
+ <width>110</width>
+ <height>28</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;Apply</string>
+ </property>
+ </widget>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>tab</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
<string>General</string>
</attribute>
<widget>
<class>QLabel</class>
<property stdset="1">
<name>name</name>
<cstring>TextLabel1</cstring>
</property>
@@ -544,17 +759,16 @@
</property>
<property stdset="1">
<name>text</name>
<string>Show Jump To Letters</string>
</property>
</widget>
</widget>
</widget>
- </grid>
</widget>
<connections>
<connection>
<sender>newserver</sender>
<signal>clicked()</signal>
<receiver>Settings</receiver>
<slot>newServer()</slot>
</connection>
@@ -601,30 +815,37 @@
<slot>changeDestinationDetails()</slot>
</connection>
<connection>
<sender>jumpTo</sender>
<signal>toggled(bool)</signal>
<receiver>Settings</receiver>
<slot>toggleJumpTo(bool)</slot>
</connection>
+ <connection>
+ <sender>btnProxyApply</sender>
+ <signal>clicked()</signal>
+ <receiver>Settings</receiver>
+ <slot>proxyApplyChanges()</slot>
+ </connection>
<slot access="public">activeServerChanged()</slot>
<slot access="public">changeDestinationDetails()</slot>
<slot access="public">changeServerDetails()</slot>
<slot access="public">createLinksToDest()</slot>
<slot access="public">destNameChanged(const QString&amp;)</slot>
<slot access="public">destUrlChanged(const QString&amp;)</slot>
<slot access="public">editDestination(int)</slot>
<slot access="public">editServer(int)</slot>
<slot access="public">installationSettingChange(int)</slot>
<slot access="public">installationSettingSetName(const QString &amp;)</slot>
<slot access="public">linkEnabled(bool)</slot>
<slot access="public">newDestination()</slot>
<slot access="public">newInstallationSetting()</slot>
<slot access="public">newServer()</slot>
+ <slot access="public">proxyApplyChanges()</slot>
<slot access="public">removeDestination()</slot>
<slot access="public">removeInstallationSetting()</slot>
<slot access="public">removeLinksToDest()</slot>
<slot access="public">removeServer()</slot>
<slot access="public">renameInstallationSetting()</slot>
<slot access="public">serverNameChanged(const QString&amp;)</slot>
<slot access="public">serverUrlChanged(const QString&amp;)</slot>
<slot access="public">toggleJumpTo(bool)</slot>
diff --git a/noncore/settings/aqpkg/settingsimpl.cpp b/noncore/settings/aqpkg/settingsimpl.cpp
index 9dd2206..4bb928a 100644
--- a/noncore/settings/aqpkg/settingsimpl.cpp
+++ b/noncore/settings/aqpkg/settingsimpl.cpp
@@ -73,23 +73,32 @@ void SettingsImpl :: setupData()
servers->insertItem( it->getServerName() );
}
// add destinations
vector<Destination>::iterator it2;
for ( it2 = dataMgr->getDestinationList().begin() ; it2 != dataMgr->getDestinationList().end() ; ++it2 )
destinations->insertItem( it2->getDestinationName() );
+ // setup general tab
#ifdef QWS
Config cfg( "aqpkg" );
cfg.setGroup( "settings" );
jumpTo->setChecked( cfg.readBoolEntry( "showJumpTo", "true" ) );
#else
jumpTo->setChecked( true );
#endif
+
+ // setup proxy tab
+ txtHttpProxy->setText( dataMgr->getHttpProxy() );
+ txtFtpProxy->setText( dataMgr->getFtpProxy() );
+ txtUsername->setText( dataMgr->getProxyUsername() );
+ txtPassword->setText( dataMgr->getProxyPassword() );
+ chkHttpProxyEnabled->setChecked( dataMgr->getHttpProxyEnabled() );
+ chkFtpProxyEnabled->setChecked( dataMgr->getFtpProxyEnabled() );
}
//------------------ Servers tab ----------------------
void SettingsImpl :: editServer( int sel )
{
currentSelectedServer = sel;
vector<Server>::iterator s = dataMgr->getServer( servers->currentText() );
@@ -239,8 +248,20 @@ void SettingsImpl :: toggleJumpTo( bool val )
{
#ifdef QWS
Config cfg( "aqpkg" );
cfg.setGroup( "settings" );
cfg.writeEntry( "showJumpTo", val );
#endif
}
+//------------------ Proxy tab ----------------------
+void SettingsImpl :: proxyApplyChanges()
+{
+ changed = true;
+ dataMgr->setHttpProxy( txtHttpProxy->text() );
+ dataMgr->setFtpProxy( txtFtpProxy->text() );
+ dataMgr->setProxyUsername( txtUsername->text() );
+ dataMgr->setProxyPassword( txtPassword->text() );
+
+ dataMgr->setHttpProxyEnabled( chkHttpProxyEnabled->isChecked() );
+ dataMgr->setFtpProxyEnabled( chkFtpProxyEnabled->isChecked() );
+}
diff --git a/noncore/settings/aqpkg/settingsimpl.h b/noncore/settings/aqpkg/settingsimpl.h
index 971516b..bb027dc 100644
--- a/noncore/settings/aqpkg/settingsimpl.h
+++ b/noncore/settings/aqpkg/settingsimpl.h
@@ -46,9 +46,11 @@ private:
void removeServer();
void editDestination( int s );
void changeDestinationDetails();
void newDestination();
void removeDestination();
void toggleJumpTo( bool val );
+
+ void proxyApplyChanges();
};