summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp18
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.h1
2 files changed, 17 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp
index 67eb277..f443ccb 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.cpp
+++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp
@@ -64,24 +64,25 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
64 this, SLOT(slotShowInfo(const QString&)) ); 64 this, SLOT(slotShowInfo(const QString&)) );
65 connect(this,SIGNAL(changeListMode(int)),m_view,SLOT(slotChangeMode(int))); 65 connect(this,SIGNAL(changeListMode(int)),m_view,SLOT(slotChangeMode(int)));
66 66
67 m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); 67 m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce);
68 68
69 listviewMenu = 0; 69 listviewMenu = 0;
70 /* setup menu and toolbar */ 70 /* setup menu and toolbar */
71 setupActions(); 71 setupActions();
72 setupToolbar(); 72 setupToolbar();
73 setupMenu(); 73 setupMenu();
74 m_aHideToolbar->setOn(m_cfg->readBoolEntry("showtoolbar",true)); 74 m_aHideToolbar->setOn(m_cfg->readBoolEntry("showtoolbar",true));
75 m_aAutoRotate->setEnabled(!m_aUnscaled->isOn()); 75 m_aAutoRotate->setEnabled(!m_aUnscaled->isOn());
76 odebug << "mainwindow constructor done" << oendl;
76} 77}
77 78
78PMainWindow::~PMainWindow() { 79PMainWindow::~PMainWindow() {
79} 80}
80 81
81void PMainWindow::slotToggleZoomer() 82void PMainWindow::slotToggleZoomer()
82{ 83{
83 m_aZoomer->setOn(!m_aZoomer->isOn()); 84 m_aZoomer->setOn(!m_aZoomer->isOn());
84} 85}
85 86
86void PMainWindow::slotZoomerToggled(bool how) 87void PMainWindow::slotZoomerToggled(bool how)
87{ 88{
@@ -424,31 +425,44 @@ void PMainWindow::closeEvent( QCloseEvent* ev ) {
424 raiseIconView(); 425 raiseIconView();
425 return; 426 return;
426 } 427 }
427 if (m_disp && m_disp->fullScreen()) { 428 if (m_disp && m_disp->fullScreen()) {
428 /* otherwise opie-eye crashes in bigscreen mode! */ 429 /* otherwise opie-eye crashes in bigscreen mode! */
429 m_disp->reparent(0,QPoint(0,0)); 430 m_disp->reparent(0,QPoint(0,0));
430 m_stack->addWidget(m_disp,ImageDisplay); 431 m_stack->addWidget(m_disp,ImageDisplay);
431 } 432 }
432 ev->accept(); 433 ev->accept();
433 QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); 434 QTimer::singleShot(0, qApp, SLOT(closeAllWindows()));
434} 435}
435 436
436void PMainWindow::setDocument( const QString& showImg ) { 437void PMainWindow::setDocument( const QString& showImg )
438{
439 bool first_start = m_disp==0;
440
437 QString file = showImg; 441 QString file = showImg;
438 DocLnk lnk(showImg); 442 DocLnk lnk(showImg);
439 if (lnk.isValid() ) 443 if (lnk.isValid() )
440 file = lnk.file(); 444 file = lnk.file();
441
442 slotDisplay( file ); 445 slotDisplay( file );
446 if (first_start && m_aFullScreen->isOn()) {
447 QTimer::singleShot(0,this,SLOT(check_view_fullscreen()));
448 }
449}
450
451void PMainWindow::check_view_fullscreen()
452{
453 if (!m_view) return;
454 if (!m_view->hasFocus()&&m_aFullScreen->isOn()) {
455 qwsDisplay()->requestFocus( m_disp->winId(), TRUE);
456 }
443} 457}
444 458
445void PMainWindow::slotSelectDir(int id) 459void PMainWindow::slotSelectDir(int id)
446{ 460{
447 emit changeDir( m_dev[fsMenu->text(id )] ); 461 emit changeDir( m_dev[fsMenu->text(id )] );
448} 462}
449 463
450void PMainWindow::dirChanged() 464void PMainWindow::dirChanged()
451{ 465{
452 fsMenu->clear(); 466 fsMenu->clear();
453 m_dev.clear(); 467 m_dev.clear();
454 468
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h
index 5707568..465e352 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.h
+++ b/noncore/graphics/opie-eye/gui/mainwindow.h
@@ -56,24 +56,25 @@ public slots:
56 void slotToggleAutorotate(); 56 void slotToggleAutorotate();
57 void slotToggleAutoscale(); 57 void slotToggleAutoscale();
58 void setDocument( const QString& ); 58 void setDocument( const QString& );
59 virtual void slotToggleFullScreen(); 59 virtual void slotToggleFullScreen();
60 virtual void slotFullScreenToggled(bool); 60 virtual void slotFullScreenToggled(bool);
61 61
62protected slots: 62protected slots:
63 void raiseIconView(); 63 void raiseIconView();
64 void closeEvent( QCloseEvent* ); 64 void closeEvent( QCloseEvent* );
65 void showToolbar(bool); 65 void showToolbar(bool);
66 void listviewselected(QAction*); 66 void listviewselected(QAction*);
67 void slotFullScreenButton(bool); 67 void slotFullScreenButton(bool);
68 void check_view_fullscreen();
68 69
69private: 70private:
70 template<class T> void initT( const char* name, T**, int ); 71 template<class T> void initT( const char* name, T**, int );
71 void initInfo(); 72 void initInfo();
72 void initDisp(); 73 void initDisp();
73 void setupViewWindow(bool full, bool forceDisplay); 74 void setupViewWindow(bool full, bool forceDisplay);
74 75
75private: 76private:
76 Opie::Core::OConfig *m_cfg; 77 Opie::Core::OConfig *m_cfg;
77 Opie::Ui::OWidgetStack *m_stack; 78 Opie::Ui::OWidgetStack *m_stack;
78 PIconView* m_view; 79 PIconView* m_view;
79 imageinfo *m_info; 80 imageinfo *m_info;