Skip to content

Commit 25a29bb

Browse files
committed
Remove License Controllers
Use Licenses.rtf
1 parent 9be2e83 commit 25a29bb

24 files changed

+89
-975
lines changed

POP Translator/Assets.xcassets/AppIcon.appiconset/Contents.json

-68
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

POP Translator/Assets.xcassets/Contents.json

-6
This file was deleted.

POP Translator/Assets.xcassets/MoreImage.imageset/Contents.json

-26
This file was deleted.
Binary file not shown.
Binary file not shown.
Binary file not shown.

POP Translator/Assets.xcassets/Translator.imageset/Contents.json

-24
This file was deleted.
Binary file not shown.

POP Translator/Base.lproj/Main.storyboard

-812
This file was deleted.

POP Translator/Controller/LicenseViewController.swift

-18
This file was deleted.

POP Translator/Controller/LicenseWindowController.swift

-19
This file was deleted.

POP Translator/Controller/MainViewController.swift

+10-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class MainViewController: NSViewController {
3434
private let mainMenu = NSMenu()
3535

3636
private var observations: [NSKeyValueObservation] = []
37-
37+
3838
deinit {
3939
observations.forEach { NotificationCenter.default.removeObserver($0) }
4040
observations.removeAll()
@@ -90,6 +90,7 @@ class MainViewController: NSViewController {
9090
mainMenu.addItem(NSMenuItem.separator())
9191
translatorMenuItems.forEach { mainMenu.addItem($0) }
9292
mainMenu.addItem(NSMenuItem.separator())
93+
mainMenu.addItem(NSMenuItem(title: "Open Source", action: #selector(openLicense), keyEquivalent: "l"))
9394
mainMenu.addItem(NSMenuItem(title: "Quit", action: #selector(NSApplication.terminate(_:)), keyEquivalent: "q"))
9495

9596
settingButton.menu = mainMenu
@@ -110,6 +111,8 @@ class MainViewController: NSViewController {
110111
loadHome()
111112
case "r":
112113
webView.reload()
114+
case "l":
115+
openLicense()
113116
default:
114117
break
115118
}
@@ -151,6 +154,12 @@ class MainViewController: NSViewController {
151154
}
152155
}
153156
}
157+
158+
@objc private func openLicense() {
159+
if let filePath = Bundle.main.path(forResource: "Licenses", ofType: "rtf") {
160+
NSWorkspace.shared.openFile(filePath, withApplication: "TextEdit")
161+
}
162+
}
154163
}
155164

156165
extension MainViewController: WKUIDelegate {

POP Translator/Controller/PopOverManageController.swift

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class PopOverManageController: NSObject {
1818
let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength)
1919
let popover = NSPopover()
2020
var eventMonitor: EventMonitor?
21-
var eventMonitor2: EventMonitor?
2221

2322
override init() {
2423
super.init()

POP Translator/Resource/Licenses.rtf

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{\rtf1\ansi\ansicpg949\cocoartf1671\cocoasubrtf100
2+
{\fonttbl\f0\fnil\fcharset0 HelveticaNeue-Bold;\f1\fmodern\fcharset0 Courier;\f2\fnil\fcharset0 HelveticaNeue;
3+
}
4+
{\colortbl;\red255\green255\blue255;\red38\green38\blue38;\red0\green0\blue0;\red52\green110\blue183;
5+
}
6+
{\*\expandedcolortbl;;\cssrgb\c20000\c20000\c20000;\cssrgb\c0\c0\c0;\cssrgb\c25490\c51373\c76863;
7+
}
8+
\margl1440\margr1440\vieww9000\viewh8400\viewkind0
9+
\deftab720
10+
\pard\pardeftab720\sl360\partightenfactor0
11+
12+
\f0\b\fs32 \cf2 \expnd0\expndtw0\kerning0
13+
MASShortcut
14+
\f1\b0\fs26 \cf0 \
15+
\pard\pardeftab720\sl360\partightenfactor0
16+
{\field{\*\fldinst{HYPERLINK "https://github.com/shpakovski/MASShortcut"}}{\fldrslt
17+
\f2\fs32 \cf4 \ul \ulc4 https://github.com/shpakovski/MASShortcut}}\
18+
\pard\pardeftab720\partightenfactor0
19+
\cf0 Copyright (c) 2012-2013, Vadim Shpakovski\
20+
All rights reserved.\
21+
\
22+
Redistribution and use in source and binary forms, with or without\
23+
modification, are permitted provided that the following conditions are met:\
24+
\
25+
1. Redistributions of source code must retain the above copyright notice, this\
26+
list of conditions and the following disclaimer.\
27+
2. Redistributions in binary form must reproduce the above copyright notice,\
28+
this list of conditions and the following disclaimer in the documentation\
29+
and/or other materials provided with the distribution.\
30+
\
31+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\
32+
\pard\pardeftab720\sl360\partightenfactor0
33+
\cf0 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\
34+
\pard\pardeftab720\partightenfactor0
35+
\cf0 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\
36+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\
37+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\
38+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\
39+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\
40+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\
41+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\
42+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\
43+
\
44+
\
45+
\pard\pardeftab720\sl380\partightenfactor0
46+
47+
\f0\b\fs32 \cf2 FlagKit\
48+
\pard\pardeftab720\sl360\partightenfactor0
49+
{\field{\*\fldinst{HYPERLINK "https://github.com/madebybowtie/FlagKit"}}{\fldrslt
50+
\f2\b0 \cf4 \ul \ulc4 https://github.com/madebybowtie/FlagKit}}
51+
\f2\b0 \cf4 \ul \ulc4 \
52+
\pard\pardeftab720\partightenfactor0
53+
54+
\f1\fs26 \cf0 \ulnone The MIT License (MIT)\
55+
\
56+
Copyright (c) 2016 Bowtie AB\
57+
\
58+
Permission is hereby granted, free of charge, to any person obtaining a copy\
59+
of this software and associated documentation files (the "Software"), to deal\
60+
in the Software without restriction, including without limitation the rights\
61+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\
62+
copies of the Software, and to permit persons to whom the Software is\
63+
furnished to do so, subject to the following conditions:\
64+
\
65+
The above copyright notice and this permission notice shall be included in all\
66+
copies or substantial portions of the Software.\
67+
\
68+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\
69+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\
70+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\
71+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\
72+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\
73+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\
74+
SOFTWARE.\
75+
\pard\pardeftab720\sl360\partightenfactor0
76+
\cf0 \
77+
\pard\pardeftab720\partightenfactor0
78+
\cf0 \
79+
}

0 commit comments

Comments
 (0)