Skip to content

Commit

Permalink
That is a lot of keys…
Browse files Browse the repository at this point in the history
  • Loading branch information
emsquared committed Jun 24, 2012
1 parent bab7936 commit f5e9cd9
Show file tree
Hide file tree
Showing 14 changed files with 919 additions and 728 deletions.
14 changes: 7 additions & 7 deletions Classes/Controllers/TXMasterController.m
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ - (BOOL)splitView:(NSSplitView *)splitView canCollapseSubview:(NSView *)subview

- (void)loadWindowState
{
NSDictionary *dic = [TPCPreferences loadWindowStateWithName:@"MainWindow"];
NSDictionary *dic = [TPCPreferences loadWindowStateWithName:@"Window -> Main Window"];

if (dic) {
NSInteger x = [dic integerForKey:@"x"];
Expand All @@ -550,9 +550,9 @@ - (void)loadWindowState

[self.window setFrame:NSMakeRect(x, y, w, h) display:YES animate:self.menu.isInFullScreenMode];

[self.text setGrammarCheckingEnabled:[_NSUserDefaults() boolForKey:@"GrammarChecking"]];
[self.text setContinuousSpellCheckingEnabled:[_NSUserDefaults() boolForKey:@"SpellChecking"]];
[self.text setAutomaticSpellingCorrectionEnabled:[_NSUserDefaults() boolForKey:@"AutoSpellCorrection"]];
[self.text setGrammarCheckingEnabled:[_NSUserDefaults() boolForKey:@"TextFieldAutomaticGrammarCheck"]];
[self.text setContinuousSpellCheckingEnabled:[_NSUserDefaults() boolForKey:@"TextFieldAutomaticSpellCheck"]];
[self.text setAutomaticSpellingCorrectionEnabled:[_NSUserDefaults() boolForKey:@"TextFieldAutomaticSpellCorrection"]];

self.serverSplitView.position = [dic integerForKey:@"serverList"];
self.memberSplitView.position = [dic integerForKey:@"memberList"];
Expand Down Expand Up @@ -618,9 +618,9 @@ - (void)saveWindowState
[dic setInteger:self.serverSplitView.position forKey:@"serverList"];
[dic setInteger:self.memberSplitView.position forKey:@"memberList"];

[_NSUserDefaults() setBool:[self.text isGrammarCheckingEnabled] forKey:@"GrammarChecking"];
[_NSUserDefaults() setBool:[self.text isContinuousSpellCheckingEnabled] forKey:@"SpellChecking"];
[_NSUserDefaults() setBool:[self.text isAutomaticSpellingCorrectionEnabled] forKey:@"AutoSpellCorrection"];
[_NSUserDefaults() setBool:[self.text isGrammarCheckingEnabled] forKey:@"TextFieldAutomaticGrammarCheck"];
[_NSUserDefaults() setBool:[self.text isContinuousSpellCheckingEnabled] forKey:@"TextFieldAutomaticSpellCheck"];
[_NSUserDefaults() setBool:[self.text isAutomaticSpellingCorrectionEnabled] forKey:@"TextFieldAutomaticSpellCorrection"];

[TPCPreferences saveWindowState:dic name:@"MainWindow"];
[TPCPreferences sync];
Expand Down
10 changes: 8 additions & 2 deletions Classes/Controllers/TXMenuController.m
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,14 @@ - (void)deleteServer:(id)sender
}

[u.config destroyKeychains];

[_NSUserDefaults() removeObjectForKey:[@"Preferences.prompts.cert_trust_error." stringByAppendingString:u.config.guid]];

NSString *supkey;

supkey = TXPopupPromptSuppressionPrefix;
supkey = [supkey stringByAppendingString:@"cert_trust_error."];
supkey = [supkey stringByAppendingString:u.config.guid];

[_NSUserDefaults() removeObjectForKey:supkey];

[self.world destroyClient:u];
[self.world save];
Expand Down
2 changes: 1 addition & 1 deletion Classes/Headers/TLOPopupPrompts.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#import "TextualApplication.h"

#define TXPopupPromptSuppressionPrefix @"Preferences.prompts."
#define TXPopupPromptSuppressionPrefix @"Text Input Prompt Suppression -> "

@interface TLOPopupPrompts : NSObject
+ (void)popupPromptNULLSelector:(NSInteger)returnCode;
Expand Down
5 changes: 1 addition & 4 deletions Classes/Headers/TPCPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ typedef enum {
+ (void)setTranscriptFolder:(NSString *)value;

+ (NSDictionary *)commandIndexList;
+ (NSInteger)commandUIndex:(NSString *)command;
+ (NSInteger)indexOfIRCommand:(NSString *)command;

+ (NSString *)defaultRealname;
+ (NSString *)defaultUsername;
Expand Down Expand Up @@ -197,9 +197,6 @@ typedef enum {
+ (NSString *)completionSuffix;
+ (void)setCompletionSuffix:(NSString *)value;

+ (BOOL)registeredToGrowl;
+ (void)setRegisteredToGrowl:(BOOL)value;

+ (NSDictionary *)loadWorld;
+ (void)saveWorld:(NSDictionary *)value;

Expand Down
2 changes: 1 addition & 1 deletion Classes/Helpers/THOPluginItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ - (void)initWithPluginClass:(Class)primaryClass

if (NSObjectIsNotEmpty(pluginRules)) {
for (NSString *command in pluginRules) {
if ([TPCPreferences commandUIndex:command] >= 1) {
if ([TPCPreferences indexOfIRCommand:command] >= 1) {
id objectValue = [pluginRules objectForKey:command];

if ([objectValue isKindOfClass:[NSArray class]]) {
Expand Down
11 changes: 6 additions & 5 deletions Classes/IRC/IRCClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -1633,7 +1633,7 @@ - (BOOL)sendCommand:(id)str completeTarget:(BOOL)completeTarget target:(NSString
[s deleteCharactersInRange:NSMakeRange(0, 1)];
}

switch ([TPCPreferences commandUIndex:cmd]) {
switch ([TPCPreferences indexOfIRCommand:cmd]) {
case 3: // Command: AWAY
{
NSString *msg = s.string;
Expand Down Expand Up @@ -5634,18 +5634,19 @@ - (void)ircConnectionDidConnect:(IRCConnection *)sender
- (void)ircConnectionDidDisconnect:(IRCConnection *)sender
{
if (self.disconnectType == IRCBadSSLCertificateDisconnectMode) {
NSString *suppKey = [@"cert_trust_error." stringByAppendingString:self.config.guid];
NSString *supkeyHead = TXPopupPromptSuppressionPrefix;
NSString *supkeyBack = [NSString stringWithFormat:@"cert_trust_error.@", self.config.guid];

if (self.config.isTrustedConnection == NO) {
BOOL status = [TLOPopupPrompts dialogWindowWithQuestion:TXTLS(@"SocketBadSSLCertificateErrorMessage")
title:TXTLS(@"SocketBadSSLCertificateErrorTitle")
defaultButton:TXTLS(@"TrustButton")
alternateButton:TXTLS(@"CancelButton")
otherButton:nil
suppressionKey:suppKey
suppressionKey:supkeyBack
suppressionText:@"-"];

[_NSUserDefaults() setBool:status forKey:suppKey];
[_NSUserDefaults() setBool:status forKey:[supkeyHead stringByAppendingString:supkeyBack]];

if (status) {
self.config.isTrustedConnection = status;
Expand Down Expand Up @@ -5703,7 +5704,7 @@ - (void)ircConnectionDidReceive:(NSData *)data
if (m.numericReply > 0) {
[self receiveNumericReply:m];
} else {
switch ([TPCPreferences commandUIndex:cmd]) {
switch ([TPCPreferences indexOfIRCommand:cmd]) {
case 4: // Command: ERROR
{
[self receiveError:m];
Expand Down
2 changes: 1 addition & 1 deletion Classes/Library/TLOSocketClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ - (id)init
- (BOOL)useNewSocketEngine
{
return (self.useSystemSocks == NO && self.useSocks == NO &&
[_NSUserDefaults() boolForKey:@"disableNewSocketEngine"] == NO);
[_NSUserDefaults() boolForKey:@"DisableNewSocketEngine"] == NO);
}

- (void)destroyDispatchQueue
Expand Down
Loading

0 comments on commit f5e9cd9

Please sign in to comment.