From dbd3e5901f07c76866047bbdee4c26bfefb3a3bd Mon Sep 17 00:00:00 2001 From: Matthias Neeracher <neeracher@apple.com> Date: Sat, 13 Aug 2011 22:12:58 +0200 Subject: [PATCH] Implement deleting --- Medianno/MADocWindow.h | 1 + Medianno/MADocWindow.mm | 17 +++ Medianno/en.lproj/MADocument.xib | 175 ++++++++++++++++++++++++++++++- Medianno/en.lproj/MainMenu.xib | 146 +++++++++++++++++--------- 4 files changed, 286 insertions(+), 53 deletions(-) diff --git a/Medianno/MADocWindow.h b/Medianno/MADocWindow.h index 7e2cd1f..efc9958 100644 --- a/Medianno/MADocWindow.h +++ b/Medianno/MADocWindow.h @@ -13,6 +13,7 @@ IBOutlet NSArrayController* annotationController; IBOutlet QTMovieView * movieView; IBOutlet NSTokenField * tokenFieldProto; + IBOutlet NSTableView * mediaTable; IBOutlet NSTableView * annotationTable; IBOutlet NSTableColumn * tokenColumn; } diff --git a/Medianno/MADocWindow.mm b/Medianno/MADocWindow.mm index 39f2886..48020b9 100644 --- a/Medianno/MADocWindow.mm +++ b/Medianno/MADocWindow.mm @@ -113,4 +113,21 @@ return [[self document] tagDescriptionForName:editingString]; } +#pragma mark Menu commands + +- (IBAction)delete:(id)sender +{ + NSResponder * responder = [[self window] firstResponder]; + while (responder && responder != self) { + if (responder == mediaTable) { + [mediaController remove:sender]; + break; + } else if (responder == annotationTable) { + [annotationController remove:sender]; + break; + } + responder = [responder nextResponder]; + } +} + @end diff --git a/Medianno/en.lproj/MADocument.xib b/Medianno/en.lproj/MADocument.xib index 1fbd43d..ab7c66c 100644 --- a/Medianno/en.lproj/MADocument.xib +++ b/Medianno/en.lproj/MADocument.xib @@ -72,6 +72,7 @@ </object> <string key="NSFrameSize">{550, 22}</string> <reference key="NSSuperview"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView"/> <string key="NSReuseIdentifierKey">_NS:3123</string> <bool key="NSEnabled">YES</bool> @@ -145,6 +146,7 @@ <int key="NSvFlags">256</int> <string key="NSFrameSize">{1279, 183}</string> <reference key="NSSuperview" ref="204692115"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="332479500"/> <string key="NSReuseIdentifierKey">_NS:1197</string> <bool key="NSEnabled">YES</bool> @@ -153,6 +155,7 @@ <int key="NSvFlags">256</int> <string key="NSFrameSize">{1279, 17}</string> <reference key="NSSuperview" ref="502749411"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="204692115"/> <string key="NSReuseIdentifierKey">_NS:1199</string> <reference key="NSTableView" ref="215129609"/> @@ -320,6 +323,7 @@ </object> <string key="NSFrame">{{1, 17}, {1279, 183}}</string> <reference key="NSSuperview" ref="726433129"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="215129609"/> <string key="NSReuseIdentifierKey">_NS:1195</string> <reference key="NSDocView" ref="215129609"/> @@ -331,6 +335,7 @@ <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{224, 17}, {15, 102}}</string> <reference key="NSSuperview" ref="726433129"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="728144490"/> <string key="NSReuseIdentifierKey">_NS:1214</string> <reference key="NSTarget" ref="726433129"/> @@ -343,6 +348,7 @@ <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{1, 185}, {1278, 15}}</string> <reference key="NSSuperview" ref="726433129"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="475349496"/> <string key="NSReuseIdentifierKey">_NS:1216</string> <int key="NSsFlags">1</int> @@ -359,6 +365,7 @@ </object> <string key="NSFrame">{{1, 0}, {1279, 17}}</string> <reference key="NSSuperview" ref="726433129"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="117432108"/> <string key="NSReuseIdentifierKey">_NS:1200</string> <reference key="NSDocView" ref="117432108"/> @@ -368,6 +375,7 @@ </object> <string key="NSFrameSize">{1281, 201}</string> <reference key="NSSuperview" ref="196617426"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="502749411"/> <string key="NSReuseIdentifierKey">_NS:1193</string> <int key="NSsFlags">133682</int> @@ -402,6 +410,7 @@ </object> <string key="NSFrame">{{0, 581}, {1281, 16}}</string> <reference key="NSSuperview" ref="1058980817"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="1054473103"/> <string key="NSReuseIdentifierKey">_NS:46</string> <reference key="kCoderFillColor" ref="1064784368"/> @@ -425,6 +434,7 @@ <int key="NSvFlags">256</int> <string key="NSFrameSize">{1279, 564}</string> <reference key="NSSuperview" ref="51131752"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="715872882"/> <string key="NSReuseIdentifierKey">_NS:1197</string> <bool key="NSEnabled">YES</bool> @@ -433,6 +443,7 @@ <int key="NSvFlags">256</int> <string key="NSFrameSize">{1279, 17}</string> <reference key="NSSuperview" ref="794153134"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="51131752"/> <string key="NSReuseIdentifierKey">_NS:1199</string> <reference key="NSTableView" ref="620291245"/> @@ -546,6 +557,7 @@ </object> <string key="NSFrame">{{1, 17}, {1279, 564}}</string> <reference key="NSSuperview" ref="1054473103"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="620291245"/> <string key="NSReuseIdentifierKey">_NS:1195</string> <reference key="NSDocView" ref="620291245"/> @@ -557,6 +569,7 @@ <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{224, 17}, {15, 102}}</string> <reference key="NSSuperview" ref="1054473103"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="387598056"/> <string key="NSReuseIdentifierKey">_NS:1214</string> <reference key="NSTarget" ref="1054473103"/> @@ -568,6 +581,7 @@ <int key="NSvFlags">-2147483392</int> <string key="NSFrame">{{1, 566}, {1279, 15}}</string> <reference key="NSSuperview" ref="1054473103"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView"/> <string key="NSReuseIdentifierKey">_NS:1216</string> <int key="NSsFlags">1</int> @@ -584,6 +598,7 @@ </object> <string key="NSFrame">{{1, 0}, {1279, 17}}</string> <reference key="NSSuperview" ref="1054473103"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="995480265"/> <reference key="NSDocView" ref="995480265"/> <reference key="NSBGColor" ref="1040976304"/> @@ -592,6 +607,7 @@ </object> <string key="NSFrame">{{0, -1}, {1281, 582}}</string> <reference key="NSSuperview" ref="1058980817"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="794153134"/> <string key="NSReuseIdentifierKey">_NS:1193</string> <int key="NSsFlags">133682</int> @@ -604,12 +620,14 @@ </object> <string key="NSFrameSize">{1281, 599}</string> <reference key="NSSuperview" ref="475349496"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="56699403"/> <string key="NSReuseIdentifierKey">_NS:11</string> </object> </object> <string key="NSFrame">{{0, 211}, {1281, 599}}</string> <reference key="NSSuperview" ref="196617426"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="1058980817"/> <string key="NSReuseIdentifierKey">_NS:9</string> <string key="NSOffsets">{0, 0}</string> @@ -634,12 +652,14 @@ </object> <string key="NSFrameSize">{1281, 810}</string> <reference key="NSSuperview" ref="568628114"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="726433129"/> <int key="NSDividerStyle">3</int> </object> </object> <string key="NSFrameSize">{1280, 809}</string> <reference key="NSSuperview"/> + <reference key="NSWindow"/> <reference key="NSNextKeyView" ref="196617426"/> </object> <string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string> @@ -1008,6 +1028,46 @@ </object> <int key="connectionID">100176</int> </object> + <object class="IBConnectionRecord"> + <object class="IBOutletConnection" key="connection"> + <string key="label">mediaTable</string> + <reference key="source" ref="512844837"/> + <reference key="destination" ref="215129609"/> + </object> + <int key="connectionID">100177</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBBindingConnection" key="connection"> + <string key="label">managedObjectContext: document.managedObjectContext</string> + <reference key="source" ref="603895450"/> + <reference key="destination" ref="512844837"/> + <object class="NSNibBindingConnector" key="connector"> + <reference key="NSSource" ref="603895450"/> + <reference key="NSDestination" ref="512844837"/> + <string key="NSLabel">managedObjectContext: document.managedObjectContext</string> + <string key="NSBinding">managedObjectContext</string> + <string key="NSKeyPath">document.managedObjectContext</string> + <int key="NSNibBindingConnectorVersion">2</int> + </object> + </object> + <int key="connectionID">100178</int> + </object> + <object class="IBConnectionRecord"> + <object class="IBBindingConnection" key="connection"> + <string key="label">managedObjectContext: document.managedObjectContext</string> + <reference key="source" ref="261388520"/> + <reference key="destination" ref="512844837"/> + <object class="NSNibBindingConnector" key="connector"> + <reference key="NSSource" ref="261388520"/> + <reference key="NSDestination" ref="512844837"/> + <string key="NSLabel">managedObjectContext: document.managedObjectContext</string> + <string key="NSBinding">managedObjectContext</string> + <string key="NSKeyPath">document.managedObjectContext</string> + <int key="NSNibBindingConnectorVersion">2</int> + </object> + </object> + <int key="connectionID">100179</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -1395,9 +1455,120 @@ <reference key="dict.values" ref="0"/> </object> <nil key="sourceID"/> - <int key="maxID">100176</int> + <int key="maxID">100179</int> + </object> + <object class="IBClassDescriber" key="IBDocument.Classes"> + <object class="NSMutableArray" key="referencedPartialClassDescriptions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBPartialClassDescription"> + <string key="className">MADocWindow</string> + <string key="superclassName">NSWindowController</string> + <object class="NSMutableDictionary" key="actions"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>addAnnotation:</string> + <string>addMediaFiles:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <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>addAnnotation:</string> + <string>addMediaFiles:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBActionInfo"> + <string key="name">addAnnotation:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">addMediaFiles:</string> + <string key="candidateClassName">id</string> + </object> + </object> + </object> + <object class="NSMutableDictionary" key="outlets"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>annotationController</string> + <string>annotationTable</string> + <string>mediaController</string> + <string>mediaTable</string> + <string>movieView</string> + <string>tokenColumn</string> + <string>tokenFieldProto</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>NSArrayController</string> + <string>NSTableView</string> + <string>NSArrayController</string> + <string>NSTableView</string> + <string>QTMovieView</string> + <string>NSTableColumn</string> + <string>NSTokenField</string> + </object> + </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>annotationController</string> + <string>annotationTable</string> + <string>mediaController</string> + <string>mediaTable</string> + <string>movieView</string> + <string>tokenColumn</string> + <string>tokenFieldProto</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBToOneOutletInfo"> + <string key="name">annotationController</string> + <string key="candidateClassName">NSArrayController</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">annotationTable</string> + <string key="candidateClassName">NSTableView</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">mediaController</string> + <string key="candidateClassName">NSArrayController</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">mediaTable</string> + <string key="candidateClassName">NSTableView</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">movieView</string> + <string key="candidateClassName">QTMovieView</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">tokenColumn</string> + <string key="candidateClassName">NSTableColumn</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">tokenFieldProto</string> + <string key="candidateClassName">NSTokenField</string> + </object> + </object> + </object> + <object class="IBClassDescriptionSource" key="sourceIdentifier"> + <string key="majorKey">IBProjectSource</string> + <string key="minorKey">./Classes/MADocWindow.h</string> + </object> + </object> + </object> </object> - <object class="IBClassDescriber" key="IBDocument.Classes"/> <int key="IBDocument.localizationMode">0</int> <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies"> diff --git a/Medianno/en.lproj/MainMenu.xib b/Medianno/en.lproj/MainMenu.xib index 4c14373..73b2225 100644 --- a/Medianno/en.lproj/MainMenu.xib +++ b/Medianno/en.lproj/MainMenu.xib @@ -395,19 +395,10 @@ <reference key="NSOnImage" ref="1033313550"/> <reference key="NSMixedImage" ref="310636482"/> </object> - <object class="NSMenuItem" id="763435172"> - <reference key="NSMenu" ref="789758025"/> - <string key="NSTitle">Paste and Match Style</string> - <string key="NSKeyEquiv">V</string> - <int key="NSKeyEquivModMask">1572864</int> - <int key="NSMnemonicLoc">2147483647</int> - <reference key="NSOnImage" ref="1033313550"/> - <reference key="NSMixedImage" ref="310636482"/> - </object> <object class="NSMenuItem" id="437104165"> <reference key="NSMenu" ref="789758025"/> <string key="NSTitle">Delete</string> - <string key="NSKeyEquiv"/> + <string type="base64-UTF8" key="NSKeyEquiv">CA</string> <int key="NSKeyEquivModMask">1048576</int> <int key="NSMnemonicLoc">2147483647</int> <reference key="NSOnImage" ref="1033313550"/> @@ -1250,14 +1241,6 @@ </object> <int key="connectionID">469</int> </object> - <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">pasteAsPlainText:</string> - <reference key="source" ref="1014"/> - <reference key="destination" ref="763435172"/> - </object> - <int key="connectionID">471</int> - </object> <object class="IBConnectionRecord"> <object class="IBActionConnection" key="connection"> <string key="label">showHelp:</string> @@ -1476,7 +1459,6 @@ <reference ref="676164635"/> <reference ref="507821607"/> <reference ref="981774355"/> - <reference ref="763435172"/> </object> <reference key="parent" ref="952259628"/> </object> @@ -1898,11 +1880,6 @@ <reference key="object" ref="817901857"/> <reference key="parent" ref="769623530"/> </object> - <object class="IBObjectRecord"> - <int key="objectID">470</int> - <reference key="object" ref="763435172"/> - <reference key="parent" ref="789758025"/> - </object> <object class="IBObjectRecord"> <int key="objectID">491</int> <reference key="object" ref="1050483726"/> @@ -2042,7 +2019,6 @@ <string>462.IBPluginDependency</string> <string>464.IBPluginDependency</string> <string>465.IBPluginDependency</string> - <string>470.IBPluginDependency</string> <string>491.IBPluginDependency</string> <string>492.IBPluginDependency</string> <string>493.IBPluginDependency</string> @@ -2166,7 +2142,6 @@ <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> <string>com.apple.InterfaceBuilder.CocoaPlugin</string> - <string>com.apple.InterfaceBuilder.CocoaPlugin</string> </object> </object> <object class="NSMutableDictionary" key="unlocalizedProperties"> @@ -2208,14 +2183,102 @@ <string key="className">MADocWindow</string> <string key="superclassName">NSWindowController</string> <object class="NSMutableDictionary" key="actions"> - <string key="NS.key.0">addMediaFiles:</string> - <string key="NS.object.0">id</string> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>addAnnotation:</string> + <string>addMediaFiles:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>id</string> + <string>id</string> + </object> </object> <object class="NSMutableDictionary" key="actionInfosByName"> - <string key="NS.key.0">addMediaFiles:</string> - <object class="IBActionInfo" key="NS.object.0"> - <string key="name">addMediaFiles:</string> - <string key="candidateClassName">id</string> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>addAnnotation:</string> + <string>addMediaFiles:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBActionInfo"> + <string key="name">addAnnotation:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">addMediaFiles:</string> + <string key="candidateClassName">id</string> + </object> + </object> + </object> + <object class="NSMutableDictionary" key="outlets"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>annotationController</string> + <string>annotationTable</string> + <string>mediaController</string> + <string>mediaTable</string> + <string>movieView</string> + <string>tokenColumn</string> + <string>tokenFieldProto</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>NSArrayController</string> + <string>NSTableView</string> + <string>NSArrayController</string> + <string>NSTableView</string> + <string>QTMovieView</string> + <string>NSTableColumn</string> + <string>NSTokenField</string> + </object> + </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>annotationController</string> + <string>annotationTable</string> + <string>mediaController</string> + <string>mediaTable</string> + <string>movieView</string> + <string>tokenColumn</string> + <string>tokenFieldProto</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBToOneOutletInfo"> + <string key="name">annotationController</string> + <string key="candidateClassName">NSArrayController</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">annotationTable</string> + <string key="candidateClassName">NSTableView</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">mediaController</string> + <string key="candidateClassName">NSArrayController</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">mediaTable</string> + <string key="candidateClassName">NSTableView</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">movieView</string> + <string key="candidateClassName">QTMovieView</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">tokenColumn</string> + <string key="candidateClassName">NSTableColumn</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">tokenFieldProto</string> + <string key="candidateClassName">NSTokenField</string> + </object> </object> </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> @@ -2223,25 +2286,6 @@ <string key="minorKey">./Classes/MADocWindow.h</string> </object> </object> - <object class="IBPartialClassDescription"> - <string key="className">MADocument</string> - <string key="superclassName">NSPersistentDocument</string> - <object class="NSMutableDictionary" key="actions"> - <string key="NS.key.0">addAnnotation:</string> - <string key="NS.object.0">id</string> - </object> - <object class="NSMutableDictionary" key="actionInfosByName"> - <string key="NS.key.0">addAnnotation:</string> - <object class="IBActionInfo" key="NS.object.0"> - <string key="name">addAnnotation:</string> - <string key="candidateClassName">id</string> - </object> - </object> - <object class="IBClassDescriptionSource" key="sourceIdentifier"> - <string key="majorKey">IBProjectSource</string> - <string key="minorKey">./Classes/MADocument.h</string> - </object> - </object> </object> </object> <int key="IBDocument.localizationMode">0</int>