Permalink
Browse files

Add a reset button to the preferences.

- Will put back the counter colors to the original defaults.
  • Loading branch information...
1 parent b682695 commit 3f9ce5b9665a790c6272e2eadf56e11d6d03071f @kamitchell kamitchell committed Oct 22, 2010
Showing with 100 additions and 24 deletions.
  1. +9 −0 MyAppDelegate.m
  2. +91 −24 Preferences.xib
View
@@ -147,4 +147,13 @@ - (IBAction)showPreferences:(id)sender
[self.preferencesWindowController showWindow:self];
}
+
+- (IBAction)resetPreferences:(id)sender
+{
+ NSUserDefaults *preferences = [NSUserDefaults standardUserDefaults];
+ [preferences removeObjectForKey:kCounterViewRingForeground];
+ [preferences removeObjectForKey:kCounterViewRingBackground];
+ [preferences removeObjectForKey:kCounterViewWedgeForeground];
+ [preferences removeObjectForKey:kCounterViewWedgeBackground];
+}
@end
View
@@ -41,7 +41,7 @@
<object class="NSWindowTemplate" id="1005">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{127, 663}, {216, 144}}</string>
+ <string key="NSWindowRect">{{127, 629}, {216, 178}}</string>
<int key="NSWTFlags">539492352</int>
<string key="NSWindowTitle">Preferences</string>
<string key="NSWindowClass">NSWindow</string>
@@ -55,7 +55,7 @@
<object class="NSTextField" id="644093570">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 110}, {112, 17}}</string>
+ <string key="NSFrame">{{17, 144}, {112, 17}}</string>
<reference key="NSSuperview" ref="1006"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="769959484">
@@ -91,7 +91,7 @@
<object class="NSTextField" id="601928843">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 82}, {116, 17}}</string>
+ <string key="NSFrame">{{17, 116}, {116, 17}}</string>
<reference key="NSSuperview" ref="1006"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="892979565">
@@ -107,7 +107,7 @@
<object class="NSTextField" id="114505582">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 51}, {126, 17}}</string>
+ <string key="NSFrame">{{17, 85}, {126, 17}}</string>
<reference key="NSSuperview" ref="1006"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="835684044">
@@ -123,7 +123,7 @@
<object class="NSTextField" id="1061054961">
<reference key="NSNextResponder" ref="1006"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{17, 20}, {130, 17}}</string>
+ <string key="NSFrame">{{17, 54}, {130, 17}}</string>
<reference key="NSSuperview" ref="1006"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="836318997">
@@ -146,15 +146,12 @@
<string>NSColor pasteboard type</string>
</object>
</object>
- <string key="NSFrame">{{152, 107}, {44, 23}}</string>
+ <string key="NSFrame">{{152, 141}, {44, 23}}</string>
<reference key="NSSuperview" ref="1006"/>
<bool key="NSEnabled">YES</bool>
<bool key="NSIsActive">YES</bool>
<bool key="NSIsBordered">YES</bool>
- <object class="NSColor" key="NSColor">
- <int key="NSColorSpace">1</int>
- <bytes key="NSRGB">MC4wNTgxMzA0OTg5OCAwLjA1NTU0MTg5OTA2IDEAA</bytes>
- </object>
+ <reference key="NSColor" ref="450497219"/>
</object>
<object class="NSColorWell" id="90919639">
<reference key="NSNextResponder" ref="1006"/>
@@ -166,7 +163,7 @@
<string>NSColor pasteboard type</string>
</object>
</object>
- <string key="NSFrame">{{152, 79}, {44, 23}}</string>
+ <string key="NSFrame">{{152, 113}, {44, 23}}</string>
<reference key="NSSuperview" ref="1006"/>
<bool key="NSEnabled">YES</bool>
<bool key="NSIsBordered">YES</bool>
@@ -185,7 +182,7 @@
<string>NSColor pasteboard type</string>
</object>
</object>
- <string key="NSFrame">{{152, 48}, {44, 23}}</string>
+ <string key="NSFrame">{{152, 82}, {44, 23}}</string>
<reference key="NSSuperview" ref="1006"/>
<bool key="NSEnabled">YES</bool>
<bool key="NSIsBordered">YES</bool>
@@ -204,7 +201,7 @@
<string>NSColor pasteboard type</string>
</object>
</object>
- <string key="NSFrame">{{152, 17}, {44, 23}}</string>
+ <string key="NSFrame">{{152, 51}, {44, 23}}</string>
<reference key="NSSuperview" ref="1006"/>
<bool key="NSEnabled">YES</bool>
<bool key="NSIsBordered">YES</bool>
@@ -213,21 +210,34 @@
<bytes key="NSRGB">MC4wNTgxMzA0OTg5OCAwLjA1NTU0MTg5OTA2IDEAA</bytes>
</object>
</object>
+ <object class="NSButton" id="231446013">
+ <reference key="NSNextResponder" ref="1006"/>
+ <int key="NSvFlags">268</int>
+ <string key="NSFrame">{{106, 12}, {96, 32}}</string>
+ <reference key="NSSuperview" ref="1006"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="486172552">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">134217728</int>
+ <string key="NSContents">Reset</string>
+ <reference key="NSSupport" ref="532671389"/>
+ <reference key="NSControlView" ref="231446013"/>
+ <int key="NSButtonFlags">-2038284033</int>
+ <int key="NSButtonFlags2">129</int>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
</object>
- <string key="NSFrameSize">{216, 144}</string>
+ <string key="NSFrameSize">{216, 178}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
</object>
<object class="NSUserDefaultsController" id="187832502">
- <object class="NSMutableArray" key="NSDeclaredKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>CounterViewRingForeground</string>
- <string>CounterViewRingBackground</string>
- <string>CounterViewWedgeForeground</string>
- <string>CounterViewWedgeBackground</string>
- </object>
<bool key="NSSharedInstance">YES</bool>
</object>
</object>
@@ -322,6 +332,14 @@
</object>
<int key="connectionID">38</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">resetPreferences:</string>
+ <reference key="source" ref="1003"/>
+ <reference key="destination" ref="231446013"/>
+ </object>
+ <int key="connectionID">41</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -372,6 +390,7 @@
<reference ref="114505582"/>
<reference ref="1061054961"/>
<reference ref="425358681"/>
+ <reference ref="231446013"/>
</object>
<reference key="parent" ref="1005"/>
</object>
@@ -456,6 +475,20 @@
<reference key="object" ref="1050194210"/>
<reference key="parent" ref="1006"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">39</int>
+ <reference key="object" ref="231446013"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="486172552"/>
+ </object>
+ <reference key="parent" ref="1006"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">40</int>
+ <reference key="object" ref="486172552"/>
+ <reference key="parent" ref="231446013"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -475,7 +508,9 @@
<string>25.IBPluginDependency</string>
<string>27.IBPluginDependency</string>
<string>3.IBPluginDependency</string>
+ <string>39.IBPluginDependency</string>
<string>4.IBPluginDependency</string>
+ <string>40.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
<string>7.IBPluginDependency</string>
@@ -484,9 +519,9 @@
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>{{127, 663}, {216, 144}}</string>
+ <string>{{127, 629}, {216, 178}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{127, 663}, {216, 144}}</string>
+ <string>{{127, 629}, {216, 178}}</string>
<integer value="1"/>
<string>{196, 240}</string>
<string>{{202, 428}, {480, 270}}</string>
@@ -503,6 +538,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>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
@@ -521,9 +558,23 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">38</int>
+ <int key="maxID">41</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
+ <object class="NSMutableArray" key="referencedPartialClassDescriptions">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBPartialClassDescription">
+ <string key="className">FirstResponder</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">resetPreferences:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBUserSource</string>
+ <string key="minorKey"/>
+ </object>
+ </object>
+ </object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
@@ -578,6 +629,22 @@
</object>
</object>
<object class="IBPartialClassDescription">
+ <string key="className">NSButton</string>
+ <string key="superclassName">NSControl</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSButton.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
+ <string key="className">NSButtonCell</string>
+ <string key="superclassName">NSActionCell</string>
+ <object class="IBClassDescriptionSource" key="sourceIdentifier">
+ <string key="majorKey">IBFrameworkSource</string>
+ <string key="minorKey">AppKit.framework/Headers/NSButtonCell.h</string>
+ </object>
+ </object>
+ <object class="IBPartialClassDescription">
<string key="className">NSCell</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">

0 comments on commit 3f9ce5b

Please sign in to comment.