Skip to content
This repository has been archived by the owner on Jul 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #206 from DylanVanAssche/develop
Browse files Browse the repository at this point in the history
Bump to V4.8-0
  • Loading branch information
DylanVanAssche committed Mar 31, 2019
2 parents a47116e + cfccaf3 commit 4fd6b38
Show file tree
Hide file tree
Showing 23 changed files with 647 additions and 137 deletions.
10 changes: 6 additions & 4 deletions harbour-sailfinder.pro
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ SOURCES += src/harbour-sailfinder.cpp \

DISTFILES += qml/harbour-sailfinder.qml \
qml/pages/CoverPage.qml \
qml/pages/FirstPage.qml \
qml/pages/MainPage.qml \
qml/pages/AboutPage.qml \
qml/pages/MatchesView.qml \
Expand Down Expand Up @@ -99,8 +98,12 @@ DISTFILES += qml/harbour-sailfinder.qml \
qml/components/TextMessage.qml \
qml/components/GIFMessage.qml \
qml/pages/GIFPage.qml \
qml/pages/TermsPage.qml
qml/components/SchoolJobDelegate.qml
qml/pages/TermsPage.qml \
qml/pages/LoginPhone.qml \
qml/pages/ValidatePhone.qml \
qml/pages/WelcomePage.qml \
qml/components/SchoolJobDelegate.qml \
qml/pages/LoginFacebook.qml

SAILFISHAPP_ICONS = 86x86 108x108 128x128 256x256

Expand Down Expand Up @@ -144,5 +147,4 @@ HEADERS += \
src/models/matcheslistmodel.h \
src/parsers/giphy.h \
src/models/gif.h \
src/keys.h \
src/models/giflistmodel.h
4 changes: 2 additions & 2 deletions qml/components/RecommendationsCover.qml
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@ Item {
iconSource: "../resources/images/dislike.png"
onTriggered: {
_loaded = false
api.passUser(api.recommendation.id)
api.passUser(api.recommendation.id, api.recommendation.sNumber)
}
}

