Re: language chooser in GDM.. auto-reload gdm and language flags?



Hi Joao,

I don't have those snapshots kept anymore (actually, we don't need them
because we decided not to change UI of gdm for language selection).

Only the code you can utilize is the new protocol part which greeter will
send the interrupt protocol to gdm-slave to start new greeter in the new
language selected by user.

gdm.h
-----
/* Different login interruptions */
#define GDM_INTERRUPT_REFRESH_GREETER 'R'

slave.c
-------
static gboolean
check_for_interruption (const char *msg) {
...
    case GDM_INTERRUPT_REFRESH_GREETER:
            ve_setenv ("LANG", &msg[2], TRUE); 
            ve_setenv ("LC_ALL", &msg[2], TRUE);
            ve_setenv ("LC_CTYPE", &msg[2], TRUE);
            ve_setenv ("LC_NUMERIC", &msg[2], TRUE);
            ve_setenv ("LC_TIME", &msg[2], TRUE);
            ve_setenv ("LC_COLLATE", &msg[2], TRUE);
            ve_setenv ("LC_MONETARY", &msg[2], TRUE);
            ve_setenv ("LC_MESSAGES", &msg[2], TRUE);
            do_restart_greeter = TRUE;
            break;
...
}

gui/greeter_action_language.c
-----------------------------
void
greeter_action_language () {
...
    case GTK_RESPONSE_OK:
      if (dialog_selected_language) {
          current_language = g_strdup (dialog_selected_language);
          tmp = ve_locale_to_utf8 (current_language);
          printf ("%c%c%c%s\n", STX, BEL,
                    GDM_INTERRUPT_REFRESH_GREETER, tmp);
          fflush(stdout);
          g_free(tmp);
      }
      break;
...
}

and the comment from George how to modify gdm-slave as shown below.

---------------------------------------------------------------------------
Date: Tue, 11 Nov 2003 09:39:38 -0800
From: "George" <jirka 5z com>

Instead of just setlocale for the whole slave, remember the language
in the slave and only do setlocale to the users language when we're
about to say something to the user.  Would be perhaps useful to have
a 'language stack', so that you can do something like (in the slave)

gdm_push_user_language ()
... some code here ...
gdm_pop_language ()

Say put this around the pam calls.  Those calls could however call some
methods that require the system language, thus it would have to be a
stack.

Perhaps this is not required, perhaps just setting and unsetting the
system langauge around all gdm_info/error would be enough.

Also you have to make sure to set back to the system language when the
login failed or the greeter is reset from the slave (do this in the slave).
---------------------------------------------------------------------------

Hopefully, this would help you to be able to start with.

Chookij V.


> Thanks Chookij
> I'm reading the thread right now and I think I can give it a try during 
> the next few weeks to get things finished... altough it seemed you had 
> most of the job done.
> 
> I think anyway that I want to solve the problem in a simpler way than 
> what you were trying to, or at least I disagree with the problems you're 
> facing in the last messages of the thread:
>   - user will not get gdm UI changed after writing username. It makes no 
> sense to me. If user was able to see where to put username into, it is 
> smart enough to know where to put the password.
>   - gdm should not try to solve locale charset problems. The locale 
> AFAIK will be the always the same if the same keyboard is used, no 
> matter wich language the user wants to see in the messages. It should be 
> dealt in a completely different level, maybe at X, if I'm thinking right.
> 
> I could not, however, see the attached files you send to bugzilla, wich
> I would like to see to get the feeling of your progress, and I am not 
> sure where to get either the source code for the "unmodified" gdm or 
> your modified version... or a patch.
> Could you point me to the files so that I get a faster start with this?
> 
> Giiz... now that I think of this, it has been 2 years since I last wrote 
> some C code... hmmmm... time to get all this rust from my fingers :-)
> 
> Joao Clemente
> 
> Chookij Vanatham wrote:
> > There is the bugzilla filed for the feature (a). Bugzilla id: 108820.
> > http://bugzilla.gnome.org/show_bug.cgi?id=108820
> > 
> > May be if you could try to finish it... ;-)
> > 
> > Thanks,
> > 
> > Chookij V.
> > 
> > 
> >>I was very glad to see a way to choose a language in GDM (I was using 
> >>kdm up till now) as my system has users with different language 
> >>preferences...
> >>
> >>I wonder if it would be simple to add two features to gdm language 
> >>choosing ability...
> >>
> >>a) To reload gdm after after a language choice has been taken:
> >>  - Users would see gdm already in the wanted language and follow the 
> >>login procedure with that language...
> >>This seem to be (theoretically) simple, as I have the feeling that gdm 
> >>reloads when we're configuring it's looks (like standart vs grafical 
> >>chooser). So, if there is already implemented a way to reload gdm...
> >>
> [...]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: gdm-unsubscribe sunsite dk
> For additional commands, e-mail: gdm-help sunsite dk
> 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]