Hide "Show hidden files" checkbutton on legacy OS (#473)

as it doesn't work.
This commit is contained in:
1024jp 2016-01-22 12:28:13 +09:00
parent 74ae202aec
commit 96de786b33
5 changed files with 14 additions and 5 deletions

View File

@ -7,7 +7,7 @@ develop
### New Features
- Now hidden file visibility can be toggled via checkbox in the document open panel.
- On El Capitan, hidden file visibility can be toggled via checkbox in the document open panel.
- Add the following encodings to the encodnig list:
- Arabic (ISO 8859-6)
- Hebrew (ISO 8859-8)

View File

@ -9,6 +9,7 @@
<connections>
<outlet property="accessoryEncodingMenu" destination="oFH-0B-ozp" id="uFj-9r-2br"/>
<outlet property="openPanelAccessoryView" destination="c22-O7-iKe" id="eeT-Yj-FJ0"/>
<outlet property="showHiddenFilesCheckbox" destination="J1J-NI-48C" id="73K-Ds-xGe"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
@ -58,6 +59,7 @@
<constraints>
<constraint firstAttribute="bottom" secondItem="J1J-NI-48C" secondAttribute="bottom" constant="10" id="4hR-6A-WvW"/>
<constraint firstItem="oFH-0B-ozp" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="10" id="6El-rr-dkw"/>
<constraint firstAttribute="bottom" secondItem="oFH-0B-ozp" secondAttribute="bottom" priority="750" constant="10" id="8DZ-5n-gCC"/>
<constraint firstItem="J1J-NI-48C" firstAttribute="top" secondItem="oFH-0B-ozp" secondAttribute="bottom" constant="8" symbolic="YES" id="Hfk-UJ-UA5"/>
<constraint firstItem="oFH-0B-ozp" firstAttribute="centerY" secondItem="bt1-Nu-etX" secondAttribute="centerY" id="Hz0-m4-xV3"/>
<constraint firstAttribute="trailing" secondItem="oFH-0B-ozp" secondAttribute="trailing" constant="20" symbolic="YES" id="XZN-dU-Gph"/>
@ -65,7 +67,7 @@
<constraint firstItem="oFH-0B-ozp" firstAttribute="leading" secondItem="bt1-Nu-etX" secondAttribute="trailing" constant="8" symbolic="YES" id="kH9-lI-myi"/>
<constraint firstItem="bt1-Nu-etX" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="20" symbolic="YES" id="mDY-Ct-zpm"/>
</constraints>
<point key="canvasLocation" x="445.5" y="671"/>
<point key="canvasLocation" x="445.5" y="670.5"/>
</customView>
</objects>
</document>

View File

@ -19,7 +19,7 @@
<h1>Opening hidden files</h1>
<p>The checkbox “Show hidden files” in the open panel can toggle the visibility of hidden files in the panel.</p>
<p>On El Capitan and later, the checkbox “Show hidden files” in the open panel can toggle the visibility of hidden files in the panel.</p>
<p>You can also meke them visible as follows:</p>
<ol>

View File

@ -19,7 +19,7 @@
<h1>不可視ファイルを開く</h1>
<p>Finder に表示されない不可視ファイルを開くには、オープンパネル内の「不可視ファイルを表示」チェックボックスをオンにします。</p>
<p>El Capitan 以降で Finder に表示されない不可視ファイルを開くには、オープンパネル内の「不可視ファイルを表示」チェックボックスをオンにします。</p>
<p>または次の手順で開くと最初から不可視ファイルを表示した状態になります。</p>
<ol>

View File

@ -47,6 +47,7 @@ static const CFStringRef CEUTTypeZipArchive = CFSTR("public.zip-archive");
@property (nonatomic, nullable) IBOutlet NSView *openPanelAccessoryView;
@property (nonatomic, nullable) IBOutlet NSPopUpButton *accessoryEncodingMenu;
@property (nonatomic, nullable) IBOutlet NSButton *showHiddenFilesCheckbox;
// readonly
@ -186,12 +187,18 @@ static const CFStringRef CEUTTypeZipArchive = CFSTR("public.zip-archive");
// initialize encoding menu and set the accessory view
if (![self openPanelAccessoryView]) {
[[NSBundle mainBundle] loadNibNamed:@"OpenDocumentAccessory" owner:self topLevelObjects:nil];
if (NSAppKitVersionNumber <= NSAppKitVersionNumber10_10_Max) {
// real time togging of hidden files visibility works only on El Capitan (and later?)
[[self showHiddenFilesCheckbox] removeFromSuperview];
}
}
[self buildEncodingPopupButton];
[openPanel setAccessoryView:[self openPanelAccessoryView]];
// set visibility of hidden files in the panel
// -> bind showsHiddenFiles flag with openPanel
[openPanel setShowsHiddenFiles:[self showsHiddenFiles]];
[openPanel setTreatsFilePackagesAsDirectories:[self showsHiddenFiles]];
// -> bind showsHiddenFiles flag with openPanel (for El capitan and leter)
[openPanel bind:@"showsHiddenFiles" toObject:self withKeyPath:@"showsHiddenFiles" options:nil];
[openPanel bind:@"treatsFilePackagesAsDirectories" toObject:self withKeyPath:@"showsHiddenFiles" options:nil];