author | alwin <alwin> | 2005-03-24 12:16:23 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-24 12:16:23 (UTC) |
commit | 4fbd94e2fd6432bb15e24e40be59426b309cbb9d (patch) (unidiff) | |
tree | b78ecad37012bb66d956e22dbaa8cfcdb8cf67fc | |
parent | c635023dd68edd0cb0cbb2827b926f33e27e0404 (diff) | |
download | opie-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
-rw-r--r-- | noncore/graphics/opie-eye/gui/basesetup.cpp | 11 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.cpp | 22 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/iconview.h | 4 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 37 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.h | 12 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.cpp | 16 | ||||
-rw-r--r-- | noncore/graphics/opie-eye/gui/mainwindow.h | 3 |
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 | |||
@@ -18,80 +18,81 @@ BaseSetup::BaseSetup(Opie::Core::OConfig *a_cfg,QWidget * parent, const char * n | |||
18 | 18 | ||
19 | m_SlideShowTime = new QSpinBox( this, "m_SlideShowTime" ); | 19 | m_SlideShowTime = new QSpinBox( this, "m_SlideShowTime" ); |
20 | m_SlideShowTime->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed)); | 20 | m_SlideShowTime->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::Fixed)); |
21 | m_SlideShowTime->setButtonSymbols( QSpinBox::PlusMinus ); | 21 | m_SlideShowTime->setButtonSymbols( QSpinBox::PlusMinus ); |
22 | m_SlideShowTime->setMaxValue( 60 ); | 22 | m_SlideShowTime->setMaxValue( 60 ); |
23 | m_SlideShowTime->setMinValue(0); | 23 | m_SlideShowTime->setMinValue(0); |
24 | m_SlideShowTime->setValue( 2 ); | 24 | m_SlideShowTime->setValue( 2 ); |
25 | m_SlideShowTime->setSuffix(tr(" seconds")); | 25 | m_SlideShowTime->setSuffix(tr(" seconds")); |
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 | ||
86 | BaseSetup::~BaseSetup() | 87 | BaseSetup::~BaseSetup() |
87 | { | 88 | { |
88 | } | 89 | } |
89 | 90 | ||
90 | void BaseSetup::save_values() | 91 | void 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 | |||
@@ -7,64 +7,68 @@ | |||
7 | #include "messagebox.h" | 7 | #include "messagebox.h" |
8 | 8 | ||
9 | #include <lib/imagecache.h> | 9 | #include <lib/imagecache.h> |
10 | #include <gui/imageinfoui.h> | 10 | #include <gui/imageinfoui.h> |
11 | 11 | ||
12 | #include <iface/dirview.h> | 12 | #include <iface/dirview.h> |
13 | #include <iface/dirlister.h> | 13 | #include <iface/dirlister.h> |
14 | 14 | ||
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 | ||
37 | using Opie::Core::OKeyConfigItem; | 37 | using Opie::Core::OKeyConfigItem; |
38 | 38 | ||
39 | const int PIconView::sMAX_ICON_SIZE = 128; | ||
40 | const int PIconView::sMIN_ICON_SIZE = 12; | ||
41 | const 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 | */ |
42 | namespace { | 46 | namespace { |
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; |
63 | int m_iconsize; | 67 | int m_iconsize; |
64 | void check_pix()const; | 68 | void check_pix()const; |
65 | 69 | ||
66 | private: | 70 | private: |
67 | QString m_path; | 71 | QString m_path; |
68 | bool m_isDir : 1; | 72 | bool m_isDir : 1; |
69 | bool m_noInfo :1; | 73 | bool m_noInfo :1; |
70 | bool m_textOnly:1; | 74 | bool m_textOnly:1; |
@@ -193,66 +197,66 @@ PIconView::PIconView( QWidget* wid, Opie::Core::OConfig* cfg ) | |||
193 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); | 197 | QCopEnvelope( "QPE/Application/opie-eye_slave", "refUp()" ); |
194 | } | 198 | } |
195 | m_path = QDir::homeDirPath(); | 199 | m_path = QDir::homeDirPath(); |
196 | m_mode = 0; | 200 | m_mode = 0; |
197 | m_iconsize = 32; | 201 | m_iconsize = 32; |
198 | m_internalReset = false; | 202 | m_internalReset = false; |
199 | m_customWidget = 0; | 203 | m_customWidget = 0; |
200 | m_setDocCalled = false; | 204 | m_setDocCalled = false; |
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 | ||
233 | void PIconView::setDoccalled(bool how) | 237 | void 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 | */ |
241 | PIconView::~PIconView() { | 245 | PIconView::~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 | ||
249 | Opie::Core::OKeyConfigManager* PIconView::manager() { | 253 | Opie::Core::OKeyConfigManager* PIconView::manager() { |
250 | return m_viewManager; | 254 | return m_viewManager; |
251 | } | 255 | } |
252 | 256 | ||
253 | 257 | ||
254 | /* | 258 | /* |
255 | * init the KeyBoard Shortcuts | 259 | * init the KeyBoard Shortcuts |
256 | * called from the c'tor | 260 | * called from the c'tor |
257 | */ | 261 | */ |
258 | void PIconView::initKeys() { | 262 | void PIconView::initKeys() { |
@@ -379,79 +383,79 @@ void PIconView::slotTrash() { | |||
379 | bool isDir; | 383 | bool isDir; |
380 | QString pa = currentFileName( isDir ); | 384 | QString pa = currentFileName( isDir ); |
381 | if ( isDir || pa.isEmpty() ) | 385 | if ( isDir || pa.isEmpty() ) |
382 | return; | 386 | return; |
383 | 387 | ||
384 | if (!OMessageBox::confirmDelete( this, tr("the Image"), | 388 | if (!OMessageBox::confirmDelete( this, tr("the Image"), |
385 | pa, tr("Delete Image" ))) | 389 | pa, tr("Delete Image" ))) |
386 | return; | 390 | return; |
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 | */ |
396 | void PIconView::loadViews() { | 400 | void 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 | ||
403 | void PIconView::resetView() { | 407 | void 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 | ||
431 | void PIconView::polish() | 435 | void 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)) ); |
450 | } | 454 | } |
451 | 455 | ||
452 | /* | 456 | /* |
453 | *swicth view reloadDir and connect signals | 457 | *swicth view reloadDir and connect signals |
454 | */ | 458 | */ |
455 | void PIconView::slotViewChanged( int i) { | 459 | void PIconView::slotViewChanged( int i) { |
456 | if (!m_views->count() ) { | 460 | if (!m_views->count() ) { |
457 | setCurrentView( 0l); | 461 | setCurrentView( 0l); |
@@ -804,106 +808,106 @@ void PIconView::slotStartSlide() { | |||
804 | slotShowImage( name ); | 808 | slotShowImage( name ); |
805 | } | 809 | } |
806 | int t = m_cfg->readNumEntry("slideshowtimeout", 2); | 810 | int t = m_cfg->readNumEntry("slideshowtimeout", 2); |
807 | emit sig_startslide(t); | 811 | emit sig_startslide(t); |
808 | } | 812 | } |
809 | 813 | ||
810 | void PIconView::slotImageInfo() { | 814 | void PIconView::slotImageInfo() { |
811 | bool isDir = false; | 815 | bool isDir = false; |
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 | ||
817 | void PIconView::slotImageInfo( const QString& name) { | 821 | void 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 | ||
824 | void PIconView::slotChangeMode( int mode ) { | 828 | void 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 | ||
856 | void PIconView::resizeEvent( QResizeEvent* re ) { | 860 | void 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 | ||
863 | void PIconView::calculateGrid(QResizeEvent* re) | 867 | void PIconView::calculateGrid(QResizeEvent* re) |
864 | { | 868 | { |
865 | int viewerWidth; | 869 | int viewerWidth; |
866 | if (re) { | 870 | if (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 | |||
@@ -8,64 +8,68 @@ | |||
8 | 8 | ||
9 | #include <qvbox.h> | 9 | #include <qvbox.h> |
10 | 10 | ||
11 | 11 | ||
12 | class QIconView; | 12 | class QIconView; |
13 | class QIconViewItem; | 13 | class QIconViewItem; |
14 | class QComboBox; | 14 | class QComboBox; |
15 | class PIconViewItem; | 15 | class PIconViewItem; |
16 | class PDirLister; | 16 | class PDirLister; |
17 | class Ir; | 17 | class Ir; |
18 | 18 | ||
19 | namespace Opie { | 19 | namespace Opie { |
20 | namespace Core{ | 20 | namespace Core{ |
21 | class OConfig; | 21 | class OConfig; |
22 | class OKeyConfigManager; | 22 | class OKeyConfigManager; |
23 | } | 23 | } |
24 | } | 24 | } |
25 | 25 | ||
26 | class PIconView : public QVBox { | 26 | class 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 | }; |
32 | public: | 32 | public: |
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 | |||
40 | signals: | 44 | signals: |
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 | ||
45 | public slots: | 49 | public 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 | ||
52 | protected: | 56 | protected: |
53 | void resizeEvent( QResizeEvent* ); | 57 | void resizeEvent( QResizeEvent* ); |
54 | 58 | ||
55 | private: | 59 | private: |
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 | ||
64 | private slots: | 68 | private slots: |
65 | void slotDirUp(); | 69 | void slotDirUp(); |
66 | void slotChangeDir(const QString&); | 70 | void slotChangeDir(const QString&); |
67 | void slotTrash(); | 71 | void slotTrash(); |
68 | void slotViewChanged( int ); | 72 | void slotViewChanged( int ); |
69 | void slotReloadDir(); | 73 | void slotReloadDir(); |
70 | void slotRename(); | 74 | void slotRename(); |
71 | void slotBeam(); | 75 | void slotBeam(); |
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 | |||
@@ -1,99 +1,118 @@ | |||
1 | #include "imageview.h" | 1 | #include "imageview.h" |
2 | 2 | ||
3 | #include <opie2/odebug.h> | 3 | #include <opie2/odebug.h> |
4 | #include <opie2/oconfig.h> | 4 | #include <opie2/oconfig.h> |
5 | #include <opie2/okeyconfigwidget.h> | 5 | #include <opie2/okeyconfigwidget.h> |
6 | 6 | ||
7 | #include <qpe/resource.h> | 7 | #include <qpe/resource.h> |
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 | ||
15 | using namespace Opie::Core; | 15 | using namespace Opie::Core; |
16 | 16 | ||
17 | ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl ) | 17 | ImageView::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 | ||
51 | void ImageView::slotIncBrightness() | ||
52 | { | ||
53 | int lb = Intensity()+5; | ||
54 | if (lb>100) lb=100; | ||
55 | setIntensity(lb,true); | ||
56 | } | ||
57 | |||
58 | void ImageView::slotDecBrightness() | ||
59 | { | ||
60 | int lb = Intensity()-5; | ||
61 | if (lb<-100) lb=-100; | ||
62 | setIntensity(lb,true); | ||
63 | } | ||
64 | |||
47 | void ImageView::systemMessage( const QCString& msg, const QByteArray& data ) | 65 | void 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 | ||
63 | void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup) | 81 | void 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 | ||
70 | ImageView::~ImageView() | 89 | ImageView::~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 | ||
76 | Opie::Core::OKeyConfigManager* ImageView::manager() | 95 | Opie::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 | ||
84 | void ImageView::startSlide(int value) | 103 | void 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 |
92 | of 0. eg "as fast as possible". | 111 | of 0. eg "as fast as possible". |
93 | */ | 112 | */ |
94 | m_slideTimer->start(m_slideValue*1000+1,true); | 113 | m_slideTimer->start(m_slideValue*1000+1,true); |
95 | } | 114 | } |
96 | 115 | ||
97 | void ImageView::stopSlide() | 116 | void ImageView::stopSlide() |
98 | { | 117 | { |
99 | if (!m_slideTimer) { | 118 | if (!m_slideTimer) { |
@@ -145,125 +164,141 @@ void ImageView::initKeys() | |||
145 | m_viewManager->setEventMask( Opie::Core::OKeyConfigManager::MaskPressed ); | 164 | m_viewManager->setEventMask( Opie::Core::OKeyConfigManager::MaskPressed ); |
146 | 165 | ||
147 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", | 166 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", |
148 | Resource::loadPixmap("1to1"), ViewInfo, | 167 | Resource::loadPixmap("1to1"), ViewInfo, |
149 | Opie::Core::OKeyPair(Qt::Key_I,0), | 168 | Opie::Core::OKeyPair(Qt::Key_I,0), |
150 | this, SLOT(slotShowImageInfo()))); | 169 | this, SLOT(slotShowImageInfo()))); |
151 | 170 | ||
152 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle autorotate"), "imageautorotate", | 171 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("Toggle autorotate"), "imageautorotate", |
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 | ||
181 | void ImageView::keyReleaseEvent(QKeyEvent * e) | 209 | void 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 | ||
196 | void ImageView::setCloseIfHide(bool how) | 224 | void ImageView::setCloseIfHide(bool how) |
197 | { | 225 | { |
198 | closeIfHide = how; | 226 | closeIfHide = how; |
199 | } | 227 | } |
200 | 228 | ||
201 | void ImageView::slotShowImageInfo() | 229 | void ImageView::slotShowImageInfo() |
202 | { | 230 | { |
203 | emit dispImageInfo(m_lastName); | 231 | emit dispImageInfo(m_lastName); |
204 | } | 232 | } |
205 | 233 | ||
206 | void ImageView::contentsMousePressEvent ( QMouseEvent * e) | 234 | void 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 | ||
241 | void ImageView::setFullScreen(bool how,bool force) | 276 | void 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 | ||
254 | void ImageView::focusInEvent(QFocusEvent *) | 289 | void 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 | } |
262 | 297 | ||
263 | void ImageView::hide() | 298 | void ImageView::hide() |
264 | { | 299 | { |
265 | if (fullScreen()) { | 300 | if (fullScreen()) { |
266 | m_ignore_next_in = true; | 301 | m_ignore_next_in = true; |
267 | showNormal(); | 302 | showNormal(); |
268 | } | 303 | } |
269 | QWidget::hide(); | 304 | QWidget::hide(); |
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 | |||
@@ -1,85 +1,91 @@ | |||
1 | #ifndef _IMAGE_VIEW_H | 1 | #ifndef _IMAGE_VIEW_H |
2 | #define _IMAGE_VIEW_H | 2 | #define _IMAGE_VIEW_H |
3 | 3 | ||
4 | #include <opie2/oimagescrollview.h> | 4 | #include <opie2/oimagescrollview.h> |
5 | 5 | ||
6 | #include <qwidget.h> | 6 | #include <qwidget.h> |
7 | 7 | ||
8 | class QTimer; | 8 | class QTimer; |
9 | class QActionGroup; | 9 | class QActionGroup; |
10 | class QAction; | 10 | class QAction; |
11 | 11 | ||
12 | class QCopChannel; | 12 | class QCopChannel; |
13 | 13 | ||
14 | namespace Opie { | 14 | namespace 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 | ||
21 | class ImageView:public Opie::MM::OImageScrollView | 21 | class 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 | ||
35 | public: | 37 | public: |
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 | ||
46 | signals: | 48 | signals: |
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 | ||
56 | protected: | 60 | protected: |
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 | ||
73 | public slots: | 77 | public 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 | ||
79 | protected slots: | 85 | protected 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 | |||
@@ -236,78 +236,80 @@ void PMainWindow::slotConfig() { | |||
236 | 236 | ||
237 | /* | 237 | /* |
238 | * create a new image info component | 238 | * create a new image info component |
239 | * and detach the current one | 239 | * and detach the current one |
240 | * we will make the other delete on exit | 240 | * we will make the other delete on exit |
241 | */ | 241 | */ |
242 | template<class T> | 242 | template<class T> |
243 | void PMainWindow::initT( const char* name, T** ptr, int id) { | 243 | 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 | ||
257 | void PMainWindow::initInfo() { | 257 | void 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 | ||
262 | void PMainWindow::initDisp() { | 262 | void 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 | ||
286 | void PMainWindow::slotToggleFullScreen() | 288 | void 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 | ||
292 | void PMainWindow::slotFullScreenButton(bool current) | 294 | void 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 | ||
303 | void PMainWindow::setupViewWindow(bool current, bool forceDisplay) | 305 | void PMainWindow::setupViewWindow(bool current, bool forceDisplay) |
304 | { | 306 | { |
305 | if (!m_disp) { | 307 | if (!m_disp) { |
306 | return; | 308 | return; |
307 | } | 309 | } |
308 | if (current) { | 310 | if (current) { |
309 | m_disp->setBackgroundColor(black); | 311 | m_disp->setBackgroundColor(black); |
310 | m_disp->reparent(0, WStyle_Customize | WStyle_NoBorderEx, QPoint(0,0)); | 312 | m_disp->reparent(0, WStyle_Customize | WStyle_NoBorderEx, QPoint(0,0)); |
311 | m_disp->setVScrollBarMode(QScrollView::AlwaysOff); | 313 | m_disp->setVScrollBarMode(QScrollView::AlwaysOff); |
312 | m_disp->setHScrollBarMode(QScrollView::AlwaysOff); | 314 | m_disp->setHScrollBarMode(QScrollView::AlwaysOff); |
313 | m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); | 315 | m_disp->resize(qApp->desktop()->width(), qApp->desktop()->height()); |
@@ -351,64 +353,65 @@ void PMainWindow::slotFullScreenToggled(bool current) | |||
351 | * | 353 | * |
352 | * ### FIXME and talk to alwin | 354 | * ### FIXME and talk to alwin |
353 | */ | 355 | */ |
354 | void PMainWindow::slotShowInfo( const QString& inf ) { | 356 | void PMainWindow::slotShowInfo( const QString& inf ) { |
355 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { | 357 | if (m_disp && m_disp->fullScreen() && m_disp->isVisible()) { |
356 | return; | 358 | return; |
357 | } | 359 | } |
358 | if ( !m_info ) { | 360 | if ( !m_info ) { |
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 | ||
376 | void PMainWindow::slotDisplay( const QString& inf ) { | 378 | void 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 ); |
407 | } | 410 | } |
408 | } | 411 | } |
409 | 412 | ||
410 | void PMainWindow::raiseIconView() { | 413 | void PMainWindow::raiseIconView() { |
411 | setUpdatesEnabled(false); | 414 | setUpdatesEnabled(false); |
412 | if (m_SmallWindow) { | 415 | if (m_SmallWindow) { |
413 | m_gPrevNext->removeFrom(toolBar); | 416 | m_gPrevNext->removeFrom(toolBar); |
414 | fsButton->show(); | 417 | fsButton->show(); |
@@ -614,73 +617,78 @@ void PMainWindow::setupActions() | |||
614 | m_aUnscaled->setToggleAction(true); | 617 | m_aUnscaled->setToggleAction(true); |
615 | connect(m_aUnscaled,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool))); | 618 | connect(m_aUnscaled,SIGNAL(toggled(bool)),this,SLOT(slotScaleToggled(bool))); |
616 | if (autoSave) { | 619 | if (autoSave) { |
617 | m_aUnscaled->setOn(m_cfg->readBoolEntry("unscaled",false)); | 620 | m_aUnscaled->setOn(m_cfg->readBoolEntry("unscaled",false)); |
618 | } else { | 621 | } else { |
619 | m_aUnscaled->setOn(false); | 622 | m_aUnscaled->setOn(false); |
620 | } | 623 | } |
621 | 624 | ||
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 | ||
648 | void PMainWindow::setupBrightness() | 656 | void 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 | ||
659 | void PMainWindow::setupToolbar() | 667 | void 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); |
679 | 687 | ||
680 | m_gDisplayType->addTo(toolBar); | 688 | m_gDisplayType->addTo(toolBar); |
681 | 689 | ||
682 | if (!m_SmallWindow) { | 690 | if (!m_SmallWindow) { |
683 | m_gPrevNext->addTo(toolBar); | 691 | m_gPrevNext->addTo(toolBar); |
684 | } else { | 692 | } else { |
685 | m_gPrevNext->setEnabled(false); | 693 | m_gPrevNext->setEnabled(false); |
686 | } | 694 | } |
@@ -695,64 +703,68 @@ void PMainWindow::setupMenu() | |||
695 | settingsMenu = new QPopupMenu( menuBar() ); | 703 | settingsMenu = new QPopupMenu( menuBar() ); |
696 | menuBar()->insertItem( tr( "Settings" ), settingsMenu ); | 704 | menuBar()->insertItem( tr( "Settings" ), settingsMenu ); |
697 | 705 | ||
698 | m_aViewfile->addTo(fileMenu); | 706 | m_aViewfile->addTo(fileMenu); |
699 | m_aShowInfo->addTo(fileMenu); | 707 | m_aShowInfo->addTo(fileMenu); |
700 | m_aStartSlide->addTo(fileMenu); | 708 | m_aStartSlide->addTo(fileMenu); |
701 | 709 | ||
702 | fileMenu->insertSeparator(); | 710 | fileMenu->insertSeparator(); |
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 | ||
736 | void PMainWindow::listviewselected(QAction*which) | 748 | void 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 | ||
751 | void PMainWindow::readConfig() | 763 | void PMainWindow::readConfig() |
752 | { | 764 | { |
753 | autoSave =m_cfg->readBoolEntry("savestatus",true); | 765 | autoSave =m_cfg->readBoolEntry("savestatus",true); |
754 | m_Intensity = m_cfg->readNumEntry("intensity",0); | 766 | m_Intensity = m_cfg->readNumEntry("intensity",0); |
755 | } | 767 | } |
756 | 768 | ||
757 | void PMainWindow::polish() | 769 | void PMainWindow::polish() |
758 | { | 770 | { |
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 | |||
@@ -62,54 +62,55 @@ public slots: | |||
62 | 62 | ||
63 | protected slots: | 63 | 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 | virtual void setupBrightness(); |
71 | 71 | ||
72 | private: | 72 | private: |
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 | ||
78 | private: | 78 | private: |
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 | ||
108 | private slots: | 109 | private 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 |