[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-devel
Subject: Re: Changes in kapp
From: David Faure <faure () kde ! org>
Date: 1999-09-19 10:04:37
[Download RAW message or body]
On Sun, Sep 19, 1999 at 12:30:04PM +0200, Espen Sand wrote:
> Last Friday I asked if anybody had objections to that I added a new method to
> kapp.cc/h. I have got no such replies. I send this message again just to make
> sure. I will add the code today sometime between 1800 and 2000 CET unless
> someone think this is really bad.
>
> The purpose it to make a method that will make a correct caption. If this
> method is used everywhere, all apps + dialogs will get the same caption.
>
> Usage: "setCaption(kapp->makeStdCaption(caption))" . In my view it is not the
> application programmer that should decide the layout of the caption.
Then what's the point in defining 3 layouts, if mCaptionStyle is always CaptionAppLast ?
Other than that, green light :)
> what I will add:
>
> kapp.h
> -----
> enum captionStyle
> {
> CaptionAppLast=0, // "caption - <appName>"
> CaptionAppFirst, // "<appName>: caption"
> CaptionNoApp // "caption"
> };
>
> int mCaptionStyle; // Set to CaptionAppLast in constructor.
> QString makeStdCaption( const QString &userCaption, bool withAppName=true )
> const;
>
> kapp.cc
> ------
>
> QString KApplication::makeStdCaption( const QString &userCaption, bool
> withAppName ) const
> {
> if( userCaption.isNull() == true )
> {
> return( getCaption() );
> }
>
> if( withAppName == true )
> {
> if( mCaptionStyle == CaptionAppLast )
> {
> return( QString("%1 - %2").arg(userCaption).arg(getCaption()));
> }
> else if( mCaptionStyle == CaptionAppFirst )
> {
> return( QString("%1: %2").arg(getCaption()).arg(userCaption) );
> }
> }
>
> return( userCaption );
> }
>
>
> Still to be considered
> ---------------
> A signal telling that the layout has changed.
--
David FAURE
david@mandrakesoft.com, faure@kde.org
http://www.insa-lyon.fr/People/AEDI/dfaure/index.html
KDE, Making The Future of Computing Available Today
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic