feat: add warning for email-less feedback
This commit is contained in:
1 parent
0bdf56bf63
commit
1acd918511
16 files changed
+43
-19
No files matched your search
@@ -31,6 +31,9 @@
|
||||
/* No comment provided by engineer. */
|
||||
"Appearance" = "Appearance";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Are you sure you don’t want a response?" = "Are you sure you don’t want a response?";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Arrow keys" = "Arrow keys";
|
||||
|
||||
@@ -59,7 +62,7 @@
|
||||
"Close window" = "Close window";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Don't check for updates periodically" = "Don't check for updates periodically";
|
||||
"Don’t check for updates periodically" = "Don’t check for updates periodically";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"General" = "General";
|
||||
@@ -139,6 +142,9 @@
|
||||
/* No comment provided by engineer. */
|
||||
"Send" = "Send";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Send anyway" = "Send anyway";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Send debug profile (CPU, memory, etc)" = "Send debug profile (CPU, memory, etc)";
|
||||
|
||||
@@ -190,6 +196,9 @@
|
||||
/* No comment provided by engineer. */
|
||||
"Window title font size:" = "Window title font size:";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"You didn’t write your email, thus can’t receive any response." = "You didn’t write your email, thus can’t receive any response.";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"❖ Windows 10" = "❖ Windows 10";
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "Fenster schließen";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "Nicht regelmäßig nach Updates suchen";
|
||||
"Don’t check for updates periodically" = "Nicht regelmäßig nach Updates suchen";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "Allgemein";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "Close window";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "Don’t check for updates periodically";
|
||||
"Don’t check for updates periodically" = "Don’t check for updates periodically";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "General";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "Cerrar ventana";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "No comprobar actualizaciones periódicamente";
|
||||
"Don’t check for updates periodically" = "No comprobar actualizaciones periódicamente";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "General";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "Sulje ikkuna";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "Älä tarkista päivityksiä";
|
||||
"Don’t check for updates periodically" = "Älä tarkista päivityksiä";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "Yleinen";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "Fermer la fenêtre";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "Ne pas chercher de mise-à-jour périodiquement";
|
||||
"Don’t check for updates periodically" = "Ne pas chercher de mise-à-jour périodiquement";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "Général";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "Ablak bezárása";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "Ne keressen frissítéseket automatikusan";
|
||||
"Don’t check for updates periodically" = "Ne keressen frissítéseket automatikusan";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "Általános";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "Chiudi la finestra";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "Non controllare gli aggiornamenti periodicamente";
|
||||
"Don’t check for updates periodically" = "Non controllare gli aggiornamenti periodicamente";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "Generale";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "ウィンドウを閉じる";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "定期的に更新を確認しない";
|
||||
"Don’t check for updates periodically" = "定期的に更新を確認しない";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "一般設定";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "창 닫기";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "주기적으로 업데이트를 확인하지 않기";
|
||||
"Don’t check for updates periodically" = "주기적으로 업데이트를 확인하지 않기";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "일반";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "Fechar janela";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "Não verifique periodicamente por atualizações";
|
||||
"Don’t check for updates periodically" = "Não verifique periodicamente por atualizações";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "Geral";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "Pencereyi kapat";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "Güncellemeleri periyodik olarak kontrol etme";
|
||||
"Don’t check for updates periodically" = "Güncellemeleri periyodik olarak kontrol etme";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "Genel";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "关闭窗口";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "不要自动检查更新";
|
||||
"Don’t check for updates periodically" = "不要自动检查更新";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "通用";
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
"Close window" = "關閉視窗";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"Don't check for updates periodically" = "不要定期自動檢查更新";
|
||||
"Don’t check for updates periodically" = "不要定期自動檢查更新";
|
||||
|
||||
/*No comment provided by engineer.*/
|
||||
"General" = "一般";
|
||||
|
||||
@@ -63,13 +63,18 @@ class FeedbackWindow: NSWindow {
|
||||
contentView = view
|
||||
}
|
||||
|
||||
@objc
|
||||
private func cancelCallback() {
|
||||
@objc private func cancelCallback() {
|
||||
close()
|
||||
}
|
||||
|
||||
@objc
|
||||
private func sendCallback() {
|
||||
@objc private func sendCallback() {
|
||||
if email.stringValue.isEmpty && !warnAboutNoEmail() {
|
||||
return
|
||||
}
|
||||
openTicket()
|
||||
}
|
||||
|
||||
func openTicket() {
|
||||
URLSession.shared.dataTask(with: prepareRequest(), completionHandler: { data, response, error in
|
||||
if error != nil || response == nil || (response as! HTTPURLResponse).statusCode != 201 {
|
||||
debugPrint("HTTP call failed:", response ?? "nil", error ?? "nil")
|
||||
@@ -78,6 +83,16 @@ class FeedbackWindow: NSWindow {
|
||||
close()
|
||||
}
|
||||
|
||||
func warnAboutNoEmail() -> Bool {
|
||||
let alert = NSAlert()
|
||||
alert.alertStyle = .warning
|
||||
alert.messageText = NSLocalizedString("Are you sure you don’t want a response?", comment: "")
|
||||
alert.informativeText = NSLocalizedString("You didn’t write your email, thus can’t receive any response.", comment: "")
|
||||
alert.addButton(withTitle: NSLocalizedString("Send anyway", comment: ""))
|
||||
alert.addButton(withTitle: NSLocalizedString("Cancel", comment: ""))
|
||||
return alert.runModal() == NSApplication.ModalResponse.alertFirstButtonReturn
|
||||
}
|
||||
|
||||
private func prepareRequest() -> URLRequest {
|
||||
var request = URLRequest(url: URL(string: "https://api.github.com/repos/lwouis/alt-tab-macos/issues")!)
|
||||
request.httpMethod = "POST"
|
||||
|
||||
@@ -14,7 +14,7 @@ class UpdatesTab: NSViewController, PreferencePane {
|
||||
var policyLock = false
|
||||
|
||||
override func loadView() {
|
||||
dontPeriodicallyCheck = NSButton(radioButtonWithTitle: NSLocalizedString("Don't check for updates periodically", comment: ""), target: self, action: #selector(updatePolicyCallback))
|
||||
dontPeriodicallyCheck = NSButton(radioButtonWithTitle: NSLocalizedString("Don’t check for updates periodically", comment: ""), target: self, action: #selector(updatePolicyCallback))
|
||||
dontPeriodicallyCheck.fit()
|
||||
periodicallyCheck = NSButton(radioButtonWithTitle: NSLocalizedString("Check for updates periodically", comment: ""), target: self, action: #selector(updatePolicyCallback))
|
||||
periodicallyCheck.fit()
|
||||
|
||||
Reference in new issue
Block a user