summaryrefslogtreecommitdiffstats
path: root/parts/documentation/documentation_part.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2014-10-31 12:01:24 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2014-10-31 12:01:24 +0900
commitb9688b905acbb256fb56b18f8006e5bcbb8117f4 (patch)
treeb536b329e3075ce4fa8511d3774fd1acff9b6ff6 /parts/documentation/documentation_part.cpp
parentd676f93b5f3a7481fc0588f087bef418879e6f78 (diff)
downloadtdevelop-b9688b905acbb256fb56b18f8006e5bcbb8117f4.tar.gz
tdevelop-b9688b905acbb256fb56b18f8006e5bcbb8117f4.zip
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 <michele.calgaro@yahoo.it>
Diffstat (limited to 'parts/documentation/documentation_part.cpp')
-rw-r--r--parts/documentation/documentation_part.cpp42
1 files changed, 30 insertions, 12 deletions
diff --git a/parts/documentation/documentation_part.cpp b/parts/documentation/documentation_part.cpp
index b0d59e24..3b9e9b78 100644
--- a/parts/documentation/documentation_part.cpp
+++ b/parts/documentation/documentation_part.cpp
@@ -33,6 +33,7 @@
#include <dcopclient.h>
#include <kiconloader.h>
#include <tdelocale.h>
+#include <tdemessagebox.h>
#include <ktrader.h>
#include <kdebug.h>
#include <tdeparts/componentfactory.h>
@@ -106,6 +107,7 @@ DocumentationPart::DocumentationPart(TQObject *parent, const char *name, const T
i18n("Documentation browser"));
setupActions();
+ checkLastVersion();
TQTimer::singleShot(5, this, TQT_SLOT(init()));
@@ -151,18 +153,6 @@ void DocumentationPart::loadDocumentationPlugins()
}
}
-void DocumentationPart::reloadDocumentationPlugins()
-{
- TQValueList<DocumentationPlugin*>::iterator it;
- for (it = m_plugins.begin(); it != m_plugins.end(); ++it)
- {
- DocumentationPlugin *plugin=*it;
- plugin->clear();
- plugin->autoSetupPlugin();
- plugin->reinit(m_widget->contents(), m_widget->index(), TQStringList());
- }
-}
-
void DocumentationPart::emitIndexSelected(IndexBox *indexBox)
{
if (!m_hasIndex)
@@ -774,4 +764,32 @@ void DocumentationPart::init( )
loadSettings();
}
+void DocumentationPart::checkLastVersion()
+{
+ // Check whether TDevelop is run for the first time under
+ // a new TDE version. If so displays a message to invite
+ // the user to update the documentation plugin lists
+ TDEConfig *config = DocumentationFactory::instance()->config();
+ TQString group = config->group();
+ config->setGroup("General");
+ TQString lastVersion = config->readEntry("Last version");
+ if (lastVersion != TDE_VERSION_STRING)
+ {
+ config->writeEntry("Last version", TDE_VERSION_STRING);
+ config->sync();
+ KMessageBox::information(m_widget,
+ i18n("It seems TDevelop is being run for the first time "
+ "under TDE version " TDE_VERSION_STRING ".\n"
+ "Some documentation catalogs may have changed "
+ "since the previous version, so we suggest "
+ "that you use the Rescan button in "
+ "Settings --> Configure TDevelop --> Documentation "
+ "to update the list of the available items.\n"
+ "This operation has not been automated to allow you "
+ "to preserve local changes that you may have made before."),
+ i18n("Rescan documentation"));
+ }
+ config->setGroup(group);
+}
+
#include "documentation_part.moc"