Skip to content

Commit

Permalink
0.2 add full disk access alert
Browse files Browse the repository at this point in the history
  • Loading branch information
vascarpenter committed Mar 27, 2022
1 parent 76ac675 commit e9c2ff5
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 27 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# SafariBookmarkEraser

- Safari の Bookmarks.plist (~/Library/Safari/Bookmark.plist) を開き、おのおののURLにアクセスを試み、 Hostが死んでいたりDNS解決できなかったりしたエントリを消してデスクトップに保存し直してくれる (いきなり置き換えるのはこわいので) プログラム
- Safari の Bookmarks.plist (~/Library/Safari/Bookmark.plist) を開き、おのおののURLにアクセスを試み、 Hostが死んでいたりDNS解決できなかったりしたエントリを消してデスクトップに保存し直してくれる (いきなり置き換えるのはこわいので)
- 各ブックマークに非同期でアクセスしにいくので、メモリはたくさん必要です
- Progressbarが右端に行ってから保存ボタンを押してください
- 起動前に 環境設定のセキュリティ&プライバシーから、フルディスクアクセス>SafariBookmarkEraserをチェックする必要があります

- これはMandatory access controlによるものか
- https://developer.apple.com/forums/thread/678819
- Changelog
- v0.2
- フルディスクアクセスできない場合にエラーダイアログを表示し先に進まない
- Save ボタンを終了するまで disable
12 changes: 12 additions & 0 deletions SafariBookmarkEraser.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
58B0E09027ED59B400E6CE90 /* SafariBookmarkEraser.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SafariBookmarkEraser.entitlements; sourceTree = "<group>"; };
58B0E09627ED59C500E6CE90 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
58B0E09727ED688700E6CE90 /* CustomCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomCellView.swift; sourceTree = "<group>"; };
58D2AB1B27F07C6D00EAEF59 /* Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = "<group>"; };
58F6334D27EF530300C13165 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -58,6 +59,7 @@
isa = PBXGroup;
children = (
58B0E09627ED59C500E6CE90 /* Info.plist */,
58D2AB1B27F07C6D00EAEF59 /* Bridging-Header.h */,
58B0E08727ED59B100E6CE90 /* AppDelegate.swift */,
58B0E08927ED59B100E6CE90 /* ViewController.swift */,
58B0E09727ED688700E6CE90 /* CustomCellView.swift */,
Expand Down Expand Up @@ -282,6 +284,10 @@
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SafariBookmarkEraser/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
Expand All @@ -296,6 +302,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.hatenablog.gikoha.SafariBookmarkEraser;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_VERSION = 5.0;
};
name = Debug;
Expand All @@ -311,6 +318,10 @@
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)",
);
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = SafariBookmarkEraser/Info.plist;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.utilities";
Expand All @@ -325,6 +336,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.hatenablog.gikoha.SafariBookmarkEraser;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "";
SWIFT_VERSION = 5.0;
};
name = Release;
Expand Down
39 changes: 20 additions & 19 deletions SafariBookmarkEraser/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -705,25 +705,25 @@
<scene sceneID="hIz-AP-VOD">
<objects>
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="SafariBookmarkEraser" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" misplaced="YES" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="586" height="477"/>
<view key="view" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="607" height="477"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="60" horizontalPageScroll="10" verticalLineScroll="60" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ffk-MK-rgr">
<rect key="frame" x="20" y="20" width="546" height="358"/>
<rect key="frame" x="20" y="20" width="567" height="358"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<clipView key="contentView" id="8yr-X6-hgf">
<rect key="frame" x="1" y="1" width="544" height="356"/>
<rect key="frame" x="1" y="1" width="565" height="356"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" multipleSelection="NO" autosaveColumns="NO" rowHeight="60" headerView="akY-FN-2Kx" viewBased="YES" id="jeC-1G-y5p">
<rect key="frame" x="0.0" y="0.0" width="564" height="328"/>
<rect key="frame" x="0.0" y="0.0" width="565" height="328"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<size key="intercellSpacing" width="17" height="0.0"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn width="552" minWidth="40" maxWidth="1000" id="cdk-0J-aNj">
<tableColumn width="553" minWidth="40" maxWidth="1000" id="cdk-0J-aNj">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
Expand All @@ -736,20 +736,20 @@
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView identifier="MyTableCell" id="enN-LW-hkV" customClass="CustomCellView" customModule="SafariBookmarkEraser" customModuleProvider="target">
<rect key="frame" x="8" y="0.0" width="547" height="55"/>
<rect key="frame" x="8" y="0.0" width="548" height="55"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="rIe-GI-Jl4">
<rect key="frame" x="1" y="35" width="360" height="16"/>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" textCompletion="NO" id="rIe-GI-Jl4">
<rect key="frame" x="1" y="35" width="361" height="16"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="left" id="rzU-NA-YGI">
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" id="rzU-NA-YGI">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" id="Pa2-xw-Gdh">
<rect key="frame" x="325" y="35" width="152" height="16"/>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" textCompletion="NO" id="Pa2-xw-Gdh">
<rect key="frame" x="387" y="35" width="91" height="16"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" id="MkU-Uz-iJW">
<font key="font" metaFont="smallSystem"/>
Expand All @@ -758,7 +758,7 @@
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jfi-DD-EiL">
<rect key="frame" x="493" y="34" width="51" height="18"/>
<rect key="frame" x="494" y="34" width="51" height="18"/>
<buttonCell key="cell" type="check" title="削除" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="vQZ-6C-UD2">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -768,7 +768,7 @@
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pmc-gQ-giw">
<rect key="frame" x="1" y="3" width="493" height="16"/>
<rect key="frame" x="1" y="3" width="546" height="24"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" id="m9L-eA-Bo3">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -799,16 +799,16 @@
</tableView>
</subviews>
</clipView>
<scroller key="horizontalScroller" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="KNp-4a-jLH">
<rect key="frame" x="1" y="341" width="544" height="16"/>
<scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="KNp-4a-jLH">
<rect key="frame" x="1" y="341" width="565" height="16"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="n8D-8e-vXk">
<rect key="frame" x="224" y="17" width="15" height="102"/>
<autoresizingMask key="autoresizingMask"/>
</scroller>
<tableHeaderView key="headerView" wantsLayer="YES" id="akY-FN-2Kx">
<rect key="frame" x="0.0" y="0.0" width="564" height="28"/>
<rect key="frame" x="0.0" y="0.0" width="565" height="28"/>
<autoresizingMask key="autoresizingMask"/>
</tableHeaderView>
</scrollView>
Expand All @@ -829,7 +829,7 @@
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pVH-Y1-Nwm">
<rect key="frame" x="13" y="398" width="179" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="削除マークを削除して保存" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="zMp-9W-JxU">
<buttonCell key="cell" type="push" title="削除マークを削除して保存" bezelStyle="rounded" alignment="center" enabled="NO" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="zMp-9W-JxU">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
Expand All @@ -846,11 +846,12 @@
<connections>
<outlet property="myTableView" destination="jeC-1G-y5p" id="mDq-Wv-kAl"/>
<outlet property="progressBar" destination="BeN-T0-EtO" id="ZGq-jv-SEa"/>
<outlet property="saveButton" destination="pVH-Y1-Nwm" id="OCh-LN-bdn"/>
</connections>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="148" y="758.5"/>
<point key="canvasLocation" x="168.5" y="758.5"/>
</scene>
</scenes>
</document>

0 comments on commit e9c2ff5

Please sign in to comment.