Skip to content

Commit 7f63682

Browse files
Migrated localization.
1 parent d41beaa commit 7f63682

File tree

6 files changed

+13
-18
lines changed

6 files changed

+13
-18
lines changed

Traktor Transition Finder.xcodeproj/project.pbxproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,9 @@
151151
};
152152
buildConfigurationList = CD6B9487BAC72AB0154CB3BF /* Build configuration list for PBXProject "Traktor Transition Finder" */;
153153
compatibilityVersion = "Xcode 3.2";
154-
developmentRegion = English;
154+
developmentRegion = en;
155155
hasScannedForEncodings = 0;
156156
knownRegions = (
157-
English,
158157
en,
159158
Base,
160159
);

Traktor Transition Finder/DragDropViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class DragDropViewController: NSViewController {
8282
}
8383

8484
func selectSong(audioID: String) {
85-
stateController?.incrementSelectedSongs()
85+
stateController?.checkDonationStatus()
8686
transitions = (graph?[audioID]?.1.map { edge in return edge })
8787

8888
if (transitions != nil) {

Traktor Transition Finder/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundleShortVersionString</key>
1818
<string>1.6.6</string>
1919
<key>CFBundleVersion</key>
20-
<string>1</string>
20+
<string>2</string>
2121
<key>LSApplicationCategoryType</key>
2222
<string>public.app-category.music</string>
2323
<key>LSMinimumSystemVersion</key>

Traktor Transition Finder/SongToSongViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class SongToSongViewController: NSViewController {
4747
}
4848

4949
func selectSong(audioID: String, index: Int) {
50-
stateController?.incrementSelectedSongs()
50+
stateController?.checkDonationStatus()
5151
guard index < 2 else { return }
5252
if let song = graph?[audioID]?.0 {
5353
if index == 0 { firstSong = song }

Traktor Transition Finder/StateController.swift

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class StateController {
3232
}
3333
}
3434
var graph: [String: (Song, [Edge])]?
35+
private var openedDialogLast = Date()
3536
private var listeners: [StateSubscriber]
3637

3738
init() {
@@ -43,21 +44,15 @@ class StateController {
4344
listeners.append(listener)
4445
}
4546

46-
func incrementSelectedSongs() {
47-
let before = UserDefaults.standard.integer(forKey: "selectedSongs")
48-
UserDefaults.standard.set(before + 1, forKey: "selectedSongs")
49-
checkDonationStatus()
50-
}
51-
52-
private func checkDonationStatus() {
47+
func checkDonationStatus() {
5348
func openDonateURL() {
5449
let url = URL(string: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ME8E22EZTC5G4&source=url")
5550
NSWorkspace.shared.open(url!)
5651
}
5752

58-
let songCount = UserDefaults.standard.integer(forKey: "selectedSongs")
5953
let donated = UserDefaults.standard.bool(forKey: "alreadyDonated")
60-
if (songCount % 10 == 0 && !donated) {
54+
let interval = DateInterval(start: self.openedDialogLast, end: Date())
55+
if (!donated && interval.duration/60 > 5) {
6156
let alert = NSAlert()
6257
alert.messageText = "Please consider supporting the development of Traktor Transition Finder"
6358
alert.informativeText = "Developing software takes time and ressources. \nPlease consider donating to support the development and improvement of Traktor Transition Finder."
@@ -79,6 +74,7 @@ class StateController {
7974
else {
8075
UserDefaults.standard.set(false, forKey: "alreadyDonated")
8176
}
77+
self.openedDialogLast = Date()
8278
}
8379
}
8480
}

Traktor Transition Finder/Traktor_Transition_Finder.entitlements

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
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.app-sandbox</key>
6-
<true/>
7-
<key>com.apple.security.files.user-selected.read-only</key>
8-
<true/>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.files.user-selected.read-only</key>
8+
<true/>
99
</dict>
1010
</plist>

0 commit comments

Comments
 (0)