|
|
@ -17,6 +17,8 @@ |
|
|
|
|
|
|
|
|
|
|
|
#include <fstream> |
|
|
|
#include <fstream> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "DaemonQT.h" |
|
|
|
|
|
|
|
|
|
|
|
std::string programOptionsWriterCurrentSection; |
|
|
|
std::string programOptionsWriterCurrentSection; |
|
|
|
|
|
|
|
|
|
|
|
MainWindow::MainWindow(QWidget *parent) : |
|
|
|
MainWindow::MainWindow(QWidget *parent) : |
|
|
@ -25,6 +27,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() |
|
|
@ -75,6 +78,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); |
|
|
@ -326,6 +331,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 |
|
|
@ -614,3 +625,7 @@ void MainWindow::addServerTunnelPushButtonReleased() { |
|
|
|
void MainWindow::addClientTunnelPushButtonReleased() { |
|
|
|
void MainWindow::addClientTunnelPushButtonReleased() { |
|
|
|
CreateDefaultClientTunnel(); |
|
|
|
CreateDefaultClientTunnel(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void MainWindow::setI2PController(i2p::qt::Controller* controller_) { |
|
|
|
|
|
|
|
this->i2pController = controller_; |
|
|
|
|
|
|
|
} |
|
|
|