comparison main/MainWindow.cpp @ 406:d70890996156 kiosk

Modifications for the Kiosk edition
author mathieub <mathieu.barthet@eecs.qmul.ac.uk>
date Tue, 22 Mar 2011 14:29:38 +0000
parents 487d208fadb3
children b3b9cc8f5466
comparison
equal deleted inserted replaced
388:5c4943eae166 406:d70890996156
159 m_activityLog(new ActivityLog()), 159 m_activityLog(new ActivityLog()),
160 m_keyReference(new KeyReference()) 160 m_keyReference(new KeyReference())
161 { 161 {
162 Profiler profiler("MainWindow::MainWindow"); 162 Profiler profiler("MainWindow::MainWindow");
163 163
164 setWindowTitle(tr("Sonic Visualiser")); 164 setWindowTitle(tr("Sonic Visualiser (Kiosk edition)"));
165 165
166 UnitDatabase *udb = UnitDatabase::getInstance(); 166 UnitDatabase *udb = UnitDatabase::getInstance();
167 udb->registerUnit("Hz"); 167 udb->registerUnit("Hz");
168 udb->registerUnit("dB"); 168 udb->registerUnit("dB");
169 udb->registerUnit("s"); 169 udb->registerUnit("s");
440 connect(action, SIGNAL(triggered()), this, SLOT(importMoreAudio())); 440 connect(action, SIGNAL(triggered()), this, SLOT(importMoreAudio()));
441 connect(this, SIGNAL(canImportMoreAudio(bool)), action, SLOT(setEnabled(bool))); 441 connect(this, SIGNAL(canImportMoreAudio(bool)), action, SLOT(setEnabled(bool)));
442 m_keyReference->registerShortcut(action); 442 m_keyReference->registerShortcut(action);
443 menu->addAction(action); 443 menu->addAction(action);
444 444
445 /* //removes the Export Audio File functionnality from the File menu
445 action = new QAction(tr("&Export Audio File..."), this); 446 action = new QAction(tr("&Export Audio File..."), this);
446 action->setStatusTip(tr("Export selection as an audio file")); 447 action->setStatusTip(tr("Export selection as an audio file"));
447 connect(action, SIGNAL(triggered()), this, SLOT(exportAudio())); 448 connect(action, SIGNAL(triggered()), this, SLOT(exportAudio()));
448 connect(this, SIGNAL(canExportAudio(bool)), action, SLOT(setEnabled(bool))); 449 connect(this, SIGNAL(canExportAudio(bool)), action, SLOT(setEnabled(bool)));
449 menu->addAction(action); 450 menu->addAction(action);
450 451
451 menu->addSeparator(); 452 menu->addSeparator();
453 */
452 454
453 action = new QAction(tr("Import Annotation &Layer..."), this); 455 action = new QAction(tr("Import Annotation &Layer..."), this);
454 action->setShortcut(tr("Ctrl+L")); 456 action->setShortcut(tr("Ctrl+L"));
455 action->setStatusTip(tr("Import layer data from an existing file")); 457 action->setStatusTip(tr("Import layer data from an existing file"));
456 connect(action, SIGNAL(triggered()), this, SLOT(importLayer())); 458 connect(action, SIGNAL(triggered()), this, SLOT(importLayer()));
2155 tr("<b>File open failed</b><p>Audio file \"%1\" could not be opened").arg(path)); 2157 tr("<b>File open failed</b><p>Audio file \"%1\" could not be opened").arg(path));
2156 } 2158 }
2157 } 2159 }
2158 } 2160 }
2159 2161
2162 /*
2160 void 2163 void
2161 MainWindow::exportAudio() 2164 MainWindow::exportAudio()
2162 { 2165 {
2163 if (!getMainModel()) return; 2166 if (!getMainModel()) return;
2164 2167
2322 } 2325 }
2323 } else { 2326 } else {
2324 QMessageBox::critical(this, tr("Failed to write file"), error); 2327 QMessageBox::critical(this, tr("Failed to write file"), error);
2325 } 2328 }
2326 } 2329 }
2330 */
2327 2331
2328 void 2332 void
2329 MainWindow::importLayer() 2333 MainWindow::importLayer()
2330 { 2334 {
2331 Pane *pane = m_paneStack->getCurrentPane(); 2335 Pane *pane = m_paneStack->getCurrentPane();
2617 m_document = 0; 2621 m_document = 0;
2618 m_viewManager->clearSelections(); 2622 m_viewManager->clearSelections();
2619 m_timeRulerLayer = 0; // document owned this 2623 m_timeRulerLayer = 0; // document owned this
2620 2624
2621 m_sessionFile = ""; 2625 m_sessionFile = "";
2622 setWindowTitle(tr("Sonic Visualiser")); 2626 setWindowTitle(tr("Sonic Visualiser (Kiosk edition)"));
2623 2627
2624 CommandHistory::getInstance()->clear(); 2628 CommandHistory::getInstance()->clear();
2625 CommandHistory::getInstance()->documentSaved(); 2629 CommandHistory::getInstance()->documentSaved();
2626 documentRestored(); 2630 documentRestored();
2627 } 2631 }
2987 2991
2988 if (!saveSessionFile(path)) { 2992 if (!saveSessionFile(path)) {
2989 QMessageBox::critical(this, tr("Failed to save file"), 2993 QMessageBox::critical(this, tr("Failed to save file"),
2990 tr("<b>Save failed</b><p>Session file \"%1\" could not be saved.").arg(path)); 2994 tr("<b>Save failed</b><p>Session file \"%1\" could not be saved.").arg(path));
2991 } else { 2995 } else {
2992 setWindowTitle(tr("Sonic Visualiser: %1") 2996 setWindowTitle(tr("Sonic Visualiser (Kiosk edition): %1")
2993 .arg(QFileInfo(path).fileName())); 2997 .arg(QFileInfo(path).fileName()));
2994 m_sessionFile = path; 2998 m_sessionFile = path;
2995 CommandHistory::getInstance()->documentSaved(); 2999 CommandHistory::getInstance()->documentSaved();
2996 documentRestored(); 3000 documentRestored();
2997 m_recentFiles.addFile(path); 3001 m_recentFiles.addFile(path);
3970 #endif // SVNREV 3974 #endif // SVNREV
3971 #endif // SV_VERSION 3975 #endif // SV_VERSION
3972 3976
3973 QString aboutText; 3977 QString aboutText;
3974 3978
3975 aboutText += tr("<h3>About Sonic Visualiser</h3>"); 3979 aboutText += tr("<h3>About Sonic Visualiser (Kiosk edition)</h3>");
3976 aboutText += tr("<p>Sonic Visualiser is a program for viewing and exploring audio data for semantic music analysis and annotation.<br><a href=\"http://www.sonicvisualiser.org/\">http://www.sonicvisualiser.org/</a></p>"); 3980 aboutText += tr("<p>Sonic Visualiser is a program for viewing and exploring audio data for semantic music analysis and annotation. The Kiosk edition provides all of the features of the full Sonic Visualiser, except that audio files cannot be saved from it. <br><a href=\"http://www.sonicvisualiser.org/\">http://www.sonicvisualiser.org/</a></p>");
3977 aboutText += tr("<p><small>%1 : %2 configuration</small></p>") 3981 aboutText += tr("<p><small>%1 : %2 configuration</small></p>")
3978 .arg(version) 3982 .arg(version)
3979 .arg(debug ? tr("Debug") : tr("Release")); 3983 .arg(debug ? tr("Debug") : tr("Release"));
3980 3984
3981 aboutText += "<small>"; 3985 aboutText += "<small>";