pycrossword
0.4
Pure-Python implementation of a crossword puzzle generator and editor
|
Custom plugin manager widget to add, delete, (de)activate and move around plugins. More...
Public Member Functions | |
def | __init__ (self, mainwindow, parent=None) |
Constructor. More... | |
def | addMainLayout (self) |
def | update_actions (self) |
Updates the Enabled property of each action based on the current selection in the plugin table. More... | |
def | from_settings (self) |
Updates the plugin table (tree view) from the global settings. More... | |
def | update_active_states (self) |
Sets the 'active' property of custom plugins in the global settings based on the state of the checkboxes in the plugin table. More... | |
def | reload_plugins (self, forced_update=False) |
Re-creates the plugin manager instance (gui::MainWindow::plugin_mgr) and updates the plugins in the manager and the global settings. More... | |
def | select_plugin (self, plcat, plname) |
Locates a plugin in the table by category and name and selects it. More... | |
def | create_syneditor (self, source=None, show=True, modal=False) |
Creates the source code editor dialog and optionally shows it. More... | |
def | add_or_edit_plugin (self, plugin_item=None) |
Adds a new plugin or edits the given plugin. More... | |
def | on_plugin_model_changed (self, item) |
Fires when a plugin is checked or unchecked in the plugin table. More... | |
def | on_tvPlugins_selected (self, selected, deselected) |
Fires when an item (plugin) is selected in the table. More... | |
def | on_act_reload (self) |
The Reload action handler: reloads plugins from the plugin manager. More... | |
def | on_act_add (self) |
The Add action handler: adds a new plugin. More... | |
def | on_act_remove (self) |
The Delete action handler: deletes the selected plugins (>=1 plugins must be selected). More... | |
def | on_act_edit (self) |
The Edit action handler: edits the selected plugin (only one must be selected). More... | |
def | on_act_clear (self) |
The Clear action handler: clears (deletes) all plugins. More... | |
def | on_act_up (self) |
The Up actions handler: moves the selected plugin upwards. More... | |
def | on_act_down (self) |
The Down actions handler: moves the selected plugin downwards. More... | |
Public Attributes | |
mainwindow | |
lo_main | |
tb_main | |
act_reload | |
act_add | |
act_remove | |
act_edit | |
act_clear | |
act_up | |
act_down | |
tvPlugins | |
plugin_model | |
syneditor | |
utils::synteditor::PluginSynEditorWidget inbuilt python code editor More... | |
Private Member Functions | |
def | _make_empty_item (self) |
Shortcut method to create a non-editable, disabled QStandardItem. More... | |
def | _make_padded_row (self, item, empty_count) |
Shortcut method to create a row of QStandardItem elements where the first element is given by 'item' and the rest are dummy items created by CustomPluginManager::_make_empty_item(). More... | |
Custom plugin manager widget to add, delete, (de)activate and move around plugins.
This is basically a tree-like table with a toolbar for manipulating plugins. Each plugin is a single row in the table. Parent nodes in the tree represent plugin categories.
def pycross.forms.CustomPluginManager.__init__ | ( | self, | |
mainwindow, | |||
parent = None |
|||
) |
Constructor.
mainwindow | QtWidgets.QMainWindow pointer to gui::MainWindow instance |
parent | QtWidgets.QWidget parent widget (default = None , i.e. no parent) |
|
private |
Shortcut method to create a non-editable, disabled QStandardItem.
|
private |
Shortcut method to create a row of QStandardItem elements where the first element is given by 'item' and the rest are dummy items created by CustomPluginManager::_make_empty_item().
item | QtGui.QStandardItem first item in the row |
empty_count | int number of dummies that follow 'item' |
list
list of QtGui.QStandardItem
elements def pycross.forms.CustomPluginManager.add_or_edit_plugin | ( | self, | |
plugin_item = None |
|||
) |
Adds a new plugin or edits the given plugin.
plugin_item | QtGui.QStandardItem the plugin item to edit; if None (default), a new plugin will be added |
def pycross.forms.CustomPluginManager.addMainLayout | ( | self | ) |
def pycross.forms.CustomPluginManager.create_syneditor | ( | self, | |
source = None , |
|||
show = True , |
|||
modal = False |
|||
) |
Creates the source code editor dialog and optionally shows it.
source | str source text to place in the editor |
show | bool True to execute (show) the dialog at once |
modal | bool whether the dialog must be shown modally |
def pycross.forms.CustomPluginManager.from_settings | ( | self | ) |
Updates the plugin table (tree view) from the global settings.
def pycross.forms.CustomPluginManager.on_act_add | ( | self | ) |
The Add action handler: adds a new plugin.
def pycross.forms.CustomPluginManager.on_act_clear | ( | self | ) |
The Clear action handler: clears (deletes) all plugins.
def pycross.forms.CustomPluginManager.on_act_down | ( | self | ) |
The Down actions handler: moves the selected plugin downwards.
This ultimately lowers the priority (precedence) of the plugin within the category since it will be handled after the other ones which come before it in the table.
def pycross.forms.CustomPluginManager.on_act_edit | ( | self | ) |
The Edit action handler: edits the selected plugin (only one must be selected).
def pycross.forms.CustomPluginManager.on_act_reload | ( | self | ) |
The Reload action handler: reloads plugins from the plugin manager.
def pycross.forms.CustomPluginManager.on_act_remove | ( | self | ) |
The Delete action handler: deletes the selected plugins (>=1 plugins must be selected).
def pycross.forms.CustomPluginManager.on_act_up | ( | self | ) |
The Up actions handler: moves the selected plugin upwards.
This ultimately raises the priority (precedence) of the plugin within the category since it will be handled before the other ones which come after it in the table.
def pycross.forms.CustomPluginManager.on_plugin_model_changed | ( | self, | |
item | |||
) |
Fires when a plugin is checked or unchecked in the plugin table.
When checked, the corresponding plugin is enabled in the table, and vice-versa.
def pycross.forms.CustomPluginManager.on_tvPlugins_selected | ( | self, | |
selected, | |||
deselected | |||
) |
Fires when an item (plugin) is selected in the table.
def pycross.forms.CustomPluginManager.reload_plugins | ( | self, | |
forced_update = False |
|||
) |
Re-creates the plugin manager instance (gui::MainWindow::plugin_mgr) and updates the plugins in the manager and the global settings.
forced_update | bool if True , all current plugin settings will be cleared and plugins will be added anew from the plugin folder (default = False ) |
def pycross.forms.CustomPluginManager.select_plugin | ( | self, | |
plcat, | |||
plname | |||
) |
Locates a plugin in the table by category and name and selects it.
plcat | str plugin category name |
plname | str plugin name |
QtGui.QStandardItem
found and selected plugin item or None
on failure to locate def pycross.forms.CustomPluginManager.update_actions | ( | self | ) |
Updates the Enabled property of each action based on the current selection in the plugin table.
def pycross.forms.CustomPluginManager.update_active_states | ( | self | ) |
Sets the 'active' property of custom plugins in the global settings based on the state of the checkboxes in the plugin table.
pycross.forms.CustomPluginManager.act_add |
pycross.forms.CustomPluginManager.act_clear |
pycross.forms.CustomPluginManager.act_down |
pycross.forms.CustomPluginManager.act_edit |
pycross.forms.CustomPluginManager.act_reload |
pycross.forms.CustomPluginManager.act_remove |
pycross.forms.CustomPluginManager.act_up |
pycross.forms.CustomPluginManager.lo_main |
pycross.forms.CustomPluginManager.mainwindow |
pycross.forms.CustomPluginManager.plugin_model |
pycross.forms.CustomPluginManager.syneditor |
utils::synteditor::PluginSynEditorWidget
inbuilt python code editor
pycross.forms.CustomPluginManager.tb_main |
pycross.forms.CustomPluginManager.tvPlugins |