|
|
@ -17,6 +17,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include <fstream> |
|
|
|
#include <fstream> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "DaemonQT.h" |
|
|
|
|
|
|
|
#include "SignatureTypeComboboxFactory.h" |
|
|
|
|
|
|
|
|
|
|
|
std::string programOptionsWriterCurrentSection; |
|
|
|
std::string programOptionsWriterCurrentSection; |
|
|
|
|
|
|
|
|
|
|
|
MainWindow::MainWindow(QWidget *parent) : |
|
|
|
MainWindow::MainWindow(QWidget *parent) : |
|
|
@ -25,6 +28,7 @@ MainWindow::MainWindow(QWidget *parent) : |
|
|
|
,quitting(false) |
|
|
|
,quitting(false) |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
,ui(new Ui::MainWindow) |
|
|
|
,ui(new Ui::MainWindow) |
|
|
|
|
|
|
|
,i2pController(nullptr) |
|
|
|
,configItems() |
|
|
|
,configItems() |
|
|
|
,datadir() |
|
|
|
,datadir() |
|
|
|
,confpath() |
|
|
|
,confpath() |
|
|
@ -48,8 +52,6 @@ MainWindow::MainWindow(QWidget *parent) : |
|
|
|
int w = 683; |
|
|
|
int w = 683; |
|
|
|
int h = 3060; |
|
|
|
int h = 3060; |
|
|
|
ui->settingsContents->setFixedSize(w, h); |
|
|
|
ui->settingsContents->setFixedSize(w, h); |
|
|
|
//ui->settingsContents->resize(w, h);
|
|
|
|
|
|
|
|
//ui->settingsContents->adjustSize();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
QPalette pal(palette()); |
|
|
|
QPalette pal(palette()); |
|
|
@ -77,6 +79,8 @@ MainWindow::MainWindow(QWidget *parent) : |
|
|
|
QObject::connect(ui->fastQuitPushButton, SIGNAL(released()), this, SLOT(handleQuitButton())); |
|
|
|
QObject::connect(ui->fastQuitPushButton, SIGNAL(released()), this, SLOT(handleQuitButton())); |
|
|
|
QObject::connect(ui->gracefulQuitPushButton, SIGNAL(released()), this, SLOT(handleGracefulQuitButton())); |
|
|
|
QObject::connect(ui->gracefulQuitPushButton, SIGNAL(released()), this, SLOT(handleGracefulQuitButton())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QObject::connect(ui->doRestartI2PDPushButton, SIGNAL(released()), this, SLOT(handleDoRestartButton())); |
|
|
|
|
|
|
|
|
|
|
|
# define OPTION(section,option,defaultValueGetter) ConfigOption(QString(section),QString(option)) |
|
|
|
# define OPTION(section,option,defaultValueGetter) ConfigOption(QString(section),QString(option)) |
|
|
|
|
|
|
|
|
|
|
|
initFileChooser( OPTION("","conf",[](){return "";}), ui->configFileLineEdit, ui->configFileBrowsePushButton); |
|
|
|
initFileChooser( OPTION("","conf",[](){return "";}), ui->configFileLineEdit, ui->configFileBrowsePushButton); |
|
|
@ -120,6 +124,7 @@ MainWindow::MainWindow(QWidget *parent) : |
|
|
|
initIPAddressBox( OPTION("httpproxy","address",[]{return "";}), ui->httpProxyAddressLineEdit, tr("HTTP proxy -> IP address")); |
|
|
|
initIPAddressBox( OPTION("httpproxy","address",[]{return "";}), ui->httpProxyAddressLineEdit, tr("HTTP proxy -> IP address")); |
|
|
|
initTCPPortBox( OPTION("httpproxy","port",[]{return "4444";}), ui->httpProxyPortLineEdit, tr("HTTP proxy -> Port")); |
|
|
|
initTCPPortBox( OPTION("httpproxy","port",[]{return "4444";}), ui->httpProxyPortLineEdit, tr("HTTP proxy -> Port")); |
|
|
|
initFileChooser( OPTION("httpproxy","keys",[]{return "";}), ui->httpProxyKeyFileLineEdit, ui->httpProxyKeyFilePushButton); |
|
|
|
initFileChooser( OPTION("httpproxy","keys",[]{return "";}), ui->httpProxyKeyFileLineEdit, ui->httpProxyKeyFilePushButton); |
|
|
|
|
|
|
|
|
|
|
|
initSignatureTypeCombobox(OPTION("httpproxy","signaturetype",[]{return "7";}), ui->comboBox_httpPorxySignatureType); |
|
|
|
initSignatureTypeCombobox(OPTION("httpproxy","signaturetype",[]{return "7";}), ui->comboBox_httpPorxySignatureType); |
|
|
|
initStringBox( OPTION("httpproxy","inbound.length",[]{return "3";}), ui->httpProxyInboundTunnelsLenLineEdit); |
|
|
|
initStringBox( OPTION("httpproxy","inbound.length",[]{return "3";}), ui->httpProxyInboundTunnelsLenLineEdit); |
|
|
|
initStringBox( OPTION("httpproxy","inbound.quantity",[]{return "5";}), ui->httpProxyInboundTunnQuantityLineEdit); |
|
|
|
initStringBox( OPTION("httpproxy","inbound.quantity",[]{return "5";}), ui->httpProxyInboundTunnQuantityLineEdit); |
|
|
@ -328,6 +333,12 @@ void MainWindow::handleGracefulQuitButton() { |
|
|
|
, this, SLOT(handleGracefulQuitTimerEvent())); |
|
|
|
, this, SLOT(handleGracefulQuitTimerEvent())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::handleDoRestartButton() { |
|
|
|
|
|
|
|
qDebug()<<"Do Restart pressed."; |
|
|
|
|
|
|
|
emit i2pController->restartDaemon(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::handleGracefulQuitTimerEvent() { |
|
|
|
void MainWindow::handleGracefulQuitTimerEvent() { |
|
|
|
qDebug("Hiding the main window"); |
|
|
|
qDebug("Hiding the main window"); |
|
|
|
#ifndef ANDROID |
|
|
|
#ifndef ANDROID |
|
|
@ -616,3 +627,7 @@ void MainWindow::addServerTunnelPushButtonReleased() { |
|
|
|
void MainWindow::addClientTunnelPushButtonReleased() { |
|
|
|
void MainWindow::addClientTunnelPushButtonReleased() { |
|
|
|
CreateDefaultClientTunnel(); |
|
|
|
CreateDefaultClientTunnel(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::setI2PController(i2p::qt::Controller* controller_) { |
|
|
|
|
|
|
|
this->i2pController = controller_; |
|
|
|
|
|
|
|
} |
|
|
|