Browse Source

qt gui preliminary results

pull/892/head
hypnosis-i2p 8 years ago
parent
commit
59b3daabc5
  1. 160
      qt/i2pd_qt/mainwindow.cpp
  2. 15
      qt/i2pd_qt/mainwindow.h
  3. 22
      qt/i2pd_qt/mainwindow.ui
  4. 2873
      qt/i2pd_qt/mainwindow.ui.backup_workingOK
  5. 2873
      qt/i2pd_qt/mainwindow.ui_expandedForm_old

160
qt/i2pd_qt/mainwindow.cpp

@ -57,72 +57,88 @@ 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()));
initFileChooser(configFileLineEdit, configFileBrowsePushButton); initFileChooser(ui->configFileLineEdit, ui->configFileBrowsePushButton);
initFileChooser(tunnelsConfigFileLineEdit, tunnelsConfigFileBrowsePushButton); initFileChooser(ui->tunnelsConfigFileLineEdit, ui->tunnelsConfigFileBrowsePushButton);
initFileChooser(pidFileLineEdit, pidFileBrowsePushButton); initFileChooser(ui->pidFileLineEdit, ui->pidFileBrowsePushButton);
initFileChooser(logFileLineEdit, logFileBrowsePushButton); initFileChooser(ui->logFileLineEdit, ui->logFileBrowsePushButton);
initFileChooser(httpProxyKeyFileLineEdit, httpProxyKeyFilePushButton); initFileChooser(ui->httpProxyKeyFileLineEdit, ui->httpProxyKeyFilePushButton);
initFileChooser(socksProxyKeyFileLineEdit, socksProxyKeyFilePushButton); initFileChooser(ui->socksProxyKeyFileLineEdit, ui->socksProxyKeyFilePushButton);
initFileChooser(i2pControlCertFileLineEdit, i2pControlCertFileBrowsePushButton); initFileChooser(ui->i2pControlCertFileLineEdit, ui->i2pControlCertFileBrowsePushButton);
initFileChooser(i2pControlKeyFileLineEdit, i2pControlKeyFileBrowsePushButton); initFileChooser(ui->i2pControlKeyFileLineEdit, ui->i2pControlKeyFileBrowsePushButton);
initFileChooser(reseedFileLineEdit, reseedFileBrowsePushButton); 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")); initIPAddressBox(ui->routerExternalHostLineEdit, tr("Router external address -> Host"));
initTCPPortBox(routerExternalPortLineEdit, tr("Router external address -> Port")); initTCPPortBox(ui->routerExternalPortLineEdit, tr("Router external address -> Port"));
initCheckBox(ipv6CheckBox); initCheckBox(ui->ipv6CheckBox);
initCheckBox(notransitCheckBox); initCheckBox(ui->notransitCheckBox);
initCheckBox(floodfillCheckBox); initCheckBox(ui->floodfillCheckBox);
initIntegerBox(bandwidthLineEdit); initIntegerBox(ui->bandwidthLineEdit);
initStringBox(familyLineEdit); initStringBox(ui->familyLineEdit);
initIntegerBox(netIdLineEdit); initIntegerBox(ui->netIdLineEdit);
initCheckBox(insomniaCheckBox); initCheckBox(ui->insomniaCheckBox);
initCheckBox(webconsoleEnabledCheckBox); initCheckBox(ui->webconsoleEnabledCheckBox);
initIPAddressBox(webconsoleAddrLineEdit, tr("HTTP webconsole -> IP address")); initIPAddressBox(ui->webconsoleAddrLineEdit, tr("HTTP webconsole -> IP address"));
initTCPPortBox(webconsolePortLineEdit, tr("HTTP webconsole -> Port")); initTCPPortBox(ui->webconsolePortLineEdit, tr("HTTP webconsole -> Port"));
initCheckBox(webconsoleBasicAuthCheckBox); initCheckBox(ui->webconsoleBasicAuthCheckBox);
initStringBox(webconsoleUserNameLineEditBasicAuth); initStringBox(ui->webconsoleUserNameLineEditBasicAuth);
initStringBox(webconsolePasswordLineEditBasicAuth); initStringBox(ui->webconsolePasswordLineEditBasicAuth);
initCheckBox(httpProxyEnabledCheckBox); initCheckBox(ui->httpProxyEnabledCheckBox);
initIPAddressBox(httpProxyAddressLineEdit, tr("HTTP proxy -> IP address")); initIPAddressBox(ui->httpProxyAddressLineEdit, tr("HTTP proxy -> IP address"));
initTCPPortBox(httpProxyPortLineEdit, tr("HTTP proxy -> Port")); initTCPPortBox(ui->httpProxyPortLineEdit, tr("HTTP proxy -> Port"));
initIntegerBox(httpProxyInboundTunnelsLenLineEdit); initIntegerBox(ui->httpProxyInboundTunnelsLenLineEdit);
initIntegerBox(httpProxyInboundTunnQuantityLineEdit); initIntegerBox(ui->httpProxyInboundTunnQuantityLineEdit);
initIntegerBox(httpProxyOutBoundTunnLenLineEdit); initIntegerBox(ui->httpProxyOutBoundTunnLenLineEdit);
initIntegerBox(httpProxyOutboundTunnQuantityLineEdit); initIntegerBox(ui->httpProxyOutboundTunnQuantityLineEdit);
initCheckBox(socksProxyEnabledCheckBox); initCheckBox(ui->socksProxyEnabledCheckBox);
initIPAddressBox(socksProxyAddressLineEdit, tr("Socks proxy -> IP address")); initIPAddressBox(ui->socksProxyAddressLineEdit, tr("Socks proxy -> IP address"));
initTCPPortBox(socksProxyPortLineEdit, tr("Socks proxy -> Port")); initTCPPortBox(ui->socksProxyPortLineEdit, tr("Socks proxy -> Port"));
initIntegerBox(socksProxyInboundTunnelsLenLineEdit); initIntegerBox(ui->socksProxyInboundTunnelsLenLineEdit);
initIntegerBox(socksProxyInboundTunnQuantityLineEdit); initIntegerBox(ui->socksProxyInboundTunnQuantityLineEdit);
initIntegerBox(socksProxyOutBoundTunnLenLineEdit); initIntegerBox(ui->socksProxyOutBoundTunnLenLineEdit);
initIntegerBox(socksProxyOutboundTunnQuantityLineEdit); initIntegerBox(ui->socksProxyOutboundTunnQuantityLineEdit);
initIPAddressBox(outproxyAddressLineEdit, tr("Socks proxy -> Outproxy address")); initIPAddressBox(ui->outproxyAddressLineEdit, tr("Socks proxy -> Outproxy address"));
initTCPPortBox(outproxyPortLineEdit, tr("Socks proxy -> Outproxy port")); initTCPPortBox(ui->outproxyPortLineEdit, tr("Socks proxy -> Outproxy port"));
initCheckBox(socksProxyEnabledCheckBox); initCheckBox(ui->samEnabledCheckBox);
initIPAddressBox(socksProxyAddressLineEdit, tr("Socks proxy -> IP address")); initIPAddressBox(ui->samAddressLineEdit, tr("SAM -> IP address"));
initTCPPortBox(socksProxyPortLineEdit, tr("Socks proxy -> Port")); initTCPPortBox(ui->samPortLineEdit, tr("SAM -> Port"));
initCheckBox(socksProxyEnabledCheckBox); initCheckBox(ui->bobEnabledCheckBox);
initIPAddressBox(socksProxyAddressLineEdit, tr("Socks proxy -> IP address")); initIPAddressBox(ui->bobAddressLineEdit, tr("BOB -> IP address"));
initTCPPortBox(socksProxyPortLineEdit, tr("Socks proxy -> Port")); initTCPPortBox(ui->bobPortLineEdit, tr("BOB -> Port"));
initCheckBox(socksProxyEnabledCheckBox); initCheckBox(ui->i2cpEnabledCheckBox);
initIPAddressBox(socksProxyAddressLineEdit, tr("Socks proxy -> IP address")); initIPAddressBox(ui->i2cpAddressLineEdit, tr("I2CP -> IP address"));
initTCPPortBox(socksProxyPortLineEdit, tr("Socks proxy -> Port")); initTCPPortBox(ui->i2cpPortLineEdit, tr("I2CP -> Port"));
initCheckBox(socksProxyEnabledCheckBox); initCheckBox(ui->i2pControlEnabledCheckBox);
initIPAddressBox(socksProxyAddressLineEdit, tr("Socks proxy -> IP address")); initIPAddressBox(ui->i2pControlAddressLineEdit, tr("I2PControl -> IP address"));
initTCPPortBox(socksProxyPortLineEdit, tr("Socks proxy -> Port")); 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(); loadAllConfigs();
@ -235,7 +251,6 @@ void MainWindow::handleQuitButton() {
void MainWindow::handleGracefulQuitButton() { void MainWindow::handleGracefulQuitButton() {
qDebug("Graceful Quit pressed."); qDebug("Graceful Quit pressed.");
/*
ui->gracefulQuitPushButton->setText(QApplication::translate("MainWindow", "Graceful quit is in progress", 0)); ui->gracefulQuitPushButton->setText(QApplication::translate("MainWindow", "Graceful quit is in progress", 0));
ui->gracefulQuitPushButton->setEnabled(false); ui->gracefulQuitPushButton->setEnabled(false);
ui->gracefulQuitPushButton->adjustSize(); ui->gracefulQuitPushButton->adjustSize();
@ -243,7 +258,6 @@ void MainWindow::handleGracefulQuitButton() {
i2p::context.SetAcceptsTunnels (false); // stop accpting tunnels i2p::context.SetAcceptsTunnels (false); // stop accpting tunnels
QTimer::singleShot(10*60*1000//millis QTimer::singleShot(10*60*1000//millis
, this, SLOT(handleGracefulQuitTimerEvent())); , this, SLOT(handleGracefulQuitTimerEvent()));
*/
} }
void MainWindow::handleGracefulQuitTimerEvent() { void MainWindow::handleGracefulQuitTimerEvent() {
@ -263,3 +277,15 @@ MainWindow::~MainWindow()
//delete ui; //delete ui;
//QMessageBox::information(0, "Debug", "mw destructor 2"); //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(){}

15
qt/i2pd_qt/mainwindow.h

@ -12,6 +12,8 @@
#include <QtWidgets/QPushButton> #include <QtWidgets/QPushButton>
#include <QtWidgets/QVBoxLayout> #include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget> #include <QtWidgets/QWidget>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QComboBox>
#ifndef ANDROID #ifndef ANDROID
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include <QCloseEvent> #include <QCloseEvent>
@ -67,6 +69,19 @@ protected:
#endif #endif
void resizeEvent(QResizeEvent* event); void resizeEvent(QResizeEvent* event);
void onResize(); 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 #endif // MAINWINDOW_H

22
qt/i2pd_qt/mainwindow.ui

@ -26,7 +26,7 @@
<x>10</x> <x>10</x>
<y>10</y> <y>10</y>
<width>801</width> <width>801</width>
<height>3000</height> <height>491</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
@ -114,7 +114,7 @@
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>3000</height> <height>516</height>
</size> </size>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
@ -127,7 +127,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>671</width> <width>671</width>
<height>3000</height> <height>491</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_5"> <layout class="QVBoxLayout" name="verticalLayout_5">
@ -175,7 +175,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>701</width> <width>701</width>
<height>3000</height> <height>460</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_4"> <layout class="QVBoxLayout" name="verticalLayout_4">
@ -213,8 +213,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>684</width> <width>683</width>
<height>427</height> <height>426</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -2223,7 +2223,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="lineEdit"/> <widget class="QLineEdit" name="maxNumOfTransitTunnelsLineEdit"/>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_23"> <spacer name="horizontalSpacer_23">
@ -2258,7 +2258,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="lineEdit_2"/> <widget class="QLineEdit" name="maxNumOfOpenFilesLineEdit"/>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_24"> <spacer name="horizontalSpacer_24">
@ -2293,7 +2293,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="lineEdit_3"/> <widget class="QLineEdit" name="coreFileMaxSizeNumberLineEdit"/>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer_25"> <spacer name="horizontalSpacer_25">
@ -2736,8 +2736,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>664</width> <width>84</width>
<height>427</height> <height>28</height>
</rect> </rect>
</property> </property>
</widget> </widget>

2873
qt/i2pd_qt/mainwindow.ui.backup_workingOK

File diff suppressed because it is too large Load Diff

2873
qt/i2pd_qt/mainwindow.ui_expandedForm_old

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save