@@ -55,85 +55,16 @@ const triggerKey = config.get('shortcuts.trigger', 'Space');
5555const hideKey = config . get ( 'shortcuts.hide' , 'Escape' ) ;
5656const myEmitter = new EventEmitter ( ) ;
5757
58- function applyAutoStartSetting ( ) {
59- const autoStartEnabled = config . get ( 'startup.autoStart' , false ) ;
60- Logger . info ( `Applying auto-start setting. Enabled: ${ autoStartEnabled } ` ) ;
61- // This API is cross-platform and handles the underlying OS specifics.
62- app . setLoginItemSettings ( {
63- openAtLogin : autoStartEnabled ,
64- path : app . getPath ( 'exe' ) // This is used by Windows and ignored by others.
65- } ) ;
66- }
67-
68- // // Add service management to tray menu
69- // const contextMenu = Menu.buildFromTemplate([
70- // {
71- // label: 'KK Setup',
72- // click: () => { windowManager.hideAll(true); showSetupWizard(); }
73- // },
74- // { type: 'separator' },
75- // {
76- // label: 'LLM Models',
77- // submenu: [
78- // {
79- // label: 'Configure Providers',
80- // click: () => showSetupWizard()
81- // },
82- // { type: 'separator' },
83- // {
84- // label: 'Loading providers...',
85- // enabled: false
86- // }
87- // ]
88- // },
89- // { type: 'separator' },
90- // {
91- // label: 'Show',
92- // click: () => windowManager.showAll()
93- // },
94- // {
95- // label: 'Hide',
96- // click: () => windowManager.hideAll(true)
97- // },
98- // { type: 'separator' },
99- // {
100- // label: 'Check for Updates',
101- // click: () => checkForUpdates(true)
102- // },
103- // { type: 'separator' },
104- // {
105- // label: 'Help',
106- // click: () => {
107- // const comRing = windowManager.getWindow('comRing');
108- // if (comRing) {
109- // if (!comRing.isVisible()) {
110- // windowManager.showAll();
111- // }
112- // comRing.send('show-help');
113- // }
114- // }
115- // },
116- // {
117- // label: 'About',
118- // click: () => {
119- // const comRing = windowManager.getWindow('comRing');
120- // if (comRing) {
121- // if (!comRing.isVisible()) {
122- // windowManager.showAll();
123- // }
124- // comRing.send('show-about');
125- // }
126- // }
127- // },
128- // { type: 'separator' },
129- // {
130- // label: 'Quit',
131- // click: () => {
132- // app.isQuitting = true;
133- // app.quit();
134- // }
135- // }
136- // ]);
58+ // TODO delayed to v0.10
59+ // function applyAutoStartSetting() {
60+ // const autoStartEnabled = config.get('startup.autoStart', false);
61+ // Logger.info(`Applying auto-start setting. Enabled: ${autoStartEnabled}`);
62+ // // This API is cross-platform and handles the underlying OS specifics.
63+ // app.setLoginItemSettings({
64+ // openAtLogin: autoStartEnabled,
65+ // path: app.getPath('exe') // This is used by Windows and ignored by others.
66+ // });
67+ // }
13768
13869// Check if this is the first run of the application
13970function isFirstRun ( ) {
@@ -143,9 +74,7 @@ function isFirstRun() {
14374// Show the setup wizard for first-time users
14475function showSetupWizard ( validationErrors = [ ] ) {
14576 console . trace ( ) ;
146- if ( validationErrors && validationErrors . length > 0 ) {
147- // ServiceManager.stopServices({ force: true });
148- // app.exit(1)
77+ if ( validationErrors && validationErrors . length > 0 && config . get ( "setup.completed" , false ) ) {
14978 Logger . warn ( 'Configuration validation failed, invalidating setup.complete because of these errors:' , validationErrors ) ;
15079 config . set ( "setup.completed" , false ) ;
15180 } else {
@@ -200,14 +129,14 @@ function showSetupWizard(validationErrors = []) {
200129 setupWindow . loadFile ( path . join ( __dirname , 'components' , 'setup.html' ) ) ;
201130
202131 setupWindow . once ( 'ready-to-show' , ( ) => {
203- setupWindow . show ( ) ;
204- if ( validationErrors && validationErrors . length > 0 ) {
132+ if ( validationErrors && validationErrors . length > 0 && config . get ( "setup.completed" , false ) ) {
205133 dialog . showErrorBox (
206134 'Configuration Error' ,
207135 'The configuration is missing some required values. The setup wizard will now launch. Error(s):\n\n' + validationErrors ,
208136 // 'The configuration file contains the following errors:\n\n' + validationErrors + "\n\nThe setup wizard will be opened now."
209137 ) ;
210138 }
139+ setupWindow . show ( ) ;
211140 // // Pass validation errors to the wizard window
212141 // if (validationErrors && validationErrors.length > 0) {
213142 // setupWindow.webContents.send('config-validation-errors', validationErrors);
@@ -394,8 +323,8 @@ async function appInitialization() {
394323 app . isQuitting = false ;
395324 await app . whenReady ( ) ;
396325
397- // Apply auto-start setting on launch
398- applyAutoStartSetting ( ) ;
326+ // // Apply auto-start setting on launch
327+ // applyAutoStartSetting();
399328
400329 // Initialize Ollama client
401330 initializeOllamaClient ( ) ;
@@ -1092,10 +1021,10 @@ function appSetupEventHandlers() {
10921021 shell . openExternal ( url ) ;
10931022 } ) ;
10941023
1095- // Handle auto-start setting changes from setup wizard
1096- ipcMain . on ( 'set-auto-start' , ( ) => {
1097- applyAutoStartSetting ( ) ;
1098- } ) ;
1024+ // // Handle auto-start setting changes from setup wizard
1025+ // ipcMain.on('set-auto-start', () => {
1026+ // applyAutoStartSetting();
1027+ // });
10991028
11001029 // Handle backup directory selection from setup wizard
11011030 ipcMain . on ( 'select-backup-directory' , async ( event ) => {
0 commit comments