Example #1
0
void CDisplayWindow::slotReplaceModule(int index, QString newModule) {
    qDebug() << "CDisplayWindow::slotReplaceModule" << m_modules.at(index) << "with" << newModule;
    m_modules.replace(index, newModule);
    qDebug() << "window's new module list:" << m_modules;
    lookup();
    modulesChanged();
    emit sigModuleListChanged();
}
BtModuleChooserBar::BtModuleChooserBar(QStringList useModules, CSwordModuleInfo::ModuleType type, CReadWindow *parent)
        : QToolBar(parent),
        BtWindowModuleChooser(parent, type),
        m_idCounter(0) {

    qDebug() << "BtModuleChooserBar::BtModuleChooserBar";
    setAllowedAreas(Qt::TopToolBarArea);
    setFloatable(false);
    setModules(useModules);
    connect(parent, SIGNAL(sigModuleListSet(QStringList)), SLOT(slotBackendModulesChanged()));
    connect(parent, SIGNAL(sigModuleListChanged()), SLOT(slotWindowModulesChanged()));
}
Example #3
0
BtTextWindowHeader::BtTextWindowHeader(CSwordModuleInfo::ModuleType modtype,
                                       QStringList modules,
                                       CDisplayWindow *window)
        : QWidget(window),
        BtWindowModuleChooser(modtype, window)
{
    QHBoxLayout* layout = new QHBoxLayout ( this );
    layout->setContentsMargins(0, 0, 0, 0);
    setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
    setLayoutDirection(Qt::LeftToRight);
    setModules(modules);
    connect(window, SIGNAL(sigModuleListSet(QStringList)), SLOT(slotBackendModulesChanged()));
    connect(window, SIGNAL(sigModuleListChanged()), SLOT(slotWindowModulesChanged()));
}
Example #4
0
void CDisplayWindow::slotRemoveModule(int index) {
    m_modules.removeAt(index);
    lookup();
    modulesChanged();
    emit sigModuleListChanged();
}
Example #5
0
void CDisplayWindow::slotAddModule(int index, QString module) {
    m_modules.insert(index, module);
    lookup();
    modulesChanged();
    emit sigModuleListChanged();
}