OSDN Git Service

MacGui: disable interface during scanning, and if there is no valid title found
authordynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Mon, 27 Aug 2007 13:34:50 +0000 (13:34 +0000)
committerdynaflash <dynaflash@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Mon, 27 Aug 2007 13:34:50 +0000 (13:34 +0000)
- Prevents crashing when attmepting to access audio variables when a valid source is not present.

git-svn-id: svn://localhost/HandBrake/trunk@876 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/Controller.mm

index 62ef8e7..5410ba0 100644 (file)
@@ -674,16 +674,8 @@ list = hb_get_titles( fHandle );
                [fScanIndicator setIndeterminate: NO];
                [fScanIndicator setDoubleValue: 0.0];
                [fScanIndicator setHidden: YES];
-               //[fScanController Cancel: NULL];
-               /* Enable/Disable Menu Controls Accordingly */
-               [fMenuOpenSource setEnabled: YES];
-               [fMenuStartEncode setEnabled: YES];
-               [fMenuAddToQueue setEnabled: YES];
-               
-               [fMenuPicturePanelShow setEnabled: YES];
-               [fMenuQueuePanelShow setEnabled: YES];
+
                [self showNewScan: NULL];
-               
        }
        
        
@@ -935,24 +927,24 @@ list = hb_get_titles( fHandle );
        if( !hb_list_count( list ) )
        {
                /* We display a message if a valid dvd source was not chosen */
-               if (sourceDisplayName)
-               {
-               /* Temporary string if til restoring old source is fixed */
-               [fSrcDVD2Field setStringValue: @"Not A Valid Source"];
-               //[fSrcDVD2Field setStringValue: [NSString stringWithFormat: @"%s", sourceDisplayName]];
-               }
-               else
-               {
-           [fSrcDVD2Field setStringValue: @"No Valid Title Found"];
-               }       
+               [fSrcDVD2Field setStringValue: @"No Valid Title Found"];
+        [fMenuOpenSource setEnabled: YES];     
        }
        else
        {
-               /* We increment the successful scancount here by one,
+     /* We increment the successful scancount here by one,
                   which we use at the end of this function to tell the gui
                   if this is the first successful scan since launch and whether
                   or not we should set all settings to the defaults */
                currentSuccessfulScanCount++;
+
+               [self enableUI: YES];
+               /* Enable/Disable Menu Controls Accordingly */
+               [fMenuOpenSource setEnabled: YES];
+               [fMenuStartEncode setEnabled: YES];
+               [fMenuAddToQueue setEnabled: YES];
+               [fMenuPicturePanelShow setEnabled: YES];
+               [fMenuQueuePanelShow setEnabled: YES];
                
                [fSrcTitlePopUp removeAllItems];
                for( int i = 0; i < hb_list_count( list ); i++ )
@@ -1148,6 +1140,7 @@ list = hb_get_titles( fHandle );
        
        [fMenuPicturePanelShow setEnabled: NO];
        [fMenuQueuePanelShow setEnabled: NO];
+    [self enableUI: NO];
        
        [self browseSources:NULL];
 }
@@ -1214,6 +1207,7 @@ list = hb_get_titles( fHandle );
                [fMenuStartEncode setEnabled: YES];
                [fMenuPicturePanelShow setEnabled: YES];
         [fMenuQueuePanelShow setEnabled: YES];
+        [self enableUI: YES];
         }
        }
 }