Add placeholder export accessory view
This commit is contained in:
parent
866a378c8d
commit
6aad7b912d
4 changed files with 92 additions and 3 deletions
|
@ -28,6 +28,9 @@
|
|||
036AFC11241800350075400A /* ThumbnailProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 036AFC10241800350075400A /* ThumbnailProvider.swift */; };
|
||||
036AFC16241800350075400A /* Thumbnail.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 036AFC0B241800350075400A /* Thumbnail.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
036AFC1B241800850075400A /* ZIPFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = 036AFC1A241800850075400A /* ZIPFoundation */; };
|
||||
0371996027BAC5D800EE1DFD /* Silica_ViewerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0371995F27BAC5D800EE1DFD /* Silica_ViewerTests.swift */; };
|
||||
0371996727BACD8700EE1DFD /* ExportAccessoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 0371996627BACD8700EE1DFD /* ExportAccessoryView.xib */; };
|
||||
0371996927BACDE800EE1DFD /* ExportAccessoryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0371996827BACDE800EE1DFD /* ExportAccessoryView.swift */; };
|
||||
03C39DE726F90734005555AE /* lzodefs.h in Headers */ = {isa = PBXBuildFile; fileRef = 03C39DE226F90733005555AE /* lzodefs.h */; };
|
||||
03C39DE826F90734005555AE /* Makefile in Sources */ = {isa = PBXBuildFile; fileRef = 03C39DE426F90734005555AE /* Makefile */; };
|
||||
03C39DE926F90734005555AE /* testmini.c in Sources */ = {isa = PBXBuildFile; fileRef = 03C39DE526F90734005555AE /* testmini.c */; };
|
||||
|
@ -53,6 +56,13 @@
|
|||
remoteGlobalIDString = 036AFC0A241800350075400A;
|
||||
remoteInfo = Thumbnail;
|
||||
};
|
||||
0371996127BAC5D800EE1DFD /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 030F6FE62415C5E300A43F01 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 030F6FED2415C5E300A43F01;
|
||||
remoteInfo = SilicaViewer;
|
||||
};
|
||||
03CB383C2419CA2D0078B3E5 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 030F6FE62415C5E300A43F01 /* Project object */;
|
||||
|
@ -105,6 +115,11 @@
|
|||
036AFC10241800350075400A /* ThumbnailProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThumbnailProvider.swift; sourceTree = "<group>"; };
|
||||
036AFC12241800350075400A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
036AFC13241800350075400A /* Thumbnail.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Thumbnail.entitlements; sourceTree = "<group>"; };
|
||||
0371995827BAC52900EE1DFD /* SilicaViewer.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = SilicaViewer.xctestplan; sourceTree = "<group>"; };
|
||||
0371995D27BAC5D800EE1DFD /* Silica ViewerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Silica ViewerTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
0371995F27BAC5D800EE1DFD /* Silica_ViewerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Silica_ViewerTests.swift; sourceTree = "<group>"; };
|
||||
0371996627BACD8700EE1DFD /* ExportAccessoryView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ExportAccessoryView.xib; sourceTree = "<group>"; };
|
||||
0371996827BACDE800EE1DFD /* ExportAccessoryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExportAccessoryView.swift; sourceTree = "<group>"; };
|
||||
03C39DE226F90733005555AE /* lzodefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lzodefs.h; sourceTree = "<group>"; };
|
||||
03C39DE326F90733005555AE /* COPYING */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = COPYING; sourceTree = "<group>"; };
|
||||
03C39DE426F90734005555AE /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
|
||||
|
@ -143,6 +158,13 @@
|
|||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
0371995A27BAC5D800EE1DFD /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
03CB382C2419C9DB0078B3E5 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
|
@ -156,11 +178,13 @@
|
|||
030F6FE52415C5E300A43F01 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0371995827BAC52900EE1DFD /* SilicaViewer.xctestplan */,
|
||||
0357A94826F9C71E0075D5BC /* LZO */,
|
||||
035D19F726F0927200B332BE /* SilicaViewer */,
|
||||
03CB383E241A5ACD0078B3E5 /* Shared */,
|
||||
030F700C2415C6B500A43F01 /* Quicklook */,
|
||||
036AFC0F241800350075400A /* Thumbnail */,
|
||||
0371995E27BAC5D800EE1DFD /* Silica ViewerTests */,
|
||||
030F70092415C6B500A43F01 /* Frameworks */,
|
||||
030F6FEF2415C5E300A43F01 /* Products */,
|
||||
);
|
||||
|
@ -173,6 +197,7 @@
|
|||
030F70082415C6B500A43F01 /* QuickLook.appex */,
|
||||
036AFC0B241800350075400A /* Thumbnail.appex */,
|
||||
03CB382E2419C9DB0078B3E5 /* libLZO.a */,
|
||||
0371995D27BAC5D800EE1DFD /* Silica ViewerTests.xctest */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
|
@ -227,6 +252,8 @@
|
|||
035D1A0126F0927200B332BE /* AppDelegate.swift */,
|
||||
035D1A0226F0927200B332BE /* TimelapseViewController.swift */,
|
||||
035D1A0326F0927200B332BE /* Info.plist */,
|
||||
0371996627BACD8700EE1DFD /* ExportAccessoryView.xib */,
|
||||
0371996827BACDE800EE1DFD /* ExportAccessoryView.swift */,
|
||||
);
|
||||
path = SilicaViewer;
|
||||
sourceTree = "<group>";
|
||||
|
@ -241,6 +268,14 @@
|
|||
path = Thumbnail;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
0371995E27BAC5D800EE1DFD /* Silica ViewerTests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0371995F27BAC5D800EE1DFD /* Silica_ViewerTests.swift */,
|
||||
);
|
||||
path = "Silica ViewerTests";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
03CB383E241A5ACD0078B3E5 /* Shared */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
|
@ -370,8 +405,7 @@
|
|||
030F6FE62415C5E300A43F01 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
==== BASE ====
|
||||
LastSwiftUpdateCheck = 1130;
|
||||
LastSwiftUpdateCheck = 1320;
|
||||
LastUpgradeCheck = 1250;
|
||||
ORGANIZATIONNAME = Josh;
|
||||
TargetAttributes = {
|
||||
|
@ -426,6 +460,7 @@
|
|||
files = (
|
||||
035D1A0626F0927200B332BE /* Assets.xcassets in Resources */,
|
||||
035D1A0726F0927200B332BE /* Main.storyboard in Resources */,
|
||||
0371996727BACD8700EE1DFD /* ExportAccessoryView.xib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -463,6 +498,7 @@
|
|||
035D1A0426F0927200B332BE /* ViewController.swift in Sources */,
|
||||
035D1A0526F0927200B332BE /* cbridge.c in Sources */,
|
||||
035D1A0826F0927200B332BE /* InfoViewController.swift in Sources */,
|
||||
0371996927BACDE800EE1DFD /* ExportAccessoryView.swift in Sources */,
|
||||
03CB3840241A5AED0078B3E5 /* Shared.swift in Sources */,
|
||||
035D1A0926F0927200B332BE /* Document.swift in Sources */,
|
||||
);
|
||||
|
|
|
@ -28,7 +28,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations {
|
|||
|
||||
let savePanel = NSSavePanel()
|
||||
savePanel.title = "Save"
|
||||
savePanel.allowedFileTypes = ["public.png"]
|
||||
savePanel.allowedFileTypes = ["public.png", "public.jpeg"]
|
||||
savePanel.accessoryView = ExportAccessoryView.fromNib()
|
||||
|
||||
savePanel.begin { (result) in
|
||||
if result.rawValue == NSApplication.ModalResponse.OK.rawValue {
|
||||
let canvas = document?.makeComposite()
|
||||
|
|
16
SilicaViewer/ExportAccessoryView.swift
Normal file
16
SilicaViewer/ExportAccessoryView.swift
Normal file
|
@ -0,0 +1,16 @@
|
|||
import Foundation
|
||||
import AppKit
|
||||
|
||||
class ExportAccessoryView : NSView {
|
||||
|
||||
}
|
||||
|
||||
extension NSView {
|
||||
class func fromNib<T: NSView>() -> T? {
|
||||
var topLevelObjects : NSArray?
|
||||
guard Bundle.main.loadNibNamed("\(self)", owner: nil, topLevelObjects: &topLevelObjects) else {
|
||||
return nil
|
||||
}
|
||||
return topLevelObjects!.first(where: { $0 is T }) as? T
|
||||
}
|
||||
}
|
35
SilicaViewer/ExportAccessoryView.xib
Normal file
35
SilicaViewer/ExportAccessoryView.xib
Normal file
|
@ -0,0 +1,35 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner"/>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="c22-O7-iKe">
|
||||
<rect key="frame" x="0.0" y="0.0" width="111" height="60"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2ff-Tm-r97">
|
||||
<rect key="frame" x="17" y="16" width="78" height="25"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<popUpButtonCell key="cell" type="push" title="Item 1" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" selectedItem="Izp-Ei-zox" id="r8S-Bt-u1Y">
|
||||
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" id="laP-Yo-gBn">
|
||||
<items>
|
||||
<menuItem title="Item 1" state="on" id="Izp-Ei-zox"/>
|
||||
<menuItem title="Item 2" id="BaW-Av-Mt9"/>
|
||||
<menuItem title="Item 3" id="7rG-gq-cBM"/>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
</popUpButton>
|
||||
</subviews>
|
||||
<point key="canvasLocation" x="-45.5" y="29"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
Reference in a new issue