CoverAction {
iconSource: "../resources/images/like.png"
onTriggered: {
_loaded = false
api.likeUser(api.recommendation.id)
api.likeUser(api.recommendation.id, api.recommendation.sNumber)
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions qml/harbour-sailfinder.qml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ ApplicationWindow
property int swipeViewIndex: 0

Component {
id: firstPage
FirstPage {}
id: welcomePage
WelcomePage {}
}

Component {
Expand All @@ -39,7 +39,7 @@ ApplicationWindow
}

id: app
initialPage: temp.readTerms? firstPage: termsPage
initialPage: temp.readTerms? welcomePage: termsPage
cover: Qt.resolvedUrl("pages/CoverPage.qml")
allowedOrientations: defaultAllowedOrientations
onNetworkStatusChanged: {
Expand Down
28 changes: 10 additions & 18 deletions qml/pages/FirstPage.qml → qml/pages/LoginFacebook.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Page {
if(fbToken.length > 0) {
loader.visible = true
tinderLogin.visible = true
api.login(fbToken)
api.login(fbToken, false, "")
}
}

Expand All @@ -39,7 +39,8 @@ Page {
onAuthenticatedChanged: {
if(api.authenticated) {
console.debug("Tinder token successfully retrieved")
pageStack.replace(Qt.resolvedUrl("../pages/MainPage.qml"))
pageStack.clear()
pageStack.push(Qt.resolvedUrl("../pages/MainPage.qml"))
}
}
}
Expand All @@ -54,11 +55,17 @@ Page {
}
}

PageHeader {
id: header
//% "Log in with Facebook"
title: qsTrId("sailfinder-login-facebook")
}

SilicaWebView {
id: webview

anchors {
top: parent.top
top: header.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
Expand Down Expand Up @@ -130,21 +137,6 @@ Page {

Behavior on opacity { FadeAnimation {} }

PullDownMenu {
MenuItem {
text: _mode === "accountkit"?
//% "Use Facebook login"
qsTrId("sailfinder-login-facebook"):
//% "Use phone login"
qsTrId("sailfinder-login-phone")
onClicked: {
_mode === "accountkit"? _mode = "facebook": _mode = "accountkit"
console.debug("Authentication mode: " + _mode)
}
visible: false // Undo when phone login support is enabled
}
}

ViewPlaceholder {
id: errorLogin
//% "Oops!"
Expand Down
76 changes: 76 additions & 0 deletions qml/pages/LoginPhone.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* This file is part of Sailfinder.
*
* Sailfinder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Sailfinder is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Sailfinder. If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 2.0
import Sailfish.Silica 1.0

Page {
id: loginPhone

Connections {
target: api
onRequestCodeChanged: pageStack.replace(Qt.resolvedUrl("../pages/ValidatePhone.qml"))
}

SilicaFlickable {
anchors.fill: parent
contentHeight: column.height + Theme.paddingLarge
contentWidth: parent.width

VerticalScrollDecorator {}

Column {
id: column
width: parent.width - Theme.paddingLarge
spacing: Theme.paddingLarge

PageHeader {
//% "Log in with phone number"
title: qsTrId("sailfinder-login-phone")
}

Label {
//% "Please enter your phone number in international format (with country code)"
text: qsTrId("sailfinder-enter-phone")
wrapMode: Text.Wrap
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
}

TextField {
id: phone
width: parent.width
inputMethodHints: Qt.ImhDialableCharactersOnly
//% "Phone number"
label: qsTrId("sailfinder-phone-number")
placeholderText: label
placeholderColor: Theme.highlightColor
color: Theme.highlightColor
anchors.horizontalCenter: parent.horizontalCenter
EnterKey.iconSource: "image://theme/icon-m-enter-close"
EnterKey.onClicked: focus = false
}

Button {
//% "Send SMS code"
text: qsTrId("sailfinder-send-sms")
anchors.horizontalCenter: parent.horizontalCenter
onClicked: api.authSendSMS(phone.text)
}
}
}
}
4 changes: 2 additions & 2 deletions qml/pages/ProfileView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ SilicaFlickable {
updatesTimer.start()
}

onLoggedOut: pageStack.replace(Qt.resolvedUrl("../pages/FirstPage.qml"), { clearData: true })
onDeleteAccount: pageStack.replace(Qt.resolvedUrl("../pages/FirstPage.qml"), { clearData: true })
onLoggedOut: pageStack.replace(Qt.resolvedUrl("../pages/WelcomePage.qml"), { clearData: true })
onDeleteAccount: pageStack.replace(Qt.resolvedUrl("../pages/WelcomePage.qml"), { clearData: true })

onPersistentPollIntervalChanged: {
if(api.persistentPollInterval > 0) {
Expand Down
6 changes: 3 additions & 3 deletions qml/pages/RecommendationsView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,17 @@ SilicaFlickable {
id: recsBar
onLiked: {
loaded = false
api.likeUser(api.recommendation.id)
api.likeUser(api.recommendation.id, api.recommendation.sNumber)
photoList.closeFullScreen()
}
onSuperliked: {
loaded = false
api.superlikeUser(api.recommendation.id)
api.superlikeUser(api.recommendation.id, api.recommendation.sNumber)
photoList.closeFullScreen()
}
onPassed: {
loaded = false
api.passUser(api.recommendation.id)
api.passUser(api.recommendation.id, api.recommendation.sNumber)
photoList.closeFullScreen()
}
}
Expand Down
2 changes: 1 addition & 1 deletion qml/pages/TermsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Page {
preferredWidth: Theme.buttonWidthMedium
onClicked: {
temp.readTerms = true
pageStack.replace(Qt.resolvedUrl("../pages/FirstPage.qml"))
pageStack.replace(Qt.resolvedUrl("../pages/WelcomePage.qml"))
}
}

Expand Down
82 changes: 82 additions & 0 deletions qml/pages/ValidatePhone.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* This file is part of Sailfinder.
*
* Sailfinder is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Sailfinder is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Sailfinder. If not, see <http://www.gnu.org/licenses/>.
*/

import QtQuick 2.0
import Sailfish.Silica 1.0

Page {
id: validatePhone

Connections {
target: api
onAuthenticatedChanged: {
if(api.authenticated) {
console.debug("Tinder token successfully retrieved")
pageStack.clear()
pageStack.push(Qt.resolvedUrl("../pages/MainPage.qml"))
}
}
}

SilicaFlickable {
anchors.fill: parent
contentHeight: column.height + Theme.paddingLarge
contentWidth: parent.width

VerticalScrollDecorator {}

Column {
id: column
width: parent.width - Theme.paddingLarge
spacing: Theme.paddingLarge

PageHeader {
//% "Log in with phone number"
title: qsTrId("sailfinder-login-phone")
}

Label {
//% "Please enter verification code"
text: qsTrId("sailfinder-enter-sms-code")
wrapMode: Text.Wrap
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
}

TextField {
id: code
width: parent.width
inputMethodHints: Qt.ImhDialableCharactersOnly
//% "SMS code"
label: qsTrId("sailfinder-sms-code")
placeholderText: label
placeholderColor: Theme.highlightColor
color: Theme.highlightColor
anchors.horizontalCenter: parent.horizontalCenter
EnterKey.iconSource: "image://theme/icon-m-enter-close"
EnterKey.onClicked: focus = false
}

Button {
//% "Log in"
text: qsTrId("sailfinder-log-in")
anchors.horizontalCenter: parent.horizontalCenter
onClicked: api.authVerifySMS(code.text)
}
}
}
}
Loading

0 comments on commit 4fd6b38

Please sign in to comment.