-rw-r--r-- | libopie2/opieui/okeyconfigwidget.h | 96 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 5 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 8 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/phunk_view.pro | 2 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/slave/slavereciever.cpp | 11 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/slave/slavereciever.h | 2 |
6 files changed, 116 insertions, 8 deletions
diff --git a/libopie2/opieui/okeyconfigwidget.h b/libopie2/opieui/okeyconfigwidget.h new file mode 100644 index 0000000..d76ea46 --- a/dev/null +++ b/libopie2/opieui/okeyconfigwidget.h @@ -0,0 +1,96 @@ +#ifndef ODP_KEY_CONFIG_WIDGET_H +#define ODP_KEY_CONFIG_WIDGET_H + +#include <opie2/oconfig.h> + +#include <qstring.h> +#include <qpixmap.h> +#include <qbytearray.h> +#include <qhbox.h> +#include <qvaluelist.h> + +class QKeyEvent; + +namespace Opie { +namespace Ui { + +class OKeyConfigItem { + friend class OKeyConfigManager; +public: + typedef QValueList<OKeyConfigItem> OKeyConfigItemList; + OKeyConfigItem( const QString& text = QString::null , const QCString& config_key = QCString(), + const QPixmap& symbol = QPixmap(), + int key = 0, int mod = 0, + int default_key = 0, int default_modified = 0 ); + ~OKeyConfigItem(); + + QString text()const; + QPixmap pixmap()const; + int key()const; + int modifier()const; + int defaultKey()const; + int defaultModifier()const; + + void setText( const QString& text ); + void setPixmap( const QPixmap& ); + void setKey( int ); + void setModied( int ); + void setDefaultKey( int ); + void setDefaultModifier( int ); + + bool isConfigured()const; + bool isEmpty()const; +private: + QString m_text; + QCString m_config; + QPixmap m_pix; + int m_key; + int m_mod; + int m_defKey; + int m_defMod; + class Private; + Private *d; +}; + + +class OKeyConfig : public QObject { + Q_OBJECT +public: + OKeyConfig(Opie::Core::OConfig *conf = 0, bool grabkeyboard); + ~OKeyConfig(); + + void load(); + void save(); + + OKeyConfigItem handleKeyEvent( QKeyEvent* ); + QString handleKeyEventString( QKeyEvent* ); + + void addKeyConfig( const OKeyConfigItem& ); + void removeKeyConfig( const OKeyConfigItem& ); +signals: + void keyConfigChanged( OKeyConfig* ); + +private: + OKeyConfigItemList m_keys; +}; + + +class OKeyConfigWidget : public QHBox { + Q_OBJECT +public: + enum ChangeMode { Imediate, Queu }; + OKeyConfigWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + OKeyConfigWidget( OKeyConfig *, QWidget* parent = 0, const char* = 0, WFlags = 0 ); + ~OKeyConfigWidget(); + + void setChangeMode( enum ChangeMode ); + ChangeMode changeMode()const; + + void reload(); +}; + +} +} + + +#endif diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp index 38a621e..729b64f 100644 --- a/noncore/graphics/opie-eye/gui/iconview.cpp +++ b/noncore/graphics/opie-eye/gui/iconview.cpp @@ -94,5 +94,5 @@ PIconView::PIconView( QWidget* wid, Config* cfg ) { { -// QCopEnvelope( "QPE/Application/opie-eye_slave", "foo()" ); + QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); } m_path = QDir::homeDirPath(); @@ -123,4 +123,7 @@ PIconView::PIconView( QWidget* wid, Config* cfg ) PIconView::~PIconView() { + { + QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); + } } diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 0a2fcab..ea765d1 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp @@ -14,6 +14,6 @@ #include <qpe/ir.h> -#include <opie/oapplicationfactory.h> -#include <opie/otabwidget.h> +#include <opie2/oapplicationfactory.h> +#include <opie2/otabwidget.h> #include <iface/ifaceinfo.h> @@ -25,5 +25,5 @@ #include "mainwindow.h" -OPIE_EXPORT_APP( OApplicationFactory<PMainWindow> ) +OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow> ) PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) @@ -85,5 +85,5 @@ void PMainWindow::slotConfig() { QHBoxLayout *lay = new QHBoxLayout(&dlg); - OTabWidget *wid = new OTabWidget(&dlg ); + Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); lay->addWidget( wid ); ViewMap *vM = viewMap(); diff --git a/noncore/graphics/opie-eye/phunk_view.pro b/noncore/graphics/opie-eye/phunk_view.pro index 21178ee..0bb5679 100644 --- a/noncore/graphics/opie-eye/phunk_view.pro +++ b/noncore/graphics/opie-eye/phunk_view.pro @@ -30,5 +30,5 @@ DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe -lopie +LIBS += -lqpe -lopieui2 include ( $(OPIEDIR)/include.pro ) diff --git a/noncore/graphics/opie-eye/slave/slavereciever.cpp b/noncore/graphics/opie-eye/slave/slavereciever.cpp index c8e33d4..bbbbb30 100644 --- a/noncore/graphics/opie-eye/slave/slavereciever.cpp +++ b/noncore/graphics/opie-eye/slave/slavereciever.cpp @@ -58,5 +58,5 @@ SlaveObjects* slaveObjects() { SlaveReciever::SlaveReciever( QObject* par) - : QObject( par ) + : QObject( par ), m_refs( 0 ) { m_inf = new QTimer(this); @@ -121,4 +121,8 @@ void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar) m_inPix.append(*it); } + }else if ( string == "refUp()" ) { + m_refs++; + }else if ( string == "refDown()" ) { + m_refs--; } @@ -129,5 +133,8 @@ void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar) m_pix->start(5); - QPEApplication::setKeepRunning(); + if ( m_refs ) + QPEApplication::setKeepRunning(); + else + qApp->quit(); } diff --git a/noncore/graphics/opie-eye/slave/slavereciever.h b/noncore/graphics/opie-eye/slave/slavereciever.h index 214bfc6..b5aaccf 100644 --- a/noncore/graphics/opie-eye/slave/slavereciever.h +++ b/noncore/graphics/opie-eye/slave/slavereciever.h @@ -53,4 +53,6 @@ private: StringList m_inList, m_outList; PixmapList m_inPix, m_outPix; +private: + int m_refs; }; |