Browse Source

Merge pull request #950 from hypnosis-i2p/openssl

ui critical fixes
pull/958/head
orignal 7 years ago committed by GitHub
parent
commit
66661417d7
  1. 7
      qt/i2pd_qt/TunnelPane.cpp
  2. 15
      qt/i2pd_qt/mainwindow.cpp
  3. 3
      qt/i2pd_qt/mainwindow.h
  4. 6
      qt/i2pd_qt/mainwindow.ui

7
qt/i2pd_qt/TunnelPane.cpp

@ -2,6 +2,7 @@
#include "QMessageBox" #include "QMessageBox"
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h"
TunnelPane::TunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener_, TunnelConfig* tunnelConfig_, QWidget* wrongInputPane_, QLabel* wrongInputLabel_, MainWindow* mainWindow_): TunnelPane::TunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener_, TunnelConfig* tunnelConfig_, QWidget* wrongInputPane_, QLabel* wrongInputLabel_, MainWindow* mainWindow_):
QObject(), QObject(),
@ -184,6 +185,7 @@ void TunnelPane::appendControlsForI2CPParameters(I2CPParameters& i2cpParameters,
void TunnelPane::updated() { void TunnelPane::updated() {
std::string oldName=tunnelConfig->getName(); std::string oldName=tunnelConfig->getName();
//validate and show red if invalid
if(!applyDataFromUIToTunnelConfig())return; if(!applyDataFromUIToTunnelConfig())return;
tunnelsPageUpdateListener->updated(oldName, tunnelConfig); tunnelsPageUpdateListener->updated(oldName, tunnelConfig);
} }
@ -231,6 +233,9 @@ void TunnelPane::deleteTunnelForm() {
void TunnelPane::highlightWrongInput(QString warningText, QWidget* controlWithWrongInput) { void TunnelPane::highlightWrongInput(QString warningText, QWidget* controlWithWrongInput) {
wrongInputPane->setVisible(true); wrongInputPane->setVisible(true);
wrongInputLabel->setText(warningText); wrongInputLabel->setText(warningText);
if(controlWithWrongInput)controlWithWrongInput->setFocus(); if(controlWithWrongInput){
mainWindow->ui->tunnelsScrollArea->ensureWidgetVisible(controlWithWrongInput);
controlWithWrongInput->setFocus();
}
mainWindow->showTunnelsPage(); mainWindow->showTunnelsPage();
} }

15
qt/i2pd_qt/mainwindow.cpp

@ -706,7 +706,7 @@ void MainWindow::appendTunnelForms(std::string tunnelNameToFocus) {
tunnelPanes.push_back(tunnelPane); tunnelPanes.push_back(tunnelPane);
if(name==tunnelNameToFocus){ if(name==tunnelNameToFocus){
tunnelPane->getNameLineEdit()->setFocus(); tunnelPane->getNameLineEdit()->setFocus();
//todo ui->settingsScrollArea->###scroll ui->tunnelsScrollArea->ensureWidgetVisible(tunnelPane->getNameLineEdit());
} }
continue; continue;
} }
@ -719,7 +719,7 @@ void MainWindow::appendTunnelForms(std::string tunnelNameToFocus) {
tunnelPanes.push_back(tunnelPane); tunnelPanes.push_back(tunnelPane);
if(name==tunnelNameToFocus){ if(name==tunnelNameToFocus){
tunnelPane->getNameLineEdit()->setFocus(); tunnelPane->getNameLineEdit()->setFocus();
//todo ui->settingsScrollArea->###scroll ui->tunnelsScrollArea->ensureWidgetVisible(tunnelPane->getNameLineEdit());
} }
continue; continue;
} }
@ -765,15 +765,6 @@ void MainWindow::reloadTunnelsConfigAndUI(std::string tunnelNameToFocus) {
void MainWindow::SaveTunnelsConfig() { void MainWindow::SaveTunnelsConfig() {
std::stringstream out; std::stringstream out;
//validate and show red if wrong
for (std::list<TunnelPane*>::iterator it=tunnelPanes.begin(); it!=tunnelPanes.end(); ++it) {
TunnelPane* tunpane = *it;
if(!tunpane->applyDataFromUIToTunnelConfig()) {
//!valid
return;
}
}
for (std::map<std::string,TunnelConfig*>::iterator it=tunnelConfigs.begin(); it!=tunnelConfigs.end(); ++it) { for (std::map<std::string,TunnelConfig*>::iterator it=tunnelConfigs.begin(); it!=tunnelConfigs.end(); ++it) {
const std::string& name = it->first; const std::string& name = it->first;
TunnelConfig* tunconf = it->second; TunnelConfig* tunconf = it->second;
@ -863,6 +854,6 @@ void MainWindow::backClickedFromChild() {
void MainWindow::highlightWrongInput(QString warningText, QWidget* widgetToFocus) { void MainWindow::highlightWrongInput(QString warningText, QWidget* widgetToFocus) {
ui->wrongInputLabel->setVisible(true); ui->wrongInputLabel->setVisible(true);
ui->wrongInputLabel->setText(warningText); ui->wrongInputLabel->setText(warningText);
if(widgetToFocus)widgetToFocus->setFocus(); if(widgetToFocus){ui->settingsScrollArea->ensureWidgetVisible(widgetToFocus);widgetToFocus->setFocus();}
showSettingsPage(); showSettingsPage();
} }

3
qt/i2pd_qt/mainwindow.h

@ -441,11 +441,12 @@ private:
QMenu *trayIconMenu; QMenu *trayIconMenu;
#endif #endif
public:
Ui::MainWindow* ui; Ui::MainWindow* ui;
Ui::StatusButtonsForm* statusButtonsUI; Ui::StatusButtonsForm* statusButtonsUI;
Ui::routerCommandsWidget* routerCommandsUI; Ui::routerCommandsWidget* routerCommandsUI;
Ui::GeneralSettingsContentsForm* uiSettings; Ui::GeneralSettingsContentsForm* uiSettings;
private:
TextBrowserTweaked1 * textBrowser; TextBrowserTweaked1 * textBrowser;
QWidget * routerCommandsParent; QWidget * routerCommandsParent;
PageWithBackButton * pageWithBackButton; PageWithBackButton * pageWithBackButton;

6
qt/i2pd_qt/mainwindow.ui

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>908</width> <width>908</width>
<height>550</height> <height>554</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
@ -50,7 +50,7 @@
<x>10</x> <x>10</x>
<y>10</y> <y>10</y>
<width>888</width> <width>888</width>
<height>555</height> <height>531</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
@ -624,7 +624,7 @@
</size> </size>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="statusPage"> <widget class="QWidget" name="statusPage">
<property name="sizePolicy"> <property name="sizePolicy">

Loading…
Cancel
Save