Skip to content

Commit

Permalink
Clean theme dead code and fix debug console colors for DM
Browse files Browse the repository at this point in the history
  • Loading branch information
nark committed Apr 30, 2020
1 parent 57c204d commit c4c56f3
Show file tree
Hide file tree
Showing 12 changed files with 212 additions and 1,475 deletions.
6 changes: 1 addition & 5 deletions Sources/WCApplicationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -792,11 +792,7 @@ - (BOOL)application:(NSApplication *)application openFile:(NSString *)filename {

extension = [filename pathExtension];

if([extension isEqualToString:@"WiredTheme"])
return [[WCPreferences preferences] importThemeFromFile:filename];
else if([extension isEqualToString:@"WiredTemplate"])
return [[WCPreferences preferences] importTemplateFromFile:filename];
else if([extension isEqualToString:@"WiredBookmarks"])
if([extension isEqualToString:@"WiredBookmarks"])
return [[WCPreferences preferences] importBookmarksFromFile:filename];
else if([extension isEqualToString:@"WiredTrackerBookmarks"])
return [[WCPreferences preferences] importTrackerBookmarksFromFile:filename];
Expand Down
3 changes: 2 additions & 1 deletion Sources/WCChatController.m
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ - (void)_printChat:(NSString *)chat by:(WCUser *)user {
nick, @"nick",
mutableOutput, @"message", nil];

NSLog(@"jsonProxy : %@", jsonProxy);

//NSLog(@"jsonProxy : %@", jsonProxy);

[_chatOutputWebView stringByEvaluatingJavaScriptFromString:
[NSSWF:@"printMessage(%@);", [_jsonWriter stringWithObject:jsonProxy]]];
Expand Down
21 changes: 11 additions & 10 deletions Sources/WCConsole.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#import "WCConsole.h"
#import "WCServerConnection.h"

#define WCConsoleMaxLength 1048576
#define WCConsoleMaxLength 1048576

@interface WCConsole(Private)

Expand Down Expand Up @@ -91,12 +91,13 @@ - (void)_log:(NSString *)string color:(NSColor *)color {
CGFloat position;

if(!font)
font = [[NSFont fontWithName:@"Monaco" size:9.0] retain];
font = [[NSFont fontWithName:@"Menlo" size:11.0] retain]; //

attributes = [NSDictionary dictionaryWithObjectsAndKeys:
color, NSForegroundColorAttributeName,
font, NSFontAttributeName,
NULL];

attributedString = [NSAttributedString attributedStringWithString:string attributes:attributes];

position = [[_consoleScrollView verticalScroller] floatValue];
Expand Down Expand Up @@ -138,38 +139,38 @@ - (void)windowDidLoad {
#pragma mark -

- (void)linkConnectionReceivedMessage:(NSNotification *)notification {
[self _log:[[notification object] description] color:[NSColor blueColor]];
[self _log:[[notification object] description] color:[NSColor systemBlueColor]]; //
}



- (void)linkConnectionReceivedErrorMessage:(NSNotification *)notification {
[self _log:[[notification object] description] color:[NSColor redColor]];
[self _log:[[notification object] description] color:[NSColor systemRedColor]]; //
}



- (void)linkConnectionReceivedInvalidMessage:(NSNotification *)notification {
[self _log:[[notification object] description] color:[NSColor redColor]];
[self _log:[[[notification userInfo] objectForKey:@"WCError"] localizedDescription] color:[NSColor redColor]];
[self _log:[[notification object] description] color:[NSColor systemRedColor]]; //
[self _log:[[[notification userInfo] objectForKey:@"WCError"] localizedDescription] color:[NSColor systemRedColor]]; //
}



- (void)linkConnectionSentMessage:(NSNotification *)notification {
[self _log:[[notification object] description] color:[NSColor blackColor]];
[self _log:[[notification object] description] color:[NSColor controlTextColor]]; //
}



- (void)exceptionHandlerReceivedBacktrace:(NSNotification *)notification {
[self _log:[notification object] color:[NSColor redColor]];
[self _log:[notification object] color:[NSColor systemRedColor]]; //
}



- (void)exceptionHandlerReceivedException:(NSNotification *)notification {
[self _log:[[notification object] description] color:[NSColor redColor]];
[self _log:[[notification object] description] color:[NSColor systemRedColor]]; //
}


Expand All @@ -181,7 +182,7 @@ - (void)log:(NSString *)format, ... {

va_start(ap, format);

[self _log:[NSString stringWithFormat:format arguments:ap] color:[NSColor redColor]];
[self _log:[NSString stringWithFormat:format arguments:ap] color:[NSColor systemRedColor]]; //

va_end(ap);
}
Expand Down
32 changes: 1 addition & 31 deletions Sources/WCPreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,6 @@ extern NSString * const WCIconDidChangeNotification;

IBOutlet NSMatrix *_threadsSplitViewMatrix;

IBOutlet NSWindow *_themesWindow;
IBOutlet NSWindow *_addThemeWindow;
IBOutlet NSWindow *_manageThemesWindow;
IBOutlet NSTextField *_addThemeNameTextField;
IBOutlet NSPopUpButton *_themesPopUpButton;
IBOutlet NSButton *_addThemeButton;
IBOutlet NSButton *_deleteThemeButton;
IBOutlet NSButton *_selectThemeButton;
IBOutlet NSButton *_customizeThemesButton;

IBOutlet NSPopUpButton *_themesTemplatesPopUpButton;
IBOutlet NSWindow *_themesTemplatesWindow;
IBOutlet NSTableView *_themesTemplatesTableView;
IBOutlet NSTableView *_themesTableView;

IBOutlet NSTextField *_themesChatFontTextField;
IBOutlet NSButton *_themesChatFontButton;
IBOutlet NSColorWell *_themesChatTextColorWell;
Expand Down Expand Up @@ -152,13 +137,10 @@ extern NSString * const WCIconDidChangeNotification;

IBOutlet NSTextField *_networkConnectionTimeoutTextField;
IBOutlet NSTextField *_networkReadTimeoutTextField;
IBOutlet NSPopUpButton *_networkCipherPopUpButton;
IBOutlet NSButton *_networkCompressionButton;

IBOutlet NSView *_bookmarksExportView;

IBOutlet WCThemesPreferences *_themesPreferences;


WITemplateBundleManager *_privateTemplateManager;
WITemplateBundleManager *_publicTemplateManager;

Expand All @@ -168,25 +150,13 @@ extern NSString * const WCIconDidChangeNotification;

+ (WCPreferences *)preferences;

- (BOOL)importThemeFromFile:(NSString *)path;
- (BOOL)importTemplateFromFile:(NSString *)path;
- (BOOL)importBookmarksFromFile:(NSString *)path;
- (BOOL)importTrackerBookmarksFromFile:(NSString *)path;
- (NSImage *)imageForTheme:(NSDictionary *)theme size:(NSSize)size;

- (IBAction)changePreferences:(id)sender;

- (IBAction)customizeTheme:(id)sender;
- (IBAction)closeTheme:(id)sender;
- (IBAction)addTheme:(id)sender;
- (IBAction)cancelAddTheme:(id)sender;
- (IBAction)okAddTheme:(id)sender;
- (IBAction)editTheme:(id)sender;
- (IBAction)deleteTheme:(id)sender;
- (IBAction)duplicateTheme:(id)sender;
- (IBAction)exportTheme:(id)sender;
- (IBAction)importTheme:(id)sender;
- (IBAction)selectTheme:(id)sender;
- (IBAction)changeTheme:(id)sender;
- (IBAction)changeThemeFont:(id)sender;

Expand Down
Loading

0 comments on commit c4c56f3

Please sign in to comment.