author | mickeyl <mickeyl> | 2005-06-11 12:22:30 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-06-11 12:22:30 (UTC) |
commit | d13a1a3345270ea71215d421627665a40f16454c (patch) (side-by-side diff) | |
tree | 58aa21f57fd6d08547756a9e68e78282ce554568 | |
parent | 9fe80ebf4fbe9b31d9f91a33e4cfc163b7236a62 (diff) | |
download | opie-d13a1a3345270ea71215d421627665a40f16454c.zip opie-d13a1a3345270ea71215d421627665a40f16454c.tar.gz opie-d13a1a3345270ea71215d421627665a40f16454c.tar.bz2 |
- read default profile fixed font specs from qpe.conf, if profile doesn't exist
- fix initial background color
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/emulation_handler.cpp | 20 |
2 files changed, 18 insertions, 3 deletions
@@ -13,4 +13,5 @@ * ZSafe - make UI conform to Opie standards (drw) * Today Addressbook plugin - fix configuration to show/not show birthdays, use checkboxes for selection (hrw) + * Opie-Console: read initial fixed font configuration from qpe.conf (mickeyl) Fixed Bugs 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 @@ -5,4 +5,8 @@ #include "logger.h" +/* OPIE */ +#include <qpe/config.h> + +/* QT */ #include <qfile.h> #include <qtextstream.h> @@ -45,10 +49,20 @@ 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) ); |