SYNERGY-799 Show message even if parent is hidden or minimized
This commit is contained in:
parent
9e4c114949
commit
fa2ad60a5b
4 changed files with 24 additions and 5 deletions
|
|
@ -19,6 +19,7 @@ Enhancements:
|
||||||
- #6977 Update synergy UI. Configure server
|
- #6977 Update synergy UI. Configure server
|
||||||
- #6978 Update synergy UI. Settings window
|
- #6978 Update synergy UI. Settings window
|
||||||
- #6981 Update synergy UI. Setup client configuration
|
- #6981 Update synergy UI. Setup client configuration
|
||||||
|
- #6984 Update synergy UI. Client error messages
|
||||||
- #6962 | #6965 Add macOS 10.13 builder
|
- #6962 | #6965 Add macOS 10.13 builder
|
||||||
===========
|
===========
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@ ClientConnection::ClientConnection(MainWindow& parent) :
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientConnection::update(const QString& line) const
|
void ClientConnection::update(const QString& line)
|
||||||
{
|
{
|
||||||
if (m_parent.isActiveWindow() &&
|
if (line.contains("failed to connect to server") &&
|
||||||
line.contains("failed to connect to server") )
|
checkMainWindow())
|
||||||
{
|
{
|
||||||
m_parent.stopSynergy();
|
m_parent.stopSynergy();
|
||||||
|
|
||||||
|
|
@ -42,6 +42,20 @@ void ClientConnection::update(const QString& line) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ClientConnection::checkMainWindow()
|
||||||
|
{
|
||||||
|
bool result = m_parent.isActiveWindow();
|
||||||
|
|
||||||
|
if (m_parent.isMinimized() || m_parent.isHidden())
|
||||||
|
{
|
||||||
|
m_parent.showNormal();
|
||||||
|
m_parent.activateWindow();
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
QString ClientConnection::getMessage() const
|
QString ClientConnection::getMessage() const
|
||||||
{
|
{
|
||||||
QString message(QObject::tr("We can’t connect to the server IP address.\nCheck your IP on your server and your firewall settings."));
|
QString message(QObject::tr("We can’t connect to the server IP address.\nCheck your IP on your server and your firewall settings."));
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,11 @@ class ClientConnection
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ClientConnection(MainWindow& parent);
|
explicit ClientConnection(MainWindow& parent);
|
||||||
void update(const QString& line) const;
|
void update(const QString& line);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString getMessage() const;
|
QString getMessage() const;
|
||||||
|
bool checkMainWindow();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CLIENTCONNECTION_H
|
#endif // CLIENTCONNECTION_H
|
||||||
|
|
|
||||||
|
|
@ -45,13 +45,16 @@ void ServerConnection::update(const QString& line)
|
||||||
|
|
||||||
bool ServerConnection::checkMainWindow()
|
bool ServerConnection::checkMainWindow()
|
||||||
{
|
{
|
||||||
|
bool result = m_parent.isActiveWindow();
|
||||||
|
|
||||||
if (m_parent.isMinimized() || m_parent.isHidden())
|
if (m_parent.isMinimized() || m_parent.isHidden())
|
||||||
{
|
{
|
||||||
m_parent.showNormal();
|
m_parent.showNormal();
|
||||||
m_parent.activateWindow();
|
m_parent.activateWindow();
|
||||||
|
result = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_parent.isActiveWindow();
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerConnection::addClient(const QString& clientName)
|
void ServerConnection::addClient(const QString& clientName)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue