Browse Source

fixes #945

pull/948/head
hypnosis-i2p 7 years ago
parent
commit
ef30d2d3b6
  1. 1
      qt/i2pd_qt/ClientTunnelPane.cpp
  2. 1
      qt/i2pd_qt/ServerTunnelPane.cpp
  3. 4
      qt/i2pd_qt/TunnelPane.cpp
  4. 3
      qt/i2pd_qt/TunnelPane.h
  5. 4
      qt/i2pd_qt/widgetlock.h
  6. 14
      qt/i2pd_qt/widgetlockregistry.h

1
qt/i2pd_qt/ClientTunnelPane.cpp

@ -11,6 +11,7 @@ void ClientTunnelPane::setGroupBoxTitle(const QString & title) { @@ -11,6 +11,7 @@ void ClientTunnelPane::setGroupBoxTitle(const QString & title) {
}
void ClientTunnelPane::deleteClientTunnelForm() {
TunnelPane::deleteTunnelForm();
delete clientTunnelNameGroupBox;
clientTunnelNameGroupBox=nullptr;

1
qt/i2pd_qt/ServerTunnelPane.cpp

@ -266,6 +266,7 @@ int ServerTunnelPane::appendServerTunnelForm( @@ -266,6 +266,7 @@ int ServerTunnelPane::appendServerTunnelForm(
}
void ServerTunnelPane::deleteServerTunnelForm() {
TunnelPane::deleteTunnelForm();
delete serverTunnelNameGroupBox;//->deleteLater();
serverTunnelNameGroupBox=nullptr;

4
qt/i2pd_qt/TunnelPane.cpp

@ -218,3 +218,7 @@ QString TunnelPane::readTunnelTypeComboboxData() { @@ -218,3 +218,7 @@ QString TunnelPane::readTunnelTypeComboboxData() {
i2p::data::SigningKeyType TunnelPane::readSigTypeComboboxUI(QComboBox* sigTypeComboBox) {
return (i2p::data::SigningKeyType) sigTypeComboBox->currentData().toInt();
}
void TunnelPane::deleteTunnelForm() {
widgetlocks.deleteListeners();
}

3
qt/i2pd_qt/TunnelPane.h

@ -31,6 +31,9 @@ public: @@ -31,6 +31,9 @@ public:
TunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener_, TunnelConfig* tunconf);
virtual ~TunnelPane(){}
void deleteTunnelForm();
virtual ServerTunnelPane* asServerTunnelPane()=0;
virtual ClientTunnelPane* asClientTunnelPane()=0;

4
qt/i2pd_qt/widgetlock.h

@ -12,6 +12,7 @@ class widgetlock : public QObject { @@ -12,6 +12,7 @@ class widgetlock : public QObject {
private:
QWidget* widget;
QPushButton* lockButton;
public slots:
void lockButtonClicked(bool) {
bool wasEnabled = widget->isEnabled();
@ -25,7 +26,8 @@ public: @@ -25,7 +26,8 @@ public:
lockButton->setText(lockButton->tr("Edit"));
QObject::connect(lockButton,SIGNAL(clicked(bool)), this, SLOT(lockButtonClicked(bool)));
}
virtual ~widgetlock() {
virtual ~widgetlock() {}
void deleteListener() {
QObject::disconnect(lockButton,SIGNAL(clicked(bool)), this, SLOT(lockButtonClicked(bool)));
}
};

14
qt/i2pd_qt/widgetlockregistry.h

@ -9,15 +9,19 @@ class widgetlockregistry { @@ -9,15 +9,19 @@ class widgetlockregistry {
public:
widgetlockregistry() : locks() {}
virtual ~widgetlockregistry() {
virtual ~widgetlockregistry() {}
void add(widgetlock* lock) {
locks.push_back(lock);
}
void deleteListeners() {
while(!locks.empty()) {
delete locks.back();
widgetlock* lock = locks.back();
lock->deleteListener();
delete lock;
locks.pop_back();
}
}
void add(widgetlock* lock) {
locks.push_back(lock);
}
};
#endif // WIDGETLOCKREGISTRY_H

Loading…
Cancel
Save