mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 21:42:32 +00:00
customized open panels throughout the app. Added brows plugins button to plugin settings
This commit is contained in:
@@ -120,19 +120,33 @@
|
||||
<action selector="addOrRemovePlugin:" target="-2" id="ywK-Vi-MR4"/>
|
||||
</connections>
|
||||
</segmentedControl>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SNe-cc-CZs">
|
||||
<rect key="frame" x="383" y="18" width="117" height="25"/>
|
||||
<buttonCell key="cell" type="roundTextured" title="Browse Plugins…" bezelStyle="texturedRounded" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="sqO-8H-n1y">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="browsePlugins:" target="-2" id="16S-2u-Tmi"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="CqP-oK-S8k" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="20" id="1Rj-zS-7t2"/>
|
||||
<constraint firstItem="vBs-Ga-aq0" firstAttribute="top" secondItem="fCk-fL-jU8" secondAttribute="top" id="2h6-C9-4N5"/>
|
||||
<constraint firstItem="B9Q-hq-K4N" firstAttribute="top" secondItem="fCk-fL-jU8" secondAttribute="bottom" constant="8" symbolic="YES" id="3vA-Oh-cFO"/>
|
||||
<constraint firstAttribute="bottom" secondItem="B9Q-hq-K4N" secondAttribute="bottom" constant="20" symbolic="YES" id="7HD-ji-Whc"/>
|
||||
<constraint firstAttribute="trailing" secondItem="SNe-cc-CZs" secondAttribute="trailing" constant="20" symbolic="YES" id="8Je-yg-f1l"/>
|
||||
<constraint firstAttribute="trailing" secondItem="aoG-FD-ds8" secondAttribute="trailing" constant="20" symbolic="YES" id="95O-Jh-0KG"/>
|
||||
<constraint firstItem="vBs-Ga-aq0" firstAttribute="bottom" secondItem="fCk-fL-jU8" secondAttribute="bottom" id="BQ2-Wp-Fsh"/>
|
||||
<constraint firstAttribute="bottom" secondItem="SNe-cc-CZs" secondAttribute="bottom" constant="20" symbolic="YES" id="Fqe-ch-vsS"/>
|
||||
<constraint firstAttribute="trailing" secondItem="vBs-Ga-aq0" secondAttribute="trailing" constant="20" id="LUb-Un-azV"/>
|
||||
<constraint firstItem="aoG-FD-ds8" firstAttribute="leading" secondItem="CqP-oK-S8k" secondAttribute="leading" id="NcW-ya-DPx"/>
|
||||
<constraint firstItem="B9Q-hq-K4N" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" symbolic="YES" id="Rtj-Ad-zkg"/>
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="CqP-oK-S8k" secondAttribute="trailing" constant="20" symbolic="YES" id="TXL-mf-nxu"/>
|
||||
<constraint firstItem="SNe-cc-CZs" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="B9Q-hq-K4N" secondAttribute="trailing" constant="8" symbolic="YES" id="a62-en-kDA"/>
|
||||
<constraint firstItem="fCk-fL-jU8" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" id="fzW-4b-L8S"/>
|
||||
<constraint firstItem="SNe-cc-CZs" firstAttribute="top" secondItem="vBs-Ga-aq0" secondAttribute="bottom" constant="8" symbolic="YES" id="r4X-iM-iYU"/>
|
||||
<constraint firstItem="CqP-oK-S8k" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="20" id="rN1-3Z-BBi"/>
|
||||
<constraint firstItem="fCk-fL-jU8" firstAttribute="top" secondItem="aoG-FD-ds8" secondAttribute="bottom" constant="8" id="vl9-MY-WW1"/>
|
||||
<constraint firstItem="vBs-Ga-aq0" firstAttribute="leading" secondItem="fCk-fL-jU8" secondAttribute="trailing" constant="8" id="xNu-Sj-xQO"/>
|
||||
|
||||
@@ -263,7 +263,9 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
openPanel.allowsMultipleSelection = NO;
|
||||
openPanel.canChooseDirectories = NO;
|
||||
openPanel.canChooseFiles = YES;
|
||||
openPanel.allowedFileTypes = @[(id)kUTTypeXML];
|
||||
openPanel.allowedFileTypes = @[(id)kUTTypeXML];
|
||||
openPanel.prompt = NSLocalizedString(@"OPEN_BUTTON_IMPORT_XML_OPEN_PANEL", "Open button in the open panel to import an XML file");
|
||||
openPanel.message = NSLocalizedString(@"MESSAGE_XML_OPEN_PANEL", "Message in the open panel to import an XML file");
|
||||
[openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
|
||||
if(result == NSFileHandlingPanelOKButton) {
|
||||
[document readXMLfromURL:openPanel.URL];
|
||||
|
||||
@@ -222,6 +222,8 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
openPanel.canChooseDirectories = NO;
|
||||
openPanel.canChooseFiles = YES;
|
||||
openPanel.allowsMultipleSelection = YES;
|
||||
openPanel.prompt = NSLocalizedString(@"OPEN_BUTTON_ADD_ATTACHMENT_OPEN_PANEL", "Open button in the open panel to add attachments to an entry");
|
||||
openPanel.message = NSLocalizedString(@"MESSAGE_ADD_ATTACHMENT_OPEN_PANEL", "Message in the open panel to add attachments to an entry");
|
||||
[openPanel beginSheetModalForWindow:self.windowController.window completionHandler:^(NSInteger result) {
|
||||
if(result == NSFileHandlingPanelOKButton) {
|
||||
for (NSURL *attachmentURL in openPanel.URLs) {
|
||||
|
||||
@@ -26,5 +26,6 @@
|
||||
@interface MPPluginSettingsController : MPViewController <MPSettingsTab>
|
||||
|
||||
- (IBAction)addOrRemovePlugin:(id)sender;
|
||||
- (IBAction)browsePlugins:(id)sender;
|
||||
|
||||
@end
|
||||
|
||||
@@ -115,6 +115,10 @@ typedef NS_ENUM(NSUInteger, MPPluginSegmentType) {
|
||||
[self showSettingsForPlugin:plugin];
|
||||
}
|
||||
|
||||
- (IBAction)browsePlugins:(id)sender {
|
||||
[NSWorkspace.sharedWorkspace openURL:[NSApp applicationSupportDirectoryURL:YES]];
|
||||
}
|
||||
|
||||
- (IBAction)addOrRemovePlugin:(id)sender {
|
||||
if(sender != self.addRemovePluginsControl) {
|
||||
return;
|
||||
@@ -136,6 +140,8 @@ typedef NS_ENUM(NSUInteger, MPPluginSegmentType) {
|
||||
openPanel.allowsMultipleSelection = NO;
|
||||
openPanel.canChooseFiles = YES;
|
||||
openPanel.canChooseDirectories = NO;
|
||||
openPanel.prompt = NSLocalizedString(@"OPEN_BUTTON_ADD_PLUGIN_OPEN_PANEL", "Open button in the add plugin open panel");
|
||||
openPanel.message = NSLocalizedString(@"MESSAGE_ADD_PLUGIN_OPEN_PANEL", "Message in the add plugin open panel");
|
||||
[openPanel beginSheetModalForWindow:self.view.window completionHandler:^(NSModalResponse result) {
|
||||
if(NSModalResponseOK) {
|
||||
if(openPanel.URLs.count == 1) {
|
||||
|
||||
@@ -80,6 +80,8 @@
|
||||
openPanel.allowsMultipleSelection = NO;
|
||||
openPanel.canChooseDirectories = NO;
|
||||
openPanel.canChooseFiles = YES;
|
||||
openPanel.prompt = NSLocalizedString(@"SELECT_DEFAULT_BROWSER_OPEN_PANEL_SELECT_BUTTON", "Label for the select browser button on the open panel for selecting which browser to use for opening URLs");
|
||||
openPanel.message = NSLocalizedString(@"SELECT_DEFAULT_BROWSER_OPEN_PANEL_MESSAGE", "Message on the open panel for selecting which browser to use for opening URLs");
|
||||
openPanel.allowedFileTypes = @[@"app"];
|
||||
|
||||
[openPanel beginSheetModalForWindow:self.view.window completionHandler:^(NSInteger result) {
|
||||
|
||||
Reference in New Issue
Block a user