From d13a1a3345270ea71215d421627665a40f16454c Mon Sep 17 00:00:00 2001 From: mickeyl Date: Sat, 11 Jun 2005 12:22:30 +0000 Subject: - read default profile fixed font specs from qpe.conf, if profile doesn't exist - fix initial background color --- (limited to 'noncore/apps') diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index 986ae8d..2087f57 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp @@ -4,6 +4,10 @@ #include "script.h" #include "logger.h" +/* OPIE */ +#include + +/* QT */ #include #include @@ -44,12 +48,22 @@ EmulationHandler::~EmulationHandler() { void EmulationHandler::load( const Profile& prof) { -// m_teWid->setVTFont( font( prof.readNumEntry("Font") ) ); - QFont font( prof.readEntry("Font"), prof.readNumEntry( "FontSize" ), QFont::Normal ); + // try to read the fontconfig from the profile + QString aFont = prof.readEntry( "Font" ); + int aFontSize = prof.readNumEntry( "FontSize" ); + // use defaults from qpe.conf if no profile yet + if ( ( aFontSize == -1 ) || ( aFont == QString::null ) ) + { + Config c( "qpe" ); + c.setGroup( "Appearance" ); + aFont = c.readEntry( "FixedFontFamily", "Fixed" ); + aFontSize = c.readNumEntry( "FixedFontSize", 7 ); + } + QFont font( aFont, aFontSize ); font.setFixedPitch( TRUE ); m_teWid->setVTFont( font ); - int num = prof.readNumEntry("Color"); + int num = prof.readNumEntry("Color", 0); setColor( foreColor(num), backColor(num) ); m_teWid->setBackgroundColor(backColor(num) ); -- cgit v0.9.0.2