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

List:       kde-core-devel
Subject:    Re: Sugestion: KStdErrorMessages
From:       Andreas Schlapbach <schlpbch () iam ! unibe ! ch>
Date:       2001-08-26 17:43:48
[Download RAW message or body]

Hi all

I very much support this idea. While writing this code I had the feeling
that this sentences must be used in other plces too, and I don't specially
care about how exaclty the error is reported to the user. Using standard
sentence sounds like a good thing to me.

Using such an approch could even improve the consistency of the KDE user
interface and reduce the translators work load.

May be somebody of the translator team could compile a list of the most
used sentences and we could add something along the line of what Pedro has
suggested.


Andreas

On Sun, 26 Aug 2001, Pedro Morais wrote:

> Em Domingo, 26 de Agosto de 2001 01:03, David Faure escreveu:
> > On Sunday 26 August 2001 00:45, Pedro Morais wrote:
> >
> > I suggest you have a look at kio/global.cpp ... 62 error messages are
> > already centralized.
>
> But they are only used in kio.
> Continuing with my domtreeviewer, take a look at line 444 of
> kdeaddons/konq-plugins/domtreeviewer/domtreeviewer.cpp
> It deals with QFile's, not with ioslaves.
> What I'm saying is that code like
>
> if (file.exists()) {
>    const QString title = i18n( "File exists" );
>    const QString text = i18n( "Do you really want to overwrite: \n%1" ).arg(url.url());
>    if (KMessageBox::Yes != KMessageBox::warningYesNoCancel(this, text, title ) ) {
>       return;
>    }
> }
>
> could be replaced with something like
>
> if (file.exists()) {
>    const QString title = i18n(KStdErrorMessages::OVERWRITE_TITLE)
>    const QString text = i18n(KStdErrorMessages::OVERWRITE).arg(url.url());
>    if (KMessageBox::Yes != KMessageBox::warningYesNoCancel(this, text, title ) ) {
>       return;
>    }
> }
>
> Or maybe just the whole code that checks if a file satisfied a certain condition
> (in this case, if exists user must have accepted that it is overwriten, must be writable)
> should be refactored to someplace; and them you could use something like:
>
> QFile file = HelperClass::open(HelperClass::PROMPT_EXIST | HelperClass::WRITABLE)
> if (file != null) {
>   doStuff
> }
>
> and all the apropriate user interaction (warnings, errors) would be handled by
> this class.
>
> Just try:
> grep "want to overwrite" $(find kde-i18n/templates -name "*.pot")
> and wonder how many times this code is replicated and why should the user
> receive a slighly diferent message depending on the apps he's running.


Andreas

--
  Andreas Schlapbach      schlpbch@iam.unibe.ch
  http://www.iam.unibe.ch/~schlpbch
                 "/home sweet /home."

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

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