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

List:       kde-commits
Subject:    KDE/kdeedu/kstars/kstars
From:       Jason Harris <kstars () 30doradus ! org>
Date:       2005-09-30 1:23:20
Message-ID: 1128043400.716576.3050.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 465515 by harris:

Fixing bug 113467 (Change tooltip if dmsBox is read-only), in trunk
Also changed the Whats this text.

BUG: 113467



 M  +26 -9     dmsbox.cpp  


--- trunk/KDE/kdeedu/kstars/kstars/dmsbox.cpp #465514:465515
@@ -21,11 +21,11 @@
 
 #include <kdebug.h>
 #include <klocale.h>
+
 #include <qregexp.h>
 #include <qstring.h>
-#include <qtooltip.h>
-#include <q3whatsthis.h>
-//Added by qt3to4:
+#include <QToolTip>
+#include <QWhatsThis>
 #include <QFocusEvent>
 
 dmsBox::dmsBox(QWidget *parent, const char *name, bool dg) 
@@ -90,16 +90,33 @@
 }
 
 void dmsBox::setDegType( bool t ) {
-	deg = t;
 
-	if ( deg ) {
-		QToolTip::add( this, i18n( "Angle value in degrees. You may enter a simple integer \
\nor a floating-point value, or space- or colon-delimited values \nspecifying \
                degrees, arcminutes and arcseconds." ) );
-		Q3WhatsThis::add( this, i18n( "Enter an angle value in degrees.  The angle can be \
expressed as a simple integer (\"45\") or floating-point (\"45.333\") value, or as \
space- or colon-delimited values specifying degrees, arcminutes and arcseconds \
(\"45:20\", \"45:20:00\", \"45:20\", \"45 20.0\", etc.)." ) );  +	QString sDeg = ( t \
? i18n( "degrees" ) : i18n( "hours" ) ); +	QString sMin = ( t ? i18n( "arcminutes" ) \
: i18n( "minutes" ) ); +	QString sSec = ( t ? i18n( "arcseconds" ) : i18n( "seconds" \
) ); +
+	QString sTip = i18n( "Angle value in %1." ).arg( sDeg );
+	QString sWhatsThis;
+
+	if ( isReadOnly() ) {
+	  sWhatsThis = i18n( "This box displays an angle in %1. "  
+			     "The three numbers displayed are the angle's "
+			     "%1, %2, and %3." ).arg(sDeg).arg(sMin).arg(sSec);
 	} else {
-		QToolTip::add( this, i18n( "Angle value in hours. You may enter a simple integer \
\nor floating-point value, or space- or colon-delimited values \nspecifying hours, \
                minutes and seconds." ) );
-		Q3WhatsThis::add( this, i18n( "Enter an angle value in hours.  The angle can be \
expressed as a simple integer (\"12\") or floating-point (\"12.333\") value, or as \
space- or colon-delimited values specifying hours, minutes and seconds (\"12:20\", \
\"12:20:00\", \"12:20\", \"12 20.0\", etc.)." ) ); +	  sTip += i18n( "  You may enter \
a simple integer, or a floating-point value, " +			"or space- or colon-delimited \
values specifying " +			"%1, %2 and %3" ).arg(sDeg).arg(sMin).arg(sSec);
+
+	  sWhatsThis = i18n( "Enter an angle value in %1.  The angle can be expressed "
+			     "as a simple integer (\"45\"), or floating-point "
+			     "(\"45.33\") value, or as space- or colon-delimited "
+			     "values specifying %1, %2 and %3 (\"45:20\", \"45:20:00\", "
+			     "\"45 20\", \"45 20 00.0\", etc.)." ).arg(sDeg).arg(sMin).arg(sSec);
 	}
 
+	setTooltip( sTip );
+	setWhatsThis( sWhatsThis );
+
 	clear();
 	unsetPalette();
 	EmptyFlag = false;


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

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