| 45 | } |
| 46 | |
| 47 | void TemplateManager::addMenu() |
| 48 | { |
| 49 | auto &ctx = dpfInstance.serviceContext(); |
| 50 | auto windowService = ctx.service<WindowService>(WindowService::name()); |
| 51 | if (!windowService) |
| 52 | return; |
| 53 | |
| 54 | auto mFile = ActionManager::instance()->actionContainer(M_FILE); |
| 55 | auto actionInit = [&](QAction *action, QString actionID, QKeySequence key, QString iconFileName){ |
| 56 | action->setIcon(QIcon::fromTheme(iconFileName)); |
| 57 | auto cmd = ActionManager::instance()->registerAction(action, actionID); |
| 58 | cmd->setDefaultKeySequence(key); |
| 59 | mFile->addAction(cmd, G_FILE_NEW); |
| 60 | }; |
| 61 | |
| 62 | d->newAction.reset(new QAction(MWMFA_NEW_FILE_OR_PROJECT, this)); |
| 63 | actionInit(d->newAction.get(), |
| 64 | "File.New.FileOrProject", |
| 65 | QKeySequence(Qt::Modifier::CTRL | Qt::Modifier::SHIFT | Qt::Key::Key_O), QString()); |
| 66 | QObject::connect(d->newAction.get(), &QAction::triggered, |
| 67 | this, &TemplateManager::newWizard, Qt::DirectConnection); |
| 68 | } |
| 69 | |
| 70 | void TemplateManager::newWizard() |
| 71 | { |
no test coverage detected