diff --git a/CMakeLists.txt b/CMakeLists.txt index ed71c47..ca10fd6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,6 @@ set (CMAKE_CXX_STANDARD 17) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") set(CMAKE_AUTOMOC ON) cmake_policy(SET CMP0048 NEW) -set(CMAKE_CXX_STANDARD 17) # Options option(PLATFORM_SAILFISHOS "Build SailfishOS version of application" OFF) diff --git a/sailfish/CMakeLists.txt b/sailfish/CMakeLists.txt index 1ad5f8d..7c417ed 100644 --- a/sailfish/CMakeLists.txt +++ b/sailfish/CMakeLists.txt @@ -44,7 +44,8 @@ set(sailfin_QML_SOURCES qml/pages/LegalPage.qml qml/pages/MainPage.qml qml/pages/AboutPage.qml - qml/harbour-sailfin.qml + qml/harbour-sailfin.qml + qml/pages/ConnectingPage.qml qml/pages/SettingsPage.qml qml/pages/VideoPage.qml qml/pages/itemdetails/BaseDetailPage.qml @@ -110,6 +111,4 @@ install(FILES icons/172x172/harbour-sailfin.png # Search the Qt Creator Manual to learn about the QtCreatorDeployment.txt file # format. file(WRITE "${CMAKE_BINARY_DIR}/QtCreatorDeployment.txt" - "${CMAKE_INSTALL_PREFIX} - ${CMAKE_BINARY_DIR}/sailfish/harbour-sailfin:bin -") + "${CMAKE_INSTALL_PREFIX}\n${CMAKE_BINARY_DIR}/sailfish/harbour-sailfin:bin") diff --git a/sailfish/harbour-sailfin.desktop b/sailfish/harbour-sailfin.desktop index 72ea2b7..e9f8b13 100644 --- a/sailfish/harbour-sailfin.desktop +++ b/sailfish/harbour-sailfin.desktop @@ -4,8 +4,6 @@ Version=1.1 X-Nemo-Application-Type=silica-qt5 Icon=harbour-sailfin Exec=harbour-sailfin -#Exec=/usr/bin/sailjail -p harbour-sailfin.desktop /usr/bin/harbour-sailfin - Name=Sailfin # translation example: # your app name in German locale (de) diff --git a/sailfish/qml/components/PlaybackBar.qml b/sailfish/qml/components/PlaybackBar.qml index b15734d..8eaca7a 100644 --- a/sailfish/qml/components/PlaybackBar.qml +++ b/sailfish/qml/components/PlaybackBar.qml @@ -68,7 +68,7 @@ PanelBackground { } width: height Binding on blurhash { - when: manager.item !== null && "Primary" in manager.item.imageBlurHashes + when: manager.item !== null && "Primary" in manager.item.imageBlurHashes && "Primary" in manager.item.imageTags value: manager.item.imageBlurHashes["Primary"][manager.item.imageTags["Primary"]] } source: largeAlbumArt.source diff --git a/sailfish/qml/harbour-sailfin.qml b/sailfish/qml/harbour-sailfin.qml index 779cbee..7a69ad3 100644 --- a/sailfish/qml/harbour-sailfin.qml +++ b/sailfish/qml/harbour-sailfin.qml @@ -62,18 +62,12 @@ ApplicationWindow { onRaiseRequested: appWindow.raise() } - initialPage: Component { - MainPage { - Connections { - target: apiClient - // Replace the MainPage if no server was set up. - - } - onStatusChanged: { - if (status == PageStatus.Active && !_hasInitialized) { - _hasInitialized = true; - apiClient.restoreSavedSession(); - } + initialPage: ConnectingPage { + id: connectingPage + onStatusChanged: { + if (connectingPage.status == PageStatus.Active && !_hasInitialized) { + _hasInitialized = true; + apiClient.restoreSavedSession(); } } } @@ -171,11 +165,36 @@ ApplicationWindow { onConnectionFailed: errorNotification.show("Connect error: " + error) //onConnectionSuccess: errorNotification.show("Success: " + loginMessage) onSetupRequired: { - var isInSetup = pageStack.find(function (page) { return typeof page._isSetupPage !== "undefined" }) !== null - console.log("Is in setup: " + isInSetup) - if (!isInSetup) { + console.log("Is in setup: " + isInSetup()) + if (!isInSetup()) { pageStack.replace(Qt.resolvedUrl("pages/setup/AddServerPage.qml"), {"backNavigation": false}); } } + onAuthenticatedChanged: { + if (authenticated && !isInSetup()) { + console.log("Authenticated)") + loginAnimation.start() + //pageStack.replace(Qt.resolvedUrl("pages/MainPage.qml")) + } + } + } + + // Delaying the creation of the MainPage prevents the application from freezing + // if connecting to the server over HTTPS + // TODO: figure out why the application actually freezes and remove this workaround + SequentialAnimation { + id: loginAnimation + + PauseAnimation { + duration: 250 + } + + ScriptAction { + script: pageStack.replace(Qt.resolvedUrl("pages/MainPage.qml"), {}, PageStackAction.Immediate) + } + } + + function isInSetup() { + return pageStack.find(function (page) { return typeof page._isSetupPage !== "undefined" }) !== null } } diff --git a/sailfish/qml/pages/ConnectingPage.qml b/sailfish/qml/pages/ConnectingPage.qml new file mode 100644 index 0000000..8cec2ce --- /dev/null +++ b/sailfish/qml/pages/ConnectingPage.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 + +Page { + PageBusyIndicator { + running: true + } +} diff --git a/sailfish/qml/pages/MainPage.qml b/sailfish/qml/pages/MainPage.qml index 9255f9c..d895271 100644 --- a/sailfish/qml/pages/MainPage.qml +++ b/sailfish/qml/pages/MainPage.qml @@ -222,7 +222,7 @@ Page { delegate: LibraryItemDelegate { property string id: model.jellyfinId title: model.name - poster: Utils.itemModelImageUrl(appWindow.apiClient.baseUrl, model.jellyfinId, model.imageTags["Primary"], "Primary", {"maxHeight": height}) + poster: Utils.itemModelImageUrl(appWindow.apiClient.baseUrl, model.jellyfinId, model.imageTags["Primary"], "Primary", {"height": height}) Binding on blurhash { when: poster !== "" value: model.imageBlurHashes["Primary"][model.imageTags["Primary"]]