Skip to content

Commit

Permalink
Download Prohibited apps (PlayCover#1502)
Browse files Browse the repository at this point in the history
* Update Downloader.swift

* better error description

* SwiftLint fix

* Added download anyway button

* updated alert style

Added "destructive" style to download anyway so it's clearer that is a not recommended action

* Revert "updated alert style"

This reverts commit ff6f45f.

* added traslation

added translation to Localizable.string and changed it to match PlayCover#1543
  • Loading branch information
Catta1997 authored Aug 25, 2024
1 parent d645695 commit 0cfcffe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 16 additions & 1 deletion PlayCover/AppInstaller/Downloader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,26 @@ class DownloadApp {
if installVM.inProgress {
Log.shared.error(PlayCoverError.waitInstallation)
} else {
if let app = app, PlayApp.PROHIBITED_APPS.contains(app.bundleID) {
let alert = NSAlert()
alert.messageText = NSLocalizedString("alert.error", comment: "")
alert.informativeText = String(
format: NSLocalizedString("error.appProhibited", comment: ""),
arguments: [app.name]
)
alert.alertStyle = .warning
alert.addButton(withTitle: NSLocalizedString("Ok", comment: ""))
alert.addButton(withTitle: NSLocalizedString("alert.download.downloadAnyway", comment: ""))
if alert.runModal() == .alertFirstButtonReturn {
return
}
}

if let warningMessage = warning, let app = app {
let alert = NSAlert()
alert.messageText = NSLocalizedString(warningMessage, comment: "")
alert.informativeText = String(
format: NSLocalizedString("ipaLibrary.alert.download", comment: ""),
format: NSLocalizedString("alert.install.anyway", comment: ""),
arguments: [app.name]
)
alert.alertStyle = .warning
Expand Down
2 changes: 2 additions & 0 deletions PlayCover/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,5 @@

"keycover.alert.title" = "Keychain was not unlocked";
"keycover.alert.content" = "Keychain access has been disabled for the current session";

"alert.install.anyway" = "Install Anyway";

0 comments on commit 0cfcffe

Please sign in to comment.