notes#

Item note editor.

The main edit widget is NoteEditor, a

Classes:

DragIndicatorButton([parent])

Dotted button indicating a draggable item.

Highlighter

Class responsible for highlighting urls

Lockfile(index[, parent])

Lockfile to prevent another user from modifying the database whilst an edit is in progress.

NoteContainerWidget([parent])

This widget for storing the added note items.

NoteEditor(index[, parent])

Main widget used to view and edit and add Notes and Tasks.

NoteItemWidget([parent])

The item-wrapper widget for the drag indicator and editor widgets.

NoteTextEditor(text[, read_only, parent])

Custom QTextBrowser widget for writing note items.

RemoveNoteButton([parent])

Button used to remove a note item.

Separator([parent])

A custom label used as an item separator.

class bookmarks.notes.DragIndicatorButton(parent=None)[source]#

Bases: QLabel

Dotted button indicating a draggable item.

The button is responsible for initiating a QDrag operation and setting the mime data. The data is populated with the TodoEditor’s text and the custom mime type. The latter is needed to accept the drag operation in the target drop widget.

Methods:

mouseMoveEvent(event)

Event handler.

mousePressEvent(event)

Event handler.

mouseMoveEvent(event)[source]#

Event handler.

mousePressEvent(event)[source]#

Event handler.

class bookmarks.notes.Highlighter[source]#

Bases: QSyntaxHighlighter

Class responsible for highlighting urls

Methods:

highlightBlock(text)

Highlights the given text.

highlightBlock(text)[source]#

Highlights the given text.

Parameters

text (str) – The text to assess.

Returns

int, int, int

Return type

tuple

class bookmarks.notes.Lockfile(index, parent=None)[source]#

Bases: QSettings

Lockfile to prevent another user from modifying the database whilst an edit is in progress.

class bookmarks.notes.NoteContainerWidget(parent=None)[source]#

Bases: QWidget

This widget for storing the added note items.

As this is the container widget, it is responsible for handling the dragging and setting the order of the contained child widgets.

items#

The added note items.

Type

list

Methods:

dragEnterEvent(event)

Event handler.

dragMoveEvent(event)

Event handler.

dropEvent(event)

Event handler.

dragEnterEvent(event)[source]#

Event handler.

dragMoveEvent(event)[source]#

Event handler.

dropEvent(event)[source]#

Event handler.

class bookmarks.notes.NoteEditor(index, parent=None)[source]#

Bases: QDialog

Main widget used to view and edit and add Notes and Tasks.

Methods:

add_item([idx, text])

Creates a new NoteItemWidget`editor and adds it to :meth:`NoteContainerWidget.items.

clear()

Deletes all note item editors.

eventFilter(widget, event)

Event filter handler.

hideEvent(event)

Hide event handler.

init_lock()

Creates a lock file.

keyPressEvent(event)

Key press event handler.

key_return()

Custom key action.

key_tab()

Custom key action.

refresh()

Populates the list from the database.

save_settings()

Saves the current list of note items to the assets configuration file.

showEvent(event)

Event handler.

sizeHint()

Returns a size hint.

unlock()

Removes the temporary lockfile on close

Attributes:

index

The path used to initialize the widget.

add_item(idx=None, text=None)[source]#

Creates a new NoteItemWidget`editor and adds it to :meth:`NoteContainerWidget.items.

Parameters
  • idx (int) – The index of the item to be added. Optional.

  • text (str) – The text of the item to be added. Optional.

clear()[source]#

Deletes all note item editors.

eventFilter(widget, event)[source]#

Event filter handler.

hideEvent(event)[source]#

Hide event handler.

init_lock()[source]#

Creates a lock file.

This will prevent other sessions editing notes.

keyPressEvent(event)[source]#

Key press event handler.

key_return()[source]#

Custom key action.

key_tab()[source]#

Custom key action.

refresh()[source]#

Populates the list from the database.

save_settings()[source]#

Saves the current list of note items to the assets configuration file.

showEvent(event)[source]#

Event handler.

sizeHint()[source]#

Returns a size hint.

unlock()[source]#

Removes the temporary lockfile on close

property index#

The path used to initialize the widget.

class bookmarks.notes.NoteItemWidget(parent=None)[source]#

Bases: QWidget

The item-wrapper widget for the drag indicator and editor widgets.

Methods:

paintEvent(event)

Event handler.

paintEvent(event)[source]#

Event handler.

class bookmarks.notes.NoteTextEditor(text, read_only=False, parent=None)[source]#

Bases: QTextBrowser

Custom QTextBrowser widget for writing note items.

The editor automatically sets its size to accommodate the contents of the document.

Methods:

adjust_height()

Slot used to set the editor height based on the current item contents.

canInsertFromMimeData(mimedata)

Checks if we can insert from the given mime-type.

contentChanged()

Sets the height of the editor.

dragEnterEvent(event)

Event handler.

dropEvent(event)

Event handler.

keyPressEvent(event)

Key press event handler.

open_url(url)

We're handling the clicking of anchors here manually.

showEvent(event)

Event handler.

adjust_height()[source]#

Slot used to set the editor height based on the current item contents.

canInsertFromMimeData(mimedata)[source]#

Checks if we can insert from the given mime-type.

contentChanged()[source]#

Sets the height of the editor.

dragEnterEvent(event)[source]#

Event handler.

dropEvent(event)[source]#

Event handler.

keyPressEvent(event)[source]#

Key press event handler.

open_url(url)[source]#

We’re handling the clicking of anchors here manually.

showEvent(event)[source]#

Event handler.

class bookmarks.notes.RemoveNoteButton(parent=None)[source]#

Bases: ClickableIconButton

Button used to remove a note item.

Methods:

remove_note()

Remove note item action.

remove_note()[source]#

Remove note item action.

class bookmarks.notes.Separator(parent=None)[source]#

Bases: QLabel

A custom label used as an item separator.

Methods:

dragEnterEvent(event)

Event handler.

dropEvent(event)

Event handler.

dragEnterEvent(event)[source]#

Event handler.

dropEvent(event)[source]#

Event handler.