diff --git a/contrib/translations/en/en_US.lng b/contrib/translations/en/en_US.lng index 9c3f14c39..a3bd581ed 100644 --- a/contrib/translations/en/en_US.lng +++ b/contrib/translations/en/en_US.lng @@ -3114,6 +3114,9 @@ Mapper-defined :MENU:showdetails Show FPS and RT speed in title bar . +:MENU:restartinst +Re-run DOSBox-X instance +. :MENU:restartconf Restart DOSBox-X with config file... . diff --git a/contrib/translations/es/es_ES.lng b/contrib/translations/es/es_ES.lng index 8e49d3ab9..926aaa55d 100644 --- a/contrib/translations/es/es_ES.lng +++ b/contrib/translations/es/es_ES.lng @@ -3095,6 +3095,9 @@ Definido por Mapeador: F11 :MENU:showdetails Mostrar FPS y velocidad RT en barra de título . +:MENU:restartinst +Vuelva a ejecutar la instancia de DOSBox-X +. :MENU:restartconf Reiniciar DOSBox-X con archivo config... . diff --git a/contrib/translations/ja/ja_JP.lng b/contrib/translations/ja/ja_JP.lng index 0f47d3a94..0a53045b2 100644 --- a/contrib/translations/ja/ja_JP.lng +++ b/contrib/translations/ja/ja_JP.lng @@ -3077,6 +3077,9 @@ Mapper-defined :MENU:showdetails FPS とRT スピードをタイトルバーに表示 . +:MENU:restartinst +DOSBox-Xインスタンスを再実行します +. :MENU:restartconf 設定ファイルを用いてDOSBox-X を再起動 ... . diff --git a/contrib/translations/zh/zh_CN.lng b/contrib/translations/zh/zh_CN.lng index a2418bb5c..eebabc5af 100644 --- a/contrib/translations/zh/zh_CN.lng +++ b/contrib/translations/zh/zh_CN.lng @@ -3079,6 +3079,9 @@ DOS 命令 :MENU:showdetails 标题栏上显示速度 . +:MENU:restartinst +重启 DOSBox-X 实例 +. :MENU:restartconf 重启 DOSBox-X 并调用指定配置文件... . diff --git a/contrib/translations/zh/zh_TW.lng b/contrib/translations/zh/zh_TW.lng index 47d66ec56..a3d2bc968 100644 --- a/contrib/translations/zh/zh_TW.lng +++ b/contrib/translations/zh/zh_TW.lng @@ -3079,6 +3079,9 @@ DOS 命令 :MENU:showdetails 標題列上顯示速度 . +:MENU:restartinst +重開 DOSBox-X 實例 +. :MENU:restartconf 重開 DOSBox-X 並調用指定組態檔案... . diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp index cf995e5be..44a79ec88 100644 --- a/src/gui/menu.cpp +++ b/src/gui/menu.cpp @@ -140,11 +140,7 @@ static const char *def_menu_main[] = "--", "mapper_reset", "mapper_reboot", -#endif -#if defined(MACOSX) - "mapper_newinst", -#endif -#if !defined(C_EMSCRIPTEN)//FIXME: Shutdown causes problems with Emscripten + "restartinst", "--", "restartconf", "restartlang", diff --git a/src/gui/sdl_gui.cpp b/src/gui/sdl_gui.cpp index 7d97c9cda..0f8390754 100644 --- a/src/gui/sdl_gui.cpp +++ b/src/gui/sdl_gui.cpp @@ -146,7 +146,7 @@ void RebootConfig(std::string filename, bool confirm=false) { } void RebootLanguage(std::string filename, bool confirm=false) { - std::string exepath=GetDOSBoxXPath(true), tmpconfig = "~dbxtemp.conf", para="-lang \""+filename+"\""; + std::string exepath=GetDOSBoxXPath(true), tmpconfig = "~dbxtemp.conf", para=filename.size()?"-lang \""+filename+"\"":""; struct stat st; if ((!confirm||CheckQuit())&&exepath.size()) { if (!stat(tmpconfig.c_str(), &st)) remove(tmpconfig.c_str()); @@ -1643,7 +1643,7 @@ public: ToplevelWindow(parent, x, y, 400, 150 + GUI::titlebar_y_stop, title) { new GUI::Label(this, 5, 10, MSG_Get("LANG_FILENAME")); name = new GUI::Input(this, 5, 30, width - 10 - border_left - border_right); - name->setText(control->opt_lang != "" ? control->opt_lang.c_str() : "messages.txt"); + name->setText(control->opt_lang != "" ? control->opt_lang.c_str() : "messages.lng"); new GUI::Label(this, 5, 60, MSG_Get("LANG_LANGNAME")); lang = new GUI::Input(this, 5, 80, width - 10 - border_left - border_right); lang->setText(langname.c_str()); diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 2cef4a6b8..54d44a000 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -303,6 +303,7 @@ unsigned int sendkeymap=0; std::string configfile = ""; std::string strPasteBuffer = ""; ScreenSizeInfo screen_size_info; +void RebootLanguage(std::string filename, bool confirm=false); bool CodePageHostToGuestUTF16(char *d/*CROSS_LEN*/,const uint16_t *s/*CROSS_LEN*/); bool CodePageGuestToHostUTF16(uint16_t *d/*CROSS_LEN*/,const char *s/*CROSS_LEN*/); @@ -5663,7 +5664,7 @@ static void GUI_StartUp() { item->set_text("Quick launch program..."); #endif -#if defined(MACOSX) +#if defined(MACOSX) && 0 MAPPER_AddHandler(NewInstanceEvent, MK_nothing, 0, "newinst", "Start new instance", &item); item->set_text("Start new instance"); { @@ -10939,10 +10940,7 @@ void Restart_language_file() { while (*name == CROSS_FILESPLIT) name++; } - if (*name) { - void RebootLanguage(std::string filename, bool confirm=false); - RebootLanguage(name, true); - } + if (*name) RebootLanguage(name, true); } if(chdir(Temp_CurrentDir) == -1) { LOG(LOG_GUI, LOG_ERROR)("Restart_language_file failed to change directories."); @@ -12129,6 +12127,13 @@ bool showdetails_menu_callback(DOSBoxMenu * const xmenu, DOSBoxMenu::item * cons return true; } +bool restartinst_menu_callback(DOSBoxMenu * const xmenu, DOSBoxMenu::item * const menuitem) { + (void)xmenu;//UNUSED + (void)menuitem;//UNUSED + RebootLanguage("", true); + return true; +} + bool restartconf_menu_callback(DOSBoxMenu * const xmenu, DOSBoxMenu::item * const menuitem) { (void)xmenu;//UNUSED (void)menuitem;//UNUSED @@ -14434,6 +14439,7 @@ int main(int argc, char* argv[]) SDL_MAIN_NOEXCEPT { /* more */ std::string doubleBufString = std::string("desktop.doublebuf"); mainMenu.alloc_item(DOSBoxMenu::item_type_id,"showdetails").set_text("Show FPS and RT speed in title bar").set_callback_function(showdetails_menu_callback).check(!menu.hidecycles && menu.showrt); + mainMenu.alloc_item(DOSBoxMenu::item_type_id,"restartinst").set_text("Re-run DOSBox-X instance").set_callback_function(restartinst_menu_callback); mainMenu.alloc_item(DOSBoxMenu::item_type_id,"restartconf").set_text("Restart DOSBox-X with config file...").set_callback_function(restartconf_menu_callback); mainMenu.alloc_item(DOSBoxMenu::item_type_id,"restartlang").set_text("Restart DOSBox-X with language file...").set_callback_function(restartlang_menu_callback); mainMenu.alloc_item(DOSBoxMenu::item_type_id,"auto_lock_mouse").set_text("Autolock mouse").set_callback_function(autolock_mouse_menu_callback).check(sdl.mouse.autoenable); diff --git a/src/misc/messages.cpp b/src/misc/messages.cpp index 1d512d414..97f7399ae 100644 --- a/src/misc/messages.cpp +++ b/src/misc/messages.cpp @@ -281,6 +281,7 @@ void MSG_Init() { if (control->opt_lang != "") { LoadMessageFile(control->opt_lang.c_str()); + SetVal("dosbox", "language", control->opt_lang.c_str()); } else { Prop_path* pathprop = section->Get_path("language");