From baf991b342c42eaa487f26897f9231ca15f99908 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 18 Jan 2010 19:20:59 +0000 Subject: [PATCH] - The user must now press 'y' to accept the legal notice in nox mode (other keys will refuse and stop the program). Thanks Mariusz Fik --- src/main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index fc528062a..237229e4c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -102,11 +102,13 @@ public: #ifdef DISABLE_GUI std::cout << std::endl << "*** " << tr("Legal Notice").toLocal8Bit().data() << " ***" << std::endl; std::cout << tr("qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.\n\nNo further notices will be issued.").toLocal8Bit().data() << std::endl << std::endl; - std::cout << tr("Press any key to accept and continue...").toLocal8Bit().data() << std::endl; - getchar(); // Read pressed key - // Save the answer - settings.setValue(QString::fromUtf8("LegalNotice/Accepted"), true); - return true; + std::cout << tr("Press %1 key to accept and continue...").arg("'y'").toLocal8Bit().data() << std::endl; + char ret = getchar(); // Read pressed key + if(ret == 'y' || ret == 'Y') { + // Save the answer + settings.setValue(QString::fromUtf8("LegalNotice/Accepted"), true); + return true; + } #else QMessageBox msgBox; msgBox.setText(tr("qBittorrent is a file sharing program. When you run a torrent, its data will be made available to others by means of upload. Any content you share is your sole responsibility.\n\nNo further notices will be issued."));