Skip to content
Snippets Groups Projects
  • kh1's avatar
    6ac6be5d
    Rewrite of the whole help modul initialization. · 6ac6be5d
    kh1 authored
    We now do as much as possible lazy initialisation, e.g only start the
    full text search indexer if we really access the search widget. Also
    moved the QFutur progress into the search widget. Changed all ctors to
    be called without an argument, since we share the help engines from
    help manager all over the place. Make use of the fact that we only need
    to call setupData on the gui engine if we access the help mode, otherwise
    all data is fetched thru the core engine whichs setupData is really fast.
    6ac6be5d
    History
    Rewrite of the whole help modul initialization.
    kh1 authored
    We now do as much as possible lazy initialisation, e.g only start the
    full text search indexer if we really access the search widget. Also
    moved the QFutur progress into the search widget. Changed all ctors to
    be called without an argument, since we share the help engines from
    help manager all over the place. Make use of the fact that we only need
    to call setupData on the gui engine if we access the help mode, otherwise
    all data is fetched thru the core engine whichs setupData is really fast.
docsettingspage.h 2.34 KiB
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** Commercial Usage
**
** Licensees holding valid Qt Commercial licenses may use this file in
** accordance with the Qt Commercial License Agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Nokia.
**
** GNU Lesser General Public License Usage
**
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you are unsure which license is appropriate for your use, please
** contact the sales department at http://qt.nokia.com/contact.
**
**************************************************************************/

#ifndef DOCSETTINGSPAGE_H
#define DOCSETTINGSPAGE_H

#include "ui_docsettingspage.h"
#include <coreplugin/dialogs/ioptionspage.h>

namespace Help {
namespace Internal {

class DocSettingsPage : public Core::IOptionsPage
{
    Q_OBJECT
    typedef QHash<QString, QString> NameSpaceToPathHash;

public:
    DocSettingsPage();

    QString id() const;
    QString displayName() const;
    QString category() const;
    QString displayCategory() const;

    QWidget *createPage(QWidget *parent);
    void apply();
    void finish() {}
    virtual bool matches(const QString &s) const;

signals:
    void documentationChanged();

private slots:
    void addDocumentation();
    void removeDocumentation();

private:
    bool eventFilter(QObject *object, QEvent *event);
    void removeDocumentation(const QList<QListWidgetItem*> items);
    void addItem(const QString &nameSpace, const QString &fileName);

private:
    Ui::DocSettingsPage m_ui;

    QString m_searchKeywords;
    QString m_recentDialogPath;

    NameSpaceToPathHash m_filesToRegister;
    NameSpaceToPathHash m_filesToUnregister;
};

} // namespace Help
} // namespace Internal

#endif // DOCSETTINGSPAGE_H