Skip to content

Commit 7b9b8ec

Browse files
committed
New: Option to start OpenComic in startup (Windows and macOS only)
1 parent ec3cb12 commit 7b9b8ec

File tree

10 files changed

+37
-9
lines changed

10 files changed

+37
-9
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1313
- Show image in its original size [`30df2fc`](https://github.com/ollm/OpenComic/commit/30df2fc70dbaefecfe1942bc8032686e083e7d53)
1414
- Show in first/last page buttons if has next/prev comic and go to next/prev comics scrolling [`2a3796e`](https://github.com/ollm/OpenComic/commit/2a3796eb82cdc86c70c69cae62e48da9baf41aa0)
1515
- Improve the detection of the type of compressed files if the file extension is not correct [`b39605c`](https://github.com/ollm/OpenComic/commit/b39605c5d5ab72742cf32f14a23004976cccec7c)
16+
- Option to start OpenComic in startup (Windows and macOS only)
1617

1718
##### 🐛 Bug Fixes
1819

languages/ca.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@
123123
},
124124
"others": {
125125
"main": "Altres configuracions",
126-
"startInFullScreen": "Inicia OpenComic a pantalla completa"
126+
"startInFullScreen": "Inicia OpenComic a pantalla completa",
127+
"startOnStartup": "Iniciar OpenComic a l'inici",
127128
},
128129
"releases": {
129130
"main": "Comprovar noves versions",

languages/en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@
123123
},
124124
"others": {
125125
"main": "Others settings",
126-
"startInFullScreen": "Start OpenComic in full screen"
126+
"startInFullScreen": "Start OpenComic in full screen",
127+
"startOnStartup": "Start OpenComic on startup"
127128
},
128129
"releases": {
129130
"main": "Check for new versions",

languages/es.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@
123123
},
124124
"others": {
125125
"main": "Otros ajustes",
126-
"startInFullScreen": "Inicial OpenComic en pantalla completa"
126+
"startInFullScreen": "Iniciar OpenComic en pantalla completa",
127+
"startOnStartup": "Iniciar OpenComic al inicio"
127128
},
128129
"releases": {
129130
"main": "Comprobar nuevas versiones",

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
},
8484
"devDependencies": {
8585
"@electron/rebuild": "^3.2.13",
86-
"electron": "^27.0.0-beta.1",
86+
"electron": "^27.0.0-beta.2",
8787
"electron-builder": "^24.6.3",
8888
"node-abi": "^3.46.0",
8989
"nodemon": "^3.0.1"

scripts/main.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const {app, BrowserWindow, Menu, nativeImage} = require('electron');
1+
const {app, ipcMain, BrowserWindow, Menu, nativeImage} = require('electron');
22
const path = require('path');
33
const url = require('url');
44
const windowStateKeeper = require('electron-window-state');
@@ -138,6 +138,14 @@ app.on('activate', () => {
138138
}
139139
})
140140

141+
ipcMain.on('open-at-login', function(event, active = false){
142+
143+
app.setLoginItemSettings({
144+
openAtLogin: active,
145+
})
146+
147+
});
148+
141149
// In this file you can include the rest of your app's specific main process
142150
// code. You can also put them in separate files and require them here.
143151

scripts/settings.js

+7
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@ function setStartInFullScreen(value)
186186
storage.updateVar('config', 'startInFullScreen', value);
187187
}
188188

189+
function setStartOnStartup(value)
190+
{
191+
storage.updateVar('config', 'startOnStartup', value);
192+
electron.ipcRenderer.send('open-at-login', value);
193+
}
194+
189195
function setCheckReleases(value)
190196
{
191197
storage.updateVar('config', 'checkReleases', value);
@@ -206,6 +212,7 @@ module.exports = {
206212
setShowFullPathLibrary: setShowFullPathLibrary,
207213
setShowFullPathOpened: setShowFullPathOpened,
208214
setStartInFullScreen: setStartInFullScreen,
215+
setStartOnStartup: setStartOnStartup,
209216
setCheckReleases: setCheckReleases,
210217
setCheckPreReleases: setCheckPreReleases,
211218
changeShortcut: changeShortcut,

scripts/storage.js

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ var storageDefault = {
6666
readingGlobalZoom: true,
6767
controllerDeadZone: 0.06,
6868
startInFullScreen: false,
69+
startOnStartup: false,
6970
renderMaxWidth: 12000,
7071
checkReleases: true,
7172
checkPreReleases: true,

templates/settings.content.right.html

+8
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ <h2 class="headline-small">{{language.settings.others.main}}</h2>
6868
</div>
6969
</div>
7070

71+
<div class="menu-simple-text gamepad-item">
72+
{{language.settings.others.startOnStartup}} (Windows and macOS)
73+
<div class="switch{{#if config.startOnStartup}} a{{/if}}" on="settings.setStartOnStartup(true)" off="settings.setStartOnStartup(false)">
74+
<div></div>
75+
<svg viewBox="0 0 52 32"><path d="M 8,0 C 3.58,0 0,3.58 0,8 0,12.42 3.58,16 8,16 8,16 8,16 8,16 12.42,16 16,12.42 16,8 16,3.58 12.42,0 8,0 8,0 8,0 8,0 Z"></path></svg>
76+
</div>
77+
</div>
78+
7179
<h2 class="headline-small">{{language.settings.releases.main}}</h2>
7280

7381
<div class="menu-simple-text gamepad-item">

0 commit comments

Comments
 (0)