]> granicus.if.org Git - handbrake/commitdiff
MacGui: miscellaneous cosmetics and consistency adjustments.
authorRodeo <tdskywalker@gmail.com>
Sat, 22 Sep 2012 14:54:28 +0000 (14:54 +0000)
committerRodeo <tdskywalker@gmail.com>
Sat, 22 Sep 2012 14:54:28 +0000 (14:54 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4974 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.h
macosx/Controller.m

index ddc52880ffd9910fb579f5d06ed10289f1916cca..5c8ddf34a0dd253914d3dc29d99ce5d54fa835ae 100644 (file)
@@ -258,12 +258,12 @@ BOOL                        fIsDragging;
     NSString                      * browsedSourceDisplayName;
     
     /* Dock progress variables */
-    double                         dockIconProgress;
+    double                          dockIconProgress;
     
-    BOOL                         fWillScan;
-    NSDockTile                    *dockTile;
-    DockTextField                 *percentField;
-    DockTextField                 *timeField;
+    BOOL                            fWillScan;
+    NSDockTile                    * dockTile;
+    DockTextField                 * percentField;
+    DockTextField                 * timeField;
 }
 - (int) getPidnum;
 - (IBAction) showAboutPanel:(id)sender;
index 6b500ab19027a9531f27a69dca45624af9a7e006..f2ef002b6f89c2ca8680e87f9d7f9089161dc233 100644 (file)
 #import "DockTextField.h"
 
 unsigned int maximumNumberOfAllowedAudioTracks = 24;
-NSString *HBContainerChangedNotification = @"HBContainerChangedNotification";
-NSString *keyContainerTag = @"keyContainerTag";
-NSString *HBTitleChangedNotification = @"HBTitleChangedNotification";
-NSString *keyTitleTag = @"keyTitleTag";
+NSString *HBContainerChangedNotification       = @"HBContainerChangedNotification";
+NSString *keyContainerTag                      = @"keyContainerTag";
+NSString *HBTitleChangedNotification           = @"HBTitleChangedNotification";
+NSString *keyTitleTag                          = @"keyTitleTag";
 
-NSString *dragDropFiles= @"dragDropFiles";
+NSString *dragDropFiles                        = @"dragDropFiles";
 
-#define DragDropSimplePboardType       @"MyCustomOutlineViewPboardType"
+#define DragDropSimplePboardType                 @"MyCustomOutlineViewPboardType"
 
-NSString *dockTilePercentFormat   = @"%2.1f%%";
+NSString *dockTilePercentFormat                = @"%2.1f%%";
 // DockTile update freqency in total percent increment
-#define dockTileUpdateFrequency     0.1f
+#define dockTileUpdateFrequency                  0.1f
 
 /* We setup the toolbar values here ShowPreviewIdentifier */
 static NSString *        ToggleDrawerIdentifier             = @"Toggle Drawer Item Identifier";
@@ -33,8 +33,8 @@ static NSString *        StartEncodingIdentifier            = @"Start Encoding I
 static NSString *        PauseEncodingIdentifier            = @"Pause Encoding Item Identifier";
 static NSString *        ShowQueueIdentifier                = @"Show Queue Item Identifier";
 static NSString *        AddToQueueIdentifier               = @"Add to Queue Item Identifier";
-static NSString *        ShowPictureIdentifier             = @"Show Picture Window Item Identifier";
-static NSString *        ShowPreviewIdentifier             = @"Show Preview Window Item Identifier";
+static NSString *        ShowPictureIdentifier              = @"Show Picture Window Item Identifier";
+static NSString *        ShowPreviewIdentifier              = @"Show Preview Window Item Identifier";
 static NSString *        ShowActivityIdentifier             = @"Debug Output Item Identifier";
 static NSString *        ChooseSourceIdentifier             = @"Choose Source Item Identifier";
 
@@ -141,7 +141,8 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
     
     // For now, we just want to accept one file at a time
     // If for any reason, more than one file is submitted, we will take the first one
-    if (filesList.count > 1) {
+    if (filesList.count > 1)
+    {
         filesList = [NSMutableArray arrayWithObject:[filesList objectAtIndex:0]];
     }
     
@@ -163,14 +164,18 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
         if (filesList.count > 0)
         {
             [[NSUserDefaults standardUserDefaults] setObject:filesList forKey:dragDropFiles];
-        } else {
+        }
+        else
+        {
             [[NSUserDefaults standardUserDefaults] removeObjectForKey:dragDropFiles];
         }
         
         [browsedSourceDisplayName release];
         browsedSourceDisplayName = [[firstItem lastPathComponent] retain];
         [self performScan:firstItem scanTitleNum:0];
-    } else {
+    }
+    else
+    {
         // Handbrake was not running before the user dropped the file(s)
         // So we save the file(s) list in the UserDefaults and we will read them
         // in the applicationDidFinishLaunching method
@@ -353,7 +358,9 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
                 {
                     NSArray *dragDropFiles = (NSArray *)dragDropFilesId;
                     [self openFiles:dragDropFiles];
-                } else {
+                }
+                else
+                {
                     /* Since we addressed any pending or previously encoding items above, we go ahead and make sure
                      * the queue is empty of any finished items or cancelled items */
                     [self clearQueueAllItems];
@@ -446,12 +453,13 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
 
 // This method is used by OSX to know what kind of files can be drag & drop on the NSWindow
 // We only want filenames (and so folders too)
-- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender {
+- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
+{
     NSPasteboard *pboard = [sender draggingPasteboard];
     
-    if ([[pboard types] containsObject:NSFilenamesPboardType]) {
+    if ([[pboard types] containsObject:NSFilenamesPboardType])
+    {
         NSArray *paths = [pboard propertyListForType:NSFilenamesPboardType];
-        
         return paths.count == 1 ? NSDragOperationGeneric : NSDragOperationNone;
     }
     
@@ -459,15 +467,18 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
 }
 
 // This method is doing the job after the drag & drop operation has been validated by [self draggingEntered] and OSX
-- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender {
+- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
+{
     NSPasteboard *pboard;
     
     pboard = [sender draggingPasteboard];
     
-    if ( [[pboard types] containsObject:NSFilenamesPboardType] ) {
+    if ([[pboard types] containsObject:NSFilenamesPboardType])
+    {
         NSArray *paths = [pboard propertyListForType:NSFilenamesPboardType];
         
-        if (paths.count > 0) {
+        if (paths.count > 0)
+        {
             // For now, we just want to accept one file at a time
             // If for any reason, more than one file is submitted, we will take the first one
             NSArray *reducedPaths = [NSArray arrayWithObject:[paths objectAtIndex:0]];
@@ -798,7 +809,9 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
     {
         [percentField setHidden:YES];
         [timeField setHidden:YES];
-    } else {
+    }
+    else
+    {
         [percentField setTextToDisplay:[NSString stringWithFormat:dockTilePercentFormat,progress * 100]];
         [percentField setHidden:NO];
         [timeField setTextToDisplay:etaStr];
@@ -1208,11 +1221,15 @@ static NSString *        ChooseSourceIdentifier             = @"Choose Source It
                 {
                     // Updating the list in the user defaults
                     [[NSUserDefaults standardUserDefaults] setObject:filesList forKey:dragDropFiles];
-                } else {
+                }
+                else
+                {
                     // Cleaning if last one was treated
                     [[NSUserDefaults standardUserDefaults] removeObjectForKey:dragDropFiles];
                 }
-            } else {
+            }
+            else
+            {
                 [[NSUserDefaults standardUserDefaults] removeObjectForKey:dragDropFiles];
             }
         }
@@ -5410,7 +5427,8 @@ the user is using "Custom" settings by determining the sender*/
 }
 
 
-- (IBAction) toggleDrawer:(id)sender {
+- (IBAction) toggleDrawer:(id)sender
+{
     [fPresetDrawer toggle:self];
 }