summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show 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
@@ -16,9 +16,8 @@
#include "lib/slavemaster.h"
#include "lib/imagecache.h"
#include <opie2/oconfig.h>
-#include <opie2/oconfig.h>
#include <opie2/okeyconfigwidget.h>
#include <opie2/odebug.h>
#include <qpe/qcopenvelope_qws.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 @@
+#include "imageview.h"
+
+#include <opie2/odebug.h>
+#include <opie2/oconfig.h>
+#include <opie2/okeyconfigwidget.h>
+
+#include <qpe/resource.h>
+
+using namespace Opie::Core;
+
+ImageView::ImageView( QWidget* parent, const char* name, WFlags fl )
+ : ImageScrollView(parent,name,fl)
+{
+ m_viewManager = 0;
+ initKeys();
+}
+
+ImageView::~ImageView()
+{
+}
+
+Opie::Ui::OKeyConfigManager* ImageView::manager()
+{
+ if (!m_viewManager) {
+ initKeys();
+ }
+ return m_viewManager;
+}
+
+void ImageView::initKeys()
+{
+ odebug << "init imageview keys" << oendl;
+ m_cfg = new Opie::Core::OConfig("phunkview");
+ m_cfg->setGroup("Zecke_view" );
+ Opie::Ui::OKeyPair::List lst;
+ lst.append( Opie::Ui::OKeyPair::upArrowKey() );
+ lst.append( Opie::Ui::OKeyPair::downArrowKey() );
+ lst.append( Opie::Ui::OKeyPair::leftArrowKey() );
+ lst.append( Opie::Ui::OKeyPair::rightArrowKey() );
+ lst.append( Opie::Ui::OKeyPair::returnKey() );
+
+ m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "Imageview-KeyBoard-Config",
+ lst, false,this, "keyconfig name" );
+ m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Image Info"), "view",
+ Resource::loadPixmap("1to1"), ViewInfo,
+ Opie::Ui::OKeyPair(Qt::Key_I,Qt::ShiftButton),
+ this, SLOT(slotShowImageInfo())));
+ m_viewManager->load();
+ m_viewManager->handleWidget( this );
+}
+
+void ImageView::slotShowImageInfo()
+{
+ emit dispImageInfo(m_lastName);
+}
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 @@
+#ifndef _IMAGE_VIEW_H
+#define _IMAGE_VIEW_H
+
+/* must be changed when it will moved to Opie::MM */
+#include "imagescrollview.h"
+
+namespace Opie {
+ namespace Core {
+ class OConfig;
+ }
+ namespace Ui {
+ class OKeyConfigManager;
+ }
+}
+
+class ImageView:public ImageScrollView
+{
+ Q_OBJECT
+
+ enum ActionIds {
+ ViewInfo
+ };
+
+public:
+ ImageView( QWidget* parent, const char* name = 0, WFlags fl = 0 );
+ virtual ~ImageView();
+ Opie::Ui::OKeyConfigManager* manager();
+
+signals:
+ void dispImageInfo(const QString&);
+ void sig_return();
+
+protected:
+ Opie::Core::OConfig * m_cfg;
+ Opie::Ui::OKeyConfigManager*m_viewManager;
+ void initKeys();
+protected slots:
+ virtual void slotShowImageInfo();
+};
+#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
@@ -6,9 +6,9 @@
#include "iconview.h"
#include "filesystem.h"
#include "imageinfoui.h"
-#include "imagescrollview.h"
+#include "imageview.h"
#include <iface/ifaceinfo.h>
#include <iface/dirview.h>
@@ -161,12 +161,19 @@ void PMainWindow::slotConfig() {
*/
Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" );
keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue );
keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() );
+
if ( !m_info ) {
initInfo();
}
keyWid->insert( tr("Imageinfo Keyboard Actions"), m_info->manager() );
+
+ if ( !m_disp ) {
+ initDisp();
+ }
+ keyWid->insert( tr("Imageview Keyboard Actions"), m_disp->manager() );
+
keyWid->load();
wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") );
@@ -214,14 +221,14 @@ void PMainWindow::initInfo() {
initT<imageinfo>( "Image Info", &m_info, ImageInfo );
connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&)));
}
void PMainWindow::initDisp() {
- initT<ImageScrollView>( "Image ScrollView", &m_disp, ImageDisplay );
+ initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay );
if (m_disp) {
m_disp->setAutoScale(autoScale);
m_disp->setAutoRotate(autoRotate);
+ connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&)));
}
-
}
/**
* With big Screen the plan could be to 'detach' the image
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
@@ -20,9 +20,9 @@ namespace Ui{
}
class PIconView;
class imageinfo;
-class ImageScrollView;
+class ImageView;
class PMainWindow : public QMainWindow {
Q_OBJECT
enum Views { IconView, ImageInfo, ImageDisplay };
public:
@@ -53,9 +53,9 @@ private:
Opie::Core::OConfig *m_cfg;
Opie::Ui::OWidgetStack *m_stack;
PIconView* m_view;
imageinfo *m_info;
- ImageScrollView *m_disp;
+ ImageView *m_disp;
bool autoRotate;
bool autoScale;
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
@@ -9,9 +9,10 @@ HEADERS = gui/iconview.h gui/filesystem.h gui/mainwindow.h \
iface/dirview.h iface/dirlister.h iface/ifaceinfo.h \
impl/dir/dir_lister.h impl/dir/dir_ifaceinfo.h \
lib/slavemaster.h \
iface/slaveiface.h \
- gui/imageinfoui.h gui/imagescrollview.h
+ gui/imageinfoui.h gui/imagescrollview.h \
+ gui/imageview.h
# A list header files
@@ -19,9 +20,10 @@ SOURCES = gui/iconview.cpp gui/filesystem.cpp gui/mainwindow.cpp \
lib/imagecache.cpp lib/viewmap.cpp \
impl/dir/dir_dirview.cpp iface/dirlister.cpp \
iface/dirview.cpp impl/dir/dir_lister.cpp \
impl/dir/dir_ifaceinfo.cpp lib/slavemaster.cpp \
- gui/imageinfoui.cpp gui/imagescrollview.cpp
+ gui/imageinfoui.cpp gui/imagescrollview.cpp \
+ gui/imageview.cpp
# A list of source files
INTERFACES =
# list of ui files