summaryrefslogtreecommitdiff
authoralwin <alwin>2004-04-07 12:46:26 (UTC)
committer alwin <alwin>2004-04-07 12:46:26 (UTC)
commit9e1ecade17a77c3d50aecc4c92091d852e99e8d9 (patch) (unidiff)
treebef7f25d64890aab64f5dc0e0fcb40c64497464a
parentd581038dd7875aa65a750f099333a94f43c37ef2 (diff)
downloadopie-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
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/imageinfoui.cpp19
-rw-r--r--noncore/graphics/opie-eye/gui/imageinfoui.h2
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp20
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.h2
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp6
5 files changed, 31 insertions, 18 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;
27 27
28using namespace Opie::Core; 28using namespace Opie::Core;
29 29
30imageinfo::imageinfo(QWidget* parent, const char* name, WFlags fl ) 30imageinfo::imageinfo(Opie::Core::OConfig *cfg,QWidget* parent, const char* name, WFlags fl )
31 : QWidget( parent, name, fl ) 31 : QWidget( parent, name, fl )
32{ 32{
33 m_viewManager = 0; 33 m_viewManager = 0;
34 m_cfg = cfg;
34 init(name); 35 init(name);
35 initKeys(); 36 initKeys();
36} 37}
@@ -39,6 +40,7 @@ imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WF
39 : QWidget( parent, name, fl ),currentFile(_path) 40 : QWidget( parent, name, fl ),currentFile(_path)
40{ 41{
41 m_viewManager = 0; 42 m_viewManager = 0;
43 m_cfg = 0;
42 init(name); 44 init(name);
43 initKeys(); 45 initKeys();
44 slotChangeName(_path); 46 slotChangeName(_path);
@@ -55,8 +57,12 @@ Opie::Ui::OKeyConfigManager* imageinfo::manager()
55void imageinfo::initKeys() 57void imageinfo::initKeys()
56{ 58{
57 odebug << "init imageinfo keys" << oendl; 59 odebug << "init imageinfo keys" << oendl;
58 m_cfg = new Opie::Core::OConfig("phunkview"); 60#if 0
59 m_cfg->setGroup("Zecke_view" ); 61 if (!m_cfg) {
62 m_cfg = new Opie::Core::OConfig("phunkview");
63 m_cfg->setGroup("imageinfo_keys" );
64 }
65#endif
60 Opie::Ui::OKeyPair::List lst; 66 Opie::Ui::OKeyPair::List lst;
61 lst.append( Opie::Ui::OKeyPair::upArrowKey() ); 67 lst.append( Opie::Ui::OKeyPair::upArrowKey() );
62 lst.append( Opie::Ui::OKeyPair::downArrowKey() ); 68 lst.append( Opie::Ui::OKeyPair::downArrowKey() );
@@ -64,9 +70,9 @@ void imageinfo::initKeys()
64 lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); 70 lst.append( Opie::Ui::OKeyPair::rightArrowKey() );
65 lst.append( Opie::Ui::OKeyPair::returnKey() ); 71 lst.append( Opie::Ui::OKeyPair::returnKey() );
66 72
67 m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "Imageinfo-KeyBoard-Config", 73 m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "imageinfo_keys",
68 lst, false,this, "keyconfig name" ); 74 lst, false,this, "keyconfig name" );
69 m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Full Image"), "view", 75 m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Full Image"), "infoview",
70 Resource::loadPixmap("1to1"), ViewItem, 76 Resource::loadPixmap("1to1"), ViewItem,
71 Opie::Ui::OKeyPair(Qt::Key_V, Qt::ShiftButton), 77 Opie::Ui::OKeyPair(Qt::Key_V, Qt::ShiftButton),
72 this, SLOT(slotShowImage()))); 78 this, SLOT(slotShowImage())));
@@ -143,7 +149,6 @@ imageinfo::~imageinfo()
143 QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); 149 QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" );
144 } 150 }
145 if (m_viewManager) { 151 if (m_viewManager) {
146 m_viewManager->save();
147 delete m_viewManager; 152 delete m_viewManager;
148 } 153 }
149} 154}
@@ -154,8 +159,6 @@ void imageinfo::slot_fullInfo(const QString&_path, const QString&_t)
154 qDebug(_t); 159 qDebug(_t);
155 QString t = _t; 160 QString t = _t;
156 t.replace(QRegExp("\n"),"<br>"); 161 t.replace(QRegExp("\n"),"<br>");
157/* t.replace(QRegeExp("<qt>","");
158 t.replace(QRegeExp("</qt>","");*/
159 TextView1->setText(t); 162 TextView1->setText(t);
160 } 163 }
161} 164}
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
29 }; 29 };
30 30
31public: 31public:
32 imageinfo( QWidget* parent = 0, const char* name = 0, WFlags fl =0); 32 imageinfo(Opie::Core::OConfig *cfg, QWidget* parent = 0, const char* name = 0, WFlags fl =0);
33 imageinfo(const QString&_path, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 33 imageinfo(const QString&_path, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
34 virtual ~imageinfo(); 34 virtual ~imageinfo();
35 35
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 @@
8 8
9using namespace Opie::Core; 9using namespace Opie::Core;
10 10
11ImageView::ImageView( QWidget* parent, const char* name, WFlags fl ) 11ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl )
12 : ImageScrollView(parent,name,fl) 12 : ImageScrollView(parent,name,fl)
13{ 13{
14 m_viewManager = 0; 14 m_viewManager = 0;
15 m_cfg = cfg;
15 initKeys(); 16 initKeys();
16} 17}
17 18
18ImageView::~ImageView() 19ImageView::~ImageView()
19{ 20{
21 if (m_viewManager) {
22 delete m_viewManager;
23 }
20} 24}
21 25
22Opie::Ui::OKeyConfigManager* ImageView::manager() 26Opie::Ui::OKeyConfigManager* ImageView::manager()
@@ -30,8 +34,10 @@ Opie::Ui::OKeyConfigManager* ImageView::manager()
30void ImageView::initKeys() 34void ImageView::initKeys()
31{ 35{
32 odebug << "init imageview keys" << oendl; 36 odebug << "init imageview keys" << oendl;
33 m_cfg = new Opie::Core::OConfig("phunkview"); 37 if (!m_cfg) {
34 m_cfg->setGroup("Zecke_view" ); 38 m_cfg = new Opie::Core::OConfig("phunkview");
39 m_cfg->setGroup("image_view_keys" );
40 }
35 Opie::Ui::OKeyPair::List lst; 41 Opie::Ui::OKeyPair::List lst;
36 lst.append( Opie::Ui::OKeyPair::upArrowKey() ); 42 lst.append( Opie::Ui::OKeyPair::upArrowKey() );
37 lst.append( Opie::Ui::OKeyPair::downArrowKey() ); 43 lst.append( Opie::Ui::OKeyPair::downArrowKey() );
@@ -39,14 +45,14 @@ void ImageView::initKeys()
39 lst.append( Opie::Ui::OKeyPair::rightArrowKey() ); 45 lst.append( Opie::Ui::OKeyPair::rightArrowKey() );
40 lst.append( Opie::Ui::OKeyPair::returnKey() ); 46 lst.append( Opie::Ui::OKeyPair::returnKey() );
41 47
42 m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "Imageview-KeyBoard-Config", 48 m_viewManager = new Opie::Ui::OKeyConfigManager(m_cfg, "image_view_keys",
43 lst, false,this, "keyconfig name" ); 49 lst, false,this, "image_view_keys" );
44 m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Image Info"), "view", 50 m_viewManager->addKeyConfig( Opie::Ui::OKeyConfigItem(tr("View Image Info"), "imageviewinfo",
45 Resource::loadPixmap("1to1"), ViewInfo, 51 Resource::loadPixmap("1to1"), ViewInfo,
46 Opie::Ui::OKeyPair(Qt::Key_I,Qt::ShiftButton), 52 Opie::Ui::OKeyPair(Qt::Key_I,Qt::ShiftButton),
47 this, SLOT(slotShowImageInfo()))); 53 this, SLOT(slotShowImageInfo())));
48 m_viewManager->load();
49 m_viewManager->handleWidget( this ); 54 m_viewManager->handleWidget( this );
55 m_viewManager->load();
50} 56}
51 57
52void ImageView::slotShowImageInfo() 58void 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
22 }; 22 };
23 23
24public: 24public:
25 ImageView( QWidget* parent, const char* name = 0, WFlags fl = 0 ); 25 ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name = 0, WFlags fl = 0 );
26 virtual ~ImageView(); 26 virtual ~ImageView();
27 Opie::Ui::OKeyConfigManager* manager(); 27 Opie::Ui::OKeyConfigManager* manager();
28 28
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() {
195 if ( act ) { 195 if ( act ) {
196 m_view->resetView(); 196 m_view->resetView();
197 keyWid->save(); 197 keyWid->save();
198 m_disp->manager()->save();
199 m_info->manager()->save();
200 m_view->manager()->save();
198 } 201 }
202 delete keyWid;
199} 203}
200 204
201/* 205/*
@@ -210,7 +214,7 @@ void PMainWindow::initT( const char* name, T** ptr, int id) {
210 (*ptr)->setDestructiveClose(); 214 (*ptr)->setDestructiveClose();
211 m_stack->removeWidget( *ptr ); 215 m_stack->removeWidget( *ptr );
212 } 216 }
213 *ptr = new T( m_stack, name ); 217 *ptr = new T(m_cfg, m_stack, name );
214 m_stack->addWidget( *ptr, id ); 218 m_stack->addWidget( *ptr, id );
215 219
216 connect(*ptr, SIGNAL(sig_return()), 220 connect(*ptr, SIGNAL(sig_return()),