Browse Source

update gui (move i2p settings page inside main window)

pull/26/head
R4SAS 7 years ago
parent
commit
26d3af663b
  1. 5
      android/gostcoin-qt-android.pro
  2. 5
      gostcoin-qt.pro
  3. 1
      src/qt/bitcoingui.cpp
  4. 26
      src/qt/clientmodel.cpp
  5. 7
      src/qt/clientmodel.h
  6. 698
      src/qt/forms/i2poptionswidget.ui
  7. 458
      src/qt/forms/optionsdialog.ui
  8. 3
      src/qt/forms/showi2paddresses.ui
  9. 100
      src/qt/i2poptionswidget.cpp
  10. 37
      src/qt/i2poptionswidget.h
  11. 94
      src/qt/optionsdialog.cpp
  12. 7
      src/qt/optionsdialog.h
  13. 21
      src/qt/optionsmodel.cpp
  14. 5
      src/qt/optionsmodel.h
  15. BIN
      src/qt/res/images/splash.png
  16. BIN
      src/qt/res/images/splash_testnet.png
  17. 20
      src/qt/showi2paddresses.cpp
  18. 14
      src/util.cpp

5
android/gostcoin-qt-android.pro

@ -287,7 +287,6 @@ HEADERS += ../src/qt/bitcoingui.h \ @@ -287,7 +287,6 @@ HEADERS += ../src/qt/bitcoingui.h \
../src/qt/macnotificationhandler.h \
../src/qt/splashscreen.h \
../src/qt/showi2paddresses.h \
../src/qt/i2poptionswidget.h \
../src/qt/setupdarknet.h
SOURCES += ../src/qt/gostcoin.cpp \
@ -362,7 +361,6 @@ SOURCES += ../src/qt/gostcoin.cpp \ @@ -362,7 +361,6 @@ SOURCES += ../src/qt/gostcoin.cpp \
../src/txdb.cpp \
../src/qt/splashscreen.cpp \
../src/qt/showi2paddresses.cpp \
../src/qt/i2poptionswidget.cpp \
../i2psam/i2psam.cpp \
../src/qt/setupdarknet.cpp
@ -380,8 +378,7 @@ FORMS += ../src/qt/forms/sendcoinsdialog.ui \ @@ -380,8 +378,7 @@ FORMS += ../src/qt/forms/sendcoinsdialog.ui \
../src/qt/forms/askpassphrasedialog.ui \
../src/qt/forms/rpcconsole.ui \
../src/qt/forms/optionsdialog.ui \
../src/qt/forms/showi2paddresses.ui \
../src/qt/forms/i2poptionswidget.ui
../src/qt/forms/showi2paddresses.ui
contains(USE_QRCODE, 1) {
HEADERS += ../src/qt/qrcodedialog.h

5
gostcoin-qt.pro

@ -211,7 +211,6 @@ HEADERS += src/qt/bitcoingui.h \ @@ -211,7 +211,6 @@ HEADERS += src/qt/bitcoingui.h \
src/qt/macnotificationhandler.h \
src/qt/splashscreen.h \
src/qt/showi2paddresses.h \
src/qt/i2poptionswidget.h \
src/qt/setupdarknet.h
SOURCES += src/qt/gostcoin.cpp \
@ -286,7 +285,6 @@ SOURCES += src/qt/gostcoin.cpp \ @@ -286,7 +285,6 @@ SOURCES += src/qt/gostcoin.cpp \
src/txdb.cpp \
src/qt/splashscreen.cpp \
src/qt/showi2paddresses.cpp \
src/qt/i2poptionswidget.cpp \
src/qt/setupdarknet.cpp \
i2psam/i2psam.cpp
@ -304,8 +302,7 @@ FORMS += src/qt/forms/sendcoinsdialog.ui \ @@ -304,8 +302,7 @@ FORMS += src/qt/forms/sendcoinsdialog.ui \
src/qt/forms/askpassphrasedialog.ui \
src/qt/forms/rpcconsole.ui \
src/qt/forms/optionsdialog.ui \
src/qt/forms/showi2paddresses.ui \
src/qt/forms/i2poptionswidget.ui
src/qt/forms/showi2paddresses.ui
contains(USE_QRCODE, 1) {
HEADERS += src/qt/qrcodedialog.h

1
src/qt/bitcoingui.cpp

@ -495,7 +495,6 @@ void BitcoinGUI::optionsClicked() @@ -495,7 +495,6 @@ void BitcoinGUI::optionsClicked()
return;
OptionsDialog dlg;
dlg.setModel(clientModel->getOptionsModel());
dlg.setClientModel(clientModel);
dlg.exec();
}

26
src/qt/clientmodel.cpp

@ -129,36 +129,14 @@ int ClientModel::getNumI2PConnections() const @@ -129,36 +129,14 @@ int ClientModel::getNumI2PConnections() const
return nI2PNodeCount;
}
QString ClientModel::getPublicI2PKey() const
{
return QString::fromStdString(I2PSession::Instance().getMyDestination().pub);
}
QString ClientModel::getPrivateI2PKey() const
{
return QString::fromStdString(I2PSession::Instance().getMyDestination().priv);
}
bool ClientModel::isI2PAddressGenerated() const
{
return I2PSession::Instance().getMyDestination().isGenerated;
}
bool ClientModel::isI2POnly() const
{
return IsI2POnly();
}
QString ClientModel::getB32Address(const QString& destination) const
{
return QString::fromStdString(I2PSession::GenerateB32AddressFromDestination(destination.toStdString()));
}
void ClientModel::generateI2PDestination(QString& pub, QString& priv) const
bool ClientModel::isI2PAddressGenerated() const
{
const SAM::FullDestination generatedDest = I2PSession::Instance().destGenerate();
pub = QString::fromStdString(generatedDest.pub);
priv = QString::fromStdString(generatedDest.priv);
return I2PSession::Instance().getMyDestination().isGenerated;
}
bool ClientModel::isTestNet() const

