summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/opie-eye/gui/basesetup.cpp19
-rw-r--r--noncore/graphics/opie-eye/gui/basesetup.h5
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.cpp68
-rw-r--r--noncore/graphics/opie-eye/gui/mainwindow.h5
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
@@ -11,12 +11,13 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
11 setFrameStyle(Box|Raised); 11 setFrameStyle(Box|Raised);
12 m_cfg = a_cfg; 12 m_cfg = a_cfg;
13 m_MainLayout = new QVBoxLayout( this, 11, 6, "m_MainLayout"); 13 m_MainLayout = new QVBoxLayout( this, 11, 6, "m_MainLayout");
14 14
15 m_SlidetimeLayout = new QGridLayout( 0, 1, 1, 0, 6, "m_SlidetimeLayout"); 15 m_SlidetimeLayout = new QGridLayout( 0, 1, 1, 0, 6, "m_SlidetimeLayout");
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
18 m_SlideShowTime = new QSpinBox( this, "m_SlideShowTime" ); 19 m_SlideShowTime = new QSpinBox( this, "m_SlideShowTime" );
19 m_SlideShowTime->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed)); 20 m_SlideShowTime->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed));
20 m_SlideShowTime->setButtonSymbols( QSpinBox::PlusMinus ); 21 m_SlideShowTime->setButtonSymbols( QSpinBox::PlusMinus );
21 m_SlideShowTime->setMaxValue( 60 ); 22 m_SlideShowTime->setMaxValue( 60 );
22 m_SlideShowTime->setMinValue(0); 23 m_SlideShowTime->setMinValue(0);
@@ -30,22 +31,33 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
30 m_SlidetimeLayout->addWidget( m_SlidetimeLabel, 0, 0 ); 31 m_SlidetimeLayout->addWidget( m_SlidetimeLabel, 0, 0 );
31 m_MainLayout->addLayout( m_SlidetimeLayout ); 32 m_MainLayout->addLayout( m_SlidetimeLayout );
32 33
33 m_Iconsize = new QSpinBox( this, "m_Iconsize" ); 34 m_Iconsize = new QSpinBox( this, "m_Iconsize" );
34 m_Iconsize->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed)); 35 m_Iconsize->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed));
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);
38 m_Iconsize->setValue( 32 ); 39 m_Iconsize->setValue( 32 );
39 m_Iconsize->setSuffix(tr(" pixel")); 40 m_Iconsize->setSuffix(tr(" pixel"));
40 m_IconsizeLayout->addWidget( m_Iconsize, 0, 1 ); 41 m_IconsizeLayout->addWidget( m_Iconsize, 0, 1 );
41 m_IconsizeLabel = new QLabel( this, "m_IconsizeLabel" ); 42 m_IconsizeLabel = new QLabel( this, "m_IconsizeLabel" );
42 m_IconsizeLabel->setText(tr("Size of thumbnails:")); 43 m_IconsizeLabel->setText(tr("Size of thumbnails:"));
43 m_IconsizeLayout->addWidget( m_IconsizeLabel, 0, 0 ); 44 m_IconsizeLayout->addWidget( m_IconsizeLabel, 0, 0 );
44 m_MainLayout->addLayout(m_IconsizeLayout); 45 m_MainLayout->addLayout(m_IconsizeLayout);
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
47#if 0 59#if 0
48 m_ShowToolBar = new QCheckBox( this, "m_ShowToolBar" ); 60 m_ShowToolBar = new QCheckBox( this, "m_ShowToolBar" );
49 m_ShowToolBar->setText(tr("Show toolbar on startup")); 61 m_ShowToolBar->setText(tr("Show toolbar on startup"));
50 m_MainLayout->addWidget( m_ShowToolBar ); 62 m_MainLayout->addWidget( m_ShowToolBar );
51#endif 63#endif
@@ -62,19 +74,24 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
62 m_SlideShowTime->setValue(stime); 74 m_SlideShowTime->setValue(stime);
63 m_SaveStateAuto->setChecked(m_cfg->readBoolEntry("savestatus",true)); 75 m_SaveStateAuto->setChecked(m_cfg->readBoolEntry("savestatus",true));
64 stime = m_cfg->readNumEntry("iconsize", 32); 76 stime = m_cfg->readNumEntry("iconsize", 32);
65 if (stime<12)stime = 12; 77 if (stime<12)stime = 12;
66 if (stime>64)stime = 64; 78 if (stime>64)stime = 64;
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}
69 85
70BaseSetup::~BaseSetup() 86BaseSetup::~BaseSetup()
71{ 87{
72} 88}
73 89
74void BaseSetup::save_values() 90void BaseSetup::save_values()
75{ 91{
76 if (!m_cfg) return; 92 if (!m_cfg) return;
77 m_cfg->writeEntry("slideshowtimeout",m_SlideShowTime->value()); 93 m_cfg->writeEntry("slideshowtimeout",m_SlideShowTime->value());
78 m_cfg->writeEntry("savestatus",m_SaveStateAuto->isChecked()); 94 m_cfg->writeEntry("savestatus",m_SaveStateAuto->isChecked());
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
@@ -30,9 +30,14 @@ protected:
30 QLabel * m_SlidetimeLabel; 30 QLabel * m_SlidetimeLabel;
31 QCheckBox *m_SaveStateAuto; 31 QCheckBox *m_SaveStateAuto;
32 QSpacerItem *spacer1; 32 QSpacerItem *spacer1;
33 QGridLayout * m_IconsizeLayout; 33 QGridLayout * m_IconsizeLayout;
34 QSpinBox * m_Iconsize; 34 QSpinBox * m_Iconsize;
35 QLabel * m_IconsizeLabel; 35 QLabel * m_IconsizeLabel;
36
37 QGridLayout * m_IntensityLayout;
38 QSpinBox * m_Intensity;
39 QLabel * m_IntensityLabel;
40
36}; 41};
37 42
38#endif 43#endif
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
@@ -16,12 +16,14 @@
16 16
17#include <opie2/odebug.h> 17#include <opie2/odebug.h>
18#include <opie2/owidgetstack.h> 18#include <opie2/owidgetstack.h>
19#include <opie2/oapplicationfactory.h> 19#include <opie2/oapplicationfactory.h>
20#include <opie2/otabwidget.h> 20#include <opie2/otabwidget.h>
21#include <opie2/okeyconfigwidget.h> 21#include <opie2/okeyconfigwidget.h>
22#include <opie2/owait.h>
23#include <opie2/oapplication.h>
22 24
23#include <qpe/resource.h> 25#include <qpe/resource.h>
24#include <qpe/config.h> 26#include <qpe/config.h>
25#include <qpe/ir.h> 27#include <qpe/ir.h>
26#include <qpe/storage.h> 28#include <qpe/storage.h>
27#include <qpe/applnk.h> 29#include <qpe/applnk.h>
@@ -32,12 +34,13 @@
32#include <qdialog.h> 34#include <qdialog.h>
33#include <qmap.h> 35#include <qmap.h>
34#include <qtimer.h> 36#include <qtimer.h>
35#include <qframe.h> 37#include <qframe.h>
36#include <qmenubar.h> 38#include <qmenubar.h>
37#include <qaction.h> 39#include <qaction.h>
40#include <qspinbox.h>
38 41
39//OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" ) 42//OPIE_EXPORT_APP_V2( Opie::Core::OApplicationFactory<PMainWindow>,"Opie Eye" )
40OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>) 43OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<PMainWindow>)
41 44
42PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style) 45PMainWindow::PMainWindow(QWidget* wid, const char* name, WFlags style)
43 : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 ) 46 : QMainWindow( wid, name, style ), m_info( 0 ), m_disp( 0 )
@@ -223,12 +226,15 @@ void PMainWindow::slotConfig() {
223 if (remdisp) { 226 if (remdisp) {
224 m_disp->hide(); 227 m_disp->hide();
225 } 228 }
226 if (reminfo) { 229 if (reminfo) {
227 m_info->hide(); 230 m_info->hide();
228 } 231 }
232 if (m_disp) {
233 m_disp->setIntensity(m_Intensity,true);
234 }
229} 235}
230 236
231/* 237/*
232 * create a new image info component 238 * create a new image info component
233 * and detach the current one 239 * and detach the current one
234 * we will make the other delete on exit 240 * we will make the other delete on exit
@@ -366,17 +372,35 @@ void PMainWindow::slotShowInfo( const QString& inf ) {
366 m_aStartSlide->setEnabled(false); 372 m_aStartSlide->setEnabled(false);
367 m_stack->raiseWidget( ImageInfo ); 373 m_stack->raiseWidget( ImageInfo );
368} 374}
369 375
370void PMainWindow::slotDisplay( const QString& inf ) { 376void 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 ) {
373 nwindow = true; 388 nwindow = true;
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) {
378 if (m_gPrevNext->isEnabled()==false) { 402 if (m_gPrevNext->isEnabled()==false) {
379 m_gPrevNext->addTo(toolBar); 403 m_gPrevNext->addTo(toolBar);
380 fsButton->hide(); 404 fsButton->hide();
381 } 405 }
382 } 406 }
@@ -627,12 +651,25 @@ void PMainWindow::setupActions()
627 m_aForceSmall = new QAction(tr("Dont show seperate windows"),Resource::loadIconSet( "AppsIcon" ), 0, 0, this, 0, true); 651 m_aForceSmall = new QAction(tr("Dont show seperate windows"),Resource::loadIconSet( "AppsIcon" ), 0, 0, this, 0, true);
628 m_aForceSmall->setToggleAction(true); 652 m_aForceSmall->setToggleAction(true);
629 connect(m_aForceSmall,SIGNAL(toggled(bool)),this,SLOT(slotForceSmall(bool))); 653 connect(m_aForceSmall,SIGNAL(toggled(bool)),this,SLOT(slotForceSmall(bool)));
630 } else { 654 } else {
631 m_aForceSmall = 0; 655 m_aForceSmall = 0;
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
661void 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}
634 671
635void PMainWindow::setupToolbar() 672void PMainWindow::setupToolbar()
636{ 673{
637 toolBar = new QToolBar( this ); 674 toolBar = new QToolBar( this );
638 addToolBar(toolBar); 675 addToolBar(toolBar);
@@ -695,12 +732,14 @@ void PMainWindow::setupMenu()
695 m_gListViewMode->addTo(listviewMenu); 732 m_gListViewMode->addTo(listviewMenu);
696 dispMenu->insertSeparator(); 733 dispMenu->insertSeparator();
697 m_aFullScreen->addTo(dispMenu); 734 m_aFullScreen->addTo(dispMenu);
698 m_gDisplayType->addTo(dispMenu); 735 m_gDisplayType->addTo(dispMenu);
699 dispMenu->insertSeparator(); 736 dispMenu->insertSeparator();
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) {
702 dispMenu->insertSeparator(); 741 dispMenu->insertSeparator();
703 m_aForceSmall->addTo(dispMenu); 742 m_aForceSmall->addTo(dispMenu);
704 } 743 }
705 744
706 m_aSetup->addTo(settingsMenu); 745 m_aSetup->addTo(settingsMenu);
@@ -722,12 +761,13 @@ void PMainWindow::listviewselected(QAction*which)
722 emit changeListMode(val); 761 emit changeListMode(val);
723} 762}
724 763
725void PMainWindow::readConfig() 764void PMainWindow::readConfig()
726{ 765{
727 autoSave =m_cfg->readBoolEntry("savestatus",true); 766 autoSave =m_cfg->readBoolEntry("savestatus",true);
767 m_Intensity = m_cfg->readNumEntry("intensity",0);
728} 768}
729 769
730void PMainWindow::polish() 770void PMainWindow::polish()
731{ 771{
732 if (m_disp) { 772 if (m_disp) {
733 odebug << "======================\n" 773 odebug << "======================\n"
@@ -761,6 +801,34 @@ void PMainWindow::slotForceSmall(bool how)
761 } 801 }
762 } 802 }
763 if (autoSave) { 803 if (autoSave) {
764 m_cfg->writeEntry("dontshowseperate",how); 804 m_cfg->writeEntry("dontshowseperate",how);
765 } 805 }
766} 806}
807
808bool 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
@@ -64,12 +64,13 @@ protected slots:
64 void raiseIconView(); 64 void raiseIconView();
65 void closeEvent( QCloseEvent* ); 65 void closeEvent( QCloseEvent* );
66 void showToolbar(bool); 66 void showToolbar(bool);
67 void listviewselected(QAction*); 67 void listviewselected(QAction*);
68 void slotFullScreenButton(bool); 68 void slotFullScreenButton(bool);
69 void check_view_fullscreen(); 69 void check_view_fullscreen();
70 virtual void setupBrightness();
70 71
71private: 72private:
72 template<class T> void initT( const char* name, T**, int ); 73 template<class T> void initT( const char* name, T**, int );
73 void initInfo(); 74 void initInfo();
74 void initDisp(); 75 void initDisp();
75 void setupViewWindow(bool full, bool forceDisplay); 76 void setupViewWindow(bool full, bool forceDisplay);
@@ -81,29 +82,31 @@ private:
81 imageinfo *m_info; 82 imageinfo *m_info;
82 ImageView *m_disp; 83 ImageView *m_disp;
83 bool autoSave:1; 84 bool autoSave:1;
84 bool m_setDocCalled:1; 85 bool m_setDocCalled:1;
85 bool m_polishDone:1; 86 bool m_polishDone:1;
86 bool m_SmallWindow:1; 87 bool m_SmallWindow:1;
88 int m_Intensity;
87 QToolButton*fsButton; 89 QToolButton*fsButton;
88 QToolBar *toolBar; 90 QToolBar *toolBar;
89 QPopupMenu *fileMenu,*dispMenu,*fsMenu,*listviewMenu,*settingsMenu; 91 QPopupMenu *fileMenu,*dispMenu,*fsMenu,*listviewMenu,*settingsMenu;
90 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;
91 QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong; 93 QAction*m_aHideToolbar,*m_aSetup,*m_aDirName,*m_aDirShort,*m_aDirLong;
92 QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup; 94 QActionGroup *m_gListViewMode,*m_gDisplayType,*m_gPrevNext,*m_hGroup;
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
96 /* init funs */ 98 /* init funs */
97 void readConfig(); 99 void readConfig();
98 void setupActions(); 100 void setupActions();
99 void setupToolbar(); 101 void setupToolbar();
100 void setupMenu(); 102 void setupMenu();
101 /* for the device submenu - ToDo: Merge with the special button */ 103 /* for the device submenu - ToDo: Merge with the special button */
102 StorageInfo *m_storage; 104 StorageInfo *m_storage;
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
105private slots: 108private slots:
106 void slotConfig(); 109 void slotConfig();
107 void slotSelectDir(int); 110 void slotSelectDir(int);
108 void dirChanged(); 111 void dirChanged();
109 void slotForceSmall(bool); 112 void slotForceSmall(bool);