fix bug with the GBA addon menu (and make it a proper list so we don't have to hardcode the length all over)
This commit is contained in:
parent
079341f102
commit
6d3ea6a485
|
@ -311,14 +311,17 @@ MainWindow::MainWindow(int id, EmuInstance* inst, QWidget* parent) :
|
||||||
|
|
||||||
{
|
{
|
||||||
QMenu* submenu = menu->addMenu("Insert add-on cart");
|
QMenu* submenu = menu->addMenu("Insert add-on cart");
|
||||||
|
QAction* act;
|
||||||
|
|
||||||
actInsertGBAAddon[0] = submenu->addAction("Memory expansion");
|
act = submenu->addAction("Memory expansion");
|
||||||
actInsertGBAAddon[0]->setData(QVariant(GBAAddon_RAMExpansion));
|
act->setData(QVariant(GBAAddon_RAMExpansion));
|
||||||
connect(actInsertGBAAddon[0], &QAction::triggered, this, &MainWindow::onInsertGBAAddon);
|
connect(act, &QAction::triggered, this, &MainWindow::onInsertGBAAddon);
|
||||||
|
actInsertGBAAddon.append(act);
|
||||||
|
|
||||||
actInsertGBAAddon[1] = submenu->addAction("Rumble Pak");
|
act = submenu->addAction("Rumble Pak");
|
||||||
actInsertGBAAddon[1]->setData(QVariant(GBAAddon_RumblePak));
|
act->setData(QVariant(GBAAddon_RumblePak));
|
||||||
connect(actInsertGBAAddon[1], &QAction::triggered, this, &MainWindow::onInsertGBAAddon);
|
connect(act, &QAction::triggered, this, &MainWindow::onInsertGBAAddon);
|
||||||
|
actInsertGBAAddon.append(act);
|
||||||
}
|
}
|
||||||
|
|
||||||
actEjectGBACart = menu->addAction("Eject cart");
|
actEjectGBACart = menu->addAction("Eject cart");
|
||||||
|
@ -673,8 +676,8 @@ MainWindow::MainWindow(int id, EmuInstance* inst, QWidget* parent) :
|
||||||
if (globalCfg.GetInt("Emu.ConsoleType") == 1)
|
if (globalCfg.GetInt("Emu.ConsoleType") == 1)
|
||||||
{
|
{
|
||||||
actInsertGBACart->setEnabled(false);
|
actInsertGBACart->setEnabled(false);
|
||||||
for (int i = 0; i < 1; i++)
|
for (auto act : actInsertGBAAddon)
|
||||||
actInsertGBAAddon[i]->setEnabled(false);
|
act->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 9; i++)
|
for (int i = 0; i < 9; i++)
|
||||||
|
@ -1700,15 +1703,15 @@ void MainWindow::onEmuSettingsDialogFinished(int res)
|
||||||
if (globalCfg.GetInt("Emu.ConsoleType") == 1)
|
if (globalCfg.GetInt("Emu.ConsoleType") == 1)
|
||||||
{
|
{
|
||||||
actInsertGBACart->setEnabled(false);
|
actInsertGBACart->setEnabled(false);
|
||||||
for (int i = 0; i < 1; i++)
|
for (auto act : actInsertGBAAddon)
|
||||||
actInsertGBAAddon[i]->setEnabled(false);
|
act->setEnabled(false);
|
||||||
actEjectGBACart->setEnabled(false);
|
actEjectGBACart->setEnabled(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
actInsertGBACart->setEnabled(true);
|
actInsertGBACart->setEnabled(true);
|
||||||
for (int i = 0; i < 1; i++)
|
for (auto act : actInsertGBAAddon)
|
||||||
actInsertGBAAddon[i]->setEnabled(true);
|
act->setEnabled(true);
|
||||||
actEjectGBACart->setEnabled(emuInstance->gbaCartInserted());
|
actEjectGBACart->setEnabled(emuInstance->gbaCartInserted());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -269,7 +269,7 @@ public:
|
||||||
QAction* actEjectCart;
|
QAction* actEjectCart;
|
||||||
QAction* actCurrentGBACart;
|
QAction* actCurrentGBACart;
|
||||||
QAction* actInsertGBACart;
|
QAction* actInsertGBACart;
|
||||||
QAction* actInsertGBAAddon[2];
|
QList<QAction*> actInsertGBAAddon;
|
||||||
QAction* actEjectGBACart;
|
QAction* actEjectGBACart;
|
||||||
QAction* actImportSavefile;
|
QAction* actImportSavefile;
|
||||||
QAction* actSaveState[9];
|
QAction* actSaveState[9];
|
||||||
|
|
Loading…
Reference in New Issue