| 1855 | } |
| 1856 | |
| 1857 | void MainWindow::messageCheck() |
| 1858 | { |
| 1859 | if(m_Ctx.IsCaptureLoaded()) |
| 1860 | { |
| 1861 | if(m_Ctx.Replay().GetCurrentProcessingTime() >= 1.5f) |
| 1862 | { |
| 1863 | statusProgress->setVisible(true); |
| 1864 | statusProgress->setMaximum(0); |
| 1865 | } |
| 1866 | else |
| 1867 | { |
| 1868 | statusProgress->hide(); |
| 1869 | } |
| 1870 | |
| 1871 | m_Ctx.Replay().AsyncInvoke([this](IReplayController *r) { |
| 1872 | rdcarray<DebugMessage> msgs; |
| 1873 | |
| 1874 | bool disconnected = false; |
| 1875 | |
| 1876 | if(m_Ctx.Replay().CurrentRemote().IsValid()) |
| 1877 | { |
| 1878 | bool wasRunning = m_Ctx.Replay().CurrentRemote().IsServerRunning(); |
| 1879 | |
| 1880 | m_Ctx.Replay().PingRemote(); |
| 1881 | |
| 1882 | if(wasRunning != m_Ctx.Replay().CurrentRemote().IsServerRunning()) |
| 1883 | { |
| 1884 | qCritical() << "Remote server disconnected"; |
| 1885 | disconnected = true; |
| 1886 | } |
| 1887 | |
| 1888 | if(!disconnected && wasRunning) |
| 1889 | msgs = r->GetDebugMessages(); |
| 1890 | } |
| 1891 | else |
| 1892 | { |
| 1893 | msgs = r->GetDebugMessages(); |
| 1894 | } |
| 1895 | |
| 1896 | GUIInvoke::call(this, [this, msgs] { |
| 1897 | if(m_Ctx.Replay().CurrentRemote().IsValid() && |
| 1898 | !m_Ctx.Replay().CurrentRemote().IsServerRunning()) |
| 1899 | contextChooser->setIcon(Icons::cross()); |
| 1900 | |
| 1901 | if(!msgs.empty()) |
| 1902 | { |
| 1903 | m_Ctx.AddMessages(msgs); |
| 1904 | } |
| 1905 | |
| 1906 | if(m_Ctx.UnreadMessageCount() > 0) |
| 1907 | m_messageAlternate = !m_messageAlternate; |
| 1908 | else |
| 1909 | m_messageAlternate = false; |
| 1910 | |
| 1911 | setCaptureHasErrors(!m_Ctx.DebugMessages().empty()); |
| 1912 | }); |
| 1913 | }); |
| 1914 | } |
nothing calls this directly
no test coverage detected