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.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 @@ -1,54 +1,62 @@ /* * GPLv2 zecke@handhelds.org * No WArranty... */ +#include "mainwindow.h" + +#include "iconview.h" +#include "filesystem.h" + +#include <iface/ifaceinfo.h> +#include <iface/dirview.h> + +#include <opie2/oapplicationfactory.h> +#include <opie2/otabwidget.h> +#include <opie2/okeyconfigwidget.h> + + +#include <qpe/resource.h> +#include <qpe/config.h> +#include <qpe/ir.h> #include <qtoolbar.h> #include <qtoolbutton.h> #include <qlayout.h> #include <qdialog.h> #include <qmap.h> -#include <qpe/resource.h> -#include <qpe/config.h> -#include <qpe/ir.h> -#include <opie2/oapplicationfactory.h> -#include <opie2/otabwidget.h> -#include <iface/ifaceinfo.h> -#include <iface/dirview.h> -#include "iconview.h" -#include "filesystem.h" - -#include "mainwindow.h" OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow> ) PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) - : QMainWindow( wid, name, style ), m_cfg("phunkview") + : QMainWindow( wid, name, style ) { setCaption( QObject::tr("Opie Eye Caramba" ) ); - m_cfg.setGroup("Zecke_view" ); + m_cfg = new Opie::Core::OConfig("phunkview"); + m_cfg->setGroup("Zecke_view" ); + + /* * Initialize ToolBar and IconView * And Connect Them */ QToolBar *bar = new QToolBar( this ); bar->setHorizontalStretchable( true ); setToolBarsMovable( false ); - m_view = new PIconView( this, &m_cfg ); + m_view = new PIconView( this, m_cfg ); setCentralWidget( m_view ); QToolButton *btn = new QToolButton( bar ); btn->setIconSet( Resource::loadIconSet( "up" ) ); connect( btn, SIGNAL(clicked()), m_view, SLOT(slotDirUp()) ); btn = new PFileSystem( bar ); connect( btn, SIGNAL( changeDir( const QString& ) ), m_view, SLOT(slotChangeDir( const QString& ) ) ); btn = new QToolButton( bar ); @@ -71,44 +79,60 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) btn = new QToolButton( bar ); btn->setIconSet( Resource::loadIconSet( "SettingsIcon" ) ); connect( btn, SIGNAL(clicked() ), this, SLOT(slotConfig() ) ); } PMainWindow::~PMainWindow() { } void PMainWindow::slotConfig() { +/* + * have a tab with the possible views + * a tab for globals image cache size.. scaled loading + * and one tab for the KeyConfigs + */ QDialog dlg(this, 0, true); dlg.setCaption( tr("Phunk View - Config" ) ); QHBoxLayout *lay = new QHBoxLayout(&dlg); Opie::Ui::OTabWidget *wid = new Opie::Ui::OTabWidget(&dlg ); lay->addWidget( wid ); ViewMap *vM = viewMap(); ViewMap::Iterator _it = vM->begin(); QMap<PDirView*, QWidget*> lst; for( ; _it != vM->end(); ++_it ) { - PDirView *view = (_it.data())(m_cfg); + PDirView *view = (_it.data())(*m_cfg); PInterfaceInfo *inf = view->interfaceInfo(); - QWidget *_wid = inf->configWidget( m_cfg ); + QWidget *_wid = inf->configWidget( *m_cfg ); _wid->reparent(wid, QPoint() ); lst.insert( view, _wid ); wid->addTab( _wid, QString::null, inf->name() ); } - dlg.showMaximized(); - bool act = ( dlg.exec() == QDialog::Accepted ); +/* + * Add the KeyConfigWidget + */ + Opie::Ui::OKeyConfigWidget* keyWid = new Opie::Ui::OKeyConfigWidget( wid, "key config" ); + keyWid->setChangeMode( Opie::Ui::OKeyConfigWidget::Queue ); + keyWid->insert( tr("Browser Keyboard Actions"), m_view->manager() ); + keyWid->load(); + wid->addTab( keyWid, QString::fromLatin1("AppsIcon" ), tr("Keyboard Configuration") ); + + + bool act = ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); QMap<PDirView*, QWidget*>::Iterator it; for ( it = lst.begin(); it != lst.end(); ++it ) { if ( act ) - it.key()->interfaceInfo()->writeConfig(it.data(), m_cfg); + it.key()->interfaceInfo()->writeConfig(it.data(), *m_cfg); delete it.key(); } - if ( act ) + if ( act ) { m_view->resetView(); + keyWid->save(); + } } |