Commit 5162493b authored by David's avatar David

macosx: open panel: Integrate capture views into main window

Add a tab view for capture and screen panels and move them there.
This is important to have their width calculation already respected
at showing the open panel. Also cleans up code a bit.
parent 7978f6d6
This diff is collapsed.
......@@ -153,10 +153,9 @@
/* generic capturing stuff */
@property (readwrite, weak) IBOutlet NSPopUpButton *captureModePopup;
@property (readwrite, weak) IBOutlet NSTabView *captureTabView;
/* screen support */
@property (readwrite, weak) IBOutlet NSView *screenView;
@property (readwrite, weak) IBOutlet NSTextField *screenlongLabel;
@property (readwrite, weak) IBOutlet NSTextField *screenFPSTextField;
@property (readwrite, weak) IBOutlet NSTextField *screenFPSLabel;
@property (readwrite, weak) IBOutlet NSStepper *screenFPSStepper;
......@@ -179,7 +178,6 @@
@property (readwrite, weak) IBOutlet NSButton *screenqtkAudioCheckbox;
/* QTK support */
@property (readwrite, weak) IBOutlet NSView *qtkView;
@property (readwrite, weak) IBOutlet NSPopUpButton *qtkVideoDevicePopup;
@property (readwrite, weak) IBOutlet NSButton *qtkVideoCheckbox;
@property (readwrite, weak) IBOutlet NSPopUpButton *qtkAudioDevicePopup;
......@@ -84,7 +84,6 @@ struct display_info_t
NSArray *_opticalDevices;
NSMutableArray *_specialMediaFolders;
NSString *_filePath;
NSView *_currentCaptureView;
NSString *_fileSlavePath;
NSString *_subPath;
NSString *_MRL;
......@@ -206,7 +205,6 @@ static NSString *kCaptureTabViewId = @"capture";
[_captureModePopup removeAllItems];
[_captureModePopup addItemWithTitle: _NS("Input Devices")];
[_captureModePopup addItemWithTitle: _NS("Screen")];
[_screenlongLabel setStringValue: _NS("This input allows you to save, stream or display your current screen contents.")];
[_screenFPSLabel setStringValue: [NSString stringWithFormat:@"%@:",_NS("Frames per Second")]];
[_screenLabel setStringValue: [NSString stringWithFormat:@"%@:",_NS("Screen")]];
[_screenLeftLabel setStringValue: [NSString stringWithFormat:@"%@:",_NS("Subscreen left")]];
......@@ -754,6 +752,7 @@ static NSString *kCaptureTabViewId = @"capture";
NSRect viewRect = [theView frame];
[theView setFrame: NSMakeRect(233, 0, viewRect.size.width, viewRect.size.height)];
[theView setAutoresizesSubviews: YES];
NSView *opticalTabView = [[_tabView tabViewItemAtIndex: [_tabView indexOfTabViewItemWithIdentifier:kDiscTabViewId]] view];
if (_currentOpticalMediaView) {
[[opticalTabView animator] replaceSubview: _currentOpticalMediaView with: theView];
......@@ -1133,25 +1132,13 @@ static NSString *kCaptureTabViewId = @"capture";
#pragma mark -
#pragma mark Capture Panel
- (void)showCaptureView: theView
NSRect viewRect = [theView frame];
[theView setFrame: NSMakeRect(0, -10, viewRect.size.width, viewRect.size.height)];
[theView setAutoresizesSubviews: YES];
if (_currentCaptureView) {
[[[[_tabView tabViewItemAtIndex: 3] view] animator] replaceSubview: _currentCaptureView with: theView];
} else {
[[[[_tabView tabViewItemAtIndex: 3] view] animator] addSubview: theView];
_currentCaptureView = theView;
- (IBAction)openCaptureModeChanged:(id)sender
intf_thread_t * p_intf = getIntf();
if ([[[_captureModePopup selectedItem] title] isEqualToString: _NS("Screen")]) {
[self showCaptureView: _screenView];
[_captureTabView selectTabViewItemAtIndex:1];
[self setMRL: @"screen://"];
[_screenHeightTextField setIntValue: config_GetInt(p_intf, "screen-height")];
[_screenWidthTextField setIntValue: config_GetInt(p_intf, "screen-width")];
......@@ -1200,7 +1187,8 @@ static NSString *kCaptureTabViewId = @"capture";
else if ([[[_captureModePopup selectedItem] title] isEqualToString: _NS("Input Devices")]) {
[self showCaptureView: _qtkView];
[_captureTabView selectTabViewItemAtIndex:0];
[self qtkChanged:nil];
[self qtkAudioChanged:nil];
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment