]> granicus.if.org Git - handbrake/commitdiff
MacGui: Write version info the the activity log and activity window
authordynaflash <dynaflashtech@gmail.com>
Mon, 17 Mar 2008 15:09:39 +0000 (15:09 +0000)
committerdynaflash <dynaflashtech@gmail.com>
Mon, 17 Mar 2008 15:09:39 +0000 (15:09 +0000)
- writes the Handbrake version number and build number to the activity window and log text file upon startup (this no longer occured out of libhb once we updated the update system to Sparkle)
- Add writing the version info upon clearing of either the log file or the window, this way we have version info from users even if they have cleared the top of the logs.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@1344 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.mm
macosx/HBOutputPanelController.m

index a5db7117611bee2d7cd6d0a20b81807133aea228..207f1f1bce2c23ba1fadc02284a7e6972312ccf4 100644 (file)
@@ -89,6 +89,10 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
     */
     fPresetsBuiltin = [[HBPresets alloc] init];
     fPreferencesController = [[HBPreferencesController alloc] init];
+    /* Lets report the HandBrake version number here to the activity log and text log file */
+    NSString *versionStringFull = [[NSString stringWithFormat: @"Handbrake Version: %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleGetInfoString"]] stringByAppendingString: [NSString stringWithFormat: @" (%@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]];
+    [self writeToActivityLog: "%s", [versionStringFull UTF8String]];    
+    
     return self;
 }
 
index 4d60a648af224b7a3cd92cc8ab038fd372dab45a..d91379a2ff16b9779c8f579ebc6e8b2cf9a8e781 100644 (file)
             /* if not, then we create a new blank one */
             [fileManager createFileAtPath:outputLogFile contents:nil attributes:nil];
         }
-        
         /* We overwrite the existing output log with the date for starters the output log to start fresh with the new session */
         /* Use the current date and time for the new output log header */
         NSString *startOutputLogString = [NSString stringWithFormat: @"HandBrake Activity Log for Session (Cleared): %@\n\n", [[NSDate  date] descriptionWithCalendarFormat:nil timeZone:nil locale:nil]];
-        [startOutputLogString writeToFile:outputLogFile atomically:YES encoding:NSUTF8StringEncoding error:NULL];
         
+        [startOutputLogString writeToFile:outputLogFile atomically:YES encoding:NSUTF8StringEncoding error:NULL];
         
                [[HBOutputRedirect stderrRedirect] addListener:self];
                [[HBOutputRedirect stdoutRedirect] addListener:self];
 - (IBAction)clearOutput:(id)sender
 {
        [outputTextStorage deleteCharactersInRange:NSMakeRange(0, [outputTextStorage length])];
+    /* We want to rewrite the app version info to the top of the activity window so it is always present */
+    NSString *versionStringFull = [[NSString stringWithFormat: @"Handbrake Version: %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleGetInfoString"]] stringByAppendingString: [NSString stringWithFormat: @" (%@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]];
+    time_t _now = time( NULL );
+    struct tm * now  = localtime( &_now );
+    fprintf(stderr, "[%02d:%02d:%02d] macgui: %s\n", now->tm_hour, now->tm_min, now->tm_sec, [versionStringFull UTF8String]);
+    
 }
 
 /**
        NSPasteboard *pboard = [NSPasteboard generalPasteboard];
        [pboard declareTypes:[NSArray arrayWithObject:NSStringPboardType] owner:nil];
        [pboard setString:[outputTextStorage string] forType:NSStringPboardType];
+    
 }
 
 /**
         /* Use the current date and time for the new output log header */
         NSString *startOutputLogString = [NSString stringWithFormat: @"HandBrake Activity Log for Session Starting: %@\n\n", [[NSDate  date] descriptionWithCalendarFormat:nil timeZone:nil locale:nil]];
         [startOutputLogString writeToFile:outputLogFile atomically:NO encoding:NSUTF8StringEncoding error:NULL];
+        
+        /* We want to rewrite the app version info to the top of the activity window so it is always present */
+        NSString *versionStringFull = [[NSString stringWithFormat: @"macgui: Handbrake Version: %@", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleGetInfoString"]] stringByAppendingString: [NSString stringWithFormat: @" (%@)", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]]];
+        [versionStringFull writeToFile:outputLogFile atomically:NO encoding:NSUTF8StringEncoding error:NULL];
+        
 }
 
 - (void)windowWillClose:(NSNotification *)aNotification