diff options
author | dynaflash <[email protected]> | 2007-08-02 05:11:48 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2007-08-02 05:11:48 +0000 |
commit | 891ea7118f8ca6d60e3920cbed100ae2a7f8bad1 (patch) | |
tree | 849b13abc67b6b09a3fbcd7c101144cf689454e7 | |
parent | 8cb0b130a99d34794a9223553478ca23830f9f2c (diff) |
MacGui: Use Ritsuka's gear icon at the bottom of the preset drawer.
- Thanks Ritsuka!
- Replaces fugly "Make Default" and "Update" buttons
- Contains a contextual menu which currently contains "Make Default" and "Update Built-In Presets"
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@779 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r-- | macosx/Controller.h | 5 | ||||
-rw-r--r-- | macosx/Controller.mm | 111 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/classes.nib | 4 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/info.nib | 13 | ||||
-rw-r--r-- | macosx/English.lproj/MainMenu.nib/keyedobjects.nib | bin | 128058 -> 128477 bytes | |||
-rw-r--r-- | macosx/HandBrake.xcodeproj/project.pbxproj | 16 |
6 files changed, 83 insertions, 66 deletions
diff --git a/macosx/Controller.h b/macosx/Controller.h index fc5260f02..19664c1b4 100644 --- a/macosx/Controller.h +++ b/macosx/Controller.h @@ -14,7 +14,7 @@ #include "ScanController.h" #include "PictureController.h" #include "QueueController.h" - +#import "MVMenuButton.h" @class HBOutputPanelController; @interface HBController : NSObject <GrowlApplicationBridgeDelegate> @@ -211,7 +211,8 @@ IBOutlet NSTableView * tableView; IBOutlet NSButton * fPresetsAdd; IBOutlet NSButton * fPresetsDelete; - IBOutlet NSButton * fPresetMakeDefault; + IBOutlet MVMenuButton * fPresetsActionButton; + IBOutlet NSMenu * fPresetsActionMenu; hb_handle_t * fHandle; hb_title_t * fTitle; diff --git a/macosx/Controller.mm b/macosx/Controller.mm index 2af28a8fa..dfc944f50 100644 --- a/macosx/Controller.mm +++ b/macosx/Controller.mm @@ -129,12 +129,12 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie - (void) awakeFromNib { [fWindow center]; - + [self TranslateStrings]; /* Initialize currentScanCount so HB can use it to - evaluate successive scans */ + evaluate successive scans */ currentScanCount = 0; - + /* Init User Presets .plist */ /* We declare the default NSFileManager into fileManager */ NSFileManager * fileManager = [NSFileManager defaultManager]; @@ -158,12 +158,12 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie if ([fileManager fileExistsAtPath:UserPresetsFile] == 0) { - + [fileManager createFileAtPath:UserPresetsFile contents:nil attributes:nil]; } // We check for the x264profiles.plist here - + if ([fileManager fileExistsAtPath:x264ProfilesFile] == 0) { @@ -171,27 +171,27 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie } - UserPresetsFile = @"~/Library/Application Support/HandBrake/UserPresets.plist"; - UserPresetsFile = [[UserPresetsFile stringByExpandingTildeInPath]retain]; - - UserPresets = [[NSMutableArray alloc] initWithContentsOfFile:UserPresetsFile]; - if (nil == UserPresets) - { - UserPresets = [[NSMutableArray alloc] init]; - [self AddFactoryPresets:NULL]; - } - - - - /* Show/Dont Show Presets drawer upon launch based - on user preference DefaultPresetsDrawerShow*/ - if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow"] > 0) - { - [fPresetDrawer open]; - } - - - + UserPresetsFile = @"~/Library/Application Support/HandBrake/UserPresets.plist"; + UserPresetsFile = [[UserPresetsFile stringByExpandingTildeInPath]retain]; + + UserPresets = [[NSMutableArray alloc] initWithContentsOfFile:UserPresetsFile]; + if (nil == UserPresets) + { + UserPresets = [[NSMutableArray alloc] init]; + [self AddFactoryPresets:NULL]; + } + + + + /* Show/Dont Show Presets drawer upon launch based + on user preference DefaultPresetsDrawerShow*/ + if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DefaultPresetsDrawerShow"] > 0) + { + [fPresetDrawer open]; + } + + + /* Destination box*/ [fDstFormatPopUp removeAllItems]; [fDstFormatPopUp addItemWithTitle: _( @"MP4 file" )]; @@ -199,7 +199,7 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie [fDstFormatPopUp addItemWithTitle: _( @"OGM file" )]; [fDstFormatPopUp addItemWithTitle: _( @"MKV file" )]; [fDstFormatPopUp selectItemAtIndex: 0]; - + [self FormatPopUpChanged: NULL]; /* We enable the create chapters checkbox here since we are .mp4 */ @@ -209,26 +209,26 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie [fCreateChapterMarkers setState: NSOnState]; } - + [fDstFile2Field setStringValue: [NSString stringWithFormat: @"%@/Desktop/Movie.mp4", NSHomeDirectory()]]; - + /* Video encoder */ [fVidEncoderPopUp removeAllItems]; [fVidEncoderPopUp addItemWithTitle: @"FFmpeg"]; [fVidEncoderPopUp addItemWithTitle: @"XviD"]; - + /* Video quality */ [fVidTargetSizeField setIntValue: 700]; [fVidBitrateField setIntValue: 1000]; - + [fVidQualityMatrix selectCell: fVidBitrateCell]; [self VideoMatrixChanged: NULL]; - + /* Video framerate */ [fVidRatePopUp removeAllItems]; [fVidRatePopUp addItemWithTitle: _( @"Same as source" )]; @@ -253,7 +253,7 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie [NSString stringWithCString: hb_audio_bitrates[i].string]]; } [fAudBitratePopUp selectItemAtIndex: hb_audio_bitrates_default]; - + /* Audio samplerate */ [fAudRatePopUp removeAllItems]; for( int i = 0; i < hb_audio_rates_count; i++ ) @@ -262,36 +262,31 @@ static NSString* ChooseSourceIdentifier = @"Choose Source Item Identifie [NSString stringWithCString: hb_audio_rates[i].string]]; } [fAudRatePopUp selectItemAtIndex: hb_audio_rates_default]; - + /* Bottom */ [fStatusField setStringValue: @""]; - - [self EnableUI: NO]; - //[fPauseButton setEnabled: NO]; - //[fRipButton setEnabled: NO]; - /* Use new Toolbar start and pause here */ - pauseButtonEnabled = NO; + [self EnableUI: NO]; + /* Use new Toolbar start and pause here */ startButtonEnabled = NO; - [self setupToolbar]; - /* In Ritsuka's patch, this goes below the Turbo stuff below - Lets try to keep it all together */ - startButtonEnabled = NO; - stopOrStart = NO; - AddToQueueButtonEnabled = NO; - pauseButtonEnabled = NO; - resumeOrPause = NO; - + stopOrStart = NO; + AddToQueueButtonEnabled = NO; + pauseButtonEnabled = NO; + resumeOrPause = NO; + [self setupToolbar]; + + [fPresetsActionButton setMenu:fPresetsActionMenu]; + /* We disable the Turbo 1st pass checkbox since we are not x264 */ [fVidTurboPassCheck setEnabled: NO]; [fVidTurboPassCheck setState: NSOffState]; - - - /* lets get our default prefs here */ - [self GetDefaultPresets: NULL]; - /* lets initialize the current successful scancount here to 0 */ - currentSuccessfulScanCount = 0; - + + + /* lets get our default prefs here */ + [self GetDefaultPresets: NULL]; + /* lets initialize the current successful scancount here to 0 */ + currentSuccessfulScanCount = 0; + } @@ -2482,7 +2477,7 @@ the user is using "Custom" settings by determining the sender*/ { /* Deselect the currently selected Preset if there is one*/ [tableView deselectRow:[tableView selectedRow]]; - [fPresetMakeDefault setEnabled: NO]; + [[fPresetsActionMenu itemAtIndex:0] setEnabled: NO]; /* Change UI to show "Custom" settings are being used */ [fPresetSelectedDisplay setStringValue: @"Custom"]; @@ -4768,7 +4763,7 @@ the user is using "Custom" settings by determining the sender*/ } - [fPresetMakeDefault setEnabled: YES]; + [[fPresetsActionMenu itemAtIndex:0] setEnabled: YES]; } } } diff --git a/macosx/English.lproj/MainMenu.nib/classes.nib b/macosx/English.lproj/MainMenu.nib/classes.nib index 5a850c960..56978b1c7 100644 --- a/macosx/English.lproj/MainMenu.nib/classes.nib +++ b/macosx/English.lproj/MainMenu.nib/classes.nib @@ -106,11 +106,12 @@ fPictureController = PictureController; fPicturePanel = NSPanel; fPresetDrawer = NSDrawer; - fPresetMakeDefault = NSButton; fPresetNewDesc = NSTextField; fPresetNewName = NSTextField; fPresetNewPicSettingsPopUp = NSPopUpButton; fPresetSelectedDisplay = NSTextField; + fPresetsActionButton = MVMenuButton; + fPresetsActionMenu = NSMenu; fPresetsAdd = NSButton; fPresetsDelete = NSButton; fQueueController = QueueController; @@ -205,6 +206,7 @@ }; SUPERCLASS = NSTextField; }, + {CLASS = MVMenuButton; LANGUAGE = ObjC; SUPERCLASS = NSButton; }, { ACTIONS = { ClosePanel = id; diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib index d56e7e5b9..7eed1978e 100644 --- a/macosx/English.lproj/MainMenu.nib/info.nib +++ b/macosx/English.lproj/MainMenu.nib/info.nib @@ -3,13 +3,15 @@ <plist version="1.0"> <dict> <key>IBDocumentLocation</key> - <string>45 274 630 601 0 0 1440 878 </string> + <string>87 46 558 375 0 0 1440 878 </string> <key>IBEditorPositions</key> <dict> <key>1843</key> - <string>620 338 200 530 0 0 1440 878 </string> + <string>640 320 200 530 0 0 1440 878 </string> + <key>2436</key> + <string>307 360 192 68 0 0 1440 878 </string> <key>29</key> - <string>155 478 365 44 0 0 1440 878 </string> + <string>155 478 368 44 0 0 1440 878 </string> </dict> <key>IBFramework Version</key> <string>446.1</string> @@ -26,8 +28,9 @@ <key>IBOpenObjects</key> <array> <integer>29</integer> - <integer>365</integer> - <integer>21</integer> + <integer>1843</integer> + <integer>2436</integer> + <integer>1867</integer> </array> <key>IBSystem Version</key> <string>8R2218</string> diff --git a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib Binary files differindex a031a0eb3..378c5f81e 100644 --- a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib +++ b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj index c000e20d4..d9276afd3 100644 --- a/macosx/HandBrake.xcodeproj/project.pbxproj +++ b/macosx/HandBrake.xcodeproj/project.pbxproj @@ -124,6 +124,10 @@ A28468680C5A43D900EF9A98 /* Disc.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A28468670C5A43D900EF9A98 /* Disc.tiff */; }; A29E05800BE1283E000533F5 /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A29E057F0BE1283E000533F5 /* Growl.framework */; }; A29E058B0BE12889000533F5 /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A29E057F0BE1283E000533F5 /* Growl.framework */; }; + A2DFC66E0C6196D900E66E89 /* actionWidget.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DFC66C0C6196D900E66E89 /* actionWidget.png */; }; + A2DFC66F0C6196D900E66E89 /* actionWidgetPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = A2DFC66D0C6196D900E66E89 /* actionWidgetPressed.png */; }; + A2DFC6750C6197C600E66E89 /* MVMenuButton.h in Headers */ = {isa = PBXBuildFile; fileRef = A2DFC6740C6197C600E66E89 /* MVMenuButton.h */; }; + A2DFC6770C61980700E66E89 /* MVMenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A2DFC6760C61980700E66E89 /* MVMenuButton.m */; }; EAA526930C3B25D200944FF2 /* stream.c in Sources */ = {isa = PBXBuildFile; fileRef = EAA526920C3B25D200944FF2 /* stream.c */; }; EAA526940C3B25D200944FF2 /* stream.c in Sources */ = {isa = PBXBuildFile; fileRef = EAA526920C3B25D200944FF2 /* stream.c */; }; FC8519500C59A02C0073812C /* denoise.c in Sources */ = {isa = PBXBuildFile; fileRef = FC85194C0C59A02C0073812C /* denoise.c */; }; @@ -260,6 +264,10 @@ A273E0950C57C19500493A45 /* muxmkv.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = muxmkv.c; path = ../libhb/muxmkv.c; sourceTree = SOURCE_ROOT; }; A28468670C5A43D900EF9A98 /* Disc.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = Disc.tiff; sourceTree = "<group>"; }; A29E057F0BE1283E000533F5 /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Growl.framework; sourceTree = "<group>"; }; + A2DFC66C0C6196D900E66E89 /* actionWidget.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = actionWidget.png; sourceTree = "<group>"; }; + A2DFC66D0C6196D900E66E89 /* actionWidgetPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = actionWidgetPressed.png; sourceTree = "<group>"; }; + A2DFC6740C6197C600E66E89 /* MVMenuButton.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MVMenuButton.h; sourceTree = "<group>"; }; + A2DFC6760C61980700E66E89 /* MVMenuButton.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = MVMenuButton.m; sourceTree = "<group>"; }; EAA526920C3B25D200944FF2 /* stream.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = stream.c; path = ../libhb/stream.c; sourceTree = SOURCE_ROOT; }; FC85194C0C59A02C0073812C /* denoise.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = denoise.c; path = ../libhb/denoise.c; sourceTree = SOURCE_ROOT; }; FC85194D0C59A02C0073812C /* deinterlace.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = deinterlace.c; path = ../libhb/deinterlace.c; sourceTree = SOURCE_ROOT; }; @@ -433,6 +441,8 @@ 526FBC930B4CAA260064E04C /* HandBrake Sources */ = { isa = PBXGroup; children = ( + A2DFC6760C61980700E66E89 /* MVMenuButton.m */, + A2DFC6740C6197C600E66E89 /* MVMenuButton.h */, 0DFA5D060B8DD9040020BC09 /* HandBrake.plist */, 4D1FD381073D19CE00E46515 /* PictureController.h */, 4D1FD382073D19CE00E46515 /* PictureController.mm */, @@ -473,6 +483,8 @@ A273E0460C57B39A00493A45 /* icons */ = { isa = PBXGroup; children = ( + A2DFC66C0C6196D900E66E89 /* actionWidget.png */, + A2DFC66D0C6196D900E66E89 /* actionWidgetPressed.png */, A28468670C5A43D900EF9A98 /* Disc.tiff */, A273E0470C57B39A00493A45 /* Add.tiff */, A273E0480C57B39A00493A45 /* Brushed Window.tiff */, @@ -507,6 +519,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + A2DFC6750C6197C600E66E89 /* MVMenuButton.h in Headers */, 4DD93F8F082036E8008E1322 /* Controller.h in Headers */, 4DD93F90082036E8008E1322 /* PictureGLView.h in Headers */, 4DD93F91082036E8008E1322 /* ScanController.h in Headers */, @@ -660,6 +673,8 @@ A273E0530C57B39A00493A45 /* Stop.tiff in Resources */, A273E0540C57B39A00493A45 /* Terminal.tiff in Resources */, A28468680C5A43D900EF9A98 /* Disc.tiff in Resources */, + A2DFC66E0C6196D900E66E89 /* actionWidget.png in Resources */, + A2DFC66F0C6196D900E66E89 /* actionWidgetPressed.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -787,6 +802,7 @@ 253886020BFE0A5B0064E995 /* HBOutputRedirect.m in Sources */, 253886180BFE0C160064E995 /* HBOutputPanelController.m in Sources */, 25DE1FB70C169A0C00F01FC8 /* HBPreferencesController.m in Sources */, + A2DFC6770C61980700E66E89 /* MVMenuButton.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; |