Mercurial > hg > sonic-visualiser
changeset 1613:3f6c18fcc075
Rework network permission tester to note that aggregate info may be used, and tweak for clarity
author | Chris Cannam |
---|---|
date | Sat, 25 Feb 2017 19:24:13 +0000 (2017-02-25) |
parents | 21befacf6cae |
children | e5ead8c8f5ed |
files | main/MainWindow.cpp main/NetworkPermissionTester.cpp main/NetworkPermissionTester.h |
diffstat | 3 files changed, 40 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/main/MainWindow.cpp Fri Feb 24 15:57:13 2017 +0000 +++ b/main/MainWindow.cpp Sat Feb 25 19:24:13 2017 +0000 @@ -319,7 +319,7 @@ connect(m_midiInput, SIGNAL(eventsAvailable()), this, SLOT(midiEventsAvailable())); - NetworkPermissionTester tester; + NetworkPermissionTester tester(withOSCSupport); bool networkPermission = tester.havePermission(); if (networkPermission) { if (withOSCSupport) {
--- a/main/NetworkPermissionTester.cpp Fri Feb 24 15:57:13 2017 +0000 +++ b/main/NetworkPermissionTester.cpp Sat Feb 25 19:24:13 2017 +0000 @@ -46,24 +46,43 @@ QGridLayout *layout = new QGridLayout; d.setLayout(layout); + QString preamble; + preamble = QCoreApplication::translate + ("NetworkPermissionTester", + "<h2>Welcome to Sonic Visualiser!</h2>" + "<p><img src=\":icons/qm-logo-smaller.png\" style=\"float:right\">Sonic Visualiser is a program for viewing and exploring audio data for semantic music analysis and annotation.</p>" + "<p>Developed in the Centre for Digital Music at Queen Mary University of London, Sonic Visualiser is open source software under the GNU General Public License.</p>" + "<p><hr></p>" + "<p><b>Before we go on...</b></p>" + "<p>Sonic Visualiser would like permission to use the network.</p>"); + + QString bullets; + if (m_withOSC) { + bullets = QCoreApplication::translate + ("NetworkPermissionTester", + "<p>This is to:</p>" + "<ul><li> Find information about available and installed plugins;</li>" + "<li> Support the use of Open Sound Control; and</li>" + "<li> Tell you when updates are available.</li>" + "</ul>"); + } else { + bullets = QCoreApplication::translate + ("NetworkPermissionTester", + "<p>This is to:</p>" + "<ul><li> Find information about available and installed plugins; and</li>" + "<li> Tell you when updates are available.</li>" + "</ul>"); + } + + QString postamble; + postamble = QCoreApplication::translate + ("NetworkPermissionTester", + "<p><b>No personal information will be sent, no tracking is carried out, and no individual information will be shared with anyone else.</b> We will however make aggregate counts of distinct requests for usage reporting.</p>" + "<p>We recommend that you allow this, because it makes Sonic Visualiser more useful to you and supports the public funding of this work. But if you do not wish to allow it, please un-check the box below.<br></p>"); + QLabel *label = new QLabel; label->setWordWrap(true); - label->setText - (QCoreApplication::translate - ("NetworkPermissionTester", - "<h2>Welcome to Sonic Visualiser!</h2>" - "<p><img src=\":icons/qm-logo-smaller.png\" style=\"float:right\">Sonic Visualiser is a program for viewing and exploring audio data for semantic music analysis and annotation.</p>" - "<p>Developed in the Centre for Digital Music at Queen Mary, University of London, Sonic Visualiser is provided free as open source software under the GNU General Public License.</p>" - "<p><hr></p>" - "<p><b>Before we go on...</b></p>" - "<p>Sonic Visualiser would like to make networking connections and open a network port.</p>" - "<p>This is to:</p>" - "<ul><li> Find information about available and installed plugins;</li>" - "<li> Support the use of Open Sound Control, where configured; and</li>" - "<li> Tell you when updates are available.</li>" - "</ul>" - "<p>No personal information will be sent, no tracking is carried out, and all requests happen in the background without interrupting your work.</p>" - "<p>We recommend that you allow this, because it makes Sonic Visualiser more useful. But if you do not wish to do so, please un-check the box below.<br></p>")); + label->setText(preamble + bullets + postamble); layout->addWidget(label, 0, 0); QCheckBox *cb = new QCheckBox(QCoreApplication::translate("NetworkPermissionTester", "Allow this"));
--- a/main/NetworkPermissionTester.h Fri Feb 24 15:57:13 2017 +0000 +++ b/main/NetworkPermissionTester.h Sat Feb 25 19:24:13 2017 +0000 @@ -18,8 +18,11 @@ class NetworkPermissionTester { public: - NetworkPermissionTester() { } + NetworkPermissionTester(bool withOSCSupport) : m_withOSC(withOSCSupport) { } bool havePermission(); + +private: + bool m_withOSC; }; #endif