Skip to content

Commit

Permalink
use the same filename proposal function also for new contest logs
Browse files Browse the repository at this point in the history
  • Loading branch information
ftl committed Jun 24, 2023
1 parent 3a4da51 commit 8fd04cb
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,11 @@ func (c *Controller) Quit() {
}

func (c *Controller) proposeFilename() string {
result := strings.Join([]string{c.Settings.Contest().Name, c.Settings.Station().Callsign.BaseCall}, " ")
return proposeFilename(c.Settings.Contest().Name, c.Settings.Station().Callsign.BaseCall)
}

func proposeFilename(contestName, callsign string) string {
result := strings.Join([]string{contestName, callsign}, " ")
result = strings.TrimSpace(result)
result = strings.ToUpper(result)
result = strings.ReplaceAll(result, " ", "_")
Expand All @@ -361,7 +365,7 @@ func (c *Controller) New() {
} else {
proposedName = newContest.Name
}
proposedFilename := proposedName + ".log"
proposedFilename := proposeFilename(proposedName, c.Settings.Station().Callsign.BaseCall) + ".log"

filename, ok, err := c.view.SelectSaveFile("New Logfile", c.configuration.LogDirectory(), proposedFilename, "*.log")
if !ok {
Expand Down

0 comments on commit 8fd04cb

Please sign in to comment.