瀏覽代碼

##2217

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 年之前
父節點
當前提交
bc680aabea
共有 52 個文件被更改,包括 165 次插入446 次删除
  1. 0 88
      Nextcloud.xcodeproj/project.pbxproj
  2. 11 3
      Widget/Dashboard/DashboardData.swift
  3. 2 2
      Widget/Dashboard/DashboardWidgetProvider.swift
  4. 121 1
      Widget/Dashboard/Intent/Base.lproj/Dashboard.intentdefinition
  5. 0 8
      Widget/Dashboard/Intent/ca.lproj/Dashboard.strings
  6. 0 8
      Widget/Dashboard/Intent/cs-CZ.lproj/Dashboard.strings
  7. 0 8
      Widget/Dashboard/Intent/da.lproj/Dashboard.strings
  8. 0 8
      Widget/Dashboard/Intent/de.lproj/Dashboard.strings
  9. 0 8
      Widget/Dashboard/Intent/en-GB.lproj/Dashboard.strings
  10. 0 8
      Widget/Dashboard/Intent/en.lproj/Dashboard.strings
  11. 0 8
      Widget/Dashboard/Intent/es-419.lproj/Dashboard.strings
  12. 0 8
      Widget/Dashboard/Intent/es-CL.lproj/Dashboard.strings
  13. 0 8
      Widget/Dashboard/Intent/es-CO.lproj/Dashboard.strings
  14. 0 8
      Widget/Dashboard/Intent/es-CR.lproj/Dashboard.strings
  15. 0 8
      Widget/Dashboard/Intent/es-DO.lproj/Dashboard.strings
  16. 0 8
      Widget/Dashboard/Intent/es-EC.lproj/Dashboard.strings
  17. 0 8
      Widget/Dashboard/Intent/es-GT.lproj/Dashboard.strings
  18. 0 8
      Widget/Dashboard/Intent/es-HN.lproj/Dashboard.strings
  19. 0 8
      Widget/Dashboard/Intent/es-MX.lproj/Dashboard.strings
  20. 0 8
      Widget/Dashboard/Intent/es-NI.lproj/Dashboard.strings
  21. 0 8
      Widget/Dashboard/Intent/es-PA.lproj/Dashboard.strings
  22. 0 8
      Widget/Dashboard/Intent/es-PE.lproj/Dashboard.strings
  23. 0 8
      Widget/Dashboard/Intent/es-PR.lproj/Dashboard.strings
  24. 0 8
      Widget/Dashboard/Intent/es-PY.lproj/Dashboard.strings
  25. 0 8
      Widget/Dashboard/Intent/es-SV.lproj/Dashboard.strings
  26. 0 8
      Widget/Dashboard/Intent/es-UY.lproj/Dashboard.strings
  27. 0 8
      Widget/Dashboard/Intent/es.lproj/Dashboard.strings
  28. 0 8
      Widget/Dashboard/Intent/eu.lproj/Dashboard.strings
  29. 0 8
      Widget/Dashboard/Intent/fr.lproj/Dashboard.strings
  30. 0 8
      Widget/Dashboard/Intent/gl.lproj/Dashboard.strings
  31. 0 8
      Widget/Dashboard/Intent/hu.lproj/Dashboard.strings
  32. 0 8
      Widget/Dashboard/Intent/is.lproj/Dashboard.strings
  33. 0 8
      Widget/Dashboard/Intent/it.lproj/Dashboard.strings
  34. 0 8
      Widget/Dashboard/Intent/ja-JP.lproj/Dashboard.strings
  35. 0 8
      Widget/Dashboard/Intent/ka-GE.lproj/Dashboard.strings
  36. 0 8
      Widget/Dashboard/Intent/ko.lproj/Dashboard.strings
  37. 0 8
      Widget/Dashboard/Intent/nb-NO.lproj/Dashboard.strings
  38. 0 8
      Widget/Dashboard/Intent/nl.lproj/Dashboard.strings
  39. 0 8
      Widget/Dashboard/Intent/pl.lproj/Dashboard.strings
  40. 0 8
      Widget/Dashboard/Intent/pt-BR.lproj/Dashboard.strings
  41. 0 8
      Widget/Dashboard/Intent/pt-PT.lproj/Dashboard.strings
  42. 0 8
      Widget/Dashboard/Intent/ru.lproj/Dashboard.strings
  43. 0 8
      Widget/Dashboard/Intent/sk-SK.lproj/Dashboard.strings
  44. 0 8
      Widget/Dashboard/Intent/sr.lproj/Dashboard.strings
  45. 0 8
      Widget/Dashboard/Intent/sv.lproj/Dashboard.strings
  46. 0 8
      Widget/Dashboard/Intent/tr.lproj/Dashboard.strings
  47. 0 8
      Widget/Dashboard/Intent/zh-Hans.lproj/Dashboard.strings
  48. 0 8
      Widget/Dashboard/Intent/zh-Hant-TW.lproj/Dashboard.strings
  49. 28 0
      WidgetDashboardIntentHandler/IntentHandler.swift
  50. 1 0
      iOSClient/Brand/WidgetDashboardIntentHandler.plist
  51. 1 0
      iOSClient/Brand/iOSClient.plist
  52. 1 0
      iOSClient/Supporting Files/en.lproj/Localizable.strings

