# HG changeset patch # User Chris Cannam # Date 1386181899 0 # Node ID a67f0e5ec654c5b8328e01b165265988ea966b02 # Parent ab624c319eb7d7f942a241ae4622b91d2a97b8bc Add initial dialog / network permission tester; lower default zoom level diff -r ab624c319eb7 -r a67f0e5ec654 .hgsubstate --- a/.hgsubstate Wed Dec 04 18:22:59 2013 +0000 +++ b/.hgsubstate Wed Dec 04 18:31:39 2013 +0000 @@ -1,4 +1,4 @@ 236814e07bd07473958c1ff89103124536a0c3c8 dataquay -055ff09f7a0897863299642f7d14814a05fcd9ac svapp -23ecd10c2eb63af570fdc510c94ae66dd2992e0c svcore +febd49356ef308ee10f07257b239cf66742bfedc svapp +cc3f78e89df010bf6e87c735688738b980f51385 svcore cc6b219762614a33cf00614c4a6e200c0da8efe6 svgui diff -r ab624c319eb7 -r a67f0e5ec654 icons/qm-logo-larger.png Binary file icons/qm-logo-larger.png has changed diff -r ab624c319eb7 -r a67f0e5ec654 icons/qm-logo-smaller.png Binary file icons/qm-logo-smaller.png has changed diff -r ab624c319eb7 -r a67f0e5ec654 src/MainWindow.cpp --- a/src/MainWindow.cpp Wed Dec 04 18:22:59 2013 +0000 +++ b/src/MainWindow.cpp Wed Dec 04 18:31:39 2013 +0000 @@ -16,9 +16,11 @@ #include "../version.h" #include "MainWindow.h" +#include "NetworkPermissionTester.h" #include "Analyser.h" #include "framework/Document.h" +#include "framework/VersionTester.h" #include "view/Pane.h" #include "view/PaneStack.h" @@ -216,9 +218,23 @@ statusBar(); - // m_analyser = new Analyser(); + newSession(); - newSession(); + settings.beginGroup("MainWindow"); + settings.setValue("zoom-default", 512); + settings.endGroup(); + zoomDefault(); + + NetworkPermissionTester tester; + bool networkPermission = tester.havePermission(); + if (networkPermission) { + m_versionTester = new VersionTester + ("sonicvisualiser.org", "latest-tony-version.txt", TONY_VERSION); + connect(m_versionTester, SIGNAL(newerVersionAvailable(QString)), + this, SLOT(newerVersionAvailable(QString))); + } else { + m_versionTester = 0; + } } MainWindow::~MainWindow() diff -r ab624c319eb7 -r a67f0e5ec654 src/MainWindow.h --- a/src/MainWindow.h Wed Dec 04 18:22:59 2013 +0000 +++ b/src/MainWindow.h Wed Dec 04 18:31:39 2013 +0000 @@ -19,6 +19,7 @@ #include "framework/MainWindowBase.h" class Analyser; +class VersionTester; class MainWindow : public MainWindowBase { @@ -127,6 +128,7 @@ bool m_intelligentActionOn; // GF: !!! temporary KeyReference *m_keyReference; + VersionTester *m_versionTester; QString exportToSVL(QString path, Layer *layer); diff -r ab624c319eb7 -r a67f0e5ec654 src/NetworkPermissionTester.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/NetworkPermissionTester.cpp Wed Dec 04 18:31:39 2013 +0000 @@ -0,0 +1,88 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Tony + An intonation analysis and annotation tool + Centre for Digital Music, Queen Mary, University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#include "NetworkPermissionTester.h" + +#include "../version.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +bool +NetworkPermissionTester::havePermission() +{ + QSettings settings; + settings.beginGroup("Preferences"); + + QString tag = QString("network-permission-%1").arg(TONY_VERSION); + + bool permish = false; + + if (settings.contains(tag)) { + permish = settings.value(tag, false).toBool(); + } else { + + QDialog d; + d.setWindowTitle(QCoreApplication::translate + ("NetworkPermissionTester", + "Tony: a tool for melody annotation")); + + QGridLayout *layout = new QGridLayout; + d.setLayout(layout); + + QLabel *label = new QLabel; + label->setWordWrap(true); + label->setText + (QCoreApplication::translate + ("NetworkPermissionTester", + "

Tony: a tool for melody annotation

" + "

Tony is a program for computer-aided melody annotation.
This is a very preliminary release, with many unfinished and provisional features.

" + "

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.

" + "


" + "

Before we go on...

" + "

Tony needs to make occasional network requests to our servers.

" + "

This is to:

" + "
  • tell you when updates are available.
" + "

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

" + "

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

")); + layout->addWidget(label, 0, 0); + + QCheckBox *cb = new QCheckBox(QCoreApplication::translate("NetworkPermissionTester", "Allow this")); + cb->setChecked(true); + layout->addWidget(cb, 1, 0); + + QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok); + QObject::connect(bb, SIGNAL(accepted()), &d, SLOT(accept())); + layout->addWidget(bb, 2, 0); + + d.exec(); + + bool permish = cb->isChecked(); + settings.setValue(tag, permish); + } + + settings.endGroup(); + + return permish; +} + + + diff -r ab624c319eb7 -r a67f0e5ec654 src/NetworkPermissionTester.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/NetworkPermissionTester.h Wed Dec 04 18:31:39 2013 +0000 @@ -0,0 +1,27 @@ +/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ + +/* + Tony + An intonation analysis and annotation tool + Centre for Digital Music, Queen Mary, University of London. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#ifndef NETWORK_PERMISSION_TESTER_H +#define NETWORK_PERMISSION_TESTER_H + +class NetworkPermissionTester +{ +public: + NetworkPermissionTester() { } + bool havePermission(); +}; + +#endif + + diff -r ab624c319eb7 -r a67f0e5ec654 tony.qrc --- a/tony.qrc Wed Dec 04 18:22:59 2013 +0000 +++ b/tony.qrc Wed Dec 04 18:31:39 2013 +0000 @@ -64,6 +64,8 @@ icons/sharpen.png icons/help.png icons/cross.png + icons/qm-logo-larger.png + icons/qm-logo-smaller.png icons/tony-16x16.png icons/tony-22x22.png icons/tony-24x24.png diff -r ab624c319eb7 -r a67f0e5ec654 tonyapp.pro --- a/tonyapp.pro Wed Dec 04 18:22:59 2013 +0000 +++ b/tonyapp.pro Wed Dec 04 18:31:39 2013 +0000 @@ -71,10 +71,12 @@ RESOURCES += tony.qrc HEADERS += src/MainWindow.h \ + src/NetworkPermissionTester.h \ src/Analyser.h SOURCES += src/main.cpp \ src/Analyser.cpp \ + src/NetworkPermissionTester.cpp \ src/MainWindow.cpp QMAKE_INFO_PLIST = deploy/osx/Info.plist