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 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/noncore/graphics/opie-eye/gui/imageview.cpp b/noncore/graphics/opie-eye/gui/imageview.cpp index 5522131..b699aa1 100644 --- a/noncore/graphics/opie-eye/gui/imageview.cpp +++ b/noncore/graphics/opie-eye/gui/imageview.cpp | |||
@@ -6,8 +6,9 @@ | |||
6 | 6 | ||
7 | #include <qpe/resource.h> | 7 | #include <qpe/resource.h> |
8 | #include <qpe/qpeapplication.h> | 8 | #include <qpe/qpeapplication.h> |
9 | #include <qpopupmenu.h> | 9 | #include <qpopupmenu.h> |
10 | #include <qtimer.h> | ||
10 | 11 | ||
11 | using namespace Opie::Core; | 12 | using namespace Opie::Core; |
12 | 13 | ||
13 | ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl ) | 14 | ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl ) |
@@ -17,10 +18,12 @@ ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name | |||
17 | focus_in_count = 0; | 18 | focus_in_count = 0; |
18 | m_cfg = cfg; | 19 | m_cfg = cfg; |
19 | m_isFullScreen = false; | 20 | m_isFullScreen = false; |
20 | m_ignore_next_in = false; | 21 | m_ignore_next_in = false; |
22 | m_slideTimer = 0; | ||
21 | QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold); | 23 | QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold); |
22 | initKeys(); | 24 | initKeys(); |
25 | m_slideValue = 5; | ||
23 | } | 26 | } |
24 | 27 | ||
25 | ImageView::~ImageView() | 28 | ImageView::~ImageView() |
26 | { | 29 | { |
@@ -35,8 +38,31 @@ Opie::Core::OKeyConfigManager* ImageView::manager() | |||
35 | } | 38 | } |
36 | return m_viewManager; | 39 | return m_viewManager; |
37 | } | 40 | } |
38 | 41 | ||
42 | void ImageView::startSlide(int value) | ||
43 | { | ||
44 | if (!m_slideTimer) { | ||
45 | m_slideTimer = new QTimer(this); | ||
46 | } | ||
47 | m_slideValue=value; | ||
48 | connect(m_slideTimer,SIGNAL(timeout()),SLOT(nextSlide())); | ||
49 | m_slideTimer->start(m_slideValue*1000,true); | ||
50 | } | ||
51 | |||
52 | void ImageView::nextSlide() | ||
53 | { | ||
54 | if (!m_slideTimer) { | ||
55 | return; | ||
56 | } | ||
57 | if (isHidden()) { | ||
58 | delete m_slideTimer; | ||
59 | m_slideTimer = 0; | ||
60 | return; | ||
61 | } | ||
62 | emit dispNext(); | ||
63 | m_slideTimer->start(m_slideValue*1000,true); | ||
64 | } | ||
39 | void ImageView::initKeys() | 65 | void ImageView::initKeys() |
40 | { | 66 | { |
41 | odebug << "init imageview keys" << oendl; | 67 | odebug << "init imageview keys" << oendl; |
42 | if (!m_cfg) { | 68 | if (!m_cfg) { |