Diffstat (limited to 'noncore/graphics/opie-eye/gui/imageview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index c7e48cb..86db732 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp | |||
@@ -66,49 +66,49 @@ void ImageView::stopSlide() | |||
66 | return; | 66 | return; |
67 | } | 67 | } |
68 | m_slideTimer->stop(); | 68 | m_slideTimer->stop(); |
69 | delete m_slideTimer; | 69 | delete m_slideTimer; |
70 | m_slideTimer = 0; | 70 | m_slideTimer = 0; |
71 | } | 71 | } |
72 | 72 | ||
73 | void ImageView::nextSlide() | 73 | void ImageView::nextSlide() |
74 | { | 74 | { |
75 | if (!m_slideTimer) { | 75 | if (!m_slideTimer) { |
76 | return; | 76 | return; |
77 | } | 77 | } |
78 | if (isHidden()) { | 78 | if (isHidden()) { |
79 | delete m_slideTimer; | 79 | delete m_slideTimer; |
80 | m_slideTimer = 0; | 80 | m_slideTimer = 0; |
81 | return; | 81 | return; |
82 | } | 82 | } |
83 | emit dispNext(); | 83 | emit dispNext(); |
84 | m_slideTimer->start(m_slideValue*1000,true); | 84 | m_slideTimer->start(m_slideValue*1000,true); |
85 | } | 85 | } |
86 | void ImageView::initKeys() | 86 | void ImageView::initKeys() |
87 | { | 87 | { |
88 | odebug << "init imageview keys" << oendl; | 88 | odebug << "init imageview keys" << oendl; |
89 | if (!m_cfg) { | 89 | if (!m_cfg) { |
90 | m_cfg = new Opie::Core::OConfig("phunkview"); | 90 | m_cfg = new Opie::Core::OConfig("opie-eye"); |
91 | m_cfg->setGroup("image_view_keys" ); | 91 | m_cfg->setGroup("image_view_keys" ); |
92 | } | 92 | } |
93 | Opie::Core::OKeyPair::List lst; | 93 | Opie::Core::OKeyPair::List lst; |
94 | lst.append( Opie::Core::OKeyPair::upArrowKey() ); | 94 | lst.append( Opie::Core::OKeyPair::upArrowKey() ); |
95 | lst.append( Opie::Core::OKeyPair::downArrowKey() ); | 95 | lst.append( Opie::Core::OKeyPair::downArrowKey() ); |
96 | lst.append( Opie::Core::OKeyPair::leftArrowKey() ); | 96 | lst.append( Opie::Core::OKeyPair::leftArrowKey() ); |
97 | lst.append( Opie::Core::OKeyPair::rightArrowKey() ); | 97 | lst.append( Opie::Core::OKeyPair::rightArrowKey() ); |
98 | lst.append( Opie::Core::OKeyPair(Qt::Key_Escape,0)); | 98 | lst.append( Opie::Core::OKeyPair(Qt::Key_Escape,0)); |
99 | 99 | ||
100 | m_viewManager = new Opie::Core::OKeyConfigManager(m_cfg, "image_view_keys", | 100 | m_viewManager = new Opie::Core::OKeyConfigManager(m_cfg, "image_view_keys", |
101 | lst, false,this, "image_view_keys" ); | 101 | lst, false,this, "image_view_keys" ); |
102 | 102 | ||
103 | /** | 103 | /** |
104 | * Handle KeyEvents when they're pressed. This avoids problems | 104 | * Handle KeyEvents when they're pressed. This avoids problems |
105 | * with 'double next' on Return. | 105 | * with 'double next' on Return. |
106 | * The Return press would switch to this view and the return | 106 | * The Return press would switch to this view and the return |
107 | * release would emit the dispNext Signal. | 107 | * release would emit the dispNext Signal. |
108 | */ | 108 | */ |
109 | m_viewManager->setEventMask( Opie::Core::OKeyConfigManager::MaskPressed ); | 109 | m_viewManager->setEventMask( Opie::Core::OKeyConfigManager::MaskPressed ); |
110 | 110 | ||
111 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", | 111 | m_viewManager->addKeyConfig( Opie::Core::OKeyConfigItem(tr("View Image Info"), "imageviewinfo", |
112 | Resource::loadPixmap("1to1"), ViewInfo, | 112 | Resource::loadPixmap("1to1"), ViewInfo, |
113 | Opie::Core::OKeyPair(Qt::Key_I,0), | 113 | Opie::Core::OKeyPair(Qt::Key_I,0), |
114 | this, SLOT(slotShowImageInfo()))); | 114 | this, SLOT(slotShowImageInfo()))); |
@@ -169,70 +169,69 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) | |||
169 | if (fullScreen()) { | 169 | if (fullScreen()) { |
170 | if (m_gPrevNext) { | 170 | if (m_gPrevNext) { |
171 | m->insertSeparator(); | 171 | m->insertSeparator(); |
172 | m_gPrevNext->addTo(m); | 172 | m_gPrevNext->addTo(m); |
173 | } | 173 | } |
174 | if (m_gDisplayType) { | 174 | if (m_gDisplayType) { |
175 | m->insertSeparator(); | 175 | m->insertSeparator(); |
176 | m_gDisplayType->addTo(m); | 176 | m_gDisplayType->addTo(m); |
177 | } | 177 | } |
178 | } | 178 | } |
179 | m->setFocus(); | 179 | m->setFocus(); |
180 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 180 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
181 | if (m_hGroup) { | 181 | if (m_hGroup) { |
182 | m_hGroup->removeFrom(m); | 182 | m_hGroup->removeFrom(m); |
183 | } | 183 | } |
184 | if (m_gPrevNext) { | 184 | if (m_gPrevNext) { |
185 | m_gPrevNext->removeFrom(m); | 185 | m_gPrevNext->removeFrom(m); |
186 | } | 186 | } |
187 | if (m_gDisplayType) { | 187 | if (m_gDisplayType) { |
188 | m_gDisplayType->removeFrom(m); | 188 | m_gDisplayType->removeFrom(m); |
189 | } | 189 | } |
190 | delete m; | 190 | delete m; |
191 | } | 191 | } |
192 | 192 | ||
193 | void ImageView::setFullScreen(bool how) | 193 | void ImageView::setFullScreen(bool how,bool force) |
194 | { | 194 | { |
195 | m_isFullScreen = how; | 195 | m_isFullScreen = how; |
196 | if (how) { | 196 | if (how) { |
197 | m_ignore_next_in = true; | 197 | m_ignore_next_in = true; |
198 | setFixedSize(qApp->desktop()->size()); | 198 | setFixedSize(qApp->desktop()->size()); |
199 | showFullScreen(); | 199 | if (force) showFullScreen(); |
200 | } else { | 200 | } else { |
201 | setMinimumSize(10,10); | 201 | setMinimumSize(10,10); |
202 | } | 202 | } |
203 | } | 203 | } |
204 | 204 | ||
205 | void ImageView::focusInEvent(QFocusEvent *) | 205 | void ImageView::focusInEvent(QFocusEvent *) |
206 | { | 206 | { |
207 | // Always do it here, no matter the size. | 207 | // Always do it here, no matter the size. |
208 | odebug << "Focus in (view)" << oendl; | 208 | odebug << "Focus in (view)" << oendl; |
209 | //if (fullScreen()) parentWidget()->showNormal(); | 209 | //if (fullScreen()) parentWidget()->showNormal(); |
210 | if (m_ignore_next_in){m_ignore_next_in=false;return;} | 210 | if (m_ignore_next_in){m_ignore_next_in=false;return;} |
211 | if (fullScreen()) enableFullscreen(); | 211 | if (fullScreen()) enableFullscreen(); |
212 | } | 212 | } |
213 | 213 | ||
214 | void ImageView::hide() | 214 | void ImageView::hide() |
215 | { | 215 | { |
216 | if (fullScreen()) { | 216 | if (fullScreen()) { |
217 | m_ignore_next_in = true; | 217 | m_ignore_next_in = true; |
218 | showNormal(); | 218 | showNormal(); |
219 | } | 219 | } |
220 | QWidget::hide(); | 220 | QWidget::hide(); |
221 | } | 221 | } |
222 | void ImageView::enableFullscreen() | 222 | void ImageView::enableFullscreen() |
223 | { | 223 | { |
224 | if (!fullScreen()) return; | 224 | if (!fullScreen()) return; |
225 | if (m_ignore_next_in) {m_ignore_next_in = false;return;} | 225 | if (m_ignore_next_in) {m_ignore_next_in = false;return;} |
226 | 226 | ||
227 | setUpdatesEnabled(false); | 227 | setUpdatesEnabled(false); |
228 | // This is needed because showNormal() forcefully changes the window | 228 | // This is needed because showNormal() forcefully changes the window |
229 | // style to WSTyle_TopLevel. | 229 | // style to WSTyle_TopLevel. |
230 | reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); | 230 | reparent(0, WStyle_Customize | WStyle_NoBorder, QPoint(0,0)); |
231 | // Enable fullscreen. | 231 | // Enable fullscreen. |
232 | /* this is the trick - I don't now why, but after a showFullScreen QTE toggles the focus | 232 | /* this is the trick - I don't now why, but after a showFullScreen QTE toggles the focus |
233 | * so we must block it here! */ | 233 | * so we must block it here! */ |
234 | m_ignore_next_in = true; | 234 | m_ignore_next_in = true; |
235 | showFullScreen(); | 235 | showFullScreen(); |
236 | setUpdatesEnabled(true); | 236 | setUpdatesEnabled(true); |
237 | |||
238 | } | 237 | } |