summaryrefslogtreecommitdiff
authoralwin <alwin>2004-04-07 11:10:21 (UTC)
committer alwin <alwin>2004-04-07 11:10:21 (UTC)
commit6095b1f70bcac407208e7473598f2bbf53339810 (patch) (unidiff)
treee76d8ad85b79de56a7aa7dd95c824da485901c6f
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 (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
@@ -17,7 +17,6 @@
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
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
@@ -7,7 +7,7 @@
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>
@@ -162,10 +162,17 @@ void PMainWindow::slotConfig() {
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
@@ -215,12 +222,12 @@ void PMainWindow::initInfo() {
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}
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) {
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/**
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
@@ -21,7 +21,7 @@ namespace Ui{
21 21
22class PIconView; 22class PIconView;
23class imageinfo; 23class imageinfo;
24class ImageScrollView; 24class ImageView;
25class PMainWindow : public QMainWindow { 25class PMainWindow : public QMainWindow {
26 Q_OBJECT 26 Q_OBJECT
27 enum Views { IconView, ImageInfo, ImageDisplay }; 27 enum Views { IconView, ImageInfo, ImageDisplay };
@@ -54,7 +54,7 @@ private:
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;
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
@@ -10,7 +10,8 @@ HEADERS = gui/iconview.h gui/filesystem.h gui/mainwindow.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
@@ -20,7 +21,8 @@ SOURCES = gui/iconview.cpp gui/filesystem.cpp gui/mainwindow.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
26INTERFACES = 28INTERFACES =