comparison main/MainWindow.cpp @ 951:61703996628d scalable-icons

Experiment with loading SVGs
author Chris Cannam
date Wed, 06 May 2015 10:08:28 +0100
parents a16456ca5e71
children 80c5d98399ec
comparison
equal deleted inserted replaced
942:abe5cfed6a88 951:61703996628d
457 m_keyReference->setCategory(tr("File and Session Management")); 457 m_keyReference->setCategory(tr("File and Session Management"));
458 458
459 IconLoader il; 459 IconLoader il;
460 460
461 QIcon icon = il.load("filenew"); 461 QIcon icon = il.load("filenew");
462 icon.addPixmap(il.loadPixmap("filenew-22"));
463 QAction *action = new QAction(icon, tr("&New Session"), this); 462 QAction *action = new QAction(icon, tr("&New Session"), this);
464 action->setShortcut(tr("Ctrl+N")); 463 action->setShortcut(tr("Ctrl+N"));
465 action->setStatusTip(tr("Abandon the current %1 session and start a new one").arg(QApplication::applicationName())); 464 action->setStatusTip(tr("Abandon the current %1 session and start a new one").arg(QApplication::applicationName()));
466 connect(action, SIGNAL(triggered()), this, SLOT(newSession())); 465 connect(action, SIGNAL(triggered()), this, SLOT(newSession()));
467 m_keyReference->registerShortcut(action); 466 m_keyReference->registerShortcut(action);
468 menu->addAction(action); 467 menu->addAction(action);
469 toolbar->addAction(action); 468 toolbar->addAction(action);
470 469
471 icon = il.load("fileopen"); 470 icon = il.load("fileopen");
472 icon.addPixmap(il.loadPixmap("fileopen-22"));
473 action = new QAction(icon, tr("&Open..."), this); 471 action = new QAction(icon, tr("&Open..."), this);
474 action->setShortcut(tr("Ctrl+O")); 472 action->setShortcut(tr("Ctrl+O"));
475 action->setStatusTip(tr("Open a session file, audio file, or layer")); 473 action->setStatusTip(tr("Open a session file, audio file, or layer"));
476 connect(action, SIGNAL(triggered()), this, SLOT(openSomething())); 474 connect(action, SIGNAL(triggered()), this, SLOT(openSomething()));
477 m_keyReference->registerShortcut(action); 475 m_keyReference->registerShortcut(action);
508 this, SLOT(setupRecentFilesMenu())); 506 this, SLOT(setupRecentFilesMenu()));
509 507
510 menu->addSeparator(); 508 menu->addSeparator();
511 509
512 icon = il.load("filesave"); 510 icon = il.load("filesave");
513 icon.addPixmap(il.loadPixmap("filesave-22"));
514 action = new QAction(icon, tr("&Save Session"), this); 511 action = new QAction(icon, tr("&Save Session"), this);
515 action->setShortcut(tr("Ctrl+S")); 512 action->setShortcut(tr("Ctrl+S"));
516 action->setStatusTip(tr("Save the current session into a %1 session file").arg(QApplication::applicationName())); 513 action->setStatusTip(tr("Save the current session into a %1 session file").arg(QApplication::applicationName()));
517 connect(action, SIGNAL(triggered()), this, SLOT(saveSession())); 514 connect(action, SIGNAL(triggered()), this, SLOT(saveSession()));
518 connect(this, SIGNAL(canSave(bool)), action, SLOT(setEnabled(bool))); 515 connect(this, SIGNAL(canSave(bool)), action, SLOT(setEnabled(bool)));
519 m_keyReference->registerShortcut(action); 516 m_keyReference->registerShortcut(action);
520 menu->addAction(action); 517 menu->addAction(action);
521 toolbar->addAction(action); 518 toolbar->addAction(action);
522 519
523 icon = il.load("filesaveas"); 520 icon = il.load("filesaveas");
524 icon.addPixmap(il.loadPixmap("filesaveas-22"));
525 action = new QAction(icon, tr("Save Session &As..."), this); 521 action = new QAction(icon, tr("Save Session &As..."), this);
526 action->setShortcut(tr("Ctrl+Shift+S")); 522 action->setShortcut(tr("Ctrl+Shift+S"));
527 action->setStatusTip(tr("Save the current session into a new %1 session file").arg(QApplication::applicationName())); 523 action->setStatusTip(tr("Save the current session into a new %1 session file").arg(QApplication::applicationName()));
528 connect(action, SIGNAL(triggered()), this, SLOT(saveSessionAs())); 524 connect(action, SIGNAL(triggered()), this, SLOT(saveSessionAs()));
529 menu->addAction(action); 525 menu->addAction(action);