MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / postSet

Method postSet

src/main/controller.ts:207–259  ·  view source on GitHub ↗
(identifier: Identifier, value: any)

Source from the content-addressed store, hash-verified

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();

Callers

nothing calls this directly

Calls 9

showDragCopyWarningFunction · 0.90
syncBoundsMethod · 0.80
setIgnoreMouseEventsMethod · 0.80
updateLocaleMethod · 0.80
registerPostStartMethod · 0.80
setStayTopMethod · 0.80
showCurrentChangelogMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected