Add download location settings

This commit is contained in:
Geomitron
2024-07-12 15:42:41 -05:00
parent 91e80aed52
commit 7968592893
13 changed files with 168 additions and 52 deletions

View File

@@ -24,7 +24,7 @@
</button>
}
</div>
<h2 class="card-title">{{ download.chartName }}</h2>
<h2 class="card-title">{{ getDownloadName(download) }}</h2>
<progress
[attr.value]="download.percent"
max="100"

View File

@@ -1,5 +1,9 @@
import { Component, HostBinding } from '@angular/core'
import { SettingsService } from 'src-angular/app/core/services/settings.service'
import { DownloadProgress } from 'src-shared/interfaces/download.interface'
import { resolveChartFolderName } from 'src-shared/UtilFunctions'
import { DownloadService } from '../../../../core/services/download.service'
@Component({
@@ -9,9 +13,16 @@ import { DownloadService } from '../../../../core/services/download.service'
export class DownloadsModalComponent {
@HostBinding('class.contents') contents = true
constructor(public downloadService: DownloadService) { }
constructor(
public downloadService: DownloadService,
public settingsService: SettingsService,
) { }
showFile(filepath: string) {
window.electron.emit.showFile(filepath)
}
getDownloadName(download: DownloadProgress) {
return resolveChartFolderName(this.settingsService.chartFolderName, download.chart)
}
}