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
)
17 std::map
<int, std::string
> cores
;
18 std::map
<int, std::string
> types
;
19 std::map
<int, std::string
> exts
;
20 std::string spec
= "All Files (*)|*.*";
23 //Collect all extensions.
24 for(auto i
: core_type::get_core_types())
26 cores
[nent
] = i
->get_core_identifier();
27 types
[nent
] = i
->get_hname();
29 for(auto j
: i
->get_extensions()) {
31 exts
[nent
] = exts
[nent
] + ";";
33 exts
[nent
] = exts
[nent
] + "*." + j
;
37 spec
= spec
+ "|" + mangle_name(cores
[nent
]) + " / " + mangle_name(types
[nent
]) +
38 "(" + exts
[nent
] + ")|" + exts
[nent
];
41 wxFileDialog
* d
= new wxFileDialog(parent
, towxstring("Choose ROM to load"), towxstring(path
),
42 towxstring(""), towxstring(spec
), wxFD_OPEN
);
43 int r
= d
->ShowModal();
44 if(r
== wxID_CANCEL
) {
48 filename
= tostdstring(d
->GetPath());
49 int idx
= d
->GetFilterIndex();