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 | 54 |
1 files changed, 38 insertions, 16 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 570ee45..ece51a1 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp @@ -44,6 +44,6 @@ PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) { setCaption( QObject::tr("Opie Eye Caramba" ) ); - m_cfg = new Opie::Core::OConfig("phunkview"); - m_cfg->setGroup("Zecke_view" ); + m_cfg = new Opie::Core::OConfig("opie-eye"); + m_cfg->setGroup("main" ); m_storage = new StorageInfo(); @@ -109,5 +109,4 @@ void PMainWindow::slotToggleAutoscale() void PMainWindow::slotRotateToggled(bool how) { - odebug << "Autorotate: " << how << oendl; autoRotate = how; if (m_disp) { @@ -227,8 +226,10 @@ void PMainWindow::initT( const char* name, T** ptr, int id) { } + void PMainWindow::initInfo() { initT<imageinfo>( "Image Info", &m_info, ImageInfo ); connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); } + void PMainWindow::initDisp() { initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); @@ -257,15 +258,30 @@ void PMainWindow::initDisp() { void PMainWindow::slotToggleFullScreen() { - odebug << "Toggle full " << oendl; bool current = !m_aFullScreen->isOn(); m_aFullScreen->setOn(current); } -void PMainWindow::slotFullScreenToggled(bool current) +void PMainWindow::slotFullScreenButton(bool current) +{ + if (m_disp) odebug << "Disp fenster ist hidden: "<<m_disp->isHidden()<<oendl; + if (!m_disp) return; + + /* I can not solve this effects here - it seems that we require some + status variable, too. so we will live with some interesting effects + meanwhile */ +#if 0 + bool th = m_disp->isHidden(); + setupViewWindow(current, false); + /* realy - after setting up the fullscreenmode while the window is hidden + it is unvisibile not hidden!!!!! Hell. */ + if (th) m_disp->hide(); +#endif + setupViewWindow(current, true); +} + +void PMainWindow::setupViewWindow(bool current, bool forceDisplay) { - odebug << "slotFullScreenToggled " << current << oendl; if (!m_disp) return; if (current) { - odebug << "full" << oendl; m_disp->setBackgroundColor(black); m_disp->reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); @@ -275,5 +291,4 @@ void PMainWindow::slotFullScreenToggled(bool current) } else { setUpdatesEnabled(false); - odebug << "window" << oendl; if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { m_disp->setMinimumSize(QApplication::desktop()->size()/2); @@ -290,5 +305,6 @@ void PMainWindow::slotFullScreenToggled(bool current) m_disp->setVScrollBarMode(QScrollView::Auto); m_disp->setHScrollBarMode(QScrollView::Auto); - m_stack->raiseWidget(m_disp); + if (forceDisplay || m_disp->isVisible()) + m_stack->raiseWidget(m_disp); if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { m_disp->resize(m_disp->minimumSize()); @@ -296,5 +312,10 @@ void PMainWindow::slotFullScreenToggled(bool current) setUpdatesEnabled(true); } - m_disp->setFullScreen(current); + m_disp->setFullScreen(current,forceDisplay); +} + +void PMainWindow::slotFullScreenToggled(bool current) +{ + setupViewWindow(current,true); } @@ -330,5 +351,4 @@ void PMainWindow::slotShowInfo( const QString& inf ) { void PMainWindow::slotDisplay( const QString& inf ) { - odebug << "slotDisplay: " << inf << oendl; if ( !m_disp ) { initDisp(); @@ -348,5 +368,4 @@ void PMainWindow::slotDisplay( const QString& inf ) { } if (m_disp->fullScreen()) { - //m_disp->showFullScreen(); qwsDisplay()->requestFocus( m_disp->winId(), TRUE); } else { @@ -519,5 +538,5 @@ void PMainWindow::setupActions() m_aFullScreen->setToggleAction(true); m_aFullScreen->setOn(false); - connect(m_aFullScreen,SIGNAL(toggled(bool)),this,SLOT(slotFullScreenToggled(bool))); + connect(m_aFullScreen,SIGNAL(toggled(bool)),this,SLOT(slotFullScreenButton(bool))); m_gDisplayType = new QActionGroup(this,"imagedisplaytype",false); @@ -570,5 +589,5 @@ void PMainWindow::setupToolbar() m_aShowInfo->addTo(toolBar); m_aTrash->addTo(toolBar); - m_aSetup->addTo(toolBar); +// m_aSetup->addTo(toolBar); m_gDisplayType->addTo(toolBar); @@ -587,4 +606,6 @@ void PMainWindow::setupMenu() dispMenu = new QPopupMenu( menuBar() ); menuBar()->insertItem( tr( "Show" ), dispMenu ); + settingsMenu = new QPopupMenu( menuBar() ); + menuBar()->insertItem( tr( "Settings" ), settingsMenu ); m_aViewfile->addTo(fileMenu); @@ -605,8 +626,6 @@ void PMainWindow::setupMenu() } fileMenu->insertSeparator(); - m_aSetup->addTo(fileMenu); m_aTrash->addTo(fileMenu); - m_aHideToolbar->addTo(dispMenu); listviewMenu = new QPopupMenu(dispMenu); dispMenu->insertItem(Resource::loadIconSet("opie-eye/opie-eye-thumb"),tr("Listview mode"),listviewMenu); @@ -617,4 +636,7 @@ void PMainWindow::setupMenu() dispMenu->insertSeparator(); m_gPrevNext->addTo(dispMenu); + + m_aSetup->addTo(settingsMenu); + m_aHideToolbar->addTo(settingsMenu); } |