Browse Source

fixed tunnels invalid ui data handling

pull/952/head
hypnosis-i2p 7 years ago
parent
commit
1947be4957
  1. 2
      qt/i2pd_qt/TunnelPane.cpp
  2. 8
      qt/i2pd_qt/mainwindow.cpp
  3. 1
      qt/i2pd_qt/mainwindow.h

2
qt/i2pd_qt/TunnelPane.cpp

@ -186,7 +186,7 @@ void TunnelPane::appendControlsForI2CPParameters(I2CPParameters& i2cpParameters, @@ -186,7 +186,7 @@ void TunnelPane::appendControlsForI2CPParameters(I2CPParameters& i2cpParameters,
void TunnelPane::updated() {
std::string oldName=tunnelConfig->getName();
//validate and show red if invalid
if(!applyDataFromUIToTunnelConfig())return;
if(!mainWindow->applyTunnelsUiToConfigs())return;
tunnelsPageUpdateListener->updated(oldName, tunnelConfig);
}

8
qt/i2pd_qt/mainwindow.cpp

@ -756,6 +756,14 @@ void MainWindow::deleteTunnelForms() { @@ -756,6 +756,14 @@ void MainWindow::deleteTunnelForms() {
tunnelPanes.clear();
}
bool MainWindow::applyTunnelsUiToConfigs() {
for(std::list<TunnelPane*>::iterator it = tunnelPanes.begin(); it != tunnelPanes.end(); ++it) {
TunnelPane* tp = *it;
if(!tp->applyDataFromUIToTunnelConfig())return false;
}
return true;
}
void MainWindow::reloadTunnelsConfigAndUI(std::string tunnelNameToFocus) {
deleteTunnelForms();
for (std::map<std::string,TunnelConfig*>::iterator it=tunnelConfigs.begin(); it!=tunnelConfigs.end(); ++it) {

1
qt/i2pd_qt/mainwindow.h

@ -446,6 +446,7 @@ public: @@ -446,6 +446,7 @@ public:
Ui::routerCommandsWidget* routerCommandsUI;
Ui::GeneralSettingsContentsForm* uiSettings;
void adjustSizesAccordingToWrongLabel();
bool applyTunnelsUiToConfigs();
private:
int settingsTitleLabelNominalHeight;
TextBrowserTweaked1 * textBrowser;

Loading…
Cancel
Save