Skip to content

Commit 235906e

Browse files
authored
Merge pull request #8 from zonayedpca/v0.7.0-beta
V0.7.0 beta
2 parents bddf293 + b2436f8 commit 235906e

File tree

6 files changed

+98
-27
lines changed

6 files changed

+98
-27
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ branches:
66

77
platform:
88
- x64
9-
- x86
9+
# - x86
1010

1111
cache:
1212
- node_modules

client/src/components/settings.css

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
.settings .MuiToolbar-regular {
2-
min-height: 48px;
2+
min-height: 48px;
33
}
44

55
.settings .MuiIconButton-root:hover {
6-
border-radius: 100%;
6+
border-radius: 100%;
77
}
88

99
.settings .content {
10-
margin-top: 45px;
11-
padding: 15px;
12-
height: 320px;
13-
overflow-y: scroll;
10+
margin-top: 45px;
11+
padding: 15px;
12+
height: 380px;
13+
overflow-y: scroll;
1414
}
1515

1616
.settings .content .btn-reset {
17-
display: block;
18-
border: solid 1px #F44336;
19-
color: #fff;
20-
cursor: pointer;
21-
font-size: 16px;
22-
padding: 15px 15px;
23-
text-align: center;
24-
width: 100%;
25-
background: #F44336;
26-
border-radius: 4px;
17+
display: block;
18+
border: solid 1px #f44336;
19+
color: #fff;
20+
cursor: pointer;
21+
font-size: 16px;
22+
padding: 15px 15px;
23+
text-align: center;
24+
width: 100%;
25+
background: #f44336;
26+
border-radius: 4px;
2727
}
2828

2929
.settings .privacy {
30-
margin-top: 15px;
31-
text-align: center;
32-
color: #b7b7b7;
33-
text-transform: uppercase;
30+
margin-top: 15px;
31+
text-align: center;
32+
color: #b7b7b7;
33+
text-transform: uppercase;
3434
}
3535

3636
.settings .privacy p {
37-
font-size: 11px;
38-
}
37+
font-size: 11px;
38+
}

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.6.0",
3+
"version": "0.7.0-beta",
44
"description": "DevTop - Essential Tools for Developers",
55
"main": "app.js",
66
"author": "Zonayed Ahmed",

src/controller/checkForUpdates.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
const { dialog, shell } = require('electron');
2+
const { autoUpdater } = require('electron-updater');
3+
4+
const { isDev } = require('../utils');
5+
6+
// eslint-disable-next-line no-unused-vars
7+
let updater;
8+
let appUpdater = {
9+
enabled: false,
10+
};
11+
12+
autoUpdater.autoDownload = false;
13+
autoUpdater.allowPrerelease = true;
14+
15+
autoUpdater.on('error', error => {
16+
dialog.showErrorBox(
17+
'Error: ',
18+
error == null ? 'unknown' : (error.stack || error).toString()
19+
);
20+
});
21+
22+
autoUpdater.on('update-available', ({ releaseNotes }) => {
23+
dialog.showMessageBox(
24+
{
25+
type: 'info',
26+
title: 'Found Updates',
27+
message: `New Update Found. You can manaullay download it
28+
29+
Changelog:
30+
${releaseNotes}
31+
`,
32+
buttons: ['Download Now', 'No'],
33+
},
34+
buttonIndex => {
35+
if (buttonIndex === 0) {
36+
shell.openExternalSync(
37+
'https://github.com/zonayedpca/DevTop/releases'
38+
);
39+
} else {
40+
appUpdater.enabled = true;
41+
updater = null;
42+
}
43+
}
44+
);
45+
});
46+
47+
autoUpdater.on('update-not-available', () => {
48+
dialog.showMessageBox({
49+
title: 'No Updates',
50+
message: 'Current version is up-to-date.',
51+
});
52+
appUpdater.enabled = true;
53+
updater = null;
54+
});
55+
56+
function checkForUpdates(menuItem) {
57+
updater = menuItem;
58+
appUpdater.enabled = false;
59+
if (!isDev()) autoUpdater.checkForUpdates();
60+
}
61+
62+
module.exports = {
63+
checkForUpdates,
64+
};

src/controller/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
const { autoLaunch } = require('./autoLaunch');
2+
const { checkForUpdates } = require('./checkForUpdates');
23

34
module.exports = {
45
autoLaunch,
6+
checkForUpdates,
57
};

src/module/ApplicationTray.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const { app, Tray, Menu, MenuItem } = require('electron');
1+
const { app, Tray, Menu, MenuItem, shell } = require('electron');
22

33
const { getPosition } = require('../utils');
4-
const { autoLaunch } = require('../controller');
4+
const { autoLaunch, checkForUpdates } = require('../controller');
55

66
class ApplicationTray extends Tray {
77
constructor(iconPath, mainWindow) {
@@ -64,6 +64,11 @@ class ApplicationTray extends Tray {
6464
menu.append(
6565
new MenuItem({
6666
label: 'DevTop Essentials',
67+
click: () => {
68+
shell.openExternalSync(
69+
'https://github.com/zonayedpca/DevTop'
70+
);
71+
},
6772
})
6873
);
6974
menu.append(new MenuItem({ type: 'separator' }));
@@ -82,7 +87,7 @@ class ApplicationTray extends Tray {
8287
label: 'Check for Updates',
8388
type: 'checkbox',
8489
click: () => {
85-
console.log('Update check will be implemented here...');
90+
checkForUpdates();
8691
},
8792
})
8893
);

0 commit comments

Comments
 (0)