author | zecke <zecke> | 2004-03-23 23:59:36 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-23 23:59:36 (UTC) |
commit | c8acbf192ca4aa64ed66306ca872cb3860590b3c (patch) (unidiff) | |
tree | ad81a8681bd755185e8ba4e3fbded2f1869c1607 | |
parent | 6a1e8a9f03d8b552a51ab0b45ec5b1959af6eb73 (diff) | |
download | opie-c8acbf192ca4aa64ed66306ca872cb3860590b3c.zip opie-c8acbf192ca4aa64ed66306ca872cb3860590b3c.tar.gz opie-c8acbf192ca4aa64ed66306ca872cb3860590b3c.tar.bz2 |
Update....
Start the Slave
Add the Iface for OKeyConfigWidget
-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 @@ | |||
1 | #ifndef ODP_KEY_CONFIG_WIDGET_H | ||
2 | #define ODP_KEY_CONFIG_WIDGET_H | ||
3 | |||
4 | #include <opie2/oconfig.h> | ||
5 | |||
6 | #include <qstring.h> | ||
7 | #include <qpixmap.h> | ||
8 | #include <qbytearray.h> | ||
9 | #include <qhbox.h> | ||
10 | #include <qvaluelist.h> | ||
11 | |||
12 | class QKeyEvent; | ||
13 | |||
14 | namespace Opie { | ||
15 | namespace Ui { | ||
16 | |||
17 | class OKeyConfigItem { | ||
18 | friend class OKeyConfigManager; | ||
19 | public: | ||
20 | typedef QValueList<OKeyConfigItem> OKeyConfigItemList; | ||
21 | OKeyConfigItem( const QString& text = QString::null , const QCString& config_key = QCString(), | ||
22 | const QPixmap& symbol = QPixmap(), | ||
23 | int key = 0, int mod = 0, | ||
24 | int default_key = 0, int default_modified = 0 ); | ||
25 | ~OKeyConfigItem(); | ||
26 | |||
27 | QString text()const; | ||
28 | QPixmap pixmap()const; | ||
29 | int key()const; | ||
30 | int modifier()const; | ||
31 | int defaultKey()const; | ||
32 | int defaultModifier()const; | ||
33 | |||
34 | void setText( const QString& text ); | ||
35 | void setPixmap( const QPixmap& ); | ||
36 | void setKey( int ); | ||
37 | void setModied( int ); | ||
38 | void setDefaultKey( int ); | ||
39 | void setDefaultModifier( int ); | ||
40 | |||
41 | bool isConfigured()const; | ||
42 | bool isEmpty()const; | ||
43 | private: | ||
44 | QString m_text; | ||
45 | QCString m_config; | ||
46 | QPixmap m_pix; | ||
47 | int m_key; | ||
48 | int m_mod; | ||
49 | int m_defKey; | ||
50 | int m_defMod; | ||
51 | class Private; | ||
52 | Private *d; | ||
53 | }; | ||
54 | |||
55 | |||
56 | class OKeyConfig : public QObject { | ||
57 | Q_OBJECT | ||
58 | public: | ||
59 | OKeyConfig(Opie::Core::OConfig *conf = 0, bool grabkeyboard); | ||
60 | ~OKeyConfig(); | ||
61 | |||
62 | void load(); | ||
63 | void save(); | ||
64 | |||
65 | OKeyConfigItem handleKeyEvent( QKeyEvent* ); | ||
66 | QString handleKeyEventString( QKeyEvent* ); | ||
67 | |||
68 | void addKeyConfig( const OKeyConfigItem& ); | ||
69 | void removeKeyConfig( const OKeyConfigItem& ); | ||
70 | signals: | ||
71 | void keyConfigChanged( OKeyConfig* ); | ||
72 | |||
73 | private: | ||
74 | OKeyConfigItemList m_keys; | ||
75 | }; | ||
76 | |||
77 | |||
78 | class OKeyConfigWidget : public QHBox { | ||
79 | Q_OBJECT | ||
80 | public: | ||
81 | enum ChangeMode { Imediate, Queu }; | ||
82 | OKeyConfigWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | ||
83 | OKeyConfigWidget( OKeyConfig *, QWidget* parent = 0, const char* = 0, WFlags = 0 ); | ||
84 | ~OKeyConfigWidget(); | ||
85 | |||
86 | void setChangeMode( enum ChangeMode ); | ||
87 | ChangeMode changeMode()const; | ||
88 | |||
89 | void reload(); | ||
90 | }; | ||
91 | |||
92 | } | ||
93 | } | ||
94 | |||
95 | |||
96 | #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 | |||
@@ -90,13 +90,13 @@ namespace { | |||
90 | 90 | ||
91 | 91 | ||
92 | PIconView::PIconView( QWidget* wid, Config* cfg ) | 92 | PIconView::PIconView( QWidget* wid, Config* cfg ) |
93 | : QVBox( wid ), m_cfg( cfg ) | 93 | : QVBox( wid ), m_cfg( cfg ) |
94 | { | 94 | { |
95 | { | 95 | { |
96 | // QCopEnvelope( "QPE/Application/opie-eye_slave", "foo()" ); | 96 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); |
97 | } | 97 | } |
98 | m_path = QDir::homeDirPath(); | 98 | m_path = QDir::homeDirPath(); |
99 | 99 | ||
100 | QHBox *hbox = new QHBox( this ); | 100 | QHBox *hbox = new QHBox( this ); |
101 | QLabel* lbl = new QLabel( hbox ); | 101 | QLabel* lbl = new QLabel( hbox ); |
102 | lbl->setText( tr("View as" ) ); | 102 | lbl->setText( tr("View as" ) ); |
@@ -119,12 +119,15 @@ PIconView::PIconView( QWidget* wid, Config* cfg ) | |||
119 | m_view->setGridY( fontMetrics().height()*2+40 ); | 119 | m_view->setGridY( fontMetrics().height()*2+40 ); |
120 | loadViews(); | 120 | loadViews(); |
121 | slotViewChanged( m_views->currentItem() ); | 121 | slotViewChanged( m_views->currentItem() ); |
122 | } | 122 | } |
123 | 123 | ||
124 | PIconView::~PIconView() { | 124 | PIconView::~PIconView() { |
125 | { | ||
126 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); | ||
127 | } | ||
125 | } | 128 | } |
126 | 129 | ||
127 | void PIconView::slotDirUp() { | 130 | void PIconView::slotDirUp() { |
128 | QDir dir( m_path ); | 131 | QDir dir( m_path ); |
129 | dir.cdUp(); | 132 | dir.cdUp(); |
130 | slotChangeDir( dir.absPath() ); | 133 | slotChangeDir( dir.absPath() ); |
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 | |||
@@ -10,24 +10,24 @@ | |||
10 | #include <qmap.h> | 10 | #include <qmap.h> |
11 | 11 | ||
12 | #include <qpe/resource.h> | 12 | #include <qpe/resource.h> |
13 | #include <qpe/config.h> | 13 | #include <qpe/config.h> |
14 | #include <qpe/ir.h> | 14 | #include <qpe/ir.h> |
15 | 15 | ||
16 | #include <opie/oapplicationfactory.h> | 16 | #include <opie2/oapplicationfactory.h> |
17 | #include <opie/otabwidget.h> | 17 | #include <opie2/otabwidget.h> |
18 | 18 | ||
19 | #include <iface/ifaceinfo.h> | 19 | #include <iface/ifaceinfo.h> |
20 | #include <iface/dirview.h> | 20 | #include <iface/dirview.h> |
21 | 21 | ||
22 | #include "iconview.h" | 22 | #include "iconview.h" |
23 | #include "filesystem.h" | 23 | #include "filesystem.h" |
24 | 24 | ||
25 | #include "mainwindow.h" | 25 | #include "mainwindow.h" |
26 | 26 | ||
27 | OPIE_EXPORT_APP( OApplicationFactory<PMainWindow> ) | 27 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow> ) |
28 | 28 | ||
29 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | 29 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) |
30 | : QMainWindow( wid, name, style ), m_cfg("phunkview") | 30 | : QMainWindow( wid, name, style ), m_cfg("phunkview") |
31 | { | 31 | { |
32 | setCaption( QObject::tr("Opie Eye Caramba" ) ); | 32 | setCaption( QObject::tr("Opie Eye Caramba" ) ); |
33 | m_cfg.setGroup("Zecke_view" ); | 33 | m_cfg.setGroup("Zecke_view" ); |
@@ -81,13 +81,13 @@ PMainWindow::~PMainWindow() { | |||
81 | 81 | ||
82 | void PMainWindow::slotConfig() { | 82 | void PMainWindow::slotConfig() { |
83 | QDialog dlg(this, 0, true); | 83 | QDialog dlg(this, 0, true); |
84 | dlg.setCaption( tr("Phunk View - Config" ) ); | 84 | dlg.setCaption( tr("Phunk View - Config" ) ); |
85 | 85 | ||
86 | QHBoxLayout *lay = new QHBoxLayout(&dlg); | 86 | QHBoxLayout *lay = new QHBoxLayout(&dlg); |
87 | OTabWidget *wid = new OTabWidget(&dlg ); | 87 | Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); |
88 | lay->addWidget( wid ); | 88 | lay->addWidget( wid ); |
89 | ViewMap *vM = viewMap(); | 89 | ViewMap *vM = viewMap(); |
90 | ViewMap::Iterator _it = vM->begin(); | 90 | ViewMap::Iterator _it = vM->begin(); |
91 | QMap<PDirView*, QWidget*> lst; | 91 | QMap<PDirView*, QWidget*> lst; |
92 | 92 | ||
93 | for( ; _it != vM->end(); ++_it ) { | 93 | for( ; _it != vM->end(); ++_it ) { |
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 | |||
@@ -26,9 +26,9 @@ INTERFACES = | |||
26 | 26 | ||
27 | INCLUDEPATH += . $(OPIEDIR)/include | 27 | INCLUDEPATH += . $(OPIEDIR)/include |
28 | DEPENDPATH += $(OPIEDIR)/include | 28 | DEPENDPATH += $(OPIEDIR)/include |
29 | 29 | ||
30 | 30 | ||
31 | 31 | ||
32 | LIBS += -lqpe -lopie | 32 | LIBS += -lqpe -lopieui2 |
33 | 33 | ||
34 | include ( $(OPIEDIR)/include.pro ) | 34 | 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 | |||
@@ -54,13 +54,13 @@ SlaveObjects* slaveObjects() { | |||
54 | if ( !_slaveObj ) | 54 | if ( !_slaveObj ) |
55 | _slaveObj = new SlaveObjects; | 55 | _slaveObj = new SlaveObjects; |
56 | return _slaveObj; | 56 | return _slaveObj; |
57 | } | 57 | } |
58 | 58 | ||
59 | SlaveReciever::SlaveReciever( QObject* par) | 59 | SlaveReciever::SlaveReciever( QObject* par) |
60 | : QObject( par ) | 60 | : QObject( par ), m_refs( 0 ) |
61 | { | 61 | { |
62 | m_inf = new QTimer(this); | 62 | m_inf = new QTimer(this); |
63 | connect(m_inf,SIGNAL(timeout()), | 63 | connect(m_inf,SIGNAL(timeout()), |
64 | this, SLOT(slotImageInfo())); | 64 | this, SLOT(slotImageInfo())); |
65 | m_pix = new QTimer(this); | 65 | m_pix = new QTimer(this); |
66 | connect(m_pix,SIGNAL(timeout()), | 66 | connect(m_pix,SIGNAL(timeout()), |
@@ -117,21 +117,28 @@ void SlaveReciever::recieveAnswer( const QCString& string, const QByteArray& ar) | |||
117 | PixmapList list; | 117 | PixmapList list; |
118 | stream >> list; | 118 | stream >> list; |
119 | for(PixmapList::Iterator it = list.begin(); it != list.end(); ++it ) { | 119 | for(PixmapList::Iterator it = list.begin(); it != list.end(); ++it ) { |
120 | qWarning( "Got %d %d " + (*it).file, (*it).width , (*it).height ); | 120 | qWarning( "Got %d %d " + (*it).file, (*it).width , (*it).height ); |
121 | m_inPix.append(*it); | 121 | m_inPix.append(*it); |
122 | } | 122 | } |
123 | }else if ( string == "refUp()" ) { | ||
124 | m_refs++; | ||
125 | }else if ( string == "refDown()" ) { | ||
126 | m_refs--; | ||
123 | } | 127 | } |
124 | 128 | ||
125 | if (!m_inf->isActive() && !m_inList.isEmpty() ) | 129 | if (!m_inf->isActive() && !m_inList.isEmpty() ) |
126 | m_inf->start(5); | 130 | m_inf->start(5); |
127 | 131 | ||
128 | if (!m_pix->isActive() && !m_inPix.isEmpty() ) | 132 | if (!m_pix->isActive() && !m_inPix.isEmpty() ) |
129 | m_pix->start(5); | 133 | m_pix->start(5); |
130 | 134 | ||
131 | QPEApplication::setKeepRunning(); | 135 | if ( m_refs ) |
136 | QPEApplication::setKeepRunning(); | ||
137 | else | ||
138 | qApp->quit(); | ||
132 | 139 | ||
133 | } | 140 | } |
134 | 141 | ||
135 | PixmapList SlaveReciever::outPix()const { | 142 | PixmapList SlaveReciever::outPix()const { |
136 | return m_outPix; | 143 | return m_outPix; |
137 | } | 144 | } |
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 | |||
@@ -49,10 +49,12 @@ private slots: | |||
49 | void slotImageInfo(); | 49 | void slotImageInfo(); |
50 | void slotThumbNail(); | 50 | void slotThumbNail(); |
51 | private: | 51 | private: |
52 | QTimer *m_inf, *m_pix, *m_out; | 52 | QTimer *m_inf, *m_pix, *m_out; |
53 | StringList m_inList, m_outList; | 53 | StringList m_inList, m_outList; |
54 | PixmapList m_inPix, m_outPix; | 54 | PixmapList m_inPix, m_outPix; |
55 | private: | ||
56 | int m_refs; | ||
55 | }; | 57 | }; |
56 | 58 | ||
57 | 59 | ||
58 | #endif | 60 | #endif |