1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-28 17:27:50 +01:00

start to tray updates

This commit is contained in:
Kyle Spearrin 2019-02-02 12:27:06 -05:00
parent a380188120
commit 65845cd909
5 changed files with 23 additions and 28 deletions

2
jslib

@ -1 +1 @@
Subproject commit b01709240e4fc0674caea4edfebe5e46249c2bd2
Subproject commit 04e6fac5e46b4ab1ab62592c6654396f384bdf76

View File

@ -53,16 +53,6 @@
<small class="help-block">{{'enableMinToTrayDesc' | i18n}}</small>
</div>
<div class="form-group" *ngIf="showMinToTray">
<div class="checkbox">
<label for="startMinimized">
<input id="startMinimized" type="checkbox" name="StartMinimized"
[(ngModel)]="startMinimized" (change)="saveStartMinimized()">
{{'startMinimized' | i18n}}
</label>
</div>
<small class="help-block">{{'startMinimizedDesc' | i18n}}</small>
</div>
<div class="form-group">
<div class="checkbox">
<label for="enableCloseToTray">
<input id="enableCloseToTray" type="checkbox" name="EnableCloseToTray"
@ -72,6 +62,16 @@
</div>
<small class="help-block">{{'enableCloseToTrayDesc' | i18n}}</small>
</div>
<div class="form-group" *ngIf="showMinToTray">
<div class="checkbox">
<label for="startToTray">
<input id="startToTray" type="checkbox" name="StartToTray"
[(ngModel)]="startToTray" (change)="saveStartToTray()">
{{'startToTray' | i18n}}
</label>
</div>
<small class="help-block">{{'startToTrayDesc' | i18n}}</small>
</div>
<div class="form-group">
<label for="theme">{{'theme' | i18n}}</label>
<select id="theme" name="Theme" [(ngModel)]="theme" (change)="saveTheme()">

View File

@ -32,7 +32,7 @@ export class SettingsComponent implements OnInit {
enableCloseToTray: boolean = false;
enableTray: boolean = false;
showMinToTray: boolean = false;
startMinimized: boolean = false;
startToTray: boolean = false;
locale: string;
lockOptions: any[];
localeOptions: any[];
@ -81,7 +81,7 @@ export class SettingsComponent implements OnInit {
this.enableMinToTray = await this.storageService.get<boolean>(ElectronConstants.enableMinimizeToTrayKey);
this.enableCloseToTray = await this.storageService.get<boolean>(ElectronConstants.enableCloseToTrayKey);
this.enableTray = await this.storageService.get<boolean>(ElectronConstants.enableTrayKey);
this.startMinimized = await this.storageService.get<boolean>(ElectronConstants.enableStartMinimizedKey);
this.startToTray = await this.storageService.get<boolean>(ElectronConstants.enableStartToTrayKey);
this.locale = await this.storageService.get<string>(ConstantsService.localeKey);
this.theme = await this.storageService.get<string>(ConstantsService.themeKey);
}
@ -113,9 +113,9 @@ export class SettingsComponent implements OnInit {
this.messagingService.send(this.enableTray ? 'showTray' : 'removeTray');
}
async saveStartMinimized() {
await this.storageService.save(ElectronConstants.enableStartMinimizedKey, this.startMinimized);
this.callAnalytics('StartMinimized', this.startMinimized);
async saveStartToTray() {
await this.storageService.save(ElectronConstants.enableStartToTrayKey, this.startToTray);
this.callAnalytics('StartToTray', this.startToTray);
}
async saveLocale() {

View File

@ -821,11 +821,11 @@
"enableTrayDesc": {
"message": "Always show an icon in the system tray."
},
"startMinimized": {
"message": "Start minimized"
"startToTray": {
"message": "Start To Tray Icon"
},
"startMinimizedDesc": {
"message": "When starting the application, it will only show an icon in the system tray."
"startToTrayDesc": {
"message": "When the application is first started, only show an icon in the system tray."
},
"language": {
"message": "Language"

View File

@ -1,8 +1,4 @@
import {
app,
BrowserWindow,
MenuItemConstructorOptions,
} from 'electron';
import { app } from 'electron';
import * as path from 'path';
import { I18nService } from './services/i18n.service';
@ -12,9 +8,9 @@ import { MessagingMain } from './main/messaging.main';
import { PowerMonitorMain } from './main/powerMonitor.main';
import { ConstantsService } from 'jslib/services/constants.service';
import { ElectronConstants } from 'jslib/electron/electronConstants';
import { LowdbStorageService } from 'jslib/services/lowdbStorage.service';
import { ElectronConstants } from 'jslib/electron/electronConstants';
import { KeytarStorageListener } from 'jslib/electron/keytarStorageListener';
import { ElectronLogService } from 'jslib/electron/services/electronLog.service';
import { ElectronMainMessagingService } from 'jslib/electron/services/electronMainMessaging.service';
@ -104,8 +100,7 @@ export class Main {
click: () => this.messagingService.send('lockVault'),
}]);
await this.updaterMain.init();
if(await this.storageService.get<boolean>(ElectronConstants.enableStartMinimizedKey)) {
if (await this.storageService.get<boolean>(ElectronConstants.enableStartToTrayKey)) {
this.trayMain.hideToTray();
}
}, (e: any) => {