~dobey/ubuntu-sso-client/update-4-2

« back to all changes in this revision

Viewing changes to ubuntu_sso/qt/reset_password_page.py

  • Committer: Rodney Dawes
  • Date: 2013-01-09 22:23:57 UTC
  • mfrom: (1011.1.1 update-4-2)
  • Revision ID: rodney.dawes@canonical.com-20130109222357-3jqwkv44hzger1vl
[Mike McCracken]

    - Add util func returning translation function for platform/pyversion/frozen status. (LP: #1074116)

[Rodney Dawes]

    - Ignore some new pep8 errors, and update code to fix others.

[Brian Curtin]

    - Use states from networkstates instead of re-defining them locally.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        """The signals to connect to the backend."""
66
66
        result = {
67
67
            'PasswordChanged':
68
 
             self._filter_by_app_name(self.on_password_changed),
 
68
                self._filter_by_app_name(self.on_password_changed),
69
69
            'PasswordChangeError':
70
 
             self._filter_by_app_name(self.on_password_change_error),
 
70
                self._filter_by_app_name(self.on_password_change_error),
71
71
        }
72
72
        return result
73
73
 
162
162
    def _add_line_edits_validations(self):
163
163
        """Add the validations to be use by the line edits."""
164
164
        self.set_line_edit_validation_rule(
165
 
                                           self.ui.password_line_edit,
166
 
                                           is_min_required_password)
 
165
            self.ui.password_line_edit,
 
166
            is_min_required_password)
167
167
        self.set_line_edit_validation_rule(
168
 
                                    self.ui.confirm_password_line_edit,
169
 
                                    self.is_correct_password_confirmation)
 
168
            self.ui.confirm_password_line_edit,
 
169
            self.is_correct_password_confirmation)
170
170
        # same as the above case, lets connect a signal to a signal
171
171
        self.ui.password_line_edit.textChanged.connect(
172
 
                     self.ui.confirm_password_line_edit.textChanged.emit)
 
172
            self.ui.confirm_password_line_edit.textChanged.emit)
173
173
 
174
174
    def on_password_changed(self, app_name, email):
175
175
        """Let user know that the password was changed."""
177
177
            app_name, email)
178
178
        self.hide_overlay()
179
179
        email = compat.text_type(
180
 
                    self.wizard().forgotten.ui.email_line_edit.text())
 
180
            self.wizard().forgotten.ui.email_line_edit.text())
181
181
        self.passwordChanged.emit(email)
182
182
 
183
183
    def on_password_change_error(self, app_name, error):