X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Faboutprefs.C;h=4702c944e6c1439074d1cb9bfcbb194175c6483d;hb=60f8df69db9ddd8148bfc41a17bb0955b52a45e6;hp=3f3a0abe7f53289674b654e9c32f3247ae32999e;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/aboutprefs.C b/cinelerra-5.1/cinelerra/aboutprefs.C index 3f3a0abe..4702c944 100644 --- a/cinelerra-5.1/cinelerra/aboutprefs.C +++ b/cinelerra-5.1/cinelerra/aboutprefs.C @@ -21,7 +21,7 @@ #include "aboutprefs.h" #include "bcsignals.h" -#include "file.inc" +#include "file.h" #include "language.h" #include "libzmpeg3.h" #include "mwindow.h" @@ -29,7 +29,10 @@ #include "vframe.h" #include "versioninfo.h" - +#ifndef COMPILEDATE +#define COMPILEDATE "built: " __DATE__ " " __TIME__ +#endif +const char *AboutPrefs::build_timestamp = COMPILEDATE; AboutPrefs::AboutPrefs(MWindow *mwindow, PreferencesWindow *pwindow) : PreferencesDialog(mwindow, pwindow) @@ -71,29 +74,32 @@ void AboutPrefs::create_objects() ); y += get_text_height(MEDIUMFONT) * 3; -// char versions[BCTEXTLEN]; -// sprintf(versions, -// _("Libmpeg3 version %d.%d.%d\n"), -// mpeg3_major(), -// mpeg3_minor(), -// mpeg3_release()); -// draw_text(x, y, versions); - - char exe_path[BCTEXTLEN], msg_path[BCTEXTLEN]; - get_exe_path(exe_path); - snprintf(msg_path, sizeof(msg_path), "%s/msg.txt", exe_path); - FILE *fp = fopen(msg_path, "r"); + const char *cfg_path = File::get_cindat_path(); + char msg_path[BCTEXTLEN]; + FILE *fp = 0; + if( BC_Resources::language[0] ) { + snprintf(msg_path, sizeof(msg_path), "%s/msg/%s", + cfg_path, BC_Resources::language); + fp = fopen(msg_path, "r"); + } + if( !fp ) { + snprintf(msg_path, sizeof(msg_path), "%s/msg/txt", + cfg_path); + fp = fopen(msg_path, "r"); + } if( fp ) { set_font(LARGEFONT); draw_text(x, y, _("About:")); y += get_text_height(LARGEFONT); char msg[BCTEXTLEN]; - while( fgets(msg, sizeof(msg), fp) ) + while( fgets(msg, sizeof(msg), fp) ) { + int len = strlen(msg); + if( len > 0 && msg[len-1] == '\n' ) msg[len-1] = 0; about.append(new BC_ListBoxItem(msg)); - + } BC_ListBox *listbox; - add_subwindow(listbox = new BC_ListBox(x, y, 300, 280, + add_subwindow(listbox = new BC_ListBox(x, y, 450, 280, LISTBOX_TEXT, &about, 0, 0, 1)); y += listbox->get_h() + get_text_height(LARGEFONT) + 10; } @@ -118,12 +124,9 @@ void AboutPrefs::create_objects() draw_text(x, y, license3); y += get_text_height(MEDIUMFONT, license3); -#ifndef COMPILEDATE -#define COMPILEDATE "built: " __DATE__ " " __TIME__ -#endif - draw_text(x, y, COMPILEDATE); + draw_text(x, y, build_timestamp); #if defined(REPOMAINTXT) - y += get_text_height(MEDIUMFONT, COMPILEDATE); + y += get_text_height(MEDIUMFONT, build_timestamp); draw_text(x, y, REPOMAINTXT); #endif