Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timezone change not accepted on cancel, fixes #3093 #677

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions extensions/cpsection/datetime/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self, model, alerts):
self.restart_alerts = alerts
self._zone_sid = 0
self._cursor_change_handler = None
self._initial_timezone = None

self.set_border_width(style.DEFAULT_SPACING * 2)
self.set_spacing(style.DEFAULT_SPACING)
Expand Down Expand Up @@ -86,9 +87,9 @@ def __init__(self, model, alerts):
self.setup()

def setup(self):
zone = self._model.get_timezone()
self._initial_timezone = self._model.get_timezone()
for row in self._store:
if zone == row[0]:
if self._initial_timezone == row[0]:
self._treeview.set_cursor(row.path, self._timezone_column,
False)
self._treeview.scroll_to_cell(row.path, self._timezone_column,
Expand All @@ -100,6 +101,7 @@ def setup(self):
'cursor-changed', self.__zone_changed_cd)

def undo(self):
self._model.set_timezone(self._initial_timezone)
self._treeview.disconnect(self._cursor_change_handler)
self._model.undo()
self._zone_alert.hide()
Expand Down