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()));
}
Ejemplo n.º 2
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()));
}
Ejemplo n.º 3
0
/** Refresh the settings of this window. */
void CDisplayWindow::reload(CSwordBackend::SetupChangedReason) {
    //first make sure all used Sword modules are still present
    QMutableStringListIterator it(m_modules);
    while (it.hasNext()) {
        if (!CSwordBackend::instance()->findModuleByName(it.next())) {
            it.remove();
        }
    }

    if (m_modules.isEmpty()) {
        close();
        return;
    }

    if (keyChooser()) keyChooser()->setModules( modules(), false );

    lookup();

    actionCollection()->readShortcuts("DisplayWindow shortcuts");
    actionCollection()->readShortcuts("Readwindow shortcuts");
    emit sigModuleListSet(m_modules);
}