chatgui/chatgui-android: уведомления со звуком, флаги и прочие улучшения UI
This commit is contained in:
1 parent
6c857ceab8
commit
0f308fdbd7
20 files changed
+292
-32
No files matched your search
@@ -18,6 +18,7 @@
|
||||
|
||||
#ifdef _WIN32
|
||||
static UtunNode* g_ctrl_node = nullptr;
|
||||
static MainWindow* g_mainWindow = nullptr;
|
||||
|
||||
static DWORD count_threads(void) {
|
||||
DWORD pid = GetCurrentProcessId(), count = 0;
|
||||
@@ -34,7 +35,12 @@ static DWORD count_threads(void) {
|
||||
|
||||
static BOOL WINAPI console_ctrl_handler(DWORD dwCtrlType) {
|
||||
if (dwCtrlType == CTRL_C_EVENT || dwCtrlType == CTRL_BREAK_EVENT) {
|
||||
if (g_ctrl_node) g_ctrl_node->requestStop();
|
||||
if (g_mainWindow)
|
||||
QMetaObject::invokeMethod(g_mainWindow, [g_mainWindow] {
|
||||
g_mainWindow->requestShutdown();
|
||||
}, Qt::QueuedConnection);
|
||||
else if (g_ctrl_node)
|
||||
g_ctrl_node->requestStop();
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
@@ -149,6 +155,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
#ifdef _WIN32
|
||||
g_ctrl_node = w.utunNode();
|
||||
g_mainWindow = &w;
|
||||
SetConsoleCtrlHandler(console_ctrl_handler, TRUE);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user