Browse Source

fixed tunnels invalid ui data handling 3

pull/952/head
hypnosis-i2p 7 years ago
parent
commit
d4e16881ff
  1. 8
      qt/i2pd_qt/TunnelPane.cpp

8
qt/i2pd_qt/TunnelPane.cpp

@ -200,6 +200,7 @@ void TunnelPane::deleteButtonReleased() {
switch (ret) { switch (ret) {
case QMessageBox::Ok: case QMessageBox::Ok:
// OK was clicked // OK was clicked
hideWrongInputLabel();
tunnelsPageUpdateListener->needsDeleting(tunnelConfig->getName()); tunnelsPageUpdateListener->needsDeleting(tunnelConfig->getName());
break; break;
case QMessageBox::Cancel: case QMessageBox::Cancel:
@ -232,10 +233,9 @@ void TunnelPane::deleteTunnelForm() {
} }
void TunnelPane::highlightWrongInput(QString warningText, QWidget* controlWithWrongInput) { void TunnelPane::highlightWrongInput(QString warningText, QWidget* controlWithWrongInput) {
bool redVisible = wrongInputPane->isVisible();
wrongInputPane->setVisible(true); wrongInputPane->setVisible(true);
wrongInputLabel->setText(warningText); wrongInputLabel->setText(warningText);
if(!redVisible)mainWindow->adjustSizesAccordingToWrongLabel(); mainWindow->adjustSizesAccordingToWrongLabel();
if(controlWithWrongInput){ if(controlWithWrongInput){
mainWindow->ui->tunnelsScrollArea->ensureWidgetVisible(controlWithWrongInput); mainWindow->ui->tunnelsScrollArea->ensureWidgetVisible(controlWithWrongInput);
controlWithWrongInput->setFocus(); controlWithWrongInput->setFocus();
@ -244,8 +244,6 @@ void TunnelPane::highlightWrongInput(QString warningText, QWidget* controlWithWr
} }
void TunnelPane::hideWrongInputLabel() const { void TunnelPane::hideWrongInputLabel() const {
bool redVisible = wrongInputPane->isVisible();
wrongInputPane->setVisible(false); wrongInputPane->setVisible(false);
if(redVisible)mainWindow->adjustSizesAccordingToWrongLabel(); mainWindow->adjustSizesAccordingToWrongLabel();
} }

Loading…
Cancel
Save