summaryrefslogtreecommitdiff
path: root/noncore/graphics/opie-eye/gui/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/graphics/opie-eye/gui/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 0a2fcab..ea765d1 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -1,51 +1,51 @@
1/* 1/*
2 * GPLv2 zecke@handhelds.org 2 * GPLv2 zecke@handhelds.org
3 * No WArranty... 3 * No WArranty...
4 */ 4 */
5 5
6#include <qtoolbar.h> 6#include <qtoolbar.h>
7#include <qtoolbutton.h> 7#include <qtoolbutton.h>
8#include <qlayout.h> 8#include <qlayout.h>
9#include <qdialog.h> 9#include <qdialog.h>
10#include <qmap.h> 10#include <qmap.h>
11 11
12#include <qpe/resource.h> 12#include <qpe/resource.h>
13#include <qpe/config.h> 13#include <qpe/config.h>
14#include <qpe/ir.h> 14#include <qpe/ir.h>
15 15
16#include <opie/oapplicationfactory.h> 16#include <opie2/oapplicationfactory.h>
17#include <opie/otabwidget.h> 17#include <opie2/otabwidget.h>
18 18
19#include <iface/ifaceinfo.h> 19#include <iface/ifaceinfo.h>
20#include <iface/dirview.h> 20#include <iface/dirview.h>
21 21
22#include "iconview.h" 22#include "iconview.h"
23#include "filesystem.h" 23#include "filesystem.h"
24 24
25#include "mainwindow.h" 25#include "mainwindow.h"
26 26
27OPIE_EXPORT_APP( OApplicationFactory<PMainWindow> ) 27OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow> )
28 28
29PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) 29PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
30 : QMainWindow( wid, name, style ), m_cfg("phunkview") 30 : QMainWindow( wid, name, style ), m_cfg("phunkview")
31{ 31{
32 setCaption( QObject::tr("Opie Eye Caramba" ) ); 32 setCaption( QObject::tr("Opie Eye Caramba" ) );
33 m_cfg.setGroup("Zecke_view" ); 33 m_cfg.setGroup("Zecke_view" );
34 /* 34 /*
35 * Initialize ToolBar and IconView 35 * Initialize ToolBar and IconView
36 * And Connect Them 36 * And Connect Them
37 */ 37 */
38 QToolBar *bar = new QToolBar( this ); 38 QToolBar *bar = new QToolBar( this );
39 bar->setHorizontalStretchable( true ); 39 bar->setHorizontalStretchable( true );
40 setToolBarsMovable( false ); 40 setToolBarsMovable( false );
41 41
42 m_view = new PIconView( this, &m_cfg ); 42 m_view = new PIconView( this, &m_cfg );
43 setCentralWidget( m_view ); 43 setCentralWidget( m_view );
44 44
45 QToolButton *btn = new QToolButton( bar ); 45 QToolButton *btn = new QToolButton( bar );
46 btn->setIconSet( Resource::loadIconSet( "up" ) ); 46 btn->setIconSet( Resource::loadIconSet( "up" ) );
47 connect( btn, SIGNAL(clicked()), 47 connect( btn, SIGNAL(clicked()),
48 m_view, SLOT(slotDirUp()) ); 48 m_view, SLOT(slotDirUp()) );
49 49
50 btn = new PFileSystem( bar ); 50 btn = new PFileSystem( bar );
51 connect( btn, SIGNAL( changeDir( const QString& ) ), 51 connect( btn, SIGNAL( changeDir( const QString& ) ),
@@ -63,49 +63,49 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
63 m_view, SLOT(slotBeam()) ); 63 m_view, SLOT(slotBeam()) );
64 } 64 }
65 65
66 btn = new QToolButton( bar ); 66 btn = new QToolButton( bar );
67 btn->setIconSet( Resource::loadIconSet( "trash" ) ); 67 btn->setIconSet( Resource::loadIconSet( "trash" ) );
68 connect( btn, SIGNAL(clicked() ), 68 connect( btn, SIGNAL(clicked() ),
69 m_view, SLOT(slotTrash() ) ); 69 m_view, SLOT(slotTrash() ) );
70 70
71 btn = new QToolButton( bar ); 71 btn = new QToolButton( bar );
72 btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); 72 btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) );
73 connect( btn, SIGNAL(clicked() ), 73 connect( btn, SIGNAL(clicked() ),
74 this, SLOT(slotConfig() ) ); 74 this, SLOT(slotConfig() ) );
75 75
76} 76}
77 77
78PMainWindow::~PMainWindow() { 78PMainWindow::~PMainWindow() {
79} 79}
80 80
81 81
82void PMainWindow::slotConfig() { 82void PMainWindow::slotConfig() {
83 QDialog dlg(this, 0, true); 83 QDialog dlg(this, 0, true);
84 dlg.setCaption( tr("Phunk View - Config" ) ); 84 dlg.setCaption( tr("Phunk View - Config" ) );
85 85
86 QHBoxLayout *lay = new QHBoxLayout(&dlg); 86 QHBoxLayout *lay = new QHBoxLayout(&dlg);
87 OTabWidget *wid = new OTabWidget(&dlg ); 87 Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg );
88 lay->addWidget( wid ); 88 lay->addWidget( wid );
89 ViewMap *vM = viewMap(); 89 ViewMap *vM = viewMap();
90 ViewMap::Iterator _it = vM->begin(); 90 ViewMap::Iterator _it = vM->begin();
91 QMap<PDirView*, QWidget*> lst; 91 QMap<PDirView*, QWidget*> lst;
92 92
93 for( ; _it != vM->end(); ++_it ) { 93 for( ; _it != vM->end(); ++_it ) {
94 PDirView *view = (_it.data())(m_cfg); 94 PDirView *view = (_it.data())(m_cfg);
95 PInterfaceInfo *inf = view->interfaceInfo(); 95 PInterfaceInfo *inf = view->interfaceInfo();
96 QWidget *_wid = inf->configWidget( m_cfg ); 96 QWidget *_wid = inf->configWidget( m_cfg );
97 _wid->reparent(wid, QPoint() ); 97 _wid->reparent(wid, QPoint() );
98 lst.insert( view, _wid ); 98 lst.insert( view, _wid );
99 wid->addTab( _wid, QString::null, inf->name() ); 99 wid->addTab( _wid, QString::null, inf->name() );
100 } 100 }
101 101
102 dlg.showMaximized(); 102 dlg.showMaximized();
103 bool act = ( dlg.exec() == QDialog::Accepted ); 103 bool act = ( dlg.exec() == QDialog::Accepted );
104 104
105 QMap<PDirView*, QWidget*>::Iterator it; 105 QMap<PDirView*, QWidget*>::Iterator it;
106 for ( it = lst.begin(); it != lst.end(); ++it ) { 106 for ( it = lst.begin(); it != lst.end(); ++it ) {
107 if ( act ) 107 if ( act )
108 it.key()->interfaceInfo()->writeConfig(it.data(), m_cfg); 108 it.key()->interfaceInfo()->writeConfig(it.data(), m_cfg);
109 delete it.key(); 109 delete it.key();
110 } 110 }
111 111