Skip to content

Commit

Permalink
More fixes and CompareView work
Browse files Browse the repository at this point in the history
  • Loading branch information
alin23 committed Jul 25, 2024
1 parent da24cf9 commit 5627853
Show file tree
Hide file tree
Showing 14 changed files with 333 additions and 78 deletions.
7 changes: 5 additions & 2 deletions Clop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@
C7AB661D288301590041BEC8 /* Sources */,
C7AB661E288301590041BEC8 /* Frameworks */,
C7AB661F288301590041BEC8 /* Resources */,
C71A88752A94AFAA00ABD6EE /* ShellScript */,
C71A88752A94AFAA00ABD6EE /* Create MASReceipt */,
C70B5F2A2AC014BF00345739 /* Embed Foundation Extensions */,
C7956A4B2AC317C100C0EDF2 /* Copy Files (1 item) */,
);
Expand Down Expand Up @@ -718,7 +718,7 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
C71A88752A94AFAA00ABD6EE /* ShellScript */ = {
C71A88752A94AFAA00ABD6EE /* Create MASReceipt */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
Expand All @@ -727,6 +727,7 @@
);
inputPaths = (
);
name = "Create MASReceipt";
outputFileListPaths = (
);
outputPaths = (
Expand Down Expand Up @@ -1347,6 +1348,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Clop/bin",
"$(PROJECT_DIR)/Clop",
);
LLVM_LTO = YES_THIN;
MACOSX_DEPLOYMENT_TARGET = 13.0;
Expand Down Expand Up @@ -1387,6 +1389,7 @@
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Clop/bin",
"$(PROJECT_DIR)/Clop",
);
LLVM_LTO = YES;
MACOSX_DEPLOYMENT_TARGET = 13.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/getsentry/sentry-cocoa",
"state" : {
"revision" : "08862789e1cbba7a9561bed69832a9306f339cd3",
"version" : "8.29.1"
"revision" : "5421f94cc859eb65f5ae3866165a053aa634431e",
"version" : "8.32.0"
}
},
{
Expand All @@ -104,17 +104,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/sparkle-project/Sparkle",
"state" : {
"revision" : "b456fd404954a9e13f55aa0c88cd5a40b8399638",
"version" : "2.6.3"
"revision" : "0ef1ee0220239b3776f433314515fd849025673f",
"version" : "2.6.4"
}
},
{
"identity" : "swift-argument-parser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-argument-parser.git",
"state" : {
"revision" : "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b",
"version" : "1.4.0"
"revision" : "41982a3656a71c768319979febd796c6fd111d5c",
"version" : "1.5.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
version = "1.0">
<ContextStates>
<ContextState
contextName = "optimiseItem(_:id:hideFloatingResult:downscaleTo:cropTo:changePlaybackSpeedBy:aggressiveOptimisation:optimisationCount:copyToClipboard:source:output:removeAudio:):OptimisationUtils.swift">
contextName = "LowtechWindow.screenCorner.didset:OSDWindow.swift">
<PersistentStrings>
<PersistentString
value = "path.string">
value = "screenCorner!">
</PersistentString>
</PersistentStrings>
</ContextState>
<ContextState
contextName = "LowtechWindow.screenCorner.didset:OSDWindow.swift">
contextName = "optimiseItem(_:id:hideFloatingResult:downscaleTo:cropTo:changePlaybackSpeedBy:aggressiveOptimisation:optimisationCount:copyToClipboard:source:output:removeAudio:):OptimisationUtils.swift">
<PersistentStrings>
<PersistentString
value = "screenCorner!">
value = "path.string">
</PersistentString>
</PersistentStrings>
</ContextState>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<key>ClopCLI.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>5</integer>
<integer>4</integer>
</dict>
<key>Example (Playground) 1.xcscheme</key>
<dict>
Expand Down Expand Up @@ -95,7 +95,7 @@
<key>FinderOptimiser-setapp.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
<integer>5</integer>
</dict>
<key>FinderOptimiser.xcscheme_^#shared#^_</key>
<dict>
Expand Down
9 changes: 8 additions & 1 deletion Clop/ClopApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ class AppDelegate: AppDelegateParent {
opt.restoreOriginal()
case .r where !opt.running:
opt.editingFilename = true
case .d where opt.url != nil && opt.comparisonOriginalURL != nil:
opt.compare()
case .c:
opt.copyToClipboard()
opt.overlayMessage = "Copied"
Expand Down Expand Up @@ -600,7 +602,7 @@ class AppDelegate: AppDelegateParent {
@objc func windowWillClose(_ notification: Notification) {
guard let window = notification.object as? NSWindow else { return }

if window.title == "Settings" {
if window.title == "Settings" || window.title == "Comparison" {
mainActor {
settingsViewManager.windowOpen = false
NSApp.setActivationPolicy(.accessory)
Expand All @@ -620,6 +622,11 @@ class AppDelegate: AppDelegateParent {

@objc func windowDidBecomeMainNotification(_ notification: Notification) {
guard let window = notification.object as? NSWindow else { return }

if window.title == "Comparison" {
NSApp.setActivationPolicy(.regular)
}

if window.title == "Settings" {
mainActor {
print(FloatingPreview.om, CompactPreview.om)
Expand Down
3 changes: 3 additions & 0 deletions Clop/ClopUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ extension FilePath {
}
}

var clopBackupPath: FilePath? {
FilePath.clopBackups.appending(nameWithHash)
}
static var clopBackups = FilePath.dir(workdir / "backups", permissions: 0o777)
static var videos = FilePath.dir(workdir / "videos", permissions: 0o777)
static var images = FilePath.dir(workdir / "images", permissions: 0o777)
Expand Down
Loading

0 comments on commit 5627853

Please sign in to comment.