[vlc-commits] macosx: fix checked state for extensions (close #14855)

David Fuhrmann git at videolan.org
Thu Jun 11 19:21:22 CEST 2015


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Thu Jun 11 19:14:50 2015 +0200| [d768b02e609ec5c3295c09a54dd6dd425df687b1] | committer: David Fuhrmann

macosx: fix checked state for extensions (close #14855)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d768b02e609ec5c3295c09a54dd6dd425df687b1
---

 modules/gui/macosx/ExtensionsDialogProvider.m |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/ExtensionsDialogProvider.m b/modules/gui/macosx/ExtensionsDialogProvider.m
index d15966c..c723ab9 100644
--- a/modules/gui/macosx/ExtensionsDialogProvider.m
+++ b/modules/gui/macosx/ExtensionsDialogProvider.m
@@ -192,9 +192,9 @@ static void updateControlFromWidget(NSView *control, extension_widget_t *widget,
         {
             assert([control isKindOfClass:[NSButton class]]);
             NSButton *button = (NSButton *)control;
-            if (!widget->psz_text)
-                break;
-            [button setTitle:[NSString stringWithUTF8String:widget->psz_text]];
+            [button setTitle:toNSStr(widget->psz_text)];
+            if (widget->type == EXTENSION_WIDGET_CHECK_BOX)
+                [button setState:widget->b_checked ? NSOnState : NSOffState];
             break;
         }
         case EXTENSION_WIDGET_DROPDOWN:
@@ -342,7 +342,10 @@ static ExtensionsDialogProvider *_o_sharedInstance = nil;
     extension_widget_t *widget = [button widget];
 
     vlc_mutex_lock(&widget->p_dialog->lock);
-    extension_WidgetClicked(widget->p_dialog, widget);
+    if (widget->type == EXTENSION_WIDGET_BUTTON)
+        extension_WidgetClicked(widget->p_dialog, widget);
+    else
+        widget->b_checked = [button state] == NSOnState;
     vlc_mutex_unlock(&widget->p_dialog->lock);
 }
 



More information about the vlc-commits mailing list