From 8ed2de96be381a76e68f1f7f60083b2b153521d7 Mon Sep 17 00:00:00 2001 From: Alin Date: Mon, 25 Nov 2024 11:32:48 -0700 Subject: [PATCH] updates --- FinderOpen/InfoPlist.xcstrings | 54 ---------- Pearcleaner.xcodeproj/project.pbxproj | 8 -- Pearcleaner/Resources/InfoPlist.xcstrings | 114 ---------------------- Pearcleaner/Views/DevelopmentView.swift | 48 ++++++++- 4 files changed, 47 insertions(+), 177 deletions(-) delete mode 100644 FinderOpen/InfoPlist.xcstrings delete mode 100644 Pearcleaner/Resources/InfoPlist.xcstrings diff --git a/FinderOpen/InfoPlist.xcstrings b/FinderOpen/InfoPlist.xcstrings deleted file mode 100644 index 9ce9c64..0000000 --- a/FinderOpen/InfoPlist.xcstrings +++ /dev/null @@ -1,54 +0,0 @@ -{ - "sourceLanguage" : "en", - "strings" : { - "CFBundleDisplayName" : { - "comment" : "Bundle display name", - "extractionState" : "extracted_with_value", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "FinderOpen" - } - }, - "zh-HK" : { - "stringUnit" : { - "state" : "translated", - "value" : "FinderOpen" - } - } - } - }, - "CFBundleName" : { - "comment" : "Bundle name", - "extractionState" : "extracted_with_value", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "FinderOpen" - } - }, - "zh-HK" : { - "stringUnit" : { - "state" : "translated", - "value" : "FinderOpen" - } - } - } - }, - "NSHumanReadableCopyright" : { - "comment" : "Copyright (human-readable)", - "extractionState" : "extracted_with_value", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "" - } - } - } - } - }, - "version" : "1.0" -} \ No newline at end of file diff --git a/Pearcleaner.xcodeproj/project.pbxproj b/Pearcleaner.xcodeproj/project.pbxproj index 393f51e..d705b88 100644 --- a/Pearcleaner.xcodeproj/project.pbxproj +++ b/Pearcleaner.xcodeproj/project.pbxproj @@ -51,8 +51,6 @@ C7F8436C2CBF066F00E3E30A /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = C7F8436A2CBF066F00E3E30A /* Localizable.xcstrings */; }; C7FB173B2B96321300B96F9A /* AppsListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7FB173A2B96321300B96F9A /* AppsListView.swift */; }; C7FEBA112BDC422200AE195F /* AppSearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7FEBA102BDC422200AE195F /* AppSearchView.swift */; }; - F6DBC0A02CF3EA2300D8EF91 /* InfoPlist.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = F6DBC09F2CF3EA2300D8EF91 /* InfoPlist.xcstrings */; }; - F6DBC0A22CF3EA2300D8EF91 /* InfoPlist.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = F6DBC0A12CF3EA2300D8EF91 /* InfoPlist.xcstrings */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -145,8 +143,6 @@ C7F8436A2CBF066F00E3E30A /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; C7FB173A2B96321300B96F9A /* AppsListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppsListView.swift; sourceTree = ""; }; C7FEBA102BDC422200AE195F /* AppSearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSearchView.swift; sourceTree = ""; }; - F6DBC09F2CF3EA2300D8EF91 /* InfoPlist.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = InfoPlist.xcstrings; sourceTree = ""; }; - F6DBC0A12CF3EA2300D8EF91 /* InfoPlist.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = InfoPlist.xcstrings; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -237,7 +233,6 @@ C77B90242AF2D796009CC655 /* Pearcleaner.entitlements */, C77B90072AF18E2F009CC655 /* Assets.xcassets */, C7F8436A2CBF066F00E3E30A /* Localizable.xcstrings */, - F6DBC0A12CF3EA2300D8EF91 /* InfoPlist.xcstrings */, ); path = Resources; sourceTree = ""; @@ -295,7 +290,6 @@ C78121642BC892A000BE06BD /* FinderOpen */ = { isa = PBXGroup; children = ( - F6DBC09F2CF3EA2300D8EF91 /* InfoPlist.xcstrings */, C78121652BC892A000BE06BD /* FinderOpen.swift */, C78121672BC892A000BE06BD /* Info.plist */, C78121682BC892A000BE06BD /* FinderOpen.entitlements */, @@ -429,7 +423,6 @@ files = ( C77B90082AF18E2F009CC655 /* Assets.xcassets in Resources */, C7A27E812AFD7C4600166168 /* com.alienator88.PearcleanerSentinel.plist in Resources */, - F6DBC0A22CF3EA2300D8EF91 /* InfoPlist.xcstrings in Resources */, C7F8436B2CBF066F00E3E30A /* Localizable.xcstrings in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -438,7 +431,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - F6DBC0A02CF3EA2300D8EF91 /* InfoPlist.xcstrings in Resources */, C7F8436C2CBF066F00E3E30A /* Localizable.xcstrings in Resources */, C7A6DBF12C9DD27200CFA042 /* Assets.xcassets in Resources */, ); diff --git a/Pearcleaner/Resources/InfoPlist.xcstrings b/Pearcleaner/Resources/InfoPlist.xcstrings deleted file mode 100644 index 02d4f23..0000000 --- a/Pearcleaner/Resources/InfoPlist.xcstrings +++ /dev/null @@ -1,114 +0,0 @@ -{ - "sourceLanguage" : "en", - "strings" : { - "CFBundleDisplayName" : { - "comment" : "Bundle display name", - "extractionState" : "extracted_with_value", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "Pearcleaner" - } - }, - "zh-HK" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pearcleaner" - } - } - } - }, - "CFBundleGetInfoString" : { - "comment" : "Get Info string", - "extractionState" : "extracted_with_value", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "" - } - } - } - }, - "CFBundleName" : { - "comment" : "Bundle name", - "extractionState" : "extracted_with_value", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "Pearcleaner" - } - }, - "zh-HK" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pearcleaner" - } - } - } - }, - "NSAppleEventsUsageDescription" : { - "comment" : "Privacy - AppleEvents Sending Usage Description", - "extractionState" : "extracted_with_value", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "Pearcleaner needs to send Apple Events to Finder to delete files" - } - }, - "zh-HK" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pearcleaner 需要將 Apple Event 傳送至 Finder 以刪除檔案" - } - } - } - }, - "NSHumanReadableCopyright" : { - "comment" : "Copyright (human-readable)", - "extractionState" : "extracted_with_value", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "" - } - } - } - }, - "NSSystemAdministrationUsageDescription" : { - "comment" : "Privacy - System Administration Usage Description", - "extractionState" : "extracted_with_value", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "Pearcleaner requires full disk access to be able to delete files in locations with no permission" - } - }, - "zh-HK" : { - "stringUnit" : { - "state" : "translated", - "value" : "Pearcleaner 需要完整磁碟取用權限才能在沒有權限的位置刪除檔案" - } - } - } - }, - "NSSystemExtensionUsageDescription" : { - "comment" : "Privacy - System Extension Usage Description", - "extractionState" : "extracted_with_value", - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "" - } - } - } - } - }, - "version" : "1.0" -} \ No newline at end of file diff --git a/Pearcleaner/Views/DevelopmentView.swift b/Pearcleaner/Views/DevelopmentView.swift index c5ba61e..fa7f235 100644 --- a/Pearcleaner/Views/DevelopmentView.swift +++ b/Pearcleaner/Views/DevelopmentView.swift @@ -84,6 +84,7 @@ struct EnvironmentCleanerView: View { ScrollView { ForEach(selectedEnvironment.paths, id: \.self) { path in PathRowView(path: path) +// CardView(path: path) } } @@ -122,6 +123,7 @@ struct PathRowView: View { openInFinder(matchedPath) } .foregroundColor(.blue) + .buttonStyle(.borderedProminent) Button("Delete Folder") { deleteFolder(matchedPath) @@ -148,7 +150,10 @@ struct PathRowView: View { } } } - .padding(5) + .padding(8) + .background(RoundedRectangle(cornerRadius: 10) + .fill(.secondary.opacity(0.2)) + .shadow(radius: 2)) .onAppear { checkPath(path) } @@ -380,3 +385,44 @@ struct PathLibrary { .sorted { $0.name < $1.name } // Sort environments by name } } + + + +struct CardView: View { + var path: String + + var body: some View { + VStack(alignment: .leading, spacing: 10) { + Text(path) + .font(.body) + .foregroundColor(.primary) + .lineLimit(1) + .truncationMode(.tail) + + HStack { + Button(action: { print("Open \(path)") }) { + Label("Open", systemImage: "folder") + } + .buttonStyle(.borderedProminent) + .tint(.blue) + + Button(action: { print("Delete Folder \(path)") }) { + Label("Delete Folder", systemImage: "trash") + } + .buttonStyle(.bordered) + .tint(.red) + + Button(action: { print("Delete Contents \(path)") }) { + Label("Delete Contents", systemImage: "trash.circle") + } + .buttonStyle(.bordered) + .tint(.orange) + } + } + .frame(maxWidth: .infinity) + .padding() + .background(RoundedRectangle(cornerRadius: 10) + .fill(.secondary.opacity(0.2)) + .shadow(radius: 2)) + } +}