MacGui: do not make the output panel textview scroll to the bottom if the window...
authorritsuka <damiog@gmail.com>
Wed, 18 Feb 2015 07:47:23 +0000 (07:47 +0000)
committerritsuka <damiog@gmail.com>
Wed, 18 Feb 2015 07:47:23 +0000 (07:47 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6923 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/HBAppDelegate.m
macosx/HBOutputPanelController.h
macosx/HBOutputPanelController.m

index b87a77b0705437943c6d9b586ec8a1b46edb3b5a..c28164a9e2c7998bee68219e6b1d49ec3b278916 100644 (file)
  */
 - (IBAction)showOutputPanel:(id)sender
 {
-    [self.outputPanel showOutputPanel:sender];
+    [self.outputPanel showWindow:sender];
 }
 
 - (IBAction)showPicturePanel:(id)sender
index 14ab72dee79bcfcb26989a61c871168dc490b1bf..38a9f867c7b4a376fed16501ab6090ccfd734638 100644 (file)
@@ -13,7 +13,6 @@
  */
 @interface HBOutputPanelController : NSWindowController
 
-- (IBAction)showOutputPanel:(id)sender;
 - (IBAction)clearOutput:(id)sender;
 - (IBAction)copyAllOutputToPasteboard:(id)sender;
 - (IBAction)openActivityLogFile:(id)sender;
index 8b6e955d788b41ee6fa50d0fd5974e18df3e4f2c..c275c3970a6b0293b340e65346ed4e693d6a6baf 100644 (file)
 /**
  * Loads output panel from OutputPanel.nib and shows it.
  */
-- (IBAction)showOutputPanel:(id)sender
+- (IBAction)showWindow:(id)sender
 {
     if ([[self window] isVisible])
     {
     }
     else
     {
-    [textView scrollRangeToVisible:NSMakeRange([outputTextStorage length], 0)];
-    [self showWindow:sender];
+        [textView scrollToEndOfDocument:self];
+        [super showWindow:sender];
 
-    [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"OutputPanelIsOpen"];
+        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"OutputPanelIsOpen"];
     }
 }
 
     if (outputTextStorage.length > TextStorageUpperSizeLimit)
                [outputTextStorage deleteCharactersInRange:NSMakeRange(0, [outputTextStorage length] - TextStorageLowerSizeLimit)];
 
-    [textView scrollRangeToVisible:NSMakeRange([outputTextStorage length], 0)];
+    if (self.window.isVisible)
+    {
+        [textView scrollToEndOfDocument:self];
+    }
 
     FILE *f = fopen(_outputLogFile.fileSystemRepresentation, "a");
     fprintf(f, "%s", text.UTF8String);