1 #include "platform/wxwidgets/window-romload.hpp"
2 #include "platform/wxwidgets/platform.hpp"
3 #include "interface/romtype.hpp"
4 #include "core/misc.hpp"
10 wxwindow_romload::wxwindow_romload(const std::string
& _path
)
15 bool wxwindow_romload::show(wxWindow
* parent
)
18 std::map
<int, std::string
> cores
;
19 std::map
<int, std::string
> types
;
20 std::map
<int, std::string
> exts
;
21 std::string spec
= "All Files (*)|*.*";
24 //Collect all extensions.
25 for(auto i
: core_type::get_core_types())
27 cores
[nent
] = i
->get_core_identifier();
28 types
[nent
] = i
->get_hname();
30 for(auto j
: i
->get_extensions()) {
32 exts
[nent
] = exts
[nent
] + ";";
34 exts
[nent
] = exts
[nent
] + "*." + j
;
38 spec
= spec
+ "|" + mangle_name(cores
[nent
]) + " / " + mangle_name(types
[nent
]) +
39 "(" + exts
[nent
] + ")|" + exts
[nent
];
42 wxFileDialog
* d
= new wxFileDialog(parent
, towxstring("Choose ROM to load"), towxstring(path
),
43 towxstring(""), towxstring(spec
), wxFD_OPEN
);
44 int r
= d
->ShowModal();
45 if(r
== wxID_CANCEL
) {
49 filename
= tostdstring(d
->GetPath());
50 int idx
= d
->GetFilterIndex();