From 5d5ae5bab4991f8e08a29276bde907fe485b76d6 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sun, 14 Sep 2025 01:43:00 -0700 Subject: [PATCH] Add app folder notice. (#704) --- .../Packages/Resources/Localizable.xcstrings | 22 +++++++++++++++++++ .../Secretive/Views/Views/ContentView.swift | 18 +++++++-------- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Sources/Packages/Resources/Localizable.xcstrings b/Sources/Packages/Resources/Localizable.xcstrings index 173c24a..f15cea4 100644 --- a/Sources/Packages/Resources/Localizable.xcstrings +++ b/Sources/Packages/Resources/Localizable.xcstrings @@ -3139,6 +3139,17 @@ } } }, + "app_not_in_applications_notice_cancel_button" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Cancel" + } + } + } + }, "app_not_in_applications_notice_detail_description" : { "extractionState" : "manual", "localizations" : { @@ -3324,6 +3335,17 @@ } } }, + "app_not_in_applications_notice_quit_button" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Quit" + } + } + } + }, "app_not_in_applications_notice_title" : { "extractionState" : "manual", "localizations" : { diff --git a/Sources/Secretive/Views/Views/ContentView.swift b/Sources/Secretive/Views/Views/ContentView.swift index c461141..7c395df 100644 --- a/Sources/Secretive/Views/Views/ContentView.swift +++ b/Sources/Secretive/Views/Views/ContentView.swift @@ -167,17 +167,17 @@ extension ContentView { .foregroundColor(.white) }) .buttonStyle(ToolbarStatusButtonStyle(color: .orange)) - .popover(isPresented: $showingAppPathNotice, attachmentAnchor: attachmentAnchor, arrowEdge: .bottom) { - VStack { - Image(systemName: "exclamationmark.triangle") - .resizable() - .aspectRatio(contentMode: .fit) - .frame(width: 64) - Text(.appNotInApplicationsNoticeDetailDescription) - .frame(maxWidth: 300) + .confirmationDialog(.appNotInApplicationsNoticeTitle, isPresented: $showingAppPathNotice) { + Button(.appNotInApplicationsNoticeCancelButton, role: .cancel) { } - .padding() + Button(.appNotInApplicationsNoticeQuitButton) { + NSWorkspace.shared.selectFile(Bundle.main.bundlePath, inFileViewerRootedAtPath: Bundle.main.bundlePath) + NSApplication.shared.terminate(nil) + } + } message: { + Text(.appNotInApplicationsNoticeDetailDescription) } + .dialogIcon(Image(systemName: "folder.fill.badge.questionmark")) } }