-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 18 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.h | 1 |
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 @@ -60,32 +60,33 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) connect(m_view, SIGNAL(sig_display(const QString&)), this, SLOT(slotDisplay(const QString&))); connect(m_view, SIGNAL(sig_showInfo(const QString&)), this, SLOT(slotShowInfo(const QString&)) ); connect(this,SIGNAL(changeListMode(int)),m_view,SLOT(slotChangeMode(int))); m_stack->forceMode(Opie::Ui::OWidgetStack::NoForce); listviewMenu = 0; /* setup menu and toolbar */ setupActions(); setupToolbar(); setupMenu(); m_aHideToolbar->setOn(m_cfg->readBoolEntry("showtoolbar",true)); m_aAutoRotate->setEnabled(!m_aUnscaled->isOn()); + odebug << "mainwindow constructor done" << oendl; } PMainWindow::~PMainWindow() { } void PMainWindow::slotToggleZoomer() { m_aZoomer->setOn(!m_aZoomer->isOn()); } void PMainWindow::slotZoomerToggled(bool how) { if (m_disp) { m_disp->setShowZoomer(how); } if (autoSave) { @@ -420,39 +421,52 @@ void PMainWindow::closeEvent( QCloseEvent* ev ) { */ if ( m_stack->visibleWidget() == m_info || m_stack->visibleWidget() == m_disp ) { ev->ignore(); raiseIconView(); return; } if (m_disp && m_disp->fullScreen()) { /* otherwise opie-eye crashes in bigscreen mode! */ m_disp->reparent(0,QPoint(0,0)); m_stack->addWidget(m_disp,ImageDisplay); } ev->accept(); QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); } -void PMainWindow::setDocument( const QString& showImg ) { +void PMainWindow::setDocument( const QString& showImg ) +{ + bool first_start = m_disp==0; + QString file = showImg; DocLnk lnk(showImg); if (lnk.isValid() ) file = lnk.file(); - slotDisplay( file ); + if (first_start && m_aFullScreen->isOn()) { + QTimer::singleShot(0,this,SLOT(check_view_fullscreen())); + } +} + +void PMainWindow::check_view_fullscreen() +{ + if (!m_view) return; + if (!m_view->hasFocus()&&m_aFullScreen->isOn()) { + qwsDisplay()->requestFocus( m_disp->winId(), TRUE); + } } void PMainWindow::slotSelectDir(int id) { emit changeDir( m_dev[fsMenu->text(id )] ); } void PMainWindow::dirChanged() { fsMenu->clear(); m_dev.clear(); /* home dir, too */ QString f = getenv( "HOME" ); if (!f.isEmpty()) { m_dev.insert("Home directory",f); 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 @@ -52,32 +52,33 @@ public slots: void slotRotateToggled(bool); void slotScaleToggled(bool); void slotZoomerToggled(bool); void slotToggleZoomer(); void slotToggleAutorotate(); void slotToggleAutoscale(); void setDocument( const QString& ); virtual void slotToggleFullScreen(); virtual void slotFullScreenToggled(bool); protected slots: void raiseIconView(); void closeEvent( QCloseEvent* ); void showToolbar(bool); void listviewselected(QAction*); void slotFullScreenButton(bool); + void check_view_fullscreen(); private: template<class T> void initT( const char* name, T**, int ); void initInfo(); void initDisp(); void setupViewWindow(bool full, bool forceDisplay); private: Opie::Core::OConfig *m_cfg; Opie::Ui::OWidgetStack *m_stack; PIconView* m_view; imageinfo *m_info; ImageView *m_disp; bool autoSave; QToolButton*fsButton; QToolBar *toolBar; |