[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Tue Apr 27 19:06:23 CEST 2004


CVS commit by arwalker: 

Issue a warning when Kst is started if the Symbol font is not installed.


  M +14 -1     kst.cpp   1.100
  M +2 -0      kst.h   1.43


--- kdeextragear-2/kst/kst/kst.cpp  #1.99:1.100
@@ -169,4 +169,6 @@ KstApp::KstApp(QWidget *parent, const ch
   }
   
+  checkFontPresent( "Symbol" );
+  
   KstViewWindow *vw = new KstViewWindow;
   addWindow(vw);
@@ -175,4 +177,15 @@ KstApp::KstApp(QWidget *parent, const ch
 }
 
+void KstApp::checkFontPresent( const QString& strFont ) {
+  QFont fontSymbol( strFont );
+  QFontInfo info( fontSymbol );
+  QString strWarning;
+  
+  if( info.family( ).lower().compare( strFont.lower() ) != 0 ) {
+    strWarning = i18n( "The %1 font was not found and so was replaced by the %2 font. As a result some labels may not display correctly" ).arg( strFont ).arg( info.family( ) );
+    KstDebug::self()->log( strWarning, KstDebug::Warning );
+  }
+}
+
 void KstApp::customEvent( QCustomEvent* pEvent ) {
   if( pEvent->type() == KstELOGDebugInfoEvent ) {
@@ -846,5 +859,5 @@ void KstApp::slotUpdateDataMsg(const QSt
 
 void KstApp::toggleDataMode() {
-  //view->setDataMode(DataMode->isChecked());
+  /*view->setDataMode(DataMode->isChecked());*/
 }
 

--- kdeextragear-2/kst/kst/kst.h  #1.42:1.43
@@ -70,4 +70,6 @@ class KstApp : public KMdiMainFrm {
     virtual ~KstApp();
 
+    void checkFontPresent( const QString& strFont );
+    
     /** add a file to the recent file list */
     void addRecentFile(const KURL &file);





More information about the Kst mailing list