Diffstat (limited to 'noncore/graphics/opie-eye/gui/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index 4ee252f..3efbb53 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -640,59 +640,68 @@ void PMainWindow::setupActions() | |||
640 | if (!m_SmallWindow) { | 640 | if (!m_SmallWindow) { |
641 | 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); |
642 | m_aForceSmall->setToggleAction(true); | 642 | m_aForceSmall->setToggleAction(true); |
643 | connect(m_aForceSmall,SIGNAL(toggled(bool)),this,SLOT(slotForceSmall(bool))); | 643 | connect(m_aForceSmall,SIGNAL(toggled(bool)),this,SLOT(slotForceSmall(bool))); |
644 | } else { | 644 | } else { |
645 | m_aForceSmall = 0; | 645 | m_aForceSmall = 0; |
646 | } | 646 | } |
647 | 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); |
648 | 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); | 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); | 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), | 651 | m_hBright = new QActionGroup(this,"actioncollection",false), |
652 | m_hBright->insert(m_setCurrentBrightness); | ||
652 | m_hBright->insert(m_IncBrightness); | 653 | m_hBright->insert(m_IncBrightness); |
653 | m_hBright->insert(m_DecBrightness); | 654 | m_hBright->insert(m_DecBrightness); |
654 | } | 655 | } |
655 | 656 | ||
656 | void PMainWindow::setupBrightness() | 657 | void PMainWindow::setupBrightness() |
657 | { | 658 | { |
658 | if (!m_disp) { | 659 | if (!m_disp) { |
659 | return; | 660 | return; |
660 | } | 661 | } |
662 | bool reshow=false; | ||
663 | if (m_disp->isVisible()&&m_disp->fullScreen()) { | ||
664 | m_disp->hide(); | ||
665 | reshow = true; | ||
666 | } | ||
661 | int lb = m_disp->Intensity(); | 667 | int lb = m_disp->Intensity(); |
662 | if (Valuebox(0,-100,100,lb,lb)) { | 668 | if (Valuebox(0,-100,100,lb,lb)) { |
663 | m_disp->setIntensity(lb,true); | 669 | m_disp->setIntensity(lb,true); |
664 | } | 670 | } |
671 | if (reshow) { | ||
672 | m_disp->showFullScreen(); | ||
673 | qwsDisplay()->requestFocus( m_disp->winId(), TRUE); | ||
674 | } | ||
665 | } | 675 | } |
666 | 676 | ||
667 | void PMainWindow::setupToolbar() | 677 | void PMainWindow::setupToolbar() |
668 | { | 678 | { |
669 | toolBar = new QToolBar( this ); | 679 | toolBar = new QToolBar( this ); |
670 | addToolBar(toolBar); | 680 | addToolBar(toolBar); |
671 | toolBar->setHorizontalStretchable( true ); | 681 | toolBar->setHorizontalStretchable( true ); |
672 | setToolBarsMovable( false ); | 682 | setToolBarsMovable( false ); |
673 | m_aDirUp->addTo( toolBar ); | 683 | m_aDirUp->addTo( toolBar ); |
674 | 684 | ||
675 | fsButton = new PFileSystem( toolBar ); | 685 | fsButton = new PFileSystem( toolBar ); |
676 | connect( fsButton, SIGNAL( changeDir( const QString& ) ), | 686 | connect( fsButton, SIGNAL( changeDir( const QString& ) ), |
677 | m_view, SLOT(slotChangeDir( const QString& ) ) ); | 687 | m_view, SLOT(slotChangeDir( const QString& ) ) ); |
678 | connect( this, SIGNAL( changeDir( const QString& ) ), | 688 | connect( this, SIGNAL( changeDir( const QString& ) ), |
679 | m_view, SLOT(slotChangeDir( const QString& ) ) ); | 689 | m_view, SLOT(slotChangeDir( const QString& ) ) ); |
680 | 690 | ||
681 | if (m_aBeam) { | 691 | if (m_aBeam) { |
682 | m_aBeam->addTo( toolBar ); | 692 | m_aBeam->addTo( toolBar ); |
683 | } | 693 | } |
684 | m_aShowInfo->addTo(toolBar); | 694 | m_aShowInfo->addTo(toolBar); |
685 | m_aTrash->addTo(toolBar); | 695 | m_aTrash->addTo(toolBar); |
686 | // m_aSetup->addTo(toolBar); | ||
687 | 696 | ||
688 | m_gDisplayType->addTo(toolBar); | 697 | m_gDisplayType->addTo(toolBar); |
689 | 698 | ||
690 | if (!m_SmallWindow) { | 699 | if (!m_SmallWindow) { |
691 | m_gPrevNext->addTo(toolBar); | 700 | m_gPrevNext->addTo(toolBar); |
692 | } else { | 701 | } else { |
693 | m_gPrevNext->setEnabled(false); | 702 | m_gPrevNext->setEnabled(false); |
694 | } | 703 | } |
695 | } | 704 | } |
696 | 705 | ||
697 | void PMainWindow::setupMenu() | 706 | void PMainWindow::setupMenu() |
698 | { | 707 | { |
@@ -721,26 +730,24 @@ void PMainWindow::setupMenu() | |||
721 | } | 730 | } |
722 | fileMenu->insertSeparator(); | 731 | fileMenu->insertSeparator(); |
723 | m_aTrash->addTo(fileMenu); | 732 | m_aTrash->addTo(fileMenu); |
724 | 733 | ||
725 | listviewMenu = new QPopupMenu(dispMenu); | 734 | listviewMenu = new QPopupMenu(dispMenu); |
726 | dispMenu->insertItem(Resource::loadIconSet("opie-eye/opie-eye-thumb"),tr("Listview mode"),listviewMenu); | 735 | dispMenu->insertItem(Resource::loadIconSet("opie-eye/opie-eye-thumb"),tr("Listview mode"),listviewMenu); |
727 | m_gListViewMode->addTo(listviewMenu); | 736 | m_gListViewMode->addTo(listviewMenu); |
728 | dispMenu->insertSeparator(); | 737 | dispMenu->insertSeparator(); |
729 | m_aFullScreen->addTo(dispMenu); | 738 | m_aFullScreen->addTo(dispMenu); |
730 | m_gDisplayType->addTo(dispMenu); | 739 | m_gDisplayType->addTo(dispMenu); |
731 | dispMenu->insertSeparator(); | 740 | dispMenu->insertSeparator(); |
732 | m_gPrevNext->addTo(dispMenu); | 741 | m_gPrevNext->addTo(dispMenu); |
733 | m_setCurrentBrightness->addTo(dispMenu); | ||
734 | m_setCurrentBrightness->setEnabled(false); | ||
735 | dispMenu->insertSeparator(); | 742 | dispMenu->insertSeparator(); |
736 | m_hBright->addTo(dispMenu); | 743 | m_hBright->addTo(dispMenu); |
737 | m_hBright->setEnabled(false); | 744 | m_hBright->setEnabled(false); |
738 | 745 | ||
739 | if (m_aForceSmall) { | 746 | if (m_aForceSmall) { |
740 | dispMenu->insertSeparator(); | 747 | dispMenu->insertSeparator(); |
741 | m_aForceSmall->addTo(dispMenu); | 748 | m_aForceSmall->addTo(dispMenu); |
742 | } | 749 | } |
743 | 750 | ||
744 | m_aSetup->addTo(settingsMenu); | 751 | m_aSetup->addTo(settingsMenu); |
745 | m_aHideToolbar->addTo(settingsMenu); | 752 | m_aHideToolbar->addTo(settingsMenu); |
746 | } | 753 | } |