Show current re-connect interval in connection settings

This commit is contained in:
Martchus 2024-06-20 23:08:41 +02:00
parent 7a47bc3e4f
commit 5b5aeaa9ab
2 changed files with 8 additions and 3 deletions

View File

@ -1158,11 +1158,12 @@ void SyncthingConnection::emitDirStatisticsChanged()
*/
void SyncthingConnection::handleFatalConnectionError()
{
setStatus(SyncthingStatus::Disconnected);
abortAllRequests();
// start the timer before emitting the event so its active state can be observed in event handler
if (m_autoReconnectTimer.interval()) {
m_autoReconnectTimer.start();
}
setStatus(SyncthingStatus::Disconnected);
abortAllRequests();
}
/*!

View File

@ -626,7 +626,11 @@ inline void SyncthingConnection::setUseDeprecatedRoutes(bool useDeprecatedRoutes
*/
inline QString SyncthingConnection::statusText() const
{
return statusText(m_status);
auto text = statusText(m_status);
if (m_autoReconnectTimer.isActive() && m_autoReconnectTimer.interval()) {
text += tr(", re-connect attempt every %1 ms").arg(m_autoReconnectTimer.interval());
}
return text;
}
/*!