7
src/qt/clientmodel.h

@ -60,13 +60,8 @@ public: @@ -60,13 +60,8 @@ public:
QString formatI2PNativeFullVersion() const;
int getNumI2PConnections() const;
QString getPublicI2PKey() const;
QString getPrivateI2PKey() const;
bool isI2PAddressGenerated() const;
bool isI2POnly() const;
QString getB32Address(const QString& destination) const;
void generateI2PDestination(QString& pub, QString& priv) const;
bool isI2PAddressGenerated() const;
// I2PSession& getI2PSession() const; // ??
// bool isPermanent

698
src/qt/forms/i2poptionswidget.ui

@ -1,698 +0,0 @@ @@ -1,698 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>I2POptionsWidget</class>
<widget class="QWidget" name="I2POptionsWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>549</width>
<height>371</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_15">
<item>
<widget class="QCheckBox" name="checkBoxUseI2POnly">
<property name="text">
<string>Use I2P only (-onlynet=i2p)</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_15">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label">
<property name="toolTip">
<string>http://www.i2p2.i2p/i2cp.html#options</string>
</property>
<property name="text">
<string>&lt;a href=&quot;http://www.i2p2.i2p/i2cp.html#options&quot;&gt;Help&lt;/a&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
</property>
<property name="openExternalLinks">
<bool>true</bool>
</property>
<property name="textInteractionFlags">
<set>Qt::TextBrowserInteraction</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_16">
<item>
<widget class="QLabel" name="labelSAMHost">
<property name="text">
<string>SAM host</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditSAMHost">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>127.0.0.1</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelSAMPort">
<property name="text">
<string>SAM port</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxSAMPort">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>7656</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_17">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_17">
<item>
<widget class="QLabel" name="labelTunnelName">
<property name="text">
<string>Tunnel name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditTunnelName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Gostcoin-client</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_18">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButtonCurrentI2PAddress">
<property name="text">
<string>Current
I2P-address...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonGenerateI2PAddress">
<property name="text">
<string>Generate
I2P-address...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_14">
<item>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QGroupBox" name="groupBoxInbound">
<property name="title">
<string>I2CP options of inbound tunnels</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="labelInboundQuantity">
<property name="text">
<string>inbound.quantity </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBoxInboundQuantity">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>16</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="labelInboundLength">
<property name="text">
<string>inbound.length </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBoxInboundLength">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>7</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="labelInboundLengthVariance">
<property name="text">
<string>inbound.lengthVariance</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBoxInboundLengthVariance">
<property name="minimum">
<number>-7</number>
</property>
<property name="maximum">
<number>7</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="labelInboundBackupQuality">
<property name="text">
<string>inbound.backupQuantity </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBoxInboundBackupQuality"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="labelInboundAllowZeroHop">
<property name="text">
<string>inbound.allowZeroHop </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxInboundAllowZeroHop">
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="labelInboundIPRestriction">
<property name="text">
<string>inbound.IPRestriction</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBoxInboundIPRestriction">
<property name="maximum">
<number>4</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_14">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="groupBoxOutbound">
<property name="title">
<string>I2CP options of outbound tunnels</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLabel" name="labelOutboundQuantity">
<property name="text">
<string>outbound.quantity </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_7">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundQuantity">
<property name="minimum">
<number>1</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="labelOutboundLength">
<property name="text">
<string>outbound.length </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_8">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundLength">
<property name="maximum">
<number>7</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="labelOutboundLengthVariance">
<property name="text">
<string>outbound.lengthVariance</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_9">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundLengthVariance">
<property name="minimum">
<number>-7</number>
</property>
<property name="maximum">
<number>7</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="labelOutboundBackupQuantity">
<property name="text">
<string>outbound.backupQuantity</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundBackupQuantity"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_11">
<item>
<widget class="QLabel" name="labelAllowZeroHop">
<property name="text">
<string>outbound.allowZeroHop </string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_11">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxAllowZeroHop">
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_12">
<item>
<widget class="QLabel" name="labelOutboundIPRestriction">
<property name="text">
<string>outbound.IPRestriction</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_12">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundIPRestriction">
<property name="maximum">
<number>4</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_13">
<item>
<widget class="QLabel" name="labelOutboundPriority">
<property name="text">
<string>outbound.priority</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_13">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundPriority">
<property name="minimum">
<number>-25</number>
</property>
<property name="maximum">
<number>25</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<tabstops>
<tabstop>checkBoxUseI2POnly</tabstop>
<tabstop>lineEditSAMHost</tabstop>
<tabstop>spinBoxSAMPort</tabstop>
<tabstop>lineEditTunnelName</tabstop>
<tabstop>pushButtonCurrentI2PAddress</tabstop>
<tabstop>pushButtonGenerateI2PAddress</tabstop>
<tabstop>spinBoxInboundQuantity</tabstop>
<tabstop>spinBoxInboundLength</tabstop>
<tabstop>spinBoxInboundLengthVariance</tabstop>
<tabstop>spinBoxInboundBackupQuality</tabstop>
<tabstop>checkBoxInboundAllowZeroHop</tabstop>
<tabstop>spinBoxInboundIPRestriction</tabstop>
<tabstop>spinBoxOutboundQuantity</tabstop>
<tabstop>spinBoxOutboundLength</tabstop>
<tabstop>spinBoxOutboundLengthVariance</tabstop>
<tabstop>spinBoxOutboundBackupQuantity</tabstop>
<tabstop>checkBoxAllowZeroHop</tabstop>
<tabstop>spinBoxOutboundIPRestriction</tabstop>
<tabstop>spinBoxOutboundPriority</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>

