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 | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index d11e4e1..4ee252f 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -256,38 +256,40 @@ void PMainWindow::initT( const char* name, T** ptr, int id) { | |||
256 | 256 | ||
257 | void PMainWindow::initInfo() { | 257 | void PMainWindow::initInfo() { |
258 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); | 258 | initT<imageinfo>( "Image Info", &m_info, ImageInfo ); |
259 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); | 259 | connect(m_info,SIGNAL(dispImage(const QString&)),this,SLOT(slotDisplay(const QString&))); |
260 | } | 260 | } |
261 | 261 | ||
262 | void PMainWindow::initDisp() { | 262 | void PMainWindow::initDisp() { |
263 | initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); | 263 | initT<ImageView>( "Image ScrollView", &m_disp, ImageDisplay ); |
264 | if (m_disp) { | 264 | if (m_disp) { |
265 | // if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { | 265 | // if (m_stack->mode() != Opie::Ui::OWidgetStack::SmallScreen) { |
266 | //m_disp->setMinimumSize(QApplication::desktop()->size()/2); | 266 | //m_disp->setMinimumSize(QApplication::desktop()->size()/2); |
267 | // } | 267 | // } |
268 | m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType); | 268 | m_disp->setMenuActions(m_hGroup,m_gPrevNext,m_gDisplayType,m_hBright); |
269 | m_disp->setAutoScale(!m_aUnscaled->isOn()); | 269 | m_disp->setAutoScale(!m_aUnscaled->isOn()); |
270 | m_disp->setAutoRotate(m_aAutoRotate->isOn()); | 270 | m_disp->setAutoRotate(m_aAutoRotate->isOn()); |
271 | m_disp->setShowZoomer(m_aZoomer->isOn()); | 271 | m_disp->setShowZoomer(m_aZoomer->isOn()); |
272 | m_disp->setBackgroundColor(white); | 272 | m_disp->setBackgroundColor(white); |
273 | connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); | 273 | connect(m_disp,SIGNAL(dispImageInfo(const QString&)),this,SLOT(slotShowInfo(const QString&))); |
274 | connect(m_disp,SIGNAL(dispNext()),m_view,SLOT(slotShowNext())); | 274 | connect(m_disp,SIGNAL(dispNext()),m_view,SLOT(slotShowNext())); |
275 | connect(m_disp,SIGNAL(dispPrev()),m_view,SLOT(slotShowPrev())); | 275 | connect(m_disp,SIGNAL(dispPrev()),m_view,SLOT(slotShowPrev())); |
276 | connect(m_disp,SIGNAL(toggleFullScreen()),this,SLOT(slotToggleFullScreen())); | 276 | connect(m_disp,SIGNAL(toggleFullScreen()),this,SLOT(slotToggleFullScreen())); |
277 | connect(m_disp,SIGNAL(hideMe()),this,SLOT(raiseIconView())); | 277 | connect(m_disp,SIGNAL(hideMe()),this,SLOT(raiseIconView())); |
278 | connect(m_disp,SIGNAL(toggleZoomer()),this,SLOT(slotToggleZoomer())); | 278 | connect(m_disp,SIGNAL(toggleZoomer()),this,SLOT(slotToggleZoomer())); |
279 | connect(m_disp,SIGNAL(toggleAutoscale()),this,SLOT(slotToggleAutoscale())); | 279 | connect(m_disp,SIGNAL(toggleAutoscale()),this,SLOT(slotToggleAutoscale())); |
280 | connect(m_disp,SIGNAL(toggleAutorotate()),this,SLOT(slotToggleAutorotate())); | 280 | connect(m_disp,SIGNAL(toggleAutorotate()),this,SLOT(slotToggleAutorotate())); |
281 | connect(m_view,SIGNAL(sig_startslide(int)),m_disp,SLOT(startSlide(int))); | 281 | connect(m_view,SIGNAL(sig_startslide(int)),m_disp,SLOT(startSlide(int))); |
282 | connect(m_IncBrightness,SIGNAL(activated()),m_disp,SLOT(slotIncBrightness())); | ||
283 | connect(m_DecBrightness,SIGNAL(activated()),m_disp,SLOT(slotDecBrightness())); | ||
282 | slotFullScreenToggled(m_aFullScreen->isOn()); | 284 | slotFullScreenToggled(m_aFullScreen->isOn()); |
283 | } | 285 | } |
284 | } | 286 | } |
285 | 287 | ||
286 | void PMainWindow::slotToggleFullScreen() | 288 | void PMainWindow::slotToggleFullScreen() |
287 | { | 289 | { |
288 | bool current = !m_aFullScreen->isOn(); | 290 | bool current = !m_aFullScreen->isOn(); |
289 | m_aFullScreen->setOn(current); | 291 | m_aFullScreen->setOn(current); |
290 | } | 292 | } |
291 | 293 | ||
292 | void PMainWindow::slotFullScreenButton(bool current) | 294 | void PMainWindow::slotFullScreenButton(bool current) |
293 | { | 295 | { |
@@ -371,24 +373,25 @@ void PMainWindow::slotShowInfo( const QString& inf ) { | |||
371 | m_aViewfile->setEnabled(true); | 373 | m_aViewfile->setEnabled(true); |
372 | m_aStartSlide->setEnabled(false); | 374 | m_aStartSlide->setEnabled(false); |
373 | m_stack->raiseWidget( ImageInfo ); | 375 | m_stack->raiseWidget( ImageInfo ); |
374 | } | 376 | } |
375 | 377 | ||
376 | void PMainWindow::slotDisplay( const QString& inf ) { | 378 | void PMainWindow::slotDisplay( const QString& inf ) { |
377 | bool nwindow = false; | 379 | bool nwindow = false; |
378 | if ( !m_disp ) { | 380 | if ( !m_disp ) { |
379 | nwindow = true; | 381 | nwindow = true; |
380 | initDisp(); | 382 | initDisp(); |
381 | m_disp->setIntensity(m_Intensity); | 383 | m_disp->setIntensity(m_Intensity); |
382 | m_setCurrentBrightness->setEnabled(true); | 384 | m_setCurrentBrightness->setEnabled(true); |
385 | m_hBright->setEnabled(true); | ||
383 | } | 386 | } |
384 | m_disp->setImage( inf ); | 387 | m_disp->setImage( inf ); |
385 | if (m_SmallWindow) { | 388 | if (m_SmallWindow) { |
386 | if (m_gPrevNext->isEnabled()==false) { | 389 | if (m_gPrevNext->isEnabled()==false) { |
387 | m_gPrevNext->addTo(toolBar); | 390 | m_gPrevNext->addTo(toolBar); |
388 | fsButton->hide(); | 391 | fsButton->hide(); |
389 | } | 392 | } |
390 | } | 393 | } |
391 | m_gPrevNext->setEnabled(true); | 394 | m_gPrevNext->setEnabled(true); |
392 | m_aDirUp->setEnabled(false); | 395 | m_aDirUp->setEnabled(false); |
393 | m_aShowInfo->setEnabled(true); | 396 | m_aShowInfo->setEnabled(true); |
394 | m_aViewfile->setEnabled(false); | 397 | m_aViewfile->setEnabled(false); |
@@ -634,33 +637,38 @@ void PMainWindow::setupActions() | |||
634 | m_hGroup = new QActionGroup(this,"actioncollection",false); | 637 | m_hGroup = new QActionGroup(this,"actioncollection",false); |
635 | m_hGroup->insert(m_aFullScreen); | 638 | m_hGroup->insert(m_aFullScreen); |
636 | 639 | ||
637 | if (!m_SmallWindow) { | 640 | if (!m_SmallWindow) { |
638 | m_aForceSmall = new QAction(tr("Dont show seperate windows"),Resource::loadIconSet( "AppsIcon" ), 0, 0, this, 0, true); | 641 | m_aForceSmall = new QAction(tr("Dont show seperate windows"),Resource::loadIconSet( "AppsIcon" ), 0, 0, this, 0, true); |
639 | m_aForceSmall->setToggleAction(true); | 642 | m_aForceSmall->setToggleAction(true); |
640 | connect(m_aForceSmall,SIGNAL(toggled(bool)),this,SLOT(slotForceSmall(bool))); | 643 | connect(m_aForceSmall,SIGNAL(toggled(bool)),this,SLOT(slotForceSmall(bool))); |
641 | } else { | 644 | } else { |
642 | m_aForceSmall = 0; | 645 | m_aForceSmall = 0; |
643 | } | 646 | } |
644 | m_setCurrentBrightness = new QAction(tr("Display brightness..."), 0, 0, this, 0, false); | 647 | m_setCurrentBrightness = new QAction(tr("Display brightness..."), 0, 0, this, 0, false); |
645 | connect(m_setCurrentBrightness,SIGNAL(activated()),this,SLOT(setupBrightness())); | 648 | connect(m_setCurrentBrightness,SIGNAL(activated()),this,SLOT(setupBrightness())); |
649 | m_IncBrightness = new QAction(tr("Increase brightness by 5"),Resource::loadIconSet( "up" ),0, 0, this, 0, false); | ||
650 | m_DecBrightness = new QAction(tr("Decrease brightness by 5"),Resource::loadIconSet( "down" ),0, 0, this, 0, false); | ||
651 | m_hBright = new QActionGroup(this,"actioncollection",false), | ||
652 | m_hBright->insert(m_IncBrightness); | ||
653 | m_hBright->insert(m_DecBrightness); | ||
646 | } | 654 | } |
647 | 655 | ||
648 | void PMainWindow::setupBrightness() | 656 | void PMainWindow::setupBrightness() |
649 | { | 657 | { |
650 | if (!m_disp) { | 658 | if (!m_disp) { |
651 | return; | 659 | return; |
652 | } | 660 | } |
653 | int lb = m_disp->Intensity(); | 661 | int lb = m_disp->Intensity(); |
654 | if (Valuebox(0,-255,255,lb,lb)) { | 662 | if (Valuebox(0,-100,100,lb,lb)) { |
655 | m_disp->setIntensity(lb,true); | 663 | m_disp->setIntensity(lb,true); |
656 | } | 664 | } |
657 | } | 665 | } |
658 | 666 | ||
659 | void PMainWindow::setupToolbar() | 667 | void PMainWindow::setupToolbar() |
660 | { | 668 | { |
661 | toolBar = new QToolBar( this ); | 669 | toolBar = new QToolBar( this ); |
662 | addToolBar(toolBar); | 670 | addToolBar(toolBar); |
663 | toolBar->setHorizontalStretchable( true ); | 671 | toolBar->setHorizontalStretchable( true ); |
664 | setToolBarsMovable( false ); | 672 | setToolBarsMovable( false ); |
665 | m_aDirUp->addTo( toolBar ); | 673 | m_aDirUp->addTo( toolBar ); |
666 | 674 | ||
@@ -715,24 +723,28 @@ void PMainWindow::setupMenu() | |||
715 | m_aTrash->addTo(fileMenu); | 723 | m_aTrash->addTo(fileMenu); |
716 | 724 | ||
717 | listviewMenu = new QPopupMenu(dispMenu); | 725 | listviewMenu = new QPopupMenu(dispMenu); |
718 | dispMenu->insertItem(Resource::loadIconSet("opie-eye/opie-eye-thumb"),tr("Listview mode"),listviewMenu); | 726 | dispMenu->insertItem(Resource::loadIconSet("opie-eye/opie-eye-thumb"),tr("Listview mode"),listviewMenu); |
719 | m_gListViewMode->addTo(listviewMenu); | 727 | m_gListViewMode->addTo(listviewMenu); |
720 | dispMenu->insertSeparator(); | 728 | dispMenu->insertSeparator(); |
721 | m_aFullScreen->addTo(dispMenu); | 729 | m_aFullScreen->addTo(dispMenu); |
722 | m_gDisplayType->addTo(dispMenu); | 730 | m_gDisplayType->addTo(dispMenu); |
723 | dispMenu->insertSeparator(); | 731 | dispMenu->insertSeparator(); |
724 | m_gPrevNext->addTo(dispMenu); | 732 | m_gPrevNext->addTo(dispMenu); |
725 | m_setCurrentBrightness->addTo(dispMenu); | 733 | m_setCurrentBrightness->addTo(dispMenu); |
726 | m_setCurrentBrightness->setEnabled(false); | 734 | m_setCurrentBrightness->setEnabled(false); |
735 | dispMenu->insertSeparator(); | ||
736 | m_hBright->addTo(dispMenu); | ||
737 | m_hBright->setEnabled(false); | ||
738 | |||
727 | if (m_aForceSmall) { | 739 | if (m_aForceSmall) { |
728 | dispMenu->insertSeparator(); | 740 | dispMenu->insertSeparator(); |
729 | m_aForceSmall->addTo(dispMenu); | 741 | m_aForceSmall->addTo(dispMenu); |
730 | } | 742 | } |
731 | 743 | ||
732 | m_aSetup->addTo(settingsMenu); | 744 | m_aSetup->addTo(settingsMenu); |
733 | m_aHideToolbar->addTo(settingsMenu); | 745 | m_aHideToolbar->addTo(settingsMenu); |
734 | } | 746 | } |
735 | 747 | ||
736 | void PMainWindow::listviewselected(QAction*which) | 748 | void PMainWindow::listviewselected(QAction*which) |
737 | { | 749 | { |
738 | if (!which || which->isOn()==false) return; | 750 | if (!which || which->isOn()==false) return; |