mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-23 17:34:21 +00:00
fixes #945
This commit is contained in:
parent
1673966e36
commit
ef30d2d3b6
@ -11,6 +11,7 @@ void ClientTunnelPane::setGroupBoxTitle(const QString & title) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ClientTunnelPane::deleteClientTunnelForm() {
|
void ClientTunnelPane::deleteClientTunnelForm() {
|
||||||
|
TunnelPane::deleteTunnelForm();
|
||||||
delete clientTunnelNameGroupBox;
|
delete clientTunnelNameGroupBox;
|
||||||
clientTunnelNameGroupBox=nullptr;
|
clientTunnelNameGroupBox=nullptr;
|
||||||
|
|
||||||
|
@ -266,6 +266,7 @@ int ServerTunnelPane::appendServerTunnelForm(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ServerTunnelPane::deleteServerTunnelForm() {
|
void ServerTunnelPane::deleteServerTunnelForm() {
|
||||||
|
TunnelPane::deleteTunnelForm();
|
||||||
delete serverTunnelNameGroupBox;//->deleteLater();
|
delete serverTunnelNameGroupBox;//->deleteLater();
|
||||||
serverTunnelNameGroupBox=nullptr;
|
serverTunnelNameGroupBox=nullptr;
|
||||||
|
|
||||||
|
@ -218,3 +218,7 @@ QString TunnelPane::readTunnelTypeComboboxData() {
|
|||||||
i2p::data::SigningKeyType TunnelPane::readSigTypeComboboxUI(QComboBox* sigTypeComboBox) {
|
i2p::data::SigningKeyType TunnelPane::readSigTypeComboboxUI(QComboBox* sigTypeComboBox) {
|
||||||
return (i2p::data::SigningKeyType) sigTypeComboBox->currentData().toInt();
|
return (i2p::data::SigningKeyType) sigTypeComboBox->currentData().toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TunnelPane::deleteTunnelForm() {
|
||||||
|
widgetlocks.deleteListeners();
|
||||||
|
}
|
||||||
|
@ -31,6 +31,9 @@ public:
|
|||||||
TunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener_, TunnelConfig* tunconf);
|
TunnelPane(TunnelsPageUpdateListener* tunnelsPageUpdateListener_, TunnelConfig* tunconf);
|
||||||
virtual ~TunnelPane(){}
|
virtual ~TunnelPane(){}
|
||||||
|
|
||||||
|
void deleteTunnelForm();
|
||||||
|
|
||||||
|
|
||||||
virtual ServerTunnelPane* asServerTunnelPane()=0;
|
virtual ServerTunnelPane* asServerTunnelPane()=0;
|
||||||
virtual ClientTunnelPane* asClientTunnelPane()=0;
|
virtual ClientTunnelPane* asClientTunnelPane()=0;
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ class widgetlock : public QObject {
|
|||||||
private:
|
private:
|
||||||
QWidget* widget;
|
QWidget* widget;
|
||||||
QPushButton* lockButton;
|
QPushButton* lockButton;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void lockButtonClicked(bool) {
|
void lockButtonClicked(bool) {
|
||||||
bool wasEnabled = widget->isEnabled();
|
bool wasEnabled = widget->isEnabled();
|
||||||
@ -25,7 +26,8 @@ public:
|
|||||||
lockButton->setText(lockButton->tr("Edit"));
|
lockButton->setText(lockButton->tr("Edit"));
|
||||||
QObject::connect(lockButton,SIGNAL(clicked(bool)), this, SLOT(lockButtonClicked(bool)));
|
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)));
|
QObject::disconnect(lockButton,SIGNAL(clicked(bool)), this, SLOT(lockButtonClicked(bool)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -9,15 +9,19 @@ class widgetlockregistry {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
widgetlockregistry() : locks() {}
|
widgetlockregistry() : locks() {}
|
||||||
virtual ~widgetlockregistry() {
|
virtual ~widgetlockregistry() {}
|
||||||
while(!locks.empty()) {
|
|
||||||
delete locks.back();
|
|
||||||
locks.pop_back();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
void add(widgetlock* lock) {
|
void add(widgetlock* lock) {
|
||||||
locks.push_back(lock);
|
locks.push_back(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void deleteListeners() {
|
||||||
|
while(!locks.empty()) {
|
||||||
|
widgetlock* lock = locks.back();
|
||||||
|
lock->deleteListener();
|
||||||
|
delete lock;
|
||||||
|
locks.pop_back();
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // WIDGETLOCKREGISTRY_H
|
#endif // WIDGETLOCKREGISTRY_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user