summaryrefslogtreecommitdiff
path: root/noncore
authoralwin <alwin>2004-04-07 12:46:26 (UTC)
committer alwin <alwin>2004-04-07 12:46:26 (UTC)
commit9e1ecade17a77c3d50aecc4c92091d852e99e8d9 (patch) (unidiff)
treebef7f25d64890aab64f5dc0e0fcb40c64497464a /noncore
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 (limited to 'noncore') (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
@@ -28,8 +28,9 @@ static const int THUMBSIZE = 128;
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();
@@ -40,4 +41,5 @@ imageinfo::imageinfo(const QString&_path, QWidget* parent, const char* name, WF
40{ 41{
41 m_viewManager = 0; 42 m_viewManager = 0;
43 m_cfg = 0;
42 init(name); 44 init(name);
43 initKeys(); 45 initKeys();
@@ -56,6 +58,10 @@ void 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() );
@@ -65,7 +71,7 @@ void imageinfo::initKeys()
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),
@@ -144,5 +150,4 @@ imageinfo::~imageinfo()
144 } 150 }
145 if (m_viewManager) { 151 if (m_viewManager) {
146 m_viewManager->save();
147 delete m_viewManager; 152 delete m_viewManager;
148 } 153 }
@@ -155,6 +160,4 @@ void imageinfo::slot_fullInfo(const QString&_path, const QString&_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 }
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
@@ -30,5 +30,5 @@ class imageinfo : public QWidget
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();
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
@@ -9,8 +9,9 @@
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}
@@ -18,4 +19,7 @@ ImageView::ImageView( QWidget* parent, const char* name, WFlags fl )
18ImageView::~ImageView() 19ImageView::~ImageView()
19{ 20{
21 if (m_viewManager) {
22 delete m_viewManager;
23 }
20} 24}
21 25
@@ -31,6 +35,8 @@ void 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() );
@@ -40,12 +46,12 @@ void ImageView::initKeys()
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
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
@@ -23,5 +23,5 @@ class ImageView:public ImageScrollView
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();
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
@@ -196,5 +196,9 @@ void PMainWindow::slotConfig() {
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
@@ -211,5 +215,5 @@ void PMainWindow::initT( const char* name, T** ptr, int id) {
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