BibleTime
|
#include <bttextwindowheaderwidget.h>
Signals | |
void | sigModuleAdd (int index, CSwordModuleInfo *module) |
void | sigModuleRemove (int index) |
void | sigModuleReplace (int index, CSwordModuleInfo *newModule) |
Public Member Functions | |
BtTextWindowHeaderWidget (CSwordModuleInfo::ModuleType mtype, QWidget *parent=nullptr) | |
void | updateWidget (BtModuleList newModulesToUse, CSwordModuleInfo *module, int newIndex, int leftLikeModules) |
Private Attributes | |
BtModuleChooserMenu * | m_addMenu |
QToolButton * | m_button |
QLabel * | m_iconLabel |
int | m_id |
QLabel * | m_label |
QAction * | m_removeAction |
BtModuleChooserMenu * | m_replaceMenu |
A widget for choosing a module in a window. Consists of a label and a button. When user selects a module, button sends a signal. This widget needs to get a message back after a window module list has been changed. Only then it will be updated. See BtTextWindowHeader.
Definition at line 36 of file bttextwindowheaderwidget.h.
BtTextWindowHeaderWidget::BtTextWindowHeaderWidget | ( | CSwordModuleInfo::ModuleType | mtype, |
QWidget * | parent = nullptr |
||
) |
A new empty widget. updateMenu() is needed to update the label, menu items etc.
Definition at line 31 of file bttextwindowheaderwidget.cpp.
References BT_ASSERT, BT_CONNECT, BtModuleChooserMenu::DisableNonBiblesOnFirstButton, BtModuleChooserMenu::DisableSelectedModule, m_addMenu, m_button, m_iconLabel, m_id, m_label, m_removeAction, m_replaceMenu, sigModuleAdd(), BtModuleChooserMenu::sigModuleChosen(), sigModuleRemove(), and sigModuleReplace().
|
signal |
User selected a module from menu to add.
Referenced by BtTextWindowHeader::addWidget(), and BtTextWindowHeaderWidget().
|
signal |
User selected a module from menu to be removed.
Referenced by BtTextWindowHeader::addWidget(), and BtTextWindowHeaderWidget().
|
signal |
User selected a module from menu to replace an existing module.
Referenced by BtTextWindowHeader::addWidget(), and BtTextWindowHeaderWidget().
void BtTextWindowHeaderWidget::updateWidget | ( | BtModuleList | newModulesToUse, |
CSwordModuleInfo * | module, | ||
int | newIndex, | ||
int | leftLikeModules | ||
) |
Called after the window module list has changed. Updates the module name and the existing menu items but doesn't add or remove them if the menu exists. If the menu doesn't exist, creates it first and then updates it.
Definition at line 106 of file bttextwindowheaderwidget.cpp.
References m_addMenu, m_iconLabel, m_id, m_label, m_removeAction, m_replaceMenu, CSwordModuleInfo::moduleIcon(), CSwordModuleInfo::name(), and BtModuleChooserMenu::update().
|
private |
Definition at line 71 of file bttextwindowheaderwidget.h.
Referenced by BtTextWindowHeaderWidget(), and updateWidget().
|
private |
Definition at line 74 of file bttextwindowheaderwidget.h.
Referenced by BtTextWindowHeaderWidget().
|
private |
Definition at line 72 of file bttextwindowheaderwidget.h.
Referenced by BtTextWindowHeaderWidget(), and updateWidget().
|
private |
Definition at line 68 of file bttextwindowheaderwidget.h.
Referenced by BtTextWindowHeaderWidget(), and updateWidget().
|
private |
Definition at line 73 of file bttextwindowheaderwidget.h.
Referenced by BtTextWindowHeaderWidget(), and updateWidget().
|
private |
Definition at line 69 of file bttextwindowheaderwidget.h.
Referenced by BtTextWindowHeaderWidget(), and updateWidget().
|
private |
Definition at line 70 of file bttextwindowheaderwidget.h.
Referenced by BtTextWindowHeaderWidget(), and updateWidget().