summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/basesetup.cpp11
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.cpp22
-rw-r--r--noncore/graphics/opie-eye/gui/iconview.h4
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.cpp37
-rw-r--r--noncore/graphics/opie-eye/gui/imageview.h12
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp16
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.h3
7 files changed, 84 insertions, 21 deletions
diff --git a/noncore/graphics/opie-eye/gui/basesetup.cpp b/noncore/graphics/opie-eye/gui/basesetup.cpp
index b0fefbf..fe51321 100644
--- a/noncore/graphics/opie-eye/gui/basesetup.cpp
+++ b/noncore/graphics/opie-eye/gui/basesetup.cpp
@@ -48,6 +48,6 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
48 m_Intensity->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed)); 48 m_Intensity->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed));
49 m_Intensity->setButtonSymbols( QSpinBox::PlusMinus ); 49 m_Intensity->setButtonSymbols( QSpinBox::PlusMinus );
50 m_Intensity->setMaxValue( 255 ); 50 m_Intensity->setMaxValue( 100 );
51 m_Intensity->setMinValue(-255); 51 m_Intensity->setMinValue(-100);
52 m_Intensity->setValue( 0 ); 52 m_Intensity->setValue( 0 );
53 m_IntensityLayout->addWidget( m_Intensity, 0, 1 ); 53 m_IntensityLayout->addWidget( m_Intensity, 0, 1 );
@@ -75,10 +75,11 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
75 m_SaveStateAuto->setChecked(m_cfg->readBoolEntry("savestatus",true)); 75 m_SaveStateAuto->setChecked(m_cfg->readBoolEntry("savestatus",true));
76 stime = m_cfg->readNumEntry("iconsize", 32); 76 stime = m_cfg->readNumEntry("iconsize", 32);
77 /* must equal to s(MAX/MIN_ICONSIZE) in iconview.cpp! */
77 if (stime<12)stime = 12; 78 if (stime<12)stime = 12;
78 if (stime>64)stime = 64; 79 if (stime>128)stime = 128;
79 m_Iconsize->setValue(stime); 80 m_Iconsize->setValue(stime);
80 stime = m_cfg->readNumEntry("intensity",0); 81 stime = m_cfg->readNumEntry("intensity",0);
81 if (stime<-255) stime = -255; 82 if (stime<-100) stime = -100;
82 if (stime>255) stime = 255; 83 if (stime>100) stime = 100;
83 m_Intensity->setValue(stime); 84 m_Intensity->setValue(stime);
84} 85}
diff --git a/noncore/graphics/opie-eye/gui/iconview.cpp b/noncore/graphics/opie-eye/gui/iconview.cpp
index b2443e8..59091a8 100644
--- a/noncore/graphics/opie-eye/gui/iconview.cpp
+++ b/noncore/graphics/opie-eye/gui/iconview.cpp
@@ -37,4 +37,8 @@
37using Opie::Core::OKeyConfigItem; 37using Opie::Core::OKeyConfigItem;
38 38
39const int PIconView::sMAX_ICON_SIZE = 128;
40const int PIconView::sMIN_ICON_SIZE = 12;
41const int PIconView::sDEF_ICON_SIZE = 64;
42
39/* 43/*
40 * The Icons, Request Cache and IconViewItem for the IconView 44 * The Icons, Request Cache and IconViewItem for the IconView
@@ -223,6 +227,6 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
223 } 227 }
224 m_iconsize = m_cfg->readNumEntry("iconsize", 32); 228 m_iconsize = m_cfg->readNumEntry("iconsize", 32);
225 if (m_iconsize<12)m_iconsize = 12; 229 if (m_iconsize<sMIN_ICON_SIZE)m_iconsize = sMIN_ICON_SIZE;
226 if (m_iconsize>64)m_iconsize = 64; 230 if (m_iconsize>sMAX_ICON_SIZE)m_iconsize = sMAX_ICON_SIZE;
227 231
228 calculateGrid(); 232 calculateGrid();
@@ -409,6 +413,6 @@ void PIconView::resetView() {
409 int osize = m_iconsize; 413 int osize = m_iconsize;
410 m_iconsize = m_cfg->readNumEntry("iconsize", 32); 414 m_iconsize = m_cfg->readNumEntry("iconsize", 32);
411 if (m_iconsize<12)m_iconsize = 12; 415 if (m_iconsize<sMIN_ICON_SIZE)m_iconsize = sMIN_ICON_SIZE;
412 if (m_iconsize>64)m_iconsize = 64; 416 if (m_iconsize>sMAX_ICON_SIZE)m_iconsize = sMAX_ICON_SIZE;
413 if (osize != m_iconsize) { 417 if (osize != m_iconsize) {
414 if (_dirPix){ 418 if (_dirPix){
@@ -423,5 +427,5 @@ void PIconView::resetView() {
423 } 427 }
424 } else { 428 } else {
425 m_iconsize = 64; 429 m_iconsize = sDEF_ICON_SIZE;
426 } 430 }
427 slotViewChanged(m_views->currentItem()); 431 slotViewChanged(m_views->currentItem());
@@ -834,9 +838,9 @@ void PIconView::slotChangeMode( int mode ) {
834 } 838 }
835 if (m_mode==1) { 839 if (m_mode==1) {
836 m_iconsize = 64; 840 m_iconsize = sDEF_ICON_SIZE;
837 } else { 841 } else {
838 m_iconsize = m_cfg->readNumEntry("iconsize", 32); 842 m_iconsize = m_cfg->readNumEntry("iconsize", 32);
839 if (m_iconsize<12)m_iconsize = 12; 843 if (m_iconsize<sMIN_ICON_SIZE)m_iconsize = sMIN_ICON_SIZE;
840 if (m_iconsize>64)m_iconsize = 64; 844 if (m_iconsize>sMAX_ICON_SIZE)m_iconsize = sMAX_ICON_SIZE;
841 } 845 }
842 if (_dirPix){ 846 if (_dirPix){
@@ -889,5 +893,5 @@ void PIconView::calculateGrid(QResizeEvent* re)
889 m_view->setGridX(m_iconsize); 893 m_view->setGridX(m_iconsize);
890 m_view->setGridY(-1); 894 m_view->setGridY(-1);
891 cache = (int)((double)64/(double)m_iconsize*40.0); 895 cache = (int)((double)sDEF_ICON_SIZE/(double)m_iconsize*80.0);
892 odebug << "cache size: " << cache << oendl; 896 odebug << "cache size: " << cache << oendl;
893 PPixmapCache::self()->setMaxImages(cache); 897 PPixmapCache::self()->setMaxImages(cache);
diff --git a/noncore/graphics/opie-eye/gui/iconview.h b/noncore/graphics/opie-eye/gui/iconview.h
index 6e08fd8..a546b88 100644
--- a/noncore/graphics/opie-eye/gui/iconview.h
+++ b/noncore/graphics/opie-eye/gui/iconview.h
@@ -38,4 +38,8 @@ public:
38 void setDoccalled(bool); 38 void setDoccalled(bool);
39 39
40 static const int sMAX_ICON_SIZE;
41 static const int sMIN_ICON_SIZE;
42 static const int sDEF_ICON_SIZE;
43
40signals: 44signals:
41 void sig_showInfo( const QString& ); 45 void sig_showInfo( const QString& );
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp
index 6c3f9cb..994fe12 100644
--- a/noncore/graphics/opie-eye/gui/imageview.cpp
+++ b/noncore/graphics/opie-eye/gui/imageview.cpp
@@ -30,4 +30,5 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name
30 m_gPrevNext = 0; 30 m_gPrevNext = 0;
31 m_hGroup = 0; 31 m_hGroup = 0;
32 m_gBright = 0;
32 m_Rotated = false; 33 m_Rotated = false;
33 closeIfHide = false; 34 closeIfHide = false;
@@ -40,4 +41,7 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name
40 setMinimumSize(10,10); 41 setMinimumSize(10,10);
41 } 42 }
43 connect(this,SIGNAL(incBrightness()),this,SLOT(slotIncBrightness()));
44 connect(this,SIGNAL(decBrightness()),this,SLOT(slotDecBrightness()));
45
42 m_sysChannel = new QCopChannel( "QPE/System", this ); 46 m_sysChannel = new QCopChannel( "QPE/System", this );
43 connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ), 47 connect( m_sysChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
@@ -45,4 +49,18 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name
45} 49}
46 50
51void ImageView::slotIncBrightness()
52{
53 int lb = Intensity()+5;
54 if (lb>100) lb=100;
55 setIntensity(lb,true);
56}
57
58void ImageView::slotDecBrightness()
59{
60 int lb = Intensity()-5;
61 if (lb<-100) lb=-100;
62 setIntensity(lb,true);
63}
64
47void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) 65void ImageView::systemMessage( const QCString& msg, const QByteArray& data )
48{ 66{
@@ -61,9 +79,10 @@ void ImageView::systemMessage( const QCString& msg, const QByteArray& data )
61} 79}
62 80
63void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup) 81void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup,QActionGroup*brightGroup)
64{ 82{
65 m_gDisplayType = disptypeGroup; 83 m_gDisplayType = disptypeGroup;
66 m_gPrevNext = nextprevGroup; 84 m_gPrevNext = nextprevGroup;
67 m_hGroup = hGroup; 85 m_hGroup = hGroup;
86 m_gBright = brightGroup;
68} 87}
69 88
@@ -175,4 +194,13 @@ void ImageView::initKeys()
175 Opie::Core::OKeyPair(Qt::Key_T,0), 194 Opie::Core::OKeyPair(Qt::Key_T,0),
176 this, SIGNAL(toggleZoomer()))); 195 this, SIGNAL(toggleZoomer())));
196
197 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Increase brightness"), "incbrightness",
198 Resource::loadPixmap("up"), Incbrightness,
199 Opie::Core::OKeyPair(Qt::Key_B,0),
200 this, SIGNAL(incBrightness())));
201 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Decrease brightness"), "decbrightness",
202 Resource::loadPixmap("down"), Decbrightness,
203 Opie::Core::OKeyPair(Qt::Key_D,0),
204 this, SIGNAL(decBrightness())));
177 m_viewManager->handleWidget( this ); 205 m_viewManager->handleWidget( this );
178 m_viewManager->load(); 206 m_viewManager->load();
@@ -224,4 +252,8 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e)
224 m_gDisplayType->addTo(m); 252 m_gDisplayType->addTo(m);
225 } 253 }
254 if (m_gBright) {
255 m->insertSeparator();
256 m_gBright->addTo(m);
257 }
226 } 258 }
227 m->setFocus(); 259 m->setFocus();
@@ -236,4 +268,7 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e)
236 m_gDisplayType->removeFrom(m); 268 m_gDisplayType->removeFrom(m);
237 } 269 }
270 if (m_gBright) {
271 m_gBright->removeFrom(m);
272 }
238 delete m; 273 delete m;
239} 274}
diff --git a/noncore/graphics/opie-eye/gui/imageview.h b/noncore/graphics/opie-eye/gui/imageview.h
index e8c8df7..b5801a6 100644
--- a/noncore/graphics/opie-eye/gui/imageview.h
+++ b/noncore/graphics/opie-eye/gui/imageview.h
@@ -30,5 +30,7 @@ class ImageView:public Opie::MM::OImageScrollView
30 Zoomer, 30 Zoomer,
31 Autorotate, 31 Autorotate,
32 Autoscale 32 Autoscale,
33 Incbrightness,
34 Decbrightness
33 }; 35 };
34 36
@@ -41,5 +43,5 @@ public:
41 virtual void enableFullscreen(); 43 virtual void enableFullscreen();
42 void stopSlide(); 44 void stopSlide();
43 void setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup); 45 void setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup,QActionGroup*brightGroup);
44 void setCloseIfHide(bool); 46 void setCloseIfHide(bool);
45 47
@@ -53,4 +55,6 @@ signals:
53 void toggleAutoscale(); 55 void toggleAutoscale();
54 void toggleAutorotate(); 56 void toggleAutorotate();
57 void incBrightness();
58 void decBrightness();
55 59
56protected: 60protected:
@@ -66,5 +70,5 @@ protected:
66 int m_slideValue; 70 int m_slideValue;
67 virtual void focusInEvent ( QFocusEvent * ); 71 virtual void focusInEvent ( QFocusEvent * );
68 QActionGroup *m_gDisplayType,*m_gPrevNext,*m_hGroup; 72 QActionGroup *m_gDisplayType,*m_gPrevNext,*m_hGroup,*m_gBright;
69 bool closeIfHide:1; 73 bool closeIfHide:1;
70 QCopChannel* m_sysChannel; 74 QCopChannel* m_sysChannel;
@@ -76,4 +80,6 @@ public slots:
76 virtual void nextSlide(); 80 virtual void nextSlide();
77 virtual void systemMessage( const QCString&, const QByteArray& ); 81 virtual void systemMessage( const QCString&, const QByteArray& );
82 virtual void slotIncBrightness();
83 virtual void slotDecBrightness();
78 84
79protected slots: 85protected slots:
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
@@ -266,5 +266,5 @@ void PMainWindow::initDisp() {
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());
@@ -280,4 +280,6 @@ void PMainWindow::initDisp() {
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 }
@@ -381,4 +383,5 @@ void PMainWindow::slotDisplay( const QString& inf ) {
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 );
@@ -644,4 +647,9 @@ void PMainWindow::setupActions()
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
@@ -652,5 +660,5 @@ void PMainWindow::setupBrightness()
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 }
@@ -725,4 +733,8 @@ void PMainWindow::setupMenu()
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();
diff --git a/noncore/graphics/opie-eye/gui/mainwindow.h b/noncore/graphics/opie-eye/gui/mainwindow.h
index 62b446b..c3b51f6 100644
--- a/noncore/graphics/opie-eye/gui/mainwindow.h
+++ b/noncore/graphics/opie-eye/gui/mainwindow.h
@@ -92,7 +92,8 @@ private:
92 QAction*m_aShowInfo,*m_aBeam,*m_aTrash,*m_aViewfile,*m_aDirUp,*m_aStartSlide; 92 QAction*m_aShowInfo,*m_aBeam,*m_aTrash,*m_aViewfile,*m_aDirUp,*m_aStartSlide;
93 QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong; 93 QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong;
94 QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup; 94 QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup,*m_hBright;
95 QAction *m_aNext,*m_aPrevious,*m_aFullScreen; 95 QAction *m_aNext,*m_aPrevious,*m_aFullScreen;
96 QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer,*m_aForceSmall,*m_setCurrentBrightness; 96 QAction *m_aAutoRotate,*m_aUnscaled,*m_aZoomer,*m_aForceSmall,*m_setCurrentBrightness;
97 QAction *m_IncBrightness,*m_DecBrightness;
97 98
98 /* init funs */ 99 /* init funs */