comparison main/MainWindow.cpp @ 418:af775c7b929b feature_150_menu_arrangement

Minimal menu changes for feature #150
author Chris Cannam
date Thu, 28 Apr 2011 15:08:38 +0100
parents aa8117d79702
children 67941a9bb202
comparison
equal deleted inserted replaced
415:aa8117d79702 418:af775c7b929b
386 action->setStatusTip(tr("Abandon the current Sonic Visualiser session and start a new one")); 386 action->setStatusTip(tr("Abandon the current Sonic Visualiser session and start a new one"));
387 connect(action, SIGNAL(triggered()), this, SLOT(newSession())); 387 connect(action, SIGNAL(triggered()), this, SLOT(newSession()));
388 m_keyReference->registerShortcut(action); 388 m_keyReference->registerShortcut(action);
389 menu->addAction(action); 389 menu->addAction(action);
390 toolbar->addAction(action); 390 toolbar->addAction(action);
391 391 /*
392 icon = il.load("fileopensession"); 392 icon = il.load("fileopensession");
393 action = new QAction(icon, tr("&Open Session..."), this); 393 action = new QAction(icon, tr("&Open Session..."), this);
394 action->setShortcut(tr("Ctrl+O")); 394 action->setShortcut(tr("Ctrl+O"));
395 action->setStatusTip(tr("Open a previously saved Sonic Visualiser session file")); 395 action->setStatusTip(tr("Open a previously saved Sonic Visualiser session file"));
396 connect(action, SIGNAL(triggered()), this, SLOT(openSession())); 396 connect(action, SIGNAL(triggered()), this, SLOT(openSession()));
397 m_keyReference->registerShortcut(action); 397 m_keyReference->registerShortcut(action);
398 menu->addAction(action); 398 menu->addAction(action);
399 399 */
400 icon = il.load("fileopen"); 400 icon = il.load("fileopen");
401 icon.addPixmap(il.loadPixmap("fileopen-22")); 401 icon.addPixmap(il.loadPixmap("fileopen-22"));
402
403 action = new QAction(icon, tr("&Open..."), this); 402 action = new QAction(icon, tr("&Open..."), this);
403 action->setShortcut(tr("Ctrl+O"));
404 action->setStatusTip(tr("Open a session file, audio file, or layer")); 404 action->setStatusTip(tr("Open a session file, audio file, or layer"));
405 connect(action, SIGNAL(triggered()), this, SLOT(openSomething())); 405 connect(action, SIGNAL(triggered()), this, SLOT(openSomething()));
406 toolbar->addAction(action); 406 toolbar->addAction(action);
407 menu->addAction(action);
408
409 // We want this one to go on the toolbar now, if we add it at all,
410 // but on the menu later
411 QAction *iaction = new QAction(tr("&Import More Audio..."), this);
412 iaction->setShortcut(tr("Ctrl+I"));
413 iaction->setStatusTip(tr("Import an extra audio file into a new pane"));
414 connect(iaction, SIGNAL(triggered()), this, SLOT(importMoreAudio()));
415 connect(this, SIGNAL(canImportMoreAudio(bool)), iaction, SLOT(setEnabled(bool)));
416 m_keyReference->registerShortcut(iaction);
417
418 action = new QAction(tr("Open Lo&cation..."), this);
419 action->setShortcut(tr("Ctrl+Shift+O"));
420 action->setStatusTip(tr("Open or import a file from a remote URL"));
421 connect(action, SIGNAL(triggered()), this, SLOT(openLocation()));
422 m_keyReference->registerShortcut(action);
423 menu->addAction(action);
424
425 m_recentFilesMenu = menu->addMenu(tr("&Recent Files"));
426 m_recentFilesMenu->setTearOffEnabled(true);
427 setupRecentFilesMenu();
428 connect(&m_recentFiles, SIGNAL(recentChanged()),
429 this, SLOT(setupRecentFilesMenu()));
430
431 menu->addSeparator();
407 432
408 icon = il.load("filesave"); 433 icon = il.load("filesave");
409 icon.addPixmap(il.loadPixmap("filesave-22")); 434 icon.addPixmap(il.loadPixmap("filesave-22"));
410 action = new QAction(icon, tr("&Save Session"), this); 435 action = new QAction(icon, tr("&Save Session"), this);
411 action->setShortcut(tr("Ctrl+S")); 436 action->setShortcut(tr("Ctrl+S"));
425 menu->addAction(action); 450 menu->addAction(action);
426 toolbar->addAction(action); 451 toolbar->addAction(action);
427 452
428 menu->addSeparator(); 453 menu->addSeparator();
429 454
455 /*
430 icon = il.load("fileopenaudio"); 456 icon = il.load("fileopenaudio");
431 action = new QAction(icon, tr("&Import Audio File..."), this); 457 action = new QAction(icon, tr("&Import Audio File..."), this);
432 action->setShortcut(tr("Ctrl+I")); 458 action->setShortcut(tr("Ctrl+I"));
433 action->setStatusTip(tr("Import an existing audio file")); 459 action->setStatusTip(tr("Import an existing audio file"));
434 connect(action, SIGNAL(triggered()), this, SLOT(importAudio())); 460 connect(action, SIGNAL(triggered()), this, SLOT(importAudio()));
435 m_keyReference->registerShortcut(action); 461 m_keyReference->registerShortcut(action);
436 menu->addAction(action); 462 menu->addAction(action);
437 463 */
438 action = new QAction(tr("Import Secondary Audio File..."), this); 464
439 action->setShortcut(tr("Ctrl+Shift+I")); 465 // the Import action we made earlier
440 action->setStatusTip(tr("Import an extra audio file as a separate layer")); 466 menu->addAction(iaction);
441 connect(action, SIGNAL(triggered()), this, SLOT(importMoreAudio()));
442 connect(this, SIGNAL(canImportMoreAudio(bool)), action, SLOT(setEnabled(bool)));
443 m_keyReference->registerShortcut(action);
444 menu->addAction(action);
445 467
446 action = new QAction(tr("&Export Audio File..."), this); 468 action = new QAction(tr("&Export Audio File..."), this);
447 action->setStatusTip(tr("Export selection as an audio file")); 469 action->setStatusTip(tr("Export selection as an audio file"));
448 connect(action, SIGNAL(triggered()), this, SLOT(exportAudio())); 470 connect(action, SIGNAL(triggered()), this, SLOT(exportAudio()));
449 connect(this, SIGNAL(canExportAudio(bool)), action, SLOT(setEnabled(bool))); 471 connect(this, SIGNAL(canExportAudio(bool)), action, SLOT(setEnabled(bool)));
473 connect(this, SIGNAL(canExportImage(bool)), action, SLOT(setEnabled(bool))); 495 connect(this, SIGNAL(canExportImage(bool)), action, SLOT(setEnabled(bool)));
474 menu->addAction(action); 496 menu->addAction(action);
475 497
476 menu->addSeparator(); 498 menu->addSeparator();
477 499
478 action = new QAction(tr("Open Lo&cation..."), this);
479 action->setShortcut(tr("Ctrl+Shift+O"));
480 action->setStatusTip(tr("Open or import a file from a remote URL"));
481 connect(action, SIGNAL(triggered()), this, SLOT(openLocation()));
482 m_keyReference->registerShortcut(action);
483 menu->addAction(action);
484
485 menu->addSeparator();
486
487 m_recentFilesMenu = menu->addMenu(tr("&Recent Files"));
488 m_recentFilesMenu->setTearOffEnabled(true);
489 setupRecentFilesMenu();
490 connect(&m_recentFiles, SIGNAL(recentChanged()),
491 this, SLOT(setupRecentFilesMenu()));
492
493 menu->addSeparator();
494 action = new QAction(tr("&Preferences..."), this); 500 action = new QAction(tr("&Preferences..."), this);
495 action->setStatusTip(tr("Adjust the application preferences")); 501 action->setStatusTip(tr("Adjust the application preferences"));
496 connect(action, SIGNAL(triggered()), this, SLOT(preferences())); 502 connect(action, SIGNAL(triggered()), this, SLOT(preferences()));
497 menu->addAction(action); 503 menu->addAction(action);
498 504