Merge pull request #260 from mjbudd77/master

Added menu and button icons to Qt GUI.
This commit is contained in:
mjbudd77 2020-12-13 22:51:34 -05:00 committed by GitHub
commit f333a62d66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 76 additions and 6 deletions

BIN
icons/application-exit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
icons/camera.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

BIN
icons/graphics-palette.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 464 B

BIN
icons/input-gaming.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
icons/input-keyboard.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 B

BIN
icons/media-record.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
icons/movie.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
icons/power.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
icons/timer.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

BIN
icons/view-fullscreen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

View File

@ -2,5 +2,16 @@
<qresource>
<file>fceux.png</file>
<file>fceux1.png</file>
<file>icons/power.png</file>
<file>icons/media-record.png</file>
<file>icons/application-exit.png</file>
<file>icons/graphics-palette.png</file>
<file>icons/view-fullscreen.png</file>
<file>icons/input-keyboard.png</file>
<file>icons/input-gaming.png</file>
<file>icons/input-gaming-symbolic.png</file>
<file>icons/timer.png</file>
<file>icons/movie.png</file>
<file>icons/camera.png</file>
</qresource>
</RCC>

View File

@ -19,6 +19,9 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
QHBoxLayout *hbox1;
QLabel *lbl;
QPushButton *button;
QStyle *style;
style = this->style();
setWindowTitle( tr("Video Config") );
@ -205,9 +208,11 @@ ConsoleVideoConfDialog_t::ConsoleVideoConfDialog_t(QWidget *parent)
button = new QPushButton( tr("Apply") );
hbox1->addWidget( button );
connect(button, SIGNAL(clicked()), this, SLOT(applyChanges(void)) );
button->setIcon( style->standardIcon( QStyle::SP_DialogApplyButton ) );
button = new QPushButton( tr("Close") );
hbox1->addWidget( button );
button->setIcon( style->standardIcon( QStyle::SP_DialogCloseButton ) );
connect(button, SIGNAL(clicked()), this, SLOT(closeWindow(void)) );
main_vbox->addLayout( hbox1 );

View File

