-rw-r--r-- | noncore/graphics/opie-eye/gui/imageinfoui.cpp | 1 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 55 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.h | 40 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 13 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.h | 4 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/phunk_view.pro | 6 |
6 files changed, 111 insertions, 8 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.cpp b/noncore/graphics/opie-eye/gui/imageinfoui.cpp index d56d65a..822fd88 100644 --- a/noncore/graphics/opie-eye/gui/imageinfoui.cpp +++ b/noncore/graphics/opie-eye/gui/imageinfoui.cpp | |||
@@ -14,13 +14,12 @@ | |||
14 | #include <qfileinfo.h> | 14 | #include <qfileinfo.h> |
15 | 15 | ||
16 | #include "lib/slavemaster.h" | 16 | #include "lib/slavemaster.h" |
17 | #include "lib/imagecache.h" | 17 | #include "lib/imagecache.h" |
18 | 18 | ||
19 | #include <opie2/oconfig.h> | 19 | #include <opie2/oconfig.h> |
20 | #include <opie2/oconfig.h> | ||
21 | #include <opie2/okeyconfigwidget.h> | 20 | #include <opie2/okeyconfigwidget.h> |
22 | #include <opie2/odebug.h> | 21 | #include <opie2/odebug.h> |
23 | 22 | ||
24 | #include <qpe/qcopenvelope_qws.h> | 23 | #include <qpe/qcopenvelope_qws.h> |
25 | #include <qpe/resource.h> | 24 | #include <qpe/resource.h> |
26 | 25 | ||
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp new file mode 100644 index 0000000..8fc258e --- a/dev/null +++ b/noncore/graphics/opie-eye/gui/imageview.cpp | |||
@@ -0,0 +1,55 @@ | |||
1 | #include "imageview.h" | ||
2 | |||
3 | #include <opie2/odebug.h> | ||
4 | #include <opie2/oconfig.h> | ||
5 | #include <opie2/okeyconfigwidget.h> | ||
6 | |||
7 | #include <qpe/resource.h> | ||
8 | |||
9 | using namespace Opie::Core; | ||
10 | |||
11 | ImageView::ImageView( QWidget* parent, const char* name, WFlags fl ) | ||
12 | : ImageScrollView(parent,name,fl) | ||
13 | { | ||
14 | m_viewManager = 0; | ||
15 | initKeys(); | ||
16 | } | ||
17 | |||
18 | ImageView::~ImageView() | ||
19 | { | ||
20 | } | ||
21 | |||
22 | Opie::Ui::OKeyConfigManager* ImageView::manager() | ||
23 | { | ||
24 | if (!m_viewManager) { | ||
25 | initKeys(); | ||
26 | } | ||
27 | return m_viewManager; | ||
28 | } | ||
29 | |||
30 | void ImageView::initKeys() | ||
31 | { | ||
32 | odebug << "init imageview keys" << oendl; | ||
33 | m_cfg = new Opie::Core::OConfig("phunkview"); | ||
34 | m_cfg->setGroup("Zecke_view" ); | ||
35 | Opie::Ui::OKeyPair::List lst; | ||
36 | lst.append( Opie::Ui::OKeyPair::upArrowKey() ); | ||
37 | lst.append( Opie::Ui::OKeyPair::downArrowKey() ); | ||
38 | lst.append( Opie::Ui::OKeyPair::leftArrowKey() ); | ||
39 | lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); | ||
40 | lst.append( Opie::Ui::OKeyPair::returnKey() ); | ||
41 | |||
42 | m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "Imageview-KeyBoard-Config", | ||
43 | lst, false,this, "keyconfig name" ); | ||
44 | m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Image Info"), "view", | ||
45 | Resource::loadPixmap("1to1"), ViewInfo, | ||
46 | Opie::Ui::OKeyPair(Qt::Key_I,Qt::ShiftButton), | ||
47 | this, SLOT(slotShowImageInfo()))); | ||
48 | m_viewManager->load(); | ||
49 | m_viewManager->handleWidget( this ); | ||
50 | } | ||
51 | |||
52 | void ImageView::slotShowImageInfo() | ||
53 | { | ||
54 | emit dispImageInfo(m_lastName); | ||
55 | } | ||
diff --git a/noncore/graphics/opie-eye/gui/imageview.h b/noncore/graphics/opie-eye/gui/imageview.h new file mode 100644 index 0000000..5ee0d7d --- a/dev/null +++ b/noncore/graphics/opie-eye/gui/imageview.h | |||
@@ -0,0 +1,40 @@ | |||
1 | #ifndef _IMAGE_VIEW_H | ||
2 | #define _IMAGE_VIEW_H | ||
3 | |||
4 | /* must be changed when it will moved to Opie::MM */ | ||
5 | #include "imagescrollview.h" | ||
6 | |||
7 | namespace Opie { | ||
8 | namespace Core { | ||
9 | class OConfig; | ||
10 | } | ||
11 | namespace Ui { | ||
12 | class OKeyConfigManager; | ||
13 | } | ||
14 | } | ||
15 | |||
16 | class ImageView:public ImageScrollView | ||
17 | { | ||
18 | Q_OBJECT | ||
19 | |||
20 | enum ActionIds { | ||
21 | ViewInfo | ||
22 | }; | ||
23 | |||
24 | public: | ||
25 | ImageView( QWidget* parent, const char* name = 0, WFlags fl = 0 ); | ||
26 | virtual ~ImageView(); | ||
27 | Opie::Ui::OKeyConfigManager* manager(); | ||
28 | |||
29 | signals: | ||
30 | void dispImageInfo(const QString&); | ||
31 | void sig_return(); | ||
32 | |||
33 | protected: | ||
34 | Opie::Core::OConfig * m_cfg; | ||
35 | Opie::Ui::OKeyConfigManager*m_viewManager; | ||
36 | void initKeys(); | ||
37 | protected slots: | ||
38 | virtual void slotShowImageInfo(); | ||
39 | }; | ||
40 | #endif | ||
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 5e94f93..529bee4 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -4,13 +4,13 @@ | |||
4 | */ | 4 | */ |
5 | #include "mainwindow.h" | 5 | #include "mainwindow.h" |
6 | 6 | ||
7 | #include "iconview.h" | 7 | #include "iconview.h" |
8 | #include "filesystem.h" | 8 | #include "filesystem.h" |
9 | #include "imageinfoui.h" | 9 | #include "imageinfoui.h" |
10 | #include "imagescrollview.h" | 10 | #include "imageview.h" |
11 | 11 | ||
12 | #include <iface/ifaceinfo.h> | 12 | #include <iface/ifaceinfo.h> |
13 | #include <iface/dirview.h> | 13 | #include <iface/dirview.h> |
14 | 14 | ||
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <opie2/owidgetstack.h> | 16 | #include <opie2/owidgetstack.h> |
@@ -159,16 +159,23 @@ void PMainWindow::slotConfig() { | |||
159 | /* | 159 | /* |
160 | * Add the KeyConfigWidget | 160 | * Add the KeyConfigWidget |
161 | */ | 161 | */ |
162 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); | 162 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); |
163 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); | 163 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); |
164 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); | 164 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); |
165 | |||
165 | if ( !m_info ) { | 166 | if ( !m_info ) { |
166 | initInfo(); | 167 | initInfo(); |
167 | } | 168 | } |
168 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); | 169 | keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() ); |
170 | |||
171 | if ( !m_disp ) { | ||
172 | initDisp(); | ||
173 | } | ||
174 | keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() ); | ||
175 | |||
169 | keyWid->load(); | 176 | keyWid->load(); |
170 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); | 177 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); |
171 | 178 | ||
172 | 179 | ||
173 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); | 180 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); |
174 | 181 | ||
@@ -212,18 +219,18 @@ void PMainWindow::initT( const char* name, T** ptr, int id) { | |||
212 | } | 219 | } |
213 | void PMainWindow::initInfo() { | 220 | void PMainWindow::initInfo() { |
214 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); | 221 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); |
215 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); | 222 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); |
216 | } | 223 | } |
217 | void PMainWindow::initDisp() { | 224 | void PMainWindow::initDisp() { |
218 | initT<ImageScrollView>( "Image ScrollView", &m_disp, ImageDisplay ); | 225 | initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); |
219 | if (m_disp) { | 226 | if (m_disp) { |
220 | m_disp->setAutoScale(autoScale); | 227 | m_disp->setAutoScale(autoScale); |
221 | m_disp->setAutoRotate(autoRotate); | 228 | m_disp->setAutoRotate(autoRotate); |
229 | connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); | ||
222 | } | 230 | } |
223 | |||
224 | } | 231 | } |
225 | 232 | ||
226 | /** | 233 | /** |
227 | * With big Screen the plan could be to 'detach' the image | 234 | * With big Screen the plan could be to 'detach' the image |
228 | * window if visible and to create a ne wone | 235 | * window if visible and to create a ne wone |
229 | * init* already supports it but I make no use of it for | 236 | * init* already supports it but I make no use of it for |
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h index 6debf7f..5de2f42 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.h +++ b/noncore/graphics/opie-eye/gui/mainwindow.h | |||
@@ -18,13 +18,13 @@ namespace Ui{ | |||
18 | class OWidgetStack; | 18 | class OWidgetStack; |
19 | } | 19 | } |
20 | } | 20 | } |
21 | 21 | ||
22 | class PIconView; | 22 | class PIconView; |
23 | class imageinfo; | 23 | class imageinfo; |
24 | class ImageScrollView; | 24 | class ImageView; |
25 | class PMainWindow : public QMainWindow { | 25 | class PMainWindow : public QMainWindow { |
26 | Q_OBJECT | 26 | Q_OBJECT |
27 | enum Views { IconView, ImageInfo, ImageDisplay }; | 27 | enum Views { IconView, ImageInfo, ImageDisplay }; |
28 | public: | 28 | public: |
29 | static QString appName() { return QString::fromLatin1("opie-eye" ); } | 29 | static QString appName() { return QString::fromLatin1("opie-eye" ); } |
30 | PMainWindow(QWidget*, const char*, WFlags ); | 30 | PMainWindow(QWidget*, const char*, WFlags ); |
@@ -51,13 +51,13 @@ private: | |||
51 | 51 | ||
52 | private: | 52 | private: |
53 | Opie::Core::OConfig *m_cfg; | 53 | Opie::Core::OConfig *m_cfg; |
54 | Opie::Ui::OWidgetStack *m_stack; | 54 | Opie::Ui::OWidgetStack *m_stack; |
55 | PIconView* m_view; | 55 | PIconView* m_view; |
56 | imageinfo *m_info; | 56 | imageinfo *m_info; |
57 | ImageScrollView *m_disp; | 57 | ImageView *m_disp; |
58 | bool autoRotate; | 58 | bool autoRotate; |
59 | bool autoScale; | 59 | bool autoScale; |
60 | QToolButton*rotateButton; | 60 | QToolButton*rotateButton; |
61 | 61 | ||
62 | 62 | ||
63 | private slots: | 63 | private slots: |
diff --git a/noncore/graphics/opie-eye/phunk_view.pro b/noncore/graphics/opie-eye/phunk_view.pro index 21fd59c..a825580 100644 --- a/noncore/graphics/opie-eye/phunk_view.pro +++ b/noncore/graphics/opie-eye/phunk_view.pro | |||
@@ -7,23 +7,25 @@ TARGET = opie-eye | |||
7 | HEADERS = gui/iconview.h gui/filesystem.h gui/mainwindow.h \ | 7 | HEADERS = gui/iconview.h gui/filesystem.h gui/mainwindow.h \ |
8 | lib/imagecache.h impl/dir/dir_dirview.h \ | 8 | lib/imagecache.h impl/dir/dir_dirview.h \ |
9 | iface/dirview.h iface/dirlister.h iface/ifaceinfo.h \ | 9 | iface/dirview.h iface/dirlister.h iface/ifaceinfo.h \ |
10 | impl/dir/dir_lister.h impl/dir/dir_ifaceinfo.h \ | 10 | impl/dir/dir_lister.h impl/dir/dir_ifaceinfo.h \ |
11 | lib/slavemaster.h \ | 11 | lib/slavemaster.h \ |
12 | iface/slaveiface.h \ | 12 | iface/slaveiface.h \ |
13 | gui/imageinfoui.h gui/imagescrollview.h | 13 | gui/imageinfoui.h gui/imagescrollview.h \ |
14 | gui/imageview.h | ||
14 | 15 | ||
15 | # A list header files | 16 | # A list header files |
16 | 17 | ||
17 | 18 | ||
18 | SOURCES = gui/iconview.cpp gui/filesystem.cpp gui/mainwindow.cpp \ | 19 | SOURCES = gui/iconview.cpp gui/filesystem.cpp gui/mainwindow.cpp \ |
19 | lib/imagecache.cpp lib/viewmap.cpp \ | 20 | lib/imagecache.cpp lib/viewmap.cpp \ |
20 | impl/dir/dir_dirview.cpp iface/dirlister.cpp \ | 21 | impl/dir/dir_dirview.cpp iface/dirlister.cpp \ |
21 | iface/dirview.cpp impl/dir/dir_lister.cpp \ | 22 | iface/dirview.cpp impl/dir/dir_lister.cpp \ |
22 | impl/dir/dir_ifaceinfo.cpp lib/slavemaster.cpp \ | 23 | impl/dir/dir_ifaceinfo.cpp lib/slavemaster.cpp \ |
23 | gui/imageinfoui.cpp gui/imagescrollview.cpp | 24 | gui/imageinfoui.cpp gui/imagescrollview.cpp \ |
25 | gui/imageview.cpp | ||
24 | # A list of source files | 26 | # A list of source files |
25 | 27 | ||
26 | INTERFACES = | 28 | INTERFACES = |
27 | # list of ui files | 29 | # list of ui files |
28 | 30 | ||
29 | INCLUDEPATH += . $(OPIEDIR)/include | 31 | INCLUDEPATH += . $(OPIEDIR)/include |