2
# -*- coding: utf-8 -*-
6
from utilities import show_error_dialog, _, create_builder
8
# Maximum number of tries for the password
11
class lumChangeUserPasswordDialog():
13
def __init__(self, datapath, username, count = 0):
15
# Create the gtk Builder and load interface files
16
self.__builder = create_builder("LumChangeUserPasswordDialog.ui")
18
self.__dialog = self.__builder.get_object("dialog")
19
self.__datapath = datapath
20
self.__username = username
21
self.__count = count + 1
25
if self.__count > max_tries:
26
show_error_dialog(_("Maximum number of tries reached, aborting."))
29
# References to password entries
30
pe1 = self.__builder.get_object("password_entry_1")
31
pe2 = self.__builder.get_object("password_entry_2")
33
if self.__dialog.run() == 1:
37
show_error_dialog(_("Passwords do not match"))
38
self.__dialog.destroy()
39
dialog = lumChangeUserPasswordDialog(self.__datapath, self.__username, self.__count)
42
self.__dialog.destroy()
45
self.__dialog.destroy()