X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fmwindow.C;h=d02fe0bbc1ae53894840d4e566af3e3eb22c81a2;hb=4f7f413cbc1c6ea5da27cb75ca27a3ab317243ec;hp=aee8aadb9184568ebcaf515cc8f0806a1cc4f23c;hpb=77815ec03df6a03ed75433e8cf8ae1e83fb76d6e;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/mwindow.C b/cinelerra-5.1/cinelerra/mwindow.C index aee8aadb..d02fe0bb 100644 --- a/cinelerra-5.1/cinelerra/mwindow.C +++ b/cinelerra-5.1/cinelerra/mwindow.C @@ -461,6 +461,32 @@ void MWindow::init_defaults(BC_Hash* &defaults, char *config_path) defaults->load(); } + +void MWindow::check_language() +{ + char curr_lang[BCTEXTLEN]; curr_lang[0] = 0; + const char *env_lang = getenv("LANGUAGE"); + if( !env_lang ) env_lang = getenv("LANG"); + if( !env_lang ) { + snprintf(curr_lang, sizeof(curr_lang), "%s-%s.%s", + BC_Resources::language, BC_Resources::region, BC_Resources::encoding); + env_lang = curr_lang; + } + char last_lang[BCTEXTLEN]; last_lang[0] = 0; + defaults->get("LAST_LANG",last_lang); + if( strcmp(env_lang,last_lang)) { + printf("lang changed from '%s' to '%s'\n", last_lang, env_lang); + defaults->update("LAST_LANG",env_lang); + char plugin_path[BCTEXTLEN]; + create_defaults_path(plugin_path, PLUGIN_FILE); + ::remove(plugin_path); + char ladspa_path[BCTEXTLEN]; + create_defaults_path(ladspa_path, LADSPA_FILE); + ::remove(ladspa_path); + defaults->save(); + } +} + void MWindow::get_plugin_path(char *path, const char *plug_dir, const char *fs_path) { char *base_path = FileSystem::basepath(fs_path), *bp = base_path; @@ -599,6 +625,7 @@ int MWindow::init_ladspa_plugins(MWindow *mwindow, Preferences *preferences) len = !cp ? strlen(path) : cp-path; char index_path[BCTEXTLEN], plugin_path[BCTEXTLEN]; memcpy(plugin_path, path, len); plugin_path[len] = 0; + if( cp ) ++len; char *plugin_dir = FileSystem::basepath(plugin_path); strcpy(plugin_path, plugin_dir); delete [] plugin_dir; create_defaults_path(index_path, LADSPA_FILE); @@ -795,6 +822,7 @@ void MWindow::init_preferences() BC_Trace::disable_locks(); } BC_WindowBase::get_resources()->popupmenu_btnup = preferences->popupmenu_btnup; + BC_WindowBase::get_resources()->textbox_focus_policy = preferences->textbox_focus_policy; } void MWindow::clean_indexes() @@ -1890,6 +1918,7 @@ void MWindow::create_objects(int want_gui, if(debug) PRINT_TRACE default_standard = default_std(); init_defaults(defaults, config_path); + check_language(); init_preferences(); if(splash_window) splash_window->operation->update(_("Initializing Plugins"));