[Kde-imaging] [Bug 97187] Calendar plugin still messing with fonts and locales
Tom Albers
tomalbers at kde.nl
Sun Aug 7 17:47:41 CEST 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=97187
tomalbers kde nl changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From tomalbers kde nl 2005-08-07 17:47 -------
SVN commit 443854 by toma:
Fixed 3 problems:
- compiler deprecated barfs on monthNames.
- the weekday was not localized, so they were english.
- default font in pull down is now the application dafault font.
BUG: 97187
M +36 -3 calpainter.cpp
M +4 -0 caltemplate.cpp
--- trunk/extragear/libs/kipi-plugins/calendar/calpainter.cpp #443853:443854
@ -35,6 +35,8 @
#include <kglobal.h>
#include <klocale.h>
+#include <kdeversion.h>
+#include <kcalendarsystem.h>
// Local includes.
@ -202,8 +204,13 @
painter->setFont(f);
painter->drawText(rCalHeader, Qt::AlignLeft|Qt::AlignVCenter,
QString::number(year_));
+#if KDE_IS_VERSION(3,2,0)
painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
+ KGlobal::locale()->calendar()->monthName(month_, year_));
+#else
+ painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
KGlobal::locale()->monthName(month_));
+#endif
painter->restore();
// ---------------------------------------------------------------
@ -226,8 +233,14 @
rsmall = r;
rsmall.setWidth(r.width() - 2);
rsmall.setHeight(r.height() - 2);
+#if KDE_IS_VERSION(3,2,0)
painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
- QDate::shortDayName(i+1));
+ KGlobal::locale()->calendar()->weekDayName(i+1, true));
+#else
+ painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
+ KGlobal::locale()->weekDayName(i+1, true));
+#endif
+
}
painter->restore();
@ -422,8 +435,13 @
painter->setFont(f);
painter->drawText(rCalHeader, Qt::AlignLeft|Qt::AlignVCenter,
QString::number(year));
+#if KDE_IS_VERSION(3,2,0)
painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
+ KGlobal::locale()->calendar()->monthName(month, year));
+#else
+ painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
KGlobal::locale()->monthName(month));
+#endif
painter->restore();
// ---------------------------------------------------------------
@ -446,8 +464,13 @
rsmall = r;
rsmall.setWidth(r.width() - 2);
rsmall.setHeight(r.height() - 2);
+#if KDE_IS_VERSION(3,2,0)
painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
- QDate::shortDayName(i+1));
+ KGlobal::locale()->calendar()->weekDayName(i+1, true));
+#else
+ painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
+ KGlobal::locale()->weekDayName(i+1, true));
+#endif
}
painter->restore();
@ -619,8 +642,13 @
painter->setFont(f);
painter->drawText(rCalHeader, Qt::AlignLeft|Qt::AlignVCenter,
QString::number(year));
+#if KDE_IS_VERSION(3,2,0)
painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
+ KGlobal::locale()->calendar()->monthName(month, year));
+#else
+ painter->drawText(rCalHeader, Qt::AlignRight|Qt::AlignVCenter,
KGlobal::locale()->monthName(month));
+#endif
painter->restore();
// ---------------------------------------------------------------
@ -643,8 +671,13 @
rsmall = r;
rsmall.setWidth(r.width() - 2);
rsmall.setHeight(r.height() - 2);
+#if KDE_IS_VERSION(3,2,0)
painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
- QDate::shortDayName(i+1));
+ KGlobal::locale()->calendar()->weekDayName(i+1, true));
+#else
+ painter->drawText(rsmall, Qt::AlignRight|Qt::AlignBottom,
+ KGlobal::locale()->weekDayName(i+1, true));
+#endif
}
painter->restore();
--- trunk/extragear/libs/kipi-plugins/calendar/caltemplate.cpp #443853:443854
@ -184,7 +184,11 @
}
comboFont_->insertStringList(smoothScalableFamilies);
+ // fetch and set the default font selected in the combo.
+ QFont f;
+ comboFont_->setCurrentText( f.family() );
+
gboxLayout->addLayout( hlayout );
connect(comboFont_, SIGNAL(activated(int)),
More information about the Kde-imaging
mailing list