sourceselectform

mod:openlp.core.ui.projector.sourceselectform module

Provides the dialog window for selecting video source for projector.

class openlp.core.ui.projector.sourceselectform.FingerTabBarWidget(parent=None, *args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QTabBar

Realign west -orientation tabs to left-right text rather than south-north text Borrowed from http://www.kidstrythisathome.com/2013/03/fingertabs-horizontal-tabs-with-horizontal-text-in-pyqt/

paintEvent(event)[source]

Repaint tab in left-right text orientation.

Parameters:event – Repaint event signal
tabSizeHint(index)[source]

Return tabsize

Parameters:index – Tab index to fetch tabsize from
Returns:instance tabSize
class openlp.core.ui.projector.sourceselectform.FingerTabWidget(parent, *args)[source]

Bases: PyQt5.QtWidgets.QTabWidget

A QTabWidget equivalent which uses our FingerTabBarWidget

Based on thread discussion http://www.riverbankcomputing.com/pipermail/pyqt/2005-December/011724.html

class openlp.core.ui.projector.sourceselectform.SourceSelectSingle(parent, projectordb, edit=False)[source]

Bases: PyQt5.QtWidgets.QDialog

Class for handling selecting the source for the projector to use. Uses single dialog interface.

accept_me()[source]

Slot to accept ‘OK’ button

button_clicked(button)[source]

Checks which button was clicked

Parameters:button – Button that was clicked
Returns:Ok: Saves current edits Delete: Resets text to last-saved text Reset: Reset all text to PJLink default text Cancel: Cancel text edit
delete_sources()[source]
exec(projector, edit=False)[source]

Override initial method so we can build the tabs.

Parameters:projector – Projector instance to build source list from
class openlp.core.ui.projector.sourceselectform.SourceSelectTabs(parent, projectordb, edit=False)[source]

Bases: PyQt5.QtWidgets.QDialog

Class for handling selecting the source for the projector to use. Uses tabbed interface.

accept_me()[source]

Slot to accept ‘OK’ button

button_clicked(button)[source]

Checks which button was clicked

Parameters:button – Button that was clicked
Returns:Ok: Saves current edits Delete: Resets text to last-saved text Reset: Reset all text to PJLink default text Cancel: Cancel text edit
delete_sources()[source]

Delete the sources for this projector

exec(projector)[source]

Override initial method so we can build the tabs.

Parameters:projector – Projector instance to build source list from
openlp.core.ui.projector.sourceselectform.build_tab(group, source_key, default, projector, projectordb, edit=False)[source]

Create the radio button page for a tab. Dictionary will be a 1-key entry where key=tab to setup, val=list of inputs.

source_key: {"groupkey1": {"key11": "key11-text",
                           "key12": "key12-text",
                           ...
                           },
             "groupkey2": {"key21": "key21-text",
                           "key22": "key22-text",
                           ...
                           },
             ...
             }
Parameters:
  • group – Button group widget to add buttons to
  • source_key – Dictionary of sources for radio buttons
  • default – Default radio button to check
  • projector – Projector instance
  • projectordb – ProjectorDB instance for session
  • edit – If we’re editing the source text
openlp.core.ui.projector.sourceselectform.set_button_tooltip(button_bar)[source]

Set the toolip for the standard buttons used

Parameters:button_bar – QDialogButtonBar instance to update
openlp.core.ui.projector.sourceselectform.source_group(inputs, source_text)[source]

Return a dictionary where key is source[0] and values are inputs grouped by source[0].

source_text = dict{"key1": "key1-text",
                   "key2": "key2-text",
                   ...}
return:
    dict{key1[0]: {"key11": "key11-text",
                   "key12": "key12-text",
                   "key13": "key13-text",
                   ...}
         key2[0]: {"key21": "key21-text",
                   "key22": "key22-text",
                   ...}
Parameters:
  • inputs – List of inputs
  • source_text – Dictionary of {code: text} values to display
Returns:

dict