Added a log window to show the mp4v2 log messages.
This commit is contained in:
1 parent
28c89d2da7
commit
84ad50a434
7 files changed
+178
-4
No files matched your search
@@ -9,6 +9,7 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@class SBPrefsController;
|
||||
@class SBDebugLogController;
|
||||
|
||||
@interface SBDocumentController : NSDocumentController
|
||||
|
||||
@@ -16,6 +17,7 @@
|
||||
|
||||
@interface SBAppDelegate : NSObject {
|
||||
SBPrefsController *prefController;
|
||||
SBDebugLogController *debugLogController;
|
||||
SBDocumentController *documentController;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
#import "SBPresetManager.h"
|
||||
#import "SBQueueController.h"
|
||||
#import "SBPrefsController.h"
|
||||
#import "SBDebugLogController.h"
|
||||
|
||||
#import <MP42Foundation/MP42File.h>
|
||||
|
||||
#define DONATE_NAG_TIME (60 * 60 * 24 * 7)
|
||||
|
||||
@@ -22,6 +25,12 @@
|
||||
|
||||
[SBPrefsController registerUserDefaults];
|
||||
|
||||
debugLogController = [[SBDebugLogController alloc] init];
|
||||
|
||||
[MP42File redirectLogUsingBlock:^(NSString *text) {
|
||||
[debugLogController log:text];
|
||||
}];
|
||||
|
||||
if ([[NSUserDefaults standardUserDefaults] valueForKey:@"SBShowQueueWindow"])
|
||||
[[SBQueueController sharedManager] showWindow:self];
|
||||
}
|
||||
@@ -127,6 +136,11 @@
|
||||
[prefController showWindow:self];
|
||||
}
|
||||
|
||||
- (IBAction) showDebugLog:(id)sender
|
||||
{
|
||||
[debugLogController showWindow:self];
|
||||
}
|
||||
|
||||
- (IBAction) donate:(id)sender
|
||||
{
|
||||
[self linkDonate:sender];
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// SBDebugLogController.h
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 24/10/14.
|
||||
//
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface SBDebugLogController : NSWindowController {
|
||||
NSTextView *logView;
|
||||
}
|
||||
|
||||
- (void)log:(NSString *)string;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// SBDebugLogController.m
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 24/10/14.
|
||||
//
|
||||
//
|
||||
|
||||
#import "SBDebugLogController.h"
|
||||
|
||||
@interface SBDebugLogController ()
|
||||
|
||||
@property (assign) IBOutlet NSTextView *logView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation SBDebugLogController
|
||||
@synthesize logView;
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
if ((self = [super initWithWindowNibName:@"SBDebugLogWindow"])) {
|
||||
[self window];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (void)windowDidLoad {
|
||||
[super windowDidLoad];
|
||||
}
|
||||
|
||||
- (void)log:(NSString *)string {
|
||||
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:string];
|
||||
[[self.logView textStorage] appendAttributedString:attributedString];
|
||||
[attributedString release];
|
||||
}
|
||||
|
||||
- (IBAction)clearLog:(id)sender {
|
||||
[[self.logView textStorage] deleteCharactersInRange:NSMakeRange(0, [[self.logView textStorage] length])];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5053" systemVersion="13D21" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment defaultVersion="1060" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5053"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
|
||||
@@ -11,7 +11,7 @@
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<menu title="AMainMenu" systemMenu="main" id="29" userLabel="MainMenu">
|
||||
<items>
|
||||
<menuItem title="Subler" id="56">
|
||||
@@ -438,6 +438,12 @@
|
||||
<action selector="showBatchWindow:" target="-1" id="596"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show Debug Log" id="9t4-R8-Exy">
|
||||
<modifierMask key="keyEquivalentModifierMask" control="YES"/>
|
||||
<connections>
|
||||
<action selector="showDebugLog:" target="-1" id="AWK-Ym-NZb"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="92">
|
||||
<modifierMask key="keyEquivalentModifierMask" command="YES"/>
|
||||
</menuItem>
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="SBDebugLogController">
|
||||
<connections>
|
||||
<outlet property="logView" destination="Ztd-g7-f0E" id="QzQ-qg-BHq"/>
|
||||
<outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Debug Log" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="SBDebugLogWindow" animationBehavior="default" id="F0z-JX-Cv5">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="164" y="1020" width="480" height="310"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
<view key="contentView" id="se5-gp-TjO">
|
||||
<rect key="frame" x="0.0" y="-1" width="480" height="310"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<scrollView horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" id="GRB-Sq-PQq">
|
||||
<rect key="frame" x="-1" y="33" width="482" height="278"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<clipView key="contentView" id="ffN-FE-TPO">
|
||||
<rect key="frame" x="1" y="1" width="223" height="133"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textView editable="NO" importsGraphics="NO" findStyle="panel" allowsUndo="YES" verticallyResizable="YES" allowsNonContiguousLayout="YES" id="Ztd-g7-f0E">
|
||||
<rect key="frame" x="0.0" y="0.0" width="223" height="133"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<size key="minSize" width="480" height="276"/>
|
||||
<size key="maxSize" width="480" height="10000000"/>
|
||||
<color key="insertionPointColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<size key="minSize" width="480" height="276"/>
|
||||
<size key="maxSize" width="480" height="10000000"/>
|
||||
</textView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="YES" id="Vnb-hn-cmp">
|
||||
<rect key="frame" x="-100" y="-100" width="87" height="18"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="UlH-Il-Vxj">
|
||||
<rect key="frame" x="224" y="1" width="15" height="133"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<button verticalHuggingPriority="750" id="myf-Ql-qUP">
|
||||
<rect key="frame" x="389" y="2" width="73" height="28"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Clear" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="h1X-Ni-exQ">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="clearLog:" target="-2" id="m5c-Yn-MPI"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="551" y="403"/>
|
||||
</window>
|
||||
</objects>
|
||||
</document>
|
||||
@@ -57,6 +57,8 @@
|
||||
A9BC410818D9ABC000F8C92C /* QueueItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9BC410618D9ABC000F8C92C /* QueueItem.xib */; };
|
||||
A9C055370F6D395B00AF15B5 /* FileImport.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C055360F6D395B00AF15B5 /* FileImport.xib */; };
|
||||
A9C4259318DB6D1F00E99DB8 /* stopTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = A9C4259218DB6D1F00E99DB8 /* stopTemplate.pdf */; };
|
||||
A9C5FA6E19FA22590051F3FF /* SBDebugLogController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C5FA6C19FA22590051F3FF /* SBDebugLogController.m */; };
|
||||
A9C5FA7419FA2FEC0051F3FF /* SBDebugLogWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C5FA7219FA2FEC0051F3FF /* SBDebugLogWindow.xib */; };
|
||||
A9C828F5195950C3004C4718 /* SBQueuePreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = A9C828F4195950C3004C4718 /* SBQueuePreferences.m */; };
|
||||
A9C9E34413FBC1EB00CA3B4E /* EncodeWorking.png in Resources */ = {isa = PBXBuildFile; fileRef = A9C9E34113FBC1EB00CA3B4E /* EncodeWorking.png */; };
|
||||
A9D47B5817B239E200900BCA /* EncodeCanceled.png in Resources */ = {isa = PBXBuildFile; fileRef = A9D47B5417B239E200900BCA /* EncodeCanceled.png */; };
|
||||
@@ -217,6 +219,9 @@
|
||||
A9C0603F168315C500FE3D98 /* libbz2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libbz2.dylib; path = usr/lib/libbz2.dylib; sourceTree = SDKROOT; };
|
||||
A9C0957F0F7B6C8C00170CAF /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = /System/Library/Frameworks/AudioToolbox.framework; sourceTree = "<absolute>"; };
|
||||
A9C4259218DB6D1F00E99DB8 /* stopTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = stopTemplate.pdf; path = images/stopTemplate.pdf; sourceTree = "<group>"; };
|
||||
A9C5FA6B19FA22590051F3FF /* SBDebugLogController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBDebugLogController.h; path = Classes/SBDebugLogController.h; sourceTree = "<group>"; };
|
||||
A9C5FA6C19FA22590051F3FF /* SBDebugLogController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBDebugLogController.m; path = Classes/SBDebugLogController.m; sourceTree = "<group>"; };
|
||||
A9C5FA7319FA2FEC0051F3FF /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/SBDebugLogWindow.xib; sourceTree = "<group>"; };
|
||||
A9C8182C0F74D6E300019BFF /* QuickTime.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuickTime.framework; path = /System/Library/Frameworks/QuickTime.framework; sourceTree = "<absolute>"; };
|
||||
A9C828F3195950C3004C4718 /* SBQueuePreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBQueuePreferences.h; path = Classes/SBQueuePreferences.h; sourceTree = "<group>"; };
|
||||
A9C828F4195950C3004C4718 /* SBQueuePreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SBQueuePreferences.m; path = Classes/SBQueuePreferences.m; sourceTree = "<group>"; };
|
||||
@@ -347,6 +352,8 @@
|
||||
A9AB484817F0AEA2000AA72E /* SBAppDelegate.m */,
|
||||
CD71FF1A12F1C46900F0A98D /* MetadataImporters */,
|
||||
A9FD5D150F3C692400817716 /* PropertyView */,
|
||||
A9C5FA6B19FA22590051F3FF /* SBDebugLogController.h */,
|
||||
A9C5FA6C19FA22590051F3FF /* SBDebugLogController.m */,
|
||||
);
|
||||
name = Classes;
|
||||
sourceTree = "<group>";
|
||||
@@ -433,6 +440,7 @@
|
||||
A9EEA5F618D654B9008B54B4 /* QueueOptions.xib */,
|
||||
A9BC410618D9ABC000F8C92C /* QueueItem.xib */,
|
||||
A90B023910F3290A000416F3 /* Prefs.xib */,
|
||||
A9C5FA7219FA2FEC0051F3FF /* SBDebugLogWindow.xib */,
|
||||
);
|
||||
name = NIBs;
|
||||
sourceTree = "<group>";
|
||||
@@ -638,6 +646,7 @@
|
||||
1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */,
|
||||
A9D47B5917B239E200900BCA /* EncodeCanceled@2x.png in Resources */,
|
||||
A984DB740F52DD4B001A20B2 /* dsa_pub.pem in Resources */,
|
||||
A9C5FA7419FA2FEC0051F3FF /* SBDebugLogWindow.xib in Resources */,
|
||||
A9C055370F6D395B00AF15B5 /* FileImport.xib in Resources */,
|
||||
A95C881D0F827BFB00F51A22 /* ToolbarRemoveTemplate.png in Resources */,
|
||||
A90B023B10F3290A000416F3 /* Prefs.xib in Resources */,
|
||||
@@ -704,6 +713,7 @@
|
||||
A9B46ABF12B79D1C0040517A /* SBDocument.m in Sources */,
|
||||
CD71FEA312F1B5AF00F0A98D /* SBMetadataSearchController.m in Sources */,
|
||||
CD71FF1D12F1C4A900F0A98D /* TheTVDB.m in Sources */,
|
||||
A9C5FA6E19FA22590051F3FF /* SBDebugLogController.m in Sources */,
|
||||
A9D73C5218BF3F1100C6FFA6 /* SBQueue.m in Sources */,
|
||||
A9AB485717F0AEAC000AA72E /* SBSoundViewController.m in Sources */,
|
||||
A9C828F5195950C3004C4718 /* SBQueuePreferences.m in Sources */,
|
||||
@@ -837,6 +847,14 @@
|
||||
name = FileImport.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A9C5FA7219FA2FEC0051F3FF /* SBDebugLogWindow.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
A9C5FA7319FA2FEC0051F3FF /* English */,
|
||||
);
|
||||
name = SBDebugLogWindow.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
A9EEA5F618D654B9008B54B4 /* QueueOptions.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
|
||||
Reference in new issue
Block a user