mirror of
https://github.com/holub/mame
synced 2025-06-08 13:53:52 +03:00
Merge pull request #1031 from npwoods/fix_create_determination
Fixes how the file selection dialog determines when to show [create]
This commit is contained in:
commit
711eb65ece
@ -560,7 +560,7 @@ void menu_file_selector::populate()
|
|||||||
append_entry(SELECTOR_ENTRY_TYPE_EMPTY, "", "");
|
append_entry(SELECTOR_ENTRY_TYPE_EMPTY, "", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_has_create)
|
if (m_has_create && !util::zippath_is_zip(directory))
|
||||||
{
|
{
|
||||||
// add the "[create]" entry
|
// add the "[create]" entry
|
||||||
append_entry(SELECTOR_ENTRY_TYPE_CREATE, "", "");
|
append_entry(SELECTOR_ENTRY_TYPE_CREATE, "", "");
|
||||||
|
@ -177,16 +177,8 @@ void menu_control_device_image::handle()
|
|||||||
{
|
{
|
||||||
switch(state) {
|
switch(state) {
|
||||||
case START_FILE: {
|
case START_FILE: {
|
||||||
bool can_create = false;
|
|
||||||
if(image->is_creatable()) {
|
|
||||||
util::zippath_directory *directory = nullptr;
|
|
||||||
osd_file::error err = util::zippath_opendir(current_directory.c_str(), &directory);
|
|
||||||
can_create = err == osd_file::error::NONE && !util::zippath_is_zip(directory);
|
|
||||||
if(directory)
|
|
||||||
util::zippath_closedir(directory);
|
|
||||||
}
|
|
||||||
submenu_result = -1;
|
submenu_result = -1;
|
||||||
menu::stack_push<menu_file_selector>(ui(), container, image, current_directory, current_file, true, image->image_interface()!=nullptr, can_create, &submenu_result);
|
menu::stack_push<menu_file_selector>(ui(), container, image, current_directory, current_file, true, image->image_interface()!=nullptr, image->is_creatable(), &submenu_result);
|
||||||
state = SELECT_FILE;
|
state = SELECT_FILE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user