more info on fail
This commit is contained in:
32
configure.in
32
configure.in
@@ -28,22 +28,9 @@ AC_SUBST(MAJOR)
|
||||
AC_SUBST(MINOR)
|
||||
AC_SUBST(LEAST)
|
||||
|
||||
case $host in
|
||||
*darwin*)
|
||||
PROXYLIB="-lproxy"
|
||||
;;
|
||||
*mingw*|*win*)
|
||||
PROXYLIB="-lwinhttp"
|
||||
;;
|
||||
*)
|
||||
PROXYLIB="-lproxy"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(PROXYLIB)
|
||||
|
||||
# Qt Environment
|
||||
CPPFLAGS+=" -DUNICODE -DQT_NO_DEBUG"
|
||||
CPPFLAGS+=" -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB"
|
||||
CPPFLAGS+=" -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_WEBKIT_LIB -DQT_CORE_LIB"
|
||||
AC_CHECK_HEADER(QtCore/QString, [found="yes"], [found="no"])
|
||||
if test "$found" == "no"; then
|
||||
AC_MSG_CHECKING([looking for qt headers])
|
||||
@@ -60,8 +47,20 @@ if test "$found" == "no"; then
|
||||
AC_MSG_RESULT([$found])
|
||||
fi
|
||||
if test "$found" == "no"; then
|
||||
AC_MSG_ERROR([Qt Headers not found])
|
||||
fi
|
||||
case $host in
|
||||
*darwin*)
|
||||
PROXYLIB="-lproxy"
|
||||
;;
|
||||
*mingw*|*win*)
|
||||
PROXYLIB="-lwinhttp"
|
||||
;;
|
||||
*)
|
||||
PROXYLIB="-lproxy"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(PROXYLIB)
|
||||
AC_MSG_WARN([Qt Headers not found])
|
||||
else
|
||||
AC_CHECK_PROGS([MOC], [moc-qt4 moc-mac moc])
|
||||
test -n "$MOC" || AC_MSG_ERROR([moc for Qt 4 not found!])
|
||||
AC_SUBST(MOC)
|
||||
@@ -75,6 +74,7 @@ AC_CHECK_PROGS([LUPDATE], [lupdate-qt4 lupdate-mac lupdate])
|
||||
test -n "$LUPDATE" || AC_MSG_ERROR([lupdate for Qt 4 not found!])
|
||||
AC_SUBST(LUPDATE)
|
||||
AC_ARG_VAR(LUPDATE_ARGS, [arguments for qt lupdate command, e.g. -no-obsolete])
|
||||
fi
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
|
@@ -111,7 +111,7 @@ namespace proxy {
|
||||
@param url the url to find a proxy for
|
||||
@param timeout [ms] time to give up search */
|
||||
void proxy(const std::string& url,
|
||||
int timeout1=1000, int timeout2=30000) {
|
||||
int timeout1=5000, int timeout2=30000) {
|
||||
qDebug()<<"Search proxy for URL, direct and default"
|
||||
<<"url="<<url.data()<<"timeout1="<<timeout1;
|
||||
_url = url;
|
||||
@@ -132,12 +132,12 @@ namespace proxy {
|
||||
}
|
||||
//! If Qt Network is available you may check the proxies found
|
||||
/*! @copydoc proxy(const std::string&, int) */
|
||||
void proxy(const QUrl& url, int timeout1=1000, int timeout2=30000) {
|
||||
void proxy(const QUrl& url, int timeout1=5000, int timeout2=30000) {
|
||||
proxy(url.toString().toStdString(), timeout1, timeout2);
|
||||
}
|
||||
//! If Qt Network is available you may check the proxies found
|
||||
/*! @copydoc proxy(const std::string&, int) */
|
||||
void proxy(const QString& url, int timeout1=1000, int timeout2=30000) {
|
||||
void proxy(const QString& url, int timeout1=5000, int timeout2=30000) {
|
||||
proxy(url.toStdString(), timeout1, timeout2);
|
||||
}
|
||||
static QString toString(const QNetworkProxy& p) {
|
||||
@@ -170,6 +170,8 @@ namespace proxy {
|
||||
void proxyFound(const QUrl&, const QNetworkProxy&);
|
||||
//! Signals a timeout, and no valid proxy for the URL requested earlier.
|
||||
void proxyError(QNetworkReply::NetworkError);
|
||||
//! Signals an error during proxy detection.
|
||||
void temporaryError(QNetworkReply::NetworkError, QString, QString);
|
||||
private:
|
||||
void setupProxyCheck(const QNetworkProxy& prxy, const std::string& url) {
|
||||
qDebug()<<"Testing proxy for url:"<<toString(prxy)<<"url="<<url.data();
|
||||
@@ -226,7 +228,11 @@ namespace proxy {
|
||||
void replyFinished(QNetworkReply* reply) {
|
||||
qDebug()<<"Proxydetection got reply with status:"
|
||||
<<reply->error()<<reply->errorString();
|
||||
if (reply->error()!=QNetworkReply::NoError) return; // wait for timeout
|
||||
if (reply->error()!=QNetworkReply::NoError) {
|
||||
temporaryError(reply->error(), reply->errorString(),
|
||||
toString(_requests[reply].second));
|
||||
return; // wait for timeout
|
||||
}
|
||||
_timeout1.stop();
|
||||
_timeout2.stop();
|
||||
QNetworkProxy prxy(_requests[reply].second);
|
||||
@@ -284,6 +290,16 @@ namespace proxy {
|
||||
};
|
||||
}
|
||||
|
||||
/*
|
||||
#ifdef QT_WEBKIT_LIB
|
||||
// use plain QT implementation
|
||||
# include <proxyface/plainqt.hxx>
|
||||
namespace proxy {
|
||||
typedef Qt Face;
|
||||
}
|
||||
#else
|
||||
# error no QT_WEBKIT_LIB
|
||||
*/
|
||||
# ifdef WIN32
|
||||
// use windoze proprietary winhttp
|
||||
# include <proxyface/windoze.hxx>
|
||||
@@ -297,5 +313,6 @@ namespace proxy {
|
||||
typedef Unix Face;
|
||||
}
|
||||
# endif
|
||||
//#endif
|
||||
|
||||
#endif
|
||||
|
@@ -1,7 +1,7 @@
|
||||
UISOURCES = proxy.ui
|
||||
MOCHEADER = proxy.hxx autoproxy.hxx
|
||||
LANGUAGES = proxy_de.qm proxy_en.qm proxy_fr.qm proxy_it.qm \
|
||||
proxy_de.ts proxy_en.ts proxy_fr.ts proxy_it.ts
|
||||
LANGUAGES = proxy_de.qm proxy_en.qm proxy_fr.qm proxy_it.qm
|
||||
LANG_TS = proxy_de.ts proxy_en.ts proxy_fr.ts proxy_it.ts
|
||||
|
||||
UIHEADER = ui_proxy.hxx
|
||||
MOCSOURCES = moc_proxy.cxx moc_autoproxy.cxx
|
||||
@@ -9,7 +9,7 @@ MOCSOURCES = moc_proxy.cxx moc_autoproxy.cxx
|
||||
BUILT_SOURCES = ${UIHEADER} ${MOCSOURCES} ${LANGUAGES}
|
||||
|
||||
proxyfacedir = ${includedir}/proxyface
|
||||
proxyface_HEADERS = unix.hxx windoze.hxx \
|
||||
proxyface_HEADERS = unix.hxx windoze.hxx plainqt.hxx \
|
||||
${MOCHEADER} ${UIHEADER}
|
||||
|
||||
lib_LTLIBRARIES = libproxyface.la
|
||||
@@ -21,12 +21,12 @@ libproxyface_la_LDFLAGS = -version-info ${LIB_VERSION}
|
||||
AM_CPPFLAGS = -I${top_srcdir} -I${top_builddir}
|
||||
|
||||
moc_%.cxx: %.hxx
|
||||
${MOC} ${CPPFLAGS} ${AM_CPPFLAGS} -o $@ $<
|
||||
${MOC} -DMOC ${CPPFLAGS} ${AM_CPPFLAGS} -o $@ $<
|
||||
|
||||
ui_%.hxx: %.ui
|
||||
${UIC} -o $@ $<
|
||||
|
||||
%.ts: ${UISOURCES} ${MOCHEADER}
|
||||
%.ts: ${UISOURCES} ${MOCHEADER} ${proxyface_HEADERS}
|
||||
${LUPDATE} ${LUPDATE_ARGS} $^ -ts $@
|
||||
|
||||
%.qm: %.ts
|
||||
|
38
proxyface/plainqt.hxx
Normal file
38
proxyface/plainqt.hxx
Normal file
@@ -0,0 +1,38 @@
|
||||
/*! @file
|
||||
|
||||
@id $Id$
|
||||
*/
|
||||
// 1 2 3 4 5 6 7 8
|
||||
// 45678901234567890123456789012345678901234567890123456789012345678901234567890
|
||||
|
||||
#ifndef PROXY_QT
|
||||
#define PROXY_QT
|
||||
|
||||
#include <QtNetwork/QHostInfo>
|
||||
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
namespace proxy {
|
||||
|
||||
class Qt: public Interface {
|
||||
|
||||
public:
|
||||
|
||||
Qt() {}
|
||||
|
||||
virtual ~Qt() {}
|
||||
|
||||
//! Implements WPAD using Qt Network and Qt Webkit
|
||||
virtual List proxies(const std::string& url) {
|
||||
List res;
|
||||
qDebug()<<"Hostname: "<<QHostInfo::localHostName();
|
||||
qDebug()<<"Domainname: "<<QHostInfo::localDomainName();
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
@@ -38,6 +38,10 @@ namespace gui {
|
||||
SLOT(proxyFoundSlot(const QUrl&, const QNetworkProxy&)));
|
||||
connect(&_auto, SIGNAL(proxyError(QNetworkReply::NetworkError)),
|
||||
SIGNAL(proxyError(QNetworkReply::NetworkError)));
|
||||
connect(&_auto, SIGNAL(temporaryError(QNetworkReply::NetworkError,
|
||||
QString, QString)),
|
||||
SIGNAL(temporaryError(QNetworkReply::NetworkError,
|
||||
QString, QString)));
|
||||
accept();
|
||||
}
|
||||
|
||||
@@ -66,6 +70,7 @@ namespace gui {
|
||||
|
||||
void proxyFound(const QUrl&, const QNetworkProxy&);
|
||||
void proxyError(QNetworkReply::NetworkError);
|
||||
void temporaryError(QNetworkReply::NetworkError, QString, QString);
|
||||
|
||||
public Q_SLOTS:
|
||||
|
||||
|
@@ -6,56 +6,68 @@
|
||||
<message>
|
||||
<location filename="proxy.ui" line="19"/>
|
||||
<location filename="proxy.ui" line="25"/>
|
||||
<location filename="ui_proxy.hxx" line="176"/>
|
||||
<location filename="ui_proxy.hxx" line="177"/>
|
||||
<source>Proxy Konfiguration</source>
|
||||
<translation>Proxy Einstellungen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="37"/>
|
||||
<location filename="ui_proxy.hxx" line="178"/>
|
||||
<source>Typ:</source>
|
||||
<translation>Typ:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="45"/>
|
||||
<location filename="ui_proxy.hxx" line="181"/>
|
||||
<source>direkt oder automatisch</source>
|
||||
<translation>automatisch</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="50"/>
|
||||
<location filename="ui_proxy.hxx" line="182"/>
|
||||
<source>HTTP</source>
|
||||
<translation>HTTP</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="55"/>
|
||||
<location filename="ui_proxy.hxx" line="183"/>
|
||||
<source>Socks5</source>
|
||||
<translation>Socks5</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="69"/>
|
||||
<location filename="ui_proxy.hxx" line="185"/>
|
||||
<source>URL:</source>
|
||||
<translation>Adresse:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="95"/>
|
||||
<location filename="ui_proxy.hxx" line="186"/>
|
||||
<source>Port:</source>
|
||||
<translation>Port:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="131"/>
|
||||
<location filename="ui_proxy.hxx" line="187"/>
|
||||
<source>Einstellungen lokal speichern</source>
|
||||
<translation>Einstellungen lokal speichern</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="137"/>
|
||||
<location filename="ui_proxy.hxx" line="188"/>
|
||||
<source>Speichern</source>
|
||||
<translation>Speichern</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="144"/>
|
||||
<location filename="ui_proxy.hxx" line="189"/>
|
||||
<source>Wenn Sie die Einstellungen speichern, werden sie auf diesem Computer in Ihrem Profil abgelegt.</source>
|
||||
<translation>Einstellungen werden nur auf diesem Computer gespeichert.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="157"/>
|
||||
<location filename="ui_proxy.hxx" line="190"/>
|
||||
<source>Loeschen</source>
|
||||
<translation>Entfernen</translation>
|
||||
</message>
|
||||
|
@@ -6,56 +6,68 @@
|
||||
<message>
|
||||
<location filename="proxy.ui" line="19"/>
|
||||
<location filename="proxy.ui" line="25"/>
|
||||
<location filename="ui_proxy.hxx" line="176"/>
|
||||
<location filename="ui_proxy.hxx" line="177"/>
|
||||
<source>Proxy Konfiguration</source>
|
||||
<translation>Proxy Settings</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="37"/>
|
||||
<location filename="ui_proxy.hxx" line="178"/>
|
||||
<source>Typ:</source>
|
||||
<translation>Type:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="45"/>
|
||||
<location filename="ui_proxy.hxx" line="181"/>
|
||||
<source>direkt oder automatisch</source>
|
||||
<translation>automatic</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="50"/>
|
||||
<location filename="ui_proxy.hxx" line="182"/>
|
||||
<source>HTTP</source>
|
||||
<translation>HTTP</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="55"/>
|
||||
<location filename="ui_proxy.hxx" line="183"/>
|
||||
<source>Socks5</source>
|
||||
<translation>Socks5</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="69"/>
|
||||
<location filename="ui_proxy.hxx" line="185"/>
|
||||
<source>URL:</source>
|
||||
<translation>Address:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="95"/>
|
||||
<location filename="ui_proxy.hxx" line="186"/>
|
||||
<source>Port:</source>
|
||||
<translation>Port:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="131"/>
|
||||
<location filename="ui_proxy.hxx" line="187"/>
|
||||
<source>Einstellungen lokal speichern</source>
|
||||
<translation>Save settings locally</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="137"/>
|
||||
<location filename="ui_proxy.hxx" line="188"/>
|
||||
<source>Speichern</source>
|
||||
<translation>Save</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="144"/>
|
||||
<location filename="ui_proxy.hxx" line="189"/>
|
||||
<source>Wenn Sie die Einstellungen speichern, werden sie auf diesem Computer in Ihrem Profil abgelegt.</source>
|
||||
<translation>Settings will be saved on this computer only.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="157"/>
|
||||
<location filename="ui_proxy.hxx" line="190"/>
|
||||
<source>Loeschen</source>
|
||||
<translation>Remove</translation>
|
||||
</message>
|
||||
|
@@ -6,56 +6,68 @@
|
||||
<message>
|
||||
<location filename="proxy.ui" line="19"/>
|
||||
<location filename="proxy.ui" line="25"/>
|
||||
<location filename="ui_proxy.hxx" line="176"/>
|
||||
<location filename="ui_proxy.hxx" line="177"/>
|
||||
<source>Proxy Konfiguration</source>
|
||||
<translation>Paramétrages du Proxy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="37"/>
|
||||
<location filename="ui_proxy.hxx" line="178"/>
|
||||
<source>Typ:</source>
|
||||
<translation>Type:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="45"/>
|
||||
<location filename="ui_proxy.hxx" line="181"/>
|
||||
<source>direkt oder automatisch</source>
|
||||
<translation>automatique</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="50"/>
|
||||
<location filename="ui_proxy.hxx" line="182"/>
|
||||
<source>HTTP</source>
|
||||
<translation>HTTP</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="55"/>
|
||||
<location filename="ui_proxy.hxx" line="183"/>
|
||||
<source>Socks5</source>
|
||||
<translation>Socks5</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="69"/>
|
||||
<location filename="ui_proxy.hxx" line="185"/>
|
||||
<source>URL:</source>
|
||||
<translation>Adresse:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="95"/>
|
||||
<location filename="ui_proxy.hxx" line="186"/>
|
||||
<source>Port:</source>
|
||||
<translation>Port:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="131"/>
|
||||
<location filename="ui_proxy.hxx" line="187"/>
|
||||
<source>Einstellungen lokal speichern</source>
|
||||
<translation>Enregistrer les paramètres localement</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="137"/>
|
||||
<location filename="ui_proxy.hxx" line="188"/>
|
||||
<source>Speichern</source>
|
||||
<translation>Salve</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="144"/>
|
||||
<location filename="ui_proxy.hxx" line="189"/>
|
||||
<source>Wenn Sie die Einstellungen speichern, werden sie auf diesem Computer in Ihrem Profil abgelegt.</source>
|
||||
<translation>Les paramètres seront enregistre seulement sur cet ordinateur.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="157"/>
|
||||
<location filename="ui_proxy.hxx" line="190"/>
|
||||
<source>Loeschen</source>
|
||||
<translation>Enlever</translation>
|
||||
</message>
|
||||
|
@@ -6,56 +6,68 @@
|
||||
<message>
|
||||
<location filename="proxy.ui" line="19"/>
|
||||
<location filename="proxy.ui" line="25"/>
|
||||
<location filename="ui_proxy.hxx" line="176"/>
|
||||
<location filename="ui_proxy.hxx" line="177"/>
|
||||
<source>Proxy Konfiguration</source>
|
||||
<translation>Impostazioni proxy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="37"/>
|
||||
<location filename="ui_proxy.hxx" line="178"/>
|
||||
<source>Typ:</source>
|
||||
<translation>Typo:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="45"/>
|
||||
<location filename="ui_proxy.hxx" line="181"/>
|
||||
<source>direkt oder automatisch</source>
|
||||
<translation>automatico</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="50"/>
|
||||
<location filename="ui_proxy.hxx" line="182"/>
|
||||
<source>HTTP</source>
|
||||
<translation>HTTP</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="55"/>
|
||||
<location filename="ui_proxy.hxx" line="183"/>
|
||||
<source>Socks5</source>
|
||||
<translation>Socks5</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="69"/>
|
||||
<location filename="ui_proxy.hxx" line="185"/>
|
||||
<source>URL:</source>
|
||||
<translation>Indirizzo:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="95"/>
|
||||
<location filename="ui_proxy.hxx" line="186"/>
|
||||
<source>Port:</source>
|
||||
<translation>Porta:</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="131"/>
|
||||
<location filename="ui_proxy.hxx" line="187"/>
|
||||
<source>Einstellungen lokal speichern</source>
|
||||
<translation>Salvare i parametri localmente</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="137"/>
|
||||
<location filename="ui_proxy.hxx" line="188"/>
|
||||
<source>Speichern</source>
|
||||
<translation>Salve</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="144"/>
|
||||
<location filename="ui_proxy.hxx" line="189"/>
|
||||
<source>Wenn Sie die Einstellungen speichern, werden sie auf diesem Computer in Ihrem Profil abgelegt.</source>
|
||||
<translation>I parametri verranno salvati solo su questo computer.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="proxy.ui" line="157"/>
|
||||
<location filename="ui_proxy.hxx" line="190"/>
|
||||
<source>Loeschen</source>
|
||||
<translation>Eliminazione</translation>
|
||||
</message>
|
||||
|
Reference in New Issue
Block a user