X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ftimeentry.C;h=f8ccf00017502db398ca7c61a1688ff5b816a091;hp=6c2382ec0f40a4f31e6015e8c68722617f99ad2f;hb=502b6f3b6fd04f6b01c6d70dcb81aa304dd0db1c;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd diff --git a/cinelerra-5.1/cinelerra/timeentry.C b/cinelerra-5.1/cinelerra/timeentry.C index 6c2382ec..f8ccf000 100644 --- a/cinelerra-5.1/cinelerra/timeentry.C +++ b/cinelerra-5.1/cinelerra/timeentry.C @@ -2,27 +2,28 @@ /* * CINELERRA * Copyright (C) 2008 Adam Williams - * + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * + * */ #include "timeentry.h" +#include "language.h" #include -TimeEntry::TimeEntry(BC_WindowBase *gui, int x, int y, +TimeEntry::TimeEntry(BC_WindowBase *gui, int x, int y, int *output_day, double *output_time, int time_format, int time_w) { @@ -45,15 +46,15 @@ TimeEntry::~TimeEntry() delete day_tumbler; delete time_text; } -const char* TimeEntry::day_table[] = +const char* TimeEntry::day_table[] = { - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "*" + N_("Sun"), N_("Mon"), N_("Tue"), N_("Wed"), N_("Thu"), N_("Fri"), N_("Sat"), "*" }; int TimeEntry::day_to_int(const char *day) { for(int i = 0; i < TOTAL_DAYS; i++) - if(!strcasecmp(day, day_table[i])) return i; + if(!strcasecmp(day, _(day_table[i]))) return i; return 0; } @@ -87,7 +88,7 @@ void TimeEntry::create_objects() char string[BCTEXTLEN]; if(output_day) { - day_text = new DayText(this, x, y, 50, + day_text = new DayText(this, x, y, 50, day_table, TOTAL_DAYS, day_table[*output_day]); gui->add_subwindow(day_text); x += day_text->get_w(); @@ -98,7 +99,7 @@ void TimeEntry::create_objects() time_w -= day_tumbler->get_w(); } - time_text = new TimeTextBox(this, x, y, time_w, + time_text = new TimeTextBox(this, x, y, time_w, Units::totext(string, *output_time, time_format)); gui->add_subwindow(time_text); @@ -138,7 +139,7 @@ void TimeEntry::reposition_window(int x, int y) int time_w = this->time_w; this->x = x; this->y = y; - + if(day_text) { day_text->reposition_window(x, y); x += day_text->get_w(); @@ -149,7 +150,7 @@ void TimeEntry::reposition_window(int x, int y) x += day_tumbler->get_w(); time_w -= day_tumbler->get_w(); } - + time_text->reposition_window(x, y, time_w); } @@ -188,11 +189,11 @@ int TimeEntry::handle_event() -DayText::DayText(TimeEntry *timeentry, - int x, int y, int w, +DayText::DayText(TimeEntry *timeentry, + int x, int y, int w, const char **table, int table_items, const char *text) - : BC_TextBox(x, y, w, 1, text) + : BC_TextBox(x, y, w, 1, _(text)) { this->timeentry = timeentry; this->table = table; @@ -220,7 +221,7 @@ int DayTumbler::handle_up_event() *timeentry->output_day += 1; if(*timeentry->output_day >= text->table_items) *timeentry->output_day = 0; - text->update(text->table[*timeentry->output_day]); + text->update(_(text->table[*timeentry->output_day])); return timeentry->handle_event(); } @@ -230,7 +231,7 @@ int DayTumbler::handle_down_event() *timeentry->output_day -= 1; if(*timeentry->output_day < 0) *timeentry->output_day = text->table_items - 1; - text->update(text->table[*timeentry->output_day]); + text->update(_(text->table[*timeentry->output_day])); return timeentry->handle_event(); } @@ -318,7 +319,7 @@ int SecTumbler::handle_down_event() -TimeTextBox::TimeTextBox(TimeEntry *timeentry, +TimeTextBox::TimeTextBox(TimeEntry *timeentry, int x, int y, int w, char *default_text) : BC_TextBox(x, y, w, 1, default_text) {