some work + fixed red errors on malformed input

This commit is contained in:
hypnosis-i2p 2017-09-08 18:58:04 +08:00
parent 1efc2a9b5d
commit 96cb663fa8
9 changed files with 59 additions and 33 deletions

View file

@ -23,27 +23,26 @@ class ClientTunnelPane;
class TunnelConfig;
class I2CPParameters;
class MainWindow;
class TunnelPane : public QObject {
Q_OBJECT
public:
TunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener_, TunnelConfig* tunconf, QWidget* wrongInputPane_, QLabel* wrongInputLabel_);
TunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener_, TunnelConfig* tunconf, QWidget* wrongInputPane_, QLabel* wrongInputLabel_, MainWindow* mainWindow_);
virtual ~TunnelPane(){}
void deleteTunnelForm();
void hideWrongInputLabel() { wrongInputPane->setVisible(false); }
void highlightWrongInput(QString warningText, QWidget* controlWithWrongInput) {
wrongInputPane->setVisible(true);
wrongInputLabel->setText(warningText);
if(controlWithWrongInput)controlWithWrongInput->setFocus();
}
void hideWrongInputLabel() const { wrongInputPane->setVisible(false); }
void highlightWrongInput(QString warningText, QWidget* controlWithWrongInput);
virtual ServerTunnelPane* asServerTunnelPane()=0;
virtual ClientTunnelPane* asClientTunnelPane()=0;
protected:
MainWindow* mainWindow;
QWidget * wrongInputPane;
QLabel* wrongInputLabel;
TunnelConfig* tunnelConfig;
@ -93,6 +92,7 @@ protected:
//should be created by factory
i2p::data::SigningKeyType readSigTypeComboboxUI(QComboBox* sigTypeComboBox);
public:
//returns false when invalid data at UI
virtual bool applyDataFromUIToTunnelConfig() {
hideWrongInputLabel();
@ -106,7 +106,7 @@ protected:
i2cpParams.setCrypto_tagsToSend(crypto_tagsToSendLineEdit->text());
return true;
}
protected:
void setupTunnelPane(
TunnelConfig* tunnelConfig,
QGroupBox *tunnelGroupBox,