+ 0 - 88
Nextcloud.xcodeproj/project.pbxproj

@@ -712,7 +712,6 @@
 		F710D1F42405770F00A6033D /* NCViewerPDF.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCViewerPDF.swift; sourceTree = "<group>"; };
 		F710D2012405826100A6033D /* NCViewer+Menu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "NCViewer+Menu.swift"; sourceTree = "<group>"; };
 		F710E80F1EF95C9C00DC2427 /* ImagesIntro.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = ImagesIntro.xcassets; sourceTree = "<group>"; };
-		F711D63328F47A66003F43C8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Dashboard.strings; sourceTree = "<group>"; };
 		F7134184259747BA00768D21 /* NCPushNotification.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NCPushNotification.h; sourceTree = "<group>"; };
 		F7134185259747BA00768D21 /* NCPushNotification.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NCPushNotification.m; sourceTree = "<group>"; };
 		F713FEFE2472764000214AF6 /* UIImage+animatedGIF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+animatedGIF.h"; sourceTree = "<group>"; };
@@ -1036,49 +1035,6 @@
 		F7CB689F254169530050EC94 /* NCSettings.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCSettings.storyboard; sourceTree = "<group>"; };
 		F7CBC31B24F78E79004D3812 /* NCSortMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCSortMenu.swift; sourceTree = "<group>"; };
 		F7CC04E61F5AD50D00378CEF /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = "<group>"; };
-		F7CD836428F6B4DA00E93B11 /* eu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = eu; path = eu.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD836628F6B4DA00E93B11 /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD836828F6B4DB00E93B11 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD836A28F6B4DC00E93B11 /* zh-Hant-TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant-TW"; path = "zh-Hant-TW.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD836C28F6B4DC00E93B11 /* cs-CZ */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "cs-CZ"; path = "cs-CZ.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD836E28F6B4DD00E93B11 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD837028F6B4E100E93B11 /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD837228F6B4E300E93B11 /* en-GB */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "en-GB"; path = "en-GB.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD837428F6B4E700E93B11 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD837628F6B4E800E93B11 /* gl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = gl; path = gl.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD837828F6B4EA00E93B11 /* ka-GE */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "ka-GE"; path = "ka-GE.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD837A28F6B4EC00E93B11 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD837C28F6B4ED00E93B11 /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD837E28F6B4EE00E93B11 /* is */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = is; path = is.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD838028F6B4EF00E93B11 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD838228F6B4F000E93B11 /* ja-JP */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "ja-JP"; path = "ja-JP.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD838428F6B4F200E93B11 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = ko.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD838628F6B4F300E93B11 /* nb-NO */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "nb-NO"; path = "nb-NO.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD838828F6B4F400E93B11 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD838A28F6B4F800E93B11 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD838C28F6B4F900E93B11 /* pt-PT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-PT"; path = "pt-PT.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD838E28F6B4F900E93B11 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD839028F6B4FA00E93B11 /* sr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sr; path = sr.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD839228F6B4FB00E93B11 /* sk-SK */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sk-SK"; path = "sk-SK.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD839428F6B4FC00E93B11 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD839628F6B4FC00E93B11 /* es-CL */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-CL"; path = "es-CL.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD839828F6B4FD00E93B11 /* es-CO */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-CO"; path = "es-CO.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD839A28F6B4FE00E93B11 /* es-CR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-CR"; path = "es-CR.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD839C28F6B4FF00E93B11 /* es-DO */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-DO"; path = "es-DO.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD839E28F6B4FF00E93B11 /* es-EC */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-EC"; path = "es-EC.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83A028F6B50000E93B11 /* es-SV */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-SV"; path = "es-SV.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83A228F6B50100E93B11 /* es-GT */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-GT"; path = "es-GT.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83A428F6B50100E93B11 /* es-HN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-HN"; path = "es-HN.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83A628F6B50200E93B11 /* es-419 */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-419"; path = "es-419.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83A828F6B50300E93B11 /* es-MX */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-MX"; path = "es-MX.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83AA28F6B50400E93B11 /* es-NI */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-NI"; path = "es-NI.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83AC28F6B50400E93B11 /* es-PA */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-PA"; path = "es-PA.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83AE28F6B50500E93B11 /* es-PY */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-PY"; path = "es-PY.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83B028F6B50600E93B11 /* es-PE */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-PE"; path = "es-PE.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83B228F6B50700E93B11 /* es-PR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-PR"; path = "es-PR.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83B428F6B50700E93B11 /* es-UY */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-UY"; path = "es-UY.lproj/Dashboard.strings"; sourceTree = "<group>"; };
-		F7CD83B628F6B50800E93B11 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Dashboard.strings; sourceTree = "<group>"; };
-		F7CD83B828F6B50800E93B11 /* tr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = tr; path = tr.lproj/Dashboard.strings; sourceTree = "<group>"; };
 		F7CE8AFA1DC1F8D8009CAE48 /* Nextcloud.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Nextcloud.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		F7CE8AFB1DC1F8D8009CAE48 /* Share.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = Share.appex; sourceTree = BUILT_PRODUCTS_DIR; };
 		F7D0F33D264144FC0097D4A3 /* Background.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Background.xcassets; sourceTree = "<group>"; };
@@ -3252,50 +3208,6 @@
 			isa = PBXVariantGroup;
 			children = (
 				F7FABE3828D1DAD00000A325 /* Base */,
