MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / createInstanceActions

Method createInstanceActions

launcher/ui/MainWindow.cpp:647–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

645 }
646
647 void createInstanceActions(QMainWindow *MainWindow)
648 {
649 // NOTE: not added to toolbar, but used for instance context menu (right click)
650 actionChangeInstIcon = TranslatedAction(MainWindow);
651 actionChangeInstIcon->setObjectName(QStringLiteral("actionChangeInstIcon"));
652 actionChangeInstIcon->setIcon(QIcon(":/icons/instances/grass"));
653 actionChangeInstIcon->setIconVisibleInMenu(true);
654 actionChangeInstIcon.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Change Icon"));
655 actionChangeInstIcon.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Change the selected instance's icon."));
656 all_actions.append(&actionChangeInstIcon);
657
658 changeIconButton = new LabeledToolButton(MainWindow);
659 changeIconButton->setObjectName(QStringLiteral("changeIconButton"));
660 changeIconButton->setIcon(APPLICATION->getThemedIcon("news"));
661 changeIconButton->setToolTip(actionChangeInstIcon->toolTip());
662 changeIconButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
663
664 // NOTE: not added to toolbar, but used for instance context menu (right click)
665 actionRenameInstance = TranslatedAction(MainWindow);
666 actionRenameInstance->setObjectName(QStringLiteral("actionRenameInstance"));
667 actionRenameInstance.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Rename"));
668 actionRenameInstance.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Rename the selected instance."));
669 all_actions.append(&actionRenameInstance);
670
671 // the rename label is inside the rename tool button
672 renameButton = new LabeledToolButton(MainWindow);
673 renameButton->setObjectName(QStringLiteral("renameButton"));
674 renameButton->setToolTip(actionRenameInstance->toolTip());
675 renameButton->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
676
677 actionLaunchInstance = TranslatedAction(MainWindow);
678 actionLaunchInstance->setObjectName(QStringLiteral("actionLaunchInstance"));
679 actionLaunchInstance.setTextId(QT_TRANSLATE_NOOP("MainWindow", "&Launch"));
680 actionLaunchInstance.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Launch the selected instance."));
681 all_actions.append(&actionLaunchInstance);
682
683 actionLaunchInstanceOffline = TranslatedAction(MainWindow);
684 actionLaunchInstanceOffline->setObjectName(QStringLiteral("actionLaunchInstanceOffline"));
685 actionLaunchInstanceOffline.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Launch &Offline"));
686 actionLaunchInstanceOffline.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Launch the selected instance in offline mode."));
687 all_actions.append(&actionLaunchInstanceOffline);
688
689 actionLaunchInstanceDemo = TranslatedAction(MainWindow);
690 actionLaunchInstanceDemo->setObjectName(QStringLiteral("actionLaunchInstanceDemo"));
691 actionLaunchInstanceDemo.setTextId(QT_TRANSLATE_NOOP("MainWindow", "Launch &Demo"));
692 actionLaunchInstanceDemo.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Launch the selected instance in demo mode."));
693 all_actions.append(&actionLaunchInstanceDemo);
694
695 actionKillInstance = TranslatedAction(MainWindow);
696 actionKillInstance->setObjectName(QStringLiteral("actionKillInstance"));
697 actionKillInstance->setDisabled(true);
698 actionKillInstance.setTextId(QT_TRANSLATE_NOOP("MainWindow", "&Kill"));
699 actionKillInstance.setTooltipId(QT_TRANSLATE_NOOP("MainWindow", "Kill the running instance"));
700 actionKillInstance->setShortcut(QKeySequence(tr("Ctrl+K")));
701 all_actions.append(&actionKillInstance);
702
703 actionEditInstance = TranslatedAction(MainWindow);
704 actionEditInstance->setObjectName(QStringLiteral("actionEditInstance"));

Callers

nothing calls this directly

Calls 5

setTextIdMethod · 0.80
setTooltipIdMethod · 0.80
appendMethod · 0.80
getThemedIconMethod · 0.80
setIconMethod · 0.45

Tested by

no test coverage detected