]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix for bug IPAL12144.
authormzn <mzn@opencascade.com>
Tue, 11 Apr 2006 11:26:42 +0000 (11:26 +0000)
committermzn <mzn@opencascade.com>
Tue, 11 Apr 2006 11:26:42 +0000 (11:26 +0000)
src/LightApp/LightApp_Application.cxx

index b711b24cdf5819a62664ad8906eb2b79c0f73384..4c4a9a6156f0cf28fcce42f794c6a7a9cccef6b0 100644 (file)
@@ -211,6 +211,30 @@ myPrefs( 0 )
 #endif
 
   connect( mySelMgr, SIGNAL( selectionChanged() ), this, SLOT( onSelection() ) );
+
+  // Set existing font for the python console in resources
+  if( !aResMgr->hasValue( "PyConsole", "font" ) )
+    return;
+  
+  QFont f = aResMgr->fontValue( "PyConsole", "font" );
+  QFontDatabase fdb;
+  QStringList famdb = fdb.families();
+  
+  if ( famdb.contains(f.family()) || !aResMgr->hasValue( "PyConsole", "additional_families" ) )
+    return;
+  
+  QStringList anAddFamilies = QStringList::split( ";", aResMgr->stringValue( "PyConsole", "additional_families" ) );
+  QString aFamily;
+  for ( QStringList::Iterator it = anAddFamilies.begin(); it != anAddFamilies.end(); ++it )
+    {
+      aFamily = *it;
+      if ( famdb.contains(aFamily) )
+       {
+         f.setFamily( aFamily );
+         aResMgr->setValue( "PyConsole", "font", f );
+         break;
+       }
+    }
 }
 
 /*!Destructor.
@@ -999,28 +1023,6 @@ void LightApp_Application::addWindow( QWidget* wid, const int flag, const int st
        f = ( ( PythonConsole* )wid )->font();
        resourceMgr()->setValue( "PyConsole", "font", f );
       }
-    
-    // Try to set one of additional families (if it exists in the font database)
-    QFontDatabase fdb;
-    QStringList aDatabaseFamilies = fdb.families();
-    
-    if ( !aDatabaseFamilies.contains(f.family()) && 
-        resourceMgr()->hasValue( "PyConsole", "additional_families" ) )
-      {
-       QStringList anAddFamilies = QStringList::split( ";", resourceMgr()->stringValue( "PyConsole", "additional_families" ) );
-       
-       QString aFamily;
-       for ( QStringList::Iterator it = anAddFamilies.begin(); it != anAddFamilies.end(); ++it )
-         {
-           aFamily = *it;
-           if ( !aDatabaseFamilies.contains(aFamily) )
-             continue;
-           
-           f.setFamily( aFamily );
-           resourceMgr()->setValue( "PyConsole", "font", f );
-           break;
-         }
-      }
   }
   else
 #endif