1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

feat(ui): output instructions when user tries to open a second instance

Fixes #3483
This commit is contained in:
anthony.bilinski 2017-09-14 00:00:38 -07:00
parent c49959711e
commit 48d65c269a

View File

@ -247,7 +247,7 @@ int main(int argc, char* argv[])
a->addLibraryPath("platforms"); a->addLibraryPath("platforms");
qDebug() << "built on: " << __TIME__ << __DATE__ << "(" << TIMESTAMP << ")"; qDebug() << "built on: " << __TIME__ << __DATE__ << "(" << TIMESTAMP << ")";
qDebug() << "commit: " << GIT_VERSION << "\n"; qDebug() << "commit: " << GIT_VERSION;
// Check whether we have an update waiting to be installed // Check whether we have an update waiting to be installed
@ -300,7 +300,12 @@ int main(int argc, char* argv[])
time_t event = ipc.postEvent(eventType, firstParam.toUtf8(), ipcDest); time_t event = ipc.postEvent(eventType, firstParam.toUtf8(), ipcDest);
// If someone else processed it, we're done here, no need to actually start qTox // If someone else processed it, we're done here, no need to actually start qTox
if (ipc.waitUntilAccepted(event, 2)) { if (ipc.waitUntilAccepted(event, 2)) {
qDebug() << "Event" << eventType << "was handled by other client."; if (eventType == "activate") {
qDebug() << "Another qTox instance is already running. If you want to start a second "
"instance, please start with a profile (qtox -p <profile name>).";
} else {
qDebug() << "Event" << eventType << "was handled by other client.";
}
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
} }