PyQt UI Reference

Qt UI Elements

BlackboardSync Qt GUI.

class blackboard_sync.qt.qt_elements.Assets[source]

Helper class to get the path of app assets.

classmethod icon() QIcon[source]

QIcon of application logo.

classmethod load_ui(qt_obj)[source]

Load a UI file for a QObject.

classmethod watermark() QPixmap[source]

QPixmap of application watermark.

class blackboard_sync.qt.qt_elements.LoginWebView(start_url: str, target_url: str)[source]

Blackboard login widget.

Create instance of LoginWebView.

Clear the HTTP cache and cookies.

property cookie_jar: RequestsCookieJar

Contains session cookies of the current session.

property login_complete_signal

Fire when the login flow has completed.

restore() None[source]
property url: str

URL of current website.

class blackboard_sync.qt.qt_elements.LoginWindow[source]

Deprecated widget previously used to login.

class blackboard_sync.qt.qt_elements.OSUtils[source]
static add_to_startup() None[source]

Add the app to start up on macOS.

static open_dir_in_file_browser(dir_to_open: Path) None[source]

Start a subprocess to open the default file explorer at the given location.

class blackboard_sync.qt.qt_elements.PersistenceWarning[source]

QDialog shown if user chooses to store their login details on their device.

Create instance of PersistenceWarning Dialog.

class blackboard_sync.qt.qt_elements.RedownloadDialog[source]

QMessageBox shown after a change in download location.

It consults the user about whether files should be redownloaded to the new location or not.

Create a RedownloadDialog.

property redownload: bool

Indicate if files have to be redownloaded.

class blackboard_sync.qt.qt_elements.SettingsWindow[source]

Settings windown UI element.

Create instance of SettingsWindow.

property download_location: Path

Path of download location.

property log_out_signal

Fire when user chooses to log out.

property save_signal

Fire when settings are saved.

property setup_wiz_signal

Fire when user wants to redo initial setup.

property sync_frequency: int

Seconds to wait between each sync job.

property username: str

Username of current session.

class blackboard_sync.qt.qt_elements.SetupWizard(institutions: list[str])[source]

Initial setup wizard.

Create a SetupWizard.

Parameters:

institutions (list[str]) – List of institution names

class Pages(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Pages contained in the wizard.

DOWNLOAD_LOCATION = 2
DOWNLOAD_SINCE = 3
INSTITUTION = 1
INTRO = 0
LAST = 3
property download_location: Path

Sync location path selected by user.

initializePage(self, id: int)[source]
property institution: str

Text of item selected in institution combo box.

property institution_index: int

Index of item selected in institution combo box.

property min_year: int | None

Courses from this year onward will be downloaded.

validateCurrentPage() bool[source]

Override QWizard method to validate pages.

class blackboard_sync.qt.qt_elements.SyncPeriod(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Enum containing all valid Sync intervals for this UI.

HALF_HOUR = 1800
ONE_HOUR = 3600
SIX_HOURS = 21600
class blackboard_sync.qt.qt_elements.SyncTrayIcon[source]

BlackboardSync system tray icon.

Create a QSystemTrayIcon.

property login_signal

Fire once user is authenticated.

property open_dir_signal

Fire once user wants to open download directory.

property quit_signal

Fire once user decides to quit app.

property reset_setup_signal

Fire when the user wants to reset the initial setup.

set_logged_in(logged: bool) None[source]

Set logged-in status in menu.

property settings_signal

Fire when the settings menu is opened.

property show_menu_signal

Fire when menu is about to be shown.

show_msg(title: str, msg: str, severity: int = 1, duration: int = 10) None[source]

Show the user a message through the tray icon.

property sync_signal

Fire if user forces sync.

toggle_currently_syncing(syncing: bool) None[source]

Toggle currently syncing indicator in menu.

update_last_synced(last: str) None[source]

Update last sync time in menu.

class blackboard_sync.qt.qt_elements.SyncTrayMenu(logged_in: bool = False, last_synced: str = '')[source]

QMenu associated with app system tray icon.

Create the menu for a SyncTrayIcon.

Parameters:
  • logged_in (bool) – Whether user is currently logged in.

  • last_synced (str) – Last sync time shown.

set_logged_in(logged: bool) None[source]

Set the UI to reflect logged-in status.

toggle_currently_syncing(syncing: bool) None[source]

Toggle the currently syncing indicator.

update_last_synced(last: str) None[source]

Update the time of last download shown to user.

class blackboard_sync.qt.qt_elements.UniNotSupportedDialog(help_url: str)[source]

QDialog about unsupported Blackboard partners.

Create instance of dialog.

Parameters:

help_url (str) – URL to help website

class blackboard_sync.qt.qt_elements.UpdateFoundDialog[source]

QMessageBox shown after a more recent version was found.

Create a UpdateFoundDialog.

property should_update: bool

Indicate if BBSync should be updated.