# HG changeset patch # User Chris Cannam # Date 1484056686 0 # Node ID 47a18e281a93ece53e546991b89d52a049cd717f # Parent ea6c44afb68f06a4e8954253776bb9f8f0eab74f Add "What's New" to help menu; primp up About box diff -r ea6c44afb68f -r 47a18e281a93 CHANGELOG --- a/CHANGELOG Tue Jan 10 11:28:35 2017 +0000 +++ b/CHANGELOG Tue Jan 10 13:58:06 2017 +0000 @@ -1,8 +1,8 @@ Changes in Sonic Visualiser 3.0 since the previous release 2.5: - - Add the ability to record audio, and the ability to change the - audio device for playback or recording in the preferences + - Add ability to record audio, and ability to change the audio device + for playback or recording in the preferences - Add complete support for high-resolution (Hi-DPI or retina) displays, including for layer data rendering as well as UI controls @@ -46,6 +46,9 @@ - Switch to using combined level/pan controls in layer property boxes and for the main volume control + - Fix a number of problems on Windows with loading and saving some + file formats to filenames not representable in system codepage + - Finally switch the Windows built to 64-bit by default (with adapters to run either 32- or 64-bit plugins) @@ -306,7 +309,7 @@ - Various other bug fixes. -Changes in Sonic Visualiser 1.5 since the previous version 1.4: +Changes in Sonic Visualiser 1.5 since the previous release 1.4: - You can now insert time instants, time values, and notes using a MIDI device during playback. If a time value or note layer is @@ -347,7 +350,7 @@ been fixed. -New features in Sonic Visualiser 1.4 since the previous version 1.3: +Changes in Sonic Visualiser 1.4 since the previous release 1.3: - SV now has a Region layer type, used for display of features with durations. It also supports Vamp v2.0 plugins that provide durations @@ -377,7 +380,7 @@ - Several crashes and other bugs have been fixed. -Changes in Sonic Visualiser 1.3 since the previous version 1.2: +Changes in Sonic Visualiser 1.3 since the previous release 1.2: - There is a new spreadsheet-style data viewer and editor for viewing and editing the data in some types of annotation layer. @@ -396,7 +399,7 @@ - Several other bug fixes. -New features in Sonic Visualiser 1.2, since the previous version 1.0: +Changes in Sonic Visualiser 1.2, since the previous release 1.0: - SV now supports time-alignment of multiple performances of a work loaded at the same time. This option is enabled when the MATCH Vamp diff -r ea6c44afb68f -r 47a18e281a93 main/MainWindow.cpp --- a/main/MainWindow.cpp Tue Jan 10 11:28:35 2017 +0000 +++ b/main/MainWindow.cpp Tue Jan 10 13:58:06 2017 +0000 @@ -124,6 +124,7 @@ #include #include #include +#include #include #include @@ -1785,6 +1786,11 @@ connect(action, SIGNAL(triggered()), this, SLOT(website())); menu->addAction(action); + action = new QAction(tr("What's &New?").arg(name), this); + action->setStatusTip(tr("Show changes in this release of %1").arg(name)); + connect(action, SIGNAL(triggered()), this, SLOT(whatsNew())); + menu->addAction(action); + action = new QAction(tr("&About %1").arg(name), this); action->setStatusTip(tr("Show information about %1").arg(name)); connect(action, SIGNAL(triggered()), this, SLOT(about())); @@ -3277,6 +3283,7 @@ tr("Template file exists

The template \"%1\" already exists.
Overwrite it?").arg(name), QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel) != QMessageBox::Ok) { + delete d; return; } } @@ -3287,6 +3294,8 @@ } } } + + delete d; } void @@ -4744,6 +4753,61 @@ } void +MainWindow::whatsNew() +{ + QFile changelog(":CHANGELOG"); + changelog.open(QFile::ReadOnly); + QByteArray content = changelog.readAll(); + QString text = QString::fromUtf8(content); + + QDialog *d = new QDialog(this); + d->setWindowTitle(tr("What's New")); + + QGridLayout *layout = new QGridLayout; + d->setLayout(layout); + + int row = 0; + + QLabel *iconLabel = new QLabel; + iconLabel->setPixmap(QApplication::windowIcon().pixmap(64, 64)); + layout->addWidget(iconLabel, row, 0); + + layout->addWidget + (new QLabel(tr("

What's New in %1

