[vlc-commits] macosx/coredialogs: add checkbox to login dialog to ask for store
Felix Paul Kühne
git at videolan.org
Thu Feb 4 20:39:41 CET 2016
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Feb 4 20:39:49 2016 +0100| [0cb29ee37c68298b01ea5a10d82336c2c7ad584a] | committer: Felix Paul Kühne
macosx/coredialogs: add checkbox to login dialog to ask for store
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0cb29ee37c68298b01ea5a10d82336c2c7ad584a
---
.../package/macosx/Resources/English.lproj/CoreDialogs.xib | 10 ++++++++++
modules/gui/macosx/coredialogs.h | 1 +
modules/gui/macosx/coredialogs.m | 9 +++++----
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/extras/package/macosx/Resources/English.lproj/CoreDialogs.xib b/extras/package/macosx/Resources/English.lproj/CoreDialogs.xib
index 3634cb0..2928892 100644
--- a/extras/package/macosx/Resources/English.lproj/CoreDialogs.xib
+++ b/extras/package/macosx/Resources/English.lproj/CoreDialogs.xib
@@ -14,6 +14,7 @@
<outlet property="authenticationOkButton" destination="252" id="BgQ-UX-t3S"/>
<outlet property="authenticationPasswordLabel" destination="251" id="mgJ-w8-OSO"/>
<outlet property="authenticationPasswordTextField" destination="253" id="kg1-Mw-Xxc"/>
+ <outlet property="authenticationStorePasswordCheckbox" destination="7LA-vc-QPm" id="eyU-kP-Qws"/>
<outlet property="authenticationTitleLabel" destination="256" id="w85-xG-Aix"/>
<outlet property="authenticationWindow" destination="248" id="KUc-xR-bpJ"/>
<outlet property="progressCancelButton" destination="306" id="yX8-ag-f4a"/>
@@ -124,6 +125,13 @@ Gw
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageAlignment="topLeft" imageScaling="proportionallyDown" image="NSApplicationIcon" id="325"/>
</imageView>
+ <button translatesAutoresizingMaskIntoConstraints="NO" id="7LA-vc-QPm">
+ <rect key="frame" x="94" y="21" width="88" height="18"/>
+ <buttonCell key="cell" type="check" title="Remember" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="5El-9y-n4Y">
+ <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
+ <font key="font" metaFont="system"/>
+ </buttonCell>
+ </button>
</subviews>
<constraints>
<constraint firstItem="252" firstAttribute="top" secondItem="253" secondAttribute="bottom" constant="20" id="0dm-8h-d9f"/>
@@ -139,7 +147,9 @@ Gw
<constraint firstItem="254" firstAttribute="centerY" secondItem="252" secondAttribute="centerY" id="Yd8-Jc-1YW"/>
<constraint firstItem="256" firstAttribute="top" secondItem="314" secondAttribute="top" id="dB9-JK-2Lo"/>
<constraint firstItem="255" firstAttribute="leading" secondItem="257" secondAttribute="leading" id="de7-8M-oBQ"/>
+ <constraint firstItem="7LA-vc-QPm" firstAttribute="leading" secondItem="253" secondAttribute="leading" id="e2a-lM-3N0"/>
<constraint firstItem="251" firstAttribute="leading" secondItem="250" secondAttribute="leading" id="iEd-dM-6MD"/>
+ <constraint firstItem="7LA-vc-QPm" firstAttribute="centerY" secondItem="254" secondAttribute="centerY" id="jqQ-3p-fZC"/>
<constraint firstItem="257" firstAttribute="trailing" secondItem="252" secondAttribute="trailing" id="keI-Fm-ogw"/>
<constraint firstAttribute="bottom" secondItem="252" secondAttribute="bottom" constant="19" id="p5k-jJ-36M"/>
<constraint firstItem="253" firstAttribute="top" secondItem="251" secondAttribute="bottom" constant="8" id="qui-cW-NGH"/>
diff --git a/modules/gui/macosx/coredialogs.h b/modules/gui/macosx/coredialogs.h
index 2705534..6c9097f 100644
--- a/modules/gui/macosx/coredialogs.h
+++ b/modules/gui/macosx/coredialogs.h
@@ -41,6 +41,7 @@
IBOutlet NSTextField *authenticationPasswordTextField;
IBOutlet NSTextField *authenticationPasswordLabel;
IBOutlet NSTextField *authenticationTitleLabel;
+ IBOutlet NSButton *authenticationStorePasswordCheckbox;
IBOutlet NSWindow *authenticationWindow;
/* progress dialog */
diff --git a/modules/gui/macosx/coredialogs.m b/modules/gui/macosx/coredialogs.m
index a76f24c..e5d8d7f 100644
--- a/modules/gui/macosx/coredialogs.m
+++ b/modules/gui/macosx/coredialogs.m
@@ -211,6 +211,7 @@ static void updateProgressCallback(vlc_dialog_id *p_id,
[authenticationPasswordLabel setStringValue: _NS("Password")];
[authenticationCancelButton setTitle: _NS("Cancel")];
[authenticationOkButton setTitle: _NS("OK")];
+ [authenticationStorePasswordCheckbox setTitle:_NS("Remember")];
[progressCancelButton setTitle: _NS("Cancel")];
[progressIndicator setUsesThreadedAnimation: YES];
@@ -222,8 +223,6 @@ static void updateProgressCallback(vlc_dialog_id *p_id,
defaultUserName:(const char *)psz_default_username
askToStore:(bool )b_ask_store
{
- // FIXME: add support for b_ask_store
-
[authenticationTitleLabel setStringValue:toNSStr(psz_title)];
authenticationWindow.title = authenticationTitleLabel.stringValue;
[authenticationDescriptionLabel setStringValue:toNSStr(psz_text)];
@@ -231,6 +230,9 @@ static void updateProgressCallback(vlc_dialog_id *p_id,
[authenticationLoginTextField setStringValue:toNSStr(psz_default_username)];
[authenticationPasswordTextField setStringValue:@""];
+ authenticationStorePasswordCheckbox.hidden = !b_ask_store;
+ authenticationStorePasswordCheckbox.state = NSOffState;
+
[authenticationWindow center];
NSInteger returnValue = [NSApp runModalForWindow:authenticationWindow];
[authenticationWindow close];
@@ -241,8 +243,7 @@ static void updateProgressCallback(vlc_dialog_id *p_id,
vlc_dialog_id_post_login(p_id,
username ? [username UTF8String] : NULL,
password ? [password UTF8String] : NULL,
- false);
-
+ authenticationStorePasswordCheckbox.state == NSOnState);
}
- (IBAction)authenticationDialogAction:(id)sender
More information about the vlc-commits
mailing list