---------------------------------------------------------------------------
| 897 | } |
| 898 | //--------------------------------------------------------------------------- |
| 899 | void 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); |
nothing calls this directly
no test coverage detected