mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-21 14:03:11 -07:00
Detect Remote Disconnect
This commit is contained in:
parent
389676899c
commit
bea03d667a
11 changed files with 91 additions and 12 deletions
|
@ -94,7 +94,7 @@ class StreamSession : public QObject
|
|||
|
||||
signals:
|
||||
void CurrentImageUpdated();
|
||||
void SessionQuit(ChiakiQuitReason reason);
|
||||
void SessionQuit(ChiakiQuitReason reason, const QString &reason_str);
|
||||
|
||||
private slots:
|
||||
#if CHIAKI_GUI_ENABLE_QT_GAMEPAD
|
||||
|
|
|
@ -46,7 +46,7 @@ class StreamWindow: public QMainWindow
|
|||
|
||||
private slots:
|
||||
void FramesAvailable();
|
||||
void SessionQuit(ChiakiQuitReason reason);
|
||||
void SessionQuit(ChiakiQuitReason reason, const QString &reason_str);
|
||||
};
|
||||
|
||||
#endif // CHIAKI_GUI_STREAMWINDOW_H
|
||||
|
|
|
@ -71,7 +71,7 @@ int main(int argc, char *argv[])
|
|||
connect_info.did = parser.value(did_option);
|
||||
|
||||
chiaki_connect_video_profile_preset(&connect_info.video_profile,
|
||||
CHIAKI_VIDEO_RESOLUTION_PRESET_540p,
|
||||
CHIAKI_VIDEO_RESOLUTION_PRESET_360p,
|
||||
CHIAKI_VIDEO_FPS_PRESET_30);
|
||||
|
||||
if(connect_info.registkey.isEmpty() || connect_info.ostype.isEmpty() || connect_info.auth.isEmpty() || connect_info.morning.isEmpty() || connect_info.did.isEmpty())
|
||||
|
|
|
@ -257,7 +257,7 @@ void StreamSession::Event(ChiakiEvent *event)
|
|||
switch(event->type)
|
||||
{
|
||||
case CHIAKI_EVENT_QUIT:
|
||||
emit SessionQuit(event->quit.reason);
|
||||
emit SessionQuit(event->quit.reason, event->quit.reason_str ? QString::fromUtf8(event->quit.reason_str) : QString());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,10 +83,13 @@ void StreamWindow::FramesAvailable()
|
|||
}
|
||||
}
|
||||
|
||||
void StreamWindow::SessionQuit(ChiakiQuitReason reason)
|
||||
void StreamWindow::SessionQuit(ChiakiQuitReason reason, const QString &reason_str)
|
||||
{
|
||||
if(reason == CHIAKI_QUIT_REASON_STOPPED)
|
||||
return;
|
||||
QMessageBox::critical(this, tr("Session has quit"), tr("Chiaki Session has quit:") + "\n" + chiaki_quit_reason_string(reason));
|
||||
QString m = tr("Chiaki Session has quit") + ":\n" + chiaki_quit_reason_string(reason);
|
||||
if(!reason_str.isEmpty())
|
||||
m += "\n" + tr("Reason") + ": \"" + reason_str + "\"";
|
||||
QMessageBox::critical(this, tr("Session has quit"), m);
|
||||
close();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue