Skip to content

Commit

Permalink
more preferences; update version number
Browse files Browse the repository at this point in the history
  • Loading branch information
scrod committed Jan 2, 2011
1 parent fd6e027 commit b9adb88
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
6 changes: 6 additions & 0 deletions GlobalPrefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ extern NSString *NVPTFPboardType;
- (void)setPastePreservesStyle:(BOOL)value sender:(id)sender;
- (BOOL)pastePreservesStyle;

- (void)setAutoFormatsDoneTag:(BOOL)value sender:(id)sender;
- (BOOL)autoFormatsDoneTag;

- (void)setLinksAutoSuggested:(BOOL)value sender:(id)sender;
- (BOOL)linksAutoSuggested;

Expand All @@ -131,6 +134,9 @@ extern NSString *NVPTFPboardType;
- (float)tableFontSize;
- (void)setTableFontSize:(float)fontSize sender:(id)sender;

- (void)setHorizontalLayout:(BOOL)value sender:(id)sender;
- (BOOL)horizontalLayout;

- (BOOL)autoCompleteSearches;
- (void)setAutoCompleteSearches:(BOOL)value sender:(id)sender;

Expand Down
26 changes: 25 additions & 1 deletion GlobalPrefs.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
static NSString *QuitWhenClosingMainWindowKey = @"QuitWhenClosingMainWindow";
static NSString *TabKeyIndentsKey = @"TabKeyIndents";
static NSString *PastePreservesStyleKey = @"PastePreservesStyle";
static NSString *AutoFormatsDoneTagKey = @"AutoFormatsDoneTag";
static NSString *AutoSuggestLinksKey = @"AutoSuggestLinks";
static NSString *HighlightSearchTermsKey = @"HighlightSearchTerms";
static NSString *SearchTermHighlightColorKey = @"SearchTermHighlightColor";
Expand All @@ -56,6 +57,7 @@
static NSString *MakeURLsClickableKey = @"MakeURLsClickable";
static NSString *AppActivationKeyCodeKey = @"AppActivationKeyCode";
static NSString *AppActivationModifiersKey = @"AppActivationModifiers";
static NSString *HorizontalLayoutKey = @"HorizontalLayout";
static NSString *BookmarksKey = @"Bookmarks";
static NSString *LastScrollOffsetKey = @"LastScrollOffset";
static NSString *LastSearchStringKey = @"LastSearchString";
Expand Down Expand Up @@ -97,7 +99,8 @@ - (id)init {
tableColumns = nil;

[defaults registerDefaults:[NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:NO], AutoSuggestLinksKey,
[NSNumber numberWithBool:YES], AutoSuggestLinksKey,
[NSNumber numberWithBool:YES], AutoFormatsDoneTagKey,
[NSNumber numberWithBool:NO], UseSoftTabsKey,
[NSNumber numberWithInt:4], NumberOfSpacesInTabKey,
[NSNumber numberWithBool:YES], PastePreservesStyleKey,
Expand All @@ -109,6 +112,7 @@ - (id)init {
[NSNumber numberWithBool:YES], QuitWhenClosingMainWindowKey,
[NSNumber numberWithBool:NO], TriedToImportBlorKey,
[NSNumber numberWithBool:NO], DrawFocusRingKey,
[NSNumber numberWithBool:NO], HorizontalLayoutKey,
[NSNumber numberWithBool:YES], MakeURLsClickableKey,
[NSNumber numberWithBool:YES], TableColumnsHaveBodyPreviewKey,
[NSNumber numberWithDouble:0.0], LastScrollOffsetKey,
Expand Down Expand Up @@ -331,6 +335,15 @@ - (BOOL)pastePreservesStyle {
return [defaults boolForKey:PastePreservesStyleKey];
}

- (void)setAutoFormatsDoneTag:(BOOL)value sender:(id)sender {
[defaults setBool:value forKey:AutoFormatsDoneTagKey];

SEND_CALLBACKS();
}
- (BOOL)autoFormatsDoneTag {
return [defaults boolForKey:AutoFormatsDoneTagKey];
}

- (void)setLinksAutoSuggested:(BOOL)value sender:(id)sender {
[defaults setBool:value forKey:AutoSuggestLinksKey];

Expand Down Expand Up @@ -486,6 +499,8 @@ - (NSDictionary*)noteBodyAttributes {
noteBodyAttributes = [[NSDictionary dictionaryWithObjectsAndKeys:bodyFont, NSFontAttributeName,
[self foregroundTextColor], NSForegroundColorAttributeName,
/* background text color is handled directly by the NSTextView subclass and so does not need to be stored here */
/*NSTextWritingDirectionEmbedding*/
//[NSArray arrayWithObjects:[NSNumber numberWithInt:0], [NSNumber numberWithInt:0], nil], @"NSWritingDirection", //for auto-LTR-RTL text
monospace ? [self noteBodyParagraphStyle] : nil, NSParagraphStyleAttributeName, nil] retain];
}
return noteBodyAttributes;
Expand Down Expand Up @@ -621,6 +636,15 @@ - (BOOL)tableIsReverseSorted {
return [defaults boolForKey:TableIsReverseSortedKey];
}

- (void)setHorizontalLayout:(BOOL)value sender:(id)sender {
[defaults setBool:value forKey:HorizontalLayoutKey];

SEND_CALLBACKS();
}
- (BOOL)horizontalLayout {
return [defaults boolForKey:HorizontalLayoutKey];
}

- (NSString*)lastSelectedPreferencesPane {
return [defaults stringForKey:LastSelectedPreferencesPaneKey];
}
Expand Down
4 changes: 2 additions & 2 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<key>CFBundleExecutable</key>
<string>Notational Velocity</string>
<key>CFBundleGetInfoString</key>
<string>2.0 β3, Copyright © 2010 Zachary Schneirov, All Rights Reserved.</string>
<string>2.0 β4, Copyright © 2010 Zachary Schneirov, All Rights Reserved.</string>
<key>CFBundleIconFile</key>
<string>Notality</string>
<key>CFBundleIdentifier</key>
Expand All @@ -142,7 +142,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0 β3</string>
<string>2.0 β4</string>
<key>CFBundleSignature</key>
<string>N†l√</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit b9adb88

Please sign in to comment.