summaryrefslogtreecommitdiff
authoralwin <alwin>2005-03-24 12:16:23 (UTC)
committer alwin <alwin>2005-03-24 12:16:23 (UTC)
commit4fbd94e2fd6432bb15e24e40be59426b309cbb9d (patch) (unidiff)
treeb78ecad37012bb66d956e22dbaa8cfcdb8cf67fc
parentc635023dd68edd0cb0cbb2827b926f33e27e0404 (diff)
downloadopie-4fbd94e2fd6432bb15e24e40be59426b309cbb9d.zip
opie-4fbd94e2fd6432bb15e24e40be59426b309cbb9d.tar.gz
opie-4fbd94e2fd6432bb15e24e40be59426b309cbb9d.tar.bz2
- increased max-thumbnail-size
- shortcuts for inc/dec brightness - make max thumbnail size as a static so there is one point in code where it is stored and not 4 time over the whole code
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
@@ -26,72 +26,73 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n
26 26
27 m_SlidetimeLayout->addWidget( m_SlideShowTime, 0, 1 ); 27 m_SlidetimeLayout->addWidget( m_SlideShowTime, 0, 1 );
28 28
29 m_SlidetimeLabel = new QLabel( this, "m_SlidetimeLabel" ); 29 m_SlidetimeLabel = new QLabel( this, "m_SlidetimeLabel" );
30 m_SlidetimeLabel->setText(tr("Slideshow timeout:")); 30 m_SlidetimeLabel->setText(tr("Slideshow timeout:"));
31 m_SlidetimeLayout->addWidget( m_SlidetimeLabel, 0, 0 ); 31 m_SlidetimeLayout->addWidget( m_SlidetimeLabel, 0, 0 );
32 m_MainLayout->addLayout( m_SlidetimeLayout ); 32 m_MainLayout->addLayout( m_SlidetimeLayout );
33 33
34 m_Iconsize = new QSpinBox( this, "m_Iconsize" ); 34 m_Iconsize = new QSpinBox( this, "m_Iconsize" );
35 m_Iconsize->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed)); 35 m_Iconsize->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed));
36 m_Iconsize->setButtonSymbols( QSpinBox::PlusMinus ); 36 m_Iconsize->setButtonSymbols( QSpinBox::PlusMinus );
37 m_Iconsize->setMaxValue( 128 ); 37 m_Iconsize->setMaxValue( 128 );
38 m_Iconsize->setMinValue(12); 38 m_Iconsize->setMinValue(12);
39 m_Iconsize->setValue( 32 ); 39 m_Iconsize->setValue( 32 );
40 m_Iconsize->setSuffix(tr(" pixel")); 40 m_Iconsize->setSuffix(tr(" pixel"));
41 m_IconsizeLayout->addWidget( m_Iconsize, 0, 1 ); 41 m_IconsizeLayout->addWidget( m_Iconsize, 0, 1 );
42 m_IconsizeLabel = new QLabel( this, "m_IconsizeLabel" ); 42 m_IconsizeLabel = new QLabel( this, "m_IconsizeLabel" );
43 m_IconsizeLabel->setText(tr("Size of thumbnails:")); 43 m_IconsizeLabel->setText(tr("Size of thumbnails:"));
44 m_IconsizeLayout->addWidget( m_IconsizeLabel, 0, 0 ); 44 m_IconsizeLayout->addWidget( m_IconsizeLabel, 0, 0 );
45 m_MainLayout->addLayout(m_IconsizeLayout); 45 m_MainLayout->addLayout(m_IconsizeLayout);
46 46
47 m_Intensity = new QSpinBox( this, "m_Intensity" ); 47 m_Intensity = new QSpinBox( this, "m_Intensity" );
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 );
54 m_IntensityLabel = new QLabel( this, "m_IntensityLabel" ); 54 m_IntensityLabel = new QLabel( this, "m_IntensityLabel" );
55 m_IntensityLabel->setText(tr("Default display brightness:")); 55 m_IntensityLabel->setText(tr("Default display brightness:"));
56 m_IntensityLayout->addWidget(m_IntensityLabel, 0, 0 ); 56 m_IntensityLayout->addWidget(m_IntensityLabel, 0, 0 );
57 m_MainLayout->addLayout(m_IntensityLayout); 57 m_MainLayout->addLayout(m_IntensityLayout);
58 58
59#if 0 59#if 0
60 m_ShowToolBar = new QCheckBox( this, "m_ShowToolBar" ); 60 m_ShowToolBar = new QCheckBox( this, "m_ShowToolBar" );
61 m_ShowToolBar->setText(tr("Show toolbar on startup")); 61 m_ShowToolBar->setText(tr("Show toolbar on startup"));
62 m_MainLayout->addWidget( m_ShowToolBar ); 62 m_MainLayout->addWidget( m_ShowToolBar );
63#endif 63#endif
64 m_SaveStateAuto = new QCheckBox( this, "m_SaveStateAuto" ); 64 m_SaveStateAuto = new QCheckBox( this, "m_SaveStateAuto" );
65 m_SaveStateAuto->setText(tr("Save status of fullscreen/autorotate")); 65 m_SaveStateAuto->setText(tr("Save status of fullscreen/autorotate"));
66 m_MainLayout->addWidget( m_SaveStateAuto ); 66 m_MainLayout->addWidget( m_SaveStateAuto );
67 67
68 spacer1 = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding ); 68 spacer1 = new QSpacerItem( 20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding );
69 m_MainLayout->addItem( spacer1 ); 69 m_MainLayout->addItem( spacer1 );
70 70
71 int stime = m_cfg->readNumEntry("slideshowtimeout",2); 71 int stime = m_cfg->readNumEntry("slideshowtimeout",2);
72 if (stime<0) stime=2; 72 if (stime<0) stime=2;
73 if (stime>60) stime=60; 73 if (stime>60) stime=60;
74 m_SlideShowTime->setValue(stime); 74 m_SlideShowTime->setValue(stime);
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}
85 86
86BaseSetup::~BaseSetup() 87BaseSetup::~BaseSetup()
87{ 88{
88} 89}
89 90
90void BaseSetup::save_values() 91void BaseSetup::save_values()
91{ 92{
92 if (!m_cfg) return; 93 if (!m_cfg) return;
93 m_cfg->writeEntry("slideshowtimeout",m_SlideShowTime->value()); 94 m_cfg->writeEntry("slideshowtimeout",m_SlideShowTime->value());
94 m_cfg->writeEntry("savestatus",m_SaveStateAuto->isChecked()); 95 m_cfg->writeEntry("savestatus",m_SaveStateAuto->isChecked());
95 m_cfg->writeEntry("iconsize",m_Iconsize->value()); 96 m_cfg->writeEntry("iconsize",m_Iconsize->value());
96 m_cfg->writeEntry("intensity",m_Intensity->value()); 97 m_cfg->writeEntry("intensity",m_Intensity->value());
97} 98}
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
@@ -15,48 +15,52 @@
15#include <opie2/oconfig.h> 15#include <opie2/oconfig.h>
16#include <opie2/okeyconfigwidget.h> 16#include <opie2/okeyconfigwidget.h>
17#include <opie2/odebug.h> 17#include <opie2/odebug.h>
18#include <opie2/oimagescrollview.h> 18#include <opie2/oimagescrollview.h>
19 19
20#include <qpe/resource.h> 20#include <qpe/resource.h>
21#include <qpe/qpemessagebox.h> 21#include <qpe/qpemessagebox.h>
22#include <qpe/ir.h> 22#include <qpe/ir.h>
23#include <qpe/qcopenvelope_qws.h> 23#include <qpe/qcopenvelope_qws.h>
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25 25
26#include <qiconview.h> 26#include <qiconview.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qhbox.h> 28#include <qhbox.h>
29#include <qcombobox.h> 29#include <qcombobox.h>
30#include <qdir.h> 30#include <qdir.h>
31#include <qapplication.h> 31#include <qapplication.h>
32#include <qmainwindow.h> 32#include <qmainwindow.h>
33#include <qtimer.h> 33#include <qtimer.h>
34#include <qstyle.h> 34#include <qstyle.h>
35 35
36 36
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
41 */ 45 */
42namespace { 46namespace {
43 static QPixmap* _dirPix = 0; 47 static QPixmap* _dirPix = 0;
44 static QPixmap* _unkPix = 0; 48 static QPixmap* _unkPix = 0;
45 static QPixmap* _cpyPix = 0; 49 static QPixmap* _cpyPix = 0;
46 static QPixmap* _emptyPix = 0; 50 static QPixmap* _emptyPix = 0;
47 class IconViewItem : public QIconViewItem { 51 class IconViewItem : public QIconViewItem {
48 public: 52 public:
49 IconViewItem( QIconView*, const QString& path, const QString& name,int a_iconsize, bool isDir = false); 53 IconViewItem( QIconView*, const QString& path, const QString& name,int a_iconsize, bool isDir = false);
50 QPixmap* pixmap()const; 54 QPixmap* pixmap()const;
51 QString path()const { return m_path; } 55 QString path()const { return m_path; }
52 bool isDir()const { return m_isDir; } 56 bool isDir()const { return m_isDir; }
53 void setText( const QString& ); 57 void setText( const QString& );
54 bool textOnly()const{return m_textOnly;} 58 bool textOnly()const{return m_textOnly;}
55 void setTextOnly(bool how){m_textOnly=how;} 59 void setTextOnly(bool how){m_textOnly=how;}
56 /* just for starting recalc of item rect! */ 60 /* just for starting recalc of item rect! */
57 virtual void setPixmap( const QPixmap & icon, bool recalc, bool redraw = TRUE ); 61 virtual void setPixmap( const QPixmap & icon, bool recalc, bool redraw = TRUE );
58 /* just for starting recalc of item rect! */ 62 /* just for starting recalc of item rect! */
59 virtual void setPixmap( const QPixmap & icon); 63 virtual void setPixmap( const QPixmap & icon);
60 64
61 protected: 65 protected:
62 mutable QPixmap* m_pix; 66 mutable QPixmap* m_pix;
@@ -201,50 +205,50 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg )
201 205
202 m_hbox = new QHBox( this ); 206 m_hbox = new QHBox( this );
203 QLabel* lbl = new QLabel( m_hbox ); 207 QLabel* lbl = new QLabel( m_hbox );
204 lbl->setText( tr("View as" ) ); 208 lbl->setText( tr("View as" ) );
205 209
206 m_views = new QComboBox( m_hbox, "View As" ); 210 m_views = new QComboBox( m_hbox, "View As" );
207 211
208 m_view= new QIconView( this ); 212 m_view= new QIconView( this );
209 connect(m_view, SIGNAL(clicked(QIconViewItem*) ), 213 connect(m_view, SIGNAL(clicked(QIconViewItem*) ),
210 this, SLOT(slotClicked(QIconViewItem*)) ); 214 this, SLOT(slotClicked(QIconViewItem*)) );
211 connect(m_view, SIGNAL(returnPressed(QIconViewItem*)), 215 connect(m_view, SIGNAL(returnPressed(QIconViewItem*)),
212 this, SLOT(slotClicked(QIconViewItem*)) ); 216 this, SLOT(slotClicked(QIconViewItem*)) );
213 217
214 m_view->setArrangement( QIconView::LeftToRight ); 218 m_view->setArrangement( QIconView::LeftToRight );
215 219
216 m_mode = m_cfg->readNumEntry("ListViewMode", 1); 220 m_mode = m_cfg->readNumEntry("ListViewMode", 1);
217 if (m_mode < 1 || m_mode>3) m_mode = 1; 221 if (m_mode < 1 || m_mode>3) m_mode = 1;
218 m_view->setItemTextPos( QIconView::Right ); 222 m_view->setItemTextPos( QIconView::Right );
219 if (m_mode >1) { 223 if (m_mode >1) {
220 m_view->setResizeMode(QIconView::Adjust); 224 m_view->setResizeMode(QIconView::Adjust);
221 } else { 225 } else {
222 m_view->setResizeMode(QIconView::Fixed); 226 m_view->setResizeMode(QIconView::Fixed);
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();
229 initKeys(); 233 initKeys();
230 loadViews(); 234 loadViews();
231} 235}
232 236
233void PIconView::setDoccalled(bool how) 237void PIconView::setDoccalled(bool how)
234{ 238{
235 m_setDocCalled = how; 239 m_setDocCalled = how;
236} 240}
237 241
238/* 242/*
239 * Unref the slave and save the keyboard manager 243 * Unref the slave and save the keyboard manager
240 */ 244 */
241PIconView::~PIconView() { 245PIconView::~PIconView() {
242 { 246 {
243 QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" ); 247 QCopEnvelope( "QPE/Application/opie-eye_slave", "refDown()" );
244 } 248 }
245 m_viewManager->save(); 249 m_viewManager->save();
246 delete m_viewManager; 250 delete m_viewManager;
247} 251}
248 252
249Opie::Core::OKeyConfigManager* PIconView::manager() { 253Opie::Core::OKeyConfigManager* PIconView::manager() {
250 return m_viewManager; 254 return m_viewManager;
@@ -387,63 +391,63 @@ void PIconView::slotTrash() {
387 391
388 392
389 currentView()->dirLister()->deleteImage( pa ); 393 currentView()->dirLister()->deleteImage( pa );
390 delete m_view->currentItem(); 394 delete m_view->currentItem();
391} 395}
392 396
393/* 397/*
394 * see what views are available 398 * see what views are available
395 */ 399 */
396void PIconView::loadViews() { 400void PIconView::loadViews() {
397 ViewMap::Iterator it; 401 ViewMap::Iterator it;
398 ViewMap* map = viewMap(); 402 ViewMap* map = viewMap();
399 for ( it = map->begin(); it != map->end(); ++it ) 403 for ( it = map->begin(); it != map->end(); ++it )
400 m_views->insertItem( it.key() ); 404 m_views->insertItem( it.key() );
401} 405}
402 406
403void PIconView::resetView() { 407void PIconView::resetView() {
404 m_internalReset = true; 408 m_internalReset = true;
405 // Also invalidate the cache. We can't cancel the operations anyway 409 // Also invalidate the cache. We can't cancel the operations anyway
406 g_stringPix.clear(); 410 g_stringPix.clear();
407 g_stringInf.clear(); 411 g_stringInf.clear();
408 if (m_mode>1) { 412 if (m_mode>1) {
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){
415 delete _dirPix; 419 delete _dirPix;
416 _dirPix = 0; 420 _dirPix = 0;
417 } 421 }
418 if (_cpyPix){ 422 if (_cpyPix){
419 delete _cpyPix; 423 delete _cpyPix;
420 _cpyPix = 0; 424 _cpyPix = 0;
421 } 425 }
422 calculateGrid(); 426 calculateGrid();
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());
428 m_internalReset = false; 432 m_internalReset = false;
429} 433}
430 434
431void PIconView::polish() 435void PIconView::polish()
432{ 436{
433 QVBox::polish(); 437 QVBox::polish();
434 438
435 QString lastView = m_cfg->readEntry("LastView",""); 439 QString lastView = m_cfg->readEntry("LastView","");
436 int cc=0; 440 int cc=0;
437 for (; cc<m_views->count();++cc) { 441 for (; cc<m_views->count();++cc) {
438 if (m_views->text(cc)==lastView) { 442 if (m_views->text(cc)==lastView) {
439 break; 443 break;
440 } 444 }
441 } 445 }
442 if (cc<m_views->count()) { 446 if (cc<m_views->count()) {
443 m_views->setCurrentItem(cc); 447 m_views->setCurrentItem(cc);
444 slotViewChanged(cc); 448 slotViewChanged(cc);
445 } else { 449 } else {
446 slotViewChanged(m_views->currentItem()); 450 slotViewChanged(m_views->currentItem());
447 } 451 }
448 connect( m_views, SIGNAL(activated(int)), 452 connect( m_views, SIGNAL(activated(int)),
449 this, SLOT(slotViewChanged(int)) ); 453 this, SLOT(slotViewChanged(int)) );
@@ -812,53 +816,53 @@ void PIconView::slotImageInfo() {
812 QString name = currentFileName(isDir); 816 QString name = currentFileName(isDir);
813 if (isDir) return; 817 if (isDir) return;
814 slotImageInfo( name ); 818 slotImageInfo( name );
815} 819}
816 820
817void PIconView::slotImageInfo( const QString& name) { 821void PIconView::slotImageInfo( const QString& name) {
818 PDirLister *lister = currentView()->dirLister(); 822 PDirLister *lister = currentView()->dirLister();
819 QString r_name = lister->nameToFname(name); 823 QString r_name = lister->nameToFname(name);
820 emit sig_showInfo(r_name ); 824 emit sig_showInfo(r_name );
821} 825}
822 826
823 827
824void PIconView::slotChangeMode( int mode ) { 828void PIconView::slotChangeMode( int mode ) {
825 if ( mode >= 1 && mode <= 3 ) { 829 if ( mode >= 1 && mode <= 3 ) {
826 m_mode = mode; 830 m_mode = mode;
827 m_cfg->writeEntry("ListViewMode", m_mode); 831 m_cfg->writeEntry("ListViewMode", m_mode);
828 /* performance! */ 832 /* performance! */
829 m_view->clear(); 833 m_view->clear();
830 if (m_mode >1) { 834 if (m_mode >1) {
831 m_view->setResizeMode(QIconView::Adjust); 835 m_view->setResizeMode(QIconView::Adjust);
832 } else { 836 } else {
833 m_view->setResizeMode(QIconView::Fixed); 837 m_view->setResizeMode(QIconView::Fixed);
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){
843 delete _dirPix; 847 delete _dirPix;
844 _dirPix = 0; 848 _dirPix = 0;
845 } 849 }
846 if (_cpyPix){ 850 if (_cpyPix){
847 delete _cpyPix; 851 delete _cpyPix;
848 _cpyPix = 0; 852 _cpyPix = 0;
849 } 853 }
850 calculateGrid(); 854 calculateGrid();
851 slotReloadDir(); 855 slotReloadDir();
852 } 856 }
853} 857}
854 858
855 859
856void PIconView::resizeEvent( QResizeEvent* re ) { 860void PIconView::resizeEvent( QResizeEvent* re ) {
857 calculateGrid(re); 861 calculateGrid(re);
858 QVBox::resizeEvent( re ); 862 QVBox::resizeEvent( re );
859 //calculateGrid(); 863 //calculateGrid();
860} 864}
861 865
862 866
863void PIconView::calculateGrid(QResizeEvent* re) 867void PIconView::calculateGrid(QResizeEvent* re)
864{ 868{
@@ -867,43 +871,43 @@ void PIconView::calculateGrid(QResizeEvent* re)
867 viewerWidth=re->size().width(); 871 viewerWidth=re->size().width();
868 } else { 872 } else {
869 int dw = QApplication::desktop()->width(); 873 int dw = QApplication::desktop()->width();
870 viewerWidth = dw-style().scrollBarExtent().width(); 874 viewerWidth = dw-style().scrollBarExtent().width();
871 } 875 }
872 876
873 QIconView::ItemTextPos pos; 877 QIconView::ItemTextPos pos;
874 switch( m_mode ) { 878 switch( m_mode ) {
875 case 2: 879 case 2:
876 pos = QIconView::Bottom; 880 pos = QIconView::Bottom;
877 break; 881 break;
878 case 3: 882 case 3:
879 case 1: 883 case 1:
880 default: 884 default:
881 pos = QIconView::Right; 885 pos = QIconView::Right;
882 break; 886 break;
883 } 887 }
884 int cache = 0; 888 int cache = 0;
885 m_view->setItemTextPos( pos ); 889 m_view->setItemTextPos( pos );
886 switch (m_mode) { 890 switch (m_mode) {
887 case 2: 891 case 2:
888 m_view->setSpacing(2); 892 m_view->setSpacing(2);
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);
894 break; 898 break;
895 case 3: 899 case 3:
896 m_view->setSpacing(10); 900 m_view->setSpacing(10);
897 m_view->setGridX( fontMetrics().width("testimage.jpg")+20); 901 m_view->setGridX( fontMetrics().width("testimage.jpg")+20);
898 m_view->setGridY(8); 902 m_view->setGridY(8);
899 PPixmapCache::self()->setMaxImages(2); 903 PPixmapCache::self()->setMaxImages(2);
900 break; 904 break;
901 case 1: 905 case 1:
902 default: 906 default:
903 m_view->setSpacing(10); 907 m_view->setSpacing(10);
904 m_view->setGridX( viewerWidth-3*m_view->spacing()); 908 m_view->setGridX( viewerWidth-3*m_view->spacing());
905 m_view->setGridY( fontMetrics().height()*2+40 ); 909 m_view->setGridY( fontMetrics().height()*2+40 );
906 PPixmapCache::self()->setMaxImages(20); 910 PPixmapCache::self()->setMaxImages(20);
907 break; 911 break;
908 } 912 }
909} 913}
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
@@ -16,48 +16,52 @@ class PIconViewItem;
16class PDirLister; 16class PDirLister;
17class Ir; 17class Ir;
18 18
19namespace Opie { 19namespace Opie {
20namespace Core{ 20namespace Core{
21 class OConfig; 21 class OConfig;
22 class OKeyConfigManager; 22 class OKeyConfigManager;
23} 23}
24} 24}
25 25
26class PIconView : public QVBox { 26class PIconView : public QVBox {
27 Q_OBJECT 27 Q_OBJECT
28 friend class PIconViewItem; 28 friend class PIconViewItem;
29 enum ActionIds { 29 enum ActionIds {
30 BeamItem, DeleteItem, ViewItem, InfoItem,SlideItem 30 BeamItem, DeleteItem, ViewItem, InfoItem,SlideItem
31 }; 31 };
32public: 32public:
33 PIconView( QWidget* wid, Opie::Core::OConfig *cfg ); 33 PIconView( QWidget* wid, Opie::Core::OConfig *cfg );
34 ~PIconView(); 34 ~PIconView();
35 void resetView(); 35 void resetView();
36 Opie::Core::OKeyConfigManager* manager(); 36 Opie::Core::OKeyConfigManager* manager();
37 37
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& );
42 void sig_display(const QString&); 46 void sig_display(const QString&);
43 void sig_startslide(int timeout); 47 void sig_startslide(int timeout);
44 48
45public slots: 49public slots:
46 virtual void slotShowNext(); 50 virtual void slotShowNext();
47 virtual void slotShowPrev(); 51 virtual void slotShowPrev();
48 virtual void slotShowLast(); 52 virtual void slotShowLast();
49 virtual bool slotShowFirst(); 53 virtual bool slotShowFirst();
50 virtual void polish(); 54 virtual void polish();
51 55
52protected: 56protected:
53 void resizeEvent( QResizeEvent* ); 57 void resizeEvent( QResizeEvent* );
54 58
55private: 59private:
56 void initKeys(); 60 void initKeys();
57 QString currentFileName(bool &isDir)const; 61 QString currentFileName(bool &isDir)const;
58 QString nextFileName(bool &isDir)const; 62 QString nextFileName(bool &isDir)const;
59 QString prevFileName(bool &isDir)const; 63 QString prevFileName(bool &isDir)const;
60 void loadViews(); 64 void loadViews();
61 void calculateGrid(QResizeEvent*e = 0); 65 void calculateGrid(QResizeEvent*e = 0);
62 bool m_setDocCalled:1; 66 bool m_setDocCalled:1;
63 67
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
@@ -8,84 +8,103 @@
8#include <qpe/qpeapplication.h> 8#include <qpe/qpeapplication.h>
9#include <qpe/qcopenvelope_qws.h> 9#include <qpe/qcopenvelope_qws.h>
10 10
11#include <qpopupmenu.h> 11#include <qpopupmenu.h>
12#include <qtimer.h> 12#include <qtimer.h>
13#include <qaction.h> 13#include <qaction.h>
14 14
15using namespace Opie::Core; 15using namespace Opie::Core;
16 16
17ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl ) 17ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl )
18 : Opie::MM::OImageScrollView(parent,name,fl) 18 : Opie::MM::OImageScrollView(parent,name,fl)
19{ 19{
20 m_viewManager = 0; 20 m_viewManager = 0;
21 focus_in_count = 0; 21 focus_in_count = 0;
22 m_cfg = cfg; 22 m_cfg = cfg;
23 m_isFullScreen = false; 23 m_isFullScreen = false;
24 m_ignore_next_in = false; 24 m_ignore_next_in = false;
25 m_slideTimer = 0; 25 m_slideTimer = 0;
26 QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold); 26 QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold);
27 initKeys(); 27 initKeys();
28 m_slideValue = 5; 28 m_slideValue = 5;
29 m_gDisplayType = 0; 29 m_gDisplayType = 0;
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;
34 int min = QApplication::desktop()->size().width()>QApplication::desktop()->size().height()? 35 int min = QApplication::desktop()->size().width()>QApplication::desktop()->size().height()?
35 QApplication::desktop()->size().height():QApplication::desktop()->size().width(); 36 QApplication::desktop()->size().height():QApplication::desktop()->size().width();
36 if (min>320) { 37 if (min>320) {
37 // bigscreen 38 // bigscreen
38 setMinimumSize(min/3,min/3); 39 setMinimumSize(min/3,min/3);
39 } else { 40 } else {
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&) ),
44 this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); 48 this, SLOT( systemMessage(const QCString&,const QByteArray&) ) );
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{
49 int _newrotation; 67 int _newrotation;
50 QDataStream stream( data, IO_ReadOnly ); 68 QDataStream stream( data, IO_ReadOnly );
51 odebug << "received system message: " << msg << oendl; 69 odebug << "received system message: " << msg << oendl;
52 if ( msg == "setCurrentRotation(int)" ) 70 if ( msg == "setCurrentRotation(int)" )
53 { 71 {
54 stream >> _newrotation; 72 stream >> _newrotation;
55 odebug << "received setCurrentRotation(" << _newrotation << ")" << oendl; 73 odebug << "received setCurrentRotation(" << _newrotation << ")" << oendl;
56 if (!fullScreen()) { 74 if (!fullScreen()) {
57 m_rotation = _newrotation; 75 m_rotation = _newrotation;
58 return; 76 return;
59 } 77 }
60 } 78 }
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
70ImageView::~ImageView() 89ImageView::~ImageView()
71{ 90{
72 odebug << "Destructor imageview" << oendl; 91 odebug << "Destructor imageview" << oendl;
73 delete m_viewManager; 92 delete m_viewManager;
74} 93}
75 94
76Opie::Core::OKeyConfigManager* ImageView::manager() 95Opie::Core::OKeyConfigManager* ImageView::manager()
77{ 96{
78 if (!m_viewManager) { 97 if (!m_viewManager) {
79 initKeys(); 98 initKeys();
80 } 99 }
81 return m_viewManager; 100 return m_viewManager;
82} 101}
83 102
84void ImageView::startSlide(int value) 103void ImageView::startSlide(int value)
85{ 104{
86 if (!m_slideTimer) { 105 if (!m_slideTimer) {
87 m_slideTimer = new QTimer(this); 106 m_slideTimer = new QTimer(this);
88 } 107 }
89 m_slideValue=value; 108 m_slideValue=value;
90 connect(m_slideTimer,SIGNAL(timeout()),SLOT(nextSlide())); 109 connect(m_slideTimer,SIGNAL(timeout()),SLOT(nextSlide()));
91 /* this "+1" is one millisecond. with that we can setup a slideshowvalue 110 /* this "+1" is one millisecond. with that we can setup a slideshowvalue
@@ -153,48 +172,57 @@ void ImageView::initKeys()
153 Resource::loadPixmap("rotate"), Autorotate, 172 Resource::loadPixmap("rotate"), Autorotate,
154 Opie::Core::OKeyPair(Qt::Key_R,0), 173 Opie::Core::OKeyPair(Qt::Key_R,0),
155 this, SIGNAL(toggleAutorotate()))); 174 this, SIGNAL(toggleAutorotate())));
156 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle autoscale"), "imageautoscale", 175 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle autoscale"), "imageautoscale",
157 Resource::loadPixmap("1to1"), Autoscale, 176 Resource::loadPixmap("1to1"), Autoscale,
158 Opie::Core::OKeyPair(Qt::Key_S,0), 177 Opie::Core::OKeyPair(Qt::Key_S,0),
159 this, SIGNAL(toggleAutoscale()))); 178 this, SIGNAL(toggleAutoscale())));
160 179
161 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Switch to next image"), "imageshownext", 180 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Switch to next image"), "imageshownext",
162 Resource::loadPixmap("forward"), ShowNext, 181 Resource::loadPixmap("forward"), ShowNext,
163 Opie::Core::OKeyPair(Qt::Key_Return,0), 182 Opie::Core::OKeyPair(Qt::Key_Return,0),
164 this, SIGNAL(dispNext()))); 183 this, SIGNAL(dispNext())));
165 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Switch to previous image"), "imageshowprev", 184 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Switch to previous image"), "imageshowprev",
166 Resource::loadPixmap("back"), ShowPrevious, 185 Resource::loadPixmap("back"), ShowPrevious,
167 Opie::Core::OKeyPair(Qt::Key_P,0), 186 Opie::Core::OKeyPair(Qt::Key_P,0),
168 this, SIGNAL(dispPrev()))); 187 this, SIGNAL(dispPrev())));
169 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle fullscreen"), "imagefullscreen", 188 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle fullscreen"), "imagefullscreen",
170 Resource::loadPixmap("fullscreen"), FullScreen, 189 Resource::loadPixmap("fullscreen"), FullScreen,
171 Opie::Core::OKeyPair(Qt::Key_F,0), 190 Opie::Core::OKeyPair(Qt::Key_F,0),
172 this, SIGNAL(toggleFullScreen()))); 191 this, SIGNAL(toggleFullScreen())));
173 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle thumbnail"), "imagezoomer", 192 m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle thumbnail"), "imagezoomer",
174 Resource::loadPixmap("mag"), Zoomer, 193 Resource::loadPixmap("mag"), Zoomer,
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();
179} 207}
180 208
181void ImageView::keyReleaseEvent(QKeyEvent * e) 209void ImageView::keyReleaseEvent(QKeyEvent * e)
182{ 210{
183 if (!e || e->state()!=0) { 211 if (!e || e->state()!=0) {
184 return; 212 return;
185 } 213 }
186 if (e->key()==Qt::Key_Escape) { 214 if (e->key()==Qt::Key_Escape) {
187 if (fullScreen()) { 215 if (fullScreen()) {
188 emit hideMe(); 216 emit hideMe();
189 } 217 }
190 if (closeIfHide) { 218 if (closeIfHide) {
191 QTimer::singleShot(0, qApp, SLOT(closeAllWindows())); 219 QTimer::singleShot(0, qApp, SLOT(closeAllWindows()));
192 } 220 }
193 } 221 }
194} 222}
195 223
196void ImageView::setCloseIfHide(bool how) 224void ImageView::setCloseIfHide(bool how)
197{ 225{
198 closeIfHide = how; 226 closeIfHide = how;
199} 227}
200 228
@@ -202,60 +230,67 @@ void ImageView::slotShowImageInfo()
202{ 230{
203 emit dispImageInfo(m_lastName); 231 emit dispImageInfo(m_lastName);
204} 232}
205 233
206void ImageView::contentsMousePressEvent ( QMouseEvent * e) 234void ImageView::contentsMousePressEvent ( QMouseEvent * e)
207{ 235{
208 if (e->button()==1) { 236 if (e->button()==1) {
209 return OImageScrollView::contentsMousePressEvent(e); 237 return OImageScrollView::contentsMousePressEvent(e);
210 } 238 }
211 odebug << "Popup " << oendl; 239 odebug << "Popup " << oendl;
212 QPopupMenu *m = new QPopupMenu(this); 240 QPopupMenu *m = new QPopupMenu(this);
213 if (!m) return; 241 if (!m) return;
214 if (m_hGroup) { 242 if (m_hGroup) {
215 m_hGroup->addTo(m); 243 m_hGroup->addTo(m);
216 } 244 }
217 if (fullScreen()) { 245 if (fullScreen()) {
218 if (m_gPrevNext) { 246 if (m_gPrevNext) {
219 m->insertSeparator(); 247 m->insertSeparator();
220 m_gPrevNext->addTo(m); 248 m_gPrevNext->addTo(m);
221 } 249 }
222 if (m_gDisplayType) { 250 if (m_gDisplayType) {
223 m->insertSeparator(); 251 m->insertSeparator();
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();
228 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); 260 m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) );
229 if (m_hGroup) { 261 if (m_hGroup) {
230 m_hGroup->removeFrom(m); 262 m_hGroup->removeFrom(m);
231 } 263 }
232 if (m_gPrevNext) { 264 if (m_gPrevNext) {
233 m_gPrevNext->removeFrom(m); 265 m_gPrevNext->removeFrom(m);
234 } 266 }
235 if (m_gDisplayType) { 267 if (m_gDisplayType) {
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}
240 275
241void ImageView::setFullScreen(bool how,bool force) 276void ImageView::setFullScreen(bool how,bool force)
242{ 277{
243 m_isFullScreen = how; 278 m_isFullScreen = how;
244 if (how) { 279 if (how) {
245 m_ignore_next_in = true; 280 m_ignore_next_in = true;
246// setFixedSize(qApp->desktop()->size()); 281// setFixedSize(qApp->desktop()->size());
247 setGeometry(0,0,qApp->desktop()->size().width(),qApp->desktop()->size().height()); 282 setGeometry(0,0,qApp->desktop()->size().width(),qApp->desktop()->size().height());
248 if (force) showFullScreen(); 283 if (force) showFullScreen();
249 } else { 284 } else {
250// setMinimumSize(10,10); 285// setMinimumSize(10,10);
251 } 286 }
252} 287}
253 288
254void ImageView::focusInEvent(QFocusEvent *) 289void ImageView::focusInEvent(QFocusEvent *)
255{ 290{
256 // Always do it here, no matter the size. 291 // Always do it here, no matter the size.
257 odebug << "Focus in (view)" << oendl; 292 odebug << "Focus in (view)" << oendl;
258 //if (fullScreen()) parentWidget()->showNormal(); 293 //if (fullScreen()) parentWidget()->showNormal();
259 if (m_ignore_next_in){m_ignore_next_in=false;return;} 294 if (m_ignore_next_in){m_ignore_next_in=false;return;}
260 if (fullScreen()) enableFullscreen(); 295 if (fullScreen()) enableFullscreen();
261} 296}
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
@@ -8,78 +8,84 @@
8class QTimer; 8class QTimer;
9class QActionGroup; 9class QActionGroup;
10class QAction; 10class QAction;
11 11
12class QCopChannel; 12class QCopChannel;
13 13
14namespace Opie { 14namespace Opie {
15 namespace Core { 15 namespace Core {
16 class OConfig; 16 class OConfig;
17 class OKeyConfigManager; 17 class OKeyConfigManager;
18 } 18 }
19} 19}
20 20
21class ImageView:public Opie::MM::OImageScrollView 21class ImageView:public Opie::MM::OImageScrollView
22{ 22{
23 Q_OBJECT 23 Q_OBJECT
24 24
25 enum ActionIds { 25 enum ActionIds {
26 ViewInfo, 26 ViewInfo,
27 FullScreen, 27 FullScreen,
28 ShowNext, 28 ShowNext,
29 ShowPrevious, 29 ShowPrevious,
30 Zoomer, 30 Zoomer,
31 Autorotate, 31 Autorotate,
32 Autoscale 32 Autoscale,
33 Incbrightness,
34 Decbrightness
33 }; 35 };
34 36
35public: 37public:
36 ImageView(Opie::Core::OConfig *cfg,QWidget* parent,const char* name = 0, WFlags fl = 0 ); 38 ImageView(Opie::Core::OConfig *cfg,QWidget* parent,const char* name = 0, WFlags fl = 0 );
37 virtual ~ImageView(); 39 virtual ~ImageView();
38 Opie::Core::OKeyConfigManager* manager(); 40 Opie::Core::OKeyConfigManager* manager();
39 void setFullScreen(bool how,bool force=true); 41 void setFullScreen(bool how,bool force=true);
40 bool fullScreen(){return m_isFullScreen;} 42 bool fullScreen(){return m_isFullScreen;}
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
46signals: 48signals:
47 void dispImageInfo(const QString&); 49 void dispImageInfo(const QString&);
48 void dispNext(); 50 void dispNext();
49 void dispPrev(); 51 void dispPrev();
50 void toggleFullScreen(); 52 void toggleFullScreen();
51 void hideMe(); 53 void hideMe();
52 void toggleZoomer(); 54 void toggleZoomer();
53 void toggleAutoscale(); 55 void toggleAutoscale();
54 void toggleAutorotate(); 56 void toggleAutorotate();
57 void incBrightness();
58 void decBrightness();
55 59
56protected: 60protected:
57 Opie::Core::OConfig * m_cfg; 61 Opie::Core::OConfig * m_cfg;
58 Opie::Core::OKeyConfigManager*m_viewManager; 62 Opie::Core::OKeyConfigManager*m_viewManager;
59 void initKeys(); 63 void initKeys();
60 bool m_isFullScreen:1; 64 bool m_isFullScreen:1;
61 bool m_ignore_next_in:1; 65 bool m_ignore_next_in:1;
62 bool m_Rotated:1; 66 bool m_Rotated:1;
63 67
64 int focus_in_count; 68 int focus_in_count;
65 QTimer*m_slideTimer; 69 QTimer*m_slideTimer;
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;
71 int m_rotation; 75 int m_rotation;
72 76
73public slots: 77public slots:
74 virtual void hide(); 78 virtual void hide();
75 virtual void startSlide(int); 79 virtual void startSlide(int);
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:
80 virtual void slotShowImageInfo(); 86 virtual void slotShowImageInfo();
81 virtual void keyReleaseEvent(QKeyEvent * e); 87 virtual void keyReleaseEvent(QKeyEvent * e);
82 virtual void contentsMousePressEvent ( QMouseEvent * e); 88 virtual void contentsMousePressEvent ( QMouseEvent * e);
83}; 89};
84 90
85#endif 91#endif
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
@@ -244,62 +244,64 @@ void PMainWindow::initT( const char* name, T** ptr, int id) {
244 if ( *ptr ) { 244 if ( *ptr ) {
245 (*ptr)->disconnect(this, SLOT(slotReturn())); 245 (*ptr)->disconnect(this, SLOT(slotReturn()));
246 (*ptr)->setDestructiveClose(); 246 (*ptr)->setDestructiveClose();
247 m_stack->removeWidget( *ptr ); 247 m_stack->removeWidget( *ptr );
248 } 248 }
249 *ptr = new T(m_cfg, m_stack, name ); 249 *ptr = new T(m_cfg, m_stack, name );
250 m_stack->addWidget( *ptr, id ); 250 m_stack->addWidget( *ptr, id );
251 251
252 connect(*ptr, SIGNAL(sig_return()), 252 connect(*ptr, SIGNAL(sig_return()),
253 this,SLOT(slotReturn())); 253 this,SLOT(slotReturn()));
254 254
255} 255}
256 256
257void PMainWindow::initInfo() { 257void 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
262void PMainWindow::initDisp() { 262void 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
286void PMainWindow::slotToggleFullScreen() 288void 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
292void PMainWindow::slotFullScreenButton(bool current) 294void PMainWindow::slotFullScreenButton(bool current)
293{ 295{
294 if (autoSave) { 296 if (autoSave) {
295 m_cfg->writeEntry("fullscreen",current); 297 m_cfg->writeEntry("fullscreen",current);
296 } 298 }
297 if (!m_disp) return; 299 if (!m_disp) return;
298 if (m_disp->isVisible()) { 300 if (m_disp->isVisible()) {
299 setupViewWindow(current, true); 301 setupViewWindow(current, true);
300 } 302 }
301} 303}
302 304
303void PMainWindow::setupViewWindow(bool current, bool forceDisplay) 305void PMainWindow::setupViewWindow(bool current, bool forceDisplay)
304{ 306{
305 if (!m_disp) { 307 if (!m_disp) {
@@ -359,48 +361,49 @@ void PMainWindow::slotShowInfo( const QString& inf ) {
359 initInfo(); 361 initInfo();
360 } 362 }
361 m_info->setPath( inf ); 363 m_info->setPath( inf );
362 if (m_SmallWindow) { 364 if (m_SmallWindow) {
363 m_aNext->removeFrom(toolBar); 365 m_aNext->removeFrom(toolBar);
364 m_aPrevious->removeFrom(toolBar); 366 m_aPrevious->removeFrom(toolBar);
365 fsButton->hide(); 367 fsButton->hide();
366 } 368 }
367 m_aNext->setEnabled(false); 369 m_aNext->setEnabled(false);
368 m_aPrevious->setEnabled(false); 370 m_aPrevious->setEnabled(false);
369 m_aDirUp->setEnabled(false); 371 m_aDirUp->setEnabled(false);
370 m_aShowInfo->setEnabled(false); 372 m_aShowInfo->setEnabled(false);
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
376void PMainWindow::slotDisplay( const QString& inf ) { 378void 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);
395 m_aStartSlide->setEnabled(false); 398 m_aStartSlide->setEnabled(false);
396 399
397 if (!nwindow && m_disp->fullScreen()!=m_aFullScreen->isOn()) { 400 if (!nwindow && m_disp->fullScreen()!=m_aFullScreen->isOn()) {
398 slotFullScreenToggled(m_aFullScreen->isOn()); 401 slotFullScreenToggled(m_aFullScreen->isOn());
399 } 402 }
400 if (m_disp->fullScreen()) { 403 if (m_disp->fullScreen()) {
401 if (!m_disp->isVisible()) { 404 if (!m_disp->isVisible()) {
402 m_disp->showFullScreen(); 405 m_disp->showFullScreen();
403 qwsDisplay()->requestFocus( m_disp->winId(), TRUE); 406 qwsDisplay()->requestFocus( m_disp->winId(), TRUE);
404 } 407 }
405 } else { 408 } else {
406 m_stack->raiseWidget( ImageDisplay ); 409 m_stack->raiseWidget( ImageDisplay );
@@ -622,57 +625,62 @@ void PMainWindow::setupActions()
622 m_aZoomer = new QAction( tr( "Show zoomer window when unscaled" ), Resource::loadIconSet( "mag" ), 0, 0, this, 0, true ); 625 m_aZoomer = new QAction( tr( "Show zoomer window when unscaled" ), Resource::loadIconSet( "mag" ), 0, 0, this, 0, true );
623 m_aZoomer->setToggleAction(true); 626 m_aZoomer->setToggleAction(true);
624 if (autoSave) { 627 if (autoSave) {
625 m_aZoomer->setOn(m_cfg->readBoolEntry("zoomeron",true)); 628 m_aZoomer->setOn(m_cfg->readBoolEntry("zoomeron",true));
626 } else { 629 } else {
627 m_aZoomer->setOn (true); 630 m_aZoomer->setOn (true);
628 } 631 }
629 connect(m_aZoomer,SIGNAL(toggled(bool)),this,SLOT(slotZoomerToggled(bool))); 632 connect(m_aZoomer,SIGNAL(toggled(bool)),this,SLOT(slotZoomerToggled(bool)));
630 m_gDisplayType->insert(m_aAutoRotate); 633 m_gDisplayType->insert(m_aAutoRotate);
631 m_gDisplayType->insert(m_aUnscaled); 634 m_gDisplayType->insert(m_aUnscaled);
632 m_gDisplayType->insert(m_aZoomer); 635 m_gDisplayType->insert(m_aZoomer);
633 636
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
648void PMainWindow::setupBrightness() 656void 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
659void PMainWindow::setupToolbar() 667void 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
667 fsButton = new PFileSystem( toolBar ); 675 fsButton = new PFileSystem( toolBar );
668 connect( fsButton, SIGNAL( changeDir( const QString& ) ), 676 connect( fsButton, SIGNAL( changeDir( const QString& ) ),
669 m_view, SLOT(slotChangeDir( const QString& ) ) ); 677 m_view, SLOT(slotChangeDir( const QString& ) ) );
670 connect( this, SIGNAL( changeDir( const QString& ) ), 678 connect( this, SIGNAL( changeDir( const QString& ) ),
671 m_view, SLOT(slotChangeDir( const QString& ) ) ); 679 m_view, SLOT(slotChangeDir( const QString& ) ) );
672 680
673 if (m_aBeam) { 681 if (m_aBeam) {
674 m_aBeam->addTo( toolBar ); 682 m_aBeam->addTo( toolBar );
675 } 683 }
676 m_aShowInfo->addTo(toolBar); 684 m_aShowInfo->addTo(toolBar);
677 m_aTrash->addTo(toolBar); 685 m_aTrash->addTo(toolBar);
678// m_aSetup->addTo(toolBar); 686// m_aSetup->addTo(toolBar);
@@ -703,48 +711,52 @@ void PMainWindow::setupMenu()
703 m_aDirUp->addTo( fileMenu ); 711 m_aDirUp->addTo( fileMenu );
704 712
705 fsMenu = new QPopupMenu(fileMenu); 713 fsMenu = new QPopupMenu(fileMenu);
706 fileMenu->insertItem(Resource::loadIconSet( "cardmon/pcmcia" ),tr("Select filesystem"),fsMenu); 714 fileMenu->insertItem(Resource::loadIconSet( "cardmon/pcmcia" ),tr("Select filesystem"),fsMenu);
707 connect( fsMenu, SIGNAL( activated( int ) ), this, SLOT(slotSelectDir( int ) ) ); 715 connect( fsMenu, SIGNAL( activated( int ) ), this, SLOT(slotSelectDir( int ) ) );
708 dirChanged(); 716 dirChanged();
709 717
710 if ( m_aBeam ) { 718 if ( m_aBeam ) {
711 fileMenu->insertSeparator(); 719 fileMenu->insertSeparator();
712 m_aBeam->addTo( fileMenu ); 720 m_aBeam->addTo( fileMenu );
713 } 721 }
714 fileMenu->insertSeparator(); 722 fileMenu->insertSeparator();
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
736void PMainWindow::listviewselected(QAction*which) 748void PMainWindow::listviewselected(QAction*which)
737{ 749{
738 if (!which || which->isOn()==false) return; 750 if (!which || which->isOn()==false) return;
739 int val = 1; 751 int val = 1;
740 752
741 if (which==m_aDirName) { 753 if (which==m_aDirName) {
742 val = 3; 754 val = 3;
743 } else if (which==m_aDirShort) { 755 } else if (which==m_aDirShort) {
744 val = 2; 756 val = 2;
745 } else if (which==m_aDirLong) { 757 } else if (which==m_aDirLong) {
746 val = 1; 758 val = 1;
747 } 759 }
748 emit changeListMode(val); 760 emit changeListMode(val);
749} 761}
750 762
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
@@ -70,46 +70,47 @@ protected slots:
70 virtual void setupBrightness(); 70 virtual void setupBrightness();
71 71
72private: 72private:
73 template<class T> void initT( const char* name, T**, int ); 73 template<class T> void initT( const char* name, T**, int );
74 void initInfo(); 74 void initInfo();
75 void initDisp(); 75 void initDisp();
76 void setupViewWindow(bool full, bool forceDisplay); 76 void setupViewWindow(bool full, bool forceDisplay);
77 77
78private: 78private:
79 Opie::Core::OConfig *m_cfg; 79 Opie::Core::OConfig *m_cfg;
80 Opie::Ui::OWidgetStack *m_stack; 80 Opie::Ui::OWidgetStack *m_stack;
81 PIconView* m_view; 81 PIconView* m_view;
82 imageinfo *m_info; 82 imageinfo *m_info;
83 ImageView *m_disp; 83 ImageView *m_disp;
84 bool autoSave:1; 84 bool autoSave:1;
85 bool m_setDocCalled:1; 85 bool m_setDocCalled:1;
86 bool m_polishDone:1; 86 bool m_polishDone:1;
87 bool m_SmallWindow:1; 87 bool m_SmallWindow:1;
88 int m_Intensity; 88 int m_Intensity;
89 QToolButton*fsButton; 89 QToolButton*fsButton;
90 QToolBar *toolBar; 90 QToolBar *toolBar;
91 QPopupMenu *fileMenu,*dispMenu,*fsMenu,*listviewMenu,*settingsMenu; 91 QPopupMenu *fileMenu,*dispMenu,*fsMenu,*listviewMenu,*settingsMenu;
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 */
99 void readConfig(); 100 void readConfig();
100 void setupActions(); 101 void setupActions();
101 void setupToolbar(); 102 void setupToolbar();
102 void setupMenu(); 103 void setupMenu();
103 /* for the device submenu - ToDo: Merge with the special button */ 104 /* for the device submenu - ToDo: Merge with the special button */
104 StorageInfo *m_storage; 105 StorageInfo *m_storage;
105 QMap<QString, QString> m_dev; 106 QMap<QString, QString> m_dev;
106 static bool Valuebox(QWidget*parent,int min, int max, int current,int&store); 107 static bool Valuebox(QWidget*parent,int min, int max, int current,int&store);
107 108
108private slots: 109private slots:
109 void slotConfig(); 110 void slotConfig();
110 void slotSelectDir(int); 111 void slotSelectDir(int);
111 void dirChanged(); 112 void dirChanged();
112 void slotForceSmall(bool); 113 void slotForceSmall(bool);
113}; 114};
114 115
115#endif 116#endif