Navigation Menu

Skip to content

Commit

Permalink
webapp: Locale settings - only enable the save but if something changed
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-h committed May 12, 2022
1 parent 7abd8f7 commit b2fda96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
Expand Up @@ -40,7 +40,9 @@

<ng-template pTemplate="footer">
<div class="p-grid p-nogutter p-justify-end">
<p-button class="pr-1" label="Save" icon="pi pi-save" iconPos="left" (onClick)="saveForm()"></p-button>
<p-button class="pr-1" label="Save" icon="pi pi-save" iconPos="left" (onClick)="saveForm(); locale.form.markAsPristine()"
[disabled]="(!locale.dirty || false)">
</p-button>
<p-button class="help-button" label="{{'common.help' | translate}}" (onClick)="showHelp()" icon="pi pi-info-circle" styleClass="p-button-info" ></p-button>
</div>
</ng-template>
Expand Down
Expand Up @@ -17,7 +17,7 @@ export class LocaleComponent implements OnInit {
// from frequencies.cpp line 2215
m_FreqTables: string[];

// from
// from
m_TVFormats: string[];

constructor(private setupService: SetupService) {
Expand Down Expand Up @@ -80,7 +80,6 @@ export class LocaleComponent implements OnInit {
}

saveForm() {
console.log("save form clicked");
this.setupService.saveLocaleSettings();
}
}
4 changes: 0 additions & 4 deletions mythtv/html/backend/src/app/services/setup.service.ts
Expand Up @@ -78,12 +78,8 @@ export class SetupService {
}

saveLocaleSettings() {
console.log("TVFormat: ", this.m_setupData.General.Locale.TVFormat,"VbiFormat: ", this.m_setupData.General.Locale.VbiFormat, "FreqTable: ", this.m_setupData.General.Locale.FreqTable);
this.mythService.PutSetting({ HostName: "_GLOBAL_", Key: "TVFormat", Value: this.m_setupData.General.Locale.TVFormat }).subscribe(result => { console.log("TVFormat: ", result.bool); });
this.mythService.PutSetting({ HostName: "_GLOBAL_", Key: "VbiFormat", Value: this.m_setupData.General.Locale.VbiFormat }).subscribe(result => { console.log("VBIFormat: ", result.bool); });
this.mythService.PutSetting({ HostName: "_GLOBAL_", Key: "FreqTable", Value: this.m_setupData.General.Locale.FreqTable }).subscribe(result => { console.log("FreqTable: ", result.bool); });
//this.mythService.PutSetting({ HostName: "_GLOBAL_", Key: "TVFormat", Value: this.m_setupData.General.Locale.TVFormat });
//this.mythService.PutSetting({ HostName: "_GLOBAL_", Key: "VbiFormat", Value: this.m_setupData.General.Locale.VbiFormat });
//this.mythService.PutSetting({ HostName: "_GLOBAL_", Key: "FreqTable", Value: this.m_setupData.General.Locale.FreqTable });
}
}

0 comments on commit b2fda96

Please sign in to comment.