From kde-devel Sun Sep 19 09:32:42 1999 From: Espen Sand Date: Sun, 19 Sep 1999 09:32:42 +0000 To: kde-devel Subject: Changes in kapp X-MARC-Message: https://marc.info/?l=kde-devel&m=93773356208689 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. what I will add: kapp.h ----- enum captionStyle { CaptionAppLast=0, // "caption - " CaptionAppFirst, // ": 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. -- Espen Sand