Exemplo n.º 1
0
CentralWidget::~CentralWidget()
{
    TRACE_OBJ
#ifndef QT_NO_PRINTER
    delete printer;
#endif

    QStringList zoomFactors;
    QStringList currentPages;
    bool searchAttached = m_searchWidget->isAttached();

    int i = searchAttached ? 1 : 0;
    for (; i < tabWidget->count(); ++i) {
        HelpViewer *viewer = qobject_cast<HelpViewer*>(tabWidget->widget(i));
        if (viewer && viewer->source().isValid()) {
            currentPages << viewer->source().toString();
            zoomFactors << QString::number(viewer->scale());
        }
    }

    HelpEngineWrapper &helpEngine = HelpEngineWrapper::instance();
    helpEngine.setLastTabPage(tabWidget->currentIndex());
    helpEngine.setLastShownPages(currentPages);
    helpEngine.setSearchWasAttached(searchAttached);
    helpEngine.setLastZoomFactors(zoomFactors);
}
Exemplo n.º 2
0
CentralWidget::~CentralWidget()
{
    QDir dir;
    QString currentPages;
    QHelpEngineCore engine(collectionFile, 0);

    if (engine.setupData()) {
        for (int i = 0; i < tabWidget->count(); ++i) {
            HelpViewer *viewer = qobject_cast<HelpViewer*>(tabWidget->widget(i));
            if (viewer && viewer->source().isValid())
                currentPages.append(viewer->source().toString()).append(QLatin1Char('|'));
        }
        engine.setCustomValue(QLatin1String("LastTabPage"), lastTabPage);
        engine.setCustomValue(QLatin1String("LastShownPages"), currentPages);
    }
}
void GeneralSettingsPage::setCurrentPage()
{
    HelpViewer *viewer = CentralWidget::instance()->currentHelpViewer();
    if (viewer)
        m_ui->homePageLineEdit->setText(viewer->source().toString());
}
Exemplo n.º 4
0
void CentralWidget::newTab()
{
    HelpViewer* viewer = currentHelpViewer();
    if (viewer)
        setSourceInNewTab(viewer->source());
}