refactor: move ClientApp::handleScreenError / ServerApp::handleScreenError to base App Class
This commit is contained in:
parent
229fedf347
commit
b2eb3a036d
6 changed files with 8 additions and 14 deletions
|
|
@ -184,6 +184,12 @@ void App::initApp(int argc, const char **argv)
|
||||||
loadConfig();
|
loadConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void App::handleScreenError() const
|
||||||
|
{
|
||||||
|
LOG((CLOG_CRIT "error on screen"));
|
||||||
|
getEvents()->addEvent(Event(EventTypes::Quit));
|
||||||
|
}
|
||||||
|
|
||||||
void App::runEventsLoop(void *)
|
void App::runEventsLoop(void *)
|
||||||
{
|
{
|
||||||
m_events->loop();
|
m_events->loop();
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,8 @@ public:
|
||||||
return *s_instance;
|
return *s_instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handleScreenError() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void runEventsLoop(void *);
|
void runEventsLoop(void *);
|
||||||
void (*m_bye)(int);
|
void (*m_bye)(int);
|
||||||
|
|
|
||||||
|
|
@ -200,12 +200,6 @@ void ClientApp::updateStatus(const std::string_view &) const
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientApp::handleScreenError()
|
|
||||||
{
|
|
||||||
LOG((CLOG_CRIT "error on screen"));
|
|
||||||
getEvents()->addEvent(Event(EventTypes::Quit));
|
|
||||||
}
|
|
||||||
|
|
||||||
deskflow::Screen *ClientApp::openClientScreen()
|
deskflow::Screen *ClientApp::openClientScreen()
|
||||||
{
|
{
|
||||||
deskflow::Screen *screen = createScreen();
|
deskflow::Screen *screen = createScreen();
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,6 @@ public:
|
||||||
|
|
||||||
void updateStatus() const;
|
void updateStatus() const;
|
||||||
void updateStatus(const std::string_view &) const;
|
void updateStatus(const std::string_view &) const;
|
||||||
void handleScreenError();
|
|
||||||
deskflow::Screen *openClientScreen();
|
deskflow::Screen *openClientScreen();
|
||||||
void closeClientScreen(deskflow::Screen *screen);
|
void closeClientScreen(deskflow::Screen *screen);
|
||||||
void handleClientRestart(const Event &, EventQueueTimer *vtimer);
|
void handleClientRestart(const Event &, EventQueueTimer *vtimer);
|
||||||
|
|
|
||||||
|
|
@ -519,12 +519,6 @@ PrimaryClient *ServerApp::openPrimaryClient(const std::string &name, deskflow::S
|
||||||
return new PrimaryClient(name, screen);
|
return new PrimaryClient(name, screen);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerApp::handleScreenError()
|
|
||||||
{
|
|
||||||
LOG((CLOG_CRIT "error on screen"));
|
|
||||||
getEvents()->addEvent(Event(EventTypes::Quit));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerApp::handleSuspend()
|
void ServerApp::handleSuspend()
|
||||||
{
|
{
|
||||||
if (!m_suspended) {
|
if (!m_suspended) {
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,6 @@ public:
|
||||||
void retryHandler();
|
void retryHandler();
|
||||||
deskflow::Screen *openServerScreen();
|
deskflow::Screen *openServerScreen();
|
||||||
PrimaryClient *openPrimaryClient(const std::string &name, deskflow::Screen *screen);
|
PrimaryClient *openPrimaryClient(const std::string &name, deskflow::Screen *screen);
|
||||||
void handleScreenError();
|
|
||||||
void handleSuspend();
|
void handleSuspend();
|
||||||
void handleResume();
|
void handleResume();
|
||||||
ClientListener *openClientListener(const NetworkAddress &address);
|
ClientListener *openClientListener(const NetworkAddress &address);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue