summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/filemngr.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-12-20 15:28:27 +1100
committer Vas Crabb <vas@vastheman.com>2020-12-20 15:28:27 +1100
commited872d1bd2a8c50086c1fe4f97420a065f249eb1 (patch)
tree2f1edc26b22ac9f9e30bd218600161d9529e6b69 /src/frontend/mame/ui/filemngr.cpp
parent25294ce9cdd4dde807f931fc2e28046db3b4ad39 (diff)
Fix some oversights and emergent behaviour with view selection.
Exposed the "native snapview" option on the video manager. Trying to use presence of a single view is a poor proxy that breaks with multi-screen systems. Allow rotation to be changed for native snapshot views, and disable the zoom to screen area control when it has no effect on the selected view. Treat an empty string identically to "auto" for view selectction. Previously this was being used for prefix matching so it would force the first view. (This caused the bad snapshot view selection. It had been relying on "internal" not being a common view name prefix so it fell through to automatic selection, but when changed to an empty string it forced the first view.) Documented "auto" as well as "native" for the -snapview option and changed the default to auto rather than an empty string for consistency with the -viewN options. Added [w]string_view handlers to the stuff that's instantiated in strformat.cpp since we'll be increasingly using them. Cleaned up and updated some documentation.
Diffstat (limited to 'src/frontend/mame/ui/filemngr.cpp')
-rw-r--r--src/frontend/mame/ui/filemngr.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/frontend/mame/ui/filemngr.cpp b/src/frontend/mame/ui/filemngr.cpp
index 69a3b5ca5fa..1ef861e5475 100644
--- a/src/frontend/mame/ui/filemngr.cpp
+++ b/src/frontend/mame/ui/filemngr.cpp
@@ -12,17 +12,19 @@
*********************************************************************/
#include "emu.h"
-#include "ui/ui.h"
-#include "ui/menu.h"
#include "ui/filemngr.h"
+
#include "ui/filesel.h"
-#include "ui/miscmenu.h"
-#include "ui/imgcntrl.h"
#include "ui/floppycntrl.h"
+#include "ui/imgcntrl.h"
+#include "ui/miscmenu.h"
+#include "ui/ui.h"
+
#include "softlist.h"
namespace ui {
+
/***************************************************************************
FILE MANAGER
***************************************************************************/
@@ -168,7 +170,7 @@ void menu_file_manager::handle()
{
// process the menu
const event *event = process(0);
- if (event != nullptr && event->itemref != nullptr && event->iptkey == IPT_UI_SELECT)
+ if (event && event->itemref && (event->iptkey == IPT_UI_SELECT))
{
if ((uintptr_t)event->itemref == 1)
{
@@ -177,18 +179,15 @@ void menu_file_manager::handle()
else
{
selected_device = (device_image_interface *) event->itemref;
- if (selected_device != nullptr)
+ if (selected_device)
{
m_curr_selected = true;
floppy_image_device *floppy_device = dynamic_cast<floppy_image_device *>(selected_device);
- if (floppy_device != nullptr)
- {
+ if (floppy_device)
menu::stack_push<menu_control_floppy_image>(ui(), container(), *floppy_device);
- }
else
- {
menu::stack_push<menu_control_device_image>(ui(), container(), *selected_device);
- }
+
// reset the existing menu
reset(reset_options::REMEMBER_POSITION);
}