MCPcopy Create free account
hub / github.com/TASEmulators/fceux / createMainMenu

Method createMainMenu

src/drivers/Qt/ConsoleWindow.cpp:899–1966  ·  view source on GitHub ↗

---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

897}
898//---------------------------------------------------------------------------
899void consoleWin_t::createMainMenu(void)
900{
901 QAction *act;
902 QMenu *subMenu;
903 QActionGroup *group;
904 int useNativeMenuBar;
905 int customAutofireOnFrames, customAutofireOffFrames;
906 //QShortcut *shortcut;
907
908 menubar = new consoleMenuBar(this);
909
910 this->setMenuBar(menubar);
911
912 // This is needed for menu bar to show up on MacOS
913 g_config->getOption( "SDL.UseNativeMenuBar", &useNativeMenuBar );
914
915 menubar->setNativeMenuBar( useNativeMenuBar ? true : false );
916
917 // Top Level Menu Iterms
918 fileMenu = menubar->addMenu(tr("&File"));
919 movieMenu = menubar->addMenu(tr("&Movie"));
920 optMenu = menubar->addMenu(tr("&Options"));
921 emuMenu = menubar->addMenu(tr("&Emulation"));
922 toolsMenu = menubar->addMenu(tr("&Tools"));
923 debugMenu = menubar->addMenu(tr("&Debug"));
924 helpMenu = menubar->addMenu(tr("&Help"));
925
926 //-----------------------------------------------------------------------
927 // File
928
929 connect( fileMenu, SIGNAL(aboutToShow(void)), this, SLOT(mainMenuOpen(void)) );
930 connect( fileMenu, SIGNAL(aboutToHide(void)), this, SLOT(mainMenuClose(void)) );
931
932 // File -> Open ROM
933 openROM = new QAction(tr("&Open ROM"), this);
934 //openROM->setShortcuts(QKeySequence::Open);
935 openROM->setStatusTip(tr("Open ROM File"));
936 //openROM->setIcon( QIcon(":icons/rom.png") );
937 //openROM->setIcon( style->standardIcon( QStyle::SP_FileIcon ) );
938 openROM->setIcon( style()->standardIcon( QStyle::SP_FileDialogStart ) );
939 connect(openROM, SIGNAL(triggered()), this, SLOT(openROMFile(void)) );
940
941 Hotkeys[ HK_OPEN_ROM ].setAction( openROM );
942 connect( Hotkeys[ HK_OPEN_ROM ].getShortcut(), SIGNAL(activated()), this, SLOT(openROMFile(void)) );
943
944 fileMenu->addAction(openROM);
945
946 // File -> Close ROM
947 closeROM = new QAction(tr("&Close ROM"), this);
948 //closeROM->setShortcut( QKeySequence(tr("Ctrl+C")));
949 closeROM->setStatusTip(tr("Close Loaded ROM"));
950 closeROM->setIcon( style()->standardIcon( QStyle::SP_BrowserStop ) );
951 connect(closeROM, SIGNAL(triggered()), this, SLOT(closeROMCB(void)) );
952
953 Hotkeys[ HK_CLOSE_ROM ].setAction( closeROM );
954 connect( Hotkeys[ HK_CLOSE_ROM ].getShortcut(), SIGNAL(activated()), this, SLOT(closeROMCB(void)) );
955
956 fileMenu->addAction(closeROM);

Callers

nothing calls this directly

Calls 15

loadNSFFunction · 0.85
loadStateFromFunction · 0.85
saveStateAsFunction · 0.85
quickLoadFunction · 0.85
quickSaveFunction · 0.85
loadLuaFunction · 0.85
toggleAutoResumeFunction · 0.85
toggleMenuVisFunction · 0.85
fceuLoadConfigColorFunction · 0.85
FCEUI_GetRegionFunction · 0.85
recordMovieFunction · 0.85
getOptionMethod · 0.80

Tested by

no test coverage detected