- 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://localhost/HandBrake/trunk@939
b64f7644-9d1e-0410-96f1-
a4d463321fa5
IBOutlet NSDrawer * fPresetDrawer;
IBOutlet NSTextField * fPresetNewName;
IBOutlet NSDrawer * fPresetDrawer;
IBOutlet NSTextField * fPresetNewName;
- IBOutlet NSTextField * fPresetNewDesc;
+ IBOutlet NSTextField * fPresetNewDesc;
IBOutlet NSPopUpButton * fPresetNewPicSettingsPopUp;
IBOutlet NSTextField * fPresetSelectedDisplay;
IBOutlet NSPopUpButton * fPresetNewPicSettingsPopUp;
IBOutlet NSTextField * fPresetSelectedDisplay;
-
- 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;
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)
if (action == @selector(Pause:))
{
if (s.state == HB_STATE_WORKING)
{
if(![[menuItem title] isEqualToString:@"Start Encoding"])
[menuItem setTitle:@"Start Encoding"];
{
if(![[menuItem title] isEqualToString:@"Start Encoding"])
[menuItem setTitle:@"Start Encoding"];
+ return [fWindow attachedSheet] == nil;
#define SERVICE_NAME @"Encode Done"
- (NSDictionary *)registrationDictionaryForGrowl
{
#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:" )];
- (void) TranslateStrings
{
[fSrcTitleField setStringValue: _( @"Title:" )];
[fPresetSelectedDisplay setStringValue: @"Custom"];
curUserPresetChosenNum = nil;
[fPresetSelectedDisplay setStringValue: @"Custom"];
curUserPresetChosenNum = nil;
- (IBAction) showAddPresetPanel: (id) sender
{
/* Deselect the currently selected Preset if there is one*/
- (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 */
[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
{
}
- (IBAction) closeAddPresetPanel: (id) sender
{
+ [NSApp endSheet: fAddPresetPanel];
+ [fAddPresetPanel orderOut: self];
- (IBAction)addUserPreset:(id)sender
{
- (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];
+ }
<integer>4</integer>
<key>IBOpenObjects</key>
<array>
<integer>4</integer>
<key>IBOpenObjects</key>
<array>
+ <integer>1843</integer>
+ <integer>29</integer>
<integer>1867</integer>
</array>
<key>IBSystem Version</key>
<integer>1867</integer>
</array>
<key>IBSystem Version</key>
- (IBAction) ClosePanel: (id) sender
{
- (IBAction) ClosePanel: (id) sender
{
+ [NSApp endSheet: fPicturePanel];
+ [fPicturePanel orderOut: self];
[NSApp beginSheet: fPicturePanel modalForWindow: fWindow
modalDelegate: NULL didEndSelector: NULL contextInfo: NULL];
[NSApp beginSheet: fPicturePanel modalForWindow: fWindow
modalDelegate: NULL didEndSelector: NULL contextInfo: NULL];
- [NSApp runModalForWindow: fPicturePanel];
- [NSApp endSheet: fPicturePanel];
- [fPicturePanel orderOut: self];