-				F711D63328F47A66003F43C8 /* en */,
-				F7CD836428F6B4DA00E93B11 /* eu */,
-				F7CD836628F6B4DA00E93B11 /* ca */,
-				F7CD836828F6B4DB00E93B11 /* zh-Hans */,
-				F7CD836A28F6B4DC00E93B11 /* zh-Hant-TW */,
-				F7CD836C28F6B4DC00E93B11 /* cs-CZ */,
-				F7CD836E28F6B4DD00E93B11 /* da */,
-				F7CD837028F6B4E100E93B11 /* nl */,
-				F7CD837228F6B4E300E93B11 /* en-GB */,
-				F7CD837428F6B4E700E93B11 /* fr */,
-				F7CD837628F6B4E800E93B11 /* gl */,
-				F7CD837828F6B4EA00E93B11 /* ka-GE */,
-				F7CD837A28F6B4EC00E93B11 /* de */,
-				F7CD837C28F6B4ED00E93B11 /* hu */,
-				F7CD837E28F6B4EE00E93B11 /* is */,
-				F7CD838028F6B4EF00E93B11 /* it */,
-				F7CD838228F6B4F000E93B11 /* ja-JP */,
-				F7CD838428F6B4F200E93B11 /* ko */,
-				F7CD838628F6B4F300E93B11 /* nb-NO */,
-				F7CD838828F6B4F400E93B11 /* pl */,
-				F7CD838A28F6B4F800E93B11 /* pt-BR */,
-				F7CD838C28F6B4F900E93B11 /* pt-PT */,
-				F7CD838E28F6B4F900E93B11 /* ru */,
-				F7CD839028F6B4FA00E93B11 /* sr */,
-				F7CD839228F6B4FB00E93B11 /* sk-SK */,
-				F7CD839428F6B4FC00E93B11 /* es */,
-				F7CD839628F6B4FC00E93B11 /* es-CL */,
-				F7CD839828F6B4FD00E93B11 /* es-CO */,
-				F7CD839A28F6B4FE00E93B11 /* es-CR */,
-				F7CD839C28F6B4FF00E93B11 /* es-DO */,
-				F7CD839E28F6B4FF00E93B11 /* es-EC */,
-				F7CD83A028F6B50000E93B11 /* es-SV */,
-				F7CD83A228F6B50100E93B11 /* es-GT */,
-				F7CD83A428F6B50100E93B11 /* es-HN */,
-				F7CD83A628F6B50200E93B11 /* es-419 */,
-				F7CD83A828F6B50300E93B11 /* es-MX */,
-				F7CD83AA28F6B50400E93B11 /* es-NI */,
-				F7CD83AC28F6B50400E93B11 /* es-PA */,
-				F7CD83AE28F6B50500E93B11 /* es-PY */,
-				F7CD83B028F6B50600E93B11 /* es-PE */,
-				F7CD83B228F6B50700E93B11 /* es-PR */,
-				F7CD83B428F6B50700E93B11 /* es-UY */,
-				F7CD83B628F6B50800E93B11 /* sv */,
-				F7CD83B828F6B50800E93B11 /* tr */,
 			);
 			name = Dashboard.intentdefinition;
 			sourceTree = "<group>";

