author | eilers <eilers> | 2003-08-08 15:09:29 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-08-08 15:09:29 (UTC) |
commit | b87b33dc1f6e8e1276a7035ab7a3e53b8ed4bd16 (patch) (unidiff) | |
tree | b0f96db67cfb1b9d2476530ecec9a2ba6eacbab1 /libopie/orecurrancewidget.cpp | |
parent | 14d394e6c107b037a09a31a92605034fe50f7813 (diff) | |
download | opie-b87b33dc1f6e8e1276a7035ab7a3e53b8ed4bd16.zip opie-b87b33dc1f6e8e1276a7035ab7a3e53b8ed4bd16.tar.gz opie-b87b33dc1f6e8e1276a7035ab7a3e53b8ed4bd16.tar.bz2 |
Merging all changes from BRANCH_1_0.
Diffstat (limited to 'libopie/orecurrancewidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/orecurrancewidget.cpp | 56 |
1 files changed, 39 insertions, 17 deletions
diff --git a/libopie/orecurrancewidget.cpp b/libopie/orecurrancewidget.cpp index 471249d..be8ec30 100644 --- a/libopie/orecurrancewidget.cpp +++ b/libopie/orecurrancewidget.cpp | |||
@@ -10,15 +10,32 @@ | |||
10 | // Global Templates for use in setting up the repeat label... | 10 | // Global Templates for use in setting up the repeat label... |
11 | const QString strDayTemplate = QObject::tr("Every"); | 11 | // the problem is these strings get initialized before QPEApplication can install the translator -zecke |
12 | const QString strYearTemplate = QObject::tr("%1 %2 every "); | 12 | namespace { |
13 | const QString strMonthDateTemplate = QObject::tr("The %1 every "); | 13 | QString strDayTemplate; |
14 | const QString strMonthDayTemplate = QObject::tr("The %1 %1 of every"); | 14 | QString strYearTemplate; |
15 | const QString strWeekTemplate = QObject::tr("Every "); | 15 | QString strMonthDateTemplate; |
16 | const QString dayLabel[] = { QObject::tr("Monday"), | 16 | QString strMonthDayTemplate; |
17 | QObject::tr("Tuesday"), | 17 | QString strWeekTemplate; |
18 | QObject::tr("Wednesday"), | 18 | QString dayLabel[7]; |
19 | QObject::tr("Thursday"), | 19 | } |
20 | QObject::tr("Friday"), | ||
21 | QObject::tr("Saturday"), | ||
22 | QObject::tr("Sunday") }; | ||
23 | 20 | ||
21 | /* | ||
22 | * static linkage to not polute the symbol table... | ||
23 | * The problem is that const and static linkage are resolved prior to installing a translator | ||
24 | * leading to that the above strings are translted but to the original we delay the init of these strings... | ||
25 | * -zecke | ||
26 | */ | ||
27 | static void fillStrings() { | ||
28 | strDayTemplate = QObject::tr("Every"); | ||
29 | strYearTemplate = QObject::tr("%1 %2 every "); | ||
30 | strMonthDateTemplate = QObject::tr("The %1 every "); | ||
31 | strMonthDayTemplate = QObject::tr("The %1 %2 of every"); | ||
32 | strWeekTemplate = QObject::tr("Every "); | ||
33 | dayLabel[0] = QObject::tr("Monday"); | ||
34 | dayLabel[1] = QObject::tr("Tuesday"); | ||
35 | dayLabel[2] = QObject::tr("Wednesday"); | ||
36 | dayLabel[3] = QObject::tr("Thursday"); | ||
37 | dayLabel[4] = QObject::tr("Friday"); | ||
38 | dayLabel[5] = QObject::tr("Saturday"); | ||
39 | dayLabel[6] = QObject::tr("Sunday"); | ||
40 | } | ||
24 | 41 | ||
@@ -48,2 +65,5 @@ ORecurranceWidget::ORecurranceWidget( bool startOnMonday, | |||
48 | { | 65 | { |
66 | if (strDayTemplate.isEmpty() ) | ||
67 | fillStrings(); | ||
68 | |||
49 | init(); | 69 | init(); |
@@ -73,2 +93,4 @@ ORecurranceWidget::ORecurranceWidget( bool startOnMonday, | |||
73 | { | 93 | { |
94 | if (strDayTemplate.isEmpty() ) | ||
95 | fillStrings(); | ||
74 | // do some stuff with the repeat pattern | 96 | // do some stuff with the repeat pattern |
@@ -86,3 +108,2 @@ ORecurranceWidget::~ORecurranceWidget() { | |||
86 | void ORecurranceWidget::setStartDate( const QDate& date ) { | 108 | void ORecurranceWidget::setStartDate( const QDate& date ) { |
87 | qWarning("ORecurranceWidget::setStartDate"); | ||
88 | setRecurrence( recurrence(), date ); | 109 | setRecurrence( recurrence(), date ); |
@@ -369,3 +390,4 @@ void ORecurranceWidget::slotWeekLabel() { | |||
369 | } | 390 | } |
370 | str = str.prepend( "on " ); | 391 | str = str.prepend( tr("on ") ); |
392 | |||
371 | lblWeekVar->setText( str ); | 393 | lblWeekVar->setText( str ); |
@@ -377,6 +399,6 @@ void ORecurranceWidget::slotMonthLabel(int type) { | |||
377 | if ( type == 1 ) | 399 | if ( type == 1 ) |
378 | str = strMonthDateTemplate.arg( numberPlacing(start.day()) ); | 400 | str = strMonthDateTemplate.arg( numberPlacing(start.day()) ); |
379 | else | 401 | else |
380 | str = strMonthDayTemplate.arg( numberPlacing(week(start))) | 402 | str = strMonthDayTemplate.arg( numberPlacing(week(start))) |
381 | .arg( dayLabel[start.dayOfWeek() - 1] ); | 403 | .arg( dayLabel[start.dayOfWeek() - 1] ); |
382 | lblRepeat->setText( str ); | 404 | lblRepeat->setText( str ); |