<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>87106</bug_id>
          
          <creation_ts>2004-08-13 09:34:09 +0000</creation_ts>
          <short_desc>advancedslideshow : option to pause, go back or forward, and quit/resume</short_desc>
          <delta_ts>2020-09-18 03:54:37 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>digikam</product>
          <component>Plugin-Generic-Presentation</component>
          <version>unspecified</version>
          <rep_platform>unspecified</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>wishlist</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Wilbert Berendsen">wbsoft</reporter>
          <assigned_to name="Digikam Developers">digikam-bugs-null</assigned_to>
          <cc>caulier.gilles</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin>7.2.0</cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>258365</commentid>
    <comment_count>0</comment_count>
    <who name="Wilbert Berendsen">wbsoft</who>
    <bug_when>2004-08-13 09:34:09 +0000</bug_when>
    <thetext>Version:           0.7.0-cvs (using KDE 3.3.0, compiled sources)
Compiler:          gcc version 3.3.4 20040623 (Gentoo Linux 3.3.4-r1, ssp-3.3.2-2, pie-8.7.6)
OS:                Linux (i686) release 2.6.7-gentoo-r11

During a slideshow it would be nice to be able to pause the show, or to go back or forward.

This could be implemented using keyboard (could not find a key except ESC to abort the show), or with a little borderless popup window that appears when a user moves the mouse or so.

ALso it would be nice if I could resume a show of an album. Sometimes during view of an album I see something, e.g. an incorrectly rotated image. I go out the slideshow, fix the image, and would like to be able to resume the slideshow without having to start all over again :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>258704</commentid>
    <comment_count>1</comment_count>
    <who name="Joern Ahrens">joern.ahrens</who>
    <bug_when>2004-08-14 11:20:10 +0000</bug_when>
    <thetext>CVS commit by jahrens: 

When the spacebar is pressed, the slideshow is interrupted until the spacebar is pressed again.

-&gt; Additionally, it has to be added an info when the slideshow is paused, maybe an icon like this &quot;||&quot; or &quot;paused&quot; at the bottom line.

CCMAIL: 87106@bugs.kde.org


  M +81 -2     slideshow.cpp   1.7
  M +3 -2      slideshow.h   1.5


--- kdeextragear-libs-1/kipi-plugins/slideshow/slideshow.cpp  #1.6:1.7
@@ -42,4 +42,65 @@ namespace KIPISlideShowPlugin
 {
 
+/**
+ * This Timer can be interrupted to pause a slideshow
+ */
+class PauseTimer : public QTimer
+{
+public:
+    PauseTimer(QObject *parent=0, const char *name=0);
+    
+    int start(int msec, bool sshot=FALSE);
+    void stop();
+    bool pause();
+    
+private:
+    time_t  m_startTime;
+    int     m_msecRest;
+    int     m_msec;
+    bool    m_paused;
+};
+
+PauseTimer::PauseTimer(QObject *parent, const char *name) :
+    QTimer(parent, name)
+{
+    m_startTime = 0;
+    m_msecRest = 0;
+    m_paused = false;
+}
+
+int PauseTimer::start(int msec, bool sshot)
+{
+    m_startTime = time(0);
+    m_msec = msec;
+    return QTimer::start(msec, sshot);
+}
+
+bool PauseTimer::pause()
+{
+    if(!m_paused)
+    {
+        m_msecRest = m_msec - time(0) - m_startTime;
+        stop();
+    }
+    else
+    {
+        if(m_msecRest &lt; 0)
+            start(0, true);
+        else
+            start(m_msecRest, true);
+    }
+    
+    m_paused = !m_paused;
+    return m_paused;
+}
+
+void PauseTimer::stop()
+{
+    m_startTime = 0;
+    m_msecRest = 0;
+    m_paused = false;    
+    QTimer::stop();
+}
+
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -60,5 +121,5 @@ SlideShow::SlideShow(const QStringList&amp; 
     effect_        = 0;
     effectRunning_ = false;
-    timer_ = new QTimer(this);
+    timer_ = new PauseTimer(this);
     connect(timer_, SIGNAL(timeout()), SLOT(slotTimeOut()));
     mIntArray = 0;
@@ -373,4 +433,23 @@ void SlideShow::showEndOfShow()
 /////////////////////////////////////////////////////////////////////////////////////////////////////
 
+void SlideShow::keyPressEvent(QKeyEvent *event)
+{
+    if(!event)
+        return;
+        
+    if(event-&gt;key() == Qt::Key_Space)
+    {
+        event-&gt;accept();
+        timer_-&gt;pause();
+    }
+    else
+    {
+        event-&gt;ignore();
+        QWidget::keyPressEvent(event);
+    }
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////
+
 void SlideShow::mousePressEvent(QMouseEvent *event)
 {

--- kdeextragear-libs-1/kipi-plugins/slideshow/slideshow.h  #1.4:1.5
@@ -29,5 +29,4 @@
 #include &lt;qmap.h&gt;
 
-class QTimer;
 class QMouseEvent;
 
@@ -35,4 +34,5 @@ namespace KIPISlideShowPlugin
 {
 
+class PauseTimer;
 class ImlibIface;
 class ImImageSS;
@@ -83,5 +83,5 @@ private:
     
     QStringList fileList_;
-    QTimer     *timer_;
+    PauseTimer *timer_;
     QTimer     *mouseMoveTimer_;
     int         fileIndex_;
@@ -102,4 +102,5 @@ protected:
     void mousePressEvent(QMouseEvent *event);
     void mouseMoveEvent(QMouseEvent *);
+    void keyPressEvent(QKeyEvent *event);
     
     int effectNone(bool);


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>274587</commentid>
    <comment_count>2</comment_count>
    <who name="Renchi Raju">renchi.raju</who>
    <bug_when>2004-10-06 18:52:58 +0000</bug_when>
    <thetext>

*** This bug has been marked as a duplicate of 88600 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1958243</commentid>
    <comment_count>3</comment_count>
    <who name="">caulier.gilles</who>
    <bug_when>2020-09-18 03:54:37 +0000</bug_when>
    <thetext>Fixed with #88600</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>