author | alwin <alwin> | 2004-04-07 12:46:26 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-04-07 12:46:26 (UTC) |
commit | 9e1ecade17a77c3d50aecc4c92091d852e99e8d9 (patch) (side-by-side diff) | |
tree | bef7f25d64890aab64f5dc0e0fcb40c64497464a | |
parent | d581038dd7875aa65a750f099333a94f43c37ef2 (diff) | |
download | opie-9e1ecade17a77c3d50aecc4c92091d852e99e8d9.zip opie-9e1ecade17a77c3d50aecc4c92091d852e99e8d9.tar.gz opie-9e1ecade17a77c3d50aecc4c92091d852e99e8d9.tar.bz2 |
keys will now be written to config file
all view use the same config object otherwise there will be problems writing
a new config
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageinfoui.cpp | 17 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageinfoui.h | 2 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 18 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.h | 2 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 6 |
5 files changed, 29 insertions, 16 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.cpp b/noncore/graphics/opie-eye/gui/imageinfoui.cpp index 822fd88..0b3250c 100644 --- a/noncore/graphics/opie-eye/gui/imageinfoui.cpp +++ b/noncore/graphics/opie-eye/gui/imageinfoui.cpp @@ -27,10 +27,11 @@ static const int THUMBSIZE = 128; using namespace Opie::Core; -imageinfo::imageinfo(QWidget* parent, const char* name, WFlags fl ) +imageinfo::imageinfo(Opie::Core::OConfig *cfg,QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { m_viewManager = 0; + m_cfg = cfg; init(name); initKeys(); } @@ -39,6 +40,7 @@ imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WF : QWidget( parent, name, fl ),currentFile(_path) { m_viewManager = 0; + m_cfg = 0; init(name); initKeys(); slotChangeName(_path); @@ -55,8 +57,12 @@ Opie::Ui::OKeyConfigManager* imageinfo::manager() void imageinfo::initKeys() { odebug << "init imageinfo keys" << oendl; +#if 0 + if (!m_cfg) { m_cfg = new Opie::Core::OConfig("phunkview"); - m_cfg->setGroup("Zecke_view" ); + m_cfg->setGroup("imageinfo_keys" ); + } +#endif Opie::Ui::OKeyPair::List lst; lst.append( Opie::Ui::OKeyPair::upArrowKey() ); lst.append( Opie::Ui::OKeyPair::downArrowKey() ); @@ -64,9 +70,9 @@ void imageinfo::initKeys() lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); lst.append( Opie::Ui::OKeyPair::returnKey() ); - m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "Imageinfo-KeyBoard-Config", + m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "imageinfo_keys", lst, false,this, "keyconfig name" ); - m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Full Image"), "view", + m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Full Image"), "infoview", Resource::loadPixmap("1to1"), ViewItem, Opie::Ui::OKeyPair(Qt::Key_V, Qt::ShiftButton), this, SLOT(slotShowImage()))); @@ -143,7 +149,6 @@ imageinfo::~imageinfo() QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); } if (m_viewManager) { - m_viewManager->save(); delete m_viewManager; } } @@ -154,8 +159,6 @@ void imageinfo::slot_fullInfo(const QString&_path, const QString&_t) qDebug(_t); QString t = _t; t.replace(QRegExp("\n"),"<br>"); -/* t.replace(QRegeExp("<qt>",""); - t.replace(QRegeExp("</qt>","");*/ TextView1->setText(t); } } diff --git a/noncore/graphics/opie-eye/gui/imageinfoui.h b/noncore/graphics/opie-eye/gui/imageinfoui.h index 0ffa423..c9b83a1 100644 --- a/noncore/graphics/opie-eye/gui/imageinfoui.h +++ b/noncore/graphics/opie-eye/gui/imageinfoui.h @@ -29,7 +29,7 @@ class imageinfo : public QWidget }; public: - imageinfo( QWidget* parent = 0, const char* name = 0, WFlags fl =0); + imageinfo(Opie::Core::OConfig *cfg, QWidget* parent = 0, const char* name = 0, WFlags fl =0); imageinfo(const QString&_path, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); virtual ~imageinfo(); diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index 8fc258e..e43bbff 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp @@ -8,15 +8,19 @@ using namespace Opie::Core; -ImageView::ImageView( QWidget* parent, const char* name, WFlags fl ) +ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl ) : ImageScrollView(parent,name,fl) { m_viewManager = 0; + m_cfg = cfg; initKeys(); } ImageView::~ImageView() { + if (m_viewManager) { + delete m_viewManager; + } } Opie::Ui::OKeyConfigManager* ImageView::manager() @@ -30,8 +34,10 @@ Opie::Ui::OKeyConfigManager* ImageView::manager() void ImageView::initKeys() { odebug << "init imageview keys" << oendl; + if (!m_cfg) { m_cfg = new Opie::Core::OConfig("phunkview"); - m_cfg->setGroup("Zecke_view" ); + m_cfg->setGroup("image_view_keys" ); + } Opie::Ui::OKeyPair::List lst; lst.append( Opie::Ui::OKeyPair::upArrowKey() ); lst.append( Opie::Ui::OKeyPair::downArrowKey() ); @@ -39,14 +45,14 @@ void ImageView::initKeys() 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", + m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "image_view_keys", + lst, false,this, "image_view_keys" ); + m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", Resource::loadPixmap("1to1"), ViewInfo, Opie::Ui::OKeyPair(Qt::Key_I,Qt::ShiftButton), this, SLOT(slotShowImageInfo()))); - m_viewManager->load(); m_viewManager->handleWidget( this ); + m_viewManager->load(); } void ImageView::slotShowImageInfo() diff --git a/noncore/graphics/opie-eye/gui/imageview.h b/noncore/graphics/opie-eye/gui/imageview.h index 5ee0d7d..f61c93f 100644 --- a/noncore/graphics/opie-eye/gui/imageview.h +++ b/noncore/graphics/opie-eye/gui/imageview.h @@ -22,7 +22,7 @@ class ImageView:public ImageScrollView }; public: - ImageView( QWidget* parent, const char* name = 0, WFlags fl = 0 ); + ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name = 0, WFlags fl = 0 ); virtual ~ImageView(); Opie::Ui::OKeyConfigManager* manager(); diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 529bee4..21a668a 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp @@ -195,7 +195,11 @@ void PMainWindow::slotConfig() { if ( act ) { m_view->resetView(); keyWid->save(); + m_disp->manager()->save(); + m_info->manager()->save(); + m_view->manager()->save(); } + delete keyWid; } /* @@ -210,7 +214,7 @@ void PMainWindow::initT( const char* name, T** ptr, int id) { (*ptr)->setDestructiveClose(); m_stack->removeWidget( *ptr ); } - *ptr = new T( m_stack, name ); + *ptr = new T(m_cfg, m_stack, name ); m_stack->addWidget( *ptr, id ); connect(*ptr, SIGNAL(sig_return()), |