Qt: Fix CD-ROM menu not updating after ejecting a CD from the guest
This commit is contained in:
@@ -521,6 +521,23 @@ MediaMenu::cdromReload(int index, int slot)
|
||||
ui_sb_update_tip(SB_CDROM | index);
|
||||
}
|
||||
|
||||
void
|
||||
MediaMenu::cdromUpdateUi(int i)
|
||||
{
|
||||
cdrom_t *drv = &cdrom[i];
|
||||
|
||||
if (drv->host_drive == 0) {
|
||||
mhm.addImageToHistory(i, ui::MediaType::Optical, drv->prev_image_path, QString());
|
||||
ui_sb_update_icon_state(SB_CDROM | i, 1);
|
||||
} else {
|
||||
mhm.addImageToHistory(i, ui::MediaType::Optical, drv->prev_image_path, drv->image_path);
|
||||
ui_sb_update_icon_state(SB_CDROM | i, 0);
|
||||
}
|
||||
|
||||
cdromUpdateMenu(i);
|
||||
ui_sb_update_tip(SB_CDROM | i);
|
||||
}
|
||||
|
||||
void
|
||||
MediaMenu::updateImageHistory(int index, int slot, ui::MediaType type)
|
||||
{
|
||||
@@ -892,6 +909,12 @@ MediaMenu::getMediaOpenDirectory()
|
||||
// callbacks from 86box C code
|
||||
extern "C" {
|
||||
|
||||
void
|
||||
plat_cdrom_ui_update(uint8_t id, uint8_t reload)
|
||||
{
|
||||
MediaMenu::ptr->cdromUpdateUi(id);
|
||||
}
|
||||
|
||||
void
|
||||
zip_eject(uint8_t id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user