--- nono/wx/wxapp.cpp 2026/04/29 17:05:40 1.1.1.18 +++ nono/wx/wxapp.cpp 2026/04/29 17:05:53 1.1.1.21 @@ -41,6 +41,8 @@ class WXApp : public wxApp std::unique_ptr pHostInfo {}; }; +static std::string utf8_to_sjis(const std::string&); + // IMPLEMENT_APP() は闇マクロすぎて clang のちからには耐えられない PRAGMA_PUSH_WARNINGS IMPLEMENT_APP(WXApp) @@ -63,7 +65,7 @@ WXApp::OnRun() { int rv; - rv = gMainApp.Init1(false, argc, argv); + rv = gMainApp.Init1(argc, argv, utf8_to_sjis); if (rv != MainApp::PASS) { return rv; } @@ -322,8 +324,8 @@ WXApp::ShowMonitorsName() } // 一覧を表示 - std::string msg = MonitorManager::MakeListString(list); - printf("%s", msg.c_str()); + std::vector names = gMonitorManager->MakeListString(list); + MainApp::ShowHelpList(stdout, names); } // モニタ名 name を検索し、一つに確定すればその id を返す。 @@ -341,8 +343,13 @@ WXApp::SearchMonitorName(const char *nam for (uint id = ID_MONITOR_START; id <= ID_SUBWIN_END; id++) { if (id < ID_SUBWIN_START) { - // モニターは登録されていなければ除外する - if (gMonitorManager->Find(id) == NULL) { + // モニターは登録されていなければ除外する。 + Monitor *mon = gMonitorManager->Find(id); + if (mon == NULL) { + continue; + } + // SLIRP モニタだけ、登録はされてて obj が NULL という状態がある。 + if (mon->obj == NULL) { continue; } } else { @@ -444,3 +451,21 @@ WXApp::FindAvailable(const std::vector wxString + wxString wstr(utf8str.c_str(), wxConvUTF8); + + // wxString -> Shift_JIS + wxCharBuffer sjisbuf = wstr.mb_str(conv); + + return std::string(sjisbuf.data()); +}