Skip to content

Commit

Permalink
Merge pull request PurpleI2P#950 from hypnosis-i2p/openssl
Browse files Browse the repository at this point in the history
ui critical fixes
  • Loading branch information
orignal authored Sep 8, 2017
2 parents 5ae93d8 + 81b79e6 commit 6666141
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
7 changes: 6 additions & 1 deletion qt/i2pd_qt/TunnelPane.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "QMessageBox"
#include "mainwindow.h"
#include "ui_mainwindow.h"

TunnelPane::TunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener_, TunnelConfig* tunnelConfig_, QWidget* wrongInputPane_, QLabel* wrongInputLabel_, MainWindow* mainWindow_):
QObject(),
Expand Down Expand Up @@ -184,6 +185,7 @@ void TunnelPane::appendControlsForI2CPParameters(I2CPParameters& i2cpParameters,

void TunnelPane::updated() {
std::string oldName=tunnelConfig->getName();
//validate and show red if invalid
if(!applyDataFromUIToTunnelConfig())return;
tunnelsPageUpdateListener->updated(oldName, tunnelConfig);
}
Expand Down Expand Up @@ -231,6 +233,9 @@ void TunnelPane::deleteTunnelForm() {
void TunnelPane::highlightWrongInput(QString warningText, QWidget* controlWithWrongInput) {
wrongInputPane->setVisible(true);
wrongInputLabel->setText(warningText);
if(controlWithWrongInput)controlWithWrongInput->setFocus();
if(controlWithWrongInput){
mainWindow->ui->tunnelsScrollArea->ensureWidgetVisible(controlWithWrongInput);
controlWithWrongInput->setFocus();
}
mainWindow->showTunnelsPage();
}
15 changes: 3 additions & 12 deletions qt/i2pd_qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ void MainWindow::appendTunnelForms(std::string tunnelNameToFocus) {
tunnelPanes.push_back(tunnelPane);
if(name==tunnelNameToFocus){
tunnelPane->getNameLineEdit()->setFocus();
//todo ui->settingsScrollArea->###scroll
ui->tunnelsScrollArea->ensureWidgetVisible(tunnelPane->getNameLineEdit());
}
continue;
}
Expand All @@ -719,7 +719,7 @@ void MainWindow::appendTunnelForms(std::string tunnelNameToFocus) {
tunnelPanes.push_back(tunnelPane);
if(name==tunnelNameToFocus){
tunnelPane->getNameLineEdit()->setFocus();
//todo ui->settingsScrollArea->###scroll
ui->tunnelsScrollArea->ensureWidgetVisible(tunnelPane->getNameLineEdit());
}
continue;
}
Expand Down Expand Up @@ -765,15 +765,6 @@ void MainWindow::reloadTunnelsConfigAndUI(std::string tunnelNameToFocus) {
void MainWindow::SaveTunnelsConfig() {
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) {
const std::string& name = it->first;
TunnelConfig* tunconf = it->second;
Expand Down Expand Up @@ -863,6 +854,6 @@ void MainWindow::backClickedFromChild() {
void MainWindow::highlightWrongInput(QString warningText, QWidget* widgetToFocus) {
ui->wrongInputLabel->setVisible(true);
ui->wrongInputLabel->setText(warningText);
if(widgetToFocus)widgetToFocus->setFocus();
if(widgetToFocus){ui->settingsScrollArea->ensureWidgetVisible(widgetToFocus);widgetToFocus->setFocus();}
showSettingsPage();
}
3 changes: 2 additions & 1 deletion qt/i2pd_qt/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,11 +441,12 @@ public slots:
QMenu *trayIconMenu;
#endif

public:
Ui::MainWindow* ui;
Ui::StatusButtonsForm* statusButtonsUI;
Ui::routerCommandsWidget* routerCommandsUI;
Ui::GeneralSettingsContentsForm* uiSettings;

private:
TextBrowserTweaked1 * textBrowser;
QWidget * routerCommandsParent;
PageWithBackButton * pageWithBackButton;
Expand Down
6 changes: 3 additions & 3 deletions qt/i2pd_qt/mainwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>908</width>
<height>550</height>
<height>554</height>
</rect>
</property>
<property name="minimumSize">
Expand Down Expand Up @@ -50,7 +50,7 @@
<x>10</x>
<y>10</y>
<width>888</width>
<height>555</height>
<height>531</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
Expand Down Expand Up @@ -624,7 +624,7 @@
</size>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="statusPage">
<property name="sizePolicy">
Expand Down

0 comments on commit 6666141

Please sign in to comment.