This commit is contained in:
Alin
2023-12-20 15:02:31 -07:00
parent 85d1a87e9c
commit 9405e02ca0
8 changed files with 37 additions and 22 deletions
+4 -4
View File
@@ -539,7 +539,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 11; CURRENT_PROJECT_VERSION = 12;
DEAD_CODE_STRIPPING = YES; DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BK8443AXLU; DEVELOPMENT_TEAM = BK8443AXLU;
@@ -557,7 +557,7 @@
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 13.0; MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.0; MARKETING_VERSION = 2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner; PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
@@ -574,7 +574,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 11; CURRENT_PROJECT_VERSION = 12;
DEAD_CODE_STRIPPING = YES; DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = BK8443AXLU; DEVELOPMENT_TEAM = BK8443AXLU;
@@ -592,7 +592,7 @@
"@executable_path/../Frameworks", "@executable_path/../Frameworks",
); );
MACOSX_DEPLOYMENT_TARGET = 13.0; MACOSX_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.0; MARKETING_VERSION = 2.1;
PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner; PRODUCT_BUNDLE_IDENTIFIER = com.alienator88.Pearcleaner;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_EMIT_LOC_STRINGS = YES;
+16 -4
View File
@@ -125,11 +125,23 @@ func getAppInfo(atPath path: URL) -> AppInfo? {
return AppInfo(id: UUID(), path: path, bundleIdentifier: bundleIdentifier, appName: appName ?? "", appVersion: appVersion, appIcon: appIcon, webApp: webApp ?? false, wrapped: false) return AppInfo(id: UUID(), path: path, bundleIdentifier: bundleIdentifier, appName: appName ?? "", appVersion: appVersion, appIcon: appIcon, webApp: webApp ?? false, wrapped: false)
} else { } else {
// print("One or more variables missing for app at path: \(path)") let wrapperURL = path.appendingPathComponent("Wrapper")//.appendingPathComponent(path.lastPathComponent)
let wrapperURL = path.appendingPathComponent("Wrapper").appendingPathComponent(path.lastPathComponent) do {
if let wrappedAppInfo = getWrappedAppInfo(atPath: wrapperURL) { let contents = try FileManager.default.contentsOfDirectory(at: wrapperURL, includingPropertiesForKeys: nil, options: [])
return wrappedAppInfo let appFiles = contents.filter { $0.pathExtension == "app" }
if let firstAppFile = appFiles.first {
let fullPath = wrapperURL.appendingPathComponent(firstAppFile.lastPathComponent)
if let wrappedAppInfo = getWrappedAppInfo(atPath: fullPath) {
return wrappedAppInfo
}
} else {
print("No .app files found in the 'Wrapper' directory.")
}
} catch {
print("Error reading contents of 'Wrapper' directory: \(error.localizedDescription)")
} }
} }
} else { } else {
print("Bundle not found at path: \(path)") print("Bundle not found at path: \(path)")
+9 -12
View File
@@ -23,15 +23,15 @@ struct PearcleanerApp: App {
var body: some Scene { var body: some Scene {
WindowGroup { WindowGroup {
Group { Group {
if !mini { if !mini {
AppListView(search: $search, showPopover: $showPopover) AppListView(search: $search, showPopover: $showPopover)
.frame(minWidth: 800, minHeight: 500)
} else { } else {
MiniMode(search: $search, showPopover: $showPopover) MiniMode(search: $search, showPopover: $showPopover)
.frame(minWidth: 300, minHeight: 300)
} }
} }
@@ -49,22 +49,15 @@ struct PearcleanerApp: App {
if let data = data as? Data, let url = URL(dataRepresentation: data, relativeTo: nil) { if let data = data as? Data, let url = URL(dataRepresentation: data, relativeTo: nil) {
let deeplinkManager = DeeplinkManager() let deeplinkManager = DeeplinkManager()
deeplinkManager.manage(url: url, appState: appState) deeplinkManager.manage(url: url, appState: appState)
// // Check if the file URL has a ".app" extension
// if url.pathExtension.lowercased() == "app" {
// // Handle the dropped file URL here
// print("Dropped .app file URL: \(url)")
// } else {
// // Print a message for non-.app files
// print("Unsupported file type. Only .app files are accepted.")
// }
} }
} }
} }
return true return true
} }
.onAppear { .onAppear {
// Disable tabbing
NSWindow.allowsAutomaticWindowTabbing = false NSWindow.allowsAutomaticWindowTabbing = false
// Get Apps // Get Apps
let sortedApps = getSortedApps() let sortedApps = getSortedApps()
appState.sortedApps.userApps = sortedApps.userApps appState.sortedApps.userApps = sortedApps.userApps
@@ -112,7 +105,7 @@ struct PearcleanerApp: App {
CommandGroup(replacing: .newItem, addition: { }) CommandGroup(replacing: .newItem, addition: { })
} }
Settings { Settings {
SettingsView() SettingsView()
@@ -128,7 +121,11 @@ struct PearcleanerApp: App {
class AppDelegate: NSObject, NSApplicationDelegate { class AppDelegate: NSObject, NSApplicationDelegate {
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
#if DEBUG
return true return true
#else
return false
#endif
} }
// func application(_ sender: NSApplication, open urls: [URL]) { // func application(_ sender: NSApplication, open urls: [URL]) {
// for url in urls { // for url in urls {
+2 -1
View File
@@ -97,10 +97,11 @@ struct GeneralSettingsTab: View {
}) })
.toggleStyle(.switch) .toggleStyle(.switch)
.onChange(of: mini) { newVal in .onChange(of: mini) { newVal in
resizeWindow(width: 300, height: 300)
if mini { if mini {
resizeWindow(width: 300, height: 300)
appState.currentView = .empty appState.currentView = .empty
} else { } else {
resizeWindow(width: 700, height: 500)
if appState.appInfo.appName.isEmpty { if appState.appInfo.appName.isEmpty {
appState.currentView = .empty appState.currentView = .empty
} else { } else {
+1
View File
@@ -30,6 +30,7 @@ struct AppListItems: View {
.resizable() .resizable()
.aspectRatio(contentMode: .fit) .aspectRatio(contentMode: .fit)
.frame(width: 30, height: 30) .frame(width: 30, height: 30)
.clipShape(RoundedRectangle(cornerRadius: 8))
} }
VStack(alignment: .leading, spacing: 5) { VStack(alignment: .leading, spacing: 5) {
Text(appInfo.appName) Text(appInfo.appName)
+1
View File
@@ -144,6 +144,7 @@ struct AppListView: View {
Spacer() Spacer()
} }
.frame(minWidth: 700, minHeight: 500)
.edgesIgnoringSafeArea(.all) .edgesIgnoringSafeArea(.all)
// .onOpenURL(perform: { url in // .onOpenURL(perform: { url in
// let deeplinkManager = DeeplinkManager() // let deeplinkManager = DeeplinkManager()
+3
View File
@@ -41,6 +41,7 @@ struct FilesView: View {
.scaledToFit() .scaledToFit()
// .aspectRatio(contentMode: .fit) // .aspectRatio(contentMode: .fit)
.frame(width: 50, height: 50) .frame(width: 50, height: 50)
.clipShape(RoundedRectangle(cornerRadius: 8))
.padding(.leading) .padding(.leading)
} }
//app title, size and items //app title, size and items
@@ -310,6 +311,8 @@ struct FileDetailsItem: View {
.resizable() .resizable()
.aspectRatio(contentMode: .fit) .aspectRatio(contentMode: .fit)
.frame(width: 30, height: 30) .frame(width: 30, height: 30)
.clipShape(RoundedRectangle(cornerRadius: 8))
} }
VStack(alignment: .leading, spacing: 5) { VStack(alignment: .leading, spacing: 5) {
Text(path.lastPathComponent) Text(path.lastPathComponent)
+1 -1
View File
@@ -218,7 +218,7 @@ struct MiniAppView: View {
.scrollIndicators(.never) .scrollIndicators(.never)
} }
// .padding(.vertical) .padding(.bottom)
} }