mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 12:24:19 +00:00
fixed tunnels invalid ui data handling 2
This commit is contained in:
parent
1947be4957
commit
cd3f274763
@ -186,6 +186,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
|
//validate and show red if invalid
|
||||||
|
hideWrongInputLabel();
|
||||||
if(!mainWindow->applyTunnelsUiToConfigs())return;
|
if(!mainWindow->applyTunnelsUiToConfigs())return;
|
||||||
tunnelsPageUpdateListener->updated(oldName, tunnelConfig);
|
tunnelsPageUpdateListener->updated(oldName, tunnelConfig);
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,6 @@ protected:
|
|||||||
public:
|
public:
|
||||||
//returns false when invalid data at UI
|
//returns false when invalid data at UI
|
||||||
virtual bool applyDataFromUIToTunnelConfig() {
|
virtual bool applyDataFromUIToTunnelConfig() {
|
||||||
hideWrongInputLabel();
|
|
||||||
tunnelConfig->setName(nameLineEdit->text().toStdString());
|
tunnelConfig->setName(nameLineEdit->text().toStdString());
|
||||||
tunnelConfig->setType(readTunnelTypeComboboxData());
|
tunnelConfig->setType(readTunnelTypeComboboxData());
|
||||||
I2CPParameters& i2cpParams=tunnelConfig->getI2cpParameters();
|
I2CPParameters& i2cpParams=tunnelConfig->getI2cpParameters();
|
||||||
|
@ -632,10 +632,6 @@ void MainWindow::loadAllConfigs(){
|
|||||||
/** returns false iff not valid items present and save was aborted */
|
/** returns false iff not valid items present and save was aborted */
|
||||||
bool MainWindow::saveAllConfigs(){
|
bool MainWindow::saveAllConfigs(){
|
||||||
QString cannotSaveSettings = QApplication::tr("Cannot save settings.");
|
QString cannotSaveSettings = QApplication::tr("Cannot save settings.");
|
||||||
bool redVisible = ui->wrongInputLabel->isVisible();
|
|
||||||
ui->wrongInputLabel->setVisible(false);
|
|
||||||
if(redVisible)adjustSizesAccordingToWrongLabel();
|
|
||||||
|
|
||||||
programOptionsWriterCurrentSection="";
|
programOptionsWriterCurrentSection="";
|
||||||
/*if(!logFileNameOption->lineEdit->text().trimmed().isEmpty())logOption->optionValue=boost::any(std::string("file"));
|
/*if(!logFileNameOption->lineEdit->text().trimmed().isEmpty())logOption->optionValue=boost::any(std::string("file"));
|
||||||
else logOption->optionValue=boost::any(std::string("stdout"));*/
|
else logOption->optionValue=boost::any(std::string("stdout"));*/
|
||||||
@ -684,15 +680,22 @@ void FolderChooserItem::pushButtonReleased() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BaseStringItem::installListeners(MainWindow *mainWindow) {
|
void BaseStringItem::installListeners(MainWindow *mainWindow) {
|
||||||
QObject::connect(lineEdit, SIGNAL(textChanged(const QString &)), mainWindow, SLOT(saveAllConfigs()));
|
QObject::connect(lineEdit, SIGNAL(textChanged(const QString &)), mainWindow, SLOT(updated()));
|
||||||
}
|
}
|
||||||
void ComboBoxItem::installListeners(MainWindow *mainWindow) {
|
void ComboBoxItem::installListeners(MainWindow *mainWindow) {
|
||||||
QObject::connect(comboBox, SIGNAL(currentIndexChanged(int)), mainWindow, SLOT(saveAllConfigs()));
|
QObject::connect(comboBox, SIGNAL(currentIndexChanged(int)), mainWindow, SLOT(updated()));
|
||||||
}
|
}
|
||||||
void CheckBoxItem::installListeners(MainWindow *mainWindow) {
|
void CheckBoxItem::installListeners(MainWindow *mainWindow) {
|
||||||
QObject::connect(checkBox, SIGNAL(stateChanged(int)), mainWindow, SLOT(saveAllConfigs()));
|
QObject::connect(checkBox, SIGNAL(stateChanged(int)), mainWindow, SLOT(updated()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::updated() {
|
||||||
|
ui->wrongInputLabel->setVisible(false);
|
||||||
|
adjustSizesAccordingToWrongLabel();
|
||||||
|
|
||||||
|
applyTunnelsUiToConfigs();
|
||||||
|
saveAllConfigs();
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindowItem::installListeners(MainWindow *mainWindow) {}
|
void MainWindowItem::installListeners(MainWindow *mainWindow) {}
|
||||||
|
|
||||||
|
@ -390,6 +390,7 @@ private:
|
|||||||
enum StatusPage {main_page, commands, local_destinations, leasesets, tunnels, transit_tunnels,
|
enum StatusPage {main_page, commands, local_destinations, leasesets, tunnels, transit_tunnels,
|
||||||
transports, i2p_tunnels, sam_sessions};
|
transports, i2p_tunnels, sam_sessions};
|
||||||
private slots:
|
private slots:
|
||||||
|
void updated();
|
||||||
|
|
||||||
void handleQuitButton();
|
void handleQuitButton();
|
||||||
void handleGracefulQuitButton();
|
void handleGracefulQuitButton();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user