Skip to content

Commit eeaad40

Browse files
committed
Fix bug on save settings.
1 parent 55120ab commit eeaad40

File tree

11 files changed

+62
-33
lines changed

11 files changed

+62
-33
lines changed

Application/AppDelegate.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
135135
} else {
136136
let alert = NSAlert()
137137
alert.window.title = "Attention"
138-
alert.messageText = "The application support folder don't exists."
138+
alert.messageText = "Application support folder does not exist"
139+
alert.informativeText = "You probably haven't created any custom themes or style sheets yet."
139140
alert.addButton(withTitle: "Close")
140141
alert.alertStyle = .informational
141142

Application/Base.lproj/Main.storyboard

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@
2525
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
2626
</connections>
2727
</menuItem>
28+
<menuItem title="Check for Updates…" id="489-Oc-30K">
29+
<modifierMask key="keyEquivalentModifierMask"/>
30+
</menuItem>
2831
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
2932
<menuItem title="About highlight…" id="27U-j5-YgY">
3033
<modifierMask key="keyEquivalentModifierMask"/>
3134
<connections>
3235
<segue destination="CEI-MK-vOQ" kind="modal" id="R9y-35-Vhk"/>
3336
</connections>
3437
</menuItem>
35-
<menuItem title="Open application support folder" id="TjU-KQ-wH7">
38+
<menuItem title="Open support folder" id="TjU-KQ-wH7">
3639
<modifierMask key="keyEquivalentModifierMask"/>
3740
<connections>
3841
<action selector="openApplicationSupportFolder:" target="Voe-Tx-rLC" id="bD6-oR-JLw"/>
@@ -74,9 +77,9 @@
7477
<modifierMask key="keyEquivalentModifierMask"/>
7578
<menu key="submenu" title="File" id="bib-Uj-vzu">
7679
<items>
77-
<menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
80+
<menuItem title="Save and Quit" keyEquivalent="s" id="pxN-rg-phH">
7881
<connections>
79-
<action selector="performClose:" target="Ady-hI-5gd" id="HmO-Ls-i7Q"/>
82+
<action selector="saveAction:" target="Ady-hI-5gd" id="5sR-k9-Yc4"/>
8083
</connections>
8184
</menuItem>
8285
</items>
@@ -870,6 +873,7 @@ DQ
870873
<viewController key="viewController" id="rXW-yy-93d">
871874
<button key="view" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5sm-SI-eJn">
872875
<rect key="frame" x="0.0" y="0.0" width="180" height="30"/>
876+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
873877
<buttonCell key="cell" type="push" title="Inquiry file" bezelStyle="rounded" image="inquiry" imagePosition="leading" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="1Ag-zw-cs5">
874878
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
875879
<font key="font" usesAppearanceFont="YES"/>
@@ -884,6 +888,7 @@ DQ
884888
<viewController key="viewController" id="3o6-C3-Xm4">
885889
<button key="view" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="NIj-cd-CJK">
886890
<rect key="frame" x="0.0" y="0.0" width="162" height="30"/>
891+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
887892
<buttonCell key="cell" type="push" title="Themes editor" bezelStyle="rounded" image="themes" imagePosition="leading" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="fyc-jK-CqN">
888893
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
889894
<font key="font" usesAppearanceFont="YES"/>
@@ -1883,10 +1888,10 @@ Gw
18831888
<autoresizingMask key="autoresizingMask"/>
18841889
<subviews>
18851890
<box horizontalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="7r5-6M-ONG">
1886-
<rect key="frame" x="258" y="0.0" width="5" height="352"/>
1891+
<rect key="frame" x="258" y="0.0" width="5" height="342"/>
18871892
</box>
18881893
<visualEffectView blendingMode="behindWindow" material="underWindowBackground" state="followsWindowActiveState" translatesAutoresizingMaskIntoConstraints="NO" id="kpv-4y-tiy">
1889-
<rect key="frame" x="0.0" y="0.0" width="260" height="352"/>
1894+
<rect key="frame" x="0.0" y="0.0" width="260" height="342"/>
18901895
<subviews>
18911896
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="G4d-Ud-cTN">
18921897
<rect key="frame" x="0.0" y="28" width="260" height="5"/>
@@ -1976,13 +1981,13 @@ Gw
19761981
</customSpacing>
19771982
</stackView>
19781983
<scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="103" horizontalPageScroll="10" verticalLineScroll="103" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="niQ-bu-HDe">
1979-
<rect key="frame" x="0.0" y="31" width="260" height="321"/>
1984+
<rect key="frame" x="0.0" y="31" width="260" height="311"/>
19801985
<clipView key="contentView" drawsBackground="NO" id="AxT-XV-sDg">
1981-
<rect key="frame" x="0.0" y="0.0" width="260" height="321"/>
1986+
<rect key="frame" x="0.0" y="0.0" width="260" height="311"/>
19821987
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19831988
<subviews>
19841989
<outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="100" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="8" autosaveExpandedItems="YES" outlineTableColumn="ROQ-Ow-FIV" id="gqF-5q-802">
1985-
<rect key="frame" x="0.0" y="0.0" width="260" height="321"/>
1990+
<rect key="frame" x="0.0" y="0.0" width="260" height="311"/>
19861991
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
19871992
<size key="intercellSpacing" width="2" height="3"/>
19881993
<color key="backgroundColor" red="1" green="1" blue="1" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>
@@ -2098,15 +2103,15 @@ Gw
20982103
</constraints>
20992104
</visualEffectView>
21002105
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="H2K-EL-2Mr">
2101-
<rect key="frame" x="405" y="184" width="56" height="16"/>
2106+
<rect key="frame" x="405" y="179" width="56" height="16"/>
21022107
<textFieldCell key="cell" lineBreakMode="clipping" enabled="NO" alignment="center" title="Preview" id="Txd-rC-BU1">
21032108
<font key="font" usesAppearanceFont="YES"/>
21042109
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
21052110
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
21062111
</textFieldCell>
21072112
</textField>
21082113
<wkWebView wantsLayer="YES" allowsLinkPreview="NO" translatesAutoresizingMaskIntoConstraints="NO" id="EpR-xA-UXw">
2109-
<rect key="frame" x="261" y="31" width="344" height="321"/>
2114+
<rect key="frame" x="261" y="31" width="344" height="311"/>
21102115
<wkWebViewConfiguration key="configuration" suppressesIncrementalRendering="YES">
21112116
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
21122117
<wkPreferences key="preferences" javaScriptCanOpenWindowsAutomatically="NO"/>
@@ -2161,19 +2166,19 @@ Gw
21612166
</customSpacing>
21622167
</stackView>
21632168
<box horizontalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="tpy-nX-jLP">
2164-
<rect key="frame" x="603" y="0.0" width="5" height="352"/>
2169+
<rect key="frame" x="603" y="0.0" width="5" height="342"/>
21652170
<constraints>
21662171
<constraint firstAttribute="width" constant="1" id="mZv-AU-9VY"/>
21672172
</constraints>
21682173
</box>
21692174
<scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="25" horizontalPageScroll="10" verticalLineScroll="25" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ZnV-SA-vVd">
2170-
<rect key="frame" x="606" y="30" width="299" height="322"/>
2175+
<rect key="frame" x="606" y="30" width="299" height="312"/>
21712176
<clipView key="contentView" drawsBackground="NO" id="pq8-mb-WNU">
2172-
<rect key="frame" x="0.0" y="0.0" width="299" height="322"/>
2177+
<rect key="frame" x="0.0" y="0.0" width="299" height="312"/>
21732178
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
21742179
<subviews>
21752180
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="firstColumnOnly" selectionHighlightStyle="none" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="23" viewBased="YES" floatsGroupRows="NO" id="Kti-Pv-Clb">
2176-
<rect key="frame" x="0.0" y="0.0" width="299" height="322"/>
2181+
<rect key="frame" x="0.0" y="0.0" width="299" height="312"/>
21772182
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
21782183
<size key="intercellSpacing" width="3" height="2"/>
21792184
<color key="backgroundColor" red="0.11764705882352941" green="0.11764705882352941" blue="0.11764705882352941" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/>

Application/Info.plist

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<key>CFBundlePackageType</key>
2626
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
2727
<key>CFBundleShortVersionString</key>
28-
<string>1.0</string>
28+
<string>$(MARKETING_VERSION)</string>
2929
<key>CFBundleSupportedPlatforms</key>
3030
<array>
3131
<string>MacOSX</string>
@@ -46,6 +46,12 @@
4646
<true/>
4747
<key>NSSupportsSuddenTermination</key>
4848
<true/>
49+
<key>SUFeedURL</key>
50+
<string>https://sbarex.github.io/SourceCodeSyntaxHighlight/appcast.xml</string>
51+
<key>SUPublicEDKey</key>
52+
<string>J+ikFQXeR6eaUV0jvyfZAJKeYh+9UKGJuD/kJSIXnZk=</string>
53+
<key>SUScheduledCheckInterval</key>
54+
<integer>604800</integer>
4955
<key>UTExportedTypeDeclarations</key>
5056
<array>
5157
<dict>

Application/PreferencesViewController.swift

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,6 @@ class PreferencesViewController: NSViewController {
640640
}
641641

642642
self.view.window?.styleMask.remove(NSWindow.StyleMask.closable)
643-
644643
saveButton.isEnabled = false
645644
cancelButton.isEnabled = false
646645

@@ -651,9 +650,10 @@ class PreferencesViewController: NSViewController {
651650
self.isDirty = false
652651
self.view.window?.styleMask.insert(NSWindow.StyleMask.closable)
653652

654-
//if (NSApplication.shared.delegate as? AppDelegate)?.documentsOpenedAtStart ?? false {
655-
self.view.window?.performClose(sender)
656-
//}
653+
if let w = self.view.window?.windowController as? PreferencesWindowController {
654+
w.askToSave = false
655+
}
656+
self.view.window?.performClose(sender)
657657
}
658658
}
659659
}
@@ -1009,6 +1009,7 @@ extension PreferencesViewController: NSTouchBarDelegate {
10091009

10101010
// MARK: - PreferencesWindowController
10111011
class PreferencesWindowController: NSWindowController, NSWindowDelegate {
1012+
var askToSave = true
10121013
func windowShouldClose(_ sender: NSWindow) -> Bool {
10131014
guard let contentViewController = self.contentViewController as? PreferencesViewController else {
10141015
return true
@@ -1018,7 +1019,7 @@ class PreferencesWindowController: NSWindowController, NSWindowDelegate {
10181019
} else {
10191020
contentViewController.saveGlobalSettings()
10201021
}
1021-
if contentViewController.isDirty {
1022+
if self.askToSave && contentViewController.isDirty {
10221023
let alert = NSAlert()
10231024
alert.alertStyle = .warning
10241025
alert.messageText = "There are some modified settings"

Application/SCSHApp.entitlements

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>com.apple.security.get-task-allow</key>
6-
<true/>
7-
<key>com.apple.security.app-sandbox</key>
5+
<key>com.apple.security.app-sandbox</key>
86
<true/>
97
<key>com.apple.security.automation.apple-events</key>
108
<true/>
119
<key>com.apple.security.files.user-selected.read-write</key>
1210
<true/>
11+
<key>com.apple.security.get-task-allow</key>
12+
<true/>
1313
<key>com.apple.security.inherit</key>
1414
<true/>
1515
<key>com.apple.security.network.client</key>

CHANGELOG.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
1.0.b29
2-
Bugfix:
3-
- fix bug on save settings.
4-
51
1.0.b29
62
New features:
73
- toolbar and touchbar for access to the inquiry and themes window.

QLExtension/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0</string>
18+
<string>$(MARKETING_VERSION)</string>
1919
<key>CFBundleSupportedPlatforms</key>
2020
<array>
2121
<string>MacOSX</string>

SourceCodeSyntaxHighlight.xcodeproj/project.pbxproj

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,7 @@
13061306
CODE_SIGN_IDENTITY = "-";
13071307
CODE_SIGN_STYLE = Manual;
13081308
COMBINE_HIDPI_IMAGES = YES;
1309-
CURRENT_PROJECT_VERSION = 30;
1309+
CURRENT_PROJECT_VERSION = 29;
13101310
DEVELOPMENT_TEAM = "";
13111311
ENABLE_HARDENED_RUNTIME = YES;
13121312
FRAMEWORK_SEARCH_PATHS = (
@@ -1318,6 +1318,7 @@
13181318
"$(inherited)",
13191319
"@executable_path/../Frameworks",
13201320
);
1321+
MARKETING_VERSION = 1.0;
13211322
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight;
13221323
PRODUCT_NAME = "$(TARGET_NAME)";
13231324
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1334,7 +1335,7 @@
13341335
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
13351336
CODE_SIGN_STYLE = Manual;
13361337
COMBINE_HIDPI_IMAGES = YES;
1337-
CURRENT_PROJECT_VERSION = 30;
1338+
CURRENT_PROJECT_VERSION = 29;
13381339
DEVELOPMENT_TEAM = "";
13391340
ENABLE_HARDENED_RUNTIME = YES;
13401341
FRAMEWORK_SEARCH_PATHS = (
@@ -1346,6 +1347,7 @@
13461347
"$(inherited)",
13471348
"@executable_path/../Frameworks",
13481349
);
1350+
MARKETING_VERSION = 1.0;
13491351
OTHER_CODE_SIGN_FLAGS = "--timestamp";
13501352
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight;
13511353
PRODUCT_NAME = "$(TARGET_NAME)";
@@ -1360,15 +1362,20 @@
13601362
CODE_SIGN_ENTITLEMENTS = QLExtension/QLExtension.entitlements;
13611363
CODE_SIGN_IDENTITY = "-";
13621364
CODE_SIGN_STYLE = Manual;
1363-
CURRENT_PROJECT_VERSION = 30;
1365+
CURRENT_PROJECT_VERSION = 29;
13641366
DEVELOPMENT_TEAM = "";
13651367
ENABLE_HARDENED_RUNTIME = YES;
1368+
FRAMEWORK_SEARCH_PATHS = (
1369+
"$(inherited)",
1370+
"$(PROJECT_DIR)",
1371+
);
13661372
INFOPLIST_FILE = QLExtension/Info.plist;
13671373
LD_RUNPATH_SEARCH_PATHS = (
13681374
"$(inherited)",
13691375
"@executable_path/../Frameworks",
13701376
"@executable_path/../../../../Frameworks",
13711377
);
1378+
MARKETING_VERSION = 1.0;
13721379
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.QuicklookExtension;
13731380
PRODUCT_NAME = "$(TARGET_NAME)";
13741381
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1384,15 +1391,20 @@
13841391
CODE_SIGN_IDENTITY = "-";
13851392
CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
13861393
CODE_SIGN_STYLE = Manual;
1387-
CURRENT_PROJECT_VERSION = 30;
1394+
CURRENT_PROJECT_VERSION = 29;
13881395
DEVELOPMENT_TEAM = "";
13891396
ENABLE_HARDENED_RUNTIME = YES;
1397+
FRAMEWORK_SEARCH_PATHS = (
1398+
"$(inherited)",
1399+
"$(PROJECT_DIR)",
1400+
);
13901401
INFOPLIST_FILE = QLExtension/Info.plist;
13911402
LD_RUNPATH_SEARCH_PATHS = (
13921403
"$(inherited)",
13931404
"@executable_path/../Frameworks",
13941405
"@executable_path/../../../../Frameworks",
13951406
);
1407+
MARKETING_VERSION = 1.0;
13961408
OTHER_CODE_SIGN_FLAGS = "--timestamp";
13971409
PRODUCT_BUNDLE_IDENTIFIER = org.sbarex.SourceCodeSyntaxHighlight.QuicklookExtension;
13981410
PRODUCT_NAME = "$(TARGET_NAME)";
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.get-task-allow</key>
6+
<true/>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)