Verified Commit 9eefa15d authored by M. Sandoval's avatar M. Sandoval 🥑
Browse files

Rename most action callbacks

parent ec2bc132
......@@ -93,9 +93,9 @@ class Application(Gtk.Application):
def setup_actions(self):
actions = [
("settings", self.on_settings_menu_clicked),
("about", self.on_about_menu_clicked),
("quit", self.on_quit),
("settings", self.show_settings),
("about", self.show_about_dialog),
("quit", self.on_quit_action),
("new", self.window.create_filechooser),
("open", self.window.open_filechooser),
]
......@@ -105,10 +105,10 @@ class Application(Gtk.Application):
simple_action.connect("activate", callback)
self.add_action(simple_action)
def on_settings_menu_clicked(self, action, param):
def show_settings(self, action, param):
SettingsDialog(self.window).on_settings_menu_clicked(action, param)
def on_about_menu_clicked(self, _action: Gio.SimpleAction, _param: None) -> None:
def show_about_dialog(self, _action: Gio.SimpleAction, _param: None) -> None:
"""Invoked when we click "about" in the main menu"""
builder = Gtk.Builder.new_from_resource(
"/org/gnome/PasswordSafe/about_dialog.ui"
......@@ -117,8 +117,8 @@ class Application(Gtk.Application):
about_dialog.set_transient_for(self.window)
about_dialog.show()
def on_quit(self, _action: Gio.SimpleAction | None = None,
_data: Any = None) -> None:
def on_quit_action(self, _action: Gio.SimpleAction | None = None,
_data: Any = None) -> None:
unsaved_databases_list = []
self.window.databases_to_save.clear()
......
......@@ -538,17 +538,17 @@ class MainWindow(Handy.ApplicationWindow):
name = action.props.name
if name == "element.delete":
action_db.on_element_delete_menu_button_clicked()
action_db.on_element_delete_action()
elif name == "entry.duplicate":
action_db.on_entry_duplicate_menu_button_clicked()
action_db.on_entry_duplicate_action()
elif name == "entry.references":
action_db.show_references_dialog()
elif name == "element.properties":
action_db.show_properties_dialog()
elif name == "db.settings":
action_db.on_database_settings_entry_clicked()
action_db.show_database_settings()
elif name == "selection":
action_db.selection_ui.on_selection_action_activated(param)
action_db.selection_ui.on_selection_action(param)
elif name in ["db.save", "db.save_dirty"]:
action_db.save_safe()
elif name == "db.lock":
......
......@@ -146,7 +146,7 @@ class SelectionUI(Gtk.Box):
self.unlocked_database.window.send_notification(_("Move completed"))
self._clear_all()
def on_selection_action_activated(self, param):
def on_selection_action(self, param):
self.unlocked_database.start_database_lock_timer()
selection_type = param.get_string()
......
......@@ -454,14 +454,14 @@ class UnlockedDatabase(GObject.GObject):
)
self.show_edit_page(safe_group)
def on_element_delete_menu_button_clicked(self) -> None:
def on_element_delete_action(self) -> None:
"""Delete the visible entry from the menu."""
parent_group = self.props.current_element.parentgroup
self.database_manager.delete_from_database(self.props.current_element.element)
self.show_browser_page(parent_group)
def on_entry_duplicate_menu_button_clicked(self):
def on_entry_duplicate_action(self):
self.database_manager.duplicate_entry(self.props.current_element.entry)
parent_group = self.props.current_element.parentgroup
......@@ -491,7 +491,7 @@ class UnlockedDatabase(GObject.GObject):
clear_clipboard_time, callback
)
def on_database_settings_entry_clicked(self) -> None:
def show_database_settings(self) -> None:
DatabaseSettingsDialog(self).present()
def on_session_lock(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment