1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- //
- // AppDelegate.swift
- // PDF Reader Pro Pro
- //
- // Created by Niehaoyu on 2022/9/23.
- //
- import Cocoa
- @main
- class AppDelegate: NSObject, NSApplicationDelegate {
-
- func applicationWillFinishLaunching(_ notification: Notification) {
- ComPDFUIConfig.initializeUIConfig();
- }
-
- func applicationDidFinishLaunching(_ aNotification: Notification) {
- // Insert code here to initialize your application
- }
- func applicationWillTerminate(_ aNotification: Notification) {
- // Insert code here to tear down your application
- }
- func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
- return true
- }
- }
- extension AppDelegate : NSMenuDelegate,NSMenuItemValidation {
- func validateMenuItem(_ menuItem: NSMenuItem) -> Bool {
- let action = menuItem.action
- if action == #selector(manageAcctounMenuAction) {
- return KMLightMemberManager.manager.isLogin()
- }
- if action == #selector(loginMenuItemAction) {
- return !KMLightMemberManager.manager.isLogin()
- }
- return true
- }
- }
|