From b9688b905acbb256fb56b18f8006e5bcbb8117f4 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Fri, 31 Oct 2014 12:01:24 +0900 Subject: Added GUI for allowing the user to manually update the Documentation Plugin lists. Added check + information message to inform the user that he/she should update the Documentation Plugin lists when TDevelop is being run for the first time under a new TDE version. This relates to bug 1859. Signed-off-by: Michele Calgaro --- parts/documentation/docglobalconfigwidget.cpp | 59 +++++++++++++++++++++++---- 1 file changed, 52 insertions(+), 7 deletions(-) (limited to 'parts/documentation/docglobalconfigwidget.cpp') diff --git a/parts/documentation/docglobalconfigwidget.cpp b/parts/documentation/docglobalconfigwidget.cpp index b27cb5f9..8dd6c0b8 100644 --- a/parts/documentation/docglobalconfigwidget.cpp +++ b/parts/documentation/docglobalconfigwidget.cpp @@ -37,6 +37,8 @@ #include #include #include +#include +#include #include "kdevdocumentationplugin.h" #include "kdevpartcontroller.h" @@ -168,13 +170,13 @@ TDEListView *DocGlobalConfigWidget::activeView() void DocGlobalConfigWidget::accept() { //write catalog settings - for (TQValueList::const_iterator it = m_part->m_plugins.constBegin(); - it != m_part->m_plugins.constEnd(); ++it) - { - (*it)->saveCatalogConfiguration( m_View ); - //@todo: take restrictions into account - (*it)->reinit(m_widget->contents(), m_widget->index(), TQStringList()); - } + for (TQValueList::const_iterator it = m_part->m_plugins.constBegin(); + it != m_part->m_plugins.constEnd(); ++it) + { + (*it)->saveCatalogConfiguration( m_View ); + //@todo: take restrictions into account + (*it)->reinit(m_widget->contents(), m_widget->index(), TQStringList()); + } TDEConfig *config = m_part->config(); //write full text search settings @@ -259,4 +261,47 @@ void DocGlobalConfigWidget::updateConfigForHTMLParts() } } +void DocGlobalConfigWidget::rescanCollectionButtonClicked() +{ + if (KMessageBox::questionYesNo(this, + i18n("This will restore the default settings " + "for the following documentation plugins: " + "chm, devhelp, doxygen, kdevtoc, qt.\n" + "Any change made to documentation catalogs " + "belonging to those plugins will be lost. " + "Changes made to documentation catalogs " + "belonging to the custom plugin will be preserved.\n" + "Do you wish to continue?"), + i18n("Rescan documentation")) == KMessageBox::Yes) + { + reloadDocumentationPlugins(); + } +} + +void DocGlobalConfigWidget::reloadDocumentationPlugins() +{ + // Clear current list + TQListViewItem *first = m_View->firstChild(); + while (first) + { + m_View->takeItem(first); + delete first; + first = m_View->firstChild(); + } + // Rescan configuration + TQValueList::iterator it; + for (it = m_part->m_plugins.begin(); it != m_part->m_plugins.end(); ++it) + { + DocumentationPlugin *plugin=*it; + plugin->clear(); + plugin->autoSetupPlugin(); + plugin->reinit(m_part->m_widget->contents(), m_part->m_widget->index(), TQStringList()); + } + // Recreate list + for (TQValueList::const_iterator it = m_part->m_plugins.constBegin(); + it != m_part->m_plugins.constEnd(); ++it) + { + (*it)->loadCatalogConfiguration(m_View); + } +} #include "docglobalconfigwidget.moc" -- cgit v1.2.3