author | alwin <alwin> | 2004-10-30 02:18:52 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-10-30 02:18:52 (UTC) |
commit | 3fcdb4e6f576f5e3eec072efe87a44bf58fdbf25 (patch) (side-by-side diff) | |
tree | 087361e8ec23fcae50ab146d6d2e2d366a54fe74 /noncore/graphics/opie-eye/gui/imageview.cpp | |
parent | dca4423e3b0966fe26ba4183e5b6ad4666c61e86 (diff) | |
download | opie-3fcdb4e6f576f5e3eec072efe87a44bf58fdbf25.zip opie-3fcdb4e6f576f5e3eec072efe87a44bf58fdbf25.tar.gz opie-3fcdb4e6f576f5e3eec072efe87a44bf58fdbf25.tar.bz2 |
slide show implemented
on next/previous images: if end/begin of list is reached it starts
again on begin/end (it was required for slideshow so what ;)
zecke: so we have a feature for OPIE 1.1.7 ;)
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 @@ -4,25 +4,28 @@ #include <opie2/oconfig.h> #include <opie2/okeyconfigwidget.h> #include <qpe/resource.h> #include <qpe/qpeapplication.h> #include <qpopupmenu.h> +#include <qtimer.h> using namespace Opie::Core; ImageView::ImageView(Opie::Core::OConfig *cfg, QWidget* parent, const char* name, WFlags fl ) : Opie::MM::OImageScrollView(parent,name,fl) { m_viewManager = 0; focus_in_count = 0; m_cfg = cfg; m_isFullScreen = false; m_ignore_next_in = false; + m_slideTimer = 0; QPEApplication::setStylusOperation(viewport(),QPEApplication::RightOnHold); initKeys(); + m_slideValue = 5; } ImageView::~ImageView() { odebug << "Delete Imageview" << oendl; delete m_viewManager; @@ -33,12 +36,35 @@ Opie::Core::OKeyConfigManager* ImageView::manager() if (!m_viewManager) { initKeys(); } return m_viewManager; } +void ImageView::startSlide(int value) +{ + if (!m_slideTimer) { + m_slideTimer = new QTimer(this); + } + m_slideValue=value; + connect(m_slideTimer,SIGNAL(timeout()),SLOT(nextSlide())); + m_slideTimer->start(m_slideValue*1000,true); +} + +void ImageView::nextSlide() +{ + if (!m_slideTimer) { + return; + } + if (isHidden()) { + delete m_slideTimer; + m_slideTimer = 0; + return; + } + emit dispNext(); + m_slideTimer->start(m_slideValue*1000,true); +} void ImageView::initKeys() { odebug << "init imageview keys" << oendl; if (!m_cfg) { m_cfg = new Opie::Core::OConfig("phunkview"); m_cfg->setGroup("image_view_keys" ); |