module timelinelib.wxgui.frames.mainframe.mainframecontroller

class timelinelib.wxgui.frames.mainframe.mainframecontroller.MainFrameController[source]

Bases: object

Controller for MainFrame. It is responsible for the business logic.

__init__(main_frame, db_open_fn, config)[source]

Initialize self. See help(type(self)) for accurate signature.

populate()[source]

Find out if there is info saved in the config object of a last used timeline. If so open that timeline.

set_error_dialog(error_dialog)[source]

For test purposes.

open_timeline_if_exists(path)[source]

Open the timeline file given by path. If the file doesn’t exist an error message is displayed.

set_title()[source]

Update the title of the MainFrame window.

get_readonly_text_in_status_bar()[source]

Return the text to be displayed in the third column of the status bar.

ok_to_edit()[source]

Returns True if no one else is editing the timeline.

edit_ends()[source]

Used to clean up after an update, such as releasing the lock.

create_new_timeline(timetype=None)[source]

File menu New-action handler that creates a new timline.

open_existing_timeline()[source]

File menu Open-action handler that opens an existing timeline.

save_as()[source]

File menu SaveAs-action handler to save the current timeline with a different name.

start_slide_show()[source]

View menu action handler to create a slide show.

measure_distance_between_two_events()[source]

Display an information message box that describes the distance between two selected events in the timeline.

open_gregorian_tutorial_timeline(*args, **kwargs)[source]

Help menu action handler to open a sample Gregorian timeline, in read-only mode.

open_numeric_tutorial_timeline(*args, **kwargs)[source]

Help menu action handler to open a sample Numeric timeline, in read-only mode.

get_visible_categories()[source]

Used by the function export-to-listbox to select events to export.

filtered_listbox_export is a flag that can be set in the settings dialog and decides if the export function shall filter out events having categories that are not shown in the timeline.

Returns:

list: A list of categories

get_start_and_end_for_all_visible_events()[source]

Return start time for the first visible event and the end time for the last visible event.

save_application_config()[source]

Save user settings to percistent storage.

set_timeline_in_readonly_mode()[source]

Is called to set a timeline in read-only-mode, which means that it cannot be edited.

This state is not saved when the timeline application is closed or when another timeline is opened. When reopening the timeline file the read-only-mode is gone.

exit()[source]

Actions taken when the application is closed:

  • Stop timers

  • Save configuration data

  • Save timeline data

  • Destroy the MainFrame window