17 #include "../version.h" 19 #include "base/Debug.h" 24 #include <QCoreApplication> 26 #include <QGridLayout> 28 #include <QDialogButtonBox> 35 settings.beginGroup(
"Preferences");
37 QString tag = QString(
"network-permission-%1").arg(SV_VERSION);
41 if (settings.contains(tag)) {
42 permish = settings.value(tag,
false).toBool();
43 SVDEBUG <<
"NetworkPermissionTester: Asked already, result was " << permish << endl;
45 SVDEBUG <<
"NetworkPermissionTester: Asking for permission" << endl;
48 d.setWindowTitle(QCoreApplication::translate(
"NetworkPermissionTester",
"Welcome to Sonic Visualiser"));
50 QGridLayout *layout =
new QGridLayout;
54 preamble = QCoreApplication::translate
55 (
"NetworkPermissionTester",
56 "<h2>Welcome to Sonic Visualiser!</h2>" 57 "<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>" 58 "<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>" 60 "<p><b>Before we go on...</b></p>" 61 "<p>Sonic Visualiser would like permission to use the network.</p>");
65 bullets = QCoreApplication::translate
66 (
"NetworkPermissionTester",
68 "<ul><li> Find information about available and installed plugins;</li>" 69 "<li> Support the use of Open Sound Control; and</li>" 70 "<li> Tell you when updates are available.</li>" 73 bullets = QCoreApplication::translate
74 (
"NetworkPermissionTester",
76 "<ul><li> Find information about available and installed plugins; and</li>" 77 "<li> Tell you when updates are available.</li>" 82 postamble = QCoreApplication::translate
83 (
"NetworkPermissionTester",
84 "<p><b>No personal information will be sent, no tracking is carried out, and no information will be shared with anyone else.</b></p>" 85 "<p>We recommend that you allow this, because it makes Sonic Visualiser more useful to you. But if you do not wish to allow it, please un-check the box below.<br></p>");
87 QLabel *label =
new QLabel;
88 label->setWordWrap(
true);
89 label->setText(preamble + bullets + postamble);
90 layout->addWidget(label, 0, 0);
92 QCheckBox *cb =
new QCheckBox(QCoreApplication::translate(
"NetworkPermissionTester",
"Allow this"));
94 layout->addWidget(cb, 1, 0);
96 QDialogButtonBox *bb =
new QDialogButtonBox(QDialogButtonBox::Ok);
97 QObject::connect(bb, SIGNAL(accepted()), &d, SLOT(accept()));
98 layout->addWidget(bb, 2, 0);
102 permish = cb->isChecked();
103 settings.setValue(tag, permish);
105 SVDEBUG <<
"NetworkPermissionTester: asked, answer was " << permish << endl;