summaryrefslogtreecommitdiff
authorzecke <zecke>2004-04-07 23:47:43 (UTC)
committer zecke <zecke>2004-04-07 23:47:43 (UTC)
commit10ec13c9068e7e4ca0acf75e5843ebd91e4e8566 (patch) (unidiff)
tree9889be205ecb8d65aeca3b280d1db7ed0f07791c
parent61cb9c9ad238e5aec6aaa1384549e0aab99d14bf (diff)
downloadopie-10ec13c9068e7e4ca0acf75e5843ebd91e4e8566.zip
opie-10ec13c9068e7e4ca0acf75e5843ebd91e4e8566.tar.gz
opie-10ec13c9068e7e4ca0acf75e5843ebd91e4e8566.tar.bz2
Implement setDocument so now we could start replacing showimg
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp10
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 21a668a..3650493 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -1,47 +1,48 @@
1/* 1/*
2 * GPLv2 zecke@handhelds.org 2 * GPLv2 zecke@handhelds.org
3 * No WArranty... 3 * No WArranty...
4 */ 4 */
5#include "mainwindow.h" 5#include "mainwindow.h"
6 6
7#include "iconview.h" 7#include "iconview.h"
8#include "filesystem.h" 8#include "filesystem.h"
9#include "imageinfoui.h" 9#include "imageinfoui.h"
10#include "imageview.h" 10#include "imageview.h"
11 11
12#include <iface/ifaceinfo.h> 12#include <iface/ifaceinfo.h>
13#include <iface/dirview.h> 13#include <iface/dirview.h>
14 14
15#include <opie2/odebug.h> 15#include <opie2/odebug.h>
16#include <opie2/owidgetstack.h> 16#include <opie2/owidgetstack.h>
17#include <opie2/oapplicationfactory.h> 17#include <opie2/oapplicationfactory.h>
18#include <opie2/otabwidget.h> 18#include <opie2/otabwidget.h>
19#include <opie2/okeyconfigwidget.h> 19#include <opie2/okeyconfigwidget.h>
20 20
21#include <qpe/resource.h> 21#include <qpe/resource.h>
22#include <qpe/config.h> 22#include <qpe/config.h>
23#include <qpe/ir.h> 23#include <qpe/ir.h>
24#include <qpe/applnk.h>
24 25
25#include <qtoolbar.h> 26#include <qtoolbar.h>
26#include <qtoolbutton.h> 27#include <qtoolbutton.h>
27#include <qlayout.h> 28#include <qlayout.h>
28#include <qdialog.h> 29#include <qdialog.h>
29#include <qmap.h> 30#include <qmap.h>
30#include <qtimer.h> 31#include <qtimer.h>
31 32
32 33
33 34
34 35
35OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) 36OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" )
36 37
37PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) 38PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
38 : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) 39 : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 )
39{ 40{
40 setCaption( QObject::tr("Opie Eye Caramba" ) ); 41 setCaption( QObject::tr("Opie Eye Caramba" ) );
41 m_cfg = new Opie::Core::OConfig("phunkview"); 42 m_cfg = new Opie::Core::OConfig("phunkview");
42 m_cfg->setGroup("Zecke_view" ); 43 m_cfg->setGroup("Zecke_view" );
43// qDebug( "Process-wide OApplication object @ %0x", oApp ); 44// qDebug( "Process-wide OApplication object @ %0x", oApp );
44 /* 45 /*
45 * Initialize ToolBar and IconView 46 * Initialize ToolBar and IconView
46 * And Connect Them 47 * And Connect Them
47 */ 48 */
@@ -260,24 +261,33 @@ void PMainWindow::slotDisplay( const QString& inf ) {
260 261
261void PMainWindow::slotReturn() { 262void PMainWindow::slotReturn() {
262 raiseIconView(); 263 raiseIconView();
263} 264}
264 265
265 266
266void PMainWindow::closeEvent( QCloseEvent* ev ) { 267void PMainWindow::closeEvent( QCloseEvent* ev ) {
267 /* 268 /*
268 * return from view 269 * return from view
269 * or properly quit 270 * or properly quit
270 */ 271 */
271 if ( m_stack->visibleWidget() == m_info || 272 if ( m_stack->visibleWidget() == m_info ||
272 m_stack->visibleWidget() == m_disp ) { 273 m_stack->visibleWidget() == m_disp ) {
273 raiseIconView(); 274 raiseIconView();
274 ev->ignore(); 275 ev->ignore();
275 return; 276 return;
276 } 277 }
277 ev->accept(); 278 ev->accept();
278 QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); 279 QTimer::singleShot(0, qApp, SLOT(closeAllWindows()));
279} 280}
280 281
281void PMainWindow::raiseIconView() { 282void PMainWindow::raiseIconView() {
282 m_stack->raiseWidget( IconView ); 283 m_stack->raiseWidget( IconView );
283} 284}
285
286void PMainWindow::setDocument( const QString& showImg ) {
287 QString file = showImg;
288 DocLnk lnk(showImg);
289 if (lnk.isValid() )
290 file = lnk.file();
291
292 slotDisplay( file );
293}
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h
index 5de2f42..042d568 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.h
+++ b/noncore/graphics/opie-eye/gui/mainwindow.h
@@ -18,48 +18,49 @@ namespace Ui{
18 class OWidgetStack; 18 class OWidgetStack;
19} 19}
20} 20}
21 21
22class PIconView; 22class PIconView;
23class imageinfo; 23class imageinfo;
24class ImageView; 24class ImageView;
25class PMainWindow : public QMainWindow { 25class PMainWindow : public QMainWindow {
26 Q_OBJECT 26 Q_OBJECT
27 enum Views { IconView, ImageInfo, ImageDisplay }; 27 enum Views { IconView, ImageInfo, ImageDisplay };
28public: 28public:
29 static QString appName() { return QString::fromLatin1("opie-eye" ); } 29 static QString appName() { return QString::fromLatin1("opie-eye" ); }
30 PMainWindow(QWidget*, const char*, WFlags ); 30 PMainWindow(QWidget*, const char*, WFlags );
31 ~PMainWindow(); 31 ~PMainWindow();
32 32
33signals: 33signals:
34 void configChanged(); 34 void configChanged();
35 35
36public slots: 36public slots:
37 void slotShowInfo( const QString& inf ); 37 void slotShowInfo( const QString& inf );
38 void slotDisplay( const QString& inf ); 38 void slotDisplay( const QString& inf );
39 void slotReturn(); 39 void slotReturn();
40 void slotRotateToggled(bool); 40 void slotRotateToggled(bool);
41 void slotScaleToggled(bool); 41 void slotScaleToggled(bool);
42 void setDocument( const QString& );
42 43
43protected: 44protected:
44 void raiseIconView(); 45 void raiseIconView();
45 void closeEvent( QCloseEvent* ); 46 void closeEvent( QCloseEvent* );
46 47
47private: 48private:
48 template<class T> void initT( const char* name, T**, int ); 49 template<class T> void initT( const char* name, T**, int );
49 void initInfo(); 50 void initInfo();
50 void initDisp(); 51 void initDisp();
51 52
52private: 53private:
53 Opie::Core::OConfig *m_cfg; 54 Opie::Core::OConfig *m_cfg;
54 Opie::Ui::OWidgetStack *m_stack; 55 Opie::Ui::OWidgetStack *m_stack;
55 PIconView* m_view; 56 PIconView* m_view;
56 imageinfo *m_info; 57 imageinfo *m_info;
57 ImageView *m_disp; 58 ImageView *m_disp;
58 bool autoRotate; 59 bool autoRotate;
59 bool autoScale; 60 bool autoScale;
60 QToolButton*rotateButton; 61 QToolButton*rotateButton;
61 62
62 63
63private slots: 64private slots:
64 void slotConfig(); 65 void slotConfig();
65}; 66};