-rw-r--r-- | noncore/graphics/opie-eye/gui/basesetup.cpp | 19 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/basesetup.h | 5 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 68 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.h | 5 |
4 files changed, 95 insertions, 2 deletions
diff --git a/noncore/graphics/opie-eye/gui/basesetup.cpp b/noncore/graphics/opie-eye/gui/basesetup.cpp index fdf3466..b0fefbf 100644 --- a/noncore/graphics/opie-eye/gui/basesetup.cpp +++ b/noncore/graphics/opie-eye/gui/basesetup.cpp | |||
@@ -16,2 +16,3 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n | |||
16 | m_IconsizeLayout = new QGridLayout( 0, 1, 1, 0, 6, "m_IconsizeLayout"); | 16 | m_IconsizeLayout = new QGridLayout( 0, 1, 1, 0, 6, "m_IconsizeLayout"); |
17 | m_IntensityLayout = new QGridLayout( 0, 1, 1, 0, 6, "m_IntensityLayout"); | ||
17 | 18 | ||
@@ -35,3 +36,3 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n | |||
35 | m_Iconsize->setButtonSymbols( QSpinBox::PlusMinus ); | 36 | m_Iconsize->setButtonSymbols( QSpinBox::PlusMinus ); |
36 | m_Iconsize->setMaxValue( 64 ); | 37 | m_Iconsize->setMaxValue( 128 ); |
37 | m_Iconsize->setMinValue(12); | 38 | m_Iconsize->setMinValue(12); |
@@ -45,2 +46,13 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n | |||
45 | 46 | ||
47 | m_Intensity = new QSpinBox( this, "m_Intensity" ); | ||
48 | m_Intensity->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed)); | ||
49 | m_Intensity->setButtonSymbols( QSpinBox::PlusMinus ); | ||
50 | m_Intensity->setMaxValue( 255 ); | ||
51 | m_Intensity->setMinValue(-255); | ||
52 | m_Intensity->setValue( 0 ); | ||
53 | m_IntensityLayout->addWidget( m_Intensity, 0, 1 ); | ||
54 | m_IntensityLabel = new QLabel( this, "m_IntensityLabel" ); | ||
55 | m_IntensityLabel->setText(tr("Default display brightness:")); | ||
56 | m_IntensityLayout->addWidget(m_IntensityLabel, 0, 0 ); | ||
57 | m_MainLayout->addLayout(m_IntensityLayout); | ||
46 | 58 | ||
@@ -67,2 +79,6 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n | |||
67 | m_Iconsize->setValue(stime); | 79 | m_Iconsize->setValue(stime); |
80 | stime = m_cfg->readNumEntry("intensity",0); | ||
81 | if (stime<-255) stime = -255; | ||
82 | if (stime>255) stime = 255; | ||
83 | m_Intensity->setValue(stime); | ||
68 | } | 84 | } |
@@ -79,2 +95,3 @@ void BaseSetup::save_values() | |||
79 | m_cfg->writeEntry("iconsize",m_Iconsize->value()); | 95 | m_cfg->writeEntry("iconsize",m_Iconsize->value()); |
96 | m_cfg->writeEntry("intensity",m_Intensity->value()); | ||
80 | } | 97 | } |
diff --git a/noncore/graphics/opie-eye/gui/basesetup.h b/noncore/graphics/opie-eye/gui/basesetup.h index 95929f2..cda6777 100644 --- a/noncore/graphics/opie-eye/gui/basesetup.h +++ b/noncore/graphics/opie-eye/gui/basesetup.h | |||
@@ -35,2 +35,7 @@ protected: | |||
35 | QLabel * m_IconsizeLabel; | 35 | QLabel * m_IconsizeLabel; |
36 | |||
37 | QGridLayout * m_IntensityLayout; | ||
38 | QSpinBox * m_Intensity; | ||
39 | QLabel * m_IntensityLabel; | ||
40 | |||
36 | }; | 41 | }; |
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.cpp b/noncore/graphics/opie-eye/gui/mainwindow.cpp index e532867..3a89dfd 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.cpp +++ b/noncore/graphics/opie-eye/gui/mainwindow.cpp | |||
@@ -21,2 +21,4 @@ | |||
21 | #include <opie2/okeyconfigwidget.h> | 21 | #include <opie2/okeyconfigwidget.h> |
22 | #include <opie2/owait.h> | ||
23 | #include <opie2/oapplication.h> | ||
22 | 24 | ||
@@ -37,2 +39,3 @@ | |||
37 | #include <qaction.h> | 39 | #include <qaction.h> |
40 | #include <qspinbox.h> | ||
38 | 41 | ||
@@ -228,2 +231,5 @@ void PMainWindow::slotConfig() { | |||
228 | } | 231 | } |
232 | if (m_disp) { | ||
233 | m_disp->setIntensity(m_Intensity,true); | ||
234 | } | ||
229 | } | 235 | } |
@@ -371,2 +377,11 @@ void PMainWindow::slotDisplay( const QString& inf ) { | |||
371 | bool nwindow = false; | 377 | bool nwindow = false; |
378 | bool disp_hack = false; | ||
379 | int lb; | ||
380 | if (m_disp && m_disp->fullScreen()) { | ||
381 | lb = m_disp->Intensity(); | ||
382 | delete m_disp; | ||
383 | m_disp = 0; | ||
384 | |||
385 | disp_hack = true; | ||
386 | } | ||
372 | if ( !m_disp ) { | 387 | if ( !m_disp ) { |
@@ -374,4 +389,13 @@ void PMainWindow::slotDisplay( const QString& inf ) { | |||
374 | initDisp(); | 389 | initDisp(); |
390 | m_disp->setIntensity((disp_hack?lb:m_Intensity)); | ||
375 | } | 391 | } |
392 | m_setCurrentBrightness->setEnabled(true); | ||
393 | |||
394 | Opie::Ui::OWait wdlg; | ||
395 | wdlg.setTimerLength(30); | ||
396 | wdlg.show(); | ||
397 | //qApp->processEvents(20); | ||
376 | m_disp->setImage( inf ); | 398 | m_disp->setImage( inf ); |
399 | wdlg.hide(); | ||
400 | //qApp->processEvents(20); | ||
377 | if (m_SmallWindow) { | 401 | if (m_SmallWindow) { |
@@ -632,2 +656,15 @@ void PMainWindow::setupActions() | |||
632 | } | 656 | } |
657 | m_setCurrentBrightness = new QAction(tr("Display brightness..."), 0, 0, this, 0, false); | ||
658 | connect(m_setCurrentBrightness,SIGNAL(activated()),this,SLOT(setupBrightness())); | ||
659 | } | ||
660 | |||
661 | void PMainWindow::setupBrightness() | ||
662 | { | ||
663 | if (!m_disp) { | ||
664 | return; | ||
665 | } | ||
666 | int lb = m_disp->Intensity(); | ||
667 | if (Valuebox(0,-255,255,lb,lb)) { | ||
668 | m_disp->setIntensity(lb,true); | ||
669 | } | ||
633 | } | 670 | } |
@@ -700,2 +737,4 @@ void PMainWindow::setupMenu() | |||
700 | m_gPrevNext->addTo(dispMenu); | 737 | m_gPrevNext->addTo(dispMenu); |
738 | m_setCurrentBrightness->addTo(dispMenu); | ||
739 | m_setCurrentBrightness->setEnabled(false); | ||
701 | if (m_aForceSmall) { | 740 | if (m_aForceSmall) { |
@@ -727,2 +766,3 @@ void PMainWindow::readConfig() | |||
727 | autoSave =m_cfg->readBoolEntry("savestatus",true); | 766 | autoSave =m_cfg->readBoolEntry("savestatus",true); |
767 | m_Intensity = m_cfg->readNumEntry("intensity",0); | ||
728 | } | 768 | } |
@@ -766 +806,29 @@ void PMainWindow::slotForceSmall(bool how) | |||
766 | } | 806 | } |
807 | |||
808 | bool PMainWindow::Valuebox(QWidget*parent,int min, int max, int current,int&store) | ||
809 | { | ||
810 | QDialog dlg(parent,"brightnessbox",true); | ||
811 | QVBoxLayout * m_MainLayout; | ||
812 | QGridLayout * m_IntensityLayout; | ||
813 | QSpinBox * m_Intensity; | ||
814 | QLabel * m_IntensityLabel; | ||
815 | |||
816 | m_MainLayout = new QVBoxLayout( &dlg, 11, 6, "m_MainLayout"); | ||
817 | m_IntensityLayout = new QGridLayout( 0, 1, 1, 0, 6, "m_IntensityLayout"); | ||
818 | m_Intensity = new QSpinBox( &dlg, "m_Intensity" ); | ||
819 | m_Intensity->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed)); | ||
820 | m_Intensity->setButtonSymbols( QSpinBox::PlusMinus ); | ||
821 | m_Intensity->setMaxValue( max ); | ||
822 | m_Intensity->setMinValue(min); | ||
823 | m_Intensity->setValue( current ); | ||
824 | m_IntensityLayout->addWidget( m_Intensity, 0, 1 ); | ||
825 | m_IntensityLabel = new QLabel( &dlg, "m_IntensityLabel" ); | ||
826 | m_IntensityLabel->setText(QObject::tr("Display brightness:")); | ||
827 | m_IntensityLayout->addWidget(m_IntensityLabel, 0, 0 ); | ||
828 | m_MainLayout->addLayout(m_IntensityLayout); | ||
829 | if (dlg.exec()) { | ||
830 | store = m_Intensity->value(); | ||
831 | return true; | ||
832 | } | ||
833 | return false; | ||
834 | } | ||
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h index a49a9d3..62b446b 100644 --- a/noncore/graphics/opie-eye/gui/mainwindow.h +++ b/noncore/graphics/opie-eye/gui/mainwindow.h | |||
@@ -69,2 +69,3 @@ protected slots: | |||
69 | void check_view_fullscreen(); | 69 | void check_view_fullscreen(); |
70 | virtual void setupBrightness(); | ||
70 | 71 | ||
@@ -86,2 +87,3 @@ private: | |||
86 | bool m_SmallWindow:1; | 87 | bool m_SmallWindow:1; |
88 | int m_Intensity; | ||
87 | QToolButton*fsButton; | 89 | QToolButton*fsButton; |
@@ -93,3 +95,3 @@ private: | |||
93 | QAction *m_aNext,*m_aPrevious,*m_aFullScreen; | 95 | QAction *m_aNext,*m_aPrevious,*m_aFullScreen; |
94 | QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer,*m_aForceSmall; | 96 | QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer,*m_aForceSmall,*m_setCurrentBrightness; |
95 | 97 | ||
@@ -103,2 +105,3 @@ private: | |||
103 | QMap<QString, QString> m_dev; | 105 | QMap<QString, QString> m_dev; |
106 | static bool Valuebox(QWidget*parent,int min, int max, int current,int&store); | ||
104 | 107 | ||