Controller

class mnemosyne.libmnemosyne.controller.Controller(component_manager)

A collection of logic used by the GUI. The logic related to the review process is split out in a separated controller class, to allow that to be swapped out easily.

There are two classes of functions here: ‘show_XXX_dialog’, which needs to be called by the GUI to set everything up to show a certain dialog, and then the other functions, which the implementation of the actual dialog can use to perform GUI-independent operations.

See also ‘How to write a new frontend’ in the docs.

change_card_type(facts, old_card_type, new_card_type, correspondence)

Note: all facts should have the same card type.

clone_card_type(card_type, clone_name)
component_type = 'controller'
create_new_cards(fact_data, card_type, grade, tag_names, check_for_duplicates=True, save=True)
delete_card_type(card_type)
delete_current_card()
delete_facts_and_their_cards(facts)
delete_plugin(plugin)
edit_sister_cards(fact, new_fact_data, old_card_type, new_card_type, new_tag_names, correspondence)
heartbeat()

For code that needs to run periodically.

install_plugin()
save_file()
show_add_cards_dialog()
show_browse_cards_dialog()
show_configuration_dialog()
show_edit_card_dialog()
show_export_file_dialog()
show_getting_started_dialog()
show_import_file_dialog()
show_insert_img_dialog(filter)

Filter contains the file dialog filter with the supported filetypes.

show_insert_sound_dialog(filter)

Filter contains the file dialog filter with the supported filetypes.

show_insert_video_dialog(filter)

Filter contains the file dialog filter with the supported filetypes.

show_manage_card_types_dialog()
show_manage_plugins_dialog()
show_new_file_dialog()
show_open_file_dialog()
show_save_file_as_dialog()
show_statistics_dialog()
show_sync_dialog()
show_tip_dialog()
sync(server, port, username, password, ui=None)
update_title()

Previous topic

Renderer

Next topic

ReviewController

This Page