← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

[Merge] lp:~vthompson/music-app/fix-1482760-arrow-keys into lp:music-app

 

Victor Thompson has proposed merging lp:~vthompson/music-app/fix-1482760-arrow-keys into lp:music-app.

Commit message:
* Allow arrow keys to control the initial walkthrough

Requested reviews:
  Music App Developers (music-app-dev)
Related bugs:
  Bug #1482760 in Ubuntu Music App: "Arrow keys in welcome wizard don't work"
  https://bugs.launchpad.net/music-app/+bug/1482760

For more details, see:
https://code.launchpad.net/~vthompson/music-app/fix-1482760-arrow-keys/+merge/267442

* Allow arrow keys to control the initial walkthrough
-- 
Your team Music App Developers is requested to review the proposed merge of lp:~vthompson/music-app/fix-1482760-arrow-keys into lp:music-app.
=== modified file 'app/components/Walkthrough/Walkthrough.qml'
--- app/components/Walkthrough/Walkthrough.qml	2015-05-03 16:22:31 +0000
+++ app/components/Walkthrough/Walkthrough.qml	2015-08-08 22:02:24 +0000
@@ -39,6 +39,20 @@
     // Property to signal walkthrough completion
     signal finished
 
+    // Go to next slide, if possible
+    function nextSlide() {
+        if (listView.currentIndex < 2) {
+            listView.currentIndex++
+        }
+    }
+
+    // Go to previous slide, if possible
+    function previousSlide() {
+        if (listView.currentIndex > 0) {
+            listView.currentIndex--
+        }
+    }
+
     // ListView to show the slides
     ListView {
         id: listView
@@ -163,7 +177,7 @@
         visible: listView.currentIndex !== 2
         width: height
 
-        onClicked: listView.currentIndex++
+        onClicked: nextSlide()
 
         Rectangle {
             anchors {

=== modified file 'app/music-app.qml'
--- app/music-app.qml	2015-07-29 01:23:11 +0000
+++ app/music-app.qml	2015-08-08 22:02:24 +0000
@@ -70,6 +70,16 @@
                 mainPageStack.goBack();  // Esc      Go back
             }
         }
+        else if (mainPageStack.currentPage.isFirstRun !== undefined) {
+            switch (event.key) {
+            case Qt.Key_Left:   //  Left   Previous slide
+                mainPageStack.currentPage.previousSlide()
+                break;
+            case Qt.Key_Right:  //  Right  Next slide
+                mainPageStack.currentPage.nextSlide()
+                break;
+            }
+        }
         else if(event.modifiers === Qt.AltModifier) {
             var position;
 

=== modified file 'debian/changelog'
--- debian/changelog	2015-08-04 23:44:41 +0000
+++ debian/changelog	2015-08-08 22:02:24 +0000
@@ -4,6 +4,7 @@
   * Fix SongsView album art for albums and genres (LP: #1477366)
   * Fix to allow the LibraryEmptyState to work again (LP: #1478162)
   * Fix typo in README.autopilot and clarify the instructions
+  * Allow arrow keys to control the initial walkthrough (LP: #1482760)
 
   [ Andrew Hayzen ]
   * Fix for console errors when using the parent changed helpers


Follow ups