naturtag.controllers.observation_controller module

class naturtag.controllers.observation_controller.DbPageResult(observations, total_results, is_empty)

Bases: object

Container to pass results from a worker thread to UI thread

is_empty: bool
observations: list[Observation]
total_results: int
class naturtag.controllers.observation_controller.ObservationController

Bases: BaseController

bind_selection(obs_cards)

Connect click signal from each observation card

display_observation(observation)

Display full details for a single observation

display_observation_by_id(observation_id)

Display full observation details

display_user_observations(observations)

Display a page of observations

load_observations_from_db()

Read the current page of observations from the local DB and display them

next_page()
on_db_page_loaded(result)

Handle DB page result on the main thread

on_sync_complete()

Backward-compatible combined completion handler.

on_sync_complete_common()

Called when the background sync finishes (always-run finalization).

on_sync_complete_success()

Called when the background sync finishes without prior sync errors.

on_sync_error_received(exc)

Called when the background sync fails

on_sync_finished

Emitted when the background sync completes

on_sync_page_received(observations)

Called each time the background sync saves a page to the DB

on_sync_progress

(loaded_count, total_count) as pages arrive

on_view_taxon

Request to switch to taxon tab

prev_page()
refresh()
start_background_sync()

Kick off a background worker to fetch all new/updated observations from the API

start_precache_when_ready()

Start thumbnail pre-caching, or defer until sync completes if one is in progress.

staticMetaObject = PySide6.QtCore.QMetaObject("ObservationController" inherits "BaseController": Methods:   #34 type=Signal, signature=on_view_taxon(PyObject), parameters=PyObject   #35 type=Signal, signature=on_sync_progress(int,int), parameters=int, int   #36 type=Signal, signature=on_sync_finished()   #37 type=Slot, signature=display_observation(PyObject), parameters=PyObject   #38 type=Slot, signature=display_user_observations(QVariantList), parameters=QVariantList   #39 type=Slot, signature=on_db_page_loaded(PyObject), parameters=PyObject   #40 type=Slot, signature=on_sync_page_received(PyObject), parameters=PyObject   #41 type=Slot, signature=on_sync_error_received(PyObject), parameters=PyObject   #42 type=Slot, signature=on_sync_complete_common()   #43 type=Slot, signature=on_sync_complete_success()   #44 type=Slot, signature=on_sync_complete()   #45 type=Slot, signature=_on_precache_finished() )
update_pagination_buttons()

Update pagination buttons, gating ‘next’ on pages that have been loaded