Browse Source

added one missing sigtype to Identity.h. Some work on qt gui.

pull/892/head
hypnosis-i2p 8 years ago
parent
commit
61e1e7fe8f
  1. 18
      qt/i2pd_qt/ClientTunnelPane.cpp
  2. 16
      qt/i2pd_qt/ClientTunnelPane.h
  3. 16
      qt/i2pd_qt/ServerTunnelPane.cpp
  4. 7
      qt/i2pd_qt/ServerTunnelPane.h
  5. 2
      qt/i2pd_qt/SignatureTypeComboboxFactory.cpp
  6. 76
      qt/i2pd_qt/SignatureTypeComboboxFactory.h
  7. 3
      qt/i2pd_qt/TunnelConfig.h
  8. 1
      qt/i2pd_qt/TunnelPane.h
  9. 186
      qt/i2pd_qt/i2pd_qt.pro
  10. 7
      qt/i2pd_qt/mainwindow.h

18
qt/i2pd_qt/ClientTunnelPane.cpp

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
#include "ClientTunnelPane.h"
#include "../../ClientContext.h"
#include "SignatureTypeComboboxFactory.h"
ClientTunnelPane::ClientTunnelPane()
{
@ -39,7 +40,7 @@ void ClientTunnelPane::appendClientTunnelForm( @@ -39,7 +40,7 @@ void ClientTunnelPane::appendClientTunnelForm(
tunnelTypeComboBox->addItem("HTTP Proxy", i2p::client::I2P_TUNNELS_SECTION_TYPE_HTTPPROXY);
tunnelTypeComboBox->addItem("UDP Client", i2p::client::I2P_TUNNELS_SECTION_TYPE_UDPCLIENT);
gridLayoutWidget_2->setGeometry(QRect(0, 0, 561, (7+5)*40));
gridLayoutWidget_2->setGeometry(QRect(0, 0, 561, (7+4)*60));
setupTunnelPane(tunnelConfig,
clientTunnelNameGroupBox,
@ -158,8 +159,17 @@ void ClientTunnelPane::appendClientTunnelForm( @@ -158,8 +159,17 @@ void ClientTunnelPane::appendClientTunnelForm(
}
{
i2p::data::SigningKeyType sigType = tunnelConfig->getsigType();
//combo box
//TODO sigtype
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
ui.sigTypeLabel = new QLabel(gridLayoutWidget_2);
sigTypeLabel->setObjectName(QStringLiteral("sigTypeLabel"));
horizontalLayout_2->addWidget(sigTypeLabel);
ui.sigTypeComboBox = SignatureTypeComboBoxFactory::createSignatureTypeComboBox(gridLayoutWidget_2, sigType);
sigTypeComboBox->setObjectName(QStringLiteral("sigTypeComboBox"));
horizontalLayout_2->addWidget(sigTypeComboBox);
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_2->addItem(horizontalSpacer);
tunnelGridLayout->addLayout(horizontalLayout_2, ++gridIndex, 0, 1, 1);
}
{
I2CPParameters& i2cpParameters = tunnelConfig->getI2cpParameters();
@ -167,6 +177,8 @@ void ClientTunnelPane::appendClientTunnelForm( @@ -167,6 +177,8 @@ void ClientTunnelPane::appendClientTunnelForm(
}
retranslateClientTunnelForm(ui);
tunnelGridLayout->invalidate();
}
ServerTunnelPane* ClientTunnelPane::asServerTunnelPane(){return nullptr;}

16
qt/i2pd_qt/ClientTunnelPane.h

@ -48,16 +48,22 @@ private: @@ -48,16 +48,22 @@ private:
QLabel * destinationPortLabel;
QLineEdit * destinationPortLineEdit;
//sigType
QLabel * sigTypeLabel;
QComboBox * sigTypeComboBox;
protected slots:
virtual void setGroupBoxTitle(const QString & title);
private:
void retranslateClientTunnelForm(ClientTunnelPane& /*ui*/) {
destinationLabel->setText(QApplication::translate("srvTunForm", "Destination:", 0));
portLabel->setText(QApplication::translate("srvTunForm", "Port:", 0));
keysLabel->setText(QApplication::translate("srvTunForm", "Keys:", 0));
destinationPortLabel->setText(QApplication::translate("srvTunForm", "Destination port:", 0));
addressLabel->setText(QApplication::translate("srvTunForm", "Address:", 0));
typeLabel->setText(QApplication::translate("cltTunForm", "Client tunnel type:", 0));
destinationLabel->setText(QApplication::translate("cltTunForm", "Destination:", 0));
portLabel->setText(QApplication::translate("cltTunForm", "Port:", 0));
keysLabel->setText(QApplication::translate("cltTunForm", "Keys:", 0));
destinationPortLabel->setText(QApplication::translate("cltTunForm", "Destination port:", 0));
addressLabel->setText(QApplication::translate("cltTunForm", "Address:", 0));
sigTypeLabel->setText(QApplication::translate("cltTunForm", "Signature type:", 0));
}
};

16
qt/i2pd_qt/ServerTunnelPane.cpp

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
#include "ServerTunnelPane.h"
#include "../../ClientContext.h"
#include "SignatureTypeComboboxFactory.h"
ServerTunnelPane::ServerTunnelPane(): TunnelPane() {}
@ -168,8 +169,17 @@ void ServerTunnelPane::appendServerTunnelForm( @@ -168,8 +169,17 @@ void ServerTunnelPane::appendServerTunnelForm(
}
{
i2p::data::SigningKeyType sigType = tunnelConfig->getsigType();
//combo box
//TODO sigtype
QHBoxLayout *horizontalLayout_2 = new QHBoxLayout();
horizontalLayout_2->setObjectName(QStringLiteral("horizontalLayout_2"));
ui.sigTypeLabel = new QLabel(gridLayoutWidget_2);
sigTypeLabel->setObjectName(QStringLiteral("sigTypeLabel"));
horizontalLayout_2->addWidget(sigTypeLabel);
ui.sigTypeComboBox = SignatureTypeComboBoxFactory::createSignatureTypeComboBox(gridLayoutWidget_2, sigType);
sigTypeComboBox->setObjectName(QStringLiteral("sigTypeComboBox"));
horizontalLayout_2->addWidget(sigTypeComboBox);
QSpacerItem * horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
horizontalLayout_2->addItem(horizontalSpacer);
tunnelGridLayout->addLayout(horizontalLayout_2, ++gridIndex, 0, 1, 1);
}
{
uint32_t maxConns = tunnelConfig->getmaxConns();
@ -220,6 +230,8 @@ void ServerTunnelPane::appendServerTunnelForm( @@ -220,6 +230,8 @@ void ServerTunnelPane::appendServerTunnelForm(
}
retranslateServerTunnelForm(ui);
tunnelGridLayout->invalidate();
}
void ServerTunnelPane::deleteServerTunnelForm(QGridLayout *tunnelsFormGridLayout) {

7
qt/i2pd_qt/ServerTunnelPane.h

@ -87,11 +87,16 @@ private: @@ -87,11 +87,16 @@ private:
//isUniqueLocal
QCheckBox * isUniqueLocalCheckBox;
//sigType
QLabel * sigTypeLabel;
QComboBox * sigTypeComboBox;
protected slots:
virtual void setGroupBoxTitle(const QString & title);
private:
void retranslateServerTunnelForm(ServerTunnelPane& /*ui*/) {
typeLabel->setText(QApplication::translate("srvTunForm", "Server tunnel type:", 0));
hostLabel->setText(QApplication::translate("srvTunForm", "Host:", 0));
portLabel->setText(QApplication::translate("srvTunForm", "Port:", 0));
keysLabel->setText(QApplication::translate("srvTunForm", "Keys:", 0));
@ -104,6 +109,8 @@ private: @@ -104,6 +109,8 @@ private:
gzipCheckBox->setText(QApplication::translate("srvTunForm", "GZip", 0));
isUniqueLocalCheckBox->setText(QApplication::translate("srvTunForm", "Is unique local", 0));
sigTypeLabel->setText(QApplication::translate("cltTunForm", "Signature type:", 0));
}
};

2
qt/i2pd_qt/SignatureTypeComboboxFactory.cpp

@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
#include "SignatureTypeComboboxFactory.h"

76
qt/i2pd_qt/SignatureTypeComboboxFactory.h

@ -0,0 +1,76 @@ @@ -0,0 +1,76 @@
#ifndef SIGNATURETYPECOMBOBOXFACTORY_H
#define SIGNATURETYPECOMBOBOXFACTORY_H
#include <QApplication>
#include <QComboBox>
#include <QWidget>
#include "../../Identity.h"
class SignatureTypeComboBoxFactory
{
static const QVariant& createUserData(const uint16_t sigType) {
return QVariant::fromValue((uint)sigType);
}
static void addItem(QComboBox* signatureTypeCombobox, QString text, const uint16_t sigType) {
const QVariant userData = createUserData(sigType);
signatureTypeCombobox->addItem(text, userData);
}
public:
static QComboBox* createSignatureTypeComboBox(QWidget* parent, uint16_t selectedSigType) {
QComboBox* signatureTypeCombobox = new QComboBox(parent);
/*
<orignal> https://geti2p.net/spec/common-structures#certificate
<orignal> все коды перечислены
<Hypnosis> это таблица "The defined Signing Public Key types are:" ?
<orignal> да
see also: Identity.h line 55
*/
int index=0;
bool foundSelected=false;
using namespace i2p::data;
addItem(signatureTypeCombobox, QApplication::translate("signatureTypeCombobox", "DSA_SHA1", 0), SIGNING_KEY_TYPE_DSA_SHA1); //0
if(selectedSigType==SIGNING_KEY_TYPE_DSA_SHA1){signatureTypeCombobox->setCurrentIndex(index);foundSelected=true;}
++index;
addItem(signatureTypeCombobox, QApplication::translate("signatureTypeCombobox", "ECDSA_SHA256_P256", 0), SIGNING_KEY_TYPE_ECDSA_SHA256_P256); //1
if(selectedSigType==SIGNING_KEY_TYPE_ECDSA_SHA256_P256){signatureTypeCombobox->setCurrentIndex(index);foundSelected=true;}
++index;
addItem(signatureTypeCombobox, QApplication::translate("signatureTypeCombobox", "ECDSA_SHA384_P384", 0), SIGNING_KEY_TYPE_ECDSA_SHA384_P384); //2
if(selectedSigType==SIGNING_KEY_TYPE_ECDSA_SHA384_P384){signatureTypeCombobox->setCurrentIndex(index);foundSelected=true;}
++index;
addItem(signatureTypeCombobox, QApplication::translate("signatureTypeCombobox", "ECDSA_SHA512_P521", 0), SIGNING_KEY_TYPE_ECDSA_SHA512_P521); //3
if(selectedSigType==SIGNING_KEY_TYPE_ECDSA_SHA512_P521){signatureTypeCombobox->setCurrentIndex(index);foundSelected=true;}
++index;
addItem(signatureTypeCombobox, QApplication::translate("signatureTypeCombobox", "RSA_SHA256_2048", 0), SIGNING_KEY_TYPE_RSA_SHA256_2048); //4
if(selectedSigType==SIGNING_KEY_TYPE_RSA_SHA256_2048){signatureTypeCombobox->setCurrentIndex(index);foundSelected=true;}
++index;
addItem(signatureTypeCombobox, QApplication::translate("signatureTypeCombobox", "RSA_SHA384_3072", 0), SIGNING_KEY_TYPE_RSA_SHA384_3072); //5
if(selectedSigType==SIGNING_KEY_TYPE_RSA_SHA384_3072){signatureTypeCombobox->setCurrentIndex(index);foundSelected=true;}
++index;
addItem(signatureTypeCombobox, QApplication::translate("signatureTypeCombobox", "RSA_SHA512_4096", 0), SIGNING_KEY_TYPE_RSA_SHA512_4096); //6
if(selectedSigType==SIGNING_KEY_TYPE_RSA_SHA512_4096){signatureTypeCombobox->setCurrentIndex(index);foundSelected=true;}
++index;
addItem(signatureTypeCombobox, QApplication::translate("signatureTypeCombobox", "EDDSA_SHA512_ED25519", 0), SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519); //7
if(selectedSigType==SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519){signatureTypeCombobox->setCurrentIndex(index);foundSelected=true;}
++index;
addItem(signatureTypeCombobox, QApplication::translate("signatureTypeCombobox", "EDDSA_SHA512_ED25519PH", 0), SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519PH); //8
if(selectedSigType==SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519PH){signatureTypeCombobox->setCurrentIndex(index);foundSelected=true;}
++index;
// the following signature type should never appear in netid=2
addItem(signatureTypeCombobox, QApplication::translate("signatureTypeCombobox", "GOSTR3410_A_GOSTR3411", 0), SIGNING_KEY_TYPE_GOSTR3410_A_GOSTR3411); //65280
if(selectedSigType==SIGNING_KEY_TYPE_GOSTR3410_A_GOSTR3411){signatureTypeCombobox->setCurrentIndex(index);foundSelected=true;}
++index;
if(!foundSelected){
addItem(signatureTypeCombobox, QString::number(selectedSigType), selectedSigType); //unknown sigtype
signatureTypeCombobox->setCurrentIndex(index);
}
return signatureTypeCombobox;
}
};
#endif // SIGNATURETYPECOMBOBOXFACTORY_H

3
qt/i2pd_qt/TunnelConfig.h

@ -108,7 +108,8 @@ public: @@ -108,7 +108,8 @@ public:
port(port_),
keys(keys_),
address(address_),
destinationPort(destinationPort_) {}
destinationPort(destinationPort_),
sigType(sigType_){}
std::string& getdest(){return dest;}
int getport(){return port;}
std::string & getkeys(){return keys;}

1
qt/i2pd_qt/TunnelPane.h

@ -79,7 +79,6 @@ private: @@ -79,7 +79,6 @@ private:
void retranslateTunnelForm(TunnelPane& ui) {
ui.deletePushButton->setText(QApplication::translate("tunForm", "Delete Tunnel", 0));
ui.nameLabel->setText(QApplication::translate("tunForm", "Tunnel name:", 0));
ui.typeLabel->setText(QApplication::translate("tunForm", "Server tunnel type:", 0));
}
void retranslateI2CPParameters() {

186
qt/i2pd_qt/i2pd_qt.pro

@ -69,10 +69,6 @@ INCLUDEPATH += . @@ -69,10 +69,6 @@ INCLUDEPATH += .
FORMS += mainwindow.ui \
tunnelform.ui
CONFIG += mobility
MOBILITY =
LIBS += -lz
android {
@ -80,6 +76,10 @@ android { @@ -80,6 +76,10 @@ android {
DEFINES += ANDROID=1
DEFINES += __ANDROID__
CONFIG += mobility
MOBILITY =
INCLUDEPATH += $$BOOST_PATH/boost_1_53_0/include \
$$OPENSSL_PATH/openssl-1.0.2/include \
$$MINIUPNP_PATH/miniupnp-2.0/include \
@ -142,181 +142,3 @@ linux:!android { @@ -142,181 +142,3 @@ linux:!android {
#INSTALLS += sources
}
DISTFILES += \
../../android/bin/classes.dex \
../../android/bin/I2PD.apk \
../../android/bin/AndroidManifest.xml \
../../android/AndroidManifest.xml \
../../libi2pd.a \
../../libi2pdclient.a \
../../i2pd \
../../android/bin/classes/org/purplei2p/i2pd/BuildConfig.class \
../../android/bin/classes/org/purplei2p/i2pd/DaemonSingleton$1.class \
../../android/bin/classes/org/purplei2p/i2pd/DaemonSingleton$State.class \
../../android/bin/classes/org/purplei2p/i2pd/DaemonSingleton$StateChangeListener.class \
../../android/bin/classes/org/purplei2p/i2pd/DaemonSingleton.class \
../../android/bin/classes/org/purplei2p/i2pd/ForegroundService$LocalBinder.class \
../../android/bin/classes/org/purplei2p/i2pd/ForegroundService.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD$1$1.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD$1.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD$2.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD$3$1.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD$3.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD.class \
../../android/bin/classes/org/purplei2p/i2pd/I2PD_JNI.class \
../../android/bin/classes/org/purplei2p/i2pd/NetworkStateChangeReceiver.class \
../../android/bin/classes/org/purplei2p/i2pd/R$attr.class \
../../android/bin/classes/org/purplei2p/i2pd/R$drawable.class \
../../android/bin/classes/org/purplei2p/i2pd/R$id.class \
../../android/bin/classes/org/purplei2p/i2pd/R$menu.class \
../../android/bin/classes/org/purplei2p/i2pd/R$string.class \
../../android/bin/classes/org/purplei2p/i2pd/R.class \
../../android/bin/dexedLibs/android-support-v4-bddf40bf5b9bc79d6d6d4419e6234206.jar \
../../android/libs/android-support-v4.jar \
android/libs/android-support-v4.jar \
../../debian/i2pd.init \
../../debian/postinst \
../../debian/postrm \
../../entrypoint.sh \
../../contrib/certificates/family/i2p-dev.crt \
../../contrib/certificates/family/i2pd-dev.crt \
../../contrib/certificates/family/mca2-i2p.crt \
../../contrib/certificates/family/volatile.crt \
../../contrib/certificates/reseed/atomike_at_mail.i2p.crt \
../../contrib/certificates/reseed/backup_at_mail.i2p.crt \
../../contrib/certificates/reseed/bugme_at_mail.i2p.crt \
../../contrib/certificates/reseed/echelon_at_mail.i2p.crt \
../../contrib/certificates/reseed/hottuna_at_mail.i2p.crt \
../../contrib/certificates/reseed/meeh_at_mail.i2p.crt \
../../contrib/certificates/reseed/parg_at_mail.i2p.crt \
../../contrib/certificates/reseed/r4sas_at_mail.i2p.crt \
../../contrib/certificates/reseed/zmx_at_mail.i2p.crt \
../../contrib/certificates/router/killyourtv_at_mail.i2p.crt \
../../contrib/certificates/router/orignal_at_mail.i2p.crt \
../../contrib/certificates/router/str4d_at_mail.i2p.crt \
../../contrib/certificates/router/zzz_at_mail.i2p.crt \
../../build/fig.yml \
../../appveyor.yml \
../../android/res/menu/options_main.xml \
../../android/res/values/strings.xml \
../../android/build.xml \
android/res/layout/splash.xml \
android/res/values/libs.xml \
android/res/values/strings.xml \
android/res/values-de/strings.xml \
android/res/values-el/strings.xml \
android/res/values-es/strings.xml \
android/res/values-et/strings.xml \
android/res/values-fa/strings.xml \
android/res/values-fr/strings.xml \
android/res/values-id/strings.xml \
android/res/values-it/strings.xml \
android/res/values-ja/strings.xml \
android/res/values-ms/strings.xml \
android/res/values-nb/strings.xml \
android/res/values-nl/strings.xml \
android/res/values-pl/strings.xml \
android/res/values-pt-rBR/strings.xml \
android/res/values-ro/strings.xml \
android/res/values-rs/strings.xml \
android/res/values-ru/strings.xml \
android/res/values-zh-rCN/strings.xml \
android/res/values-zh-rTW/strings.xml \
../../android/bin/resources.ap_ \
../../Win32/ictoopie.bmp \
../../Win32/mask.bmp \
../../android/bin/res/crunch/drawable/icon.png \
../../android/bin/res/crunch/drawable/itoopie_notification_icon.png \
../../android/res/drawable/icon.png \
../../android/res/drawable/itoopie_notification_icon.png \
../../docs/itoopieImage.png \
android/res/drawable/itoopie_notification_icon.png \
android/res/drawable-hdpi/icon.png \
../../Win32/ictoopie.ico \
../../Win32/mask.ico \
docs/patch_openssl_so_libs.html \
../../android/bin/jarlist.cache \
../../android/jni/Android.mk \
../../android/jni/Application.mk \
../../android/proguard-project.txt \
../../android/project.properties \
../../build/cmake_modules/NSIS.template.in \
../../build/docker/old-ubuntu-based/Dockerfile \
../../contrib/debian/i2pd.service \
../../contrib/debian/i2pd.tmpfile \
../../contrib/rpm/i2pd.service \
../../debian/patches/series \
../../debian/source/format \
../../debian/compat \
../../debian/control \
../../debian/copyright \
../../debian/docs \
../../debian/i2pd.1 \
../../debian/i2pd.default \
../../debian/i2pd.dirs \
../../debian/i2pd.install \
../../debian/i2pd.links \
../../debian/i2pd.manpages \
../../debian/i2pd.openrc \
../../debian/i2pd.upstart \
../../debian/logrotate \
../../debian/watch \
../../docs/Doxyfile \
../../docs/index.rst \
../../docs/subscriptions.txt \
../../docs/tunnels.conf \
android/src/org/kde/necessitas/ministro/IMinistro.aidl \
android/src/org/kde/necessitas/ministro/IMinistroCallback.aidl \
android/build.gradle \
android/project.properties \
../../Win32/nsi/helper_readme.nsh \
../../Win32/nsi/servicelib.nsh \
../../Win32/i2pd.sln \
../../Win32/i2pd.vcxproj \
../../Win32/i2pd.vcxproj.filters \
../../Win32/inno_installer.iss \
../../Win32/install_service.bat \
../../Win32/installer.iss \
../../Win32/Itoopie.cmd \
../../Win32/PurpleI2P.nsi \
../../Win32/uninstall_service.bat \
../../Dockerfile \
../../filelist.mk \
../../LICENSE \
../../debian/changelog \
../../ChangeLog \
../../build/cmake_modules/FindMiniUPnPc.cmake \
../../build/CMakeLists.txt \
../../android/gen/org/purplei2p/i2pd/BuildConfig.java \
../../android/gen/org/purplei2p/i2pd/R.java \
../../android/src/org/purplei2p/i2pd/DaemonSingleton.java \
../../android/src/org/purplei2p/i2pd/ForegroundService.java \
../../android/src/org/purplei2p/i2pd/I2PD.java \
../../android/src/org/purplei2p/i2pd/I2PD_JNI.java \
../../android/src/org/purplei2p/i2pd/NetworkStateChangeReceiver.java \
android/src/org/purplei2p/i2pd/I2PDMainActivity.java \
android/src/org/purplei2p/i2pd/LocalService.java \
android/src/org/qtproject/qt5/android/bindings/QtActivity.java \
android/src/org/qtproject/qt5/android/bindings/QtApplication.java \
../../debian/rules \
../../build/docker/README.md \
../../docs/building/android.md \
../../docs/building/cross.md \
../../docs/building/ios.md \
../../docs/building/requirements.md \
../../docs/building/unix.md \
../../docs/building/windows.md \
../../docs/config_opts_after_2.3.0.md \
../../docs/configuration.md \
../../docs/family.md \
../../docs/hacking.md \
../../docs/usage.md \
README.md \
../../README.md \
../../docs/i2pd.conf \
../../build/cmake-zlib-amd64.patch \
../../build/cmake-zlib-static.patch \
../../debian/patches/01-tune-build-opts.patch \
../../docs/conf.py \
../../contrib/debian/README \
../../contrib/rpm/i2pd.spec

7
qt/i2pd_qt/mainwindow.h

@ -401,13 +401,6 @@ private: @@ -401,13 +401,6 @@ private:
TODO signaturetype
<orignal_> https://geti2p.net/spec/common-structures#certificate
<orignal_> все коды перечислены
<Hypnosis> orignal_, это таблица "The defined Signing Public Key types are:" ?
<orignal_> да
see also : Identity.h line 55
*/
template<typename Section, typename Type>

Loading…
Cancel
Save