458
src/qt/forms/optionsdialog.ui

@ -6,8 +6,8 @@ @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>540</width>
<height>380</height>
<width>650</width>
<height>420</height>
</rect>
</property>
<property name="windowTitle">
@ -16,12 +16,15 @@ @@ -16,12 +16,15 @@
<property name="modal">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
@ -325,6 +328,9 @@ @@ -325,6 +328,9 @@
<property name="toolTip">
<string>The user interface language can be set here. This setting will take effect after restarting Gostcoin.</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
</widget>
</item>
</layout>
@ -388,6 +394,452 @@ @@ -388,6 +394,452 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tabI2P">
<attribute name="title">
<string notr="true">&amp;I2P</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_1_I2P">
<item>
<widget class="QCheckBox" name="checkBoxUseI2POnly">
<property name="text">
<string>Use I2P only (-onlynet=i2p)</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonCurrentI2PAddress">
<property name="text">
<string>Current I2P-address...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonGenerateI2PAddress">
<property name="text">
<string>Generate I2P-address...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2_I2P">
<item>
<widget class="QLabel" name="labelSAMHost">
<property name="text">
<string>SAM host</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditSAMHost">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>127.0.0.1</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelSAMPort">
<property name="text">
<string>SAM port</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxSAMPort">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>7656</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelTunnelName">
<property name="text">
<string>Tunnel name</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditTunnelName">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Gostcoin-client</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_I2P">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3_1_I2P">
<item>
<widget class="QGroupBox" name="groupBoxInbound_3_1_I2P">
<property name="title">
<string>I2CP options of inbound tunnels</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_1_1_I2P">
<item>
<widget class="QLabel" name="labelInboundQuantity">
<property name="text">
<string>quantity </string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxInboundQuantity">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>16</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_1_2_I2P">
<item>
<widget class="QLabel" name="labelInboundLength">
<property name="text">
<string>length </string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxInboundLength">
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>7</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_1_3_I2P">
<item>
<widget class="QLabel" name="labelInboundLengthVariance">
<property name="text">
<string>lengthVariance</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxInboundLengthVariance">
<property name="minimum">
<number>-7</number>
</property>
<property name="maximum">
<number>7</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_1_4_I2P">
<item>
<widget class="QLabel" name="labelInboundBackupQuality">
<property name="text">
<string>backupQuantity</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxInboundBackupQuality"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_1_5_I2P">
<item>
<widget class="QLabel" name="labelInboundAllowZeroHop">
<property name="text">
<string>allowZeroHop</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3_1_5_I2P">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxInboundAllowZeroHop">
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_1_6_I2P">
<item>
<widget class="QLabel" name="labelInboundIPRestriction">
<property name="text">
<string>IPRestriction</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxInboundIPRestriction">
<property name="maximum">
<number>4</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3_1_I2P">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3_2_I2P">
<item>
<widget class="QGroupBox" name="groupBoxOutbound_3_2_I2P">
<property name="title">
<string>I2CP options of outbound tunnels</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_2_1_I2P">
<item>
<widget class="QLabel" name="labelOutboundQuantity">
<property name="text">
<string>quantity</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundQuantity">
<property name="minimum">
<number>1</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_2_2_I2P">
<item>
<widget class="QLabel" name="labelOutboundLength">
<property name="text">
<string>length</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundLength">
<property name="maximum">
<number>7</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_2_3_I2P">
<item>
<widget class="QLabel" name="labelOutboundLengthVariance">
<property name="text">
<string>lengthVariance</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundLengthVariance">
<property name="minimum">
<number>-7</number>
</property>
<property name="maximum">
<number>7</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_2_4_I2P">
<item>
<widget class="QLabel" name="labelOutboundBackupQuantity">
<property name="text">
<string>backupQuantity</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundBackupQuantity"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_2_5_I2P">
<item>
<widget class="QLabel" name="labelAllowZeroHop">
<property name="text">
<string>allowZeroHop</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3_2_5_I2P">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="checkBoxAllowZeroHop">
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_2_6_I2P">
<item>
<widget class="QLabel" name="labelOutboundIPRestriction">
<property name="text">
<string>IPRestriction</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundIPRestriction">
<property name="maximum">
<number>4</number>
</property>
<property name="value">
<number>2</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3_2_7_I2P">
<item>
<widget class="QLabel" name="labelOutboundPriority">
<property name="text">
<string>priority</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBoxOutboundPriority">
<property name="minimum">
<number>-25</number>
</property>
<property name="maximum">
<number>25</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3_2_I2P">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
<zorder></zorder>
<zorder></zorder>
<zorder></zorder>
</widget>
</widget>
</item>
<item>

