CBookKeyChooser::CBookKeyChooser(QList<CSwordModuleInfo*> modules, CSwordKey *key, QWidget *parent) : CKeyChooser(modules, key, parent), m_layout(0) { setModules(modules, false); m_key = dynamic_cast<CSwordTreeKey*>(key); if (!m_modules.count()) { m_key = 0; } setModules(modules, true); setKey(key); adjustFont(); connect(this, SIGNAL(keyChanged(CSwordKey*)), history(), SLOT(add(CSwordKey*)) ); }
BlueTooth::BlueTooth(RingBuffer * rxBuffer, RingBuffer * txBuffer) :m_rxBuffer(rxBuffer), m_txBuffer(txBuffer), m_lastConnectStatus(false) { m_lastRefId = 0; resetPacketState(); setModules(NULL, 0); }
CDisplayWindow::CDisplayWindow(const QList<CSwordModuleInfo *> & modules, CMDIArea * parent) : QMainWindow(parent), m_actionCollection(0), m_mdi(parent), m_keyChooser(0), m_swordKey(0), m_isReady(false), m_moduleChooserBar(0), m_mainToolBar(0), m_buttonsToolBar(0), m_formatToolBar(0), m_headerBar(0), m_popupMenu(0), m_displayWidget(0), m_history(0) { setAttribute(Qt::WA_DeleteOnClose); //we want to destroy this window when it is closed m_actionCollection = new BtActionCollection(this); setModules(modules); // Connect this to the backend module list changes connect(CSwordBackend::instance(), SIGNAL(sigSwordSetupChanged(CSwordBackend::SetupChangedReason)), SLOT(reload(CSwordBackend::SetupChangedReason))); BibleTime* mainwindow = btMainWindow(); connect(mainwindow, SIGNAL(toggledTextWindowHeader(bool)), SLOT(slotShowHeader(bool)) ); connect(mainwindow, SIGNAL(toggledTextWindowNavigator(bool)), SLOT(slotShowNavigator(bool)) ); connect(mainwindow, SIGNAL(toggledTextWindowToolButtons(bool)), SLOT(slotShowToolButtons(bool)) ); connect(mainwindow, SIGNAL(toggledTextWindowModuleChooser(bool)), SLOT(slotShowModuleChooser(bool)) ); connect(mainwindow, SIGNAL(toggledTextWindowFormatToolbar(bool)), SLOT(slotShowFormatToolBar(bool)) ); }
CBibleKeyChooser::CBibleKeyChooser(QList<CSwordModuleInfo*> modules, CSwordKey *key, QWidget *parent) : CKeyChooser(modules, key, parent), m_key(dynamic_cast<CSwordVerseKey*>(key)) { w_ref = 0; setModules(modules, false); if (!m_modules.count()) { qWarning() << "CBibleKeyChooser: module is not a Bible or commentary!"; m_key = 0; return; } QHBoxLayout* layout = new QHBoxLayout(this); layout->setSpacing(0); layout->setContentsMargins(0, 0, 0, 0); layout->setDirection( QBoxLayout::LeftToRight ); w_ref = new CKeyReferenceWidget(dynamic_cast<CSwordBibleModuleInfo*>(m_modules.first()), m_key, this); setFocusProxy(w_ref); layout->addWidget(w_ref); connect(w_ref, SIGNAL(beforeChange(CSwordVerseKey *)), SLOT(beforeRefChange(CSwordVerseKey *))); connect(w_ref, SIGNAL(changed(CSwordVerseKey *)), SLOT(refChanged(CSwordVerseKey *))); setKey(m_key); //set the key without changing it, setKey(key()) would change it connect(this, SIGNAL(keyChanged(CSwordKey*)), history(), SLOT(add(CSwordKey*)) ); }
/** Starts the search with the given module list and given search text. */ void CSearchDialog::startSearch( const QList<CSwordModuleInfo*> modules, const QString& searchText) { m_searchResultArea->reset(); m_searchOptionsArea->reset(); setModules(modules); setSearchText(searchText); startSearch(); }
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())); }
CLexiconKeyChooser::CLexiconKeyChooser(const BtConstModuleList & modules, BTHistory * historyPtr, CSwordKey * key, QWidget * parent) : CKeyChooser(modules, historyPtr, parent) , m_key(dynamic_cast<CSwordLDKey *>(key)) { setModules(modules, false); //we use a layout because the key chooser should be resized to full size m_layout = new QHBoxLayout(this); m_layout->setSpacing(0); m_layout->setContentsMargins(0, 0, 0, 0); m_layout->setDirection(QBoxLayout::LeftToRight); m_layout->setSizeConstraint(QLayout::SetNoConstraint); m_widget = new CKeyChooserWidget(0, this); setFocusProxy(m_widget); //don't allow a too high width, try to keep as narrow as possible //to aid users with smaller screen resolutions m_widget->comboBox().setMaximumWidth(200); m_widget->setToolTips( tr("Entries of the current work"), tr("Next entry"), tr("Scroll through the entries of the list. Press the button and move the mouse to increase or decrease the item."), tr("Previous entry") ); m_layout->addWidget(m_widget, 0, Qt::AlignLeft); BT_CONNECT(m_widget, SIGNAL(changed(int)), SLOT(activated(int))); BT_CONNECT(m_widget, SIGNAL(focusOut(int)), SLOT(activated(int))); setModules(modules, true); setKey(key); BT_CONNECT(this, SIGNAL(keyChanged(CSwordKey *)), history(), SLOT(add(CSwordKey *)) ); }
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())); }