summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
Side-by-side diff
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index cf437da..f84bc0e 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -61,24 +61,26 @@
#include <qmotifstyle.h>
#include <qmotifplusstyle.h>
#include "lightstyle.h"
#endif
#include "global.h"
#include "resource.h"
#if QT_VERSION <= 230 && defined(QT_NO_CODECS)
#include "qutfcodec.h"
#endif
#include "config.h"
#include "network.h"
#include "fontmanager.h"
+#include "fontdatabase.h"
+
#include "power.h"
#include "alarmserver.h"
#include "applnk.h"
#include "qpemenubar.h"
#include <unistd.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/soundcard.h>
// for setBacklight()
#if defined(QT_QWS_IPAQ) || defined(QT_QWS_EBX)
@@ -376,25 +378,25 @@ public:
Config config( "qpe" );
config.setGroup( "Screensaver" );
if (config.readNumEntry("LcdOffOnly",0) != 0) // We're only turning off the LCD
{
fd=open("/dev/fb0",O_RDWR);
if (fd != -1) { ioctl(fd,FBIOBLANK,VESA_POWERDOWN); close(fd); }
LcdOn = FALSE;
}
else // We're going to suspend the whole machine
{
if ( disable_suspend > 2 && !powerOnline() && !networkOnline() ) {
QWSServer::sendKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE );
- return TRUE;
+ return TRUE;
}
}
break;
}
return FALSE;
}
};
static int ssi(int interval, Config &config, const QString &enable, const QString& value, int def)
{
if ( !enable.isEmpty() && config.readNumEntry(enable,0) == 0 )
return 0;
@@ -495,25 +497,25 @@ static void setScreenSaverInterval(int interval)
\sa qcop.html
*/
/*!
Constructs a QPEApplication just as you would construct
a QApplication, passing \a argc, \a argv, and \a t.
*/
QPEApplication::QPEApplication( int& argc, char **argv, Type t )
: QApplication( hack(argc), argv, t )
{
int dw = desktop()->width();
if ( dw < 200 ) {
- setFont( QFont( "helvetica", 8 ) );
+// setFont( QFont( "helvetica", 8 ) );
AppLnk::setSmallIconSize(10);
AppLnk::setBigIconSize(28);
}
d = new QPEApplicationData;
QMimeSourceFactory::setDefaultFactory(new ResourceMimeFactory);
connect(this, SIGNAL(lastWindowClosed()), this, SLOT(hideOrQuit()));
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
QString qcopfn("/tmp/qcop-msg-");
qcopfn += QString(argv[0]); // append command name
@@ -590,25 +592,39 @@ QPEApplication::QPEApplication( int& argc, char **argv, Type t )
trans = new QTranslator(this);
tfn = qpeDir()+"/i18n/"+lang+"/"+d->appName+".qm";
if ( trans->load( tfn ))
installTranslator( trans );
else
delete trans;
//###language/font hack; should look it up somewhere
if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) {
QFont fn = FontManager::unicodeFont( FontManager::Proportional );
setFont( fn );
}
+ else {
+ Config config( "qpe" );
+ config.setGroup( "Appearance" );
+ QString familyStr = config.readEntry( "FontFamily", "fixed" );
+ QString styleStr = config.readEntry( "FontStyle", "Regular" );
+ QString sizeStr = config.readEntry( "FontSize", "10" );
+ QString charSetStr = config.readEntry( "FontCharSet", "iso10646-1" );
+ bool ok;
+ int i_size = sizeStr.toInt( &ok, 10 );
+ FontDatabase fdb;
+ QFont selectedFont = fdb.font( familyStr, styleStr, i_size, charSetStr );
+ setFont( selectedFont );
+ }
}
+
#endif
applyStyle();
if ( type() == GuiServer ) {
setScreenSaverInterval(-1);
setVolume();
QWSServer::setScreenSaver(new QPEScreenSaver);
}
installEventFilter( this );