Skip to content

Commit

Permalink
Fixed a few UI and other minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
imdatceleste committed Feb 27, 2021
1 parent 0eff630 commit a247950
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 39 deletions.
4 changes: 3 additions & 1 deletion Katip.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1230;
LastUpgradeCheck = 1230;
LastUpgradeCheck = 1240;
TargetAttributes = {
726FB40325BD612F007BEAE9 = {
CreatedOnToolsVersion = 12.3;
Expand Down Expand Up @@ -338,6 +338,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Katip/Katip.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = RVR78FQQ62;
Expand All @@ -360,6 +361,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = Katip/Katip.entitlements;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = RVR78FQQ62;
Expand Down
Binary file not shown.
31 changes: 21 additions & 10 deletions Katip/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -588,15 +588,15 @@
</customObject>
<window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" hidesOnDeactivate="YES" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="75i-ZF-ts9" customClass="NSPanel">
<windowStyleMask key="styleMask" titled="YES" closable="YES" resizable="YES" utility="YES"/>
<rect key="contentRect" x="4265" y="294" width="280" height="311"/>
<rect key="contentRect" x="4265" y="294" width="280" height="377"/>
<rect key="screenRect" x="3840" y="0.0" width="3840" height="2135"/>
<value key="minSize" type="size" width="280" height="311"/>
<view key="contentView" id="605-Dy-7Bi">
<rect key="frame" x="0.0" y="0.0" width="280" height="311"/>
<rect key="frame" x="0.0" y="0.0" width="280" height="377"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView autohidesScrollers="YES" horizontalLineScroll="17" horizontalPageScroll="10" verticalLineScroll="17" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="L8l-jO-Rml">
<rect key="frame" x="20" y="60" width="240" height="207"/>
<rect key="frame" x="20" y="119" width="240" height="207"/>
<clipView key="contentView" id="JEW-J9-wLr">
<rect key="frame" x="1" y="1" width="238" height="205"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand Down Expand Up @@ -635,7 +635,7 @@
</scroller>
</scrollView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="kWH-mr-UXY">
<rect key="frame" x="18" y="275" width="207" height="16"/>
<rect key="frame" x="18" y="341" width="207" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="7El-mi-uLk"/>
Expand All @@ -646,8 +646,19 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" id="wBz-L8-8hJ">
<rect key="frame" x="150" y="13" width="120" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Dismiss" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="6rr-sa-pGN">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<action selector="dismissPreferences:" target="66D-GA-F88" id="YXl-QH-JL2"/>
</connections>
</button>
<button verticalHuggingPriority="750" id="kMb-3R-g4w">
<rect key="frame" x="45" y="13" width="190" height="32"/>
<rect key="frame" x="45" y="72" width="190" height="32"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="push" title="Reset ETA Assumptions..." bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="oXO-Fh-hBu">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
Expand All @@ -662,14 +673,14 @@
<constraint firstItem="L8l-jO-Rml" firstAttribute="leading" secondItem="605-Dy-7Bi" secondAttribute="leading" constant="20" symbolic="YES" id="Dk7-kn-pJv"/>
<constraint firstItem="kWH-mr-UXY" firstAttribute="top" secondItem="605-Dy-7Bi" secondAttribute="top" constant="20" symbolic="YES" id="HX4-iL-uq6"/>
<constraint firstItem="kWH-mr-UXY" firstAttribute="leading" secondItem="605-Dy-7Bi" secondAttribute="leading" constant="20" symbolic="YES" id="Jgz-xB-3yF"/>
<constraint firstItem="kMb-3R-g4w" firstAttribute="top" secondItem="L8l-jO-Rml" secondAttribute="bottom" constant="20" symbolic="YES" id="YYK-Ji-fSB"/>
<constraint firstItem="L8l-jO-Rml" firstAttribute="top" secondItem="kWH-mr-UXY" secondAttribute="bottom" constant="8" symbolic="YES" id="nsd-zU-VXM"/>
<constraint firstItem="L8l-jO-Rml" firstAttribute="top" secondItem="kWH-mr-UXY" secondAttribute="bottom" constant="8" symbolic="YES" id="q2E-dg-5nO"/>
<constraint firstItem="L8l-jO-Rml" firstAttribute="top" secondItem="kWH-mr-UXY" secondAttribute="bottom" constant="8" symbolic="YES" id="tQa-se-TUq"/>
<constraint firstItem="L8l-jO-Rml" firstAttribute="top" secondItem="kWH-mr-UXY" secondAttribute="bottom" constant="15" id="Une-tO-Pho"/>
<constraint firstItem="kMb-3R-g4w" firstAttribute="top" secondItem="L8l-jO-Rml" secondAttribute="bottom" constant="20" symbolic="YES" id="YCg-mO-AhV"/>
<constraint firstItem="L8l-jO-Rml" firstAttribute="leading" secondItem="605-Dy-7Bi" secondAttribute="leading" constant="20" symbolic="YES" id="gcf-ta-cVr"/>
<constraint firstAttribute="trailing" secondItem="L8l-jO-Rml" secondAttribute="trailing" constant="20" symbolic="YES" id="kUS-yZ-fd0"/>
<constraint firstAttribute="trailing" secondItem="L8l-jO-Rml" secondAttribute="trailing" constant="20" symbolic="YES" id="zhQ-kq-uKf"/>
</constraints>
</view>
<point key="canvasLocation" x="-373" y="-971.5"/>
<point key="canvasLocation" x="-373" y="-938.5"/>
</window>
</objects>
</document>
43 changes: 28 additions & 15 deletions Katip/ISOKatip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ class ISOKatip: NSObject, ISOTranscriberDelegate, NSWindowDelegate {
}

func prepareDisplayLocales() {
displayLocales.removeAll()
if let transcriber = self.transcriber, transcriber.recognitionEnabled {
for locale in transcriber.supportedLocales {
displayLocales.append(locale)
Expand Down Expand Up @@ -328,19 +329,36 @@ class ISOKatip: NSObject, ISOTranscriberDelegate, NSWindowDelegate {
// MARK: Preferences
@IBAction func showPreferences(_ : Any) {
var selectedLanguagesSet = IndexSet()
preferencesPanel?.makeKeyAndOrderFront(self)
preferencesPanel?.delegate = self
preferencesLanguagesTable?.delegate = self
preferencesLanguagesTable?.dataSource = self
if let transcriber = self.transcriber, transcriber.recognitionEnabled {
for i in 0..<transcriber.supportedLocales.count {
if displayLocales.contains(transcriber.supportedLocales[i]) {
selectedLanguagesSet.insert(i)
if let mainWindow = mainWindow, let preferencesPanel = preferencesPanel {
preferencesLanguagesTable?.delegate = self
preferencesLanguagesTable?.dataSource = self
if let transcriber = self.transcriber, transcriber.recognitionEnabled {
for i in 0..<transcriber.supportedLocales.count {
if displayLocales.contains(transcriber.supportedLocales[i]) {
selectedLanguagesSet.insert(i)
}
}
}
preferencesLanguagesTable?.reloadData()
preferencesLanguagesTable?.selectRowIndexes(selectedLanguagesSet, byExtendingSelection: false)
mainWindow.beginSheet(preferencesPanel) { response in
}
}
}

@IBAction func dismissPreferences(_ : Any) {
if let selectedLanguages = preferencesLanguagesTable?.selectedRowIndexes, let transcriber = self.transcriber {
storedLocales.removeAll()
for lang in selectedLanguages {
storedLocales.append(transcriber.supportedLocales[lang].identifier)
}
}
preferencesLanguagesTable?.reloadData()
preferencesLanguagesTable?.selectRowIndexes(selectedLanguagesSet, byExtendingSelection: false)
UserDefaults.standard.set(storedLocales, forKey: "SelectedLanguages")
if let mainWindow = mainWindow, let preferencesPanel = preferencesPanel {
mainWindow.endSheet(preferencesPanel)
}
prepareDisplayLocales()
updateLanguagesPopup()
}

@IBAction func resetETAEstimates(_ : Any) {
Expand All @@ -357,9 +375,4 @@ class ISOKatip: NSObject, ISOTranscriberDelegate, NSWindowDelegate {
transcriptionTimeDivider = 1.0
}
}

func windowWillClose(_ notification: Notification) {
prepareDisplayLocales()
updateLanguagesPopup()
}
}
12 changes: 0 additions & 12 deletions Katip/ISOKatpi+NSTableViewDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,4 @@ extension ISOKatip: NSTableViewDelegate {
func selectionShouldChange(in tableView: NSTableView) -> Bool {
true
}

func tableViewSelectionDidChange(_ notification: Notification) {
if let selectedLanguages = preferencesLanguagesTable?.selectedRowIndexes, let transcriber = self.transcriber {
storedLocales.removeAll()
for lang in selectedLanguages {
storedLocales.append(transcriber.supportedLocales[lang].identifier)
}
}
UserDefaults.standard.set(storedLocales, forKey: "SelectedLanguages")
prepareDisplayLocales()
updateLanguagesPopup()
}
}
6 changes: 5 additions & 1 deletion Katip/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Katip</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
Expand All @@ -19,11 +21,13 @@
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>42</string>
<string>79</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (2021) Imdat Solak. All Rights Reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Expand Down

0 comments on commit a247950

Please sign in to comment.