diff --git a/wowup-electron/app-updater.ts b/wowup-electron/app-updater.ts index 3750e63d..cbab5d6e 100644 --- a/wowup-electron/app-updater.ts +++ b/wowup-electron/app-updater.ts @@ -3,7 +3,9 @@ import * as log from "electron-log"; import { autoUpdater } from "electron-updater"; import { APP_UPDATE_AVAILABLE, + APP_UPDATE_CHECK_END, APP_UPDATE_CHECK_FOR_UPDATE, + APP_UPDATE_CHECK_START, APP_UPDATE_DOWNLOADED, APP_UPDATE_ERROR, APP_UPDATE_INSTALL, @@ -11,6 +13,21 @@ import { APP_UPDATE_START_DOWNLOAD, } from "./src/common/constants"; +export const checkForUpdates = async function checkForUpdates( + win: BrowserWindow +) { + let result = null; + + try { + win.webContents.send(APP_UPDATE_CHECK_START); + result = await autoUpdater.checkForUpdates(); + } finally { + win.webContents.send(APP_UPDATE_CHECK_END); + } + + return result; +}; + // Example: https://github.com/electron-userland/electron-builder/blob/docs/encapsulated%20manual%20update%20via%20menu.js export function initializeAppUpdater(win: BrowserWindow) { autoUpdater.logger = log; @@ -39,9 +56,10 @@ export function initializeAppUpdater(win: BrowserWindow) { }); } -export function initializeAppUpdateIpcHandlers() { +export function initializeAppUpdateIpcHandlers(win: BrowserWindow) { ipcMain.handle(APP_UPDATE_START_DOWNLOAD, async () => { log.info(APP_UPDATE_START_DOWNLOAD); + win.webContents.send(APP_UPDATE_START_DOWNLOAD); return await autoUpdater.downloadUpdate(); }); @@ -52,6 +70,6 @@ export function initializeAppUpdateIpcHandlers() { ipcMain.handle(APP_UPDATE_CHECK_FOR_UPDATE, async () => { log.info(APP_UPDATE_CHECK_FOR_UPDATE); - return await autoUpdater.checkForUpdates(); + return await checkForUpdates(win); }); } diff --git a/wowup-electron/main.ts b/wowup-electron/main.ts index 1f4c33a4..b2937870 100644 --- a/wowup-electron/main.ts +++ b/wowup-electron/main.ts @@ -35,7 +35,7 @@ let win: BrowserWindow = null; // APP MENU SETUP const appMenuTemplate: Array< -MenuItemConstructorOptions | MenuItem + MenuItemConstructorOptions | MenuItem > = getAppMenu(); const appMenu = Menu.buildFromTemplate(appMenuTemplate); @@ -66,6 +66,10 @@ const argv = require("minimist")(process.argv.slice(1), { boolean: ["serve", "hidden"], }); +function canStartHidden() { + return argv.hidden || app.getLoginItemSettings().wasOpenedAsHidden; +} + function windowStateManager( windowName: string, { width, height }: { width: number; height: number } @@ -90,9 +94,9 @@ function windowStateManager( windowState.x >= display.bounds.x && windowState.y >= display.bounds.y && windowState.x + windowState.width <= - display.bounds.x + display.bounds.width && + display.bounds.x + display.bounds.width && windowState.y + windowState.height <= - display.bounds.y + display.bounds.height + display.bounds.y + display.bounds.height ); }); @@ -173,7 +177,7 @@ function createWindow(): BrowserWindow { win = new BrowserWindow(windowOptions); initializeIpcHanders(win); initializeAppUpdater(win); - initializeAppUpdateIpcHandlers(); + initializeAppUpdateIpcHandlers(win); // Keep track of window state mainWindowManager.monitorState(win); @@ -181,7 +185,10 @@ function createWindow(): BrowserWindow { win.webContents.userAgent = USER_AGENT; win.once("ready-to-show", () => { - if (!argv.hidden) win.show(); + if (canStartHidden()) { + return; + } + win.show(); }); win.once("show", () => { diff --git a/wowup-electron/package.json b/wowup-electron/package.json index 3fecfc82..4b5280d1 100644 --- a/wowup-electron/package.json +++ b/wowup-electron/package.json @@ -114,6 +114,8 @@ "@angular/animations": "~10.1.4", "@angular/cdk": "10.2.5", "@angular/material": "10.2.5", + "@fortawesome/fontawesome-svg-core": "1.2.32", + "@fortawesome/free-solid-svg-icons": "5.15.1", "@types/lodash": "4.14.162", "adm-zip": "0.4.16", "async": "3.2.0", diff --git a/wowup-electron/src/app/app.component.ts b/wowup-electron/src/app/app.component.ts index ae53d5c1..ced9b0c0 100644 --- a/wowup-electron/src/app/app.component.ts +++ b/wowup-electron/src/app/app.component.ts @@ -1,8 +1,6 @@ import { AfterViewInit, ChangeDetectionStrategy, Component } from "@angular/core"; import { MatDialog } from "@angular/material/dialog"; import { TranslateService } from "@ngx-translate/core"; -import { from } from "rxjs"; -import { switchMap } from "rxjs/operators"; import { CREATE_TRAY_MENU_CHANNEL } from "../common/constants"; import { SystemTrayConfig } from "../common/wowup/system-tray-config"; import { TelemetryDialogComponent } from "./components/telemetry-dialog/telemetry-dialog.component"; @@ -10,8 +8,9 @@ import { ElectronService } from "./services"; import { AddonService } from "./services/addons/addon.service"; import { AnalyticsService } from "./services/analytics/analytics.service"; import { FileService } from "./services/files/file.service"; -import { WarcraftService } from "./services/warcraft/warcraft.service"; import { WowUpService } from "./services/wowup/wowup.service"; +import { IconService } from "./services/icons/icon.service"; +import { faAngleDoubleDown } from "@fortawesome/free-solid-svg-icons"; const AUTO_UPDATE_PERIOD_MS = 60 * 60 * 1000; // 1 hour @@ -29,13 +28,15 @@ export class AppComponent implements AfterViewInit { private _electronService: ElectronService, private _fileService: FileService, private translate: TranslateService, - private warcraft: WarcraftService, private _wowUpService: WowUpService, private _dialog: MatDialog, - private _addonService: AddonService + private _addonService: AddonService, + private _iconService: IconService ) { this.translate.setDefaultLang("en"); this.translate.use(this._wowUpService.currentLanguage); + + this._iconService.addSvg(faAngleDoubleDown); } ngAfterViewInit(): void { @@ -90,6 +91,7 @@ export class AppComponent implements AfterViewInit { console.debug("Creating tray", result); const config: SystemTrayConfig = { quitLabel: result["APP.SYSTEM_TRAY.QUIT_ACTION"], + checkUpdateLabel: result["APP.SYSTEM_TRAY.CHECK_UPDATE"], showLabel: result["APP.SYSTEM_TRAY.SHOW_ACTION"], }; diff --git a/wowup-electron/src/app/components/footer/footer.component.html b/wowup-electron/src/app/components/footer/footer.component.html index 14941f17..ac4f0a29 100644 --- a/wowup-electron/src/app/components/footer/footer.component.html +++ b/wowup-electron/src/app/components/footer/footer.component.html @@ -32,6 +32,18 @@

{{ sessionService.pageContextText$ | async }}

v{{ wowUpService.applicationVersion }}

+
+ +
+
+ cached +
\ No newline at end of file diff --git a/wowup-electron/src/app/components/my-addons-addon-cell/my-addons-addon-cell.component.scss b/wowup-electron/src/app/components/my-addons-addon-cell/my-addons-addon-cell.component.scss index 28eaf176..bdc7a491 100644 --- a/wowup-electron/src/app/components/my-addons-addon-cell/my-addons-addon-cell.component.scss +++ b/wowup-electron/src/app/components/my-addons-addon-cell/my-addons-addon-cell.component.scss @@ -66,6 +66,10 @@ .addon-version { color: $white-2; + + .update-available { + color: $artifact; + } } .auto-update-icon { diff --git a/wowup-electron/src/app/components/my-addons-addon-cell/my-addons-addon-cell.component.ts b/wowup-electron/src/app/components/my-addons-addon-cell/my-addons-addon-cell.component.ts index bd0ac009..2a2f58cc 100644 --- a/wowup-electron/src/app/components/my-addons-addon-cell/my-addons-addon-cell.component.ts +++ b/wowup-electron/src/app/components/my-addons-addon-cell/my-addons-addon-cell.component.ts @@ -8,6 +8,7 @@ import { AddonViewModel } from "../../business-objects/my-addon-list-item"; }) export class MyAddonsAddonCellComponent implements OnInit { @Input("addon") listItem: AddonViewModel; + @Input() showUpdateToVersion = false; @Output() onViewDetails: EventEmitter = new EventEmitter(); diff --git a/wowup-electron/src/app/mat-module.ts b/wowup-electron/src/app/mat-module.ts index 80c8df16..f6e2d1ea 100644 --- a/wowup-electron/src/app/mat-module.ts +++ b/wowup-electron/src/app/mat-module.ts @@ -20,6 +20,7 @@ import { MatTabsModule } from "@angular/material/tabs"; import { MatTooltipModule } from "@angular/material/tooltip"; import { MatSidenavModule } from "@angular/material/sidenav"; import { MatListModule } from "@angular/material/list"; +import { MatBadgeModule } from "@angular/material/badge"; @NgModule({ exports: [ @@ -44,6 +45,7 @@ import { MatListModule } from "@angular/material/list"; MatSnackBarModule, MatSidenavModule, MatListModule, + MatBadgeModule, ], imports: [ MatSliderModule, @@ -67,6 +69,7 @@ import { MatListModule } from "@angular/material/list"; MatSnackBarModule, MatSidenavModule, MatListModule, + MatBadgeModule, ], }) export class MatModule {} diff --git a/wowup-electron/src/app/pages/my-addons/my-addons.component.html b/wowup-electron/src/app/pages/my-addons/my-addons.component.html index 346cfad4..5cd722e5 100644 --- a/wowup-electron/src/app/pages/my-addons/my-addons.component.html +++ b/wowup-electron/src/app/pages/my-addons/my-addons.component.html @@ -131,6 +131,7 @@ @@ -179,7 +180,7 @@ {{ "PAGES.MY_ADDONS.TABLE.LATEST_VERSION_COLUMN_HEADER" | translate }} - + {{ element.addon.latestVersion }} @@ -307,7 +308,13 @@
{{ listItem.addon.name }}
-
{{ listItem.addon.latestVersion }}
+
{{ listItem.addon.installedVersion }}
+
+ {{ listItem.addon.latestVersion }} +
diff --git a/wowup-electron/src/app/pages/my-addons/my-addons.component.scss b/wowup-electron/src/app/pages/my-addons/my-addons.component.scss index ef4833b7..963a0812 100644 --- a/wowup-electron/src/app/pages/my-addons/my-addons.component.scss +++ b/wowup-electron/src/app/pages/my-addons/my-addons.component.scss @@ -86,6 +86,10 @@ white-space: pre-wrap; } + .addon-update-available { + color: $artifact; + } + .game-version-cell { min-width: 110px; } diff --git a/wowup-electron/src/app/pages/my-addons/my-addons.component.ts b/wowup-electron/src/app/pages/my-addons/my-addons.component.ts index 9984c440..1831b99a 100644 --- a/wowup-electron/src/app/pages/my-addons/my-addons.component.ts +++ b/wowup-electron/src/app/pages/my-addons/my-addons.component.ts @@ -180,6 +180,10 @@ export class MyAddonsComponent implements OnInit, OnDestroy { this.subscriptions.forEach((sub) => sub.unsubscribe()); } + public isLatestUpdateColumnVisible(): boolean { + return this.columns.find(column => column.name === 'addon.latestVersion').visible + } + public onSortChange(): void { if (this.table) { this.table.nativeElement.scrollIntoView({ behavior: "smooth" }); diff --git a/wowup-electron/src/app/services/electron/electron.service.ts b/wowup-electron/src/app/services/electron/electron.service.ts index 9bfee121..9a87f19b 100644 --- a/wowup-electron/src/app/services/electron/electron.service.ts +++ b/wowup-electron/src/app/services/electron/electron.service.ts @@ -1,8 +1,9 @@ import { Injectable } from "@angular/core"; import * as childProcess from "child_process"; +import { APP_UPDATE_CHECK_END, APP_UPDATE_CHECK_START } from "common/constants"; // If you import a module but never use any of the imported values other than as TypeScript types, // the resulting javascript file will look as if you never imported the module at all. -import { ipcRenderer, remote, shell, webFrame } from "electron"; +import { ipcRenderer, remote, Settings, shell, webFrame } from "electron"; import * as fs from "fs"; import { BehaviorSubject } from "rxjs"; import { v4 as uuidv4 } from "uuid"; @@ -17,6 +18,7 @@ import { ValueResponse } from "../../../common/models/value-response"; export class ElectronService { private readonly _windowMaximizedSrc = new BehaviorSubject(false); private readonly _windowMinimizedSrc = new BehaviorSubject(false); + private readonly _ipcEventReceivedSrc = new BehaviorSubject(''); ipcRenderer: typeof ipcRenderer; webFrame: typeof webFrame; @@ -27,6 +29,7 @@ export class ElectronService { public readonly windowMaximized$ = this._windowMaximizedSrc.asObservable(); public readonly windowMinimized$ = this._windowMinimizedSrc.asObservable(); + public readonly ipcEventReceived$ = this._ipcEventReceivedSrc.asObservable(); public readonly isWin = process.platform === "win32"; public readonly isMac = process.platform === "darwin"; public readonly isLinux = process.platform === "linux"; @@ -39,6 +42,13 @@ export class ElectronService { return this.remote.app.getLocale().split("-")[0]; } + get loginItemSettings() { + return this.remote.app.getLoginItemSettings(); + } + set loginItemSettings(settings: Settings) { + this.remote.app.setLoginItemSettings(settings); + } + constructor() { // Conditional imports if (!this.isElectron) { @@ -55,6 +65,14 @@ export class ElectronService { this.childProcess = window.require("child_process"); this.fs = window.require("fs"); + this.ipcRenderer.on(APP_UPDATE_CHECK_START, () => { + this._ipcEventReceivedSrc.next(APP_UPDATE_CHECK_START); + }); + + this.ipcRenderer.on(APP_UPDATE_CHECK_END, () => { + this._ipcEventReceivedSrc.next(APP_UPDATE_CHECK_END); + }); + const currentWindow = this.remote?.getCurrentWindow(); currentWindow?.on("minimize", () => { diff --git a/wowup-electron/src/app/services/icons/icon.service.ts b/wowup-electron/src/app/services/icons/icon.service.ts new file mode 100644 index 00000000..8324dd04 --- /dev/null +++ b/wowup-electron/src/app/services/icons/icon.service.ts @@ -0,0 +1,24 @@ +import { Injectable } from "@angular/core"; +import { MatIconRegistry } from "@angular/material/icon"; +import { IconDefinition } from "@fortawesome/fontawesome-svg-core"; +import { DomSanitizer } from "@angular/platform-browser"; + +@Injectable({ + providedIn: "root", +}) +export class IconService { + constructor( + private _matIconRegistry: MatIconRegistry, + private _sanitizer: DomSanitizer + ) {} + + async addSvg(icon: IconDefinition) { + const svg = ``; + + this._matIconRegistry.addSvgIconLiteralInNamespace( + icon.prefix, + icon.iconName, + this._sanitizer.bypassSecurityTrustHtml(svg) + ); + } +} diff --git a/wowup-electron/src/app/services/wowup/wowup.service.ts b/wowup-electron/src/app/services/wowup/wowup.service.ts index cfe603b1..9cc0edfd 100644 --- a/wowup-electron/src/app/services/wowup/wowup.service.ts +++ b/wowup-electron/src/app/services/wowup/wowup.service.ts @@ -5,7 +5,10 @@ import { existsSync } from "fs"; import { join } from "path"; import { Subject } from "rxjs"; import { + APP_UPDATE_CHECK_END, APP_UPDATE_CHECK_FOR_UPDATE, + APP_UPDATE_CHECK_START, + APP_UPDATE_DOWNLOADED, APP_UPDATE_INSTALL, APP_UPDATE_START_DOWNLOAD, COLLAPSE_TO_TRAY_PREFERENCE_KEY, @@ -25,23 +28,21 @@ import { AddonChannelType } from "../../models/wowup/addon-channel-type"; import { PreferenceChange } from "../../models/wowup/preference-change"; import { WowUpReleaseChannelType } from "../../models/wowup/wowup-release-channel-type"; import { getEnumList, getEnumName } from "../../utils/enum.utils"; -import { CachingService } from "../caching/caching-service"; -import { DownloadSevice } from "../download/download.service"; import { ElectronService } from "../electron/electron.service"; import { FileService } from "../files/file.service"; import { PreferenceStorageService } from "../storage/preference-storage.service"; -import { WowUpApiService } from "../wowup-api/wowup-api.service"; -const LATEST_VERSION_CACHE_KEY = "latest-version-response"; -var autoLaunch = require("auto-launch"); +const autoLaunch = require("auto-launch"); @Injectable({ providedIn: "root", }) export class WowUpService { private readonly _preferenceChangeSrc = new Subject(); + private readonly _wowupUpdateDownloadInProgressSrc = new Subject(); private readonly _wowupUpdateDownloadedSrc = new Subject(); private readonly _wowupUpdateCheckSrc = new Subject(); + private readonly _wowupUpdateCheckInProgressSrc = new Subject(); public readonly updaterName = "WowUpUpdater.exe"; @@ -67,15 +68,14 @@ export class WowUpService { public readonly isBetaBuild: boolean; public readonly preferenceChange$ = this._preferenceChangeSrc.asObservable(); public readonly wowupUpdateDownloaded$ = this._wowupUpdateDownloadedSrc.asObservable(); + public readonly wowupUpdateDownloadInProgress$ = this._wowupUpdateDownloadInProgressSrc.asObservable(); public readonly wowupUpdateCheck$ = this._wowupUpdateCheckSrc.asObservable(); + public readonly wowupUpdateCheckInProgress$ = this._wowupUpdateCheckInProgressSrc.asObservable(); constructor( private _preferenceStorageService: PreferenceStorageService, - private _downloadService: DownloadSevice, private _electronService: ElectronService, private _fileService: FileService, - private _cacheService: CachingService, - private _wowUpApiService: WowUpApiService ) { this.setDefaultPreferences(); @@ -84,6 +84,31 @@ export class WowUpService { this.applicationVersion.toLowerCase().indexOf("beta") != -1; this.createDownloadDirectory().then(() => this.cleanupDownloads()); + + this._electronService.ipcEventReceived$.subscribe((evt) => { + switch (evt) { + case APP_UPDATE_CHECK_START: + console.log(APP_UPDATE_CHECK_START); + this._wowupUpdateCheckInProgressSrc.next(true); + break; + case APP_UPDATE_CHECK_END: + console.log(APP_UPDATE_CHECK_END); + this._wowupUpdateCheckInProgressSrc.next(false); + break; + case APP_UPDATE_START_DOWNLOAD: + console.log(APP_UPDATE_START_DOWNLOAD); + this._wowupUpdateDownloadInProgressSrc.next(true); + break; + case APP_UPDATE_DOWNLOADED: + console.log(APP_UPDATE_DOWNLOADED); + this._wowupUpdateDownloadInProgressSrc.next(false); + break; + } + }); + + this.setAutoStartup(); + + console.log('loginItemSettings', this._electronService.loginItemSettings); } public get updaterExists() { @@ -245,16 +270,21 @@ export class WowUpService { ); // only notify things when the version changes - if ( - updateCheckResult.updateInfo.version !== - this._electronService.getVersionNumber() - ) { + if (!this.isSameVersion(updateCheckResult)) { this._wowupUpdateCheckSrc.next(updateCheckResult); } return updateCheckResult; } + public isSameVersion(updateCheckResult: UpdateCheckResult) { + return ( + updateCheckResult && + updateCheckResult.updateInfo?.version === + this._electronService.getVersionNumber() + ); + } + public async downloadUpdate() { const downloadResult = await this._electronService.invoke( APP_UPDATE_START_DOWNLOAD @@ -347,10 +377,14 @@ export class WowUpService { isHidden: this.startMinimized, }); - if (this.startWithSystem) autoLauncher.enable(); - else autoLauncher.disable(); + if (this.startWithSystem) { + autoLauncher.enable(); + } + else { + autoLauncher.disable(); + } } else { - this._electronService.remote.app.setLoginItemSettings({ + this._electronService.loginItemSettings = { openAtLogin: this.startWithSystem, openAsHidden: this._electronService.isMac ? this.startMinimized : false, args: this._electronService.isWin @@ -358,7 +392,7 @@ export class WowUpService { ? ["--hidden"] : [] : [], - }); + }; } } diff --git a/wowup-electron/src/assets/i18n/de.json b/wowup-electron/src/assets/i18n/de.json index 279b5fdb..b4446e98 100644 --- a/wowup-electron/src/assets/i18n/de.json +++ b/wowup-electron/src/assets/i18n/de.json @@ -3,9 +3,14 @@ "AUTO_UPDATE_NOTIFICATION_BODY": "Automatisch {count} {count, plural, =1{Addon} other{Addons}} aktualisiert.", "AUTO_UPDATE_NOTIFICATION_TITLE": "Automatische Aktualisierung", "SYSTEM_TRAY": { + "CHECK_UPDATE": "Check for Updates...", "QUIT_ACTION": "Beenden", "SHOW_ACTION": "Öffnen" }, + "WOWUP_UPDATE": { + "NOT_AVAILABLE": "Latest version of WowUp is already installed", + "UPDATE_ERROR": "Failed to get WowUp update" + }, "WOWUP_UPDATE_DOWNLOADED_TOOLTIP": "WowUp Update installieren", "WOWUP_UPDATE_INSTALL_MESSAGE": "Willst du WowUp neu Starten um das Update zu installieren?", "WOWUP_UPDATE_INSTALL_TITLE": "WowUp Update bereit", @@ -222,6 +227,11 @@ "LOG_FILES_LABEL": "Log-Dateien", "TITLE": "Debuggen" }, + "TABS": { + "APPLICATION": "Application", + "CLIENTS": "Clients", + "DEBUG": "Debug" + }, "WOW": { "AUTO_UPDATE_DESCRIPTION": "Neu installierte Addons werden standardmäßig auf Auto-Update gesetzt", "AUTO_UPDATE_LABEL": "Automatisch aktualisieren", diff --git a/wowup-electron/src/assets/i18n/en.json b/wowup-electron/src/assets/i18n/en.json index 3c4c6139..e6a54dfb 100644 --- a/wowup-electron/src/assets/i18n/en.json +++ b/wowup-electron/src/assets/i18n/en.json @@ -3,9 +3,14 @@ "AUTO_UPDATE_NOTIFICATION_BODY": "Automatically updated {count} {count, plural, =1{addon} other{addons}}.", "AUTO_UPDATE_NOTIFICATION_TITLE": "Auto Updates", "SYSTEM_TRAY": { + "CHECK_UPDATE": "Check for Updates...", "QUIT_ACTION": "Quit", "SHOW_ACTION": "Show" }, + "WOWUP_UPDATE": { + "NOT_AVAILABLE": "Latest version of WowUp is already installed", + "UPDATE_ERROR": "Failed to get WowUp update" + }, "WOWUP_UPDATE_DOWNLOADED_TOOLTIP": "Install WowUp update", "WOWUP_UPDATE_INSTALL_MESSAGE": "Do you want to restart WowUp and install the update?", "WOWUP_UPDATE_INSTALL_TITLE": "WowUp Update Ready", diff --git a/wowup-electron/src/assets/i18n/es.json b/wowup-electron/src/assets/i18n/es.json index 7d00eaa9..a497cf1f 100644 --- a/wowup-electron/src/assets/i18n/es.json +++ b/wowup-electron/src/assets/i18n/es.json @@ -3,9 +3,14 @@ "AUTO_UPDATE_NOTIFICATION_BODY": "Automatically updated {count} {count, plural, =1{addon} other{addons}}.", "AUTO_UPDATE_NOTIFICATION_TITLE": "Auto Updates", "SYSTEM_TRAY": { + "CHECK_UPDATE": "Check for Updates...", "QUIT_ACTION": "Quit", "SHOW_ACTION": "Show" }, + "WOWUP_UPDATE": { + "NOT_AVAILABLE": "Latest version of WowUp is already installed", + "UPDATE_ERROR": "Failed to get WowUp update" + }, "WOWUP_UPDATE_DOWNLOADED_TOOLTIP": "Install WowUp update", "WOWUP_UPDATE_INSTALL_MESSAGE": "Do you want restart WowUp to install the update?", "WOWUP_UPDATE_INSTALL_TITLE": "WowUp Update Ready", diff --git a/wowup-electron/src/assets/i18n/fr.json b/wowup-electron/src/assets/i18n/fr.json index b30357a3..ecb8335b 100644 --- a/wowup-electron/src/assets/i18n/fr.json +++ b/wowup-electron/src/assets/i18n/fr.json @@ -3,9 +3,14 @@ "AUTO_UPDATE_NOTIFICATION_BODY": "Automatically updated {count} {count, plural, =1{addon} other{addons}}.", "AUTO_UPDATE_NOTIFICATION_TITLE": "Auto Updates", "SYSTEM_TRAY": { + "CHECK_UPDATE": "Check for Updates...", "QUIT_ACTION": "Quit", "SHOW_ACTION": "Show" }, + "WOWUP_UPDATE": { + "NOT_AVAILABLE": "Latest version of WowUp is already installed", + "UPDATE_ERROR": "Failed to get WowUp update" + }, "WOWUP_UPDATE_DOWNLOADED_TOOLTIP": "Install WowUp update", "WOWUP_UPDATE_INSTALL_MESSAGE": "Do you want restart WowUp to install the update?", "WOWUP_UPDATE_INSTALL_TITLE": "WowUp Update Ready", diff --git a/wowup-electron/src/assets/i18n/it.json b/wowup-electron/src/assets/i18n/it.json index 46b1b7c1..428ec2a7 100644 --- a/wowup-electron/src/assets/i18n/it.json +++ b/wowup-electron/src/assets/i18n/it.json @@ -3,9 +3,14 @@ "AUTO_UPDATE_NOTIFICATION_BODY": "Automaticamente {count, plural, =1{aggiornato} other{aggiornati}} {count} {count, plural, =1{addon} other{addons}}.", "AUTO_UPDATE_NOTIFICATION_TITLE": "Aggiornamenti automatici", "SYSTEM_TRAY": { + "CHECK_UPDATE": "Check for Updates...", "QUIT_ACTION": "Chiudi", "SHOW_ACTION": "Mostra" }, + "WOWUP_UPDATE": { + "NOT_AVAILABLE": "Latest version of WowUp is already installed", + "UPDATE_ERROR": "Failed to get WowUp update" + }, "WOWUP_UPDATE_DOWNLOADED_TOOLTIP": "Installa l'aggiornamento di WowUp", "WOWUP_UPDATE_INSTALL_MESSAGE": "Vuoi riavviare WowUp per installare l'aggiornamento?", "WOWUP_UPDATE_INSTALL_TITLE": "Aggiornamento di Wowup pronto", diff --git a/wowup-electron/src/assets/i18n/ko.json b/wowup-electron/src/assets/i18n/ko.json index 93f674f2..bb644ec2 100644 --- a/wowup-electron/src/assets/i18n/ko.json +++ b/wowup-electron/src/assets/i18n/ko.json @@ -3,9 +3,14 @@ "AUTO_UPDATE_NOTIFICATION_BODY": "Automatically updated {count} {count, plural, =1{addon} other{addons}}.", "AUTO_UPDATE_NOTIFICATION_TITLE": "Auto Updates", "SYSTEM_TRAY": { + "CHECK_UPDATE": "Check for Updates...", "QUIT_ACTION": "Quit", "SHOW_ACTION": "Show" }, + "WOWUP_UPDATE": { + "NOT_AVAILABLE": "Latest version of WowUp is already installed", + "UPDATE_ERROR": "Failed to get WowUp update" + }, "WOWUP_UPDATE_DOWNLOADED_TOOLTIP": "Install WowUp update", "WOWUP_UPDATE_INSTALL_MESSAGE": "Do you want restart WowUp to install the update?", "WOWUP_UPDATE_INSTALL_TITLE": "WowUp Update Ready", diff --git a/wowup-electron/src/assets/i18n/nb.json b/wowup-electron/src/assets/i18n/nb.json index 87dc2fdf..f894de24 100644 --- a/wowup-electron/src/assets/i18n/nb.json +++ b/wowup-electron/src/assets/i18n/nb.json @@ -3,9 +3,14 @@ "AUTO_UPDATE_NOTIFICATION_BODY": "{count} {count, plural, =1{utvidelse} other{utvidelse} ble automatisk oppdatert}.", "AUTO_UPDATE_NOTIFICATION_TITLE": "Automatiske Oppdateringer", "SYSTEM_TRAY": { + "CHECK_UPDATE": "Check for Updates...", "QUIT_ACTION": "Quit", "SHOW_ACTION": "Show" }, + "WOWUP_UPDATE": { + "NOT_AVAILABLE": "Latest version of WowUp is already installed", + "UPDATE_ERROR": "Failed to get WowUp update" + }, "WOWUP_UPDATE_DOWNLOADED_TOOLTIP": "Installer oppdatering til WowUp", "WOWUP_UPDATE_INSTALL_MESSAGE": "Vil du restarte WowUp for å installere oppdateringen?", "WOWUP_UPDATE_INSTALL_TITLE": "WowUp-oppdatering er klar", diff --git a/wowup-electron/src/assets/i18n/pt.json b/wowup-electron/src/assets/i18n/pt.json index 9483dd01..92107693 100644 --- a/wowup-electron/src/assets/i18n/pt.json +++ b/wowup-electron/src/assets/i18n/pt.json @@ -3,9 +3,14 @@ "AUTO_UPDATE_NOTIFICATION_BODY": "Automatically updated {count} {count, plural, =1{addon} other{addons}}.", "AUTO_UPDATE_NOTIFICATION_TITLE": "Auto Updates", "SYSTEM_TRAY": { + "CHECK_UPDATE": "Check for Updates...", "QUIT_ACTION": "Quit", "SHOW_ACTION": "Show" }, + "WOWUP_UPDATE": { + "NOT_AVAILABLE": "Latest version of WowUp is already installed", + "UPDATE_ERROR": "Failed to get WowUp update" + }, "WOWUP_UPDATE_DOWNLOADED_TOOLTIP": "Install WowUp update", "WOWUP_UPDATE_INSTALL_MESSAGE": "Do you want restart WowUp to install the update?", "WOWUP_UPDATE_INSTALL_TITLE": "WowUp Update Ready", diff --git a/wowup-electron/src/assets/i18n/ru.json b/wowup-electron/src/assets/i18n/ru.json index 4cb845bf..4e814b72 100644 --- a/wowup-electron/src/assets/i18n/ru.json +++ b/wowup-electron/src/assets/i18n/ru.json @@ -3,9 +3,14 @@ "AUTO_UPDATE_NOTIFICATION_BODY": "Автоматически {count, plural, one{обновлена} other{обновлено}} {count} {count, plural, one{модификация} few{модификации} other{модификаций}}.", "AUTO_UPDATE_NOTIFICATION_TITLE": "Автоматические обновления", "SYSTEM_TRAY": { + "CHECK_UPDATE": "Check for Updates...", "QUIT_ACTION": "Выход", "SHOW_ACTION": "Показать" }, + "WOWUP_UPDATE": { + "NOT_AVAILABLE": "Latest version of WowUp is already installed", + "UPDATE_ERROR": "Failed to get WowUp update" + }, "WOWUP_UPDATE_DOWNLOADED_TOOLTIP": "Установить обновление WowUp", "WOWUP_UPDATE_INSTALL_MESSAGE": "Вы хотите перезапустить WowUp чтобы установить обновление?", "WOWUP_UPDATE_INSTALL_TITLE": "Для WowUp готово обновление", diff --git a/wowup-electron/src/assets/i18n/zh.json b/wowup-electron/src/assets/i18n/zh.json index 6bf1e9da..54201d92 100644 --- a/wowup-electron/src/assets/i18n/zh.json +++ b/wowup-electron/src/assets/i18n/zh.json @@ -3,9 +3,14 @@ "AUTO_UPDATE_NOTIFICATION_BODY": "Automatically updated {count} {count, plural, =1{addon} other{addons}}.", "AUTO_UPDATE_NOTIFICATION_TITLE": "Auto Updates", "SYSTEM_TRAY": { + "CHECK_UPDATE": "Check for Updates...", "QUIT_ACTION": "Quit", "SHOW_ACTION": "Show" }, + "WOWUP_UPDATE": { + "NOT_AVAILABLE": "Latest version of WowUp is already installed", + "UPDATE_ERROR": "Failed to get WowUp update" + }, "WOWUP_UPDATE_DOWNLOADED_TOOLTIP": "Install WowUp update", "WOWUP_UPDATE_INSTALL_MESSAGE": "Do you want restart WowUp to install the update?", "WOWUP_UPDATE_INSTALL_TITLE": "WowUp Update Ready", diff --git a/wowup-electron/src/common/constants.ts b/wowup-electron/src/common/constants.ts index 25ec62e3..70c04091 100644 --- a/wowup-electron/src/common/constants.ts +++ b/wowup-electron/src/common/constants.ts @@ -43,3 +43,5 @@ export const APP_UPDATE_AVAILABLE = "app-update-available"; export const APP_UPDATE_START_DOWNLOAD = "app-update-start-download"; export const APP_UPDATE_INSTALL = "app-update-install"; export const APP_UPDATE_CHECK_FOR_UPDATE = "app-update-check-for-update"; +export const APP_UPDATE_CHECK_START = "app-update-check-start"; +export const APP_UPDATE_CHECK_END = "app-update-check-end"; \ No newline at end of file diff --git a/wowup-electron/src/common/wowup/system-tray-config.ts b/wowup-electron/src/common/wowup/system-tray-config.ts index 91706f2f..7b59040b 100644 --- a/wowup-electron/src/common/wowup/system-tray-config.ts +++ b/wowup-electron/src/common/wowup/system-tray-config.ts @@ -1,4 +1,5 @@ export interface SystemTrayConfig { showLabel: string; quitLabel: string; + checkUpdateLabel: string; } diff --git a/wowup-electron/src/styles.scss b/wowup-electron/src/styles.scss index 3e444a21..7f32fdd9 100644 --- a/wowup-electron/src/styles.scss +++ b/wowup-electron/src/styles.scss @@ -298,6 +298,10 @@ img { .addon-version { color: $white-2; } + + .addon-update-available { + color: $artifact; + } } } @@ -401,6 +405,10 @@ img { } } +.error-text { + color: red; +} + .no-tabs { &.mat-tab-group { .mat-tab-header { @@ -408,3 +416,12 @@ img { } } } + +snack-bar-container { + &.center-text { + span { + margin: auto; + text-align: center; + } + } +} diff --git a/wowup-electron/src/variables.scss b/wowup-electron/src/variables.scss index 2e74cf74..1efe7c34 100644 --- a/wowup-electron/src/variables.scss +++ b/wowup-electron/src/variables.scss @@ -18,3 +18,5 @@ $white-4: #bbbbbb; $rare-color: #0070dd; $epic-color: #a335ee; + +$artifact: #dbcc78; diff --git a/wowup-electron/system-tray.ts b/wowup-electron/system-tray.ts index 809d998a..991c0de2 100644 --- a/wowup-electron/system-tray.ts +++ b/wowup-electron/system-tray.ts @@ -33,6 +33,13 @@ export function createTray( } }, }, + // Removing this for now per discussion with zak + // { + // label: config.showLabel || "Check for Updates...", + // click: () => { + // checkForUpdates(window); + // }, + // }, { label: config.quitLabel || "Quit", role: "quit",