comparison main/MainWindow.cpp @ 439:6d5ee6860682 toggle

Add a new feature to allow users to toggle between minimal and full modes. This is done by hiding/showing the pane stack, menu actions, and toolbars. The main part of the process is handled in MainWindow::toggleViewMode(). The toggle view mode option appears in the View Menu and is associated with a new toolbar button. Two icons have been added in the resources. They come from: http://www.iconfinder.com/icondetails/42115/32/ In a working state, but the resizing of the main window and the audio file overview can be improved. Some menus or menu actions can be deleted/disabled in the minimal mode (although the changes are active in the hidden pane(s) and do not cause the application to crash). See TO-DO list in MainWindow::toggleViewMode(). In sonic-visualiser.pro: -lvamp-hostsdk has been added to the LIBS (the sonic-visualiser.pro file may be to be removed from the tracked files since the modification seems to depend on the system).
author mathieub <mathieu.barthet@eecs.qmul.ac.uk>
date Tue, 21 Jun 2011 22:04:55 +0100
parents 868f73825b37
children 4d9e4053c120
comparison
equal deleted inserted replaced
438:868f73825b37 439:6d5ee6860682
156 m_playControlsSpacer(0), 156 m_playControlsSpacer(0),
157 m_playControlsWidth(0), 157 m_playControlsWidth(0),
158 m_preferencesDialog(0), 158 m_preferencesDialog(0),
159 m_layerTreeDialog(0), 159 m_layerTreeDialog(0),
160 m_activityLog(new ActivityLog()), 160 m_activityLog(new ActivityLog()),
161 m_keyReference(new KeyReference()) 161 m_keyReference(new KeyReference()),
162 m_fileMenu(0),
163 m_editMenu(0),
164 m_viewMenu(0),
165 m_helpMenu(0),
166 m_importAnnotationLayerAction(0),
167 m_exportAnnotationLayerAction(0),
168 m_showNoOverlaysAction(0),
169 m_showMinimalOverlaysAction(0),
170 m_showStandardOverlaysAction(0),
171 m_showAllOverlaysAction(0),
172 m_showAllTimeRulersAction(0),
173 m_showZoomWheelsAction(0),
174 m_showPropertyBoxesAction(0),
175 m_showStatusBarAction(0),
176 m_fileToolBar(0),
177 m_playbackToolBar(0),
178 m_viewToolBar(0),
179 m_playModeToolBar(0),
180 m_editToolBar(0),
181 m_toolsToolBar(0)
162 { 182 {
163 Profiler profiler("MainWindow::MainWindow"); 183 Profiler profiler("MainWindow::MainWindow");
164 184
165 setWindowTitle(tr("Sonic Visualiser")); 185 setWindowTitle(tr("Sonic Visualiser"));
166 186
369 void 389 void
370 MainWindow::setupFileMenu() 390 MainWindow::setupFileMenu()
371 { 391 {
372 if (m_mainMenusCreated) return; 392 if (m_mainMenusCreated) return;
373 393
374 QMenu *menu = menuBar()->addMenu(tr("&File")); 394 m_fileMenu = menuBar()->addMenu(tr("&File"));
375 menu->setTearOffEnabled(true); 395 m_fileMenu->setTearOffEnabled(true);
376 QToolBar *toolbar = addToolBar(tr("File Toolbar")); 396 m_fileToolBar = addToolBar(tr("File Toolbar"));
377 397
378 m_keyReference->setCategory(tr("File and Session Management")); 398 m_keyReference->setCategory(tr("File and Session Management"));
379 399
380 IconLoader il; 400 IconLoader il;
381 401
384 QAction *action = new QAction(icon, tr("&New Session"), this); 404 QAction *action = new QAction(icon, tr("&New Session"), this);
385 action->setShortcut(tr("Ctrl+N")); 405 action->setShortcut(tr("Ctrl+N"));
386 action->setStatusTip(tr("Abandon the current Sonic Visualiser session and start a new one")); 406 action->setStatusTip(tr("Abandon the current Sonic Visualiser session and start a new one"));
387 connect(action, SIGNAL(triggered()), this, SLOT(newSession())); 407 connect(action, SIGNAL(triggered()), this, SLOT(newSession()));
388 m_keyReference->registerShortcut(action); 408 m_keyReference->registerShortcut(action);
389 menu->addAction(action); 409 m_fileMenu->addAction(action);
390 toolbar->addAction(action); 410 m_fileToolBar->addAction(action);
391 411
392 icon = il.load("fileopensession"); 412 icon = il.load("fileopensession");
393 action = new QAction(icon, tr("&Open Session..."), this); 413 action = new QAction(icon, tr("&Open Session..."), this);
394 action->setShortcut(tr("Ctrl+O")); 414 action->setShortcut(tr("Ctrl+O"));
395 action->setStatusTip(tr("Open a previously saved Sonic Visualiser session file")); 415 action->setStatusTip(tr("Open a previously saved Sonic Visualiser session file"));
396 connect(action, SIGNAL(triggered()), this, SLOT(openSession())); 416 connect(action, SIGNAL(triggered()), this, SLOT(openSession()));
397 m_keyReference->registerShortcut(action); 417 m_keyReference->registerShortcut(action);
398 menu->addAction(action); 418 m_fileMenu->addAction(action);
399 419
400 icon = il.load("fileopen"); 420 icon = il.load("fileopen");
401 icon.addPixmap(il.loadPixmap("fileopen-22")); 421 icon.addPixmap(il.loadPixmap("fileopen-22"));
402 422
403 action = new QAction(icon, tr("&Open..."), this); 423 action = new QAction(icon, tr("&Open..."), this);
404 action->setStatusTip(tr("Open a session file, audio file, or layer")); 424 action->setStatusTip(tr("Open a session file, audio file, or layer"));
405 connect(action, SIGNAL(triggered()), this, SLOT(openSomething())); 425 connect(action, SIGNAL(triggered()), this, SLOT(openSomething()));
406 toolbar->addAction(action); 426 m_fileToolBar->addAction(action);
407 427
408 icon = il.load("filesave"); 428 icon = il.load("filesave");
409 icon.addPixmap(il.loadPixmap("filesave-22")); 429 icon.addPixmap(il.loadPixmap("filesave-22"));
410 action = new QAction(icon, tr("&Save Session"), this); 430 action = new QAction(icon, tr("&Save Session"), this);
411 action->setShortcut(tr("Ctrl+S")); 431 action->setShortcut(tr("Ctrl+S"));
412 action->setStatusTip(tr("Save the current session into a Sonic Visualiser session file")); 432 action->setStatusTip(tr("Save the current session into a Sonic Visualiser session file"));
413 connect(action, SIGNAL(triggered()), this, SLOT(saveSession())); 433 connect(action, SIGNAL(triggered()), this, SLOT(saveSession()));
414 connect(this, SIGNAL(canSave(bool)), action, SLOT(setEnabled(bool))); 434 connect(this, SIGNAL(canSave(bool)), action, SLOT(setEnabled(bool)));
415 m_keyReference->registerShortcut(action); 435 m_keyReference->registerShortcut(action);
416 menu->addAction(action); 436 m_fileMenu->addAction(action);
417 toolbar->addAction(action); 437 m_fileToolBar->addAction(action);
418 438
419 icon = il.load("filesaveas"); 439 icon = il.load("filesaveas");
420 icon.addPixmap(il.loadPixmap("filesaveas-22")); 440 icon.addPixmap(il.loadPixmap("filesaveas-22"));
421 action = new QAction(icon, tr("Save Session &As..."), this); 441 action = new QAction(icon, tr("Save Session &As..."), this);
422 action->setShortcut(tr("Ctrl+Shift+S")); 442 action->setShortcut(tr("Ctrl+Shift+S"));
423 action->setStatusTip(tr("Save the current session into a new Sonic Visualiser session file")); 443 action->setStatusTip(tr("Save the current session into a new Sonic Visualiser session file"));
424 connect(action, SIGNAL(triggered()), this, SLOT(saveSessionAs())); 444 connect(action, SIGNAL(triggered()), this, SLOT(saveSessionAs()));
425 menu->addAction(action); 445 m_fileMenu->addAction(action);
426 toolbar->addAction(action); 446 m_fileToolBar->addAction(action);
427 447
428 menu->addSeparator(); 448 m_fileMenu->addSeparator();
429 449
430 icon = il.load("fileopenaudio"); 450 icon = il.load("fileopenaudio");
431 action = new QAction(icon, tr("&Import Audio File..."), this); 451 action = new QAction(icon, tr("&Import Audio File..."), this);
432 action->setShortcut(tr("Ctrl+I")); 452 action->setShortcut(tr("Ctrl+I"));
433 action->setStatusTip(tr("Import an existing audio file")); 453 action->setStatusTip(tr("Import an existing audio file"));
434 connect(action, SIGNAL(triggered()), this, SLOT(importAudio())); 454 connect(action, SIGNAL(triggered()), this, SLOT(importAudio()));
435 m_keyReference->registerShortcut(action); 455 m_keyReference->registerShortcut(action);
436 menu->addAction(action); 456 m_fileMenu->addAction(action);
437 457
438 action = new QAction(tr("Import Secondary Audio File..."), this); 458 action = new QAction(tr("Import Secondary Audio File..."), this);
439 action->setShortcut(tr("Ctrl+Shift+I")); 459 action->setShortcut(tr("Ctrl+Shift+I"));
440 action->setStatusTip(tr("Import an extra audio file as a separate layer")); 460 action->setStatusTip(tr("Import an extra audio file as a separate layer"));
441 connect(action, SIGNAL(triggered()), this, SLOT(importMoreAudio())); 461 connect(action, SIGNAL(triggered()), this, SLOT(importMoreAudio()));
442 connect(this, SIGNAL(canImportMoreAudio(bool)), action, SLOT(setEnabled(bool))); 462 connect(this, SIGNAL(canImportMoreAudio(bool)), action, SLOT(setEnabled(bool)));
443 m_keyReference->registerShortcut(action); 463 m_keyReference->registerShortcut(action);
444 menu->addAction(action); 464 m_fileMenu->addAction(action);
445 465
446 action = new QAction(tr("&Export Audio File..."), this); 466 action = new QAction(tr("&Export Audio File..."), this);
447 action->setStatusTip(tr("Export selection as an audio file")); 467 action->setStatusTip(tr("Export selection as an audio file"));
448 connect(action, SIGNAL(triggered()), this, SLOT(exportAudio())); 468 connect(action, SIGNAL(triggered()), this, SLOT(exportAudio()));
449 connect(this, SIGNAL(canExportAudio(bool)), action, SLOT(setEnabled(bool))); 469 connect(this, SIGNAL(canExportAudio(bool)), action, SLOT(setEnabled(bool)));
450 menu->addAction(action); 470 m_fileMenu->addAction(action);
451 471
452 menu->addSeparator(); 472 m_fileMenu->addSeparator();
453 473
454 action = new QAction(tr("Import Annotation &Layer..."), this); 474 m_importAnnotationLayerAction = new QAction(tr("Import Annotation &Layer..."), this);
455 action->setShortcut(tr("Ctrl+L")); 475 m_importAnnotationLayerAction->setShortcut(tr("Ctrl+L"));
456 action->setStatusTip(tr("Import layer data from an existing file")); 476 m_importAnnotationLayerAction->setStatusTip(tr("Import layer data from an existing file"));
457 connect(action, SIGNAL(triggered()), this, SLOT(importLayer())); 477 connect(m_importAnnotationLayerAction, SIGNAL(triggered()), this, SLOT(importLayer()));
458 connect(this, SIGNAL(canImportLayer(bool)), action, SLOT(setEnabled(bool))); 478 connect(this, SIGNAL(canImportLayer(bool)), action, SLOT(setEnabled(bool)));
459 m_keyReference->registerShortcut(action); 479 m_keyReference->registerShortcut(m_importAnnotationLayerAction);
460 menu->addAction(action); 480 m_fileMenu->addAction(m_importAnnotationLayerAction);
461 481
462 action = new QAction(tr("Export Annotation Layer..."), this); 482 m_exportAnnotationLayerAction = new QAction(tr("Export Annotation Layer..."), this);
463 action->setStatusTip(tr("Export layer data to a file")); 483 m_exportAnnotationLayerAction->setStatusTip(tr("Export layer data to a file"));
464 connect(action, SIGNAL(triggered()), this, SLOT(exportLayer())); 484 connect(m_exportAnnotationLayerAction, SIGNAL(triggered()), this, SLOT(exportLayer()));
465 connect(this, SIGNAL(canExportLayer(bool)), action, SLOT(setEnabled(bool))); 485 connect(this, SIGNAL(canExportLayer(bool)), action, SLOT(setEnabled(bool)));
466 menu->addAction(action); 486 m_fileMenu->addAction(m_exportAnnotationLayerAction);
467 487
468 menu->addSeparator(); 488 m_fileMenu->addSeparator();
469 489
470 action = new QAction(tr("Export Image File..."), this); 490 action = new QAction(tr("Export Image File..."), this);
471 action->setStatusTip(tr("Export a single pane to an image file")); 491 action->setStatusTip(tr("Export a single pane to an image file"));
472 connect(action, SIGNAL(triggered()), this, SLOT(exportImage())); 492 connect(action, SIGNAL(triggered()), this, SLOT(exportImage()));
473 connect(this, SIGNAL(canExportImage(bool)), action, SLOT(setEnabled(bool))); 493 connect(this, SIGNAL(canExportImage(bool)), action, SLOT(setEnabled(bool)));
474 menu->addAction(action); 494 m_fileMenu->addAction(action);
475 495
476 menu->addSeparator(); 496 m_fileMenu->addSeparator();
477 497
478 action = new QAction(tr("Open Lo&cation..."), this); 498 action = new QAction(tr("Open Lo&cation..."), this);
479 action->setShortcut(tr("Ctrl+Shift+O")); 499 action->setShortcut(tr("Ctrl+Shift+O"));
480 action->setStatusTip(tr("Open or import a file from a remote URL")); 500 action->setStatusTip(tr("Open or import a file from a remote URL"));
481 connect(action, SIGNAL(triggered()), this, SLOT(openLocation())); 501 connect(action, SIGNAL(triggered()), this, SLOT(openLocation()));
482 m_keyReference->registerShortcut(action); 502 m_keyReference->registerShortcut(action);
483 menu->addAction(action); 503 m_fileMenu->addAction(action);
484 504
485 menu->addSeparator(); 505 m_fileMenu->addSeparator();
486 506
487 m_recentFilesMenu = menu->addMenu(tr("&Recent Files")); 507 m_recentFilesMenu = m_fileMenu->addMenu(tr("&Recent Files"));
488 m_recentFilesMenu->setTearOffEnabled(true); 508 m_recentFilesMenu->setTearOffEnabled(true);
489 setupRecentFilesMenu(); 509 setupRecentFilesMenu();
490 connect(&m_recentFiles, SIGNAL(recentChanged()), 510 connect(&m_recentFiles, SIGNAL(recentChanged()),
491 this, SLOT(setupRecentFilesMenu())); 511 this, SLOT(setupRecentFilesMenu()));
492 512
493 menu->addSeparator(); 513 m_fileMenu->addSeparator();
494 action = new QAction(tr("&Preferences..."), this); 514 action = new QAction(tr("&Preferences..."), this);
495 action->setStatusTip(tr("Adjust the application preferences")); 515 action->setStatusTip(tr("Adjust the application preferences"));
496 connect(action, SIGNAL(triggered()), this, SLOT(preferences())); 516 connect(action, SIGNAL(triggered()), this, SLOT(preferences()));
497 menu->addAction(action); 517 m_fileMenu->addAction(action);
498 518
499 menu->addSeparator(); 519 m_fileMenu->addSeparator();
500 action = new QAction(il.load("exit"), 520 action = new QAction(il.load("exit"),
501 tr("&Quit"), this); 521 tr("&Quit"), this);
502 action->setShortcut(tr("Ctrl+Q")); 522 action->setShortcut(tr("Ctrl+Q"));
503 action->setStatusTip(tr("Exit Sonic Visualiser")); 523 action->setStatusTip(tr("Exit Sonic Visualiser"));
504 connect(action, SIGNAL(triggered()), this, SLOT(close())); 524 connect(action, SIGNAL(triggered()), this, SLOT(close()));
505 m_keyReference->registerShortcut(action); 525 m_keyReference->registerShortcut(action);
506 menu->addAction(action); 526 m_fileMenu->addAction(action);
507 } 527 }
508 528
509 void 529 void
510 MainWindow::setupEditMenu() 530 MainWindow::setupEditMenu()
511 { 531 {
512 if (m_mainMenusCreated) return; 532 if (m_mainMenusCreated) return;
513 533
514 QMenu *menu = menuBar()->addMenu(tr("&Edit")); 534 m_editMenu = menuBar()->addMenu(tr("&Edit"));
515 menu->setTearOffEnabled(true); 535 m_editMenu->setTearOffEnabled(true);
516 CommandHistory::getInstance()->registerMenu(menu); 536 CommandHistory::getInstance()->registerMenu(m_editMenu);
517 537
518 m_keyReference->setCategory(tr("Editing")); 538 m_keyReference->setCategory(tr("Editing"));
519 539
520 menu->addSeparator(); 540 m_editMenu->addSeparator();
521 541
522 IconLoader il; 542 IconLoader il;
523 543
524 QAction *action = new QAction(il.load("editcut"), 544 QAction *action = new QAction(il.load("editcut"),
525 tr("Cu&t"), this); 545 tr("Cu&t"), this);
526 action->setShortcut(tr("Ctrl+X")); 546 action->setShortcut(tr("Ctrl+X"));
527 action->setStatusTip(tr("Cut the selection from the current layer to the clipboard")); 547 action->setStatusTip(tr("Cut the selection from the current layer to the clipboard"));
528 connect(action, SIGNAL(triggered()), this, SLOT(cut())); 548 connect(action, SIGNAL(triggered()), this, SLOT(cut()));
529 connect(this, SIGNAL(canEditSelection(bool)), action, SLOT(setEnabled(bool))); 549 connect(this, SIGNAL(canEditSelection(bool)), action, SLOT(setEnabled(bool)));
530 m_keyReference->registerShortcut(action); 550 m_keyReference->registerShortcut(action);
531 menu->addAction(action); 551 m_editMenu->addAction(action);
532 m_rightButtonMenu->addAction(action); 552 m_rightButtonMenu->addAction(action);
533 553
534 action = new QAction(il.load("editcopy"), 554 action = new QAction(il.load("editcopy"),
535 tr("&Copy"), this); 555 tr("&Copy"), this);
536 action->setShortcut(tr("Ctrl+C")); 556 action->setShortcut(tr("Ctrl+C"));
537 action->setStatusTip(tr("Copy the selection from the current layer to the clipboard")); 557 action->setStatusTip(tr("Copy the selection from the current layer to the clipboard"));
538 connect(action, SIGNAL(triggered()), this, SLOT(copy())); 558 connect(action, SIGNAL(triggered()), this, SLOT(copy()));
539 connect(this, SIGNAL(canEditSelection(bool)), action, SLOT(setEnabled(bool))); 559 connect(this, SIGNAL(canEditSelection(bool)), action, SLOT(setEnabled(bool)));
540 m_keyReference->registerShortcut(action); 560 m_keyReference->registerShortcut(action);
541 menu->addAction(action); 561 m_editMenu->addAction(action);
542 m_rightButtonMenu->addAction(action); 562 m_rightButtonMenu->addAction(action);
543 563
544 action = new QAction(il.load("editpaste"), 564 action = new QAction(il.load("editpaste"),
545 tr("&Paste"), this); 565 tr("&Paste"), this);
546 action->setShortcut(tr("Ctrl+V")); 566 action->setShortcut(tr("Ctrl+V"));
547 action->setStatusTip(tr("Paste from the clipboard to the current layer")); 567 action->setStatusTip(tr("Paste from the clipboard to the current layer"));
548 connect(action, SIGNAL(triggered()), this, SLOT(paste())); 568 connect(action, SIGNAL(triggered()), this, SLOT(paste()));
549 connect(this, SIGNAL(canPaste(bool)), action, SLOT(setEnabled(bool))); 569 connect(this, SIGNAL(canPaste(bool)), action, SLOT(setEnabled(bool)));
550 m_keyReference->registerShortcut(action); 570 m_keyReference->registerShortcut(action);
551 menu->addAction(action); 571 m_editMenu->addAction(action);
552 m_rightButtonMenu->addAction(action); 572 m_rightButtonMenu->addAction(action);
553 573
554 action = new QAction(tr("Paste at Playback Position"), this); 574 action = new QAction(tr("Paste at Playback Position"), this);
555 action->setShortcut(tr("Ctrl+Shift+V")); 575 action->setShortcut(tr("Ctrl+Shift+V"));
556 action->setStatusTip(tr("Paste from the clipboard to the current layer, placing the first item at the playback position")); 576 action->setStatusTip(tr("Paste from the clipboard to the current layer, placing the first item at the playback position"));
557 connect(action, SIGNAL(triggered()), this, SLOT(pasteAtPlaybackPosition())); 577 connect(action, SIGNAL(triggered()), this, SLOT(pasteAtPlaybackPosition()));
558 connect(this, SIGNAL(canPaste(bool)), action, SLOT(setEnabled(bool))); 578 connect(this, SIGNAL(canPaste(bool)), action, SLOT(setEnabled(bool)));
559 m_keyReference->registerShortcut(action); 579 m_keyReference->registerShortcut(action);
560 menu->addAction(action); 580 m_editMenu->addAction(action);
561 m_rightButtonMenu->addAction(action); 581 m_rightButtonMenu->addAction(action);
562 582
563 m_deleteSelectedAction = new QAction(tr("&Delete Selected Items"), this); 583 m_deleteSelectedAction = new QAction(tr("&Delete Selected Items"), this);
564 m_deleteSelectedAction->setShortcut(tr("Del")); 584 m_deleteSelectedAction->setShortcut(tr("Del"));
565 m_deleteSelectedAction->setStatusTip(tr("Delete items in current selection from the current layer")); 585 m_deleteSelectedAction->setStatusTip(tr("Delete items in current selection from the current layer"));
566 connect(m_deleteSelectedAction, SIGNAL(triggered()), this, SLOT(deleteSelected())); 586 connect(m_deleteSelectedAction, SIGNAL(triggered()), this, SLOT(deleteSelected()));
567 connect(this, SIGNAL(canDeleteSelection(bool)), m_deleteSelectedAction, SLOT(setEnabled(bool))); 587 connect(this, SIGNAL(canDeleteSelection(bool)), m_deleteSelectedAction, SLOT(setEnabled(bool)));
568 m_keyReference->registerShortcut(m_deleteSelectedAction); 588 m_keyReference->registerShortcut(m_deleteSelectedAction);
569 menu->addAction(m_deleteSelectedAction); 589 m_editMenu->addAction(m_deleteSelectedAction);
570 m_rightButtonMenu->addAction(m_deleteSelectedAction); 590 m_rightButtonMenu->addAction(m_deleteSelectedAction);
571 591
572 menu->addSeparator(); 592 m_editMenu->addSeparator();
573 m_rightButtonMenu->addSeparator(); 593 m_rightButtonMenu->addSeparator();
574 594
575 m_keyReference->setCategory(tr("Selection")); 595 m_keyReference->setCategory(tr("Selection"));
576 596
577 action = new QAction(tr("Select &All"), this); 597 action = new QAction(tr("Select &All"), this);
578 action->setShortcut(tr("Ctrl+A")); 598 action->setShortcut(tr("Ctrl+A"));
579 action->setStatusTip(tr("Select the whole duration of the current session")); 599 action->setStatusTip(tr("Select the whole duration of the current session"));
580 connect(action, SIGNAL(triggered()), this, SLOT(selectAll())); 600 connect(action, SIGNAL(triggered()), this, SLOT(selectAll()));
581 connect(this, SIGNAL(canSelect(bool)), action, SLOT(setEnabled(bool))); 601 connect(this, SIGNAL(canSelect(bool)), action, SLOT(setEnabled(bool)));
582 m_keyReference->registerShortcut(action); 602 m_keyReference->registerShortcut(action);
583 menu->addAction(action); 603 m_editMenu->addAction(action);
584 m_rightButtonMenu->addAction(action); 604 m_rightButtonMenu->addAction(action);
585 605
586 action = new QAction(tr("Select &Visible Range"), this); 606 action = new QAction(tr("Select &Visible Range"), this);
587 action->setShortcut(tr("Ctrl+Shift+A")); 607 action->setShortcut(tr("Ctrl+Shift+A"));
588 action->setStatusTip(tr("Select the time range corresponding to the current window width")); 608 action->setStatusTip(tr("Select the time range corresponding to the current window width"));
589 connect(action, SIGNAL(triggered()), this, SLOT(selectVisible())); 609 connect(action, SIGNAL(triggered()), this, SLOT(selectVisible()));
590 connect(this, SIGNAL(canSelect(bool)), action, SLOT(setEnabled(bool))); 610 connect(this, SIGNAL(canSelect(bool)), action, SLOT(setEnabled(bool)));
591 m_keyReference->registerShortcut(action); 611 m_keyReference->registerShortcut(action);
592 menu->addAction(action); 612 m_editMenu->addAction(action);
593 613
594 action = new QAction(tr("Select to &Start"), this); 614 action = new QAction(tr("Select to &Start"), this);
595 action->setShortcut(tr("Shift+Left")); 615 action->setShortcut(tr("Shift+Left"));
596 action->setStatusTip(tr("Select from the start of the session to the current playback position")); 616 action->setStatusTip(tr("Select from the start of the session to the current playback position"));
597 connect(action, SIGNAL(triggered()), this, SLOT(selectToStart())); 617 connect(action, SIGNAL(triggered()), this, SLOT(selectToStart()));
598 connect(this, SIGNAL(canSelect(bool)), action, SLOT(setEnabled(bool))); 618 connect(this, SIGNAL(canSelect(bool)), action, SLOT(setEnabled(bool)));
599 m_keyReference->registerShortcut(action); 619 m_keyReference->registerShortcut(action);
600 menu->addAction(action); 620 m_editMenu->addAction(action);
601 621
602 action = new QAction(tr("Select to &End"), this); 622 action = new QAction(tr("Select to &End"), this);
603 action->setShortcut(tr("Shift+Right")); 623 action->setShortcut(tr("Shift+Right"));
604 action->setStatusTip(tr("Select from the current playback position to the end of the session")); 624 action->setStatusTip(tr("Select from the current playback position to the end of the session"));
605 connect(action, SIGNAL(triggered()), this, SLOT(selectToEnd())); 625 connect(action, SIGNAL(triggered()), this, SLOT(selectToEnd()));
606 connect(this, SIGNAL(canSelect(bool)), action, SLOT(setEnabled(bool))); 626 connect(this, SIGNAL(canSelect(bool)), action, SLOT(setEnabled(bool)));
607 m_keyReference->registerShortcut(action); 627 m_keyReference->registerShortcut(action);
608 menu->addAction(action); 628 m_editMenu->addAction(action);
609 629
610 action = new QAction(tr("C&lear Selection"), this); 630 action = new QAction(tr("C&lear Selection"), this);
611 action->setShortcut(tr("Esc")); 631 action->setShortcut(tr("Esc"));
612 action->setStatusTip(tr("Clear the selection")); 632 action->setStatusTip(tr("Clear the selection"));
613 connect(action, SIGNAL(triggered()), this, SLOT(clearSelection())); 633 connect(action, SIGNAL(triggered()), this, SLOT(clearSelection()));
614 connect(this, SIGNAL(canClearSelection(bool)), action, SLOT(setEnabled(bool))); 634 connect(this, SIGNAL(canClearSelection(bool)), action, SLOT(setEnabled(bool)));
615 m_keyReference->registerShortcut(action); 635 m_keyReference->registerShortcut(action);
616 menu->addAction(action); 636 m_editMenu->addAction(action);
617 m_rightButtonMenu->addAction(action); 637 m_rightButtonMenu->addAction(action);
618 638
619 menu->addSeparator(); 639 m_editMenu->addSeparator();
620 640
621 m_keyReference->setCategory(tr("Tapping Time Instants")); 641 m_keyReference->setCategory(tr("Tapping Time Instants"));
622 642
623 action = new QAction(tr("&Insert Instant at Playback Position"), this); 643 action = new QAction(tr("&Insert Instant at Playback Position"), this);
624 action->setShortcut(tr("Enter")); 644 action->setShortcut(tr("Enter"));
625 action->setStatusTip(tr("Insert a new time instant at the current playback position, in a new layer if necessary")); 645 action->setStatusTip(tr("Insert a new time instant at the current playback position, in a new layer if necessary"));
626 connect(action, SIGNAL(triggered()), this, SLOT(insertInstant())); 646 connect(action, SIGNAL(triggered()), this, SLOT(insertInstant()));
627 connect(this, SIGNAL(canInsertInstant(bool)), action, SLOT(setEnabled(bool))); 647 connect(this, SIGNAL(canInsertInstant(bool)), action, SLOT(setEnabled(bool)));
628 m_keyReference->registerShortcut(action); 648 m_keyReference->registerShortcut(action);
629 menu->addAction(action); 649 m_editMenu->addAction(action);
630 650
631 // Laptop shortcut (no keypad Enter key) 651 // Laptop shortcut (no keypad Enter key)
632 QString shortcut(tr(";")); 652 QString shortcut(tr(";"));
633 connect(new QShortcut(shortcut, this), SIGNAL(activated()), 653 connect(new QShortcut(shortcut, this), SIGNAL(activated()),
634 this, SLOT(insertInstant())); 654 this, SLOT(insertInstant()));
638 action->setShortcut(tr("Shift+Enter")); 658 action->setShortcut(tr("Shift+Enter"));
639 action->setStatusTip(tr("Insert new time instants at the start and end of the current selected regions, in a new layer if necessary")); 659 action->setStatusTip(tr("Insert new time instants at the start and end of the current selected regions, in a new layer if necessary"));
640 connect(action, SIGNAL(triggered()), this, SLOT(insertInstantsAtBoundaries())); 660 connect(action, SIGNAL(triggered()), this, SLOT(insertInstantsAtBoundaries()));
641 connect(this, SIGNAL(canInsertInstantsAtBoundaries(bool)), action, SLOT(setEnabled(bool))); 661 connect(this, SIGNAL(canInsertInstantsAtBoundaries(bool)), action, SLOT(setEnabled(bool)));
642 m_keyReference->registerShortcut(action); 662 m_keyReference->registerShortcut(action);
643 menu->addAction(action); 663 m_editMenu->addAction(action);
644 664
645 action = new QAction(tr("Insert Item at Selection"), this); 665 action = new QAction(tr("Insert Item at Selection"), this);
646 action->setShortcut(tr("Ctrl+Shift+Enter")); 666 action->setShortcut(tr("Ctrl+Shift+Enter"));
647 action->setStatusTip(tr("Insert a new note or region item corresponding to the current selection")); 667 action->setStatusTip(tr("Insert a new note or region item corresponding to the current selection"));
648 connect(action, SIGNAL(triggered()), this, SLOT(insertItemAtSelection())); 668 connect(action, SIGNAL(triggered()), this, SLOT(insertItemAtSelection()));
649 connect(this, SIGNAL(canInsertItemAtSelection(bool)), action, SLOT(setEnabled(bool))); 669 connect(this, SIGNAL(canInsertItemAtSelection(bool)), action, SLOT(setEnabled(bool)));
650 m_keyReference->registerShortcut(action); 670 m_keyReference->registerShortcut(action);
651 menu->addAction(action); 671 m_editMenu->addAction(action);
652 672
653 menu->addSeparator(); 673 m_editMenu->addSeparator();
654 674
655 QMenu *numberingMenu = menu->addMenu(tr("Number New Instants with")); 675 QMenu *numberingMenu = m_editMenu->addMenu(tr("Number New Instants with"));
656 numberingMenu->setTearOffEnabled(true); 676 numberingMenu->setTearOffEnabled(true);
657 QActionGroup *numberingGroup = new QActionGroup(this); 677 QActionGroup *numberingGroup = new QActionGroup(this);
658 678
659 Labeller::TypeNameMap types = m_labeller->getTypeNames(); 679 Labeller::TypeNameMap types = m_labeller->getTypeNames();
660 for (Labeller::TypeNameMap::iterator i = types.begin(); i != types.end(); ++i) { 680 for (Labeller::TypeNameMap::iterator i = types.begin(); i != types.end(); ++i) {
694 } 714 }
695 715
696 action = new QAction(tr("Set Numbering Counters..."), this); 716 action = new QAction(tr("Set Numbering Counters..."), this);
697 action->setStatusTip(tr("Set the counters used for counter-based labelling")); 717 action->setStatusTip(tr("Set the counters used for counter-based labelling"));
698 connect(action, SIGNAL(triggered()), this, SLOT(resetInstantsCounters())); 718 connect(action, SIGNAL(triggered()), this, SLOT(resetInstantsCounters()));
699 menu->addAction(action); 719 m_editMenu->addAction(action);
700 720
701 action = new QAction(tr("Renumber Selected Instants"), this); 721 action = new QAction(tr("Renumber Selected Instants"), this);
702 action->setStatusTip(tr("Renumber the selected instants using the current labelling scheme")); 722 action->setStatusTip(tr("Renumber the selected instants using the current labelling scheme"));
703 connect(action, SIGNAL(triggered()), this, SLOT(renumberInstants())); 723 connect(action, SIGNAL(triggered()), this, SLOT(renumberInstants()));
704 connect(this, SIGNAL(canRenumberInstants(bool)), action, SLOT(setEnabled(bool))); 724 connect(this, SIGNAL(canRenumberInstants(bool)), action, SLOT(setEnabled(bool)));
705 // m_keyReference->registerShortcut(action); 725 // m_keyReference->registerShortcut(action);
706 menu->addAction(action); 726 m_editMenu->addAction(action);
707 } 727 }
708 728
709 void 729 void
710 MainWindow::setupViewMenu() 730 MainWindow::setupViewMenu()
711 { 731 {
713 733
714 IconLoader il; 734 IconLoader il;
715 735
716 QAction *action = 0; 736 QAction *action = 0;
717 737
738 m_viewMenu = menuBar()->addMenu(tr("&View"));
739 m_viewMenu->setTearOffEnabled(true);
740
741 m_viewToolBar = addToolBar(tr("View Toolbar"));
742
743 m_keyReference->setCategory(tr("User Interface design"));
744
745 QIcon icon = il.load("toggle16");
746 icon.addPixmap(il.loadPixmap("toggle22"));
747 action = new QAction(icon,tr("Minimal Mode"), this);
748 action->setShortcut(tr("C"));
749 action->setStatusTip(tr("Activates the Minimal Mode"));
750 connect(action, SIGNAL(triggered()), this, SLOT(toggleViewMode()));
751 action->setCheckable(true);
752 action->setChecked(m_viewManager->getMinimalModeEnabled());
753 m_keyReference->registerShortcut(action);
754 m_viewMenu->addAction(action);
755 m_viewToolBar->addAction(action);
756
757 m_viewMenu->addSeparator();
758
718 m_keyReference->setCategory(tr("Panning and Navigation")); 759 m_keyReference->setCategory(tr("Panning and Navigation"));
719 760
720 QMenu *menu = menuBar()->addMenu(tr("&View"));
721 menu->setTearOffEnabled(true);
722 action = new QAction(tr("Scroll &Left"), this); 761 action = new QAction(tr("Scroll &Left"), this);
723 action->setShortcut(tr("Left")); 762 action->setShortcut(tr("Left"));
724 action->setStatusTip(tr("Scroll the current pane to the left")); 763 action->setStatusTip(tr("Scroll the current pane to the left"));
725 connect(action, SIGNAL(triggered()), this, SLOT(scrollLeft())); 764 connect(action, SIGNAL(triggered()), this, SLOT(scrollLeft()));
726 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool))); 765 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
727 m_keyReference->registerShortcut(action); 766 m_keyReference->registerShortcut(action);
728 menu->addAction(action); 767 m_viewMenu->addAction(action);
729 768
730 action = new QAction(tr("Scroll &Right"), this); 769 action = new QAction(tr("Scroll &Right"), this);
731 action->setShortcut(tr("Right")); 770 action->setShortcut(tr("Right"));
732 action->setStatusTip(tr("Scroll the current pane to the right")); 771 action->setStatusTip(tr("Scroll the current pane to the right"));
733 connect(action, SIGNAL(triggered()), this, SLOT(scrollRight())); 772 connect(action, SIGNAL(triggered()), this, SLOT(scrollRight()));
734 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool))); 773 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
735 m_keyReference->registerShortcut(action); 774 m_keyReference->registerShortcut(action);
736 menu->addAction(action); 775 m_viewMenu->addAction(action);
737 776
738 action = new QAction(tr("&Jump Left"), this); 777 action = new QAction(tr("&Jump Left"), this);
739 action->setShortcut(tr("Ctrl+Left")); 778 action->setShortcut(tr("Ctrl+Left"));
740 action->setStatusTip(tr("Scroll the current pane a big step to the left")); 779 action->setStatusTip(tr("Scroll the current pane a big step to the left"));
741 connect(action, SIGNAL(triggered()), this, SLOT(jumpLeft())); 780 connect(action, SIGNAL(triggered()), this, SLOT(jumpLeft()));
742 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool))); 781 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
743 m_keyReference->registerShortcut(action); 782 m_keyReference->registerShortcut(action);
744 menu->addAction(action); 783 m_viewMenu->addAction(action);
745 784
746 action = new QAction(tr("J&ump Right"), this); 785 action = new QAction(tr("J&ump Right"), this);
747 action->setShortcut(tr("Ctrl+Right")); 786 action->setShortcut(tr("Ctrl+Right"));
748 action->setStatusTip(tr("Scroll the current pane a big step to the right")); 787 action->setStatusTip(tr("Scroll the current pane a big step to the right"));
749 connect(action, SIGNAL(triggered()), this, SLOT(jumpRight())); 788 connect(action, SIGNAL(triggered()), this, SLOT(jumpRight()));
750 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool))); 789 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
751 m_keyReference->registerShortcut(action); 790 m_keyReference->registerShortcut(action);
752 menu->addAction(action); 791 m_viewMenu->addAction(action);
753 792
754 action = new QAction(tr("Peek Left"), this); 793 action = new QAction(tr("Peek Left"), this);
755 action->setShortcut(tr("Alt+Left")); 794 action->setShortcut(tr("Alt+Left"));
756 action->setStatusTip(tr("Scroll the current pane to the left without moving the playback cursor or other panes")); 795 action->setStatusTip(tr("Scroll the current pane to the left without moving the playback cursor or other panes"));
757 connect(action, SIGNAL(triggered()), this, SLOT(peekLeft())); 796 connect(action, SIGNAL(triggered()), this, SLOT(peekLeft()));
758 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool))); 797 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
759 m_keyReference->registerShortcut(action); 798 m_keyReference->registerShortcut(action);
760 menu->addAction(action); 799 m_viewMenu->addAction(action);
761 800
762 action = new QAction(tr("Peek Right"), this); 801 action = new QAction(tr("Peek Right"), this);
763 action->setShortcut(tr("Alt+Right")); 802 action->setShortcut(tr("Alt+Right"));
764 action->setStatusTip(tr("Scroll the current pane to the right without moving the playback cursor or other panes")); 803 action->setStatusTip(tr("Scroll the current pane to the right without moving the playback cursor or other panes"));
765 connect(action, SIGNAL(triggered()), this, SLOT(peekRight())); 804 connect(action, SIGNAL(triggered()), this, SLOT(peekRight()));
766 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool))); 805 connect(this, SIGNAL(canScroll(bool)), action, SLOT(setEnabled(bool)));
767 m_keyReference->registerShortcut(action); 806 m_keyReference->registerShortcut(action);
768 menu->addAction(action); 807 m_viewMenu->addAction(action);
769 808
770 menu->addSeparator(); 809 m_viewMenu->addSeparator();
771 810
772 m_keyReference->setCategory(tr("Zoom")); 811 m_keyReference->setCategory(tr("Zoom"));
773 812
774 action = new QAction(il.load("zoom-in"), 813 action = new QAction(il.load("zoom-in"),
775 tr("Zoom &In"), this); 814 tr("Zoom &In"), this);
776 action->setShortcut(tr("Up")); 815 action->setShortcut(tr("Up"));
777 action->setStatusTip(tr("Increase the zoom level")); 816 action->setStatusTip(tr("Increase the zoom level"));
778 connect(action, SIGNAL(triggered()), this, SLOT(zoomIn())); 817 connect(action, SIGNAL(triggered()), this, SLOT(zoomIn()));
779 connect(this, SIGNAL(canZoom(bool)), action, SLOT(setEnabled(bool))); 818 connect(this, SIGNAL(canZoom(bool)), action, SLOT(setEnabled(bool)));
780 m_keyReference->registerShortcut(action); 819 m_keyReference->registerShortcut(action);
781 menu->addAction(action); 820 m_viewMenu->addAction(action);
782 821
783 action = new QAction(il.load("zoom-out"), 822 action = new QAction(il.load("zoom-out"),
784 tr("Zoom &Out"), this); 823 tr("Zoom &Out"), this);
785 action->setShortcut(tr("Down")); 824 action->setShortcut(tr("Down"));
786 action->setStatusTip(tr("Decrease the zoom level")); 825 action->setStatusTip(tr("Decrease the zoom level"));
787 connect(action, SIGNAL(triggered()), this, SLOT(zoomOut())); 826 connect(action, SIGNAL(triggered()), this, SLOT(zoomOut()));
788 connect(this, SIGNAL(canZoom(bool)), action, SLOT(setEnabled(bool))); 827 connect(this, SIGNAL(canZoom(bool)), action, SLOT(setEnabled(bool)));
789 m_keyReference->registerShortcut(action); 828 m_keyReference->registerShortcut(action);
790 menu->addAction(action); 829 m_viewMenu->addAction(action);
791 830
792 action = new QAction(tr("Restore &Default Zoom"), this); 831 action = new QAction(tr("Restore &Default Zoom"), this);
793 action->setStatusTip(tr("Restore the zoom level to the default")); 832 action->setStatusTip(tr("Restore the zoom level to the default"));
794 connect(action, SIGNAL(triggered()), this, SLOT(zoomDefault())); 833 connect(action, SIGNAL(triggered()), this, SLOT(zoomDefault()));
795 connect(this, SIGNAL(canZoom(bool)), action, SLOT(setEnabled(bool))); 834 connect(this, SIGNAL(canZoom(bool)), action, SLOT(setEnabled(bool)));
796 menu->addAction(action); 835 m_viewMenu->addAction(action);
797 836
798 action = new QAction(il.load("zoom-fit"), 837 action = new QAction(il.load("zoom-fit"),
799 tr("Zoom to &Fit"), this); 838 tr("Zoom to &Fit"), this);
800 action->setShortcut(tr("F")); 839 action->setShortcut(tr("F"));
801 action->setStatusTip(tr("Zoom to show the whole file")); 840 action->setStatusTip(tr("Zoom to show the whole file"));
802 connect(action, SIGNAL(triggered()), this, SLOT(zoomToFit())); 841 connect(action, SIGNAL(triggered()), this, SLOT(zoomToFit()));
803 connect(this, SIGNAL(canZoom(bool)), action, SLOT(setEnabled(bool))); 842 connect(this, SIGNAL(canZoom(bool)), action, SLOT(setEnabled(bool)));
804 m_keyReference->registerShortcut(action); 843 m_keyReference->registerShortcut(action);
805 menu->addAction(action); 844 m_viewMenu->addAction(action);
806 845
807 menu->addSeparator(); 846 m_viewMenu->addSeparator();
808 847
809 m_keyReference->setCategory(tr("Display Features")); 848 m_keyReference->setCategory(tr("Display Features"));
810 849
811 QActionGroup *overlayGroup = new QActionGroup(this); 850 QActionGroup *overlayGroup = new QActionGroup(this);
812 851
813 action = new QAction(tr("Show &No Overlays"), this); 852 m_showNoOverlaysAction = new QAction(tr("Show &No Overlays"), this);
814 action->setShortcut(tr("0")); 853 m_showNoOverlaysAction->setShortcut(tr("0"));
815 action->setStatusTip(tr("Hide centre indicator, frame times, layer names and scale")); 854 m_showNoOverlaysAction->setStatusTip(tr("Hide centre indicator, frame times, layer names and scale"));
816 connect(action, SIGNAL(triggered()), this, SLOT(showNoOverlays())); 855 connect(m_showNoOverlaysAction, SIGNAL(triggered()), this, SLOT(showNoOverlays()));
817 action->setCheckable(true); 856 m_showNoOverlaysAction->setCheckable(true);
818 action->setChecked(false); 857 m_showNoOverlaysAction->setChecked(false);
819 overlayGroup->addAction(action); 858 overlayGroup->addAction(m_showNoOverlaysAction);
820 m_keyReference->registerShortcut(action); 859 m_keyReference->registerShortcut(m_showNoOverlaysAction);
821 menu->addAction(action); 860 m_viewMenu->addAction(m_showNoOverlaysAction);
822 861
823 action = new QAction(tr("Show &Minimal Overlays"), this); 862 m_showMinimalOverlaysAction = new QAction(tr("Show &Minimal Overlays"), this);
824 action->setShortcut(tr("9")); 863 m_showMinimalOverlaysAction->setShortcut(tr("9"));
825 action->setStatusTip(tr("Show centre indicator only")); 864 m_showMinimalOverlaysAction->setStatusTip(tr("Show centre indicator only"));
826 connect(action, SIGNAL(triggered()), this, SLOT(showMinimalOverlays())); 865 connect(m_showMinimalOverlaysAction, SIGNAL(triggered()), this, SLOT(showMinimalOverlays()));
827 action->setCheckable(true); 866 m_showMinimalOverlaysAction->setCheckable(true);
828 action->setChecked(false); 867 m_showMinimalOverlaysAction->setChecked(false);
829 overlayGroup->addAction(action); 868 overlayGroup->addAction(m_showMinimalOverlaysAction);
830 m_keyReference->registerShortcut(action); 869 m_keyReference->registerShortcut(m_showMinimalOverlaysAction);
831 menu->addAction(action); 870 m_viewMenu->addAction(m_showMinimalOverlaysAction);
832 871
833 action = new QAction(tr("Show &Standard Overlays"), this); 872 m_showStandardOverlaysAction = new QAction(tr("Show &Standard Overlays"), this);
834 action->setShortcut(tr("8")); 873 m_showStandardOverlaysAction->setShortcut(tr("8"));
835 action->setStatusTip(tr("Show centre indicator, frame times and scale")); 874 m_showStandardOverlaysAction->setStatusTip(tr("Show centre indicator, frame times and scale"));
836 connect(action, SIGNAL(triggered()), this, SLOT(showStandardOverlays())); 875 connect(m_showStandardOverlaysAction, SIGNAL(triggered()), this, SLOT(showStandardOverlays()));
837 action->setCheckable(true); 876 m_showStandardOverlaysAction->setCheckable(true);
838 action->setChecked(true); 877 m_showStandardOverlaysAction->setChecked(true);
839 overlayGroup->addAction(action); 878 overlayGroup->addAction(m_showStandardOverlaysAction);
840 m_keyReference->registerShortcut(action); 879 m_keyReference->registerShortcut(m_showStandardOverlaysAction);
841 menu->addAction(action); 880 m_viewMenu->addAction(m_showStandardOverlaysAction);
842 881
843 action = new QAction(tr("Show &All Overlays"), this); 882 m_showAllOverlaysAction = new QAction(tr("Show &All Overlays"), this);
844 action->setShortcut(tr("7")); 883 m_showAllOverlaysAction->setShortcut(tr("7"));
845 action->setStatusTip(tr("Show all texts and scale")); 884 m_showAllOverlaysAction->setStatusTip(tr("Show all texts and scale"));
846 connect(action, SIGNAL(triggered()), this, SLOT(showAllOverlays())); 885 connect(m_showAllOverlaysAction, SIGNAL(triggered()), this, SLOT(showAllOverlays()));
847 action->setCheckable(true); 886 m_showAllOverlaysAction->setCheckable(true);
848 action->setChecked(false); 887 m_showAllOverlaysAction->setChecked(false);
849 overlayGroup->addAction(action); 888 overlayGroup->addAction(m_showAllOverlaysAction);
850 m_keyReference->registerShortcut(action); 889 m_keyReference->registerShortcut(m_showAllOverlaysAction);
851 menu->addAction(action); 890 m_viewMenu->addAction(m_showAllOverlaysAction);
852 891
853 menu->addSeparator(); 892 m_viewMenu->addSeparator();
854 893
855 action = new QAction(tr("Show All Time Rulers"), this); 894 m_showAllTimeRulersAction = new QAction(tr("Show All Time Rulers"), this);
856 action->setShortcut(tr("#")); 895 m_showAllTimeRulersAction->setShortcut(tr("#"));
857 action->setStatusTip(tr("Show or hide all time rulers")); 896 m_showAllTimeRulersAction->setStatusTip(tr("Show or hide all time rulers"));
858 connect(action, SIGNAL(triggered()), this, SLOT(toggleTimeRulers())); 897 connect(m_showAllTimeRulersAction, SIGNAL(triggered()), this, SLOT(toggleTimeRulers()));
859 m_keyReference->registerShortcut(action); 898 m_keyReference->registerShortcut(m_showAllTimeRulersAction);
860 menu->addAction(action); 899 m_viewMenu->addAction(m_showAllTimeRulersAction);
861 900
862 menu->addSeparator(); 901 m_viewMenu->addSeparator();
863 902
864 action = new QAction(tr("Show &Zoom Wheels"), this); 903 m_showZoomWheelsAction = new QAction(tr("Show &Zoom Wheels"), this);
865 action->setShortcut(tr("Z")); 904 m_showZoomWheelsAction->setShortcut(tr("Z"));
866 action->setStatusTip(tr("Show thumbwheels for zooming horizontally and vertically")); 905 m_showZoomWheelsAction->setStatusTip(tr("Show thumbwheels for zooming horizontally and vertically"));
867 connect(action, SIGNAL(triggered()), this, SLOT(toggleZoomWheels())); 906 connect(m_showZoomWheelsAction, SIGNAL(triggered()), this, SLOT(toggleZoomWheels()));
868 action->setCheckable(true); 907 m_showZoomWheelsAction->setCheckable(true);
869 action->setChecked(m_viewManager->getZoomWheelsEnabled()); 908 m_showZoomWheelsAction->setChecked(m_viewManager->getZoomWheelsEnabled());
870 m_keyReference->registerShortcut(action); 909 m_keyReference->registerShortcut(m_showZoomWheelsAction);
871 menu->addAction(action); 910 m_viewMenu->addAction(m_showZoomWheelsAction);
872 911
873 action = new QAction(tr("Show Property Bo&xes"), this); 912 m_showPropertyBoxesAction = new QAction(tr("Show Property Bo&xes"), this);
874 action->setShortcut(tr("X")); 913 m_showPropertyBoxesAction->setShortcut(tr("X"));
875 action->setStatusTip(tr("Show the layer property boxes at the side of the main window")); 914 m_showPropertyBoxesAction->setStatusTip(tr("Show the layer property boxes at the side of the main window"));
876 connect(action, SIGNAL(triggered()), this, SLOT(togglePropertyBoxes())); 915 connect(m_showPropertyBoxesAction, SIGNAL(triggered()), this, SLOT(togglePropertyBoxes()));
877 action->setCheckable(true); 916 m_showPropertyBoxesAction->setCheckable(true);
878 action->setChecked(true); 917 m_showPropertyBoxesAction->setChecked(true);
879 m_keyReference->registerShortcut(action); 918 m_keyReference->registerShortcut(m_showPropertyBoxesAction);
880 menu->addAction(action); 919 m_viewMenu->addAction(m_showPropertyBoxesAction);
881 920
882 action = new QAction(tr("Show Status &Bar"), this); 921 m_showStatusBarAction = new QAction(tr("Show Status &Bar"), this);
883 action->setStatusTip(tr("Show context help information in the status bar at the bottom of the window")); 922 m_showStatusBarAction->setStatusTip(tr("Show context help information in the status bar at the bottom of the window"));
884 connect(action, SIGNAL(triggered()), this, SLOT(toggleStatusBar())); 923 connect(m_showStatusBarAction, SIGNAL(triggered()), this, SLOT(toggleStatusBar()));
885 action->setCheckable(true); 924 m_showStatusBarAction->setCheckable(true);
886 action->setChecked(true); 925 m_showStatusBarAction->setChecked(true);
887 menu->addAction(action); 926 m_viewMenu->addAction(m_showStatusBarAction);
888 927
889 QSettings settings; 928 QSettings settings;
890 settings.beginGroup("MainWindow"); 929 settings.beginGroup("MainWindow");
891 bool sb = settings.value("showstatusbar", true).toBool(); 930 bool sb = settings.value("showstatusbar", true).toBool();
892 if (!sb) { 931 if (!sb) {
893 action->setChecked(false); 932 action->setChecked(false);
894 statusBar()->hide(); 933 statusBar()->hide();
895 } 934 }
896 settings.endGroup(); 935 settings.endGroup();
897 936
898 menu->addSeparator(); 937 m_viewMenu->addSeparator();
899 938
900 action = new QAction(tr("Show La&yer Summary"), this); 939 action = new QAction(tr("Show La&yer Summary"), this);
901 action->setShortcut(tr("Y")); 940 action->setShortcut(tr("Y"));
902 action->setStatusTip(tr("Open a window displaying the hierarchy of panes and layers in this session")); 941 action->setStatusTip(tr("Open a window displaying the hierarchy of panes and layers in this session"));
903 connect(action, SIGNAL(triggered()), this, SLOT(showLayerTree())); 942 connect(action, SIGNAL(triggered()), this, SLOT(showLayerTree()));
904 m_keyReference->registerShortcut(action); 943 m_keyReference->registerShortcut(action);
905 menu->addAction(action); 944 m_viewMenu->addAction(action);
906 945
907 action = new QAction(tr("Show Acti&vity Log"), this); 946 action = new QAction(tr("Show Acti&vity Log"), this);
908 action->setStatusTip(tr("Open a window listing interactions and other events")); 947 action->setStatusTip(tr("Open a window listing interactions and other events"));
909 connect(action, SIGNAL(triggered()), this, SLOT(showActivityLog())); 948 connect(action, SIGNAL(triggered()), this, SLOT(showActivityLog()));
910 menu->addAction(action); 949 m_viewMenu->addAction(action);
911 } 950 }
912 951
913 void 952 void
914 MainWindow::setupPaneAndLayerMenus() 953 MainWindow::setupPaneAndLayerMenus()
915 { 954 {
1732 QMenu *menu = m_playbackMenu = menuBar()->addMenu(tr("Play&back")); 1771 QMenu *menu = m_playbackMenu = menuBar()->addMenu(tr("Play&back"));
1733 menu->setTearOffEnabled(true); 1772 menu->setTearOffEnabled(true);
1734 m_rightButtonMenu->addSeparator(); 1773 m_rightButtonMenu->addSeparator();
1735 m_rightButtonPlaybackMenu = m_rightButtonMenu->addMenu(tr("Playback")); 1774 m_rightButtonPlaybackMenu = m_rightButtonMenu->addMenu(tr("Playback"));
1736 1775
1737 QToolBar *toolbar = addToolBar(tr("Playback Toolbar")); 1776 m_playbackToolBar = addToolBar(tr("Playback Toolbar"));
1738 1777 m_rwdStartAction = m_playbackToolBar->addAction(il.load("rewind-start"),
1739 m_rwdStartAction = toolbar->addAction(il.load("rewind-start"), 1778 tr("Rewind to Start"));
1740 tr("Rewind to Start"));
1741 m_rwdStartAction->setShortcut(tr("Home")); 1779 m_rwdStartAction->setShortcut(tr("Home"));
1742 m_rwdStartAction->setStatusTip(tr("Rewind to the start")); 1780 m_rwdStartAction->setStatusTip(tr("Rewind to the start"));
1743 connect(m_rwdStartAction, SIGNAL(triggered()), this, SLOT(rewindStart())); 1781 connect(m_rwdStartAction, SIGNAL(triggered()), this, SLOT(rewindStart()));
1744 connect(this, SIGNAL(canPlay(bool)), m_rwdStartAction, SLOT(setEnabled(bool))); 1782 connect(this, SIGNAL(canPlay(bool)), m_rwdStartAction, SLOT(setEnabled(bool)));
1745 1783
1746 m_rwdAction = toolbar->addAction(il.load("rewind"), tr("Rewind")); 1784 m_rwdAction = m_playbackToolBar->addAction(il.load("rewind"), tr("Rewind"));
1747 m_rwdAction->setShortcut(tr("PgUp")); 1785 m_rwdAction->setShortcut(tr("PgUp"));
1748 m_rwdAction->setStatusTip(tr("Rewind to the previous time instant or time ruler notch")); 1786 m_rwdAction->setStatusTip(tr("Rewind to the previous time instant or time ruler notch"));
1749 connect(m_rwdAction, SIGNAL(triggered()), this, SLOT(rewind())); 1787 connect(m_rwdAction, SIGNAL(triggered()), this, SLOT(rewind()));
1750 connect(this, SIGNAL(canRewind(bool)), m_rwdAction, SLOT(setEnabled(bool))); 1788 connect(this, SIGNAL(canRewind(bool)), m_rwdAction, SLOT(setEnabled(bool)));
1751 1789
1753 m_rwdSimilarAction->setShortcut(tr("Shift+PgUp")); 1791 m_rwdSimilarAction->setShortcut(tr("Shift+PgUp"));
1754 m_rwdSimilarAction->setStatusTip(tr("Rewind to the previous similarly valued time instant")); 1792 m_rwdSimilarAction->setStatusTip(tr("Rewind to the previous similarly valued time instant"));
1755 connect(m_rwdSimilarAction, SIGNAL(triggered()), this, SLOT(rewindSimilar())); 1793 connect(m_rwdSimilarAction, SIGNAL(triggered()), this, SLOT(rewindSimilar()));
1756 connect(this, SIGNAL(canRewind(bool)), m_rwdSimilarAction, SLOT(setEnabled(bool))); 1794 connect(this, SIGNAL(canRewind(bool)), m_rwdSimilarAction, SLOT(setEnabled(bool)));
1757 1795
1758 m_playAction = toolbar->addAction(il.load("playpause"), 1796 m_playAction = m_playbackToolBar->addAction(il.load("playpause"),
1759 tr("Play / Pause")); 1797 tr("Play / Pause"));
1760 m_playAction->setCheckable(true); 1798 m_playAction->setCheckable(true);
1761 m_playAction->setShortcut(tr("Space")); 1799 m_playAction->setShortcut(tr("Space"));
1762 m_playAction->setStatusTip(tr("Start or stop playback from the current position")); 1800 m_playAction->setStatusTip(tr("Start or stop playback from the current position"));
1763 connect(m_playAction, SIGNAL(triggered()), this, SLOT(play())); 1801 connect(m_playAction, SIGNAL(triggered()), this, SLOT(play()));
1765 m_playAction, SLOT(setChecked(bool))); 1803 m_playAction, SLOT(setChecked(bool)));
1766 connect(m_playSource, SIGNAL(playStatusChanged(bool)), 1804 connect(m_playSource, SIGNAL(playStatusChanged(bool)),
1767 this, SLOT(playStatusChanged(bool))); 1805 this, SLOT(playStatusChanged(bool)));
1768 connect(this, SIGNAL(canPlay(bool)), m_playAction, SLOT(setEnabled(bool))); 1806 connect(this, SIGNAL(canPlay(bool)), m_playAction, SLOT(setEnabled(bool)));
1769 1807
1770 m_ffwdAction = toolbar->addAction(il.load("ffwd"), 1808 m_ffwdAction = m_playbackToolBar->addAction(il.load("ffwd"),
1771 tr("Fast Forward")); 1809 tr("Fast Forward"));
1772 m_ffwdAction->setShortcut(tr("PgDown")); 1810 m_ffwdAction->setShortcut(tr("PgDown"));
1773 m_ffwdAction->setStatusTip(tr("Fast-forward to the next time instant or time ruler notch")); 1811 m_ffwdAction->setStatusTip(tr("Fast-forward to the next time instant or time ruler notch"));
1774 connect(m_ffwdAction, SIGNAL(triggered()), this, SLOT(ffwd())); 1812 connect(m_ffwdAction, SIGNAL(triggered()), this, SLOT(ffwd()));
1775 connect(this, SIGNAL(canFfwd(bool)), m_ffwdAction, SLOT(setEnabled(bool))); 1813 connect(this, SIGNAL(canFfwd(bool)), m_ffwdAction, SLOT(setEnabled(bool)));
1778 m_ffwdSimilarAction->setShortcut(tr("Shift+PgDown")); 1816 m_ffwdSimilarAction->setShortcut(tr("Shift+PgDown"));
1779 m_ffwdSimilarAction->setStatusTip(tr("Fast-forward to the next similarly valued time instant")); 1817 m_ffwdSimilarAction->setStatusTip(tr("Fast-forward to the next similarly valued time instant"));
1780 connect(m_ffwdSimilarAction, SIGNAL(triggered()), this, SLOT(ffwdSimilar())); 1818 connect(m_ffwdSimilarAction, SIGNAL(triggered()), this, SLOT(ffwdSimilar()));
1781 connect(this, SIGNAL(canFfwd(bool)), m_ffwdSimilarAction, SLOT(setEnabled(bool))); 1819 connect(this, SIGNAL(canFfwd(bool)), m_ffwdSimilarAction, SLOT(setEnabled(bool)));
1782 1820
1783 m_ffwdEndAction = toolbar->addAction(il.load("ffwd-end"), 1821 m_ffwdEndAction = m_playbackToolBar->addAction(il.load("ffwd-end"),
1784 tr("Fast Forward to End")); 1822 tr("Fast Forward to End"));
1785 m_ffwdEndAction->setShortcut(tr("End")); 1823 m_ffwdEndAction->setShortcut(tr("End"));
1786 m_ffwdEndAction->setStatusTip(tr("Fast-forward to the end")); 1824 m_ffwdEndAction->setStatusTip(tr("Fast-forward to the end"));
1787 connect(m_ffwdEndAction, SIGNAL(triggered()), this, SLOT(ffwdEnd())); 1825 connect(m_ffwdEndAction, SIGNAL(triggered()), this, SLOT(ffwdEnd()));
1788 connect(this, SIGNAL(canPlay(bool)), m_ffwdEndAction, SLOT(setEnabled(bool))); 1826 connect(this, SIGNAL(canPlay(bool)), m_ffwdEndAction, SLOT(setEnabled(bool)));
1789 1827
1790 toolbar = addToolBar(tr("Play Mode Toolbar")); 1828 m_playModeToolBar = addToolBar(tr("Play Mode Toolbar"));
1791 1829
1792 m_playSelectionAction = toolbar->addAction(il.load("playselection"), 1830 m_playSelectionAction = m_playModeToolBar->addAction(il.load("playselection"),
1793 tr("Constrain Playback to Selection")); 1831 tr("Constrain Playback to Selection"));
1794 m_playSelectionAction->setCheckable(true); 1832 m_playSelectionAction->setCheckable(true);
1795 m_playSelectionAction->setChecked(m_viewManager->getPlaySelectionMode()); 1833 m_playSelectionAction->setChecked(m_viewManager->getPlaySelectionMode());
1796 m_playSelectionAction->setShortcut(tr("s")); 1834 m_playSelectionAction->setShortcut(tr("s"));
1797 m_playSelectionAction->setStatusTip(tr("Constrain playback to the selected regions")); 1835 m_playSelectionAction->setStatusTip(tr("Constrain playback to the selected regions"));
1798 connect(m_viewManager, SIGNAL(playSelectionModeChanged(bool)), 1836 connect(m_viewManager, SIGNAL(playSelectionModeChanged(bool)),
1799 m_playSelectionAction, SLOT(setChecked(bool))); 1837 m_playSelectionAction, SLOT(setChecked(bool)));
1800 connect(m_playSelectionAction, SIGNAL(triggered()), this, SLOT(playSelectionToggled())); 1838 connect(m_playSelectionAction, SIGNAL(triggered()), this, SLOT(playSelectionToggled()));
1801 connect(this, SIGNAL(canPlaySelection(bool)), m_playSelectionAction, SLOT(setEnabled(bool))); 1839 connect(this, SIGNAL(canPlaySelection(bool)), m_playSelectionAction, SLOT(setEnabled(bool)));
1802 1840
1803 m_playLoopAction = toolbar->addAction(il.load("playloop"), 1841 m_playLoopAction = m_playModeToolBar->addAction(il.load("playloop"),
1804 tr("Loop Playback")); 1842 tr("Loop Playback"));
1805 m_playLoopAction->setCheckable(true); 1843 m_playLoopAction->setCheckable(true);
1806 m_playLoopAction->setChecked(m_viewManager->getPlayLoopMode()); 1844 m_playLoopAction->setChecked(m_viewManager->getPlayLoopMode());
1807 m_playLoopAction->setShortcut(tr("l")); 1845 m_playLoopAction->setShortcut(tr("l"));
1808 m_playLoopAction->setStatusTip(tr("Loop playback")); 1846 m_playLoopAction->setStatusTip(tr("Loop playback"));
1809 connect(m_viewManager, SIGNAL(playLoopModeChanged(bool)), 1847 connect(m_viewManager, SIGNAL(playLoopModeChanged(bool)),
1810 m_playLoopAction, SLOT(setChecked(bool))); 1848 m_playLoopAction, SLOT(setChecked(bool)));
1811 connect(m_playLoopAction, SIGNAL(triggered()), this, SLOT(playLoopToggled())); 1849 connect(m_playLoopAction, SIGNAL(triggered()), this, SLOT(playLoopToggled()));
1812 connect(this, SIGNAL(canPlay(bool)), m_playLoopAction, SLOT(setEnabled(bool))); 1850 connect(this, SIGNAL(canPlay(bool)), m_playLoopAction, SLOT(setEnabled(bool)));
1813 1851
1814 m_soloAction = toolbar->addAction(il.load("solo"), 1852 m_soloAction = m_playModeToolBar->addAction(il.load("solo"),
1815 tr("Solo Current Pane")); 1853 tr("Solo Current Pane"));
1816 m_soloAction->setCheckable(true); 1854 m_soloAction->setCheckable(true);
1817 m_soloAction->setChecked(m_viewManager->getPlaySoloMode()); 1855 m_soloAction->setChecked(m_viewManager->getPlaySoloMode());
1818 m_prevSolo = m_viewManager->getPlaySoloMode(); 1856 m_prevSolo = m_viewManager->getPlaySoloMode();
1819 m_soloAction->setShortcut(tr("o")); 1857 m_soloAction->setShortcut(tr("o"));
1823 connect(m_soloAction, SIGNAL(triggered()), this, SLOT(playSoloToggled())); 1861 connect(m_soloAction, SIGNAL(triggered()), this, SLOT(playSoloToggled()));
1824 connect(this, SIGNAL(canChangeSolo(bool)), m_soloAction, SLOT(setEnabled(bool))); 1862 connect(this, SIGNAL(canChangeSolo(bool)), m_soloAction, SLOT(setEnabled(bool)));
1825 1863
1826 QAction *alAction = 0; 1864 QAction *alAction = 0;
1827 if (Document::canAlign()) { 1865 if (Document::canAlign()) {
1828 alAction = toolbar->addAction(il.load("align"), 1866 alAction = m_playModeToolBar->addAction(il.load("align"),
1829 tr("Align File Timelines")); 1867 tr("Align File Timelines"));
1830 alAction->setCheckable(true); 1868 alAction->setCheckable(true);
1831 alAction->setChecked(m_viewManager->getAlignMode()); 1869 alAction->setChecked(m_viewManager->getAlignMode());
1832 alAction->setStatusTip(tr("Treat multiple audio files as versions of the same work, and align their timelines")); 1870 alAction->setStatusTip(tr("Treat multiple audio files as versions of the same work, and align their timelines"));
1833 connect(m_viewManager, SIGNAL(alignModeChanged(bool)), 1871 connect(m_viewManager, SIGNAL(alignModeChanged(bool)),
1901 1939
1902 m_rightButtonPlaybackMenu->addAction(fastAction); 1940 m_rightButtonPlaybackMenu->addAction(fastAction);
1903 m_rightButtonPlaybackMenu->addAction(slowAction); 1941 m_rightButtonPlaybackMenu->addAction(slowAction);
1904 m_rightButtonPlaybackMenu->addAction(normalAction); 1942 m_rightButtonPlaybackMenu->addAction(normalAction);
1905 1943
1906 toolbar = addToolBar(tr("Edit Toolbar")); 1944 m_editToolBar = addToolBar(tr("Edit Toolbar"));
1907 CommandHistory::getInstance()->registerToolbar(toolbar); 1945 CommandHistory::getInstance()->registerToolbar(m_editToolBar);
1908 1946
1909 m_keyReference->setCategory(tr("Tool Selection")); 1947 m_keyReference->setCategory(tr("Tool Selection"));
1910 1948
1911 toolbar = addToolBar(tr("Tools Toolbar")); 1949 m_toolsToolBar = addToolBar(tr("Tools Toolbar"));
1912 QActionGroup *group = new QActionGroup(this); 1950 QActionGroup *group = new QActionGroup(this);
1913 1951
1914 QAction *action = toolbar->addAction(il.load("navigate"), 1952 QAction *action = m_toolsToolBar->addAction(il.load("navigate"),
1915 tr("Navigate")); 1953 tr("Navigate"));
1916 action->setCheckable(true); 1954 action->setCheckable(true);
1917 action->setChecked(true); 1955 action->setChecked(true);
1918 action->setShortcut(tr("1")); 1956 action->setShortcut(tr("1"));
1919 action->setStatusTip(tr("Navigate")); 1957 action->setStatusTip(tr("Navigate"));
1920 connect(action, SIGNAL(triggered()), this, SLOT(toolNavigateSelected())); 1958 connect(action, SIGNAL(triggered()), this, SLOT(toolNavigateSelected()));
1921 group->addAction(action); 1959 group->addAction(action);
1922 m_keyReference->registerShortcut(action); 1960 m_keyReference->registerShortcut(action);
1923 m_toolActions[ViewManager::NavigateMode] = action; 1961 m_toolActions[ViewManager::NavigateMode] = action;
1924 1962
1925 action = toolbar->addAction(il.load("select"), 1963 action = m_toolsToolBar->addAction(il.load("select"),
1926 tr("Select")); 1964 tr("Select"));
1927 action->setCheckable(true); 1965 action->setCheckable(true);
1928 action->setShortcut(tr("2")); 1966 action->setShortcut(tr("2"));
1929 action->setStatusTip(tr("Select ranges")); 1967 action->setStatusTip(tr("Select ranges"));
1930 connect(action, SIGNAL(triggered()), this, SLOT(toolSelectSelected())); 1968 connect(action, SIGNAL(triggered()), this, SLOT(toolSelectSelected()));
1931 group->addAction(action); 1969 group->addAction(action);
1932 m_keyReference->registerShortcut(action); 1970 m_keyReference->registerShortcut(action);
1933 m_toolActions[ViewManager::SelectMode] = action; 1971 m_toolActions[ViewManager::SelectMode] = action;
1934 1972
1935 action = toolbar->addAction(il.load("move"), 1973 action = m_toolsToolBar->addAction(il.load("move"),
1936 tr("Edit")); 1974 tr("Edit"));
1937 action->setCheckable(true); 1975 action->setCheckable(true);
1938 action->setShortcut(tr("3")); 1976 action->setShortcut(tr("3"));
1939 action->setStatusTip(tr("Edit items in layer")); 1977 action->setStatusTip(tr("Edit items in layer"));
1940 connect(action, SIGNAL(triggered()), this, SLOT(toolEditSelected())); 1978 connect(action, SIGNAL(triggered()), this, SLOT(toolEditSelected()));
1941 connect(this, SIGNAL(canEditLayer(bool)), action, SLOT(setEnabled(bool))); 1979 connect(this, SIGNAL(canEditLayer(bool)), action, SLOT(setEnabled(bool)));
1942 group->addAction(action); 1980 group->addAction(action);
1943 m_keyReference->registerShortcut(action); 1981 m_keyReference->registerShortcut(action);
1944 m_toolActions[ViewManager::EditMode] = action; 1982 m_toolActions[ViewManager::EditMode] = action;
1945 1983
1946 action = toolbar->addAction(il.load("draw"), 1984 action = m_toolsToolBar->addAction(il.load("draw"),
1947 tr("Draw")); 1985 tr("Draw"));
1948 action->setCheckable(true); 1986 action->setCheckable(true);
1949 action->setShortcut(tr("4")); 1987 action->setShortcut(tr("4"));
1950 action->setStatusTip(tr("Draw new items in layer")); 1988 action->setStatusTip(tr("Draw new items in layer"));
1951 connect(action, SIGNAL(triggered()), this, SLOT(toolDrawSelected())); 1989 connect(action, SIGNAL(triggered()), this, SLOT(toolDrawSelected()));
1952 connect(this, SIGNAL(canEditLayer(bool)), action, SLOT(setEnabled(bool))); 1990 connect(this, SIGNAL(canEditLayer(bool)), action, SLOT(setEnabled(bool)));
1953 group->addAction(action); 1991 group->addAction(action);
1954 m_keyReference->registerShortcut(action); 1992 m_keyReference->registerShortcut(action);
1955 m_toolActions[ViewManager::DrawMode] = action; 1993 m_toolActions[ViewManager::DrawMode] = action;
1956 1994
1957 action = toolbar->addAction(il.load("erase"), 1995 action = m_toolsToolBar->addAction(il.load("erase"),
1958 tr("Erase")); 1996 tr("Erase"));
1959 action->setCheckable(true); 1997 action->setCheckable(true);
1960 action->setShortcut(tr("5")); 1998 action->setShortcut(tr("5"));
1961 action->setStatusTip(tr("Erase items from layer")); 1999 action->setStatusTip(tr("Erase items from layer"));
1962 connect(action, SIGNAL(triggered()), this, SLOT(toolEraseSelected())); 2000 connect(action, SIGNAL(triggered()), this, SLOT(toolEraseSelected()));
1963 connect(this, SIGNAL(canEditLayer(bool)), action, SLOT(setEnabled(bool))); 2001 connect(this, SIGNAL(canEditLayer(bool)), action, SLOT(setEnabled(bool)));
1964 group->addAction(action); 2002 group->addAction(action);
1965 m_keyReference->registerShortcut(action); 2003 m_keyReference->registerShortcut(action);
1966 m_toolActions[ViewManager::EraseMode] = action; 2004 m_toolActions[ViewManager::EraseMode] = action;
1967 2005
1968 action = toolbar->addAction(il.load("measure"), tr("Measure")); 2006 action = m_toolsToolBar->addAction(il.load("measure"), tr("Measure"));
1969 action->setCheckable(true); 2007 action->setCheckable(true);
1970 action->setShortcut(tr("6")); 2008 action->setShortcut(tr("6"));
1971 action->setStatusTip(tr("Make measurements in layer")); 2009 action->setStatusTip(tr("Make measurements in layer"));
1972 connect(action, SIGNAL(triggered()), this, SLOT(toolMeasureSelected())); 2010 connect(action, SIGNAL(triggered()), this, SLOT(toolMeasureSelected()));
1973 connect(this, SIGNAL(canMeasureLayer(bool)), action, SLOT(setEnabled(bool))); 2011 connect(this, SIGNAL(canMeasureLayer(bool)), action, SLOT(setEnabled(bool)));
4130 settings.setValue(tag, false); 4168 settings.setValue(tag, false);
4131 } 4169 }
4132 settings.endGroup(); 4170 settings.endGroup();
4133 } 4171 }
4134 4172
4135 4173 void
4174 MainWindow::toggleViewMode()
4175 {
4176 bool visible;
4177
4178 if (m_viewManager->getMinimalModeEnabled()) {
4179 visible = true;
4180 m_viewManager->setMinimalModeEnabled(false);
4181 m_paneStack->show();
4182 } else {
4183 visible = false;
4184 m_viewManager->setMinimalModeEnabled(true);
4185 m_paneStack->hide();
4186 }
4187
4188 //cerr << "Call to MainWindow::toggleViewMode"<< endl;
4189
4190 m_playModeToolBar->setVisible(visible);
4191 m_editToolBar->setVisible(visible);
4192 m_toolsToolBar->setVisible(visible);
4193
4194 m_importAnnotationLayerAction->setVisible(visible);
4195 m_exportAnnotationLayerAction->setVisible(visible);
4196 m_showNoOverlaysAction->setVisible(visible);
4197 m_showMinimalOverlaysAction->setVisible(visible);
4198 m_showStandardOverlaysAction->setVisible(visible);
4199 m_showAllOverlaysAction->setVisible(visible);
4200 m_showAllTimeRulersAction->setVisible(visible);
4201 m_showZoomWheelsAction->setVisible(visible);
4202 m_showPropertyBoxesAction->setVisible(visible);
4203 m_showStatusBarAction->setVisible(visible);
4204
4205 //layout()->activate();
4206 //layout()->update();
4207 adjustSize(); //shrinks successfully the main window but does not remove the space allocated for the central widget containing panes
4208
4209 //TO-DOS:
4210 //- when switching back to full mode, the pane is not shown entirely, should restore the previous size
4211 //- the size of the overview (namely its width) should be increased when the minimal mode is activated
4212 //- the menus which have no effects in the minimal mode should be removed (or their actions disabled)
4213 //even if this doesn't lead cause the application to crash (the actual changes are made in the hidden pane(s))
4214 //- the menu actions which have no effects in the minimal mode should be removed or disabled
4215 }
4216