mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-27 19:27:49 +02:00
fixed #935
This commit is contained in:
parent
ef30d2d3b6
commit
9441c1cffe
10 changed files with 863 additions and 353 deletions
|
@ -31,7 +31,7 @@ class ServerTunnelPane : public TunnelPane {
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ServerTunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener, ServerTunnelConfig* tunconf);
|
||||
ServerTunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener, ServerTunnelConfig* tunconf, QWidget* wrongInputPane_, QLabel* wrongInputLabel_);
|
||||
virtual ~ServerTunnelPane(){}
|
||||
|
||||
virtual ServerTunnelPane* asServerTunnelPane();
|
||||
|
@ -119,6 +119,7 @@ private:
|
|||
|
||||
protected:
|
||||
virtual bool applyDataFromUIToTunnelConfig() {
|
||||
QString cannotSaveSettings = QApplication::tr("Cannot save settings.");
|
||||
bool ok=TunnelPane::applyDataFromUIToTunnelConfig();
|
||||
if(!ok)return false;
|
||||
ServerTunnelConfig* stc=tunnelConfig->asServerTunnelConfig();
|
||||
|
@ -127,14 +128,20 @@ protected:
|
|||
|
||||
auto portStr=portLineEdit->text();
|
||||
int portInt=portStr.toInt(&ok);
|
||||
if(!ok)return false;
|
||||
if(!ok){
|
||||
highlightWrongInput(QApplication::tr("Bad port, must be int.")+" "+cannotSaveSettings,portLineEdit);
|
||||
return false;
|
||||
}
|
||||
stc->setport(portInt);
|
||||
|
||||
stc->setkeys(keysLineEdit->text().toStdString());
|
||||
|
||||
auto str=inPortLineEdit->text();
|
||||
int inPortInt=str.toInt(&ok);
|
||||
if(!ok)return false;
|
||||
if(!ok){
|
||||
highlightWrongInput(QApplication::tr("Bad inPort, must be int.")+" "+cannotSaveSettings,inPortLineEdit);
|
||||
return false;
|
||||
}
|
||||
stc->setinPort(inPortInt);
|
||||
|
||||
stc->setaccessList(accessListLineEdit->text().toStdString());
|
||||
|
@ -147,7 +154,10 @@ protected:
|
|||
|
||||
auto mcStr=maxConnsLineEdit->text();
|
||||
uint32_t mcInt=(uint32_t)mcStr.toInt(&ok);
|
||||
if(!ok)return false;
|
||||
if(!ok){
|
||||
highlightWrongInput(QApplication::tr("Bad maxConns, must be int.")+" "+cannotSaveSettings,maxConnsLineEdit);
|
||||
return false;
|
||||
}
|
||||
stc->setmaxConns(mcInt);
|
||||
|
||||
stc->setgzip(gzipCheckBox->isChecked());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue