Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added an 'export' entry to the file menu of the GUI application, to s…

…ave the contents of the NIB code as a file on the file system
  • Loading branch information...
commit 7ddec598f37cb181691ea794866791e7934e472d 1 parent 3269fb1
Adrian Kosmaczewski authored
View
124 GUI/English.lproj/MainMenu.xib
@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="57"/>
+ <integer value="81"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -238,6 +238,25 @@
<reference key="NSOnImage" ref="1033313550"/>
<reference key="NSMixedImage" ref="310636482"/>
</object>
+ <object class="NSMenuItem" id="357549107">
+ <reference key="NSMenu" ref="720053764"/>
+ <string key="NSTitle">Export...</string>
+ <string key="NSKeyEquiv">s</string>
+ <int key="NSKeyEquivModMask">1048576</int>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="1033313550"/>
+ <reference key="NSMixedImage" ref="310636482"/>
+ </object>
+ <object class="NSMenuItem" id="932140800">
+ <reference key="NSMenu" ref="720053764"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="1033313550"/>
+ <reference key="NSMixedImage" ref="310636482"/>
+ </object>
<object class="NSMenuItem" id="776162233">
<reference key="NSMenu" ref="720053764"/>
<string key="NSTitle">Close</string>
@@ -1571,6 +1590,14 @@
</object>
<int key="connectionID">529</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">saveDocumentTo:</string>
+ <reference key="source" ref="1014"/>
+ <reference key="destination" ref="357549107"/>
+ </object>
+ <int key="connectionID">532</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -1659,6 +1686,8 @@
<reference ref="1025936716"/>
<reference ref="776162233"/>
<reference ref="425164168"/>
+ <reference ref="932140800"/>
+ <reference ref="357549107"/>
</object>
<reference key="parent" ref="379814623"/>
</object>
@@ -2401,6 +2430,16 @@
<reference key="object" ref="838497762"/>
<reference key="parent" ref="546157535"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">530</int>
+ <reference key="object" ref="932140800"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">531</int>
+ <reference key="object" ref="357549107"/>
+ <reference key="parent" ref="720053764"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -2576,6 +2615,8 @@
<string>514.IBPluginDependency</string>
<string>515.IBPluginDependency</string>
<string>516.IBPluginDependency</string>
+ <string>530.IBPluginDependency</string>
+ <string>531.IBPluginDependency</string>
<string>56.IBPluginDependency</string>
<string>56.ImportedFromIB2</string>
<string>57.IBEditorWindowLastContentRect</string>
@@ -2771,6 +2812,8 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{221, 898}, {195, 183}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -2784,7 +2827,7 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>{{302, 1008}, {164, 73}}</string>
+ <string>{{302, 978}, {164, 103}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{155, 774}, {199, 203}}</string>
@@ -2810,7 +2853,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">529</int>
+ <int key="maxID">532</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
@@ -2875,6 +2918,81 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSDocument</string>
+ <string key="superclassName">NSObject</string>
+ <object class="NSMutableDictionary" key="actions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>printDocument:</string>
+ <string>revertDocumentToSaved:</string>
+ <string>runPageLayout:</string>
+ <string>saveDocument:</string>
+ <string>saveDocumentAs:</string>
+ <string>saveDocumentTo:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ <string>id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="dict.sortedKeys">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>printDocument:</string>
+ <string>revertDocumentToSaved:</string>
+ <string>runPageLayout:</string>
+ <string>saveDocument:</string>
+ <string>saveDocumentAs:</string>
+ <string>saveDocumentTo:</string>
+ </object>
+ <object class="NSMutableArray" key="dict.values">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBActionInfo">
+ <string key="name">printDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">revertDocumentToSaved:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">runPageLayout:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">saveDocument:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">saveDocumentAs:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ <object class="IBActionInfo">
+ <string key="name">saveDocumentTo:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDocument.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSDocument</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSDocumentScripting.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSDocumentController</string>
<string key="superclassName">NSObject</string>
<object class="NSMutableDictionary" key="actions">
View
13 GUI/MyDocument.m
@@ -44,6 +44,19 @@ - (void)windowControllerDidLoadNib:(NSWindowController *) aController
[self.editor setString:self.nibCode];
}
+- (BOOL)prepareSavePanel:(NSSavePanel *)savePanel
+{
+ [savePanel setAllowedFileTypes:[NSArray arrayWithObjects:@"m", nil]];
+ [savePanel setExtensionHidden:NO];
+ return YES;
+}
+
+- (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError
+{
+ [self.nibCode writeToURL:absoluteURL atomically:YES encoding:NSUTF8StringEncoding error:nil];
+ return YES;
+}
+
- (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type
{
self.fileName = fileName;
View
4 GUI/nib2objc-Info.plist
@@ -38,11 +38,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>1.0</string>
+ <string>1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>1</string>
+ <string>1.1</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSMainNibFile</key>
Please sign in to comment.
Something went wrong with that request. Please try again.