summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
authorerik <erik>2007-01-19 01:15:31 (UTC)
committer erik <erik>2007-01-19 01:15:31 (UTC)
commitac0ce844e90a64247c0adb210e0a23021b011d57 (patch) (side-by-side diff)
tree1fd3b8d0c24d8f2054ed45e7e2e102f940343462 /library/qpeapplication.cpp
parent1ab92f1d2b346de7da8ca5c3aaa6bc75b43981e7 (diff)
downloadopie-ac0ce844e90a64247c0adb210e0a23021b011d57.zip
opie-ac0ce844e90a64247c0adb210e0a23021b011d57.tar.gz
opie-ac0ce844e90a64247c0adb210e0a23021b011d57.tar.bz2
Commit of Paul's patch to remove a macro and substitute it with a
class variable.
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index dcc1001..34f5e6a 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -98,12 +98,13 @@
#endif
#include <backend/rohfeedback.h>
static bool useBigPixmaps = 0;
+static bool saveWindowsPos = 0;
class HackWidget : public QWidget
{
public:
bool needsOk()
{ return (getWState() & WState_Reserved1 ); }
@@ -126,12 +127,13 @@ public:
cfg.setGroup( "Appearance" );
useBigPixmaps = cfg.readBoolEntry( "useBigPixmaps", false );
fontFamily = cfg.readEntry( "FontFamily", "Vera" );
fontSize = cfg.readNumEntry( "FontSize", 10 );
smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 );
bigIconSize = cfg.readNumEntry( "BigIconSize", 32 );
+ saveWindowsPos = cfg.readBoolEntry( "AllowWindowed", false );
#ifdef OPIE_WITHROHFEEDBACK
RoH = 0;
#endif
}
int presstimer;
@@ -247,13 +249,14 @@ public:
}
}
}
static bool read_widget_rect(const QString &app, bool &maximized, QPoint &p, QSize &s)
{
-#ifndef OPIE_NO_WINDOWED
+ if (!saveWindowsPos)
+ return FALSE;
maximized = TRUE;
// 350 is the trigger in qwsdefaultdecoration for providing a resize button
if ( qApp->desktop()->width() <= 350 )
return FALSE;
Config cfg( "qpe" );
@@ -269,14 +272,12 @@ public:
s.setHeight( l[3].toInt() );
maximized = l[4].toInt();
return TRUE;
}
-#endif
- return FALSE;
}
static bool validate_widget_size(const QWidget *w, QPoint &p, QSize &s)
{
#ifndef Q_WS_QWS
@@ -319,13 +320,14 @@ public:
}
static void store_widget_rect(QWidget *w, QString &app)
{
if( !w )
return;
-#ifndef OPIE_NO_WINDOWED
+ if (!saveWindowsPos)
+ return;
// 350 is the trigger in qwsdefaultdecoration for providing a resize button
if ( qApp->desktop()->width() <= 350 )
return;
// we use these to map the offset of geometry and pos. ( we can only use normalGeometry to
// get the non-maximized version, so we have to do it the hard way )
int offsetX = w->x() - w->geometry().left();
@@ -340,13 +342,12 @@ public:
// Stores the window placement as pos(), size() (due to the offset mapping)
Config cfg( "qpe" );
cfg.setGroup("ApplicationPositions");
QString s;
s.sprintf("%d,%d,%d,%d,%d", r.left() + offsetX, r.top() + offsetY, r.width(), r.height(), w->isMaximized() );
cfg.writeEntry( app, s );
-#endif
}
static bool setWidgetCaptionFromAppName( QWidget* /*mw*/, const QString& /*appName*/, const QString& /*appsPath*/ )
{
/*
// This works but disable it for now until it is safe to apply
@@ -2204,12 +2205,17 @@ void QPEApplication::hideOrQuit()
}
#endif
else
quit();
}
+bool QPEApplication::isSaveWindowsPos()
+{
+ return saveWindowsPos;
+}
+
#if (__GNUC__ > 2 ) && !defined(_OS_MACX_)
extern "C" void __cxa_pure_virtual();
void __cxa_pure_virtual()
{
fprintf( stderr, "Pure virtual called\n");