Skip to content

Commit c46cdb0

Browse files
committed
update screenshots; use the central clock also in settings
1 parent 5b51f21 commit c46cdb0

File tree

7 files changed

+8
-5
lines changed

7 files changed

+8
-5
lines changed

core/app/app.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ func (c *Controller) Startup() {
148148
c.callHistoryFinder = callhistory.New(c.ServiceStatus.StatusChanged)
149149
c.Settings = settings.New(
150150
c.OpenConfigurationFile,
151+
c.clock,
151152
c.openWithExternalApplication,
152153
c.callHistoryFinder,
153154
c.configuration.Station(),

core/settings/settings.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ type View interface {
107107
SetMultisGoal(string)
108108
}
109109

110-
func New(configurationFileOpener ConfigurationFileOpener, browserOpener BrowserOpener, callHistory CallHistory, station core.Station, contest core.Contest) *Settings {
110+
func New(configurationFileOpener ConfigurationFileOpener, clock core.Clock, browserOpener BrowserOpener, callHistory CallHistory, station core.Station, contest core.Contest) *Settings {
111111
result := &Settings{
112112
writer: new(nullWriter),
113+
clock: clock,
113114
view: new(nullView),
114115
configurationFileOpener: configurationFileOpener,
115116
browserOpener: browserOpener,
@@ -132,6 +133,7 @@ func New(configurationFileOpener ConfigurationFileOpener, browserOpener BrowserO
132133

133134
type Settings struct {
134135
writer Writer
136+
clock core.Clock
135137
view View
136138
configurationFileOpener ConfigurationFileOpener
137139
browserOpener BrowserOpener
@@ -432,7 +434,7 @@ func (s *Settings) ContestDefinition(contestIdentifier string) *conval.Definitio
432434
}
433435

434436
func (s *Settings) ProposeContestName(contestIdentifier string) string {
435-
year := time.Now().Format("2006") // TODO use the central clock instead of time.Now()!
437+
year := s.clock.Now().Format("2006")
436438
return fmt.Sprintf("%s %s", contestIdentifier, year)
437439
}
438440

@@ -629,14 +631,14 @@ func (s *Settings) EnterContestStartTime(value string) {
629631
}
630632

631633
func (s *Settings) SetContestStartTimeToday() {
632-
year, month, day := time.Now().Date()
634+
year, month, day := s.clock.Now().Date()
633635
s.contest.StartTime = time.Date(year, month, day, 0, 0, 0, 0, time.UTC)
634636
s.view.HideMessage()
635637
s.view.SetContestStartTime(s.formattedContestStartTime())
636638
}
637639

638640
func (s *Settings) SetContestStartTimeNow() {
639-
s.contest.StartTime = time.Now().UTC().Truncate(time.Hour)
641+
s.contest.StartTime = s.clock.Now().UTC().Truncate(time.Hour)
640642
s.view.HideMessage()
641643
s.view.SetContestStartTime(s.formattedContestStartTime())
642644
}

docs/docu_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Use [flameshot](https://flameshot.org) to take the screenshots. Use the light mo
2626
- only 'My Exchange' for CWT -> [contest_settings_my_exchange_cwt](screenshots/contest_settings_myexchange_cwt.png)
2727
- only 'My Exchange' for RST + serial, 'Gen. Report' selected
2828
- only 'My Exchange' for RST + serial, 'Gen. Report' not selected
29-
- 'New Contest'
29+
- 'New Contest' -> [new_cwt](screenshots/new_cwt.png)
3030
- 'Macros'
3131
- 'QSO-Rate', with some numbered bullet points to explain the graphic's components:
3232
- the ciruclar time indicator
2.52 KB
Loading
396 Bytes
Loading
-3.56 KB
Loading

docs/screenshots/new_cwt.png

14.8 KB
Loading

0 commit comments

Comments
 (0)