author | cniehaus <cniehaus> | 2002-11-22 11:29:36 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2002-11-22 11:29:36 (UTC) |
commit | c185c4f9788a1e3882711efa1b1c11b17fb7ef1d (patch) (side-by-side diff) | |
tree | 9f7858cefd87420f50478796239ad3e36414e6bf | |
parent | 480284c491e26427c630131a25e56f9ed1d129b2 (diff) | |
download | opie-c185c4f9788a1e3882711efa1b1c11b17fb7ef1d.zip opie-c185c4f9788a1e3882711efa1b1c11b17fb7ef1d.tar.gz opie-c185c4f9788a1e3882711efa1b1c11b17fb7ef1d.tar.bz2 |
This is the way tr() should be used. Now even RTL-languages and such
are supported
@@ -53,7 +53,7 @@ void DateBookWeekLstHeader::setDate(cons
int year,week;
calcWeek(d,week,year,onMonday);
- labelWeek->setText("W: " + QString::number(week));
+ labelWeek->setText(tr( "W: %1" ).arg( ( QString::number(week)) ) );
QDate start=date;
QDate stop=start.addDays(6);
-rw-r--r-- | core/pim/datebook/datebookweeklst.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/datebook/datebookweeklst.cpp b/core/pim/datebook/datebookweeklst.cpp index 5eefc27..7451abc 100644 --- a/core/pim/datebook/datebookweeklst.cpp +++ b/core/pim/datebook/datebookweeklst.cpp @@ -8,97 +8,97 @@ #include <qpe/qpeapplication.h> #include <qpe/timestring.h> #include <qpe/datebookmonth.h> #include <qpe/config.h> #include <qdatetime.h> #include <qheader.h> #include <qlabel.h> #include <qlayout.h> #include <qpainter.h> #include <qpopupmenu.h> #include <qtimer.h> #include <qstyle.h> #include <qtoolbutton.h> #include <qvbox.h> #include <qsizepolicy.h> #include <qabstractlayout.h> #include <qtl.h> bool calcWeek(const QDate &d, int &week, int &year, bool startOnMonday = false); DateBookWeekLstHeader::DateBookWeekLstHeader(bool onM, QWidget* parent, const char* name, WFlags fl) : DateBookWeekLstHeaderBase(parent, name, fl) { setBackgroundMode( PaletteButton ); labelDate->setBackgroundMode( PaletteButton ); labelWeek->setBackgroundMode( PaletteButton ); forward->setBackgroundMode( PaletteButton ); back->setBackgroundMode( PaletteButton ); DateBookWeekLstHeaderBaseLayout->setSpacing(0); DateBookWeekLstHeaderBaseLayout->setMargin(0); //setSizePolicy(QSizePolicy(QSizePolicy::Fixed,QSizePolicy::Expanding)); setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed)); connect(back, SIGNAL(clicked()), this, SLOT(prevWeek())); connect(forward, SIGNAL(clicked()), this, SLOT(nextWeek())); connect(labelWeek, SIGNAL(clicked()), this, SLOT(pickDate())); connect(dbl, SIGNAL(toggled(bool)), this, SIGNAL(setDbl(bool))); onMonday=onM; } DateBookWeekLstHeader::~DateBookWeekLstHeader(){} void DateBookWeekLstHeader::setDate(const QDate &d) { date=d; int year,week; calcWeek(d,week,year,onMonday); - labelWeek->setText("W: " + QString::number(week)); + labelWeek->setText(tr( "W: %1" ).arg( ( QString::number(week)) ) ); QDate start=date; QDate stop=start.addDays(6); labelDate->setText( QString::number(start.day()) + " " + start.monthName(start.month()) + " - " + QString::number(stop.day()) + " " + start.monthName(stop.month()) ); emit dateChanged(year,week); } void DateBookWeekLstHeader::pickDate() { static QPopupMenu *m1 = 0; static DateBookMonth *picker = 0; if ( !m1 ) { m1 = new QPopupMenu( this ); picker = new DateBookMonth( m1, 0, TRUE ); m1->insertItem( picker ); connect( picker, SIGNAL( dateClicked( int, int, int ) ), this, SLOT( setDate( int, int, int ) ) ); //connect( m1, SIGNAL( aboutToHide() ), //this, SLOT( gotHide() ) ); } picker->setDate( date.year(), date.month(), date.day() ); m1->popup(mapToGlobal(labelWeek->pos()+QPoint(0,labelWeek->height()))); picker->setFocus(); } void DateBookWeekLstHeader::setDate(int y, int m, int d) { QDate new_date(y,m,d); setDate(new_date); } void DateBookWeekLstHeader::nextWeek() { setDate(date.addDays(7)); } void DateBookWeekLstHeader::prevWeek() { setDate(date.addDays(-7)); } DateBookWeekLstDayHdr::DateBookWeekLstDayHdr(const QDate &d, bool /*onM*/, QWidget* parent, const char* name, WFlags fl ) : DateBookWeekLstDayHdrBase(parent, name, fl) { date=d; static const char *wdays="MTWTFSS"; char day=wdays[d.dayOfWeek()-1]; |