@ -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"