code refactor & sync bugfixes
This commit is contained in:
parent
2bcb47076a
commit
9edcc9841b
20 changed files with 820 additions and 812 deletions
|
|
@ -68,18 +68,9 @@ function registerIpc({ getWindow, onGamesChanged }) {
|
|||
ipcMain.handle('settings:set', (e, patch) => library.saveSettings(patch))
|
||||
|
||||
// wines ----------------------------------------------------------------------
|
||||
function systemWine() {
|
||||
let version = ''
|
||||
try {
|
||||
const { execFileSync } = require('child_process')
|
||||
version = String(execFileSync('wine', ['--version'], { timeout: 15000 })).trim().replace(/^wine-?/i, '')
|
||||
} catch {}
|
||||
return { id: 'system', type: 'system', label: 'System Wine', version }
|
||||
}
|
||||
|
||||
ipcMain.handle('wines:list', async () => {
|
||||
await wines.refreshWines()
|
||||
return [systemWine(), ...wines.getWines()]
|
||||
return [wines.systemWine(), ...wines.getWines()]
|
||||
})
|
||||
ipcMain.handle('wines:refresh', async () => (await wines.refreshWines()).filter(w => !w.disabled))
|
||||
ipcMain.handle('wines:setDisabled', (e, id, disabled) => wines.setWineDisabled(id, disabled))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue