mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-24 13:29:46 +00:00
Welcome window now displays a list of recent documents.
also the window now gets closed when a document is loaded
This commit is contained in:
201
MacPass/Base.lproj/WelcomeView.xib
Normal file
201
MacPass/Base.lproj/WelcomeView.xib
Normal file
@@ -0,0 +1,201 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.18"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="MPWelcomeViewController">
|
||||
<connections>
|
||||
<outlet property="tableView" destination="51b-Ql-3gM" id="g2f-YT-q5R"/>
|
||||
<outlet property="view" destination="9Nv-Zl-Z9p" id="ySe-F6-puU"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<view id="9Nv-Zl-Z9p">
|
||||
<rect key="frame" x="0.0" y="0.0" width="528" height="300"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<stackView orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ITj-5P-sn9">
|
||||
<rect key="frame" x="20" y="0.0" width="508" height="300"/>
|
||||
<middleViews>
|
||||
<stackView orientation="vertical" alignment="centerX" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="jd3-xw-cZP">
|
||||
<rect key="frame" x="143" y="0.0" width="222" height="300"/>
|
||||
<middleViews>
|
||||
<imageView misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VWi-da-LGh">
|
||||
<rect key="frame" x="47" y="105" width="128" height="128"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="128" id="T0d-gp-edr"/>
|
||||
<constraint firstAttribute="width" constant="128" id="Xdf-jE-D9H"/>
|
||||
</constraints>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="MacPassAppIcon" id="9f2-Co-St2"/>
|
||||
</imageView>
|
||||
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EEg-rH-sPx">
|
||||
<rect key="frame" x="-2" y="68" width="226" height="29"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Welcome to MacPass" id="zdv-z8-khG">
|
||||
<font key="font" metaFont="system" size="24"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</middleViews>
|
||||
<endViews>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MmF-PL-dgZ">
|
||||
<rect key="frame" x="39" y="22" width="144" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Open Database…" bezelStyle="rounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Jj3-zy-gaz">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="openDatabase:" target="-1" id="iC6-yP-ZKT"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="IRO-Hz-Zjp">
|
||||
<rect key="frame" x="26" y="-7" width="170" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Create new Database" bezelStyle="rounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Vxx-Ql-eI5">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="createNewDatabase:" target="-1" id="hbV-Rz-x5g"/>
|
||||
</connections>
|
||||
</button>
|
||||
</endViews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="300" id="f86-vL-FmV"/>
|
||||
</constraints>
|
||||
<visibilityPriorities>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
</visibilityPriorities>
|
||||
<customSpacing>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
</customSpacing>
|
||||
</stackView>
|
||||
</middleViews>
|
||||
<endViews>
|
||||
<scrollView misplaced="YES" autohidesScrollers="YES" horizontalLineScroll="40" horizontalPageScroll="10" verticalLineScroll="40" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eUA-6g-T1O">
|
||||
<rect key="frame" x="373" y="0.0" width="135" height="300"/>
|
||||
<clipView key="contentView" id="0Kf-Fq-by2">
|
||||
<rect key="frame" x="1" y="1" width="133" height="298"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="38" rowSizeStyle="automatic" viewBased="YES" id="51b-Ql-3gM">
|
||||
<rect key="frame" x="0.0" y="0.0" width="133" height="298"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<size key="intercellSpacing" width="3" height="2"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||
<tableColumns>
|
||||
<tableColumn width="130" minWidth="40" maxWidth="1000" id="oLj-wZ-syY">
|
||||
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||
</tableHeaderCell>
|
||||
<textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" title="Text Cell" id="Fbl-HT-XIu">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||
<prototypeCellViews>
|
||||
<tableCellView id="6UF-Gr-4nf">
|
||||
<rect key="frame" x="1" y="1" width="130" height="38"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Kko-1G-JNn">
|
||||
<rect key="frame" x="2" y="3" width="32" height="32"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" secondItem="Kko-1G-JNn" secondAttribute="height" multiplier="1:1" id="DCx-UU-29t"/>
|
||||
<constraint firstAttribute="height" constant="32" id="tUG-uX-FuQ"/>
|
||||
</constraints>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSActionTemplate" id="9TF-9t-7gd"/>
|
||||
</imageView>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Kso-jb-pRH">
|
||||
<rect key="frame" x="39" y="3" width="91" height="32"/>
|
||||
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" title="Table View Cell" id="vzM-ly-CYn">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<binding destination="6UF-Gr-4nf" name="value" keyPath="objectValue" id="xQO-gD-dYm"/>
|
||||
</connections>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="Kso-jb-pRH" firstAttribute="centerY" secondItem="6UF-Gr-4nf" secondAttribute="centerY" id="EFe-Eu-cwW"/>
|
||||
<constraint firstItem="Kso-jb-pRH" firstAttribute="leading" secondItem="Kko-1G-JNn" secondAttribute="trailing" constant="7" id="Jlp-gO-6rv"/>
|
||||
<constraint firstItem="Kso-jb-pRH" firstAttribute="top" secondItem="Kko-1G-JNn" secondAttribute="top" id="KY0-l7-LXd"/>
|
||||
<constraint firstItem="Kko-1G-JNn" firstAttribute="leading" secondItem="6UF-Gr-4nf" secondAttribute="leading" constant="2" id="RV0-o5-iyA"/>
|
||||
<constraint firstItem="Kso-jb-pRH" firstAttribute="bottom" secondItem="Kko-1G-JNn" secondAttribute="bottom" id="d6U-3y-ffn"/>
|
||||
<constraint firstAttribute="trailing" secondItem="Kso-jb-pRH" secondAttribute="trailing" constant="2" id="ptI-vC-fK9"/>
|
||||
</constraints>
|
||||
<connections>
|
||||
<outlet property="imageView" destination="Kko-1G-JNn" id="AvW-EL-9Rw"/>
|
||||
<outlet property="textField" destination="Kso-jb-pRH" id="yWg-4p-sFp"/>
|
||||
</connections>
|
||||
</tableCellView>
|
||||
</prototypeCellViews>
|
||||
</tableColumn>
|
||||
</tableColumns>
|
||||
<connections>
|
||||
<action trigger="doubleAction" selector="openRecentURL:" target="-2" id="kTu-60-aYp"/>
|
||||
<outlet property="dataSource" destination="-2" id="pLD-5Q-GVH"/>
|
||||
<outlet property="delegate" destination="-2" id="hO0-G9-RVy"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
</subviews>
|
||||
</clipView>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="200" id="R0Z-La-Y3C"/>
|
||||
</constraints>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="bRy-ef-e76">
|
||||
<rect key="frame" x="1" y="283" width="133" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="2e9-uR-dY7">
|
||||
<rect key="frame" x="224" y="17" width="15" height="102"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
</endViews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="jd3-xw-cZP" secondAttribute="bottom" constant="20" id="581-be-EbR"/>
|
||||
<constraint firstItem="jd3-xw-cZP" firstAttribute="top" secondItem="ITj-5P-sn9" secondAttribute="top" constant="20" id="9he-mz-Ciw"/>
|
||||
<constraint firstAttribute="bottom" secondItem="eUA-6g-T1O" secondAttribute="bottom" constant="-1" id="Ejt-qZ-puH"/>
|
||||
<constraint firstAttribute="trailing" secondItem="eUA-6g-T1O" secondAttribute="trailing" constant="-1" id="PEw-In-uMJ"/>
|
||||
<constraint firstItem="eUA-6g-T1O" firstAttribute="top" secondItem="ITj-5P-sn9" secondAttribute="top" constant="-1" id="piI-8Q-zsE"/>
|
||||
</constraints>
|
||||
<visibilityPriorities>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
</visibilityPriorities>
|
||||
<customSpacing>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
<real value="3.4028234663852886e+38"/>
|
||||
</customSpacing>
|
||||
</stackView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="ITj-5P-sn9" secondAttribute="trailing" id="7Bo-Jl-7Zu"/>
|
||||
<constraint firstItem="ITj-5P-sn9" firstAttribute="top" secondItem="9Nv-Zl-Z9p" secondAttribute="top" id="lrE-f8-tD5"/>
|
||||
<constraint firstItem="ITj-5P-sn9" firstAttribute="leading" secondItem="9Nv-Zl-Z9p" secondAttribute="leading" constant="20" id="oWL-PJ-VCT"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ITj-5P-sn9" secondAttribute="bottom" id="syW-TO-uwv"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-21" y="-483"/>
|
||||
</view>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="MacPassAppIcon" width="128" height="128"/>
|
||||
<image name="NSActionTemplate" width="14" height="14"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -1,92 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13196" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13196"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="MPAppDelegate">
|
||||
<connections>
|
||||
<outlet property="welcomeWindow" destination="1" id="94"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Welcome" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="1">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="448" height="255"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
<view key="contentView" id="2">
|
||||
<rect key="frame" x="0.0" y="0.0" width="448" height="255"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<imageView translatesAutoresizingMaskIntoConstraints="NO" id="3">
|
||||
<rect key="frame" x="160" y="107" width="128" height="128"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="128" id="18"/>
|
||||
<constraint firstAttribute="height" constant="128" id="19"/>
|
||||
</constraints>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="MacPassAppIcon" id="4"/>
|
||||
</imageView>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="23">
|
||||
<rect key="frame" x="108" y="70" width="233" height="29"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Welcome to MacPass" id="24">
|
||||
<font key="font" metaFont="system" size="24"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="43">
|
||||
<rect key="frame" x="172" y="18" width="118" height="25"/>
|
||||
<buttonCell key="cell" type="roundTextured" title="Open Database…" bezelStyle="texturedRounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="44">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="openDatabase:" target="-2" id="101"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="47">
|
||||
<rect key="frame" x="20" y="18" width="144" height="25"/>
|
||||
<buttonCell key="cell" type="roundTextured" title="Create new Database" bezelStyle="texturedRounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="48">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="createNewDatabase:" target="-2" id="102"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="69">
|
||||
<rect key="frame" x="372" y="18" width="56" height="25"/>
|
||||
<buttonCell key="cell" type="roundTextured" title="Cancel" bezelStyle="texturedRounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="70">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="orderOut:" target="1" id="93"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="43" secondAttribute="bottom" constant="20" symbolic="YES" id="63"/>
|
||||
<constraint firstAttribute="bottom" secondItem="47" secondAttribute="bottom" constant="20" symbolic="YES" id="65"/>
|
||||
<constraint firstItem="47" firstAttribute="leading" secondItem="2" secondAttribute="leading" constant="20" symbolic="YES" id="66"/>
|
||||
<constraint firstItem="43" firstAttribute="leading" secondItem="47" secondAttribute="trailing" constant="8" symbolic="YES" id="68"/>
|
||||
<constraint firstAttribute="bottom" secondItem="69" secondAttribute="bottom" constant="20" symbolic="YES" id="73"/>
|
||||
<constraint firstAttribute="trailing" secondItem="69" secondAttribute="trailing" constant="20" symbolic="YES" id="74"/>
|
||||
<constraint firstItem="3" firstAttribute="centerX" secondItem="23" secondAttribute="centerX" id="85"/>
|
||||
<constraint firstItem="3" firstAttribute="top" secondItem="2" secondAttribute="top" constant="20" symbolic="YES" id="87"/>
|
||||
<constraint firstItem="23" firstAttribute="top" secondItem="3" secondAttribute="bottom" constant="8" symbolic="YES" id="89"/>
|
||||
<constraint firstItem="69" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="43" secondAttribute="trailing" constant="8" symbolic="YES" id="96"/>
|
||||
<constraint firstItem="43" firstAttribute="top" relation="greaterThanOrEqual" secondItem="23" secondAttribute="bottom" constant="8" symbolic="YES" id="98"/>
|
||||
<constraint firstItem="3" firstAttribute="centerX" secondItem="2" secondAttribute="centerX" id="100"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<point key="canvasLocation" x="133" y="85"/>
|
||||
</window>
|
||||
</objects>
|
||||
<resources>
|
||||
<image name="MacPassAppIcon" width="128" height="128"/>
|
||||
</resources>
|
||||
</document>
|
||||
@@ -24,12 +24,8 @@
|
||||
|
||||
APPKIT_EXTERN NSString *const MPDidChangeStoredKeyFilesSettings;
|
||||
|
||||
@class MPAutotypeDaemon;
|
||||
|
||||
@interface MPAppDelegate : NSObject <NSApplicationDelegate, NSMenuDelegate>
|
||||
|
||||
@property (strong) IBOutlet NSWindow *passwordCreatorWindow;
|
||||
@property (strong) IBOutlet NSWindow *welcomeWindow;
|
||||
@property (weak) IBOutlet NSMenuItem *saveMenuItem;
|
||||
@property (weak) IBOutlet NSMenuItem *fixAutotypeMenuItem;
|
||||
@property (weak) IBOutlet NSMenuItem *fileNewMenuItem;
|
||||
@@ -52,5 +48,6 @@ APPKIT_EXTERN NSString *const MPDidChangeStoredKeyFilesSettings;
|
||||
- (void)lockAllDocuments;
|
||||
|
||||
- (void)showWelcomeWindow;
|
||||
- (void)hideWelcomeWindow;
|
||||
|
||||
@end
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#import "MPTemporaryFileStorageCenter.h"
|
||||
#import "MPValueTransformerHelper.h"
|
||||
#import "MPUserNotificationCenterDelegate.h"
|
||||
#import "MPWelcomeViewController.h"
|
||||
|
||||
#import "NSApplication+MPAdditions.h"
|
||||
|
||||
@@ -55,6 +56,8 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
|
||||
BOOL _shouldOpenFile; // YES if app was started to open a
|
||||
}
|
||||
|
||||
@property (strong) NSWindow *welcomeWindow;
|
||||
@property (strong) IBOutlet NSWindow *passwordCreatorWindow;
|
||||
@property (strong, nonatomic) MPSettingsWindowController *settingsController;
|
||||
@property (strong, nonatomic) MPPasswordCreatorViewController *passwordCreatorController;
|
||||
|
||||
@@ -249,10 +252,25 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
|
||||
}
|
||||
|
||||
- (void)showWelcomeWindow {
|
||||
[self _loadWelcomeWindow];
|
||||
if(!self.welcomeWindow) {
|
||||
self.welcomeWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 100, 100)
|
||||
styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskResizable
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
self.welcomeWindow.releasedWhenClosed = NO;
|
||||
}
|
||||
if(!self.welcomeWindow.contentViewController) {
|
||||
self.welcomeWindow.contentViewController = [[MPWelcomeViewController alloc] init];
|
||||
}
|
||||
|
||||
[self.welcomeWindow center];
|
||||
[self.welcomeWindow makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
- (void)hideWelcomeWindow {
|
||||
[self.welcomeWindow orderOut:nil];
|
||||
}
|
||||
|
||||
- (void)clearRememberdKeyFiles:(id)sender {
|
||||
[NSUserDefaults.standardUserDefaults removeObjectForKey:kMPSettingsKeyRememeberdKeysForDatabases];
|
||||
}
|
||||
@@ -296,11 +314,4 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
|
||||
}
|
||||
}
|
||||
|
||||
- (void)_loadWelcomeWindow {
|
||||
if(!_welcomeWindow) {
|
||||
NSArray *topLevelObject;
|
||||
[NSBundle.mainBundle loadNibNamed:@"WelcomeWindow" owner:self topLevelObjects:&topLevelObject];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -78,6 +78,11 @@
|
||||
return [super typeForContentsOfURL:url error:outError];
|
||||
}
|
||||
|
||||
- (void)addDocument:(NSDocument *)document {
|
||||
[((MPAppDelegate *)NSApp.delegate) hideWelcomeWindow];
|
||||
[super addDocument:document];
|
||||
}
|
||||
|
||||
- (BOOL)reopenLastDocument {
|
||||
if(self.documents.count > 0) {
|
||||
return YES; // The document is already open
|
||||
|
||||
17
MacPass/MPWelcomeViewController.h
Normal file
17
MacPass/MPWelcomeViewController.h
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// MPWelcomeWindowViewController.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 28.09.18.
|
||||
// Copyright © 2018 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MPWelcomeViewController : NSViewController <NSTableViewDataSource, NSTableViewDelegate>
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
50
MacPass/MPWelcomeViewController.m
Normal file
50
MacPass/MPWelcomeViewController.m
Normal file
@@ -0,0 +1,50 @@
|
||||
//
|
||||
// MPWelcomeWindowViewController.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 28.09.18.
|
||||
// Copyright © 2018 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPWelcomeViewController.h"
|
||||
|
||||
@interface MPWelcomeViewController ()
|
||||
|
||||
@property (strong) IBOutlet NSTableView *tableView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPWelcomeViewController
|
||||
|
||||
- (NSNibName)nibName {
|
||||
return @"WelcomeView";
|
||||
}
|
||||
|
||||
- (void)viewWillAppear {
|
||||
[super viewWillAppear];
|
||||
[self.tableView reloadData];
|
||||
}
|
||||
|
||||
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
|
||||
return NSDocumentController.sharedDocumentController.recentDocumentURLs.count;
|
||||
}
|
||||
|
||||
- (nullable NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row {
|
||||
NSTableCellView *view = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self];
|
||||
NSURL *url = NSDocumentController.sharedDocumentController.recentDocumentURLs[row];
|
||||
view.textField.stringValue = url.lastPathComponent;
|
||||
view.imageView.image = [NSWorkspace.sharedWorkspace iconForFile:url.path];
|
||||
return view;
|
||||
}
|
||||
|
||||
- (IBAction)openRecentURL:(id)sender {
|
||||
NSInteger clicked = self.tableView.clickedRow;
|
||||
NSArray <NSURL *> *recentURLS = NSDocumentController.sharedDocumentController.recentDocumentURLs;
|
||||
if(clicked > 0 && clicked < recentURLS.count) {
|
||||
[NSDocumentController.sharedDocumentController openDocumentWithContentsOfURL:recentURLS[clicked]
|
||||
display:YES
|
||||
completionHandler:^(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error) {}];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13196" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14313.18" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13196"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14313.18"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -13,7 +13,7 @@
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Password Generator" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="1">
|
||||
<window title="Password Generator" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="1">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="338" height="216"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
|
||||
@@ -21,7 +21,7 @@
|
||||
<rect key="frame" x="0.0" y="0.0" width="338" height="216"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</view>
|
||||
<point key="canvasLocation" x="288" y="14"/>
|
||||
<point key="canvasLocation" x="48" y="-70"/>
|
||||
</window>
|
||||
</objects>
|
||||
</document>
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */
|
||||
"1.title" = "Willkommen";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */
|
||||
"24.title" = "Willkommen zu MacPass";
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */
|
||||
"1.title" = "Welcome";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */
|
||||
"24.title" = "Welcome to MacPass";
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
|
||||
/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */
|
||||
"1.title" = "Bienvenido";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */
|
||||
"24.title" = "Bienvenido a MacPass";
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
|
||||
/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */
|
||||
"1.title" = "Bienvenue";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */
|
||||
"24.title" = "Bienvenue dans MacPass";
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
|
||||
/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */
|
||||
"1.title" = "Benvenuto";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */
|
||||
"24.title" = "Benvenuto a MacPass";
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */
|
||||
"1.title" = "Welkom";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */
|
||||
"24.title" = "Welkom bij MacPass";
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */
|
||||
"1.title" = "Witaj";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */
|
||||
"24.title" = "Witaj w MacPass";
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
|
||||
/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */
|
||||
"1.title" = "Добро пожаловать";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */
|
||||
"24.title" = "Добро пожаловать в MacPass";
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
|
||||
/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */
|
||||
"1.title" = "Välkommen";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */
|
||||
"24.title" = "Välkommen till MacPass";
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
|
||||
/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */
|
||||
"1.title" = "Welcome";
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */
|
||||
"24.title" = "欢迎使用 MacPass";
|
||||
|
||||
Reference in New Issue
Block a user