Wip start on login

This commit is contained in:
Hinton 2020-11-23 15:04:35 +01:00
parent 2cbe7f3d0a
commit f926f80d8c
4 changed files with 25 additions and 0 deletions

View File

@ -128,6 +128,16 @@
</div> </div>
<small class="help-block">{{startToTrayDescText}}</small> <small class="help-block">{{startToTrayDescText}}</small>
</div> </div>
<div class="form-group">
<div class="checkbox">
<label for="startOnLogin">
<input id="startOnLogin" type="checkbox" name="StartOnLogin" [(ngModel)]="startOnLogin"
(change)="saveStartOnLogin()">
{{'startOnLogin' | i18n}}
</label>
</div>
<small class="help-block">{{'startOnLoginDesc' | i18n}}</small>
</div>
<div class="form-group" *ngIf="showAlwaysShowDock"> <div class="form-group" *ngIf="showAlwaysShowDock">
<div class="checkbox"> <div class="checkbox">
<label for="alwaysShowDock"> <label for="alwaysShowDock">

View File

@ -51,6 +51,7 @@ export class SettingsComponent implements OnInit {
biometricText: string; biometricText: string;
alwaysShowDock: boolean; alwaysShowDock: boolean;
showAlwaysShowDock: boolean = false; showAlwaysShowDock: boolean = false;
startOnLogin: boolean;
enableTrayText: string; enableTrayText: string;
enableTrayDescText: string; enableTrayDescText: string;
@ -306,6 +307,10 @@ export class SettingsComponent implements OnInit {
await this.storageService.save(ElectronConstants.alwaysShowDock, this.alwaysShowDock); await this.storageService.save(ElectronConstants.alwaysShowDock, this.alwaysShowDock);
} }
async saveStartOnLogin() {
this.messagingService.send(this.startOnLogin ? 'addOpenAtLogin' : 'removeOpenAtLogin');
}
private callAnalytics(name: string, enabled: boolean) { private callAnalytics(name: string, enabled: boolean) {
const status = enabled ? 'Enabled' : 'Disabled'; const status = enabled ? 'Enabled' : 'Disabled';
this.analytics.eventTrack.next({ action: `${status} ${name}` }); this.analytics.eventTrack.next({ action: `${status} ${name}` });

View File

@ -888,6 +888,12 @@
"startToMenuBarDesc": { "startToMenuBarDesc": {
"message": "When the application is first started, only show an icon in the menu bar." "message": "When the application is first started, only show an icon in the menu bar."
}, },
"startOnLogin": {
"message": "Start automatically on login"
},
"startOnLoginDesc": {
"message": "Start the Bitwarden Desktop application automatically on login."
},
"alwaysShowDock": { "alwaysShowDock": {
"message": "Always show in the Dock" "message": "Always show in the Dock"
}, },

View File

@ -44,6 +44,10 @@ export class MessagingMain {
case 'hideToTray': case 'hideToTray':
this.main.trayMain.hideToTray(); this.main.trayMain.hideToTray();
break; break;
case 'addStartOnLogin':
break;
case 'removeStartOnLogin':
break;
default: default:
break; break;
} }