mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 08:22: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:
|
def _rolloverHour(self) -> int:
|
||||||
return self.col.conf.get("rollover", 4)
|
return self.col.conf.get("rollover", 4)
|
||||||
|
|
||||||
# New timezone handling
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
def _timing_today(self) -> SchedTimingToday:
|
def _timing_today(self) -> SchedTimingToday:
|
||||||
return self.col.backend.sched_timing_today(
|
return self.col.backend.sched_timing_today(
|
||||||
self.col.crt,
|
self.col.crt,
|
||||||
|
@ -1407,6 +1404,12 @@ where id = ?
|
||||||
def _creation_timezone_offset(self) -> Optional[int]:
|
def _creation_timezone_offset(self) -> Optional[int]:
|
||||||
return self.col.conf.get("creationOffset", None)
|
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):
|
def set_creation_offset(self):
|
||||||
"""Save the UTC west offset at the time of creation into the DB.
|
"""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)
|
f.new_timezone.setVisible(False)
|
||||||
else:
|
else:
|
||||||
f.newSched.setChecked(True)
|
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):
|
def updateCollection(self):
|
||||||
f = self.form
|
f = self.form
|
||||||
|
@ -124,7 +124,7 @@ class Preferences(QDialog):
|
||||||
qc["dayLearnFirst"] = f.dayLearnFirst.isChecked()
|
qc["dayLearnFirst"] = f.dayLearnFirst.isChecked()
|
||||||
self._updateDayCutoff()
|
self._updateDayCutoff()
|
||||||
if self.mw.col.schedVer() != 1:
|
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()
|
is_enabled = f.new_timezone.isChecked()
|
||||||
if was_enabled != is_enabled:
|
if was_enabled != is_enabled:
|
||||||
if is_enabled:
|
if is_enabled:
|
||||||
|
|
Loading…
Reference in a new issue