OSDN Git Service

x264: bump to r1159-3da3f95
[handbrake-jp/handbrake-jp-git.git] / macosx / HBOutputPanelController.m
index 13203d3..0ae508d 100644 (file)
  */
 - (IBAction)showOutputPanel:(id)sender
 {
+    if ([[self window] isVisible])
+    {
+        [[self window] close];
+    }
+    else
+    {
     [textView scrollRangeToVisible:NSMakeRange([outputTextStorage length], 0)];
     [self showWindow:sender];
 
     [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"OutputPanelIsOpen"];
+    }
 }
 
 - (void) startEncodeLog:(NSString *) logPath
     /* We need to get the current time in YY-MM-DD HH-MM-SS format to put at the beginning of the name of the log file */
     time_t _now = time( NULL );
     struct tm * now  = localtime( &_now );
-    NSString *dateForLogTitle = [NSString stringWithFormat:@"%02d-%02d-%02d %02d-%02d-%02d",now->tm_year + 1900, now->tm_mon, now->tm_mday,now->tm_hour, now->tm_min, now->tm_sec]; 
+    NSString *dateForLogTitle = [NSString stringWithFormat:@"%02d-%02d-%02d %02d-%02d-%02d",now->tm_year + 1900, now->tm_mon + 1, now->tm_mday,now->tm_hour, now->tm_min, now->tm_sec]; 
     
     /* Assemble the new log file name as YY-MM-DD HH-MM-SS mymoviename.txt */
     NSString *outputDateFileName = [NSString stringWithFormat:@"%@ %@.txt",dateForLogTitle,[[outputFileForEncode lastPathComponent] stringByDeletingPathExtension]];
     [fileManager createFileAtPath:outputLogFileForEncode contents:nil attributes:nil];
     
     /* Similar to the regular activity log, we print a header containing the date and time of the encode as well as what directory it was encoded to */
-    NSString *startOutputLogString = [NSString stringWithFormat: @"HandBrake Activity Log for %@: %@\n\n",outputFileForEncode, [[NSDate  date] descriptionWithCalendarFormat:nil timeZone:nil locale:nil]];
+    NSString *versionStringFull = [[NSString stringWithFormat: @"Handbrake Version: %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]] stringByAppendingString: [NSString stringWithFormat: @" (%@)\n\n", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]];
+    NSString *startOutputLogString = [NSString stringWithFormat: @"HandBrake Activity Log for %@: %@\n%@",outputFileForEncode, [[NSDate  date] descriptionWithCalendarFormat:nil timeZone:nil locale:nil],versionStringFull];
     [startOutputLogString writeToFile:outputLogFileForEncode atomically:YES encoding:NSUTF8StringEncoding error:NULL];
+
+
 }
 
 - (void) endEncodeLog