[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/office/zippl
From:       Klaas Freitag <freitag () suse ! de>
Date:       2011-07-10 19:05:33
Message-ID: 20110710190533.07BB1AC84E () svn ! kde ! org
[Download RAW message or body]

SVN commit 1240851 by freitag:

- added previous key
- fixed some numbering probs



 M  +3 -0      graphwidget.cpp  
 M  +1 -1      graphwidget.h  
 M  +1 -1      mainwindow.cpp  
 M  +16 -1     zipplcontroler.cpp  
 M  +2 -0      zipplcontroler.h  


--- trunk/playground/office/zippl/graphwidget.cpp #1240850:1240851
@@ -89,6 +89,9 @@
     case Qt::Key_Return:
         emit moveToNextSpot();
         break;
+    case Qt::Key_Backspace:
+        emit moveToPreviousSpot();
+        break;
     default:
         QGraphicsView::keyPressEvent(event);
     }
--- trunk/playground/office/zippl/graphwidget.h #1240850:1240851
@@ -59,8 +59,8 @@
 signals:
   void moveToNextSpot();
   void moveToNextStation();
+  void moveToPreviousSpot();
 
-
 protected:
   void keyPressEvent(QKeyEvent *event);
   void timerEvent(QTimerEvent *event);
--- trunk/playground/office/zippl/mainwindow.cpp #1240850:1240851
@@ -32,7 +32,7 @@
                                          QDir::homePath(), tr("Zippl Files (*xml)"));
     res = mController->loadFile( file );
   }
-  if( ! res ) exit;
+  if( ! res ) exit(0);
 }
 
 QString MainWindow::autoFile() const
--- trunk/playground/office/zippl/zipplcontroler.cpp #1240850:1240851
@@ -13,6 +13,8 @@
 
   connect( mGraphWidget, SIGNAL( moveToNextSpot()), SLOT( slotNextSpot() ) );
   connect( mGraphWidget, SIGNAL( moveToNextStation()), SLOT( slotNextHidden() ) );
+  connect( mGraphWidget, SIGNAL( moveToPreviousSpot()), SLOT( slotPreviousSpot() ) );
+
   connect( mWatcher, SIGNAL(fileChanged( const QString&)), SLOT( slotFileChanged( const QString& )));
 
 }
@@ -62,8 +64,9 @@
 {
   qDebug() << "Move to next spot, current spot no is " << mCurrSpotNo;
 
+  mCurrSpotNo++;
   QGraphicsItem *currItem = currentSpot();
-  mCurrSpotNo++;
+
   // turn to next Spot.
 
   centerOnItem( currItem );
@@ -99,6 +102,18 @@
 
 }
 
+void ZipplControler::slotPreviousSpot()
+{
+  qDebug() << "Move to previous spot, current spot no is " << mCurrSpotNo;
+
+  mCurrSpotNo--;
+  QGraphicsItem *currItem = currentSpot();
+
+  // turn to next Spot.
+
+  centerOnItem( currItem );
+}
+
 void ZipplControler::centerOnItem( QGraphicsItem* item )
 {
   if( !item ) {
--- trunk/playground/office/zippl/zipplcontroler.h #1240850:1240851
@@ -18,6 +18,8 @@
 protected slots:
   void slotNextSpot();
   void slotNextHidden();
+  void slotPreviousSpot( );
+
   void centerOnItem( QGraphicsItem* );
   void slotFileChanged( const QString& );
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic