Commit e0c7e33d authored by Alexandre Lision's avatar Alexandre Lision

video settings: prevent stopping preview

Prevent the video setting panel to start/stop the preview if it's already
running. If their is an ongoing call we do not stop the preview when leaving
video settings panel.

Issue: #78359
Change-Id: I4bcf0cee460880e6491b57535348ef3ef46b474b
parent 0327c0e0
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
@property (assign) IBOutlet NSPopUpButton *sizesList; @property (assign) IBOutlet NSPopUpButton *sizesList;
@property (assign) IBOutlet NSPopUpButton *ratesList; @property (assign) IBOutlet NSPopUpButton *ratesList;
@property BOOL shouldHandlePreview;
@end @end
@implementation VideoPrefsVC @implementation VideoPrefsVC
...@@ -97,6 +99,8 @@ QMetaObject::Connection previewStopped; ...@@ -97,6 +99,8 @@ QMetaObject::Connection previewStopped;
} }
// check if preview has to be started/stopped by this controller
self.shouldHandlePreview = !Video::PreviewManager::instance()->isPreviewing();
[previewView setWantsLayer:YES]; [previewView setWantsLayer:YES];
[previewView setLayer:[CALayer layer]]; [previewView setLayer:[CALayer layer]];
...@@ -191,12 +195,16 @@ QMetaObject::Connection previewStopped; ...@@ -191,12 +195,16 @@ QMetaObject::Connection previewStopped;
- (void) viewWillAppear - (void) viewWillAppear
{ {
Video::PreviewManager::instance()->startPreview(); if (self.shouldHandlePreview) {
Video::PreviewManager::instance()->startPreview();
}
} }
- (void)viewWillDisappear - (void)viewWillDisappear
{ {
Video::PreviewManager::instance()->stopPreview(); if (self.shouldHandlePreview) {
Video::PreviewManager::instance()->stopPreview();
}
} }
#pragma mark - NSMenuDelegate methods #pragma mark - NSMenuDelegate methods
......
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