[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: Addressbook UI
From:       Rik Hemsley <rik () rikkus ! demon ! co ! uk>
Date:       1999-07-09 0:12:16
[Download RAW message or body]


On 09-Jul-99 Don Sanders wrote:
> Ok I've got the three tabs working, there is still one really annoying
> problem
> with the dialog itself. For some reason the dialog isn't properly sized until
> after it has been shown. I mean the dialog appears and then is resized to the
> correct size. This can confuse the window manager (KWM) which may place the
> window on the screen in a position where it is fully visible (though too
> small) at its initial size but is only partially visible after the late
> resizing takes place.
> 
> Has anyone run into this problem? Do they have a solution?

Try this at the end of the ctor:
resize(minimumSizeHint());

> Another problem I have is that I have long lists of strings defined in my
> code.
> I'm wondering what the proper method of dealing with them is. At the moment I
> have a 
> 
> QString blaa[] = {
>   "a", "b", "c", ""
> };
> 
> and a
> 
> for(int i = 0; blaa[i] != ""; ++i)
>   dosomething( i18n( blaa );
> 
> surely there is a better way, yes?

Seems ok to me. I haven't found a better way myself. I tend to do this:
QString blaah[] = { "a", "b", "c" };
int numblaah = 3;

.. and update numblaah when I change blaah. Same difference, as we say here :)

I'm concerned about having i18n(variable). I don't know how i18n() works but I
wonder whether translation will actually work unless you do i18n("string").

> Even nastier I have lists like
> 
> QString title[] = {
>   "Mr.", "Miss", "Mrs.", "Prof"
> };
> 
> Which may well be locale dependent. (I guess different cultures might not
> have
> an equivalent to Miss or may have more titles than English speakers do) How
> do I
> handle this in a locale independent way?

I think this might work:
Pick a number of titles. Define what they mean. Make the Combo editable
so anyone can add their own. This way, you can do something like this:

# 1 = Male 2 = Unmarried female 3 = Married female 4 = Married/Unmarried female
# (polite form) 5 = Person with PhD >5 = Anything else

const QString titles = i18n("1,Mr,2,Miss,3,Mrs,4,Ms,5,Dr");

You can then parse the list and map the correct titles.

The French version might look something like this (I don't know the contracted
forms or the word for doctor)

"1,Monsieur,2,Mademoiselle,4,Madame,5,Dr"

You can then add only those which are defined.

This is a little odd. Perhaps there's a better way.

Cheers,
Rik


--
KDE - Colour outside the lines  : http://www.kde.org
[[without]] - software for KDE  : http://without.netpedia.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic