summaryrefslogtreecommitdiffstats
path: root/macosx/HBQueueController.mm
diff options
context:
space:
mode:
authorritsuka <[email protected]>2015-01-22 10:30:26 +0000
committerritsuka <[email protected]>2015-01-22 10:30:26 +0000
commitdfa1f8dd4bbaed3fba144a5afead99a1ea102c44 (patch)
tree9a487f570a21d91cd6d8beeb7ada67e5b99002e8 /macosx/HBQueueController.mm
parent1784a808ebe642b54bff0d06abc147226d0287fe (diff)
MacGui: move the application delegate to its own class. Removed the "Open Source (Title Specific)" menu item, now integrated in the standard open panel.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6784 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBQueueController.mm')
-rw-r--r--macosx/HBQueueController.mm44
1 files changed, 42 insertions, 2 deletions
diff --git a/macosx/HBQueueController.mm b/macosx/HBQueueController.mm
index b835599a9..1a8712653 100644
--- a/macosx/HBQueueController.mm
+++ b/macosx/HBQueueController.mm
@@ -9,6 +9,7 @@
#import "HBCore.h"
#import "Controller.h"
+#import "HBAppDelegate.h"
#import "HBOutputPanelController.h"
#import "HBQueueOutlineView.h"
@@ -136,6 +137,45 @@
#pragma mark Toolbar
+- (BOOL)validateMenuItem:(NSMenuItem *)menuItem
+{
+ SEL action = menuItem.action;
+
+ if (action == @selector(rip:))
+ {
+ if (self.core.state == HBStateIdle)
+ {
+ menuItem.title = NSLocalizedString(@"Start Encoding", nil);
+ menuItem.keyEquivalent = @"s";
+
+ return (self.pendingItemsCount > 0);
+ }
+ else if (self.core.state != HBStateIdle)
+ {
+ menuItem.title = NSLocalizedString(@"Stop Encoding", nil);
+ menuItem.keyEquivalent = @".";
+
+ return YES;
+ }
+ }
+
+ if (action == @selector(pause:))
+ {
+ if (self.core.state != HBStatePaused)
+ {
+ menuItem.title = NSLocalizedString(@"Pause Encoding", nil);
+ }
+ else
+ {
+ menuItem.title = NSLocalizedString(@"Resume Encoding", nil);
+ }
+
+ return (self.core.state == HBStateWorking || self.core.state == HBStatePaused);
+ }
+
+ return YES;
+}
+
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem
{
SEL action = theItem.action;
@@ -898,7 +938,7 @@
NSInteger response = [alert runModal];
if (response == NSAlertSecondButtonReturn)
{
- [self.controller showPreferencesWindow:nil];
+ [self.delegate showPreferencesWindow:nil];
}
[alert release];
}
@@ -917,7 +957,7 @@
NSInteger response = [alert runModal];
if (response == NSAlertSecondButtonReturn)
{
- [self.controller showPreferencesWindow:nil];
+ [self.delegate showPreferencesWindow:nil];
}
[alert release];
}