mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
add back new_timezone_enabled(), as it's used in the prefs screen
This commit is contained in:
parent
427bf268fc
commit
75b7ebb156
2 changed files with 8 additions and 5 deletions
|
@ -1384,9 +1384,6 @@ where id = ?
|
|||
def _rolloverHour(self) -> int:
|
||||
return self.col.conf.get("rollover", 4)
|
||||
|
||||
# New timezone handling
|
||||
##########################################################################
|
||||
|
||||
def _timing_today(self) -> SchedTimingToday:
|
||||
return self.col.backend.sched_timing_today(
|
||||
self.col.crt,
|
||||
|
@ -1407,6 +1404,12 @@ where id = ?
|
|||
def _creation_timezone_offset(self) -> Optional[int]:
|
||||
return self.col.conf.get("creationOffset", None)
|
||||
|
||||
# New timezone handling - GUI helpers
|
||||
##########################################################################
|
||||
|
||||
def new_timezone_enabled(self) -> bool:
|
||||
return self.col.conf.get("creationOffset") is not None
|
||||
|
||||
def set_creation_offset(self):
|
||||
"""Save the UTC west offset at the time of creation into the DB.
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ class Preferences(QDialog):
|
|||
f.new_timezone.setVisible(False)
|
||||
else:
|
||||
f.newSched.setChecked(True)
|
||||
f.new_timezone.setChecked(self.mw.col.sched._new_timezone_enabled())
|
||||
f.new_timezone.setChecked(self.mw.col.sched.new_timezone_enabled())
|
||||
|
||||
def updateCollection(self):
|
||||
f = self.form
|
||||
|
@ -124,7 +124,7 @@ class Preferences(QDialog):
|
|||
qc["dayLearnFirst"] = f.dayLearnFirst.isChecked()
|
||||
self._updateDayCutoff()
|
||||
if self.mw.col.schedVer() != 1:
|
||||
was_enabled = self.mw.col.sched._new_timezone_enabled()
|
||||
was_enabled = self.mw.col.sched.new_timezone_enabled()
|
||||
is_enabled = f.new_timezone.isChecked()
|
||||
if was_enabled != is_enabled:
|
||||
if is_enabled:
|
||||
|
|
Loading…
Reference in a new issue