eric7.TrayStarter.TrayStarterMenuEditor

Module implementing a dialog to edit the variable part of the tray starter menu.

Global Attributes

None

Classes

TrayStarterMenuEditorDialog Class implementing a dialog to edit the variable part of the tray starter menu.
TrayStarterMenuEntryType Class defining the various menu entry types.

Functions

None


TrayStarterMenuEditorDialog

Class implementing a dialog to edit the variable part of the tray starter menu.

Signals

menuChanged()
emitted to indicate a changed menu

Derived from

QDialog, Ui_TrayStarterMenuEditorDialog

Class Attributes

None

Class Methods

None

Methods

TrayStarterMenuEditorDialog Constructor
__addItem Private slot to add a menu item to the menu tree after the current one.
__buildMenuItemsList Private method to build the list of entries for a given menu entry.
__menuItemAbove Private method to find the next menu item above the given index.
__menuItemCount Private method to determine the number of menu entries of a given parent item.
__menuItems Private method to get a list of menu entries of a given parent item.
__moveCurrentItemUpDown Private method to move the current item up or down.
__populateActions Private slot to populate the list of available actions.
__populateMenu Private slot to populate the menu tree.
__resetMenu Private slot to reset the menu to the state before any change was made.
__restoreMenuToDefault Private slot to reset the menu to the default menu.
__saveMenu Private slot to save the the define menu structure.
__updateButtons Private slot to update the enabled state of the various action buttons.
closeEvent Protected method to handle close events.
on_addMenuButton_clicked Private slot to add a new menu entry.
on_buttonBox_clicked Private slot called, when a button of the button box was clicked.
on_decButton_clicked Private slot to move the current item up one level in the menu hierarchy.
on_editButton_clicked Private slot to edit the data of the current item.
on_incButton_clicked Private slot to move the current item to the previous level in the menu hierarchy.
on_leftButton_clicked Private slot to remove the current item from the menu tree.
on_rightButton_clicked Private slot to add the selected action to the menu tree.
on_separatorButton_clicked Private slot to add a separator entry.

Static Methods

None

TrayStarterMenuEditorDialog (Constructor)

TrayStarterMenuEditorDialog(menuItems, defaultMenuItems, parent=None)

Constructor

menuItems (list[TrayStarterAction | TrayStarterSeparator | TrayStarterMenu])
list of menu items of the variable part
defaultMenuItems (list[TrayStarterAction | TrayStarterSeparator | TrayStarterMenu])
list of default menu items of the variable part
parent (QWidget (optional))
reference to the parent widget (defaults to None)

TrayStarterMenuEditorDialog.__addItem

__addItem(item)

Private slot to add a menu item to the menu tree after the current one.

item (QTreeWidgetItem)
reference to the item to be added

TrayStarterMenuEditorDialog.__buildMenuItemsList

__buildMenuItemsList(menuTreeItem)

Private method to build the list of entries for a given menu entry.

menuTreeItem (QTreeWidgetItem)
reference to the menu tree widget
Return:
list of menu entries
Return Type:
list[TrayStarterAction | TrayStarterSeparator | TrayStarterMenu]

TrayStarterMenuEditorDialog.__menuItemAbove

__menuItemAbove(parentItem, index)

Private method to find the next menu item above the given index.

parentItem (QTreeWidgetItem | None)
reference to the parent item
index (int)
index where to start the search
Return:
reference to the menu item above or None if no was found
Return Type:
QTreeWidgetItem | None

TrayStarterMenuEditorDialog.__menuItemCount

__menuItemCount(parentItem)

Private method to determine the number of menu entries of a given parent item.

parentItem (QTreeWidgetItem | None)
reference to the parent item
Return:
number of submenu entries
Return Type:
int

TrayStarterMenuEditorDialog.__menuItems

__menuItems(parentItem)

Private method to get a list of menu entries of a given parent item.

parentItem (QTreeWidgetItem | None)
reference to the parent item
Return:
list of menu entries
Return Type:
list[QTreeWidgetItem]

TrayStarterMenuEditorDialog.__moveCurrentItemUpDown

__moveCurrentItemUpDown(up)

Private method to move the current item up or down.

up (bool)
flag indicating to move up

TrayStarterMenuEditorDialog.__populateActions

__populateActions(menuItems)

Private slot to populate the list of available actions.

menuItems (list[TrayStarterAction | TrayStarterSeparator | TrayStarterMenu])
list of menu items to extract action entries from

TrayStarterMenuEditorDialog.__populateMenu

__populateMenu(parentItem, menuItems)

Private slot to populate the menu tree.

parentItem (QTreeWidget | QTreeWidgetItem)
reference to the parent item
menuItems (list[TrayStarterAction | TrayStarterSeparator | TrayStarterMenu])
list of menu items

TrayStarterMenuEditorDialog.__resetMenu

__resetMenu()

Private slot to reset the menu to the state before any change was made.

TrayStarterMenuEditorDialog.__restoreMenuToDefault

__restoreMenuToDefault()

Private slot to reset the menu to the default menu.

TrayStarterMenuEditorDialog.__saveMenu

__saveMenu()

Private slot to save the the define menu structure.

Return:
flag indicating successful save of the edited menu
Return Type:
bool

TrayStarterMenuEditorDialog.__updateButtons

__updateButtons()

Private slot to update the enabled state of the various action buttons.

TrayStarterMenuEditorDialog.closeEvent

closeEvent(evt)

Protected method to handle close events.

evt (QCloseEvent)
reference to the close event

TrayStarterMenuEditorDialog.on_addMenuButton_clicked

on_addMenuButton_clicked()

Private slot to add a new menu entry.

TrayStarterMenuEditorDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called, when a button of the button box was clicked.

button (QAbstractButton)
reference to the button clicked

TrayStarterMenuEditorDialog.on_decButton_clicked

on_decButton_clicked()

Private slot to move the current item up one level in the menu hierarchy.

TrayStarterMenuEditorDialog.on_editButton_clicked

on_editButton_clicked()

Private slot to edit the data of the current item.

TrayStarterMenuEditorDialog.on_incButton_clicked

on_incButton_clicked()

Private slot to move the current item to the previous level in the menu hierarchy.

TrayStarterMenuEditorDialog.on_leftButton_clicked

on_leftButton_clicked()

Private slot to remove the current item from the menu tree.

TrayStarterMenuEditorDialog.on_rightButton_clicked

on_rightButton_clicked()

Private slot to add the selected action to the menu tree.

TrayStarterMenuEditorDialog.on_separatorButton_clicked

on_separatorButton_clicked()

Private slot to add a separator entry.

Up


TrayStarterMenuEntryType

Class defining the various menu entry types.

Derived from

enum.IntEnum

Class Attributes

Action
Menu
Separator

Class Methods

None

Methods

None

Static Methods

None
Up