Skip to content

Commit bddf293

Browse files
authored
Merge pull request #7 from zonayedpca/v0.6.0-beta
V0.6.0 beta
2 parents 3710ae7 + 6cf5f10 commit bddf293

File tree

6 files changed

+54
-44
lines changed

6 files changed

+54
-44
lines changed

app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const iconName =
1818
const iconPath = path.join(__dirname, `./src/assets/img/${iconName}`);
1919

2020
let mainWindow;
21+
// eslint-disable-next-line no-unused-vars
2122
let tray;
2223

2324
app.on('ready', () => {

electron-builder.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ win:
3232
- ia32
3333
publish: ['github']
3434

35+
# Config for the windows installer
36+
nsis:
37+
oneClick: false
38+
3539
# Linux configuration
3640
linux:
3741
icon: 'src/assets/img/iconTemplate.png'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "devtop",
3-
"version": "0.5.0",
3+
"version": "0.6.0",
44
"description": "DevTop - Essential Tools for Developers",
55
"main": "app.js",
66
"author": "Zonayed Ahmed",

src/controller/autoLaunch.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const AutoLaunch = require('auto-launch');
2+
3+
const autoLaunch = () => {
4+
const devTopAutoLauncher = new AutoLaunch({
5+
name: 'DevTop',
6+
});
7+
return devTopAutoLauncher;
8+
};
9+
10+
module.exports = {
11+
autoLaunch,
12+
};

src/controller/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const { autoLaunch } = require('./autoLaunch');
2+
3+
module.exports = {
4+
autoLaunch,
5+
};

src/module/ApplicationTray.js

Lines changed: 31 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
const { app, Tray, Menu, MenuItem, dialog } = require('electron');
2-
const AutoLaunch = require('auto-launch');
1+
const { app, Tray, Menu, MenuItem } = require('electron');
32

43
const { getPosition } = require('../utils');
5-
6-
const devTopAutoLauncher = new AutoLaunch({
7-
name: 'DevTop',
8-
});
4+
const { autoLaunch } = require('../controller');
95

106
class ApplicationTray extends Tray {
117
constructor(iconPath, mainWindow) {
@@ -19,33 +15,37 @@ class ApplicationTray extends Tray {
1915
}
2016

2117
setAutoStart() {
22-
devTopAutoLauncher.isEnabled().then(isEnabled => {
23-
this.autoStart = isEnabled;
24-
});
18+
autoLaunch()
19+
.isEnabled()
20+
.then(isEnabled => {
21+
this.autoStart = isEnabled;
22+
});
2523
}
2624

2725
toggleAutoLaunch() {
28-
devTopAutoLauncher.isEnabled().then(isEnabled => {
29-
if (isEnabled) {
30-
devTopAutoLauncher
31-
.disable()
32-
.then(() => {
33-
this.autoStart = false;
34-
})
35-
.catch(err => {
36-
console.log(err);
37-
});
38-
} else {
39-
devTopAutoLauncher
40-
.enable()
41-
.then(() => {
42-
this.autoStart = true;
43-
})
44-
.catch(err => {
45-
console.log(err);
46-
});
47-
}
48-
});
26+
autoLaunch()
27+
.isEnabled()
28+
.then(isEnabled => {
29+
if (isEnabled) {
30+
autoLaunch()
31+
.disable()
32+
.then(() => {
33+
this.autoStart = false;
34+
})
35+
.catch(err => {
36+
console.log(err);
37+
});
38+
} else {
39+
autoLaunch()
40+
.enable()
41+
.then(() => {
42+
this.autoStart = true;
43+
})
44+
.catch(err => {
45+
console.log(err);
46+
});
47+
}
48+
});
4949
}
5050

5151
onClick() {
@@ -82,19 +82,7 @@ class ApplicationTray extends Tray {
8282
label: 'Check for Updates',
8383
type: 'checkbox',
8484
click: () => {
85-
const dialogOpts = {
86-
type: 'info',
87-
buttons: ['Ok', 'Cancel'],
88-
title: 'Update is coming soon...',
89-
message: 'DevTop Essential Update',
90-
detail:
91-
'Automated update option is going to be implemented in future, please update manually for now.',
92-
};
93-
dialog.showMessageBox(dialogOpts, response => {
94-
if (response === 0) {
95-
console.log('Dialog');
96-
}
97-
});
85+
console.log('Update check will be implemented here...');
9886
},
9987
})
10088
);

0 commit comments

Comments
 (0)