@ -243,6 +243,9 @@ void consoleWin_t::createMainMenu(void)
QMenu *subMenu;
QActionGroup *group;
int useNativeMenuBar;
QStyle *style;
style = this->style();
// This is needed for menu bar to show up on MacOS
g_config->getOption( "SDL.UseNativeMenuBar", &useNativeMenuBar );
@ -257,6 +260,9 @@ void consoleWin_t::createMainMenu(void)
openROM = new QAction(tr("Open ROM"), this);
openROM->setShortcuts(QKeySequence::Open);
openROM->setStatusTip(tr("Open ROM File"));
//openROM->setIcon( QIcon(":icons/rom.png") );
//openROM->setIcon( style->standardIcon( QStyle::SP_FileIcon ) );
openROM->setIcon( style->standardIcon( QStyle::SP_FileDialogStart ) );
connect(openROM, SIGNAL(triggered()), this, SLOT(openROMFile(void)) );
fileMenu->addAction(openROM);
@ -265,6 +271,7 @@ void consoleWin_t::createMainMenu(void)
closeROM = new QAction(tr("Close ROM"), this);
closeROM->setShortcut( QKeySequence(tr("Ctrl+C")));
closeROM->setStatusTip(tr("Close Loaded ROM"));
closeROM->setIcon( style->standardIcon( QStyle::SP_BrowserStop ) );
connect(closeROM, SIGNAL(triggered()), this, SLOT(closeROMCB(void)) );
fileMenu->addAction(closeROM);
@ -285,6 +292,7 @@ void consoleWin_t::createMainMenu(void)
loadStateAct = new QAction(tr("Load State From"), this);
//loadStateAct->setShortcut( QKeySequence(tr("Ctrl+N")));
loadStateAct->setStatusTip(tr("Load State From"));
loadStateAct->setIcon( style->standardIcon( QStyle::SP_FileDialogStart ) );
connect(loadStateAct, SIGNAL(triggered()), this, SLOT(loadStateFrom(void)) );
fileMenu->addAction(loadStateAct);
@ -293,6 +301,7 @@ void consoleWin_t::createMainMenu(void)
saveStateAct = new QAction(tr("Save State As"), this);
//loadStateAct->setShortcut( QKeySequence(tr("Ctrl+N")));
saveStateAct->setStatusTip(tr("Save State As"));
saveStateAct->setIcon( style->standardIcon( QStyle::SP_DialogSaveButton ) );
connect(saveStateAct, SIGNAL(triggered()), this, SLOT(saveStateAs(void)) );
fileMenu->addAction(saveStateAct);
@ -351,6 +360,7 @@ void consoleWin_t::createMainMenu(void)
loadLuaAct = new QAction(tr("Load Lua Script"), this);
//loadLuaAct->setShortcut( QKeySequence(tr("F5")));
loadLuaAct->setStatusTip(tr("Load Lua Script"));
//loadLuaAct->setIcon( QIcon(":icons/lua-logo.png") );
connect(loadLuaAct, SIGNAL(triggered()), this, SLOT(loadLua(void)) );
fileMenu->addAction(loadLuaAct);
@ -364,6 +374,7 @@ void consoleWin_t::createMainMenu(void)
scrShotAct = new QAction(tr("Screenshot"), this);
scrShotAct->setShortcut( QKeySequence(tr("F12")));
scrShotAct->setStatusTip(tr("Screenshot"));
scrShotAct->setIcon( QIcon(":icons/camera.png") );
connect(scrShotAct, SIGNAL(triggered()), this, SLOT(takeScreenShot()));
fileMenu->addAction(scrShotAct);
@ -372,6 +383,8 @@ void consoleWin_t::createMainMenu(void)
quitAct = new QAction(tr("Quit"), this);
quitAct->setShortcut( QKeySequence(tr("Ctrl+Q")));
quitAct->setStatusTip(tr("Quit the Application"));
//quitAct->setIcon( style->standardIcon( QStyle::SP_DialogCloseButton ) );
quitAct->setIcon( QIcon(":icons/application-exit.png") );
connect(quitAct, SIGNAL(triggered()), this, SLOT(closeApp()));
fileMenu->addAction(quitAct);
@ -381,17 +394,19 @@ void consoleWin_t::createMainMenu(void)
optMenu = menuBar()->addMenu(tr("Options"));
// Options -> Input Config
gamePadConfig = new QAction(tr("Input Config"), this);
//gamePadConfig->setShortcut( QKeySequence(tr("Ctrl+C")));
gamePadConfig->setStatusTip(tr("Input Configure"));
connect(gamePadConfig, SIGNAL(triggered()), this, SLOT(openInputConfWin(void)) );
inputConfig = new QAction(tr("Input Config"), this);
//inputConfig->setShortcut( QKeySequence(tr("Ctrl+C")));
inputConfig->setStatusTip(tr("Input Configure"));
inputConfig->setIcon( QIcon(":icons/input-gaming.png") );
connect(inputConfig, SIGNAL(triggered()), this, SLOT(openInputConfWin(void)) );
optMenu->addAction(gamePadConfig);
optMenu->addAction(inputConfig);
// Options -> GamePad Config
gamePadConfig = new QAction(tr("GamePad Config"), this);
//gamePadConfig->setShortcut( QKeySequence(tr("Ctrl+C")));
gamePadConfig->setStatusTip(tr("GamePad Configure"));
gamePadConfig->setIcon( QIcon(":icons/input-gaming-symbolic.png") );
connect(gamePadConfig, SIGNAL(triggered()), this, SLOT(openGamePadConfWin(void)) );
optMenu->addAction(gamePadConfig);
@ -400,6 +415,7 @@ void consoleWin_t::createMainMenu(void)
gameSoundConfig = new QAction(tr("Sound Config"), this);
//gameSoundConfig->setShortcut( QKeySequence(tr("Ctrl+C")));
gameSoundConfig->setStatusTip(tr("Sound Configure"));
gameSoundConfig->setIcon( style->standardIcon( QStyle::SP_MediaVolume ) );
connect(gameSoundConfig, SIGNAL(triggered()), this, SLOT(openGameSndConfWin(void)) );
optMenu->addAction(gameSoundConfig);
@ -408,6 +424,7 @@ void consoleWin_t::createMainMenu(void)
gameVideoConfig = new QAction(tr("Video Config"), this);
//gameVideoConfig->setShortcut( QKeySequence(tr("Ctrl+C")));
gameVideoConfig->setStatusTip(tr("Video Preferences"));
gameVideoConfig->setIcon( style->standardIcon( QStyle::SP_ComputerIcon ) );
connect(gameVideoConfig, SIGNAL(triggered()), this, SLOT(openGameVideoConfWin(void)) );
optMenu->addAction(gameVideoConfig);
@ -416,6 +433,7 @@ void consoleWin_t::createMainMenu(void)
hotkeyConfig = new QAction(tr("Hotkey Config"), this);
//hotkeyConfig->setShortcut( QKeySequence(tr("Ctrl+C")));
hotkeyConfig->setStatusTip(tr("Hotkey Configure"));
hotkeyConfig->setIcon( QIcon(":icons/input-keyboard.png") );
connect(hotkeyConfig, SIGNAL(triggered()), this, SLOT(openHotkeyConfWin(void)) );
optMenu->addAction(hotkeyConfig);
@ -424,6 +442,7 @@ void consoleWin_t::createMainMenu(void)
paletteConfig = new QAction(tr("Palette Config"), this);
//paletteConfig->setShortcut( QKeySequence(tr("Ctrl+C")));
paletteConfig->setStatusTip(tr("Palette Configure"));
paletteConfig->setIcon( QIcon(":icons/graphics-palette.png") );
connect(paletteConfig, SIGNAL(triggered()), this, SLOT(openPaletteConfWin(void)) );
optMenu->addAction(paletteConfig);
@ -432,6 +451,7 @@ void consoleWin_t::createMainMenu(void)
guiConfig = new QAction(tr("GUI Config"), this);
//guiConfig->setShortcut( QKeySequence(tr("Ctrl+C")));
guiConfig->setStatusTip(tr("GUI Configure"));
guiConfig->setIcon( style->standardIcon( QStyle::SP_TitleBarNormalButton ) );
connect(guiConfig, SIGNAL(triggered()), this, SLOT(openGuiConfWin(void)) );
optMenu->addAction(guiConfig);
@ -440,6 +460,7 @@ void consoleWin_t::createMainMenu(void)
timingConfig = new QAction(tr("Timing Config"), this);
//timingConfig->setShortcut( QKeySequence(tr("Ctrl+C")));
timingConfig->setStatusTip(tr("Timing Configure"));
timingConfig->setIcon( QIcon(":icons/timer.png") );
connect(timingConfig, SIGNAL(triggered()), this, SLOT(openTimingConfWin(void)) );
optMenu->addAction(timingConfig);
@ -448,6 +469,7 @@ void consoleWin_t::createMainMenu(void)
movieConfig = new QAction(tr("Movie Options"), this);
//movieConfig->setShortcut( QKeySequence(tr("Ctrl+C")));
movieConfig->setStatusTip(tr("Movie Options"));
movieConfig->setIcon( QIcon(":icons/movie.png") );
connect(movieConfig, SIGNAL(triggered()), this, SLOT(openMovieOptWin(void)) );
optMenu->addAction(movieConfig);
@ -466,8 +488,9 @@ void consoleWin_t::createMainMenu(void)
// Options -> Full Screen
fullscreen = new QAction(tr("Fullscreen"), this);
fullscreen->setShortcut( QKeySequence(tr("Alt+Return")));
//fullscreen->setCheckable(true);
fullscreen->setStatusTip(tr("Fullscreen"));
//fullscreen->setIcon( style->standardIcon( QStyle::SP_TitleBarMaxButton ) );
fullscreen->setIcon( QIcon(":icons/view-fullscreen.png") );
connect(fullscreen, SIGNAL(triggered()), this, SLOT(toggleFullscreen(void)) );
optMenu->addAction(fullscreen);
@ -480,6 +503,7 @@ void consoleWin_t::createMainMenu(void)
powerAct = new QAction(tr("Power"), this);
//powerAct->setShortcut( QKeySequence(tr("Ctrl+P")));
powerAct->setStatusTip(tr("Power On Console"));
powerAct->setIcon( QIcon(":icons/power.png") );
connect(powerAct, SIGNAL(triggered()), this, SLOT(powerConsoleCB(void)) );
emuMenu->addAction(powerAct);
@ -488,6 +512,7 @@ void consoleWin_t::createMainMenu(void)
resetAct = new QAction(tr("Reset"), this);
//resetAct->setShortcut( QKeySequence(tr("Ctrl+R")));
resetAct->setStatusTip(tr("Reset Console"));
resetAct->setIcon( style->standardIcon( QStyle::SP_DialogResetButton ) );
connect(resetAct, SIGNAL(triggered()), this, SLOT(consoleHardReset(void)) );
emuMenu->addAction(resetAct);
@ -496,6 +521,7 @@ void consoleWin_t::createMainMenu(void)
sresetAct = new QAction(tr("Soft Reset"), this);
//sresetAct->setShortcut( QKeySequence(tr("Ctrl+R")));
sresetAct->setStatusTip(tr("Soft Reset of Console"));
sresetAct->setIcon( style->standardIcon( QStyle::SP_BrowserReload ) );
connect(sresetAct, SIGNAL(triggered()), this, SLOT(consoleSoftReset(void)) );
emuMenu->addAction(sresetAct);
@ -504,6 +530,7 @@ void consoleWin_t::createMainMenu(void)
pauseAct = new QAction(tr("Pause"), this);
pauseAct->setShortcut( QKeySequence(tr("Pause")));
pauseAct->setStatusTip(tr("Pause Console"));
pauseAct->setIcon( style->standardIcon( QStyle::SP_MediaPause ) );
connect(pauseAct, SIGNAL(triggered()), this, SLOT(consolePause(void)) );
emuMenu->addAction(pauseAct);
@ -577,6 +604,7 @@ void consoleWin_t::createMainMenu(void)
act = new QAction(tr("Speed Up"), this);
act->setShortcut( QKeySequence(tr("=")));
act->setStatusTip(tr("Speed Up"));
act->setIcon( style->standardIcon( QStyle::SP_MediaSeekForward ) );
connect(act, SIGNAL(triggered()), this, SLOT(emuSpeedUp(void)) );
subMenu->addAction(act);
@ -585,6 +613,7 @@ void consoleWin_t::createMainMenu(void)
act = new QAction(tr("Slow Down"), this);
act->setShortcut( QKeySequence(tr("-")));
act->setStatusTip(tr("Slow Down"));
act->setIcon( style->standardIcon( QStyle::SP_MediaSeekBackward ) );
connect(act, SIGNAL(triggered()), this, SLOT(emuSlowDown(void)) );
subMenu->addAction(act);
@ -595,6 +624,7 @@ void consoleWin_t::createMainMenu(void)
act = new QAction(tr("Slowest"), this);
//act->setShortcut( QKeySequence(tr("-")));
act->setStatusTip(tr("Slowest"));
act->setIcon( style->standardIcon( QStyle::SP_MediaSkipBackward ) );
connect(act, SIGNAL(triggered()), this, SLOT(emuSlowestSpd(void)) );
subMenu->addAction(act);
@ -603,6 +633,7 @@ void consoleWin_t::createMainMenu(void)
act = new QAction(tr("Normal"), this);
//act->setShortcut( QKeySequence(tr("-")));
act->setStatusTip(tr("Normal"));
act->setIcon( style->standardIcon( QStyle::SP_MediaPlay ) );
connect(act, SIGNAL(triggered()), this, SLOT(emuNormalSpd(void)) );
subMenu->addAction(act);
@ -611,6 +642,7 @@ void consoleWin_t::createMainMenu(void)
act = new QAction(tr("Turbo"), this);
//act->setShortcut( QKeySequence(tr("-")));
act->setStatusTip(tr("Turbo (Fastest)"));
act->setIcon( style->standardIcon( QStyle::SP_MediaSkipForward ) );
connect(act, SIGNAL(triggered()), this, SLOT(emuFastestSpd(void)) );
subMenu->addAction(act);
@ -745,6 +777,7 @@ void consoleWin_t::createMainMenu(void)
openMovAct = new QAction(tr("Play"), this);
openMovAct->setShortcut( QKeySequence(tr("Shift+F7")));
openMovAct->setStatusTip(tr("Play Movie File"));
openMovAct->setIcon( style->standardIcon( QStyle::SP_MediaPlay ) );
connect(openMovAct, SIGNAL(triggered()), this, SLOT(openMovie(void)) );
movieMenu->addAction(openMovAct);
@ -753,6 +786,7 @@ void consoleWin_t::createMainMenu(void)
stopMovAct = new QAction(tr("Stop"), this);
//stopMovAct->setShortcut( QKeySequence(tr("Shift+F7")));
stopMovAct->setStatusTip(tr("Stop Movie Recording"));
stopMovAct->setIcon( style->standardIcon( QStyle::SP_MediaStop ) );
connect(stopMovAct, SIGNAL(triggered()), this, SLOT(stopMovie(void)) );
movieMenu->addAction(stopMovAct);
@ -763,6 +797,7 @@ void consoleWin_t::createMainMenu(void)
recMovAct = new QAction(tr("Record"), this);
recMovAct->setShortcut( QKeySequence(tr("Shift+F5")));
recMovAct->setStatusTip(tr("Record Movie"));
recMovAct->setIcon( QIcon(":icons/media-record.png") );
connect(recMovAct, SIGNAL(triggered()), this, SLOT(recordMovie(void)) );
movieMenu->addAction(recMovAct);
@ -782,6 +817,7 @@ void consoleWin_t::createMainMenu(void)
// Help -> About FCEUX
aboutAct = new QAction(tr("About FCEUX"), this);
aboutAct->setStatusTip(tr("About FCEUX"));
aboutAct->setIcon( style->standardIcon( QStyle::SP_MessageBoxInformation ) );
connect(aboutAct, SIGNAL(triggered()), this, SLOT(aboutFCEUX(void)) );
helpMenu->addAction(aboutAct);
@ -789,6 +825,7 @@ void consoleWin_t::createMainMenu(void)
// Help -> About Qt
aboutActQt = new QAction(tr("About Qt"), this);
aboutActQt->setStatusTip(tr("About Qt"));
aboutActQt->setIcon( style->standardIcon( QStyle::SP_TitleBarMenuButton ) );
connect(aboutActQt, SIGNAL(triggered()), this, SLOT(aboutQt(void)) );
helpMenu->addAction(aboutActQt);
@ -796,6 +833,7 @@ void consoleWin_t::createMainMenu(void)
// Help -> Message Log
msgLogAct = new QAction(tr("Message Log"), this);
msgLogAct->setStatusTip(tr("Message Log"));
msgLogAct->setIcon( style->standardIcon( QStyle::SP_MessageBoxWarning ) );
connect(msgLogAct, SIGNAL(triggered()), this, SLOT(openMsgLogWin(void)) );
helpMenu->addAction(msgLogAct);

View File

@ -107,6 +107,7 @@ class consoleWin_t : public QMainWindow
QAction *loadLuaAct;
QAction *scrShotAct;
QAction *quitAct;
QAction *inputConfig;
QAction *gamePadConfig;
QAction *gameSoundConfig;
QAction *gameVideoConfig;

View File

@ -81,9 +81,12 @@ GamePadConfDialog_t::GamePadConfDialog_t(QWidget *parent)
QPushButton *closebutton;
QPushButton *clearButton[GAMEPAD_NUM_BUTTONS];
QScrollArea *scroll;
QStyle *style;
std::string prefix;
char stmp[256];
style = this->style();
gamePadConfWin = this;
// Ensure that joysticks are enabled, no harm calling init again.
@ -174,10 +177,12 @@ GamePadConfDialog_t::GamePadConfDialog_t(QWidget *parent)
applyProfileButton = new QPushButton( tr("Load") );
applyProfileButton->setWhatsThis(tr("Sets Current Active Map to the Selected Profile"));
applyProfileButton->setIcon( style->standardIcon( QStyle::SP_DialogApplyButton ) );
hbox->addWidget( applyProfileButton );
saveProfileButton = new QPushButton( tr("Save") );
saveProfileButton->setWhatsThis(tr("Stores Current Active Map to the Selected Profile"));
saveProfileButton->setIcon( style->standardIcon( QStyle::SP_DialogSaveButton ) );
hbox->addWidget( saveProfileButton );
hbox = new QHBoxLayout();
@ -185,10 +190,12 @@ GamePadConfDialog_t::GamePadConfDialog_t(QWidget *parent)
newProfileButton = new QPushButton( tr("New") );
newProfileButton->setWhatsThis(tr("Create a New Map Profile"));
newProfileButton->setIcon( style->standardIcon( QStyle::SP_FileIcon ) );
hbox->addWidget( newProfileButton );
removeProfileButton = new QPushButton( tr("Delete") );
removeProfileButton->setWhatsThis(tr("Deletes the Selected Map Profile"));
removeProfileButton->setIcon( style->standardIcon( QStyle::SP_TrashIcon ) );
hbox->addWidget( removeProfileButton );
mapMsg = new QLabel();
@ -242,6 +249,9 @@ GamePadConfDialog_t::GamePadConfDialog_t(QWidget *parent)
clearAllButton = new QPushButton(tr("Clear All"));
closebutton = new QPushButton(tr("Close"));
clearAllButton->setIcon( style->standardIcon( QStyle::SP_LineEditClearButton ) );
closebutton->setIcon( style->standardIcon( QStyle::SP_DialogCloseButton ) );
hbox4->addWidget( clearAllButton );
hbox4->addWidget( closebutton );

View File

@ -32,10 +32,13 @@ PaletteConfDialog_t::PaletteConfDialog_t(QWidget *parent)
//QPushButton *closebutton;
QPushButton *button;
QTextEdit *comments;
QStyle *style;
int hue, tint;
char stmp[64];
std::string paletteFile;
style = this->style();
resize( 512, 600 );
// sync with config
@ -63,6 +66,7 @@ PaletteConfDialog_t::PaletteConfDialog_t(QWidget *parent)
connect(deemphSwap, SIGNAL(stateChanged(int)), this, SLOT(deemphswap_Changed(int)) );
button = new QPushButton( tr("Open Palette") );
button->setIcon( style->standardIcon( QStyle::SP_FileDialogStart ) );
hbox1->addWidget( button );
connect( button, SIGNAL(clicked(void)), this, SLOT(openPaletteFile(void)) );
@ -81,6 +85,7 @@ PaletteConfDialog_t::PaletteConfDialog_t(QWidget *parent)
button = new QPushButton( tr("Clear") );
button->setIcon( style->standardIcon( QStyle::SP_LineEditClearButton ) );
hbox1->addWidget( button );
connect( button, SIGNAL(clicked(void)), this, SLOT(clearPalette(void)) );