summaryrefslogtreecommitdiff
authorzecke <zecke>2004-04-02 13:34:44 (UTC)
committer zecke <zecke>2004-04-02 13:34:44 (UTC)
commit96105800596dfbd6b828ef47dd7774769f1e3ef3 (patch) (side-by-side diff)
treee8862c0d4f8cc6fb3a90da0856857cd21010ba8b
parent02696a8b22d86f74a4f123edcd24bfa32dd00441 (diff)
downloadopie-96105800596dfbd6b828ef47dd7774769f1e3ef3.zip
opie-96105800596dfbd6b828ef47dd7774769f1e3ef3.tar.gz
opie-96105800596dfbd6b828ef47dd7774769f1e3ef3.tar.bz2
-Use OConfig
-Use OKeyConfigManager/Widget for Keyboard short cuts
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp63
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.h26
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp64
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.h13
4 files changed, 139 insertions, 27 deletions
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index 74a8d0f..b3f0006 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -12,3 +12,5 @@
-#include <qpe/config.h>
+#include <opie2/oconfig.h>
+#include <opie2/okeyconfigwidget.h>
+
#include <qpe/resource.h>
@@ -18,2 +20,3 @@
+
#include <qiconview.h>
@@ -29,2 +32,3 @@
+using Opie::Ui::OKeyConfigItem;
@@ -98,3 +102,3 @@ namespace {
-PIconView::PIconView( QWidget* wid, Config* cfg )
+PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
: QVBox( wid ), m_cfg( cfg )
@@ -126,2 +130,6 @@ PIconView::PIconView( QWidget* wid, Config* cfg )
m_view->setGridY( fontMetrics().height()*2+40 );
+
+
+ initKeys();
+
loadViews();
@@ -134,2 +142,38 @@ PIconView::~PIconView() {
}
+ m_viewManager->save();
+ delete m_viewManager;
+}
+
+Opie::Ui::OKeyConfigManager* PIconView::manager() {
+ return m_viewManager;
+}
+
+void PIconView::initKeys() {
+ 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, "View-KeyBoard-Config",
+ lst, false,this, "keyconfig name" );
+ m_viewManager->addKeyConfig( OKeyConfigItem(tr("Beam Current Item") , "beam",
+ QString::fromLatin1("beam"), BeamItem,
+ Opie::Ui::OKeyPair(Qt::Key_B, Qt::ShiftButton),
+ this, SLOT(slotBeam())) );
+ m_viewManager->addKeyConfig( OKeyConfigItem(tr("Delete Current Item"), "delete",
+ QString::fromLatin1("trash"), DeleteItem,
+ Opie::Ui::OKeyPair(Qt::Key_D, Qt::ShiftButton),
+ this, SLOT(slotTrash())) );
+ m_viewManager->addKeyConfig( OKeyConfigItem(tr("View Current Item"), "view",
+ QString::fromLatin1("1to1"), ViewItem,
+ Opie::Ui::OKeyPair(Qt::Key_V, Qt::ShiftButton),
+ this, SLOT(slotShowImage())));
+ m_viewManager->addKeyConfig( OKeyConfigItem(tr("Show Image Info") , "info",
+ QString::fromLatin1("DocumentTypeWord"), InfoItem,
+ Opie::Ui::OKeyPair(Qt::Key_I, Qt::ShiftButton ),
+ this, SLOT(slotImageInfo()) ) );
+ m_viewManager->load();
+ m_viewManager->handleWidget( m_view );
}
@@ -154,2 +198,3 @@ void PIconView::slotChangeDir(const QString& path) {
+ m_view->setUpdatesEnabled( false );
m_view->clear();
@@ -157,2 +202,3 @@ void PIconView::slotChangeDir(const QString& path) {
addFiles( lister->files() );
+ m_view->setUpdatesEnabled( true );
@@ -319 +365,14 @@ void PIconView::slotEnd() {
}
+
+void PIconView::slotShowImage() {
+
+}
+void PIconView::slotShowImage( const QString& ) {
+
+}
+void PIconView::slotImageInfo() {
+
+}
+void PIconView::slotImageInfo( const QString& ) {
+
+}
diff --git a/noncore/graphics/opie-eye/gui/iconview.h b/noncore/graphics/opie-eye/gui/iconview.h
index 439833a..0fba327 100644
--- a/noncore/graphics/opie-eye/gui/iconview.h
+++ b/noncore/graphics/opie-eye/gui/iconview.h
@@ -10,3 +10,2 @@
-#include <qpe/config.h>
@@ -18,2 +17,12 @@ class PDirLister;
class Ir;
+
+namespace Opie {
+namespace Core{
+ class OConfig;
+}
+namespace Ui {
+ class OKeyConfigManager;
+}
+}
+
class PIconView : public QVBox {
@@ -21,8 +30,13 @@ class PIconView : public QVBox {
friend class PIconViewItem;
+ enum ActionIds {
+ BeamItem, DeleteItem, ViewItem, InfoItem
+ };
public:
- PIconView( QWidget* wid, Config *cfg );
+ PIconView( QWidget* wid, Opie::Core::OConfig *cfg );
~PIconView();
void resetView();
+ Opie::Ui::OKeyConfigManager* manager();
private:
+ void initKeys();
QString currentFileName(bool &isDir)const;
@@ -40,2 +54,7 @@ private slots:
+ void slotShowImage();
+ void slotShowImage( const QString& );
+ void slotImageInfo();
+ void slotImageInfo( const QString& );
+
void slotStart();
@@ -52,3 +71,4 @@ private slots:
private:
- Config *m_cfg;
+ Opie::Ui::OKeyConfigManager *m_viewManager;
+ Opie::Core::OConfig *m_cfg;
QComboBox* m_views;
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index ea765d1..0314659 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -4,2 +4,18 @@
*/
+#include "mainwindow.h"
+
+#include "iconview.h"
+#include "filesystem.h"
+
+#include <iface/ifaceinfo.h>
+#include <iface/dirview.h>
+
+#include <opie2/oapplicationfactory.h>
+#include <opie2/otabwidget.h>
+#include <opie2/okeyconfigwidget.h>
+
+
+#include <qpe/resource.h>
+#include <qpe/config.h>
+#include <qpe/ir.h>
@@ -11,16 +27,5 @@
-#include <qpe/resource.h>
-#include <qpe/config.h>
-#include <qpe/ir.h>
-#include <opie2/oapplicationfactory.h>
-#include <opie2/otabwidget.h>
-#include <iface/ifaceinfo.h>
-#include <iface/dirview.h>
-#include "iconview.h"
-#include "filesystem.h"
-
-#include "mainwindow.h"
@@ -29,6 +34,9 @@ OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow> )
PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
- : QMainWindow( wid, name, style ), m_cfg("phunkview")
+ : QMainWindow( wid, name, style )
{
setCaption( QObject::tr("Opie Eye Caramba" ) );
- m_cfg.setGroup("Zecke_view" );
+ m_cfg = new Opie::Core::OConfig("phunkview");
+ m_cfg->setGroup("Zecke_view" );
+
+
/*
@@ -41,3 +49,3 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
- m_view = new PIconView( this, &m_cfg );
+ m_view = new PIconView( this, m_cfg );
setCentralWidget( m_view );
@@ -82,2 +90,7 @@ PMainWindow::~PMainWindow() {
void PMainWindow::slotConfig() {
+/*
+ * have a tab with the possible views
+ * a tab for globals image cache size.. scaled loading
+ * and one tab for the KeyConfigs
+ */
QDialog dlg(this, 0, true);
@@ -93,5 +106,5 @@ void PMainWindow::slotConfig() {
for( ; _it != vM->end(); ++_it ) {
- PDirView *view = (_it.data())(m_cfg);
+ PDirView *view = (_it.data())(*m_cfg);
PInterfaceInfo *inf = view->interfaceInfo();
- QWidget *_wid = inf->configWidget( m_cfg );
+ QWidget *_wid = inf->configWidget( *m_cfg );
_wid->reparent(wid, QPoint() );
@@ -101,4 +114,13 @@ void PMainWindow::slotConfig() {
- dlg.showMaximized();
- bool act = ( dlg.exec() == QDialog::Accepted );
+/*
+ * Add the KeyConfigWidget
+ */
+ 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() );
+ keyWid->load();
+ wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") );
+
+
+ bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted );
@@ -107,3 +129,3 @@ void PMainWindow::slotConfig() {
if ( act )
- it.key()->interfaceInfo()->writeConfig(it.data(), m_cfg);
+ it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg);
delete it.key();
@@ -111,4 +133,6 @@ void PMainWindow::slotConfig() {
- if ( act )
+ if ( act ) {
m_view->resetView();
+ keyWid->save();
+ }
}
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h
index 408fe32..317a51e 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.h
+++ b/noncore/graphics/opie-eye/gui/mainwindow.h
@@ -8,5 +8,13 @@
+#include <opie2/oconfig.h>
+
#include <qmainwindow.h>
-#include <qpe/config.h>
+
+
+namespace Opie {
+namespace Ui{
+ class OKeyConfigManager;
+}
+}
@@ -21,5 +29,6 @@ public:
private:
- Config m_cfg;
+ Opie::Core::OConfig *m_cfg;
PIconView* m_view;
+
private slots: