Chris@95: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@95: Chris@95: /* Chris@95: Tony Chris@95: An intonation analysis and annotation tool Chris@95: Centre for Digital Music, Queen Mary, University of London. Chris@95: Chris@95: This program is free software; you can redistribute it and/or Chris@95: modify it under the terms of the GNU General Public License as Chris@95: published by the Free Software Foundation; either version 2 of the Chris@95: License, or (at your option) any later version. See the file Chris@95: COPYING included with this distribution for more information. Chris@95: */ Chris@95: Chris@95: #include "NetworkPermissionTester.h" Chris@95: Chris@95: #include "../version.h" Chris@95: Chris@95: #include Chris@95: #include Chris@95: #include Chris@95: #include Chris@95: #include Chris@95: #include Chris@95: #include Chris@95: #include Chris@95: #include Chris@95: Chris@95: bool Chris@95: NetworkPermissionTester::havePermission() Chris@95: { Chris@95: QSettings settings; Chris@95: settings.beginGroup("Preferences"); Chris@95: Chris@95: QString tag = QString("network-permission-%1").arg(TONY_VERSION); Chris@95: Chris@95: bool permish = false; Chris@95: Chris@95: if (settings.contains(tag)) { Chris@95: permish = settings.value(tag, false).toBool(); Chris@95: } else { Chris@95: Chris@95: QDialog d; Chris@95: d.setWindowTitle(QCoreApplication::translate Chris@95: ("NetworkPermissionTester", Chris@95: "Tony: a tool for melody annotation")); Chris@95: Chris@95: QGridLayout *layout = new QGridLayout; Chris@95: d.setLayout(layout); Chris@95: Chris@95: QLabel *label = new QLabel; Chris@95: label->setWordWrap(true); Chris@95: label->setText Chris@95: (QCoreApplication::translate Chris@95: ("NetworkPermissionTester", Chris@95: "

Tony: a tool for melody annotation

" Chris@436: "

Tony is a program for computer-assisted pitch and note annotation of unaccompanied melody.

" Chris@95: "

Developed in the Centre for Digital Music at Queen Mary, University of London, Tony is provided free as open source software under the GNU General Public License.

" Chris@95: "


" Chris@95: "

Before we go on...

" Chris@95: "

Tony needs to make occasional network requests to our servers.

" Chris@95: "

This is to:

" Chris@95: "
  • tell you when updates are available.
" Chris@95: "

No personal information will be sent, no tracking is carried out, and all requests happen in the background without interrupting your work.

" Chris@95: "

We recommend that you allow this. But if you do not wish to do so, please un-check the box below.

")); Chris@95: layout->addWidget(label, 0, 0); Chris@95: Chris@95: QCheckBox *cb = new QCheckBox(QCoreApplication::translate("NetworkPermissionTester", "Allow this")); Chris@95: cb->setChecked(true); Chris@95: layout->addWidget(cb, 1, 0); Chris@95: Chris@95: QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok); Chris@95: QObject::connect(bb, SIGNAL(accepted()), &d, SLOT(accept())); Chris@95: layout->addWidget(bb, 2, 0); Chris@95: Chris@95: d.exec(); Chris@95: Chris@95: bool permish = cb->isChecked(); Chris@95: settings.setValue(tag, permish); Chris@95: } Chris@95: Chris@95: settings.endGroup(); Chris@95: Chris@95: return permish; Chris@95: } Chris@95: Chris@95: Chris@95: