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

Welcome to Sonic Visualiser!

Sonic Visualiser is a program for viewing and exploring audio data for semantic music analysis and annotation.

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.

Before we start...

Sonic Visualiser needs to make occasional network requests to our servers.

This is in order to:

  • download metadata about available and installed plugins; and
  • find out when a newer version of Sonic Visualiser is available.

No personal or identifying information will be sent, and your use of the program will not be tracked.

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

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