mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
qt gui preliminary results
This commit is contained in:
parent
f2b0f64138
commit
59b3daabc5
|
@ -57,72 +57,88 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
QObject::connect(ui->fastQuitPushButton, SIGNAL(released()), this, SLOT(handleQuitButton()));
|
||||
QObject::connect(ui->gracefulQuitPushButton, SIGNAL(released()), this, SLOT(handleGracefulQuitButton()));
|
||||
|
||||
initFileChooser(configFileLineEdit, configFileBrowsePushButton);
|
||||
initFileChooser(tunnelsConfigFileLineEdit, tunnelsConfigFileBrowsePushButton);
|
||||
initFileChooser(pidFileLineEdit, pidFileBrowsePushButton);
|
||||
initFileChooser(logFileLineEdit, logFileBrowsePushButton);
|
||||
initFileChooser(httpProxyKeyFileLineEdit, httpProxyKeyFilePushButton);
|
||||
initFileChooser(socksProxyKeyFileLineEdit, socksProxyKeyFilePushButton);
|
||||
initFileChooser(i2pControlCertFileLineEdit, i2pControlCertFileBrowsePushButton);
|
||||
initFileChooser(i2pControlKeyFileLineEdit, i2pControlKeyFileBrowsePushButton);
|
||||
initFileChooser(reseedFileLineEdit, reseedFileBrowsePushButton);
|
||||
initFileChooser(ui->configFileLineEdit, ui->configFileBrowsePushButton);
|
||||
initFileChooser(ui->tunnelsConfigFileLineEdit, ui->tunnelsConfigFileBrowsePushButton);
|
||||
initFileChooser(ui->pidFileLineEdit, ui->pidFileBrowsePushButton);
|
||||
initFileChooser(ui->logFileLineEdit, ui->logFileBrowsePushButton);
|
||||
initFileChooser(ui->httpProxyKeyFileLineEdit, ui->httpProxyKeyFilePushButton);
|
||||
initFileChooser(ui->socksProxyKeyFileLineEdit, ui->socksProxyKeyFilePushButton);
|
||||
initFileChooser(ui->i2pControlCertFileLineEdit, ui->i2pControlCertFileBrowsePushButton);
|
||||
initFileChooser(ui->i2pControlKeyFileLineEdit, ui->i2pControlKeyFileBrowsePushButton);
|
||||
initFileChooser(ui->reseedFileLineEdit, ui->reseedFileBrowsePushButton);
|
||||
|
||||
initFolderChooser(dataFolderLineEdit, dataFolderBrowsePushButton);
|
||||
initFolderChooser(ui->dataFolderLineEdit, ui->dataFolderBrowsePushButton);
|
||||
|
||||
initCombobox(logLevelComboBox);
|
||||
initCombobox(ui->logLevelComboBox);
|
||||
|
||||
initIPAddressBox(routerExternalHostLineEdit, tr("Router external address -> Host"));
|
||||
initTCPPortBox(routerExternalPortLineEdit, tr("Router external address -> Port"));
|
||||
initIPAddressBox(ui->routerExternalHostLineEdit, tr("Router external address -> Host"));
|
||||
initTCPPortBox(ui->routerExternalPortLineEdit, tr("Router external address -> Port"));
|
||||
|
||||
initCheckBox(ipv6CheckBox);
|
||||
initCheckBox(notransitCheckBox);
|
||||
initCheckBox(floodfillCheckBox);
|
||||
initIntegerBox(bandwidthLineEdit);
|
||||
initStringBox(familyLineEdit);
|
||||
initIntegerBox(netIdLineEdit);
|
||||
initCheckBox(ui->ipv6CheckBox);
|
||||
initCheckBox(ui->notransitCheckBox);
|
||||
initCheckBox(ui->floodfillCheckBox);
|
||||
initIntegerBox(ui->bandwidthLineEdit);
|
||||
initStringBox(ui->familyLineEdit);
|
||||
initIntegerBox(ui->netIdLineEdit);
|
||||
|
||||
initCheckBox(insomniaCheckBox);
|
||||
initCheckBox(ui->insomniaCheckBox);
|
||||
|
||||
initCheckBox(webconsoleEnabledCheckBox);
|
||||
initIPAddressBox(webconsoleAddrLineEdit, tr("HTTP webconsole -> IP address"));
|
||||
initTCPPortBox(webconsolePortLineEdit, tr("HTTP webconsole -> Port"));
|
||||
initCheckBox(webconsoleBasicAuthCheckBox);
|
||||
initStringBox(webconsoleUserNameLineEditBasicAuth);
|
||||
initStringBox(webconsolePasswordLineEditBasicAuth);
|
||||
initCheckBox(ui->webconsoleEnabledCheckBox);
|
||||
initIPAddressBox(ui->webconsoleAddrLineEdit, tr("HTTP webconsole -> IP address"));
|
||||
initTCPPortBox(ui->webconsolePortLineEdit, tr("HTTP webconsole -> Port"));
|
||||
initCheckBox(ui->webconsoleBasicAuthCheckBox);
|
||||
initStringBox(ui->webconsoleUserNameLineEditBasicAuth);
|
||||
initStringBox(ui->webconsolePasswordLineEditBasicAuth);
|
||||
|
||||
initCheckBox(httpProxyEnabledCheckBox);
|
||||
initIPAddressBox(httpProxyAddressLineEdit, tr("HTTP proxy -> IP address"));
|
||||
initTCPPortBox(httpProxyPortLineEdit, tr("HTTP proxy -> Port"));
|
||||
initIntegerBox(httpProxyInboundTunnelsLenLineEdit);
|
||||
initIntegerBox(httpProxyInboundTunnQuantityLineEdit);
|
||||
initIntegerBox(httpProxyOutBoundTunnLenLineEdit);
|
||||
initIntegerBox(httpProxyOutboundTunnQuantityLineEdit);
|
||||
initCheckBox(ui->httpProxyEnabledCheckBox);
|
||||
initIPAddressBox(ui->httpProxyAddressLineEdit, tr("HTTP proxy -> IP address"));
|
||||
initTCPPortBox(ui->httpProxyPortLineEdit, tr("HTTP proxy -> Port"));
|
||||
initIntegerBox(ui->httpProxyInboundTunnelsLenLineEdit);
|
||||
initIntegerBox(ui->httpProxyInboundTunnQuantityLineEdit);
|
||||
initIntegerBox(ui->httpProxyOutBoundTunnLenLineEdit);
|
||||
initIntegerBox(ui->httpProxyOutboundTunnQuantityLineEdit);
|
||||
|
||||
initCheckBox(socksProxyEnabledCheckBox);
|
||||
initIPAddressBox(socksProxyAddressLineEdit, tr("Socks proxy -> IP address"));
|
||||
initTCPPortBox(socksProxyPortLineEdit, tr("Socks proxy -> Port"));
|
||||
initIntegerBox(socksProxyInboundTunnelsLenLineEdit);
|
||||
initIntegerBox(socksProxyInboundTunnQuantityLineEdit);
|
||||
initIntegerBox(socksProxyOutBoundTunnLenLineEdit);
|
||||
initIntegerBox(socksProxyOutboundTunnQuantityLineEdit);
|
||||
initIPAddressBox(outproxyAddressLineEdit, tr("Socks proxy -> Outproxy address"));
|
||||
initTCPPortBox(outproxyPortLineEdit, tr("Socks proxy -> Outproxy port"));
|
||||
initCheckBox(ui->socksProxyEnabledCheckBox);
|
||||
initIPAddressBox(ui->socksProxyAddressLineEdit, tr("Socks proxy -> IP address"));
|
||||
initTCPPortBox(ui->socksProxyPortLineEdit, tr("Socks proxy -> Port"));
|
||||
initIntegerBox(ui->socksProxyInboundTunnelsLenLineEdit);
|
||||
initIntegerBox(ui->socksProxyInboundTunnQuantityLineEdit);
|
||||
initIntegerBox(ui->socksProxyOutBoundTunnLenLineEdit);
|
||||
initIntegerBox(ui->socksProxyOutboundTunnQuantityLineEdit);
|
||||
initIPAddressBox(ui->outproxyAddressLineEdit, tr("Socks proxy -> Outproxy address"));
|
||||
initTCPPortBox(ui->outproxyPortLineEdit, tr("Socks proxy -> Outproxy port"));
|
||||
|
||||
initCheckBox(socksProxyEnabledCheckBox);
|
||||
initIPAddressBox(socksProxyAddressLineEdit, tr("Socks proxy -> IP address"));
|
||||
initTCPPortBox(socksProxyPortLineEdit, tr("Socks proxy -> Port"));
|
||||
initCheckBox(ui->samEnabledCheckBox);
|
||||
initIPAddressBox(ui->samAddressLineEdit, tr("SAM -> IP address"));
|
||||
initTCPPortBox(ui->samPortLineEdit, tr("SAM -> Port"));
|
||||
|
||||
initCheckBox(socksProxyEnabledCheckBox);
|
||||
initIPAddressBox(socksProxyAddressLineEdit, tr("Socks proxy -> IP address"));
|
||||
initTCPPortBox(socksProxyPortLineEdit, tr("Socks proxy -> Port"));
|
||||
initCheckBox(ui->bobEnabledCheckBox);
|
||||
initIPAddressBox(ui->bobAddressLineEdit, tr("BOB -> IP address"));
|
||||
initTCPPortBox(ui->bobPortLineEdit, tr("BOB -> Port"));
|
||||
|
||||
initCheckBox(socksProxyEnabledCheckBox);
|
||||
initIPAddressBox(socksProxyAddressLineEdit, tr("Socks proxy -> IP address"));
|
||||
initTCPPortBox(socksProxyPortLineEdit, tr("Socks proxy -> Port"));
|
||||
initCheckBox(ui->i2cpEnabledCheckBox);
|
||||
initIPAddressBox(ui->i2cpAddressLineEdit, tr("I2CP -> IP address"));
|
||||
initTCPPortBox(ui->i2cpPortLineEdit, tr("I2CP -> Port"));
|
||||
|
||||
initCheckBox(socksProxyEnabledCheckBox);
|
||||
initIPAddressBox(socksProxyAddressLineEdit, tr("Socks proxy -> IP address"));
|
||||
initTCPPortBox(socksProxyPortLineEdit, tr("Socks proxy -> Port"));
|
||||
initCheckBox(ui->i2pControlEnabledCheckBox);
|
||||
initIPAddressBox(ui->i2pControlAddressLineEdit, tr("I2PControl -> IP address"));
|
||||
initTCPPortBox(ui->i2pControlPortLineEdit, tr("I2PControl -> Port"));
|
||||
initStringBox(ui->i2pControlPasswordLineEdit);
|
||||
|
||||
initCheckBox(ui->enableUPnPCheckBox);
|
||||
initStringBox(ui->upnpNameLineEdit);
|
||||
|
||||
initCheckBox(ui->useElGamalPrecomputedTablesCheckBox);
|
||||
|
||||
initCheckBox(ui->reseedVerifyCheckBox);
|
||||
initStringBox(ui->reseedURLsLineEdit);
|
||||
|
||||
initStringBox(ui->addressbookDefaultURLLineEdit);
|
||||
initStringBox(ui->addressbookSubscriptionsURLslineEdit);
|
||||
|
||||
initIntegerBox(ui->maxNumOfTransitTunnelsLineEdit);
|
||||
initIntegerBox(ui->maxNumOfOpenFilesLineEdit);
|
||||
initIntegerBox(ui->coreFileMaxSizeNumberLineEdit);
|
||||
|
||||
loadAllConfigs();
|
||||
|
||||
|
@ -235,7 +251,6 @@ void MainWindow::handleQuitButton() {
|
|||
|
||||
void MainWindow::handleGracefulQuitButton() {
|
||||
qDebug("Graceful Quit pressed.");
|
||||
/*
|
||||
ui->gracefulQuitPushButton->setText(QApplication::translate("MainWindow", "Graceful quit is in progress", 0));
|
||||
ui->gracefulQuitPushButton->setEnabled(false);
|
||||
ui->gracefulQuitPushButton->adjustSize();
|
||||
|
@ -243,7 +258,6 @@ void MainWindow::handleGracefulQuitButton() {
|
|||
i2p::context.SetAcceptsTunnels (false); // stop accpting tunnels
|
||||
QTimer::singleShot(10*60*1000//millis
|
||||
, this, SLOT(handleGracefulQuitTimerEvent()));
|
||||
*/
|
||||
}
|
||||
|
||||
void MainWindow::handleGracefulQuitTimerEvent() {
|
||||
|
@ -263,3 +277,15 @@ MainWindow::~MainWindow()
|
|||
//delete ui;
|
||||
//QMessageBox::information(0, "Debug", "mw destructor 2");
|
||||
}
|
||||
|
||||
void MainWindow::initFileChooser(QLineEdit* fileNameLineEdit, QPushButton* fileBrowsePushButton){}
|
||||
void MainWindow::initFolderChooser(QLineEdit* folderLineEdit, QPushButton* folderBrowsePushButton){}
|
||||
void MainWindow::initCombobox(QComboBox* comboBox){}
|
||||
void MainWindow::initIPAddressBox(QLineEdit* addressLineEdit, QString fieldNameTranslated){}
|
||||
void MainWindow::initTCPPortBox(QLineEdit* portLineEdit, QString fieldNameTranslated){}
|
||||
void MainWindow::initCheckBox(QCheckBox* checkBox){}
|
||||
void MainWindow::initIntegerBox(QLineEdit* numberLineEdit){}
|
||||
void MainWindow::initStringBox(QLineEdit* lineEdit){}
|
||||
|
||||
void MainWindow::loadAllConfigs(){}
|
||||
void MainWindow::saveAllConfigs(){}
|
||||
|
|
|
@ -12,6 +12,8 @@
|
|||
#include <QtWidgets/QPushButton>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QWidget>
|
||||
#include <QtWidgets/QCheckBox>
|
||||
#include <QtWidgets/QComboBox>
|
||||
#ifndef ANDROID
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QCloseEvent>
|
||||
|
@ -67,6 +69,19 @@ protected:
|
|||
#endif
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
void onResize();
|
||||
|
||||
void initFileChooser(QLineEdit* fileNameLineEdit, QPushButton* fileBrowsePushButton);
|
||||
void initFolderChooser(QLineEdit* folderLineEdit, QPushButton* folderBrowsePushButton);
|
||||
void initCombobox(QComboBox* comboBox);
|
||||
void initIPAddressBox(QLineEdit* addressLineEdit, QString fieldNameTranslated);
|
||||
void initTCPPortBox(QLineEdit* portLineEdit, QString fieldNameTranslated);
|
||||
void initCheckBox(QCheckBox* checkBox);
|
||||
void initIntegerBox(QLineEdit* numberLineEdit);
|
||||
void initStringBox(QLineEdit* lineEdit);
|
||||
|
||||
void loadAllConfigs();
|
||||
void saveAllConfigs();
|
||||
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<x>10</x>
|
||||
<y>10</y>
|
||||
<width>801</width>
|
||||
<height>3000</height>
|
||||
<height>491</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
|
@ -114,7 +114,7 @@
|
|||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>3000</height>
|
||||
<height>516</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
|
@ -127,7 +127,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>671</width>
|
||||
<height>3000</height>
|
||||
<height>491</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
|
@ -175,7 +175,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>701</width>
|
||||
<height>3000</height>
|
||||
<height>460</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
|
@ -213,8 +213,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>684</width>
|
||||
<height>427</height>
|
||||
<width>683</width>
|
||||
<height>426</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
|
@ -2223,7 +2223,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
<widget class="QLineEdit" name="maxNumOfTransitTunnelsLineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_23">
|
||||
|
@ -2258,7 +2258,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_2"/>
|
||||
<widget class="QLineEdit" name="maxNumOfOpenFilesLineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_24">
|
||||
|
@ -2293,7 +2293,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_3"/>
|
||||
<widget class="QLineEdit" name="coreFileMaxSizeNumberLineEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_25">
|
||||
|
@ -2736,8 +2736,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>664</width>
|
||||
<height>427</height>
|
||||
<width>84</width>
|
||||
<height>28</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
|
2873
qt/i2pd_qt/mainwindow.ui.backup_workingOK
Normal file
2873
qt/i2pd_qt/mainwindow.ui.backup_workingOK
Normal file
File diff suppressed because it is too large
Load diff
2873
qt/i2pd_qt/mainwindow.ui_expandedForm_old
Normal file
2873
qt/i2pd_qt/mainwindow.ui_expandedForm_old
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue