diff --git a/qml/Utils.js b/qml/Utils.js
index c5b40a5..c5257dd 100644
--- a/qml/Utils.js
+++ b/qml/Utils.js
@@ -32,5 +32,8 @@ function itemModelImageUrl(baseUrl, itemId, tag, type, options) {
}
}
return baseUrl + "/Items/" + itemId + "/Images/" + type + "?tag=" + tag + extraQuery
-
+}
+
+function usePortraitCover(itemType) {
+ return ["Series", "Movie"].indexOf(itemType) >= 0
}
diff --git a/qml/harbour-sailfin.qml b/qml/harbour-sailfin.qml
index 8500264..a71dd80 100644
--- a/qml/harbour-sailfin.qml
+++ b/qml/harbour-sailfin.qml
@@ -9,7 +9,6 @@ import "pages"
ApplicationWindow {
id: appWindow
- property bool isInSetup: false
property bool _hasInitialized: false
// The global mediaPlayer instance
readonly property MediaPlayer mediaPlayer: _mediaPlayer
@@ -29,7 +28,14 @@ ApplicationWindow {
target: ApiClient
onNetworkError: errorNotification.show("Network error: " + error)
onConnectionFailed: errorNotification.show("Connect error: " + error)
- //onConnectionSuccess: errorNotification.show("Success: " + loginMessage)
+ //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) {
+ pageStack.replace(Qt.resolvedUrl("pages/setup/AddServerPage.qml"), {"backNavigation": false});
+ }
+ }
}
MediaPlayer {
@@ -42,12 +48,7 @@ ApplicationWindow {
Connections {
target: ApiClient
// Replace the MainPage if no server was set up.
- onSetupRequired: {
- if (!isInSetup) {
- isInSetup = true;
- pageStack.replace(Qt.resolvedUrl("pages/setup/AddServerPage.qml"), {"backNavigation": false});
- }
- }
+
}
onStatusChanged: {
if (status == PageStatus.Active && !_hasInitialized) {
diff --git a/qml/pages/MainPage.qml b/qml/pages/MainPage.qml
index 814ed1c..5e7fd55 100644
--- a/qml/pages/MainPage.qml
+++ b/qml/pages/MainPage.qml
@@ -73,7 +73,6 @@ Page {
clip: true
height: {
if (count > 0) {
- console.log(collectionType)
if (["tvshows", "movies"].indexOf(collectionType) == -1) {
Constants.libraryDelegateHeight
} else {
@@ -99,7 +98,7 @@ Page {
/*model.imageTags["Primary"] ? ApiClient.baseUrl + "/Items/" + model.id
+ "/Images/Primary?maxHeight=" + height + "&tag=" + model.imageTags["Primary"]
: ""*/
- landscape: ["Series", "Movie"].indexOf(model.type) == -1
+ landscape: !Utils.usePortraitCover(model.type)
onClicked: {
pageStack.push(Qt.resolvedUrl("DetailPage.qml"), {"itemId": model.id})
diff --git a/qml/pages/setup/AddServerPage.qml b/qml/pages/setup/AddServerPage.qml
index de1368f..f48859c 100644
--- a/qml/pages/setup/AddServerPage.qml
+++ b/qml/pages/setup/AddServerPage.qml
@@ -14,6 +14,7 @@ Dialog {
readonly property string address: serverSelect.currentItem._address
readonly property bool addressCorrect: serverSelect.currentIndex > 0 || manualAddress.acceptableInput
readonly property string serverName: serverSelect.currentItem._name
+ readonly property bool _isSetupPage: true
acceptDestination: AddServerConnectingPage {
diff --git a/qml/pages/setup/LoginDialog.qml b/qml/pages/setup/LoginDialog.qml
index 927363d..b96fadb 100644
--- a/qml/pages/setup/LoginDialog.qml
+++ b/qml/pages/setup/LoginDialog.qml
@@ -35,7 +35,7 @@ Dialog {
onAuthenticatedChanged: {
if (ApiClient.authenticated) {
console.log("authenticated!")
- pageStack.replaceAbove(pageStack.previousPage(firstPage), Qt.resolvedUrl("../MainPage.qml"))
+ pageStack.replaceAbove(null, Qt.resolvedUrl("../MainPage.qml"))
}
}
onAuthenticationError: {
diff --git a/src/credentialmanager.cpp b/src/credentialmanager.cpp
index 31700ef..8f2404c 100644
--- a/src/credentialmanager.cpp
+++ b/src/credentialmanager.cpp
@@ -34,6 +34,14 @@ void FallbackCredentialsManager::get(const QString &server, const QString &user)
void FallbackCredentialsManager::remove(const QString &server, const QString &user) {
m_settings.remove(urlToGroupName(server) + "/users/" + user);
+
+ // Check if only the /address key is left. In this case, the server section should be removed.
+ m_settings.beginGroup(urlToGroupName(server));
+ int childGroupsCount = m_settings.childGroups().count();
+ m_settings.endGroup();
+ if (childGroupsCount == 0) {
+ m_settings.remove(urlToGroupName(server));
+ }
}
void FallbackCredentialsManager::listServers() const {
diff --git a/translations/harbour-sailfin.ts b/translations/harbour-sailfin.ts
index ff900a3..d4025b5 100644
--- a/translations/harbour-sailfin.ts
+++ b/translations/harbour-sailfin.ts
@@ -109,26 +109,31 @@
+ Dialog action
+ Section header for entering username and password
+ Label placeholder for username field
-
-
-
-
+ Label placeholder for password field
+ Message shown on login, configured by the server owner. Some form of a MOTD
+
+
+
+
@@ -207,6 +212,10 @@
+
+
+
+
UnsupportedDetails