") + .arg(QApplication::applicationName())), + row++, 1); + layout->setColumnStretch(2, 10); + + QTextEdit *textEdit = new QTextEdit; + layout->addWidget(textEdit, row++, 1, 1, 2); + + if (m_newerVersionIs != "") { + layout->addWidget(new QLabel(tr("Note: A newer version of Sonic Visualiser is available.
(Version %1 is available; you are using version %2)").arg(m_newerVersionIs).arg(SV_VERSION)), row++, 1, 1, 2); + } + + QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok); + layout->addWidget(bb, row++, 0, 1, 3); + connect(bb, SIGNAL(accepted()), d, SLOT(accept())); + + text.replace(QRegExp("(.)\n +(.)"), "\\1 \\2"); + text.replace(QRegExp("\n - ([^\n]+)"), "\n
  • \\1
  • "); + text.replace(QRegExp(": *\n"), ":\n
      \n"); + text.replace(QRegExp("\n\\s*\n"), "\n
    \n\n"); + text.replace(QRegExp("\n(\\w[^:\n]+:)"), "\n

    \\1

    "); +// text.replace(QRegExp("
  • ([^,.\n]+)([,.] +\\w)"), "
  • \\1\\2"); + + textEdit->setHtml(text); + textEdit->setReadOnly(true); + + d->setMinimumSize(m_viewManager->scalePixelSize(420), + m_viewManager->scalePixelSize(400)); + + d->exec(); + + delete d; +} + +void MainWindow::about() { bool debug = false; @@ -4773,10 +4837,16 @@ .arg(debug ? tr("Debug") : tr("Release")) .arg(sizeof(void *) * 8); - aboutText += ""; + if (m_oscQueue && m_oscQueue->isOK()) { + aboutText += tr("

    The OSC URL for this instance is: \"%1\"").arg(m_oscQueue->getOSCURL()); + } + + aboutText += "

    "; aboutText += tr("With Qt v%1 © The Qt Company").arg(QT_VERSION_STR); + aboutText += ""; + #ifdef HAVE_JACK #ifdef JACK_VERSION aboutText += tr("
    With JACK audio output library v%1 © Paul Davis and Jack O'Quin").arg(JACK_VERSION); @@ -4856,17 +4926,9 @@ aboutText += tr("
    With liblo Lite OSC library © Steve Harris"); #endif // LIBLO_VERSION - if (m_oscQueue && m_oscQueue->isOK()) { - aboutText += tr("

    The OSC URL for this instance is: \"%1\"").arg(m_oscQueue->getOSCURL()); - } - aboutText += "

    "; #endif // HAVE_LIBLO -#ifndef BUILD_STATIC - aboutText.replace(tr("With "), tr("Using ")); -#endif - aboutText += "

    Sonic Visualiser Copyright © 2005–2017 Chris Cannam and " "Queen Mary, University of London.

    " @@ -4875,8 +4937,62 @@ "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.

    "; + + // use our own dialog so we can influence the size + + QDialog *d = new QDialog(this); + + d->setWindowTitle(tr("About %1").arg(QApplication::applicationName())); + + QGridLayout *layout = new QGridLayout; + d->setLayout(layout); + + int row = 0; - QMessageBox::about(this, tr("About Sonic Visualiser"), aboutText); + QLabel *iconLabel = new QLabel; + iconLabel->setPixmap(QApplication::windowIcon().pixmap(64, 64)); + layout->addWidget(iconLabel, row, 0, Qt::AlignTop); + + QLabel *mainText = new QLabel(); + layout->addWidget(mainText, row, 1, 1, 2); + + layout->setRowStretch(row, 10); + layout->setColumnStretch(1, 10); + + ++row; + + QDialogButtonBox *bb = new QDialogButtonBox(QDialogButtonBox::Ok); + layout->addWidget(bb, row++, 0, 1, 3); + connect(bb, SIGNAL(accepted()), d, SLOT(accept())); + +// mainText->setHtml(aboutText); +// mainText->setReadOnly(true); + mainText->setWordWrap(true); + mainText->setOpenExternalLinks(true); + mainText->setText(aboutText); + + d->setMinimumSize(m_viewManager->scalePixelSize(420), + m_viewManager->scalePixelSize(200)); + + d->exec(); + + delete d; + /* + QMessageBox about(QMessageBox::Information, + tr("About Sonic Visualiser"), + aboutText, + QMessageBox::StandardButtons(QMessageBox::Ok), + this); + + QIcon icon = QApplication::windowIcon(); + QSize size = icon.actualSize(QSize(64, 64)); + about.setIconPixmap(icon.pixmap(size)); + + about.setMinimumSize(m_viewManager->scalePixelSize(400), + m_viewManager->scalePixelSize(400)); + + about.exec(); + */ } void @@ -4888,6 +5004,8 @@ void MainWindow::newerVersionAvailable(QString version) { + m_newerVersionIs = version; + QSettings settings; settings.beginGroup("NewerVersionWarning"); QString tag = QString("version-%1-available-show").arg(version); diff -r ea6c44afb68f -r 47a18e281a93 main/MainWindow.h --- a/main/MainWindow.h Tue Jan 10 11:28:35 2017 +0000 +++ b/main/MainWindow.h Tue Jan 10 13:58:06 2017 +0000 @@ -163,12 +163,12 @@ virtual void website(); virtual void help(); virtual void about(); + virtual void whatsNew(); virtual void keyReference(); virtual void newerVersionAvailable(QString); protected: Overview *m_overview; -//!!! Fader *m_fader; LevelPanToolButton *m_mainLevelPan; AudioDial *m_playSpeed; WaveformLayer *m_panLayer; @@ -230,6 +230,7 @@ Surveyer *m_surveyer; VersionTester *m_versionTester; + QString m_newerVersionIs; struct LayerConfiguration { LayerConfiguration(LayerFactory::LayerType _layer diff -r ea6c44afb68f -r 47a18e281a93 sonic-visualiser.qrc --- a/sonic-visualiser.qrc Tue Jan 10 11:28:35 2017 +0000 +++ b/sonic-visualiser.qrc Tue Jan 10 13:58:06 2017 +0000 @@ -176,5 +176,10 @@ i18n/sonic-visualiser_en_US.qm i18n/sonic-visualiser_cs_CZ.qm i18n/tips_en.xml + README + README.OSC + CHANGELOG + COPYING + CITATION