3
src/qt/forms/showi2paddresses.ui

@ -23,7 +23,8 @@ @@ -23,7 +23,8 @@
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>If you want to use a permanent I2P-address you have to set a 'mydestination' option in the configuration file:</string>
<string>If you want to use a permanent I2P-address you have to set a 'mydestination' option in the configuration file:
</string>
</property>
<property name="wordWrap">
<bool>true</bool>

100
src/qt/i2poptionswidget.cpp

@ -1,100 +0,0 @@ @@ -1,100 +0,0 @@
#include "i2poptionswidget.h"
#include "ui_i2poptionswidget.h"
#include "optionsmodel.h"
#include "monitoreddatamapper.h"
#include "showi2paddresses.h"
//#include "i2p.h"
#include "util.h"
#include "clientmodel.h"
I2POptionsWidget::I2POptionsWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::I2POptionsWidget),
clientModel(0)
{
ui->setupUi(this);
QObject::connect(ui->pushButtonCurrentI2PAddress, SIGNAL(clicked()), this, SLOT(ShowCurrentI2PAddress()));
QObject::connect(ui->pushButtonGenerateI2PAddress, SIGNAL(clicked()), this, SLOT(GenerateNewI2PAddress()));
QObject::connect(ui->checkBoxAllowZeroHop , SIGNAL(stateChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->checkBoxInboundAllowZeroHop , SIGNAL(stateChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->checkBoxUseI2POnly , SIGNAL(stateChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->lineEditSAMHost , SIGNAL(textChanged(QString)), this, SIGNAL(settingsChanged()));
QObject::connect(ui->lineEditTunnelName , SIGNAL(textChanged(QString)), this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxInboundBackupQuality , SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxInboundIPRestriction , SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxInboundLength , SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxInboundLengthVariance , SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxInboundQuantity , SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxOutboundBackupQuantity, SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxOutboundIPRestriction , SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxOutboundLength , SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxOutboundLengthVariance, SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxOutboundPriority , SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxOutboundQuantity , SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
QObject::connect(ui->spinBoxSAMPort , SIGNAL(valueChanged(int)) , this, SIGNAL(settingsChanged()));
}
I2POptionsWidget::~I2POptionsWidget()
{
delete ui;
}
void I2POptionsWidget::setMapper(MonitoredDataMapper& mapper)
{
mapper.addMapping(ui->checkBoxUseI2POnly , OptionsModel::I2PUseI2POnly);
mapper.addMapping(ui->lineEditSAMHost , OptionsModel::I2PSAMHost);
mapper.addMapping(ui->spinBoxSAMPort , OptionsModel::I2PSAMPort);
mapper.addMapping(ui->lineEditTunnelName , OptionsModel::I2PSessionName);
mapper.addMapping(ui->spinBoxInboundQuantity , OptionsModel::I2PInboundQuantity);
mapper.addMapping(ui->spinBoxInboundLength , OptionsModel::I2PInboundLength);
mapper.addMapping(ui->spinBoxInboundLengthVariance , OptionsModel::I2PInboundLengthVariance);
mapper.addMapping(ui->spinBoxInboundBackupQuality , OptionsModel::I2PInboundBackupQuantity);
mapper.addMapping(ui->checkBoxInboundAllowZeroHop , OptionsModel::I2PInboundAllowZeroHop);
mapper.addMapping(ui->spinBoxInboundIPRestriction , OptionsModel::I2PInboundIPRestriction);
mapper.addMapping(ui->spinBoxOutboundQuantity , OptionsModel::I2POutboundQuantity);
mapper.addMapping(ui->spinBoxOutboundLength , OptionsModel::I2POutboundLength);
mapper.addMapping(ui->spinBoxOutboundLengthVariance, OptionsModel::I2POutboundLengthVariance);
mapper.addMapping(ui->spinBoxOutboundBackupQuantity, OptionsModel::I2POutboundBackupQuantity);
mapper.addMapping(ui->checkBoxAllowZeroHop , OptionsModel::I2POutboundAllowZeroHop);
mapper.addMapping(ui->spinBoxOutboundIPRestriction , OptionsModel::I2POutboundIPRestriction);
mapper.addMapping(ui->spinBoxOutboundPriority , OptionsModel::I2POutboundIPRestriction);
}
void I2POptionsWidget::setModel(ClientModel* model)
{
clientModel = model;
}
void I2POptionsWidget::ShowCurrentI2PAddress()
{
if (clientModel)
{
const QString pub = clientModel->getPublicI2PKey();
const QString priv = clientModel->getPrivateI2PKey();
const QString b32 = clientModel->getB32Address(pub);
const QString configFile = QString::fromStdString(GetConfigFile().string());
ShowI2PAddresses i2pCurrDialog("Your current I2P-address", pub, priv, b32, configFile, this);
i2pCurrDialog.exec();
}
}
void I2POptionsWidget::GenerateNewI2PAddress()
{
if (clientModel)
{
QString pub, priv;
clientModel->generateI2PDestination(pub, priv);
const QString b32 = clientModel->getB32Address(pub);
const QString configFile = QString::fromStdString(GetConfigFile().string());
ShowI2PAddresses i2pCurrDialog("Generated I2P address", pub, priv, b32, configFile, this);
i2pCurrDialog.exec();
}
}

37
src/qt/i2poptionswidget.h

@ -1,37 +0,0 @@ @@ -1,37 +0,0 @@
#ifndef I2POPTIONSWIDGET_H
#define I2POPTIONSWIDGET_H
#include <QWidget>
class MonitoredDataMapper;
namespace Ui {
class I2POptionsWidget;
}
class ClientModel;
class I2POptionsWidget : public QWidget
{
Q_OBJECT
public:
explicit I2POptionsWidget(QWidget *parent = 0);
~I2POptionsWidget();
void setMapper(MonitoredDataMapper& mapper);
void setModel(ClientModel* model);
private:
Ui::I2POptionsWidget *ui;
ClientModel* clientModel;
private slots:
void ShowCurrentI2PAddress();
void GenerateNewI2PAddress();
signals:
void settingsChanged();
};
#endif // I2POPTIONSWIDGET_H

94
src/qt/optionsdialog.cpp

@ -6,6 +6,9 @@ @@ -6,6 +6,9 @@
#include "netbase.h"
#include "optionsmodel.h"
#include "showi2paddresses.h"
#include "util.h"
#include "clientmodel.h"
#include <QDir>
@ -21,8 +24,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) : @@ -21,8 +24,7 @@ OptionsDialog::OptionsDialog(QWidget *parent) :
fRestartWarningDisplayed_Proxy(false),
fRestartWarningDisplayed_Lang(false),
fProxyIpValid(true),
fRestartWarningDisplayed_I2P(false),
tabI2P(new I2POptionsWidget())
fRestartWarningDisplayed_I2P(false)
{
ui->setupUi(this);
@ -37,10 +39,13 @@ OptionsDialog::OptionsDialog(QWidget *parent) : @@ -37,10 +39,13 @@ OptionsDialog::OptionsDialog(QWidget *parent) :
ui->socksVersion->addItem("4", 4);
ui->socksVersion->setCurrentIndex(0);
connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyIp, SLOT(setEnabled(bool)));
connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->proxyPort, SLOT(setEnabled(bool)));
connect(ui->connectSocks, SIGNAL(toggled(bool)), ui->socksVersion, SLOT(setEnabled(bool)));
connect(ui->connectSocks, SIGNAL(clicked(bool)), this, SLOT(showRestartWarning_Proxy()));
connect(ui->connectSocks , SIGNAL(toggled(bool)) , ui->proxyIp, SLOT(setEnabled(bool)));
connect(ui->connectSocks , SIGNAL(toggled(bool)) , ui->proxyPort, SLOT(setEnabled(bool)));
connect(ui->connectSocks , SIGNAL(toggled(bool)) , ui->socksVersion, SLOT(setEnabled(bool)));
connect(ui->connectSocks , SIGNAL(clicked(bool)) , this, SLOT(showRestartWarning_Proxy()));
connect(ui->pushButtonCurrentI2PAddress , SIGNAL(clicked()) , this, SLOT(ShowCurrentI2PAddress()));
connect(ui->pushButtonGenerateI2PAddress , SIGNAL(clicked()) , this, SLOT(GenerateNewI2PAddress()));
ui->proxyIp->installEventFilter(this);
@ -93,8 +98,6 @@ OptionsDialog::OptionsDialog(QWidget *parent) : @@ -93,8 +98,6 @@ OptionsDialog::OptionsDialog(QWidget *parent) :
connect(mapper, SIGNAL(currentIndexChanged(int)), this, SLOT(disableApplyButton()));
/* setup/change UI elements when proxy IP is invalid/valid */
connect(this, SIGNAL(proxyIpValid(QValidatedLineEdit *, bool)), this, SLOT(handleProxyIpValid(QValidatedLineEdit *, bool)));
ui->tabWidget->addTab(tabI2P, QString("I2P"));
}
OptionsDialog::~OptionsDialog()
@ -118,22 +121,30 @@ void OptionsDialog::setModel(OptionsModel *model) @@ -118,22 +121,30 @@ void OptionsDialog::setModel(OptionsModel *model)
/* update the display unit, to not use the default ("BTC") */
updateDisplayUnit();
/* warn only when language selection changes by user action (placed here so init via mapper doesn't trigger this) */
/* warn only when changed by user action (placed here so init via mapper doesn't trigger this) */
connect(ui->lang, SIGNAL(valueChanged()), this, SLOT(showRestartWarning_Lang()));
QObject::connect(tabI2P, SIGNAL(settingsChanged()), this, SLOT(showRestartWarning_I2P()));
connect(ui->checkBoxAllowZeroHop , SIGNAL(stateChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->checkBoxInboundAllowZeroHop , SIGNAL(stateChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->checkBoxUseI2POnly , SIGNAL(stateChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->lineEditSAMHost , SIGNAL(textChanged(QString)), this, SLOT(showRestartWarning_I2P()));
connect(ui->lineEditTunnelName , SIGNAL(textChanged(QString)), this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxInboundBackupQuality , SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxInboundIPRestriction , SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxInboundLength , SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxInboundLengthVariance , SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxInboundQuantity , SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxOutboundBackupQuantity, SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxOutboundIPRestriction , SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxOutboundLength , SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxOutboundLengthVariance, SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxOutboundPriority , SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxOutboundQuantity , SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
connect(ui->spinBoxSAMPort , SIGNAL(valueChanged(int)) , this, SLOT(showRestartWarning_I2P()));
/* disable apply button after settings are loaded as there is nothing to save */
disableApplyButton();
}
void OptionsDialog::setClientModel(ClientModel* clientModel)
{
if (clientModel)
{
tabI2P->setModel(clientModel);
}
}
void OptionsDialog::setMapper()
{
/* Main */
@ -159,7 +170,24 @@ void OptionsDialog::setMapper() @@ -159,7 +170,24 @@ void OptionsDialog::setMapper()
mapper->addMapping(ui->displayAddresses, OptionsModel::DisplayAddresses);
mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);
tabI2P->setMapper(*mapper);
/* I2P */
mapper->addMapping(ui->checkBoxUseI2POnly , OptionsModel::I2PUseI2POnly);
mapper->addMapping(ui->lineEditSAMHost , OptionsModel::I2PSAMHost);
mapper->addMapping(ui->spinBoxSAMPort , OptionsModel::I2PSAMPort);
mapper->addMapping(ui->lineEditTunnelName , OptionsModel::I2PSessionName);
mapper->addMapping(ui->spinBoxInboundQuantity , OptionsModel::I2PInboundQuantity);
mapper->addMapping(ui->spinBoxInboundLength , OptionsModel::I2PInboundLength);
mapper->addMapping(ui->spinBoxInboundLengthVariance , OptionsModel::I2PInboundLengthVariance);
mapper->addMapping(ui->spinBoxInboundBackupQuality , OptionsModel::I2PInboundBackupQuantity);
mapper->addMapping(ui->checkBoxInboundAllowZeroHop , OptionsModel::I2PInboundAllowZeroHop);
mapper->addMapping(ui->spinBoxInboundIPRestriction , OptionsModel::I2PInboundIPRestriction);
mapper->addMapping(ui->spinBoxOutboundQuantity , OptionsModel::I2POutboundQuantity);
mapper->addMapping(ui->spinBoxOutboundLength , OptionsModel::I2POutboundLength);
mapper->addMapping(ui->spinBoxOutboundLengthVariance, OptionsModel::I2POutboundLengthVariance);
mapper->addMapping(ui->spinBoxOutboundBackupQuantity, OptionsModel::I2POutboundBackupQuantity);
mapper->addMapping(ui->checkBoxAllowZeroHop , OptionsModel::I2POutboundAllowZeroHop);
mapper->addMapping(ui->spinBoxOutboundIPRestriction , OptionsModel::I2POutboundIPRestriction);
mapper->addMapping(ui->spinBoxOutboundPriority , OptionsModel::I2POutboundIPRestriction);
}
void OptionsDialog::enableApplyButton()
@ -263,6 +291,34 @@ void OptionsDialog::showRestartWarning_Lang() @@ -263,6 +291,34 @@ void OptionsDialog::showRestartWarning_Lang()
}
}
void OptionsDialog::ShowCurrentI2PAddress()
{
if (this->model)
{
const QString pub = this->model->getPublicI2PKey();
const QString priv = this->model->getPrivateI2PKey();
const QString b32 = this->model->getB32Address(pub);
const QString configFile = QString::fromStdString(GetConfigFile().string());
ShowI2PAddresses i2pCurrDialog("Your current I2P-address", pub, priv, b32, configFile, this);
i2pCurrDialog.exec();
}
}
void OptionsDialog::GenerateNewI2PAddress()
{
if (this->model)
{
QString pub, priv;
this->model->generateI2PDestination(pub, priv);
const QString b32 = this->model->getB32Address(pub);
const QString configFile = QString::fromStdString(GetConfigFile().string());
ShowI2PAddresses i2pCurrDialog("Generated I2P address", pub, priv, b32, configFile, this);
i2pCurrDialog.exec();
}
}
void OptionsDialog::updateDisplayUnit()
{
if(model)

7
src/qt/optionsdialog.h

@ -3,8 +3,6 @@ @@ -3,8 +3,6 @@
#include <QDialog>
#include "i2poptionswidget.h"
namespace Ui {
class OptionsDialog;
}
@ -51,8 +49,12 @@ private slots: @@ -51,8 +49,12 @@ private slots:
void updateDisplayUnit();
void handleProxyIpValid(QValidatedLineEdit *object, bool fState);
void ShowCurrentI2PAddress();
void GenerateNewI2PAddress();
signals:
void proxyIpValid(QValidatedLineEdit *object, bool fValid);
void settingsChanged();
private:
Ui::OptionsDialog *ui;
@ -62,7 +64,6 @@ private: @@ -62,7 +64,6 @@ private:
bool fRestartWarningDisplayed_Lang;
bool fProxyIpValid;
bool fRestartWarningDisplayed_I2P;
I2POptionsWidget* tabI2P;
};
#endif // OPTIONSDIALOG_H

21
src/qt/optionsmodel.cpp

@ -588,3 +588,24 @@ bool OptionsModel::getCoinControlFeatures() @@ -588,3 +588,24 @@ bool OptionsModel::getCoinControlFeatures()
return fCoinControlFeatures;
}
QString OptionsModel::getPublicI2PKey() const
{
return QString::fromStdString(I2PSession::Instance().getMyDestination().pub);
}
QString OptionsModel::getPrivateI2PKey() const
{
return QString::fromStdString(I2PSession::Instance().getMyDestination().priv);
}
QString OptionsModel::getB32Address(const QString& destination) const
{
return QString::fromStdString(I2PSession::GenerateB32AddressFromDestination(destination.toStdString()));
}
void OptionsModel::generateI2PDestination(QString& pub, QString& priv) const
{
const SAM::FullDestination generatedDest = I2PSession::Instance().destGenerate();
pub = QString::fromStdString(generatedDest.pub);
priv = QString::fromStdString(generatedDest.priv);
}

