2020-01-23 20:10:11 +00:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
|
|
|
import { MatSlideToggleChange } from '@angular/material';
|
|
|
|
|
|
|
|
import { OpenLPService } from '../../openlp.service';
|
|
|
|
import { PageTitleService } from '../../page-title.service';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'openlp-themes',
|
|
|
|
templateUrl: './themes.component.html',
|
|
|
|
styleUrls: ['./themes.component.scss'],
|
|
|
|
providers: [OpenLPService]
|
|
|
|
})
|
|
|
|
export class ThemesComponent implements OnInit {
|
2020-05-09 07:02:05 +00:00
|
|
|
private _theme = null;
|
|
|
|
private _themeList = [];
|
|
|
|
private _themeLevel = null;
|
2020-01-23 20:10:11 +00:00
|
|
|
|
|
|
|
constructor(private pageTitleService: PageTitleService, private openlpService: OpenLPService) {
|
|
|
|
pageTitleService.changePageTitle('Themes');
|
|
|
|
}
|
|
|
|
|
|
|
|
ngOnInit() {
|
|
|
|
this.getThemeLevel();
|
|
|
|
this.getThemes();
|
2020-05-09 07:02:05 +00:00
|
|
|
this.getTheme();
|
2020-01-23 20:10:11 +00:00
|
|
|
}
|
|
|
|
|
2020-05-09 07:02:05 +00:00
|
|
|
get theme(): string {
|
|
|
|
return this._theme;
|
2020-01-23 20:10:11 +00:00
|
|
|
}
|
|
|
|
|
2020-05-09 07:02:05 +00:00
|
|
|
set theme(themeName: string) {
|
|
|
|
this._theme = themeName;
|
|
|
|
this.openlpService.setTheme(themeName).subscribe();
|
2020-01-23 20:10:11 +00:00
|
|
|
}
|
|
|
|
|
2020-05-09 07:02:05 +00:00
|
|
|
get themeList(): Array<string> {
|
|
|
|
return this._themeList;
|
2020-01-23 20:10:11 +00:00
|
|
|
}
|
|
|
|
|
2020-05-09 07:02:05 +00:00
|
|
|
get themeLevel(): string {
|
|
|
|
return this._themeLevel;
|
2020-01-23 20:10:11 +00:00
|
|
|
}
|
|
|
|
|
2020-05-09 07:02:05 +00:00
|
|
|
set themeLevel(level: string) {
|
|
|
|
this._themeLevel = level;
|
|
|
|
this.openlpService.setThemeLevel(level).subscribe();
|
2020-01-23 20:10:11 +00:00
|
|
|
}
|
|
|
|
|
2020-05-09 07:02:05 +00:00
|
|
|
isThemeLevelSupported(): boolean {
|
|
|
|
return this._themeLevel !== 'song';
|
|
|
|
}
|
|
|
|
|
|
|
|
getThemeLevel() {
|
|
|
|
this.openlpService.getThemeLevel().subscribe(themeLevel => this._themeLevel = themeLevel);
|
|
|
|
}
|
|
|
|
|
|
|
|
getThemes() {
|
|
|
|
this.openlpService.getThemes().subscribe(themeList => this._themeList = themeList);
|
|
|
|
}
|
|
|
|
|
|
|
|
getTheme() {
|
|
|
|
this.openlpService.getTheme().subscribe(theme => this._theme = theme);
|
2020-01-23 20:10:11 +00:00
|
|
|
}
|
|
|
|
}
|