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 | 49 |
1 files changed, 41 insertions, 8 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 | |||
@@ -9,4 +9,5 @@ | |||
9 | #include <qpopupmenu.h> | 9 | #include <qpopupmenu.h> |
10 | #include <qtimer.h> | 10 | #include <qtimer.h> |
11 | #include <qaction.h> | ||
11 | 12 | ||
12 | using namespace Opie::Core; | 13 | using namespace Opie::Core; |
@@ -24,4 +25,14 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name | |||
24 | initKeys(); | 25 | initKeys(); |
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 | } |
27 | 38 | ||
@@ -50,4 +61,14 @@ void ImageView::startSlide(int value) | |||
50 | } | 61 | } |
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() |
53 | { | 74 | { |
@@ -143,16 +164,28 @@ void ImageView::contentsMousePressEvent ( QMouseEvent * e) | |||
143 | QPopupMenu *m = new QPopupMenu(0); | 164 | QPopupMenu *m = new QPopupMenu(0); |
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()) { |
147 | m->insertSeparator(); | 170 | if (m_gPrevNext) { |
148 | m->insertItem(tr("Previous image"),this,SIGNAL(dispPrev())); | 171 | m->insertSeparator(); |
149 | m->insertItem(tr("Next image"),this,SIGNAL(dispNext())); | 172 | m_gPrevNext->addTo(m); |
150 | m->insertSeparator(); | 173 | } |
151 | m->insertItem(tr("Toggle autoscale"),this, SIGNAL(toggleAutoscale())); | 174 | if (m_gDisplayType) { |
152 | m->insertItem(tr("Toggle autorotate"),this, SIGNAL(toggleAutorotate())); | 175 | m->insertSeparator(); |
153 | m->insertItem(tr("Toggle thumbnail"),this, SIGNAL(toggleZoomer())); | 176 | m_gDisplayType->addTo(m); |
177 | } | ||
154 | } | 178 | } |
155 | m->setFocus(); | 179 | m->setFocus(); |
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; |
158 | } | 191 | } |