Skip to content

Commit

Permalink
Fix #4733 - remove warning on username change
Browse files Browse the repository at this point in the history
If the user changes the username on My Setting -> About me view and then
reverts it to the initial username, remove the warning about restart.
  • Loading branch information
ana-balica authored and dnarvaez committed Mar 13, 2014
1 parent 427f17f commit 88da664
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions extensions/cpsection/aboutme/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,15 @@ def __init__(self, model, alerts):

self._color = XoColor(self._model.get_color())

self._original_nick = self._model.get_nick()
self._setup_color()
self._setup_nick()
self._setup_gender()
self._setup_age()

self._update_pickers(self._color)

self._nick_entry.set_text(self._model.get_nick())
self._nick_entry.set_text(self._original_nick)
self._color_valid = True
self._nick_valid = True
self.needs_restart = False
Expand Down Expand Up @@ -463,13 +464,18 @@ def __nick_timeout_cb(self, widget):
except ValueError, detail:
self._nick_alert.props.msg = detail
self._nick_valid = False
self._nick_alert.show()
else:
self._nick_alert.props.msg = self.restart_msg
self._nick_valid = True
self.needs_restart = True
self.restart_alerts.append('nick')
if widget.get_text() == self._original_nick:
self.restart_alerts.remove('nick')
self._nick_alert.hide()
else:
self._nick_alert.props.msg = self.restart_msg
self.needs_restart = True
self.restart_alerts.append('nick')
self._nick_alert.show()
self._validate()
self._nick_alert.show()
return False

def __color_changed_cb(self, colorpicker, color):
Expand Down

0 comments on commit 88da664

Please sign in to comment.