Diffstat (limited to 'noncore/graphics/opie-eye/gui/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 64 |
1 files changed, 44 insertions, 20 deletions
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 @@ | |||
4 | */ | 4 | */ |
5 | #include "mainwindow.h" | ||
6 | |||
7 | #include "iconview.h" | ||
8 | #include "filesystem.h" | ||
9 | |||
10 | #include <iface/ifaceinfo.h> | ||
11 | #include <iface/dirview.h> | ||
12 | |||
13 | #include <opie2/oapplicationfactory.h> | ||
14 | #include <opie2/otabwidget.h> | ||
15 | #include <opie2/okeyconfigwidget.h> | ||
16 | |||
17 | |||
18 | #include <qpe/resource.h> | ||
19 | #include <qpe/config.h> | ||
20 | #include <qpe/ir.h> | ||
5 | 21 | ||
@@ -11,16 +27,5 @@ | |||
11 | 27 | ||
12 | #include <qpe/resource.h> | ||
13 | #include <qpe/config.h> | ||
14 | #include <qpe/ir.h> | ||
15 | |||
16 | #include <opie2/oapplicationfactory.h> | ||
17 | #include <opie2/otabwidget.h> | ||
18 | 28 | ||
19 | #include <iface/ifaceinfo.h> | ||
20 | #include <iface/dirview.h> | ||
21 | 29 | ||
22 | #include "iconview.h" | ||
23 | #include "filesystem.h" | ||
24 | 30 | ||
25 | #include "mainwindow.h" | ||
26 | 31 | ||
@@ -29,6 +34,9 @@ OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow> ) | |||
29 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | 34 | PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) |
30 | : QMainWindow( wid, name, style ), m_cfg("phunkview") | 35 | : QMainWindow( wid, name, style ) |
31 | { | 36 | { |
32 | setCaption( QObject::tr("Opie Eye Caramba" ) ); | 37 | setCaption( QObject::tr("Opie Eye Caramba" ) ); |
33 | m_cfg.setGroup("Zecke_view" ); | 38 | m_cfg = new Opie::Core::OConfig("phunkview"); |
39 | m_cfg->setGroup("Zecke_view" ); | ||
40 | |||
41 | |||
34 | /* | 42 | /* |
@@ -41,3 +49,3 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) | |||
41 | 49 | ||
42 | m_view = new PIconView( this, &m_cfg ); | 50 | m_view = new PIconView( this, m_cfg ); |
43 | setCentralWidget( m_view ); | 51 | setCentralWidget( m_view ); |
@@ -82,2 +90,7 @@ PMainWindow::~PMainWindow() { | |||
82 | void PMainWindow::slotConfig() { | 90 | void PMainWindow::slotConfig() { |
91 | /* | ||
92 | * have a tab with the possible views | ||
93 | * a tab for globals image cache size.. scaled loading | ||
94 | * and one tab for the KeyConfigs | ||
95 | */ | ||
83 | QDialog dlg(this, 0, true); | 96 | QDialog dlg(this, 0, true); |
@@ -93,5 +106,5 @@ void PMainWindow::slotConfig() { | |||
93 | for( ; _it != vM->end(); ++_it ) { | 106 | for( ; _it != vM->end(); ++_it ) { |
94 | PDirView *view = (_it.data())(m_cfg); | 107 | PDirView *view = (_it.data())(*m_cfg); |
95 | PInterfaceInfo *inf = view->interfaceInfo(); | 108 | PInterfaceInfo *inf = view->interfaceInfo(); |
96 | QWidget *_wid = inf->configWidget( m_cfg ); | 109 | QWidget *_wid = inf->configWidget( *m_cfg ); |
97 | _wid->reparent(wid, QPoint() ); | 110 | _wid->reparent(wid, QPoint() ); |
@@ -101,4 +114,13 @@ void PMainWindow::slotConfig() { | |||
101 | 114 | ||
102 | dlg.showMaximized(); | 115 | /* |
103 | bool act = ( dlg.exec() == QDialog::Accepted ); | 116 | * Add the KeyConfigWidget |
117 | */ | ||
118 | Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); | ||
119 | keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); | ||
120 | keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); | ||
121 | keyWid->load(); | ||
122 | wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); | ||
123 | |||
124 | |||
125 | bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); | ||
104 | 126 | ||
@@ -107,3 +129,3 @@ void PMainWindow::slotConfig() { | |||
107 | if ( act ) | 129 | if ( act ) |
108 | it.key()->interfaceInfo()->writeConfig(it.data(), m_cfg); | 130 | it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); |
109 | delete it.key(); | 131 | delete it.key(); |
@@ -111,4 +133,6 @@ void PMainWindow::slotConfig() { | |||
111 | 133 | ||
112 | if ( act ) | 134 | if ( act ) { |
113 | m_view->resetView(); | 135 | m_view->resetView(); |
136 | keyWid->save(); | ||
137 | } | ||
114 | } | 138 | } |