Commit 61d3a52f authored by ransome1's avatar ransome1
Browse files

AutoUpdate: added Mac support, default set to false, added options in interface

parent 0580e986
......@@ -3,24 +3,22 @@
## What is needed?
### Refactor JavaScript
sleek is written in plain vanilla JavaScript. I'm doing my best to keep the code as slim and tidy as possible. But I'm not a professional developer and limited on time I can invest in this project. You can contribute by reviewing the JavaScript with the aim of making sleek faster and more maintainable.
sleek is written in plain vanilla JavaScript. I'm doing my best to keep the code as slim and tidy as possible. But I'm not a professional developer and limited on time I can invest into this project. You can contribute by reviewing the JavaScript with the aim of making sleek faster and more maintainable.
### Clean up the CSS
In order to create sleeks' unique look lot of (S)CSS had been written. If you have experience on CSS you can review and optimise it.
In order to create sleeks' unique look a lot of (S)CSS had been written. If you have experience in CSS you can review and optimise it.
### Work on feature requests
Over the time plenty of feature requests had been files for sleek: https://github.com/ransome1/sleek/issues. You can simply pick feature request and start working on it. Every feature needs to be contributed with a sufficient amount of test cases (see "Write test cases"). There is a prioritised backlog too: https://github.com/ransome1/sleek/projects/2
Over the time plenty of feature requests had been added to sleeks backlog: https://github.com/ransome1/sleek/issues. You can simply pick a feature request and start working on it. Every feature needs to be contributed with a sufficient amount of test cases (see "Write test cases"). There is a prioritised backlog too: https://github.com/ransome1/sleek/projects/2
### Enhance the CI process
sleek is being distributed through Github and many other platforms (Snap Store, Flathub, Arch User Repository, Windows Store, Mac App Store). Releasing sleek is still plenty of work and it would be of great help if the releasing process would be further automated. For instance the build process on Flathub or AUR could be triggered on tag creation on Github. The current CI configuration can be found here: https://github.com/ransome1/sleek/blob/develop/.github/workflows/github-ci.yml
### Enhance the design
If you have interface design experience you can propose design changes. As sleek has a strong focus on its design all changes should be discussed before any implementation is being done.
If you have interface design experience you can propose design changes. As sleek has a strong focus on its design, all changes should be discussed before any implementation is being done.
### Translate sleek into your language
Plenty of languages are already available, but if yours is missing, you can translate the app to it.
## Write test cases
## File pull request
\ No newline at end of file
Test cases are written for the Playwright end to end testing environment: https://playwright.dev/docs/api/class-playwright. Creating cases it pretty much straight forward and you can take a look on how it has been done so far: https://github.com/ransome1/sleek/blob/master/test/playwright.spec.js
\ No newline at end of file
{
"name": "sleek",
"productName": "sleek",
"version": "1.1.8-rc.3",
"version": "1.1.6",
"description": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"synopsis": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"category": "ProjectManagement",
......@@ -120,6 +120,7 @@
},
"scripts": {
"build:mas": "yarn build:css && yarn build:pegjs && electron-builder -m mas --universal --publish never && bash build/resignPkg.sh",
"build:macos": "yarn build:css && yarn build:pegjs && electron-builder -m zip --universal --publish never && bash build/resignPkg.sh",
"build:appx": "yarn build:css && yarn build:pegjs && electron-builder -w appx --publish never",
"build:css": "sass src/scss/style.scss:src/css/style.css",
"build:pegjs": "peggy --format es --output src/js/filterlang.mjs src/js/filterlang.pegjs",
......
const { AppImageUpdater } = require("electron-updater");
const { AppImageUpdater, MacUpdater } = require("electron-updater");
const autoUpdater = new AppImageUpdater();
function addEvents(element) {
element
.on("update-available", () => {
console.log("Update available");
})
.on("update-not-available", () => {
console.log("No update");
})
.on("error", (error) => {
console.log("Error in updater: " + error);
})
.on("download-progress", (progressObj) => {
let log_message = "Download speed: " + progressObj.bytesPerSecond;
log_message = log_message + " - Downloaded " + progressObj.percent + "%";
log_message = log_message + " (" + progressObj.transferred + "/" + progressObj.total + ")";
console.log(log_message);
})
.on("update-downloaded", () => {
console.log("Update downloaded");
});
}
autoUpdater.allowPrerelease = false;
const autoUpdaterAppImage = new AppImageUpdater();
autoUpdaterAppImage.allowPrerelease = false;
addEvents(autoUpdaterAppImage);
autoUpdater
.on("update-available", () => {
console.log("Update available");
})
.on("update-not-available", () => {
console.log("No update");
})
.on("error", (error) => {
console.log("Error in updater: " + error);
})
.on("download-progress", (progressObj) => {
let log_message = "Download speed: " + progressObj.bytesPerSecond;
log_message = log_message + " - Downloaded " + progressObj.percent + "%";
log_message = log_message + " (" + progressObj.transferred + "/" + progressObj.total + ")";
console.log(log_message);
})
.on("update-downloaded", () => {
console.log("Update downloaded");
});
const autoUpdaterMac = new MacUpdater();
autoUpdaterMac.allowPrerelease = false;
addEvents(autoUpdaterMac);
module.exports = autoUpdater;
\ No newline at end of file
module.exports = { autoUpdaterAppImage, autoUpdaterMac };
\ No newline at end of file
......@@ -477,6 +477,22 @@
</td>
</tr>
</table>
<table id="autoUpdate" class="settings is-hidden">
<tr>
<th colspan="100%" id="autoUpdateHeadline"></th>
</tr>
<tr>
<td id="autoUpdateBody"></td>
<td>
<span class="toggle">
<label class="switch" for="autoUpdate">
<input type="checkbox" id="autoUpdate" class="toggle" tabindex="0">
<span class="slider round"></span>
</label>
</span>
</td>
</tr>
</table>
<table class="settings">
<tr>
<th colspan="100%" id="zoomHeadline"></th>
......
......@@ -89,6 +89,9 @@ const zoomHeadline = document.getElementById("zoomHeadline");
const zoomUndo = document.getElementById("zoomUndo");
const language = document.getElementById("language");
const autoUpdateHeadline = document.getElementById("autoUpdateHeadline");
const autoUpdateBody = document.getElementById("autoUpdateBody");
addAsTodo.innerHTML = translations.addAsTodo;
compactViewBody.innerHTML = translations.compactViewBody;
compactViewHeadline.innerHTML = translations.compactView;
......@@ -167,6 +170,8 @@ shareTwitter.innerHTML = translations.shareTwitter;
submitIssuesOnGithub.innerHTML = translations.submitIssuesOnGithub;
zoomBody.innerHTML = translations.zoomBody;
zoomHeadline.innerHTML = translations.zoomHeadline;
autoUpdateHeadline.innerHTML = translations.autoUpdateHeadline;
autoUpdateBody.innerHTML = translations.autoUpdateBody;
language.onchange = function() {
// only continue if language code has been passed
......
......@@ -177,6 +177,9 @@ export function initialSetupInterface() {
window.api.send("darkmode", userData.darkmode);
(userData.darkmode) ? body.classList.add("dark") : body.classList.remove("dark");
// show or hide specific settings
if(appData.channel === "AppImage" || appData.os === "mac" && appData.channel !== "Mac App Store") document.getElementById("autoUpdate").classList.remove("is-hidden")
// set scaling factor if default font size has changed
document.getElementById("html").style.zoom = userData.zoom + "%";
document.getElementById("zoomStatus").innerHTML = userData.zoom + "%";
......
......@@ -3,8 +3,10 @@
"addAsTodo": "Přidat jako úkol",
"addTodo": "Přidat nový úkol",
"addTodoContainerHeadline": "Žádné úkoly",
"addTodoContainerSubtitle": "Tento seznam je prázdný, pojďme přidat nějaké úkoly.",
"addTodoConta0inerSubtitle": "Tento seznam je prázdný, pojďme přidat nějaké úkoly.",
"archive": "Archiv",
"autoUpdateHeadline": "Automatické aktualizace",
"autoUpdateBody": "Nové verze se automaticky stahují a instalují. Po restartu je aktualizace dostupná.",
"bdaily": "Každý pracovní den",
"bday": "pracovní den",
"bday_plural": "pracovní dny",
......
......@@ -5,6 +5,8 @@
"addTodoContainerHeadline": "Keine Aufgaben",
"addTodoContainerSubtitle": "Diese Liste ist leer, füge eine Aufgabe hinzu",
"archive": "Archivieren",
"autoUpdateHeadline": "Automatische Updates",
"autoUpdateBody": "Neue Versionen werden automatisch heruntergeladen und installiert. Nach einem Neustart ist das Update verfügbar.",
"bdaily": "jedem Geschäftstag",
"bday": "Geschäftstag",
"bday_plural": "Geschäftstage",
......
......@@ -5,6 +5,8 @@
"addTodoContainerHeadline": "No todos",
"addTodoContainerSubtitle": "This list is empty, let's add some todos.",
"archive": "Archive",
"autoUpdateHeadline": "Automatic updates",
"autoUpdateBody": "New versions are automatically downloaded and installed. After a restart, the update is available.",
"bdaily": "Each business day",
"bday": "business day",
"bday_plural": "business days",
......
......@@ -5,6 +5,8 @@
"addTodoContainerHeadline": "No hay tareas",
"addTodoContainerSubtitle": "Esta lista está vacía, añade una nueva tarea.",
"archive": "Archivar",
"autoUpdateHeadline": "Actualizaciones automáticas",
"autoUpdateBody": "Las nuevas versiones se descargan e instalan automáticamente. Después de un reinicio, la actualización está disponible.",
"bdaily": "Cada día laboral",
"bday": "día laboral",
"bday_plural": "días laborales",
......
......@@ -5,6 +5,8 @@
"addTodoContainerHeadline": "Pas de tâche",
"addTodoContainerSubtitle": "La liste est vide, ajoutez quelques tâches.",
"archive": "Archiver",
"autoUpdateHeadline": "Mises à jour automatiques",
"autoUpdateBody": "Les nouvelles versions sont automatiquement téléchargées et installées. Après un redémarrage, la mise à jour est disponible.",
"bdaily": "Tous les jours ouvrables",
"bday": "jour ouvrable",
"bday_plural": "jours ouvrables",
......
......@@ -5,6 +5,8 @@
"addTodoContainerHeadline": "Nincsenek tennivalók",
"addTodoContainerSubtitle": "Ez a lista üres, adjon hozzá néhány tennivalót.",
"archive": "Archiválás",
"autoUpdateHeadline": "Automatikus frissítések",
"autoUpdateBody": "Az új verziók letöltése és telepítése automatikusan megtörténik. Újraindítás után elérhető a frissítés.",
"bdaily": "Minden munkanap",
"bday": "munkanap",
"bday_plural": "munkanap",
......
......@@ -5,6 +5,8 @@
"addTodoContainerHeadline": "Nessun todo",
"addTodoContainerSubtitle": "Questa lista è vuota, aggiungiamo un nuovo todo.",
"archive": "Archivio",
"autoUpdateHeadline": "Aggiornamenti automatici",
"autoUpdateBody": "Le nuove versioni vengono scaricate e installate automaticamente. Dopo un riavvio, l'aggiornamento è disponibile.",
"bdaily": "Ogni giorno lavorativo",
"bday": "Giorno lavorativo",
"bday_plural": "Giorni lavorativi",
......
......@@ -5,6 +5,8 @@
"addTodoContainerHeadline": "タスクがない",
"addTodoContainerSubtitle": "リストは空であり, タスクを追加しましょう",
"archive": "アーカイブ",
"autoUpdateHeadline": "自動的にアップデート",
"autoUpdateBody": "新しいバージョンが自動的にダウンロードされ、インストールされます。 再起動後、アップデートが利用可能になります。",
"bdaily": "毎営業日",
"bday": "営業日",
"bday_plural": "営業日",
......
......@@ -5,6 +5,8 @@
"addTodoContainerHeadline": "Brak zadań",
"addTodoContainerSubtitle": "Ta lista jest pusta, dodaj jakieś zadania.",
"archive": "Archiwizuj",
"autoUpdateHeadline": "Automatyczne aktualizacje",
"autoUpdateBody": "Nowe wersje są automatycznie pobierane i instalowane. Aktualizacja jest dostępna po ponownym uruchomieniu.",
"bdaily": "Każdy dzień roboczy",
"bday": "dzień roboczy",
"bday_plural": "dni robocze",
......
......@@ -5,6 +5,8 @@
"addTodoContainerHeadline": "Sem todos",
"addTodoContainerSubtitle": "Esta lista está vazia, vamos adicionar alguns todos.",
"archive": "Arquivo",
"autoUpdateHeadline": "Atualizações automáticas",
"autoUpdateBody": "Novas versões são baixadas e instaladas automaticamente. Após uma reinicialização, a atualização está disponível.",
"bdaily": "Cada dia útil ",
"bday": "dia útil",
"bday_plural": "dias úteis",
......
......@@ -5,6 +5,8 @@
"addTodoContainerHeadline": "Yapılacak yok",
"addTodoContainerSubtitle": "Bu liste boş, hadi bir kaç yeni yapılacak ekleyelim.",
"archive": "Arşiv",
"autoUpdateHeadline": "Otomatik güncellemeler",
"autoUpdateBody": "Yeni sürümler otomatik olarak indirilir ve kurulur. Yeniden başlatmanın ardından güncelleme kullanılabilir.",
"bdaily": "Her iş günü",
"bday": "iş günü",
"bday_plural": "iş günleri",
......
......@@ -5,6 +5,8 @@
"addTodoContainerHeadline": "没有任务",
"addTodoContainerSubtitle": "列表为空, 来创建一些任务吧",
"archive": "存档",
"autoUpdateHeadline": "自动更新",
"autoUpdateBody": "新版本会自动下载并安装。 重新启动后,更新可用。",
"bdaily": "每个工作日",
"bday": "工作日",
"bday_plural": "工作日",
......
"use strict";
const { Tray, app, Notification, clipboard, Menu, ipcMain, BrowserWindow, nativeTheme, dialog } = require("electron");
const i18next = require("./configs/i18next.config");
const path = require("path");
const fs = require("fs");
const chokidar = require("chokidar");
const Store = require("./configs/store.config.js");
const autoUpdater = require("./configs/autoUpdater.config.js");
const Badge = require("electron-windows-badge");
const i18next = require("./configs/i18next.config");
const { autoUpdaterAppImage, autoUpdaterMac } = require("./configs/autoUpdater.config.js");
//const dismissedNotificationsStorage = require("./configs/store.config.js");
const os = {
darwin: "mac",
......@@ -39,7 +37,6 @@ let
menuTemplateTodos,
menuTemplateView,
menuTemplateAbout;
// ########################################################################################################################
// HOT RELOAD
......@@ -382,7 +379,7 @@ function getUserData() {
if(typeof userData.data.fileTabs != "boolean") userData.data.fileTabs = true;
if(typeof userData.data.appendStartDate != "boolean") userData.data.appendStartDate = false;
if(typeof userData.data.language != "string") userData.data.language = app.getLocale().substr(0,2);
if(typeof userData.data.autoUpdate != "boolean") userData.data.autoUpdate = true;
if(typeof userData.data.autoUpdate != "boolean") userData.data.autoUpdate = false;
//TODO remove this after 1.1.7 has been fully distributed
const indexOfDueString = userData.data.sortBy.indexOf("dueString");
......@@ -649,6 +646,7 @@ async function createWindow() {
// create badge for Windows build
if(appData.os === "windows") {
const Badge = await require("electron-windows-badge");
new Badge(mainWindow, {
font: "10px arial"
});
......@@ -721,20 +719,17 @@ async function createWindow() {
}
}]
}
// menuTemplateEdit = {
// label: translations.edit,
// submenu: [
// { role: "undo", accelerator: "CmdOrCtrl+Z" },
// { role: "redo", accelerator: "CmdOrCtrl+Shift+Z" },
// { type: "separator" },
// { label: translations.cut, accelerator: "CmdOrCtrl+X", selector: "cut:" },
// { label: translations.copy, accelerator: "CmdOrCtrl+C", selector: "copy:" },
// { label: translations.paste, accelerator: "CmdOrCtrl+V", selector: "paste:" },
// { role: "selectAll", accelerator: "CmdOrCtrl+A" }
// ]
// }
menuTemplateEdit = {
role: "editMenu"
menuTemplateEdit = {
label: translations.edit,
submenu: [
{ role: "undo", accelerator: "CmdOrCtrl+Z" },
{ role: "redo", accelerator: "CmdOrCtrl+Shift+Z" },
{ type: "separator" },
{ label: translations.cut, accelerator: "CmdOrCtrl+X", selector: "cut:" },
{ label: translations.copy, accelerator: "CmdOrCtrl+C", selector: "copy:" },
{ label: translations.paste, accelerator: "CmdOrCtrl+V", selector: "paste:" },
{ role: "selectAll", accelerator: "CmdOrCtrl+A" }
]
}
menuTemplateTodos = {
label: translations.todos,
......@@ -881,7 +876,10 @@ if(!process.mas && (!app.requestSingleInstanceLock() && process.env.SLEEK_MULTIP
app.on("ready", () => {
// setup autoupdater for AppImage build
if(appData.channel === "AppImage" && userData.data.autoUpdate) autoUpdater.checkForUpdatesAndNotify()
if(appData.channel === "AppImage" && userData.data.autoUpdate) autoUpdaterAppImage.checkForUpdatesAndNotify()
// setup autoupdater for Mac builds
if(appData.os === "mac" && appData.channel !== "Mac App Store" && userData.data.autoUpdate) autoUpdaterMac.checkForUpdatesAndNotify()
// identifier for windows store
if(appData.os === "windows") app.setAppUserModelId("RobinAhle.sleektodomanager")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment