_clockalarm.UI package

Submodules

_clockalarm.UI.AlertListWidget module

class _clockalarm.UI.AlertListWidget.AlertListWidget[source]

Bases: PyQt5.QtWidgets.QTableWidget

Visual list displaying the Alerts from the database.

actualize(alert_list)[source]

Actualizes the graphical alert list based on the list given in argument.

alert_list

The list containing all the alerts.

init_ui()[source]

Initialization helper method.

Creates a visual empty grid with column headers ID, Time, Periodicity and Message. If alerts are in the db, fills the list with alerts and sorts them.

_clockalarm.UI.ColorSelectorWidget module

class _clockalarm.UI.ColorSelectorWidget.ColorSelectorWidget(hex_color=None, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Custom widget to selected a color for the notification

button_click()[source]

Called when the color_select_button is clicked.

Choose a color from a palette.

change_event()[source]

Called every times the QLineEdit field is updated.

Update the hex_color value and the color of the QPushButton.

init_ui()[source]

Initialize the GUI of the QWidget

set_hex_color(hex_color)[source]

Set a new hexadecimal color

hex_color

str – The new color.

_clockalarm.UI.MainWindow module

class _clockalarm.UI.MainWindow.MainWindow(application, *args)[source]

Bases: PyQt5.QtWidgets.QMainWindow

Main window interface extending PyQt5.QtWidgets.QMainWindow.

Shows a list of all the alerts retrieved from a JSON file.

application

The main application

*args

The parent pointer or window flags

add_simple_alert()[source]

Creates a SimpleAlertEditWidget and shows it to the user.

closeEvent(event)[source]

Overrides closeEvent() method.

Allows to intercept the window closing event.

delete_alerts()[source]

Deletes the selected alerts.

edit_simple_alert()[source]

Edits the selected alert and shows an SimpleAlertEditWidget to the user.

static export_json_db()[source]

Exports all the Alerts into a JSON file.

static import_json_db()[source]

Imports Alerts from a JSON file into ClockAlarm.

init_ui()[source]

Init helper method to set up the main window.

mute_button_click()[source]

Mutes the alerts and updates the mute button.

tray_icon_click(reason)[source]

Displays the main window when clicking on the app icon in the tray.

_clockalarm.UI.NotificationWidget module

class _clockalarm.UI.NotificationWidget.NotificationWidget(geometry, notification, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Notification widget

geometry

The position and size of the widget on the screen

notification

The notification

init_ui(geom)[source]

Helper method that sets the style of the NotificationWidget.

geom

The position and size of the widget on the screen

mousePressEvent(event)[source]

Override of :class:~PyQt5.QtWidgets.QWidget.mousePressEvent method

popup_close

_clockalarm.UI.SimpleAlertEditWidget module

class _clockalarm.UI.SimpleAlertEditWidget.SimpleAlertEditWidget(alert: _clockalarm.SimpleAlert.SimpleAlert = None)[source]

Bases: PyQt5.QtWidgets.QWidget

Widget allowing to create or edit a SimpleAlert.

alert

A SimpleAlert to edit, default None

init_ui(alert)[source]

Initialization helper method.

alert

The SimpleAlert to edit

_clockalarm.UI.SoundSelectorWidget module

class _clockalarm.UI.SoundSelectorWidget.SoundSelectorWidget(sound_name: str = None, parent=None)[source]

Bases: PyQt5.QtWidgets.QWidget

Costum widget to selected a sound

Select a wave file and import it in the application sound folder.

button_click()[source]

Called when the sound_select_button is clicked. Get a wave sound file path from the file explorer.

init_ui()[source]

Initialize the GUI of the QWidget

load_sound(sound_path: str)[source]

Load the given .wave sound file in the application folder

If the file already exist in the sound folder of the app, nothing append. If a file with the same name already exist in the sound folder, he is overwritten.

sound_path

the full path of the sound file.

Exceptions:
ValueError: If the given sound_path isn’t a valid wave sound.
set_sound(sound: str)[source]

Set a new sound

Modify the name and update the edit field.

sound

str – The new sound basename.

Exceptions:
ValueError: If the sound_name argument isn’t a wave file.

Module contents