note_splitter.gui module

Various functions for building the graphical user interface.

class note_splitter.gui.SplitSummaryDialog(new_notes: list[note_splitter.note.Note], all_notes: list[note_splitter.note.Note], parent: PySide6.QtWidgets.QWidget)

Bases: PySide6.QtWidgets.QDialog

staticMetaObject = PySide6.QtCore.QMetaObject("SplitSummaryDialog" inherits "QDialog": )
note_splitter.gui.files_browse(parent: PySide6.QtWidgets.QWidget | None, title: str, start_folder_path: Optional[str] = None) list[note_splitter.note.Note]

Opens a file dialog and returns the selected notes.

If the user cancels the dialog, an empty list is returned.

Parameters
  • parent (QtWidgets.QWidget | None) – The parent widget. If not None, the dialog will be centered over the parent.

  • title (str) – The title of the dialog.

  • start_folder_path (str | None) – The folder path that the dialog will open to. If None, the current working directory is used.

note_splitter.gui.folder_browse(parent: PySide6.QtWidgets.QWidget, line_edit: PySide6.QtWidgets.QLineEdit, title: str) str

Opens a folder dialog, sets the line edit’s text, & emits editingFinished.

If the user cancels the dialog, the line edit’s text is not changed, the signal is not emitted, and an empty string is returned. Only folders are shown in the dialog.

note_splitter.gui.request_confirmation(text: str) bool

Asks for confirmation from the user.

Returns True if the user chooses “Yes”, False otherwise.

note_splitter.gui.request_folder_path(folder_description: str) str | None

Prompts the user to select a folder.

Parameters

folder_description (str) – The description of the folder.

Returns

The absolute path to a folder, or None if the user canceled.

Return type

str, None

note_splitter.gui.require_folder_path(folder_description: str) str

Requires the user to choose a folder.

Parameters

folder_description (str) – The description of the folder that the user will be choosing.

Returns

The absolute path to a folder.

Return type

str