Fix:gui/qml:Made point.qml available after swithing to main.qml
authorakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Fri, 9 Apr 2010 12:53:56 +0000 (12:53 +0000)
committerakashihi <akashihi@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Fri, 9 Apr 2010 12:53:56 +0000 (12:53 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3144 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/gui/qml/guiProxy.h
navit/navit/gui/qml/skins/navit/Cellar.qml

index ae172f4..57f6cdd 100644 (file)
@@ -101,7 +101,9 @@ public slots:
                        returnPage=returnList.takeLast(); //Set previous element as return page and remove it from the list
                }
                this->source=returnList.join(QString("/"));
-               this->source.prepend(QString("/"));
+               if (!this->source.startsWith("/")) {
+                       this->source.prepend(QString("/"));
+               }
                this->setPage(returnPage);
        }
 
index 129a608..2df59cb 100644 (file)
@@ -2,17 +2,20 @@ import Qt 4.6
 
 Rectangle {
 
-    function hideButtons() {    
-               if ( gui.returnSource.split('/').length < 4  ) {
-               btnBack.opacity=0;
+    function onStartup() {    
+    console.log("returnSource: "+gui.returnSource);
+               if ( gui.returnSource.split('/').length > 2  ) {
+               btnBack.opacity=1;
        }
-       if ( gui.returnSource == "/main.qml" ) {
-               btnHome.opacity=0;
-               btnBack.opacity=0;
+       if ( gui.returnSource != "/point.qml" ) {
+               btnPoint.opacity=1
+       }
+       if ( gui.returnSource != "/main.qml" ) {
+               btnMenu.opacity=1;
        }
     }
 
-   Component.onCompleted: hideButtons();
+   Component.onCompleted: onStartup();
 
     ButtonIcon {
         id: btnMap; icon: "gui_map.svg"; text:"Map"; onClicked: gui.backToMap();
@@ -21,15 +24,24 @@ Rectangle {
     }
 
     ButtonIcon {
-        id: btnHome; icon: "gui_home.svg"; text: "Home"; onClicked: { gui.returnSource=""; gui.setPage("main.qml"); }
-        anchors.horizontalCenter: parent.horizontalCenter; anchors.leftMargin: 3
+        id: btnPoint; icon: "gui_arrow_up.svg"; text: "Point"; onClicked: { gui.returnSource=""; gui.setPage("point.qml"); }
+        anchors.left: btnMap.left; anchors.leftMargin: parent.width/3;
+        anchors.bottom: parent.bottom; anchors.bottomMargin: 3
+       opacity: 0;
+    }
+
+    ButtonIcon {
+        id: btnMenu; icon: "gui_menu.svg"; text: "Menu"; onClicked: { gui.returnSource=""; gui.setPage("main.qml"); }
+        anchors.right: btnBack.right; anchors.rightMargin: parent.width/3;
         anchors.bottom: parent.bottom; anchors.bottomMargin: 3
+       opacity: 0;
     }
 
     ButtonIcon {
         id: btnBack; icon: "gui_arrow_left.svg"; text: "Back"; onClicked: gui.backToPrevPage();
         anchors.right: parent.right; anchors.leftMargin: 3
         anchors.bottom: parent.bottom; anchors.bottomMargin: 3
+       opacity: 0;
     }
 
 }