5
src/qt/optionsmodel.h

@ -72,6 +72,11 @@ public: @@ -72,6 +72,11 @@ public:
QString getLanguage() { return language; }
bool getCoinControlFeatures();
QString getPublicI2PKey() const;
QString getPrivateI2PKey() const;
QString getB32Address(const QString& destination) const;
void generateI2PDestination(QString& pub, QString& priv) const;
private:
int nDisplayUnit;
bool bDisplayAddresses;

BIN
src/qt/res/images/splash.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

After

Width:  |  Height:  |  Size: 191 KiB

BIN
src/qt/res/images/splash_testnet.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 KiB

After

Width:  |  Height:  |  Size: 187 KiB

20
src/qt/showi2paddresses.cpp

@ -10,22 +10,16 @@ ShowI2PAddresses::ShowI2PAddresses(const QString& caption, const QString& pub, c @@ -10,22 +10,16 @@ ShowI2PAddresses::ShowI2PAddresses(const QString& caption, const QString& pub, c
ui->pubText->setPlainText(pub);
ui->privText->setText("<b>mydestination=</b>" + priv);
ui->b32Line->setText(b32);
ui->label->setText(ui->label->text() + "\n" + configFileName);
ui->label->setText(ui->label->text() + configFileName);
QObject::connect(ui->privButton, SIGNAL(clicked()),
ui->privText, SLOT(selectAll()));
QObject::connect(ui->privButton, SIGNAL(clicked()),
ui->privText, SLOT(copy()));
QObject::connect(ui->privButton, SIGNAL(clicked()), ui->privText, SLOT(selectAll()));
QObject::connect(ui->privButton, SIGNAL(clicked()), ui->privText, SLOT(copy()));
QObject::connect(ui->pubButton, SIGNAL(clicked()),
ui->pubText, SLOT(selectAll()));
QObject::connect(ui->pubButton, SIGNAL(clicked()),
ui->pubText, SLOT(copy()));
QObject::connect(ui->pubButton, SIGNAL(clicked()), ui->pubText, SLOT(selectAll()));
QObject::connect(ui->pubButton, SIGNAL(clicked()), ui->pubText, SLOT(copy()));
QObject::connect(ui->b32Button, SIGNAL(clicked()),
ui->b32Line, SLOT(selectAll()));
QObject::connect(ui->b32Button, SIGNAL(clicked()),
ui->b32Line, SLOT(copy()));
QObject::connect(ui->b32Button, SIGNAL(clicked()), ui->b32Line, SLOT(selectAll()));
QObject::connect(ui->b32Button, SIGNAL(clicked()), ui->b32Line, SLOT(copy()));
}
ShowI2PAddresses::~ShowI2PAddresses()

14
src/util.cpp

@ -1070,10 +1070,10 @@ void PrintExceptionContinue(std::exception* pex, const char* pszThread) @@ -1070,10 +1070,10 @@ void PrintExceptionContinue(std::exception* pex, const char* pszThread)
boost::filesystem::path GetDefaultDataDir()
{
namespace fs = boost::filesystem;
// Windows < Vista: C:\Documents and Settings\Username\Application Data\Bitcoin
// Windows >= Vista: C:\Users\Username\AppData\Roaming\Bitcoin
// Mac: ~/Library/Application Support/Bitcoin
// Unix: ~/.bitcoin
// Windows < Vista: C:\Documents and Settings\Username\Application Data\Gostcoin
// Windows >= Vista: C:\Users\Username\AppData\Roaming\Gostcoin
// Mac: ~/Library/Application Support/Gostcoin
// Unix: ~/.gostcoin
#ifdef WIN32
// Windows
return GetSpecialFolderPath(CSIDL_APPDATA) / "Gostcoin";
@ -1150,10 +1150,10 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific) @@ -1150,10 +1150,10 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
path = GetDefaultDataDir();
}
if (fNetSpecific && GetBoolArg("-testnet", false))
{
fs::create_directory(path);
{
fs::create_directory(path);
path /= "testnet3";
}
}
fs::create_directory(path);

Loading…
Cancel
Save