From e5bb85eb7e1bad9b07d098474c804532829539fa Mon Sep 17 00:00:00 2001 From: akashihi Date: Mon, 12 Apr 2010 11:27:55 +0000 Subject: [PATCH] Fix:gui/qml:returnSource now correctly built git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@3163 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/navit/gui/qml/guiProxy.h | 11 +++++++---- navit/navit/gui/qml/skins/navit/Cellar.qml | 22 ++++++---------------- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/navit/navit/gui/qml/guiProxy.h b/navit/navit/gui/qml/guiProxy.h index 57f6cdd..7b5b942 100644 --- a/navit/navit/gui/qml/guiProxy.h +++ b/navit/navit/gui/qml/guiProxy.h @@ -44,7 +44,6 @@ signals: void heightSignal(int); public slots: void setPage(QString page,bool hidden=false) { - dbg(0,"Page is: %s\n",page.toStdString().c_str()); this->source+="/"+page; #if QT_VERSION < 0x040700 @@ -100,9 +99,13 @@ public slots: returnList.takeLast();//Remove current element returnPage=returnList.takeLast(); //Set previous element as return page and remove it from the list } - this->source=returnList.join(QString("/")); - if (!this->source.startsWith("/")) { - this->source.prepend(QString("/")); + if (returnList.size()>0) { + this->source=returnList.join(QString("/")); + if (!this->source.startsWith("/")) { + this->source.prepend(QString("/")); + } + } else { + this->source.clear(); } this->setPage(returnPage); } diff --git a/navit/navit/gui/qml/skins/navit/Cellar.qml b/navit/navit/gui/qml/skins/navit/Cellar.qml index 4af1be4..953a4a0 100644 --- a/navit/navit/gui/qml/skins/navit/Cellar.qml +++ b/navit/navit/gui/qml/skins/navit/Cellar.qml @@ -2,15 +2,12 @@ import Qt 4.6 Rectangle { - function onStartup() { + function onStartup() { if ( gui.returnSource.split('/').length > 2 ) { btnBack.opacity=1; } - if ( gui.returnSource != "/point.qml" ) { - btnPoint.opacity=1 - } - if ( gui.returnSource != "/main.qml" ) { - btnMenu.opacity=1; + if ( gui.returnSource == "/main.qml" ) { + btnQuit.opacity=1; } } @@ -23,21 +20,14 @@ Rectangle { } ButtonIcon { - 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; + 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; } ButtonIcon { - id: btnBack; icon: "gui_arrow_left.svg"; text: "Back"; onClicked: gui.backToPrevPage(); + id: btnQuit; icon: "gui_quit.svg"; text: "Quit"; onClicked: navit.quit() anchors.right: parent.right; anchors.leftMargin: 3 anchors.bottom: parent.bottom; anchors.bottomMargin: 3 opacity: 0; -- 2.7.4