diff options
author | ritsuka <[email protected]> | 2007-09-08 21:58:49 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2007-09-08 21:58:49 +0000 |
commit | 09a6c03875d3e89fd2d86663334842c8d7605028 (patch) | |
tree | aa00975279b6156050dc235449e5e2f098d6e639 /macosx | |
parent | 23a408168d6460600e392987cfec09a458761645 (diff) |
MacGui:
- Better menu item validation
- Sheets no long disable every existing menu item
- Added a check for preset name length when adding a new preset
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@939 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/Controller.h | 2 | ||||
-rw-r--r-- | macosx/Controller.mm | 69 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/info.nib | 3 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/keyedobjects.nib | bin | 67703 -> 67629 bytes | |||
-rw-r--r-- | macosx/PictureController.mm | 6 |
5 files changed, 40 insertions, 40 deletions
diff --git a/macosx/Controller.h b/macosx/Controller.h index f9a11946e..088ce15f7 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -147,7 +147,7 @@ IBOutlet NSDrawer * fPresetDrawer; IBOutlet NSTextField * fPresetNewName; - IBOutlet NSTextField * fPresetNewDesc; + IBOutlet NSTextField * fPresetNewDesc; IBOutlet NSPopUpButton * fPresetNewPicSettingsPopUp; IBOutlet NSTextField * fPresetSelectedDisplay; diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 9e06c49b8..0b7df1e35 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -521,15 +521,18 @@ static int hb_group_count(hb_handle_t * h) if (fHandle) { - - if (action == @selector(addToQueue:) || action == @selector(showPicturePanel:)) - return SuccessfulScan; - + if (action == @selector(addToQueue:) || action == @selector(showPicturePanel:) || action == @selector(showAddPresetPanel:)) + return SuccessfulScan && [fWindow attachedSheet] == nil; + if (action == @selector(showScanPanel:)) { if (s.state == HB_STATE_SCANNING) return NO; + else + return [fWindow attachedSheet] == nil; } + if (action == @selector(selectDefaultPreset:)) + return [tableView selectedRow] >= 0 && [fWindow attachedSheet] == nil; if (action == @selector(Pause:)) { if (s.state == HB_STATE_WORKING) @@ -558,12 +561,11 @@ static int hb_group_count(hb_handle_t * h) { if(![[menuItem title] isEqualToString:@"Start Encoding"]) [menuItem setTitle:@"Start Encoding"]; - return YES; + return [fWindow attachedSheet] == nil; } else return NO; } - return YES; } @@ -574,13 +576,14 @@ static int hb_group_count(hb_handle_t * h) #define SERVICE_NAME @"Encode Done" - (NSDictionary *)registrationDictionaryForGrowl { -NSDictionary *registrationDictionary = [NSDictionary dictionaryWithObjectsAndKeys: -[NSArray arrayWithObjects:SERVICE_NAME,nil], GROWL_NOTIFICATIONS_ALL, -[NSArray arrayWithObjects:SERVICE_NAME,nil], GROWL_NOTIFICATIONS_DEFAULT, -nil]; + NSDictionary *registrationDictionary = [NSDictionary dictionaryWithObjectsAndKeys: + [NSArray arrayWithObjects:SERVICE_NAME,nil], GROWL_NOTIFICATIONS_ALL, + [NSArray arrayWithObjects:SERVICE_NAME,nil], GROWL_NOTIFICATIONS_DEFAULT, + nil]; -return registrationDictionary; + return registrationDictionary; } + - (void) TranslateStrings { [fSrcTitleField setStringValue: _( @"Title:" )]; @@ -2687,8 +2690,6 @@ the user is using "Custom" settings by determining the sender*/ [fPresetSelectedDisplay setStringValue: @"Custom"]; curUserPresetChosenNum = nil; - - } } @@ -2751,40 +2752,40 @@ the user is using "Custom" settings by determining the sender*/ - (IBAction) showAddPresetPanel: (id) sender { /* Deselect the currently selected Preset if there is one*/ - [tableView deselectRow:[tableView selectedRow]]; + [tableView deselectRow:[tableView selectedRow]]; - /* Populate the preset picture settings popup here */ - [fPresetNewPicSettingsPopUp removeAllItems]; - [fPresetNewPicSettingsPopUp addItemWithTitle:@"None"]; - [fPresetNewPicSettingsPopUp addItemWithTitle:@"Current"]; - [fPresetNewPicSettingsPopUp addItemWithTitle:@"Source Maximum (post source scan)"]; - [fPresetNewPicSettingsPopUp selectItemAtIndex: 0]; + /* Populate the preset picture settings popup here */ + [fPresetNewPicSettingsPopUp removeAllItems]; + [fPresetNewPicSettingsPopUp addItemWithTitle:@"None"]; + [fPresetNewPicSettingsPopUp addItemWithTitle:@"Current"]; + [fPresetNewPicSettingsPopUp addItemWithTitle:@"Source Maximum (post source scan)"]; + [fPresetNewPicSettingsPopUp selectItemAtIndex: 0]; - /* Erase info from the input fields fPresetNewDesc*/ + /* Erase info from the input fields fPresetNewDesc*/ [fPresetNewName setStringValue: @""]; [fPresetNewDesc setStringValue: @""]; /* Show the panel */ - [NSApp beginSheet: fAddPresetPanel modalForWindow: fWindow - modalDelegate: NULL didEndSelector: NULL contextInfo: NULL]; - [NSApp runModalForWindow: fAddPresetPanel]; - [NSApp endSheet: fAddPresetPanel]; - [fAddPresetPanel orderOut: self]; + [NSApp beginSheet: fAddPresetPanel modalForWindow: fWindow modalDelegate: NULL didEndSelector: NULL contextInfo: NULL]; } - (IBAction) closeAddPresetPanel: (id) sender { - [NSApp stopModal]; + [NSApp endSheet: fAddPresetPanel]; + [fAddPresetPanel orderOut: self]; } - - (IBAction)addUserPreset:(id)sender { - /* Here we create a custom user preset */ - [UserPresets addObject:[self createPreset]]; - - /* We stop the modal window for the new preset */ - [NSApp stopModal]; - [self addPreset]; + if (![[fPresetNewName stringValue] length]) + NSRunAlertPanel(@"Warning!", @"You need to insert a name for the preset.", @"OK", nil , nil); + else + { + /* Here we create a custom user preset */ + [UserPresets addObject:[self createPreset]]; + [self addPreset]; + + [self closeAddPresetPanel:NULL]; + } } - (void)addPreset { diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib index 05de1f8a2..f7c6e6b37 100644 --- a/macosx/English.lproj/MainMenu.nib/info.nib +++ b/macosx/English.lproj/MainMenu.nib/info.nib @@ -27,8 +27,9 @@ <integer>4</integer> <key>IBOpenObjects</key> <array> - <integer>29</integer> <integer>21</integer> + <integer>1843</integer> + <integer>29</integer> <integer>1867</integer> </array> <key>IBSystem Version</key> diff --git a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib Binary files differindex 86a3c3ba5..337f96f8f 100644 --- a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib +++ b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib diff --git a/macosx/PictureController.mm b/macosx/PictureController.mm index a8ae974f8..c274c196c 100644 --- a/macosx/PictureController.mm +++ b/macosx/PictureController.mm @@ -346,7 +346,8 @@ static int GetAlignedSize( int size ) - (IBAction) ClosePanel: (id) sender { - [NSApp stopModal]; + [NSApp endSheet: fPicturePanel]; + [fPicturePanel orderOut: self]; } - (BOOL) autoCrop @@ -399,9 +400,6 @@ static int GetAlignedSize( int size ) [NSApp beginSheet: fPicturePanel modalForWindow: fWindow modalDelegate: NULL didEndSelector: NULL contextInfo: NULL]; - [NSApp runModalForWindow: fPicturePanel]; - [NSApp endSheet: fPicturePanel]; - [fPicturePanel orderOut: self]; } - (BOOL) loadMyNibFile |