Exemple #1
0
    def __init__(self, parent, cfg, clipboard=None):
        Utility.__init__(self, parent, _('Password Generator'),
                         ((gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE),
                          (ui.STOCK_GENERATE, gtk.RESPONSE_OK)))

        self.config = cfg
        self.set_modal(False)

        self.section = self.add_section(_('Password Generator'))

        self.entry = ui.PasswordEntry(None, cfg, clipboard)
        self.entry.autocheck = False
        self.entry.set_editable(False)
        self.entry.set_tooltip_text(_('The generated password'))
        self.section.append_widget(_('Password'), self.entry)

        self.spin_pwlen = ui.SpinEntry()
        self.spin_pwlen.set_range(4, 256)
        self.spin_pwlen.set_value(self.config.get("passwordgen/length"))
        self.spin_pwlen.set_tooltip_text(
            _('The number of characters in generated passwords - 8 or more are recommended'
              ))
        self.section.append_widget(_('Length'), self.spin_pwlen)

        self.check_punctuation_chars = ui.CheckButton(
            _('Use punctuation characters for passwords'))
        if self.config.get("passwordgen/length"):
            self.check_punctuation_chars.set_active(True)

        self.check_punctuation_chars.set_tooltip_text(
            _('When passwords are generated, use punctuation characters like %, =, { or .'
              ))
        self.section.append_widget(None, self.check_punctuation_chars)

        self.connect("response", self.__cb_response)
Exemple #2
0
    def __init__(self, parent, filename):
        Password.__init__(
            self, parent, _('Enter password for file'),
            _('Please enter a password for the file \'%s\'. You will need this password to open the file at a later time.'
              ) % filename, gtk.STOCK_SAVE)

        self.entry_new = self.add_entry(_('New password'), ui.PasswordEntry())
        self.entry_confirm = self.add_entry(_('Confirm password'))
        self.entry_confirm.autocheck = False
Exemple #3
0
    def __init__(self, parent, password=None):
        Password.__init__(
            self, parent, _('Enter new password'),
            _('Enter a new password for the current data file. The file must be saved before the new password is applied.'
              ), ui.STOCK_PASSWORD_CHANGE)

        self.password = password

        if password is not None:
            self.entry_current = self.add_entry(_('Current password'))

        self.entry_new = self.add_entry(_('New password'), ui.PasswordEntry())
        self.entry_confirm = self.add_entry(_('Confirm password'))
        self.entry_confirm.autocheck = False
Exemple #4
0
    def __init__(self, parent, cfg=None, clipboard=None):
        Utility.__init__(self, parent, _('Password Checker'),
                         ((gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE), ))

        self.cfg = cfg
        self.set_modal(False)
        self.set_size_request(300, -1)

        self.section = self.add_section(_('Password Checker'))

        self.entry = ui.PasswordEntry(None, cfg, clipboard)
        self.entry.autocheck = False
        self.entry.set_width_chars(40)
        self.entry.connect("changed", self.__cb_changed)
        self.entry.set_tooltip_text(_('Enter a password to check'))
        self.section.append_widget(_('Password'), self.entry)

        self.result = ui.ImageLabel(_('Enter a password to check'),
                                    ui.STOCK_UNKNOWN, ui.ICON_SIZE_HEADLINE)
        self.result.set_tooltip_text(_('The result of the check'))
        self.section.append_widget(None, self.result)

        self.connect("response", self.__cb_response)