Skip to content

Commit

Permalink
qt now statically compiles for win32
Browse files Browse the repository at this point in the history
  • Loading branch information
mewmew-i2p committed Apr 23, 2018
1 parent d9b8731 commit c8de7aa
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 46 deletions.
18 changes: 0 additions & 18 deletions qt/i2pd_qt/ServerTunnelPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,24 +204,6 @@ int ServerTunnelPane::appendServerTunnelForm(
horizontalLayout_2->addItem(horizontalSpacer);
tunnelGridLayout->addLayout(horizontalLayout_2);
}
{
uint32_t maxConns = tunnelConfig->getmaxConns();
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
ui.maxConnsLabel = new QLabel(gridLayoutWidget_2);
maxConnsLabel->setObjectName(QStringLiteral("maxConnsLabel"));
horizontalLayout_2->addWidget(maxConnsLabel);
ui.maxConnsLineEdit = new QLineEdit(gridLayoutWidget_2);
maxConnsLineEdit->setObjectName(QStringLiteral("maxConnsLineEdit"));
maxConnsLineEdit->setText(QString::number(maxConns));
maxConnsLineEdit->setMaximumWidth(80);
QObject::connect(maxConnsLineEdit, SIGNAL(textChanged(const QString &)),
this, SLOT(updated()));
horizontalLayout_2->addWidget(maxConnsLineEdit);
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_2->addItem(horizontalSpacer);
tunnelGridLayout->addLayout(horizontalLayout_2);
}
{
std::string address = tunnelConfig->getaddress();
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
Expand Down
13 changes: 0 additions & 13 deletions qt/i2pd_qt/ServerTunnelPane.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ class ServerTunnelPane : public TunnelPane {
QLabel * addressLabel;
QLineEdit * addressLineEdit;

//maxConns
QLabel * maxConnsLabel;
QLineEdit * maxConnsLineEdit;

//gzip
QCheckBox * gzipCheckBox;

Expand All @@ -109,7 +105,6 @@ protected slots:
hostOverrideLabel->setText(QApplication::translate("srvTunForm", "Host override:", 0));
webIRCPassLabel->setText(QApplication::translate("srvTunForm", "WebIRC password:", 0));
addressLabel->setText(QApplication::translate("srvTunForm", "Address:", 0));
maxConnsLabel->setText(QApplication::translate("srvTunForm", "Max connections:", 0));

gzipCheckBox->setText(QApplication::translate("srvTunForm", "GZip", 0));
isUniqueLocalCheckBox->setText(QApplication::translate("srvTunForm", "Is unique local", 0));
Expand Down Expand Up @@ -152,14 +147,6 @@ protected slots:

stc->setaddress(addressLineEdit->text().toStdString());

auto mcStr=maxConnsLineEdit->text();
uint32_t mcInt=(uint32_t)mcStr.toInt(&ok);
if(!ok){
highlightWrongInput(QApplication::tr("Bad maxConns, must be int.")+" "+cannotSaveSettings,maxConnsLineEdit);
return false;
}
stc->setmaxConns(mcInt);

stc->setgzip(gzipCheckBox->isChecked());

stc->setisUniqueLocal(isUniqueLocalCheckBox->isChecked());
Expand Down
3 changes: 1 addition & 2 deletions qt/i2pd_qt/TunnelConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ void ServerTunnelConfig::saveToStringStream(std::stringstream& out) {
<< "enableuniquelocal=" << (isUniqueLocal?"true":"false") << "\n"
<< "address=" << address << "\n"
<< "hostoverride=" << hostOverride << "\n"
<< "webircpassword=" << webircpass << "\n"
<< "maxconns=" << maxConns << "\n";
<< "webircpassword=" << webircpass << "\n";
}

6 changes: 0 additions & 6 deletions qt/i2pd_qt/TunnelConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ class ClientTunnelConfig : public TunnelConfig {
std::string webircpass = section.second.get<std::string> (I2P_SERVER_TUNNEL_WEBIRC_PASSWORD, "");
bool gzip = section.second.get (I2P_SERVER_TUNNEL_GZIP, true);
i2p::data::SigningKeyType sigType = section.second.get (I2P_SERVER_TUNNEL_SIGNATURE_TYPE, i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256);
uint32_t maxConns = section.second.get(i2p::stream::I2CP_PARAM_STREAMING_MAX_CONNS_PER_MIN, i2p::stream::DEFAULT_MAX_CONNS_PER_MIN);
std::string address = section.second.get<std::string> (I2P_SERVER_TUNNEL_ADDRESS, "127.0.0.1");
bool isUniqueLocal = section.second.get(I2P_SERVER_TUNNEL_ENABLE_UNIQUE_LOCAL, true);
# * inport -- optional, i2p service port, if unset - the same as 'port'
Expand All @@ -170,7 +169,6 @@ class ServerTunnelConfig : public TunnelConfig {
std::string webircpass;
bool gzip;
i2p::data::SigningKeyType sigType;
uint32_t maxConns;
std::string address;
bool isUniqueLocal;
public:
Expand All @@ -184,7 +182,6 @@ class ServerTunnelConfig : public TunnelConfig {
std::string webircpass_,
bool gzip_,
i2p::data::SigningKeyType sigType_,
uint32_t maxConns_,
std::string address_,
bool isUniqueLocal_): TunnelConfig(name_, type_, i2cpParameters_),
host(host_),
Expand All @@ -196,7 +193,6 @@ class ServerTunnelConfig : public TunnelConfig {
webircpass(webircpass_),
gzip(gzip_),
sigType(sigType_),
maxConns(maxConns_),
address(address_),
isUniqueLocal(isUniqueLocal_) {}
std::string& gethost(){return host;}
Expand All @@ -208,7 +204,6 @@ class ServerTunnelConfig : public TunnelConfig {
std::string& getwebircpass(){return webircpass;}
bool getgzip(){return gzip;}
i2p::data::SigningKeyType getsigType(){return sigType;}
uint32_t getmaxConns(){return maxConns;}
std::string& getaddress(){return address;}
bool getisUniqueLocal(){return isUniqueLocal;}
void sethost(const std::string& host_){host=host_;}
Expand All @@ -220,7 +215,6 @@ class ServerTunnelConfig : public TunnelConfig {
void setwebircpass(const std::string& webircpass_){webircpass=webircpass_;}
void setgzip(bool gzip_){gzip=gzip_;}
void setsigType(i2p::data::SigningKeyType sigType_){sigType=sigType_;}
void setmaxConns(uint32_t maxConns_){maxConns=maxConns_;}
void setaddress(const std::string& address_){address=address_;}
void setisUniqueLocal(bool isUniqueLocal_){isUniqueLocal=isUniqueLocal_;}
virtual void saveToStringStream(std::stringstream& out);
Expand Down
23 changes: 20 additions & 3 deletions qt/i2pd_qt/i2pd_qt.pro
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,27 @@ linux:!android {
LIBS += -lcrypto -lssl -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread -lminiupnpc
}

windows:!android {
windows {
message("Using Windows settings")
DEFINES += BOOST_USE_WINDOWS_H WINDOWS
LIBS += -lcrypto -lssl -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread -lminiupnpc
DEFINES += BOOST_USE_WINDOWS_H WINDOWS _WINDOWS WIN32_LEAN_AND_MEAN MINIUPNP_STATICLIB
DEFINES -= UNICODE _UNICODE
BOOST_SUFFIX = -mt
QMAKE_LDFLAGS = -s -Wl,-rpath,/usr/local/lib -Wl,-Bstatic -static-libgcc -static-libstdc++ -mwindows

LIBS = -lminiupnpc \
-lboost_system$$BOOST_SUFFIX \
-lboost_date_time$$BOOST_SUFFIX \
-lboost_filesystem$$BOOST_SUFFIX \
-lboost_program_options$$BOOST_SUFFIX \
-lssl \
-lcrypto \
-lz \
-lwsock32 \
-lws2_32 \
-lgdi32 \
-liphlpapi \
-lstdc++ \
-lpthread
}

!android:!symbian:!maemo5:!simulator {
Expand Down
4 changes: 0 additions & 4 deletions qt/i2pd_qt/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ public slots:
std::string webircpass = "";
bool gzip = true;
i2p::data::SigningKeyType sigType = i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256;
uint32_t maxConns = i2p::stream::DEFAULT_MAX_CONNS_PER_MIN;
std::string address = "127.0.0.1";
bool isUniqueLocal = true;

Expand All @@ -646,7 +645,6 @@ public slots:
webircpass,
gzip,
sigType,
maxConns,
address,
isUniqueLocal);

Expand Down Expand Up @@ -734,7 +732,6 @@ public slots:
std::string webircpass = section.second.get<std::string> (I2P_SERVER_TUNNEL_WEBIRC_PASSWORD, "");
bool gzip = section.second.get (I2P_SERVER_TUNNEL_GZIP, true);
i2p::data::SigningKeyType sigType = section.second.get (I2P_SERVER_TUNNEL_SIGNATURE_TYPE, i2p::data::SIGNING_KEY_TYPE_ECDSA_SHA256_P256);
uint32_t maxConns = section.second.get(i2p::stream::I2CP_PARAM_STREAMING_MAX_CONNS_PER_MIN, i2p::stream::DEFAULT_MAX_CONNS_PER_MIN);
std::string address = section.second.get<std::string> (I2P_SERVER_TUNNEL_ADDRESS, "127.0.0.1");
bool isUniqueLocal = section.second.get(I2P_SERVER_TUNNEL_ENABLE_UNIQUE_LOCAL, true);

Expand Down Expand Up @@ -769,7 +766,6 @@ public slots:
webircpass,
gzip,
sigType,
maxConns,
address,
isUniqueLocal);
}
Expand Down

0 comments on commit c8de7aa

Please sign in to comment.