Skip to content

Commit

Permalink
Add confirmation dialog for stopping configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
koho committed Nov 19, 2023
1 parent a8ec3c2 commit 7aecf04
Show file tree
Hide file tree
Showing 8 changed files with 534 additions and 329 deletions.
654 changes: 335 additions & 319 deletions i18n/catalog.go

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions i18n/locales/en-US/messages.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,40 @@
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Stop config \"{Name}\"",
"message": "Stop config \"{Name}\"",
"translation": "Stop config \"{Name}\"",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
],
"fuzzy": true
},
{
"id": "Are you sure you would like to stop config \"{Name}\"?",
"message": "Are you sure you would like to stop config \"{Name}\"?",
"translation": "Are you sure you would like to stop config \"{Name}\"?",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
],
"fuzzy": true
},
{
"id": "Stop",
"message": "Stop",
Expand Down
30 changes: 30 additions & 0 deletions i18n/locales/es-ES/messages.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,36 @@
"message": "Service",
"translation": "Servicio"
},
{
"id": "Stop config \"{Name}\"",
"message": "Stop config \"{Name}\"",
"translation": "Detener configuración \"{Name}\"",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
]
},
{
"id": "Are you sure you would like to stop config \"{Name}\"?",
"message": "Are you sure you would like to stop config \"{Name}\"?",
"translation": "¿Está seguro de que desea detener la configuración \"{Name}\"?",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
]
},
{
"id": "Stop",
"message": "Stop",
Expand Down
50 changes: 40 additions & 10 deletions i18n/locales/ja-JP/messages.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
{
"id": "Another config already exists with the name \"{BaseName}\".",
"message": "Another config already exists with the name \"{BaseName}\".",
"translation": "\"{BaseName}\" という名前の別の設定が既に存在します。",
"translation": "{BaseName}という名前の別の設定が既に存在します。",
"placeholders": [
{
"id": "BaseName",
Expand All @@ -332,7 +332,7 @@
{
"id": "The file \"{Path}\" is not a valid ZIP file.",
"message": "The file \"{Path}\" is not a valid ZIP file.",
"translation": "ファイル \"{Path}\" は有効なZIPファイルではありません",
"translation": "ファイル{Path}」は有効な ZIP ファイルではありません",
"placeholders": [
{
"id": "Path",
Expand All @@ -347,7 +347,7 @@
{
"id": "Delete config \"{Name}\"",
"message": "Delete config \"{Name}\"",
"translation": "設定 \"{Name}\" を削除",
"translation": "設定{Name}を削除",
"placeholders": [
{
"id": "Name",
Expand All @@ -362,7 +362,7 @@
{
"id": "Are you sure you would like to delete config \"{Name}\"?",
"message": "Are you sure you would like to delete config \"{Name}\"?",
"translation": "本当に設定 \"{Name}\" を削除しますか?",
"translation": "設定「{Name}」を削除してもよろしいですか?",
"placeholders": [
{
"id": "Name",
Expand Down Expand Up @@ -747,7 +747,7 @@
{
"id": "The config name \"{Name}\" already exists.",
"message": "The config name \"{Name}\" already exists.",
"translation": "設定名 \"{Name}\" は既に存在します",
"translation": "設定名{Name}」はすでに存在します",
"placeholders": [
{
"id": "Name",
Expand Down Expand Up @@ -1047,7 +1047,7 @@
{
"id": "The proxy name \"{Name}\" already exists.",
"message": "The proxy name \"{Name}\" already exists.",
"translation": "プロキシ名 \"{Name}\" は既に存在します",
"translation": "プロキシ名{Name}」はすでに存在します",
"placeholders": [
{
"id": "Name",
Expand Down Expand Up @@ -1159,6 +1159,36 @@
"message": "Service",
"translation": "サービス"
},
{
"id": "Stop config \"{Name}\"",
"message": "Stop config \"{Name}\"",
"translation": "設定「{Name}」を停止します",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
]
},
{
"id": "Are you sure you would like to stop config \"{Name}\"?",
"message": "Are you sure you would like to stop config \"{Name}\"?",
"translation": "設定「{Name}」を停止してもよろしいですか?",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
]
},
{
"id": "Stop",
"message": "Stop",
Expand Down Expand Up @@ -1317,7 +1347,7 @@
{
"id": "Delete proxy \"{Name}\"",
"message": "Delete proxy \"{Name}\"",
"translation": "プロキシ \"{Name}\" を削除します",
"translation": "プロキシ{Name}を削除します",
"placeholders": [
{
"id": "Name",
Expand All @@ -1332,7 +1362,7 @@
{
"id": "Are you sure you would like to delete proxy \"{Name}\"?",
"message": "Are you sure you would like to delete proxy \"{Name}\"?",
"translation": "本当にプロキシ \"{Name}\" を削除しますか?",
"translation": "プロキシ「{Name}」を削除してもよろしいですか?",
"placeholders": [
{
"id": "Name",
Expand All @@ -1347,7 +1377,7 @@
{
"id": "Disable proxy \"{Name}\"",
"message": "Disable proxy \"{Name}\"",
"translation": "プロキシ \"{Name}\" を無効にする",
"translation": "プロキシ{Name}を無効にする",
"placeholders": [
{
"id": "Name",
Expand All @@ -1362,7 +1392,7 @@
{
"id": "Are you sure you would like to disable proxy \"{Name}\"?",
"message": "Are you sure you would like to disable proxy \"{Name}\"?",
"translation": "プロキシ \"{Name}\" を無効にしてもよろしいですか",
"translation": "プロキシ{Name}を無効にしてもよろしいですか?",
"placeholders": [
{
"id": "Name",
Expand Down
30 changes: 30 additions & 0 deletions i18n/locales/ko-KR/messages.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,36 @@
"message": "Service",
"translation": "서비스"
},
{
"id": "Stop config \"{Name}\"",
"message": "Stop config \"{Name}\"",
"translation": "\"{Name}\" 구성 중지",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
]
},
{
"id": "Are you sure you would like to stop config \"{Name}\"?",
"message": "Are you sure you would like to stop config \"{Name}\"?",
"translation": "\"{Name}\" 구성을 중지하시겠습니까?",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
]
},
{
"id": "Stop",
"message": "Stop",
Expand Down
30 changes: 30 additions & 0 deletions i18n/locales/zh-CN/messages.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,36 @@
"message": "Service",
"translation": "服务"
},
{
"id": "Stop config \"{Name}\"",
"message": "Stop config \"{Name}\"",
"translation": "停止配置「{Name}」",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
]
},
{
"id": "Are you sure you would like to stop config \"{Name}\"?",
"message": "Are you sure you would like to stop config \"{Name}\"?",
"translation": "确定要停止配置「{Name}」吗?",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
]
},
{
"id": "Stop",
"message": "Stop",
Expand Down
30 changes: 30 additions & 0 deletions i18n/locales/zh-TW/messages.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,36 @@
"message": "Service",
"translation": "服務"
},
{
"id": "Stop config \"{Name}\"",
"message": "Stop config \"{Name}\"",
"translation": "停止配置「{Name}」",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
]
},
{
"id": "Are you sure you would like to stop config \"{Name}\"?",
"message": "Are you sure you would like to stop config \"{Name}\"?",
"translation": "確定要停止配置「{Name}」嗎?",
"placeholders": [
{
"id": "Name",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "conf.Name"
}
]
},
{
"id": "Stop",
"message": "Stop",
Expand Down
5 changes: 5 additions & 0 deletions ui/panelview.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ func (pv *PanelView) ToggleService() {
}
var err error
if conf.State == consts.StateStarted {
if walk.MsgBox(pv.Form(), i18n.Sprintf("Stop config \"%s\"", conf.Name),
i18n.Sprintf("Are you sure you would like to stop config \"%s\"?", conf.Name),
walk.MsgBoxOKCancel|walk.MsgBoxIconQuestion) == walk.DlgCmdCancel {
return
}
err = pv.StopService(conf)
} else {
err = pv.StartService(conf)
Expand Down

0 comments on commit 7aecf04

Please sign in to comment.