summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye
authoralwin <alwin>2004-04-07 11:10:21 (UTC)
committer alwin <alwin>2004-04-07 11:10:21 (UTC)
commit6095b1f70bcac407208e7473598f2bbf53339810 (patch) (unidiff)
treee76d8ad85b79de56a7aa7dd95c824da485901c6f /noncore/graphics/opie-eye
parent364971c08f3d761102daab01889b9fab394f8f08 (diff)
downloadopie-6095b1f70bcac407208e7473598f2bbf53339810.zip
opie-6095b1f70bcac407208e7473598f2bbf53339810.tar.gz
opie-6095b1f70bcac407208e7473598f2bbf53339810.tar.bz2
the ImageScrollView wrapped with another class where just the
opie-eye specifics are implemented. So we can move that into the MM lib and use it in other programs.
Diffstat (limited to 'noncore/graphics/opie-eye') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imageinfoui.cpp1
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp55
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.h40
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp13
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.h4
-rw-r--r--noncore/graphics/opie-eye/phunk_view.pro6
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
@@ -19,3 +19,2 @@
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>
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
9using namespace Opie::Core;
10
11ImageView::ImageView( QWidget* parent, const char* name, WFlags fl )
12 : ImageScrollView(parent,name,fl)
13{
14 m_viewManager = 0;
15 initKeys();
16}
17
18ImageView::~ImageView()
19{
20}
21
22Opie::Ui::OKeyConfigManager* ImageView::manager()
23{
24 if (!m_viewManager) {
25 initKeys();
26 }
27 return m_viewManager;
28}
29
30void 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
52void 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
7namespace Opie {
8 namespace Core {
9 class OConfig;
10 }
11 namespace Ui {
12 class OKeyConfigManager;
13 }
14}
15
16class ImageView:public ImageScrollView
17{
18 Q_OBJECT
19
20 enum ActionIds {
21 ViewInfo
22 };
23
24public:
25 ImageView( QWidget* parent, const char* name = 0, WFlags fl = 0 );
26 virtual ~ImageView();
27 Opie::Ui::OKeyConfigManager* manager();
28
29signals:
30 void dispImageInfo(const QString&);
31 void sig_return();
32
33protected:
34 Opie::Core::OConfig * m_cfg;
35 Opie::Ui::OKeyConfigManager*m_viewManager;
36 void initKeys();
37protected 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
@@ -9,3 +9,3 @@
9#include "imageinfoui.h" 9#include "imageinfoui.h"
10#include "imagescrollview.h" 10#include "imageview.h"
11 11
@@ -164,2 +164,3 @@ void PMainWindow::slotConfig() {
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 ) {
@@ -168,2 +169,8 @@ void PMainWindow::slotConfig() {
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();
@@ -217,3 +224,3 @@ void PMainWindow::initInfo() {
217void PMainWindow::initDisp() { 224void 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) {
@@ -221,4 +228,4 @@ void PMainWindow::initDisp() {
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}
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
@@ -23,3 +23,3 @@ class PIconView;
23class imageinfo; 23class imageinfo;
24class ImageScrollView; 24class ImageView;
25class PMainWindow : public QMainWindow { 25class PMainWindow : public QMainWindow {
@@ -56,3 +56,3 @@ private:
56 imageinfo *m_info; 56 imageinfo *m_info;
57 ImageScrollView *m_disp; 57 ImageView *m_disp;
58 bool autoRotate; 58 bool autoRotate;
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
@@ -12,3 +12,4 @@ HEADERS = gui/iconview.h gui/filesystem.h gui/mainwindow.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
@@ -22,3 +23,4 @@ SOURCES = gui/iconview.cpp gui/filesystem.cpp gui/mainwindow.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