+ 11 - 3
Widget/Dashboard/DashboardData.swift

@@ -80,22 +80,30 @@ func getDashboardItems(displaySize: CGSize, withButton: Bool) -> Int {
     }
 }
 
-func getDashboardDataEntry(intent: Applications?, isPreview: Bool, displaySize: CGSize, completion: @escaping (_ entry: DashboardDataEntry) -> Void) {
+func getDashboardDataEntry(intent: DashboardIntent?, isPreview: Bool, displaySize: CGSize, completion: @escaping (_ entry: DashboardDataEntry) -> Void) {
 
     let dashboardItems = getDashboardItems(displaySize: displaySize, withButton: false)
     let datasPlaceholder = Array(dashboardDatasTest[0...dashboardItems - 1])
+    var account: tableAccount?
 
     if isPreview {
         return completion(DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: nil, buttons: nil, isPlaceholder: true, isEmpty: false, titleImage: UIImage(named: "widget")!, title: "Dashboard", footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " dashboard"))
     }
 
-    guard let account = NCManageDatabase.shared.getActiveAccount() else {
+    let accountIdentifier: String = intent?.Accounts?.identifier ?? "active"
+    if accountIdentifier == "active" {
+        account = NCManageDatabase.shared.getActiveAccount()
+    } else {
+        account = NCManageDatabase.shared.getAccount(predicate: NSPredicate(format: "account == %@", accountIdentifier))
+    }
+
+    guard let account = account else {
         return completion(DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: nil, buttons: nil, isPlaceholder: true, isEmpty: false, titleImage: UIImage(named: "widget")!, title: "Dashboard", footerImage: "xmark.icloud", footerText: NSLocalizedString("_no_active_account_", comment: "")))
     }
 
     // Default widget
     let result = NCManageDatabase.shared.getDashboardWidgetApplications(account: account.account).first
-    let id: String = intent?.identifier ?? (result?.id ?? "recommendations")
+    let id: String = intent?.Applications?.identifier ?? (result?.id ?? "recommendations")
 
     let serverVersionMajor = NCManageDatabase.shared.getCapabilitiesServerInt(account: account.account, elements: NCElementsJSON.shared.capabilitiesVersionMajor)
     guard serverVersionMajor >= NCGlobal.shared.nextcloudVersion25 else {

+ 2 - 2
Widget/Dashboard/DashboardWidgetProvider.swift

@@ -39,13 +39,13 @@ struct DashboardWidgetProvider: IntentTimelineProvider {
     }
 
     func getSnapshot(for configuration: DashboardIntent, in context: Context, completion: @escaping (DashboardDataEntry) -> Void) {
-        getDashboardDataEntry(intent: configuration.Applications, isPreview: false, displaySize: context.displaySize) { entry in
+        getDashboardDataEntry(intent: configuration, isPreview: false, displaySize: context.displaySize) { entry in
             completion(entry)
         }
     }
 
     func getTimeline(for configuration: DashboardIntent, in context: Context, completion: @escaping (Timeline<DashboardDataEntry>) -> Void) {
-        getDashboardDataEntry(intent: configuration.Applications, isPreview: context.isPreview, displaySize: context.displaySize) { entry in
+        getDashboardDataEntry(intent: configuration, isPreview: context.isPreview, displaySize: context.displaySize) { entry in
             let timeLine = Timeline(entries: [entry], policy: .atEnd)
             completion(timeLine)
         }

+ 121 - 1
Widget/Dashboard/Intent/Base.lproj/Dashboard.intentdefinition

@@ -28,7 +28,7 @@
 			<key>INIntentIneligibleForSuggestions</key>
 			<true/>
 			<key>INIntentLastParameterTag</key>
-			<integer>7</integer>
+			<integer>9</integer>
 			<key>INIntentName</key>
 			<string>Dashboard</string>
 			<key>INIntentParameters</key>
@@ -70,6 +70,63 @@
 					<key>INIntentParameterType</key>
 					<string>Object</string>
 				</dict>
+				<dict>
+					<key>INIntentParameterConfigurable</key>
+					<true/>
+					<key>INIntentParameterDisplayName</key>
+					<string>Account</string>
+					<key>INIntentParameterDisplayNameID</key>
+					<string>jHO1Mn</string>
+					<key>INIntentParameterDisplayPriority</key>
+					<integer>2</integer>
+					<key>INIntentParameterName</key>
+					<string>Accounts</string>
+					<key>INIntentParameterObjectType</key>
+					<string>Accounts</string>
+					<key>INIntentParameterObjectTypeNamespace</key>
+					<string>88xZPY</string>
+					<key>INIntentParameterPromptDialogs</key>
+					<array>
+						<dict>
+							<key>INIntentParameterPromptDialogCustom</key>
+							<true/>
+							<key>INIntentParameterPromptDialogType</key>
+							<string>Configuration</string>
+						</dict>
+						<dict>
+							<key>INIntentParameterPromptDialogCustom</key>
+							<true/>
+							<key>INIntentParameterPromptDialogType</key>
+							<string>Primary</string>
+						</dict>
+						<dict>
+							<key>INIntentParameterPromptDialogCustom</key>
+							<true/>
+							<key>INIntentParameterPromptDialogFormatString</key>
+							<string>There are ${count} options matching ‘${Accounts}’.</string>
+							<key>INIntentParameterPromptDialogFormatStringID</key>
+							<string>gJ9MnX</string>
+							<key>INIntentParameterPromptDialogType</key>
+							<string>DisambiguationIntroduction</string>
+						</dict>
+						<dict>
+							<key>INIntentParameterPromptDialogCustom</key>
+							<true/>
+							<key>INIntentParameterPromptDialogFormatString</key>
+							<string>Just to confirm, you wanted ‘${Accounts}’?</string>
+							<key>INIntentParameterPromptDialogFormatStringID</key>
+							<string>y95pmY</string>
+							<key>INIntentParameterPromptDialogType</key>
+							<string>Confirmation</string>
+						</dict>
+					</array>
+					<key>INIntentParameterSupportsDynamicEnumeration</key>
+					<true/>
+					<key>INIntentParameterTag</key>
+					<integer>9</integer>
+					<key>INIntentParameterType</key>
+					<string>Object</string>
+				</dict>
 			</array>
 			<key>INIntentResponse</key>
 			<dict>
@@ -164,6 +221,69 @@
 				</dict>
 			</array>
 		</dict>
+		<dict>
+			<key>INTypeDisplayName</key>
+			<string>Accounts</string>
+			<key>INTypeDisplayNameID</key>
+			<string>dLCeWT</string>
+			<key>INTypeLastPropertyTag</key>
+			<integer>99</integer>
+			<key>INTypeName</key>
+			<string>Accounts</string>
+			<key>INTypeProperties</key>
+			<array>
+				<dict>
+					<key>INTypePropertyDefault</key>
+					<true/>
+					<key>INTypePropertyDisplayPriority</key>
+					<integer>1</integer>
+					<key>INTypePropertyName</key>
+					<string>identifier</string>
+					<key>INTypePropertyTag</key>
+					<integer>1</integer>
+					<key>INTypePropertyType</key>
+					<string>String</string>
+				</dict>
+				<dict>
+					<key>INTypePropertyDefault</key>
+					<true/>
+					<key>INTypePropertyDisplayPriority</key>
+					<integer>2</integer>
+					<key>INTypePropertyName</key>
+					<string>displayString</string>
+					<key>INTypePropertyTag</key>
+					<integer>2</integer>
+					<key>INTypePropertyType</key>
+					<string>String</string>
+				</dict>
+				<dict>
+					<key>INTypePropertyDefault</key>
+					<true/>
+					<key>INTypePropertyDisplayPriority</key>
+					<integer>3</integer>
+					<key>INTypePropertyName</key>
+					<string>pronunciationHint</string>
+					<key>INTypePropertyTag</key>
+					<integer>3</integer>
+					<key>INTypePropertyType</key>
+					<string>String</string>
+				</dict>
+				<dict>
+					<key>INTypePropertyDefault</key>
+					<true/>
+					<key>INTypePropertyDisplayPriority</key>
+					<integer>4</integer>
+					<key>INTypePropertyName</key>
+					<string>alternativeSpeakableMatches</string>
+					<key>INTypePropertySupportsMultipleValues</key>
+					<true/>
+					<key>INTypePropertyTag</key>
+					<integer>4</integer>
+					<key>INTypePropertyType</key>
+					<string>SpeakableString</string>
+				</dict>
+			</array>
+		</dict>
 	</array>
 </dict>
 </plist>

+ 0 - 8
Widget/Dashboard/Intent/ca.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/cs-CZ.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/da.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/de.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/en-GB.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/en.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-419.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-CL.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-CO.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-CR.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-DO.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-EC.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-GT.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-HN.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-MX.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-NI.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-PA.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-PE.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-PR.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-PY.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-SV.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es-UY.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/es.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/eu.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/fr.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/gl.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/hu.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/is.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/it.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/ja-JP.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/ka-GE.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/ko.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/nb-NO.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/nl.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/pl.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/pt-BR.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/pt-PT.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/ru.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/sk-SK.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/sr.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/sv.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/tr.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/zh-Hans.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 0 - 8
Widget/Dashboard/Intent/zh-Hant-TW.lproj/Dashboard.strings

@@ -1,8 +0,0 @@
-"TRaTZg" = "Widget";
-
-"gpCwrM" = "Dashboard";
-
-"l090JH" = "Applications";
-
-"tVvJ9c" = "Dashboard Widget";
-

+ 28 - 0
WidgetDashboardIntentHandler/IntentHandler.swift

@@ -11,6 +11,8 @@ import RealmSwift
 
 class IntentHandler: INExtension, DashboardIntentHandling {
 
+    // Application
+
     func provideApplicationsOptionsCollection(for intent: DashboardIntent, with completion: @escaping (INObjectCollection<Applications>?, Error?) -> Void) {
 
         var applications: [Applications] = []
@@ -39,4 +41,30 @@ class IntentHandler: INExtension, DashboardIntentHandling {
         }
         return nil
     }
+
+    // Account
+
+    func provideAccountsOptionsCollection(for intent: DashboardIntent, with completion: @escaping (INObjectCollection<Accounts>?, Error?) -> Void) {
+
+        var accounts: [Accounts] = []
+        accounts.append(Accounts(identifier: "active", display: NSLocalizedString("_account_active_", comment: "")))
+
+        let results = NCManageDatabase.shared.getAllAccount()
+        for result in results {
+            let display = (result.alias.isEmpty) ? result.account : result.alias
+            let account = Accounts(identifier: result.account, display: display)
+            accounts.append(account)
+        }
+
+        completion(INObjectCollection(items: accounts), nil)
+    }
+
+    func defaultAccounts(for intent: DashboardIntent) -> Accounts? {
+
+        if NCManageDatabase.shared.getActiveAccount() == nil {
+            return nil
+        } else {
+            return Accounts(identifier: "active", display: NSLocalizedString("_account_active_", comment: ""))
+        }
+    }
 }

+ 1 - 0
iOSClient/Brand/WidgetDashboardIntentHandler.plist

@@ -18,6 +18,7 @@
 			<key>IntentsSupported</key>
 			<array>
 				<string>DashboardIntent</string>
+				<string>IntentIntent</string>
 			</array>
 		</dict>
 		<key>NSExtensionPointIdentifier</key>

+ 1 - 0
iOSClient/Brand/iOSClient.plist

@@ -78,6 +78,7 @@
 	<key>NSUserActivityTypes</key>
 	<array>
 		<string>DashboardIntent</string>
+		<string>IntentIntent</string>
 	</array>
 	<key>PHPhotoLibraryPreventAutomaticLimitedAccessAlert</key>
 	<true/>

+ 1 - 0
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -896,6 +896,7 @@
 "_description_lockscreenwidget_" = "Keep an eye on available space and recent activity";
 "_no_items_"                = "No items";
 "_check_back_late_"         = "Check back late";
+"_account_active_"          = "Account active";
 
 // Video
 "_select_trace_"            = "Select the trace";