summaryrefslogtreecommitdiff
authorsandman <sandman>2002-11-26 23:34:04 (UTC)
committer sandman <sandman>2002-11-26 23:34:04 (UTC)
commite52158d2f9e1fdc9766d991dc672729648d5a020 (patch) (side-by-side diff)
tree2e87e8d9a24cdb336b2d7ca654a5ffa2f80c5f8c
parentac4f32931212847803534a72eb5e951bd01e6ff5 (diff)
downloadopie-e52158d2f9e1fdc9766d991dc672729648d5a020.zip
opie-e52158d2f9e1fdc9766d991dc672729648d5a020.tar.gz
opie-e52158d2f9e1fdc9766d991dc672729648d5a020.tar.bz2
Sharp ROM compatibilty upgrade:
All these functions are needed to get qtmail (from the Sharp ROM) running on Opie - I have even tested qtmail on an iPAQ and it seems to work ..
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/config.cpp12
-rw-r--r--library/config.h5
-rw-r--r--library/datebookmonth.cpp12
-rw-r--r--library/datebookmonth.h15
-rw-r--r--library/qpemenubar.cpp9
-rw-r--r--library/qpemenubar.h7
6 files changed, 59 insertions, 1 deletions
diff --git a/library/config.cpp b/library/config.cpp
index 1121cd4..b47c620 100644
--- a/library/config.cpp
+++ b/library/config.cpp
@@ -93,24 +93,36 @@ QString Config::configFilename(const QString& name, Domain d)
In the File Domain, \a name is an absolute filename.
*/
Config::Config( const QString &name, Domain domain )
: filename( configFilename(name,domain) )
{
git = groups.end();
read();
QStringList l = Global::languageList();
lang = l[0];
glang = l[1];
}
+
+// Sharp ROM compatibility
+Config::Config ( const QString &name, bool what )
+ : filename( configFilename(name,what ? User : File) )
+{
+ git = groups.end();
+ read();
+ QStringList l = Global::languageList();
+ lang = l[0];
+ glang = l[1];
+}
+
/*!
Writes any changes to disk and destroys the in-memory object.
*/
Config::~Config()
{
if ( changed )
write();
}
/*!
Returns whether the current group has an entry called \a key.
*/
diff --git a/library/config.h b/library/config.h
index 1dc32fa..0bab7ca 100644
--- a/library/config.h
+++ b/library/config.h
@@ -26,25 +26,25 @@
#include <qmap.h>
#include <qstringlist.h>
class ConfigPrivate;
class Config
{
public:
typedef QMap< QString, QString > ConfigGroup;
enum Domain { File, User };
Config( const QString &name, Domain domain=User );
~Config();
-
+
bool operator == ( const Config & other ) const { return (filename == other.filename); }
bool operator != ( const Config & other ) const { return (filename != other.filename); }
bool isValid() const;
bool hasKey( const QString &key ) const;
void setGroup( const QString &gname );
void writeEntry( const QString &key, const char* value );
void writeEntry( const QString &key, const QString &value );
void writeEntryCrypt( const QString &key, const QString &value );
void writeEntry( const QString &key, int num );
#ifdef Q_HAS_BOOL_TYPE
@@ -75,24 +75,27 @@ public:
protected:
void read();
bool parse( const QString &line );
QMap< QString, ConfigGroup > groups;
QMap< QString, ConfigGroup >::Iterator git;
QString filename;
QString lang;
QString glang;
bool changed;
ConfigPrivate *d;
static QString configFilename(const QString& name, Domain);
+
+private: // Sharp ROM compatibility
+ Config( const QString &name, bool what );
};
inline QString Config::readEntry( const QString &key, const QString &deflt ) const
{ return ((Config*)this)->readEntry(key,deflt); }
inline QString Config::readEntryCrypt( const QString &key, const QString &deflt ) const
{ return ((Config*)this)->readEntryCrypt(key,deflt); }
inline QString Config::readEntryDirect( const QString &key, const QString &deflt ) const
{ return ((Config*)this)->readEntryDirect(key,deflt); }
inline int Config::readNumEntry( const QString &key, int deflt ) const
{ return ((Config*)this)->readNumEntry(key,deflt); }
inline bool Config::readBoolEntry( const QString &key, bool deflt ) const
{ return ((Config*)this)->readBoolEntry(key,deflt); }
diff --git a/library/datebookmonth.cpp b/library/datebookmonth.cpp
index 4a9dcbd..e8be313 100644
--- a/library/datebookmonth.cpp
+++ b/library/datebookmonth.cpp
@@ -739,12 +739,24 @@ void DateButton::setDate( QDate d )
void DateButton::setDateFormat( DateFormat f )
{
df = f;
setDate( currDate );
}
bool DateButton::customWhatsThis() const
{
return TRUE;
}
+
+// this class is only here for Sharp ROM compatibility
+// I have reverse engineered this class and it seems to
+// work (only qtmail seems to use it) - sandman
+// DO NOT USE IT IN NEW CODE !!
+
+DateBookMonthPopup::DateBookMonthPopup ( QWidget *w )
+ : QPopupMenu ( w )
+{
+ m_dbm = new DateBookMonth( this, 0, TRUE );
+ insertItem( m_dbm );
+}
diff --git a/library/datebookmonth.h b/library/datebookmonth.h
index 3c57c19..cb436a8 100644
--- a/library/datebookmonth.h
+++ b/library/datebookmonth.h
@@ -19,24 +19,25 @@
**********************************************************************/
#ifndef DATEBOOKMONTH
#define DATEBOOKMONTH
#include <qtopia/private/event.h>
#include <qvbox.h>
#include <qhbox.h>
#include <qdatetime.h>
#include <qvaluelist.h>
#include <qtable.h>
#include <qpushbutton.h>
+#include <qpopupmenu.h>
#include "calendar.h"
#include "timestring.h"
class QToolButton;
class QComboBox;
class QSpinBox;
class Event;
class DateBookDB;
class DateBookMonthHeaderPrivate;
class DateBookMonthHeader : public QHBox
@@ -200,14 +201,28 @@ public slots:
private slots:
void pickDate();
void gotHide();
private:
bool longFormat;
bool weekStartsMonday;
QDate currDate;
DateFormat df;
};
+// this class is only here for Sharp ROM compatibility
+// I have reverse engineered this class and it seems to
+// work (only qtmail seems to use it) - sandman
+// DO NOT USE IT IN NEW CODE !!
+
+class DateBookMonthPopup : public QPopupMenu
+{
+ Q_OBJECT
+public:
+ DateBookMonthPopup ( QWidget *w );
+
+private:
+ DateBookMonth *m_dbm;
+};
#endif
diff --git a/library/qpemenubar.cpp b/library/qpemenubar.cpp
index c658d10..4aa0bf3 100644
--- a/library/qpemenubar.cpp
+++ b/library/qpemenubar.cpp
@@ -35,24 +35,33 @@ public:
{
activateItemAt(-1);
for ( unsigned int i = 0; i < count(); i++ ) {
QMenuItem *mi = findItem( idAt(i) );
if ( mi->popup() ) {
mi->popup()->hide();
}
}
}
};
+// Sharp ROM compatibility
+void QPEMenuToolFocusManager::setMenukeyEnabled ( bool )
+{
+}
+int QPEMenuBar::getOldFocus ( )
+{
+ return 0;
+}
+
QPEMenuToolFocusManager *QPEMenuToolFocusManager::me = 0;
QPEMenuToolFocusManager::QPEMenuToolFocusManager() : QObject()
{
qApp->installEventFilter( this );
}
void QPEMenuToolFocusManager::addWidget( QWidget *w )
{
list.append( GuardedWidget(w) );
}
diff --git a/library/qpemenubar.h b/library/qpemenubar.h
index 05abc4e..66d0c85 100644
--- a/library/qpemenubar.h
+++ b/library/qpemenubar.h
@@ -44,35 +44,42 @@ protected:
void setFocus( QWidget *w, bool next=TRUE );
bool eventFilter( QObject *object, QEvent *event );
private slots:
void deactivate();
private:
typedef QGuardedPtr<QWidget> GuardedWidget;
QValueList<GuardedWidget> list;
GuardedWidget inFocus;
GuardedWidget oldFocus;
static QPEMenuToolFocusManager *me;
+
+private: // Sharp ROM compatibility
+ void setMenukeyEnabled ( bool b );
};
class QPEMenuBar : public QMenuBar
{
Q_OBJECT
public:
QPEMenuBar( QWidget *parent=0, const char* name=0 );
~QPEMenuBar();
protected:
virtual void keyPressEvent( QKeyEvent *e );
/* Patch from Mickey
* Sharp Qtopia1.5 seems to have these functions
* TO BE RESOLVED - zecke
*/
void activateItem( int index );
void goodbye();
+
+ // This is a special "lineo" add-on for the Sharp ROM
+ // nobody knows, what it does, though ...
+ int getOldFocus ( );
};
#endif