From kde-i18n-doc Thu Mar 23 20:27:53 2006 From: Hasso Tepper Date: Thu, 23 Mar 2006 20:27:53 +0000 To: kde-i18n-doc Subject: Re: Plural handling Message-Id: <200603232227.54066.hasso () kde ! org> X-MARC-Message: https://marc.info/?l=kde-i18n-doc&m=114314569022233 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_KTwIEejNIPgasfQ" --Boundary-00=_KTwIEejNIPgasfQ Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Nicolas Goutte wrote: > On Wednesday 22 March 2006 12:24, Hasso Tepper wrote: > > 2) What to do about stuff coming from *.ui files? Some of them handle > > singular case in hackish way (for example with setSpecialValueText() > > in case of QSpinBox), but that's not the correct way of course. > > I do not think that it is possible at all, as the uic compiler cannot > handle it. After some experiments I found out that it can be done though. Proof of concept patch attached. What do you think? Maybe there are some drawbacks I don't see? And note that I volunteer to fix things myself, I need just confirmation that I don't screw up something. regards, -- Hasso Tepper KDE Estonian Team --Boundary-00=_KTwIEejNIPgasfQ Content-Type: text/x-diff; charset="iso-8859-15"; name="ui-plurals-proof.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ui-plurals-proof.patch" Index: korganizer/koeditoralarms_base.ui =================================================================== --- korganizer/koeditoralarms_base.ui (revision 521648) +++ korganizer/koeditoralarms_base.ui (working copy) @@ -139,7 +139,7 @@ false - time(s) + 500 @@ -189,7 +189,7 @@ every - Minute(s) + 999 @@ -652,10 +652,30 @@ mRepeatCount setEnabled(bool) + + mRepeatCount + valueChanged(int) + KOEditorAlarms_base + repeatCountChanged(int) + + + mRepeatInterval + valueChanged(int) + KOEditorAlarms_base + repeatIntervalChanged(int) + addresseelineedit.h + koeditoralarms_base.ui.h + + repeatCountChanged( int value ) + repeatIntervalChanged( int value ) + + + init() + kurlrequester.h Index: korganizer/koeditoralarms_base.ui.h =================================================================== --- korganizer/koeditoralarms_base.ui.h (revision 0) +++ korganizer/koeditoralarms_base.ui.h (revision 0) @@ -0,0 +1,27 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you want to add, delete, or rename functions or slots, use +** Qt Designer to update this file, preserving your code. +** +** You should not define a constructor or destructor in this file. +** Instead, write your code in functions called init() and destroy(). +** These will automatically be called by the form's constructor and +** destructor. +*****************************************************************************/ + +void KOEditorAlarms_base::init() +{ + repeatCountChanged( mRepeatCount->value() ); + repeatIntervalChanged ( mRepeatInterval->value() ); +} + +void KOEditorAlarms_base::repeatCountChanged(int value) +{ + mRepeatCount->setSuffix( i18n(" time", " times", value)); +} + +void KOEditorAlarms_base::repeatIntervalChanged( int value ) +{ + mRepeatInterval->setSuffix( i18n(" minute", " minutes", value)); +} --Boundary-00=_KTwIEejNIPgasfQ--