(identifier: Identifier, value: any)
| 205 | } |
| 206 | |
| 207 | postSet(identifier: Identifier, value: any): boolean { |
| 208 | switch (identifier) { |
| 209 | case "layoutType": |
| 210 | this.win.syncBounds(); |
| 211 | break; |
| 212 | case "ignoreMouseEvents": |
| 213 | this.win.setIgnoreMouseEvents(value as boolean); |
| 214 | break; |
| 215 | case "localeSetting": |
| 216 | this.l10n.updateLocale(this.get("localeSetting")); |
| 217 | break; |
| 218 | case "dragCopy": |
| 219 | if (value == true) { |
| 220 | if ( |
| 221 | this.get<DragCopyMode>("dragCopyMode") === "dragCopyGlobal" && |
| 222 | !this.get("neverShow") |
| 223 | ) { |
| 224 | //只在全局模式才show出来 |
| 225 | this.win.registerPostStart(() => showDragCopyWarning(this)); |
| 226 | } |
| 227 | if ( |
| 228 | this.get<DragCopyMode>("dragCopyMode") === "dragCopyWhiteList" && |
| 229 | this.get<string[]>("dragCopyWhiteList").length == 0 //白名单模式且白名单为空则警告 |
| 230 | ) { |
| 231 | this.win.registerPostStart(() => |
| 232 | showDragCopyEmptyWhitelistWarning(this) |
| 233 | ); |
| 234 | } |
| 235 | } |
| 236 | break; |
| 237 | case "stayTop": |
| 238 | this.win.registerPostStart(() => this.win.setStayTop(value)); |
| 239 | break; |
| 240 | case "skipTaskbar": |
| 241 | this.win.registerPostStart(() => |
| 242 | this.win.mainWindow.setSkipTaskbar(value) |
| 243 | ); |
| 244 | break; |
| 245 | case "openAtLogin": |
| 246 | app.setLoginItemSettings({ |
| 247 | openAtLogin: value, |
| 248 | }); |
| 249 | break; |
| 250 | case "isNewUser": |
| 251 | if (value) { |
| 252 | this.updater.showCurrentChangelog(); |
| 253 | } |
| 254 | break; |
| 255 | default: |
| 256 | return false; |
| 257 | } |
| 258 | return true; |
| 259 | } |
| 260 | |
| 261 | resotreDefaultSetting() { |
| 262 | resetAllConfig(); |
nothing calls this directly
no test coverage detected