Source code for qct_interfaces.persist

"""
The definition of the IPersistState interface.
"""
#
# Copyright Qualcomm Technologies Inc, 2019.
# All Rights Reserved
#

# Python imports
from typing import Tuple

# Thirdparty imports
from zope.interface import Interface, Attribute

# Zope interface bends the rules slightly, so ignore these pylint warnings:
# pylint: disable=no-self-argument,inherit-non-class,no-method-argument


[docs]class IPersistState(Interface): """The UI state of the Package Manager application is saved using this interface. This interface will be used as a utility. """ STATE_VERSION = Attribute("A read-only attribute describing the version of the format " "that is being used to save the state. Changes to this " "value occur when incompatible format changes occur.") def save_application_window_state(geometry, dock_state): """Save the top level window geometry and the state of the docking areas. :param geometry: The geometry of the main window. :type geometry: QByteArray :param dock_state: The positions and locations of the docking widgets on the main window. :type dock_state: QByteArray """ def restore_application_window_state(): """Return a two-tuple from the saved state: - the top-level window geometry, as a QByteArray. - the state of the docking areas, as a QByteArray """ def save_config_state(path_to_config_db: str, current_dev_uri: str) -> None: """Save the current user's state, which consists of the file path to the current config database, and the URI of the currently chosen device connection. """ def restore_config_state() -> Tuple[str, str]: """Return from the persistence store the path to the configuration database, and the URI of the previously connected device. """