mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 17:55:45 +08:00
QTimer::singleShot "guard"
This commit is contained in:
@@ -144,7 +144,12 @@ void SwiftGuiStd::closeEvent(QCloseEvent *event)
|
|||||||
{
|
{
|
||||||
// we do not just logoff, but give the user a chance to respond
|
// we do not just logoff, but give the user a chance to respond
|
||||||
event->ignore();
|
event->ignore();
|
||||||
QTimer::singleShot(500, this, &SwiftGuiStd::loginRequested);
|
QPointer<SwiftGuiStd> myself(this);
|
||||||
|
QTimer::singleShot(500, this, [ = ]
|
||||||
|
{
|
||||||
|
if (!myself) { return; }
|
||||||
|
myself->loginRequested();
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -251,9 +256,7 @@ void SwiftGuiStd::displayStatusMessageInGui(const CStatusMessage &statusMessage)
|
|||||||
void SwiftGuiStd::onKickedFromNetwork(const QString &kickMessage)
|
void SwiftGuiStd::onKickedFromNetwork(const QString &kickMessage)
|
||||||
{
|
{
|
||||||
this->updateGuiStatusInformation();
|
this->updateGuiStatusInformation();
|
||||||
this->displayInOverlayWindow(CStatusMessage(
|
this->displayInOverlayWindow(CStatusMessage(this, CStatusMessage::SeverityError, kickMessage.isEmpty() ? "You have been kicked from the network" : kickMessage));
|
||||||
this, CStatusMessage::SeverityError,
|
|
||||||
kickMessage.isEmpty() ? "You have been kicked from the network" : kickMessage));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SwiftGuiStd::onConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
|
void SwiftGuiStd::onConnectionStatusChanged(INetwork::ConnectionStatus from, INetwork::ConnectionStatus to)
|
||||||
|
|||||||
Reference in New Issue
Block a user