Skip to content

Commit 147a93e

Browse files
author
Erik Terwan
committed
Fixed slow, synchronous PNGOut, added indicator
1 parent 456b6d2 commit 147a93e

File tree

72 files changed

+96
-48
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+96
-48
lines changed

Build/Intermediates/ArchiveIntermediates/Retini/BuildProductsPath/Release/Retini.app.dSYM/Contents/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<key>CFBundleSignature</key>
1414
<string>????</string>
1515
<key>CFBundleShortVersionString</key>
16-
<string>1.0.5</string>
16+
<string>1.0.6</string>
1717
<key>CFBundleVersion</key>
1818
<string>1</string>
1919
</dict>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/Users/Erik/Mac Apps/Retini/Build/Intermediates/ArchiveIntermediates/Retini/IntermediateBuildFilesPath/UninstalledProducts/macosx/libAFNetworking.a
1+
/Users/Erik/Mac Apps/Retini/Build/Intermediates/ArchiveIntermediates/Retini/IntermediateBuildFilesPath/UninstalledProducts/libAFNetworking.a
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/Users/Erik/Mac Apps/Retini/Build/Intermediates/ArchiveIntermediates/Retini/IntermediateBuildFilesPath/UninstalledProducts/macosx/libPods.a
1+
/Users/Erik/Mac Apps/Retini/Build/Intermediates/ArchiveIntermediates/Retini/IntermediateBuildFilesPath/UninstalledProducts/libPods.a
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
dependencies: /Users/Erik/Mac\ Apps/Retini/RetiniTests/RetiniTests.m \
2-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIKeyboardKeys.h \
3-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIElementQuery.h \
4-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUICoordinate.h \
5-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIDevice.h \
6-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIElementTypeQueryProvider.h \
7-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIElementTypes.h \
8-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIElementAttributes.h \
9-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIElement.h \
10-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIApplication.h \
11-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestSuiteRun.h \
12-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestSuite.h \
13-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestProbe.h \
14-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestObservation.h \
15-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestObservationCenter.h \
16-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestObserver.h \
17-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestLog.h \
18-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestRun.h \
19-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCaseRun.h \
20-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCase+AsynchronousTesting.h \
21-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCase.h \
22-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestAssertionsImpl.h \
23-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestAssertions.h \
24-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCAbstractTest.h \
25-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestErrors.h \
26-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestDefines.h \
27-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.h \
28-
/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap
2+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIKeyboardKeys.h \
3+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIElementQuery.h \
4+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUICoordinate.h \
5+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIDevice.h \
6+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIElementTypeQueryProvider.h \
7+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIElementTypes.h \
8+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIElementAttributes.h \
9+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIElement.h \
10+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCUIApplication.h \
11+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestSuiteRun.h \
12+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestSuite.h \
13+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestProbe.h \
14+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestObservation.h \
15+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestObservationCenter.h \
16+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestObserver.h \
17+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestLog.h \
18+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestRun.h \
19+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCaseRun.h \
20+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCase+AsynchronousTesting.h \
21+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestCase.h \
22+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestAssertionsImpl.h \
23+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestAssertions.h \
24+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCAbstractTest.h \
25+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestErrors.h \
26+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTestDefines.h \
27+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Headers/XCTest.h \
28+
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Modules/module.modulemap
Binary file not shown.

Build/Products/Debug/Retini.app/Contents/Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@
5252
<key>DTCompiler</key>
5353
<string>com.apple.compilers.llvm.clang.1_0</string>
5454
<key>DTPlatformBuild</key>
55-
<string>7B60</string>
55+
<string>7A1001</string>
5656
<key>DTPlatformVersion</key>
5757
<string>GM</string>
5858
<key>DTSDKBuild</key>
5959
<string>15A278</string>
6060
<key>DTSDKName</key>
6161
<string>macosx10.11</string>
6262
<key>DTXcode</key>
63-
<string>0710</string>
63+
<string>0701</string>
6464
<key>DTXcodeBuild</key>
65-
<string>7B60</string>
65+
<string>7A1001</string>
6666
<key>LSApplicationCategoryType</key>
6767
<string>public.app-category.productivity</string>
6868
<key>LSMinimumSystemVersion</key>
Binary file not shown.
Binary file not shown.
Binary file not shown.

Build/Products/Debug/Retini.app/Contents/_CodeSignature/CodeResources

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<dict>
77
<key>Resources/AppIcon.icns</key>
88
<data>
9-
Wqel1q8yuM1Y+HDW1PMGCWklpMI=
9+
+1ot2HnOdPp4MhWxJVJE+T9EpGM=
1010
</data>
1111
<key>Resources/Assets.car</key>
1212
<data>
@@ -16,7 +16,7 @@
1616
<dict>
1717
<key>hash</key>
1818
<data>
19-
JT7ovtG7IJ+H2EBqgV7YrAq1jM8=
19+
E4oIzhYYQyXIIzs5DkUizx5LFvQ=
2020
</data>
2121
<key>optional</key>
2222
<true/>
@@ -58,7 +58,7 @@
5858
<dict>
5959
<key>Resources/AppIcon.icns</key>
6060
<data>
61-
Wqel1q8yuM1Y+HDW1PMGCWklpMI=
61+
+1ot2HnOdPp4MhWxJVJE+T9EpGM=
6262
</data>
6363
<key>Resources/Assets.car</key>
6464
<data>
@@ -68,7 +68,7 @@
6868
<dict>
6969
<key>hash</key>
7070
<data>
71-
JT7ovtG7IJ+H2EBqgV7YrAq1jM8=
71+
E4oIzhYYQyXIIzs5DkUizx5LFvQ=
7272
</data>
7373
<key>optional</key>
7474
<true/>

Build/Products/Debug/RetiniTests.xctest/Contents/Info.plist

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@
2929
<key>DTCompiler</key>
3030
<string>com.apple.compilers.llvm.clang.1_0</string>
3131
<key>DTPlatformBuild</key>
32-
<string>7B60</string>
32+
<string>7A1001</string>
3333
<key>DTPlatformVersion</key>
3434
<string>GM</string>
3535
<key>DTSDKBuild</key>
3636
<string>15A278</string>
3737
<key>DTSDKName</key>
3838
<string>macosx10.11</string>
3939
<key>DTXcode</key>
40-
<string>0710</string>
40+
<string>0701</string>
4141
<key>DTXcodeBuild</key>
42-
<string>7B60</string>
42+
<string>7A1001</string>
4343
</dict>
4444
</plist>
Binary file not shown.
-448 Bytes
Binary file not shown.

Build/Products/Debug/libPods.a

-16 Bytes
Binary file not shown.

Retini.zip

3.2 KB
Binary file not shown.

Retini/AppDelegate.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
@interface AppDelegate ()
1414

15+
// Jup, i know this all shoud be in neat UIWindows and stuff, i'm going to refractor the code soon.
16+
1517
@property (nonatomic, retain) IBOutlet NSLayoutConstraint *topDragConstraint;
1618
@property (nonatomic, retain) IBOutlet NSLayoutConstraint *bottomDragConstraint;
1719
@property (nonatomic, retain) IBOutlet NSWindow *window;

Retini/Base.lproj/MainMenu.xib

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9046" systemVersion="15B22c" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
2+
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="15B22c" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
33
<dependencies>
44
<deployment identifier="macosx"/>
5-
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9046"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
66
</dependencies>
77
<objects>
88
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@@ -134,7 +134,24 @@
134134
</stepper>
135135
<customView translatesAutoresizingMaskIntoConstraints="NO" id="UFV-hG-527" customClass="DragDropView">
136136
<rect key="frame" x="0.0" y="0.0" width="480" height="360"/>
137+
<subviews>
138+
<progressIndicator wantsLayer="YES" style="bar" translatesAutoresizingMaskIntoConstraints="NO" id="rli-D0-rtJ">
139+
<rect key="frame" x="20" y="46" width="440" height="20"/>
140+
<constraints>
141+
<constraint firstAttribute="height" constant="18" id="k7p-Fl-f1F"/>
142+
</constraints>
143+
<animations/>
144+
</progressIndicator>
145+
</subviews>
146+
<constraints>
147+
<constraint firstAttribute="trailing" secondItem="rli-D0-rtJ" secondAttribute="trailing" constant="20" id="LlK-m2-Ssq"/>
148+
<constraint firstItem="rli-D0-rtJ" firstAttribute="leading" secondItem="UFV-hG-527" secondAttribute="leading" constant="20" id="O5c-tB-THd"/>
149+
<constraint firstAttribute="bottom" secondItem="rli-D0-rtJ" secondAttribute="bottom" constant="47" id="zZI-IA-yVO"/>
150+
</constraints>
137151
<animations/>
152+
<connections>
153+
<outlet property="pngCrushLoader" destination="rli-D0-rtJ" id="Pc2-Ip-aj5"/>
154+
</connections>
138155
</customView>
139156
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YTv-ws-hhB">
140157
<rect key="frame" x="18" y="-42" width="265" height="25"/>

Retini/DragDropView.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
@interface DragDropView : NSView
1212

13+
@property (nonatomic, retain) IBOutlet NSProgressIndicator *pngCrushLoader;
14+
1315
@property BOOL highlight; // If should show the highlighted image
1416
@property BOOL notFound; // If no retina (@2x, @3x) files where found
1517

Retini/DragDropView.m

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
#import "DragDropView.h"
1010
#import "NSImage+Resize.h" // File from https://github.com/nate-parrott/Flashlight
1111

12+
// I'm going to refractor this aswell, put everything that should be in a model, in a model.
13+
1214
@implementation DragDropView
1315

16+
@synthesize pngCrushLoader;
1417
@synthesize highlight, notFound;
1518

1619
- (id)initWithFrame:(NSRect)frame
@@ -19,6 +22,8 @@ - (id)initWithFrame:(NSRect)frame
1922

2023
if(self){
2124
[self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
25+
26+
[pngCrushLoader setAlphaValue:0.0];
2227
}
2328

2429
return self;
@@ -30,11 +35,18 @@ - (id)initWithCoder:(NSCoder *)coder
3035

3136
if(self){
3237
[self registerForDraggedTypes:[NSArray arrayWithObject:NSFilenamesPboardType]];
38+
39+
[pngCrushLoader setAlphaValue:0.0];
3340
}
3441

3542
return self;
3643
}
3744

45+
- (void)awakeFromNib
46+
{
47+
[pngCrushLoader setAlphaValue:0.0];
48+
}
49+
3850
- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
3951
{
4052
highlight = YES;
@@ -229,12 +241,27 @@ - (BOOL)crushPng:(NSString *)fileName
229241
return NO;
230242
}
231243

232-
NSTask *task = [[NSTask alloc] init];
233-
task.launchPath = [[NSBundle mainBundle] pathForResource:@"pngout" ofType:@""];
234-
task.arguments = @[@"-y", fileName, fileName];
244+
[pngCrushLoader setMaxValue:pngCrushLoader.maxValue + 1];
245+
[pngCrushLoader setAlphaValue:1.0];
235246

236-
[task launch];
237-
[task waitUntilExit];
247+
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
248+
NSTask *task = [[NSTask alloc] init];
249+
task.launchPath = [[NSBundle mainBundle] pathForResource:@"pngout" ofType:@""];
250+
task.arguments = @[@"-y", fileName, fileName];
251+
252+
[task launch];
253+
[task waitUntilExit];
254+
255+
dispatch_async(dispatch_get_main_queue(), ^{
256+
[pngCrushLoader setDoubleValue:pngCrushLoader.doubleValue + 1];
257+
258+
if(pngCrushLoader.doubleValue == pngCrushLoader.maxValue){
259+
[pngCrushLoader setAlphaValue:0.0];
260+
[pngCrushLoader setDoubleValue:0];
261+
[pngCrushLoader setMaxValue:0];
262+
}
263+
});
264+
});
238265

239266
return YES;
240267
}

Retini/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<key>CFBundlePackageType</key>
3939
<string>APPL</string>
4040
<key>CFBundleShortVersionString</key>
41-
<string>1.0.5</string>
41+
<string>1.0.6</string>
4242
<key>CFBundleSignature</key>
4343
<string>????</string>
4444
<key>CFBundleVersion</key>

0 commit comments

Comments
 (0)