From 3896b9ab4f0bfaf480f1f060f08df6f6451aee47 Mon Sep 17 00:00:00 2001 From: Tim Bert <5411131+timbms@users.noreply.github.com> Date: Sun, 19 Jun 2022 15:20:44 +0200 Subject: [PATCH] Addressing #670 - Different sort orders on sitemaps (#672) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Addressing #670 - Different sort orders on sitemaps * Including localizations Signed-off-by: Tim Müller-Seydlitz --- .../Sources/OpenHABCore/Util/Endpoint.swift | 5 ++ .../OpenHABCore/Util/Preferences.swift | 2 +- openHAB/Main.storyboard | 63 ++++++++++++++----- .../OpenHABDrawerTableViewController.swift | 8 ++- openHAB/OpenHABSettingsViewController.swift | 11 +++- openHAB/OpenHABWebViewController.swift | 1 - .../Resources/de.lproj/Localizable.strings | 2 + .../Resources/en.lproj/Localizable.strings | 1 + .../Resources/es.lproj/Localizable.strings | 1 + .../Resources/fi.lproj/Localizable.strings | 1 + .../Resources/fr.lproj/Localizable.strings | 1 + .../Resources/it.lproj/Localizable.strings | 1 + .../Resources/nl.lproj/Localizable.strings | 1 + .../Resources/ru.lproj/Localizable.strings | 1 + openHABTestsSwift/OpenHABEndPoint.swift | 15 ++--- 15 files changed, 85 insertions(+), 29 deletions(-) diff --git a/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift b/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift index a61e3fc40..3b62acc90 100644 --- a/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift +++ b/OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift @@ -22,6 +22,11 @@ public enum IconType: Int { case svg } +public enum SortSitemapsOrder: Int { + case label + case name +} + public struct Endpoint { let baseURL: String let path: String diff --git a/OpenHABCore/Sources/OpenHABCore/Util/Preferences.swift b/OpenHABCore/Sources/OpenHABCore/Util/Preferences.swift index dec4db81a..a46de6456 100644 --- a/OpenHABCore/Sources/OpenHABCore/Util/Preferences.swift +++ b/OpenHABCore/Sources/OpenHABCore/Util/Preferences.swift @@ -77,7 +77,6 @@ public enum Preferences { @UserDefaultURL("localUrl", defaultValue: "") public static var localUrl: String @UserDefaultURL("remoteUrl", defaultValue: "https://myopenhab.org") public static var remoteUrl: String - @UserDefault("username", defaultValue: "test") public static var username: String @UserDefault("password", defaultValue: "test") public static var password: String @UserDefault("alwaysSendCreds", defaultValue: false) public static var alwaysSendCreds: Bool @@ -89,6 +88,7 @@ public enum Preferences { @UserDefault("iconType", defaultValue: 0) public static var iconType: Int @UserDefault("defaultSitemap", defaultValue: "demo") public static var defaultSitemap: String @UserDefault("sendCrashReports", defaultValue: false) public static var sendCrashReports: Bool + @UserDefault("sortSitemapsBy", defaultValue: 0) public static var sortSitemapsby: Int // MARK: - Private diff --git a/openHAB/Main.storyboard b/openHAB/Main.storyboard index a84ada41b..780ea339b 100644 --- a/openHAB/Main.storyboard +++ b/openHAB/Main.storyboard @@ -1,9 +1,9 @@ - + - + @@ -53,11 +53,11 @@ - +