Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f4fd9cfa09
2 changed files with 22 additions and 2 deletions
|
@ -123,19 +123,29 @@ namespace
|
||||||
SetSizer(top_s);
|
SetSizer(top_s);
|
||||||
|
|
||||||
if(singletab) {
|
if(singletab) {
|
||||||
|
//If this throws, let it throw through.
|
||||||
settings_tab* t = singletab->create(this);
|
settings_tab* t = singletab->create(this);
|
||||||
top_s->Add(t, 1, wxGROW);
|
top_s->Add(t, 1, wxGROW);
|
||||||
t->set_notify([this]() { this->on_notify(); });
|
t->set_notify([this]() { this->on_notify(); });
|
||||||
tabs.push_back(t);
|
tabs.push_back(t);
|
||||||
} else {
|
} else {
|
||||||
|
int created = 0;
|
||||||
tabset = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize, wxNB_TOP);
|
tabset = new wxNotebook(this, -1, wxDefaultPosition, wxDefaultSize, wxNB_TOP);
|
||||||
for(auto i : settings_tab_factory::factories()) {
|
for(auto i : settings_tab_factory::factories()) {
|
||||||
settings_tab* t = i->create(tabset);
|
settings_tab* t;
|
||||||
|
try {
|
||||||
|
t = i->create(tabset);
|
||||||
|
} catch(...) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
tabset->AddPage(t, towxstring(i->get_name()));
|
tabset->AddPage(t, towxstring(i->get_name()));
|
||||||
t->set_notify([this]() { this->on_notify(); });
|
t->set_notify([this]() { this->on_notify(); });
|
||||||
tabs.push_back(t);
|
tabs.push_back(t);
|
||||||
|
created++;
|
||||||
}
|
}
|
||||||
top_s->Add(tabset, 1, wxGROW);
|
top_s->Add(tabset, 1, wxGROW);
|
||||||
|
if(!created)
|
||||||
|
throw std::runtime_error("Nothing to configure here, move along");
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBoxSizer* pbutton_s = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer* pbutton_s = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
@ -187,8 +197,16 @@ void display_settings_dialog(wxWindow* parent, settings_tab_factory* singletab)
|
||||||
{
|
{
|
||||||
modal_pause_holder hld;
|
modal_pause_holder hld;
|
||||||
wxDialog* editor;
|
wxDialog* editor;
|
||||||
|
try {
|
||||||
try {
|
try {
|
||||||
editor = dlg = new wxeditor_esettings2(parent, singletab);
|
editor = dlg = new wxeditor_esettings2(parent, singletab);
|
||||||
|
} catch(std::exception& e) {
|
||||||
|
std::string title = "Configure";
|
||||||
|
if(singletab)
|
||||||
|
title = "Configure " + singletab->get_name();
|
||||||
|
show_message_ok(parent, title, e.what(), wxICON_EXCLAMATION);
|
||||||
|
return;
|
||||||
|
}
|
||||||
editor->ShowModal();
|
editor->ShowModal();
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -273,6 +273,8 @@ namespace
|
||||||
joystick_config_window(wxWindow* parent)
|
joystick_config_window(wxWindow* parent)
|
||||||
: settings_tab(parent)
|
: settings_tab(parent)
|
||||||
{
|
{
|
||||||
|
if(!lsnes_gamepads.gamepads())
|
||||||
|
throw std::runtime_error("No joysticks available");
|
||||||
wxSizer* top1_s = new wxBoxSizer(wxVERTICAL);
|
wxSizer* top1_s = new wxBoxSizer(wxVERTICAL);
|
||||||
SetSizer(top1_s);
|
SetSizer(top1_s);
|
||||||
std::map<std::string, unsigned> jsnum;
|
std::map<std::string, unsigned> jsnum;
|
||||||
|
|
Loading…
Add table
Reference in a new issue