Diffstat (limited to 'noncore/graphics/opie-eye/gui/imageview.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/graphics/opie-eye/gui/imageview.cpp | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index a20c879..c7e48cb 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp | |||
@@ -10,2 +10,3 @@ | |||
10 | #include <qtimer.h> | 10 | #include <qtimer.h> |
11 | #include <qaction.h> | ||
11 | 12 | ||
@@ -25,2 +26,12 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name | |||
25 | m_slideValue = 5; | 26 | m_slideValue = 5; |
27 | m_gDisplayType = 0; | ||
28 | m_gPrevNext = 0; | ||
29 | m_hGroup = 0; | ||
30 | } | ||
31 | |||
32 | void ImageView::setMenuActions(QActionGroup*hGroup,QActionGroup*nextprevGroup, QActionGroup*disptypeGroup) | ||
33 | { | ||
34 | m_gDisplayType = disptypeGroup; | ||
35 | m_gPrevNext = nextprevGroup; | ||
36 | m_hGroup = hGroup; | ||
26 | } | 37 | } |
@@ -51,2 +62,12 @@ void ImageView::startSlide(int value) | |||
51 | 62 | ||
63 | void ImageView::stopSlide() | ||
64 | { | ||
65 | if (!m_slideTimer) { | ||
66 | return; | ||
67 | } | ||
68 | m_slideTimer->stop(); | ||
69 | delete m_slideTimer; | ||
70 | m_slideTimer = 0; | ||
71 | } | ||
72 | |||
52 | void ImageView::nextSlide() | 73 | void ImageView::nextSlide() |
@@ -144,11 +165,14 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) | |||
144 | if (!m) return; | 165 | if (!m) return; |
145 | m->insertItem(tr("Toggle fullscreen"),this, SIGNAL(toggleFullScreen())); | 166 | if (m_hGroup) { |
167 | m_hGroup->addTo(m); | ||
168 | } | ||
146 | if (fullScreen()) { | 169 | if (fullScreen()) { |
170 | if (m_gPrevNext) { | ||
147 | m->insertSeparator(); | 171 | m->insertSeparator(); |
148 | m->insertItem(tr("Previous image"),this,SIGNAL(dispPrev())); | 172 | m_gPrevNext->addTo(m); |
149 | m->insertItem(tr("Next image"),this,SIGNAL(dispNext())); | 173 | } |
174 | if (m_gDisplayType) { | ||
150 | m->insertSeparator(); | 175 | m->insertSeparator(); |
151 | m->insertItem(tr("Toggle autoscale"),this, SIGNAL(toggleAutoscale())); | 176 | m_gDisplayType->addTo(m); |
152 | m->insertItem(tr("Toggle autorotate"),this, SIGNAL(toggleAutorotate())); | 177 | } |
153 | m->insertItem(tr("Toggle thumbnail"),this, SIGNAL(toggleZoomer())); | ||
154 | } | 178 | } |
@@ -156,2 +180,11 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) | |||
156 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); | 180 | m->exec( QPoint( QCursor::pos().x(), QCursor::pos().y()) ); |
181 | if (m_hGroup) { | ||
182 | m_hGroup->removeFrom(m); | ||
183 | } | ||
184 | if (m_gPrevNext) { | ||
185 | m_gPrevNext->removeFrom(m); | ||
186 | } | ||
187 | if (m_gDisplayType) { | ||
188 | m_gDisplayType->removeFrom(m); | ||
189 | } | ||
157 | delete m; | 190 | delete m; |