mirror of
https://gitlab.gnome.org/World/Authenticator.git
synced 2025-03-05 17:20:57 +01:00
Settings: fix notifications
This commit is contained in:
parent
3fb0d87c43
commit
c260624e1c
4 changed files with 2 additions and 29 deletions
|
@ -16,15 +16,5 @@
|
|||
<summary>Default window maximized behaviour</summary>
|
||||
<description></description>
|
||||
</key>
|
||||
<key name="is-locked" type="b">
|
||||
<default>false</default>
|
||||
<summary>Whether the application is locked with a password or not</summary>
|
||||
<description></description>
|
||||
</key>
|
||||
<key name="can-be-locked" type="b">
|
||||
<default>false</default>
|
||||
<summary>Whether the application can be locked or not</summary>
|
||||
<description></description>
|
||||
</key>
|
||||
</schema>
|
||||
</schemalist>
|
||||
|
|
|
@ -89,7 +89,7 @@ class Application(Gtk.Application):
|
|||
def __generate_menu(self):
|
||||
"""Generate application menu."""
|
||||
# Lock/Unlock
|
||||
if Settings.get_default().can_be_locked:
|
||||
if Keyring.get_default().has_password():
|
||||
lock_content = Gio.Menu.new()
|
||||
lock_content.append_item(Gio.MenuItem.new(_("Lock the application"), "app.lock"))
|
||||
self._menu.append_item(Gio.MenuItem.new_section(None, lock_content))
|
||||
|
|
|
@ -92,20 +92,3 @@ class Settings(Gio.Settings):
|
|||
:type is_maximized: bool
|
||||
"""
|
||||
self.set_boolean("is-maximized", is_maximized)
|
||||
|
||||
@property
|
||||
def is_locked(self):
|
||||
return self.get_boolean("is-locked")
|
||||
|
||||
@is_locked.setter
|
||||
def is_locked(self, state):
|
||||
self.set_boolean("is-locked", state)
|
||||
|
||||
@property
|
||||
def can_be_locked(self):
|
||||
return self.get_boolean("can-be-locked")
|
||||
|
||||
@can_be_locked.setter
|
||||
def can_be_locked(self, state):
|
||||
self.set_boolean("can-be-locked", state)
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ class SettingsWindow(Gtk.Window):
|
|||
def __on_app_set_password(self, __, state):
|
||||
if state and not Keyring.get_default().has_password():
|
||||
self.props.view = SettingsView.PASSWORD
|
||||
else:
|
||||
elif Keyring.get_default().has_password():
|
||||
Keyring.get_default().clear_password()
|
||||
self.__send_notification(_("Authentication password was unset. Please restart the application"))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue