diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/documentwidget.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index f6b68034..67cefc9b 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c | |||
@@ -85,24 +85,25 @@ enum iReloadInterval { | |||
85 | }; | 85 | }; |
86 | 86 | ||
87 | static int seconds_ReloadInterval_(enum iReloadInterval d) { | 87 | static int seconds_ReloadInterval_(enum iReloadInterval d) { |
88 | static const int times[] = { 0, 1, 5, 15, 60, 4 * 60, 12 * 60, 24 * 60 }; | 88 | static const int mins[] = { 0, 1, 5, 15, 60, 4 * 60, 12 * 60, 24 * 60 }; |
89 | if (d < 0 || d >= max_ReloadInterval) return 0; | 89 | if (d < 0 || d >= max_ReloadInterval) return 0; |
90 | return times[d]; | 90 | return mins[d] * 60; |
91 | } | 91 | } |
92 | 92 | ||
93 | static const char *label_ReloadInterval_(enum iReloadInterval d) { | 93 | static const char *label_ReloadInterval_(enum iReloadInterval d) { |
94 | static const char *labels[] = { | 94 | switch (d) { |
95 | "Never", | 95 | case never_RelodPeriod: |
96 | "1 minute", | 96 | return cstr_Lang("reload.never"); |
97 | "5 minutes", | 97 | case day_ReloadInterval: |
98 | "15 minutes", | 98 | return cstr_Lang("reload.onceperday"); |
99 | "1 hour", | 99 | case minute_ReloadInterval: |
100 | "4 hours", | 100 | case fiveMinutes_ReloadInterval: |
101 | "12 hours", | 101 | case fifteenMinutes_ReloadInterval: |
102 | "Once per day" | 102 | return formatCStr_Lang("num.minutes.n", seconds_ReloadInterval_(d) / 60); |
103 | }; | 103 | default: |
104 | if (d < 0 || d >= max_ReloadInterval) return 0; | 104 | return formatCStr_Lang("num.hours.n", seconds_ReloadInterval_(d) / 3600); |
105 | return labels[d]; | 105 | } |
106 | return ""; | ||
106 | } | 107 | } |
107 | 108 | ||
108 | struct Impl_PersistentDocumentState { | 109 | struct Impl_PersistentDocumentState { |