Browse Source

Les XmlQuery sont maintenant sous forme de script (pour facilement les modifiers).

Les plugins sont désactivables (mais cela ne les décharges pas ==> pas de soucis pour la destruction des objets).
Seul certain plugin sont chargés par défaut.
v0.7.2
Ulrich Van Den Hekke 14 years ago
parent
commit
134a9b886c
  1. 4
      libxinx/appsettings.cpp
  2. 7
      libxinx/config.xml
  3. 85
      libxinx/xinxpluginsloader.cpp
  4. 8
      libxinx/xinxpluginsloader.h
  5. 4
      scripts/conf_businessviewlist.xq
  6. 18
      scripts/conf_version.xq
  7. 24
      xinx.kdevelop
  8. 195
      xinx/configurationfile.cpp
  9. 5
      xinx/configurationfile.h
  10. 21
      xinx/customdialogimpl.cpp
  11. 2
      xinx/main.cpp
  12. 12
      xinx/mainformimpl.cpp
  13. 6
      xinx/newprojectwizard.cpp
  14. 6
      xinx/projectpropertyimpl.cpp
  15. 4
      xinx/scriptmanager.cpp
  16. 4
      xinx/ui/specifiquedlg.ui

4
libxinx/appsettings.cpp

@ -434,6 +434,10 @@ void AppSettings::setSettingsGlobals( AppSettingsSettings * settings, const QStr
QHash<QString,bool> AppSettings::getDefaultHash_bool() {
QHash<QString,bool> value;
value[ "WebPlugin" ] = true;
value[ "ServicesPlugin" ] = true;
value[ "SVNPlugin" ] = true;
value[ "CVSPlugin" ] = true;
return value;
}

7
libxinx/config.xml

@ -59,7 +59,12 @@
<value name="Maximized" type="bool" default="no"/>
<value name="State" type="blob"/>
<value name="XINX Trace" type="string"/>
<value name="Plugins" type="hash:bool"/>
<value name="Plugins" type="hash:bool">
<default name="WebPlugin" default="true"/>
<default name="ServicesPlugin" default="true"/>
<default name="SVNPlugin" default="true"/>
<default name="CVSPlugin" default="true"/>
</value>
<value name="Descriptions" type="Descriptions"/>
<value name="Project" type="Project"/>

85
libxinx/xinxpluginsloader.cpp

@ -40,6 +40,7 @@ XinxPluginsLoader::XinxPluginsLoader() {
}
XinxPluginsLoader::~XinxPluginsLoader() {
qDeleteAll( plugins() );
if( s_self == this )
s_self = NULL;
}
@ -52,8 +53,12 @@ XinxPluginsLoader * XinxPluginsLoader::self() {
return s_self;
}
const QList<XinxPluginElement> & XinxPluginsLoader::plugins() const {
return m_plugins;
QList<XinxPluginElement*> XinxPluginsLoader::plugins() const {
return m_plugins.values();
}
XinxPluginElement * XinxPluginsLoader::plugin( const QString & name ) {
return m_plugins.value( name );
}
void XinxPluginsLoader::addPlugin( QObject * plugin, bool staticLoaded ) {
@ -61,13 +66,16 @@ void XinxPluginsLoader::addPlugin( QObject * plugin, bool staticLoaded ) {
IXinxPlugin * iXinxPlugin = qobject_cast<IXinxPlugin*>( plugin );
if( ! iXinxPlugin ) return;
QString name = plugin->metaObject()->className();
if(! iXinxPlugin->initializePlugin( XINXConfig::self()->config().language ) ) {
qCritical() << "Can't load " << plugin->metaObject()->className() << " plugin.";
qCritical() << "Can't load " << name << " plugin.";
return;
}
XinxPluginElement element( plugin, staticLoaded );
m_plugins.append( element );
XinxPluginElement * element = new XinxPluginElement( plugin, staticLoaded );
element->setActivated( XINXConfig::self()->config().plugins.value( name, false ) );
m_plugins.insert( name, element );
QPair<QString,QString> tools;
foreach( tools, iXinxPlugin->pluginTools() )
@ -79,23 +87,24 @@ void XinxPluginsLoader::loadPlugins() {
addPlugin( plugin, true );
m_pluginsDir = QDir( qApp->applicationDirPath() );
m_pluginsDir.cd( "../plugins" );
foreach( QString fileName, m_pluginsDir.entryList( QDir::Files ) ) {
QPluginLoader loader( m_pluginsDir.absoluteFilePath( fileName ) );
QObject * plugin = loader.instance();
if ( plugin )
addPlugin( plugin );
else
qDebug() << loader.errorString();
}
if( m_pluginsDir.cd( "../plugins" ) ) {
foreach( QString fileName, m_pluginsDir.entryList( QDir::Files ) ) {
QPluginLoader loader( m_pluginsDir.absoluteFilePath( fileName ) );
QObject * plugin = loader.instance();
if ( plugin )
addPlugin( plugin );
else
qDebug() << loader.errorString();
}
}
}
QList<IFileTypePlugin*> XinxPluginsLoader::fileTypes() const {
QList<IFileTypePlugin*> result;
foreach( XinxPluginElement element, m_plugins ) {
IFilePlugin * interface = qobject_cast<IFilePlugin*>( element.plugin() );
if( element.isActivated() && interface ) {
foreach( XinxPluginElement * element, plugins() ) {
IFilePlugin * interface = qobject_cast<IFilePlugin*>( element->plugin() );
if( element->isActivated() && interface ) {
result += interface->fileTypes();
}
}
@ -181,9 +190,9 @@ FileContentElement * XinxPluginsLoader::createElement( QString & filename, FileC
QList< QPair<QString,QString> > XinxPluginsLoader::revisionsControls() const {
QList< QPair<QString,QString> > result;
foreach( XinxPluginElement element, m_plugins ) {
IRCSPlugin * interface = qobject_cast<IRCSPlugin*>( element.plugin() );
if( element.isActivated() && interface ) {
foreach( XinxPluginElement * element, plugins() ) {
IRCSPlugin * interface = qobject_cast<IRCSPlugin*>( element->plugin() );
if( element->isActivated() && interface ) {
foreach( QString rcsKey, interface->rcs() ) {
result << qMakePair( rcsKey, interface->descriptionOfRCS( rcsKey ) );
}
@ -194,9 +203,9 @@ QList< QPair<QString,QString> > XinxPluginsLoader::revisionsControls() const {
RCS * XinxPluginsLoader::createRevisionControl( QString revision, QString basePath ) const {
RCS * rcs = NULL;
foreach( XinxPluginElement element, m_plugins ) {
IRCSPlugin * interface = qobject_cast<IRCSPlugin*>( element.plugin() );
if( element.isActivated() && interface ) {
foreach( XinxPluginElement * element, plugins() ) {
IRCSPlugin * interface = qobject_cast<IRCSPlugin*>( element->plugin() );
if( element->isActivated() && interface ) {
rcs = interface->createRCS( revision, basePath );
if( rcs ) break;
}
@ -206,18 +215,18 @@ RCS * XinxPluginsLoader::createRevisionControl( QString revision, QString basePa
QStringList XinxPluginsLoader::highlighters() const {
QStringList result;
foreach( XinxPluginElement element, m_plugins ) {
IPluginSyntaxHighlighter * interface = qobject_cast<IPluginSyntaxHighlighter*>( element.plugin() );
if( element.isActivated() && interface )
foreach( XinxPluginElement * element, plugins() ) {
IPluginSyntaxHighlighter * interface = qobject_cast<IPluginSyntaxHighlighter*>( element->plugin() );
if( element->isActivated() && interface )
result += interface->highlighters();
}
return result;
}
QString XinxPluginsLoader::highlighterOfSuffix( const QString & suffix ) const {
foreach( XinxPluginElement element, m_plugins ) {
IPluginSyntaxHighlighter * interface = qobject_cast<IPluginSyntaxHighlighter*>( element.plugin() );
if( element.isActivated() && interface ) {
foreach( XinxPluginElement * element, plugins() ) {
IPluginSyntaxHighlighter * interface = qobject_cast<IPluginSyntaxHighlighter*>( element->plugin() );
if( element->isActivated() && interface ) {
QString value = interface->highlighterOfExtention( suffix );
if( ! value.isEmpty() )
return value;
@ -228,9 +237,9 @@ QString XinxPluginsLoader::highlighterOfSuffix( const QString & suffix ) const {
SyntaxHighlighter * XinxPluginsLoader::createHighlighter( const QString & highlighter, QTextDocument* parent, XINXConfig * config ) {
SyntaxHighlighter * h = NULL;
foreach( XinxPluginElement element, m_plugins ) {
IPluginSyntaxHighlighter * interface = qobject_cast<IPluginSyntaxHighlighter*>( element.plugin() );
if( element.isActivated() && interface ) {
foreach( XinxPluginElement * element, plugins() ) {
IPluginSyntaxHighlighter * interface = qobject_cast<IPluginSyntaxHighlighter*>( element->plugin() );
if( element->isActivated() && interface ) {
h = interface->createHighlighter( highlighter, parent, config );
if( h ) break;
}
@ -239,18 +248,18 @@ SyntaxHighlighter * XinxPluginsLoader::createHighlighter( const QString & highli
}
QHash<QString,QTextCharFormat> XinxPluginsLoader::formatOfHighlighter( const QString & highlighter ) {
foreach( XinxPluginElement element, m_plugins ) {
IPluginSyntaxHighlighter * interface = qobject_cast<IPluginSyntaxHighlighter*>( element.plugin() );
if( element.isActivated() && interface && interface->highlighters().contains( highlighter, Qt::CaseInsensitive ) )
foreach( XinxPluginElement * element, plugins() ) {
IPluginSyntaxHighlighter * interface = qobject_cast<IPluginSyntaxHighlighter*>( element->plugin() );
if( element->isActivated() && interface && interface->highlighters().contains( highlighter, Qt::CaseInsensitive ) )
return interface->formatOfHighlighter( highlighter );
}
return QHash<QString,QTextCharFormat>();
}
QString XinxPluginsLoader::exampleOfHighlighter( const QString & highlighter ) {
foreach( XinxPluginElement element, m_plugins ) {
IPluginSyntaxHighlighter * interface = qobject_cast<IPluginSyntaxHighlighter*>( element.plugin() );
if( element.isActivated() && interface ) {
foreach( XinxPluginElement * element, plugins() ) {
IPluginSyntaxHighlighter * interface = qobject_cast<IPluginSyntaxHighlighter*>( element->plugin() );
if( element->isActivated() && interface ) {
QString value = interface->exampleOfHighlighter( highlighter );
if( ! value.isEmpty() )
return value;

8
libxinx/xinxpluginsloader.h

@ -50,7 +50,11 @@ public:
/*!
* List all the loaded plugins
*/
const QList<XinxPluginElement> & plugins() const;
QList<XinxPluginElement*> plugins() const;
/*!
* Plugin of name \e name
*/
XinxPluginElement * plugin( const QString & name );
/*!
* List all the revision control that can be used. The Result is a list of
* QPair. The first element is the key and the second element is the description.
@ -94,7 +98,7 @@ private:
QString allManagedFileFilter() const;
QDir m_pluginsDir;
QList< XinxPluginElement > m_plugins;
QMap<QString, XinxPluginElement*> m_plugins;
static XinxPluginsLoader * s_self;
};

4
scripts/conf_businessviewlist.xq

@ -0,0 +1,4 @@
declare default element namespace 'http://www.generix.fr/technicalframework/configuration';
(doc($inputDocument)/config/application/presentation)[1]/*[@fileRef=$relativeFileName]/
string(@businessview)

18
scripts/conf_version.xq

@ -0,0 +1,18 @@
<result xmlns="http://www.generix.fr/technicalframework/configuration">
{
(doc($inputDocument)/config/version/numero)[1]/
<numero>{string(text())}</numero>
}
{
(doc($inputDocument)/config/version/edition_speciale)[1]/
<edition_speciale>{string(text())}</edition_speciale>
}
{
(doc($inputDocument)/config/application/properties)[1]/
<xmlpres>{string(@xmlPresentationFile)}</xmlpres>
}
{
(doc($inputDocument)/config/application/presentation)[1]/
<rootPath>{string(@rootPath)}</rootPath>
}
</result>

24
xinx.kdevelop

@ -23,8 +23,8 @@
</ignoreparts>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description></description>
<defaultencoding></defaultencoding>
<description/>
<defaultencoding/>
<versioncontrol>kdevsubversion</versioncontrol>
</general>
<kdevfileview>
@ -82,11 +82,11 @@
</kdevdoctreeview>
<kdevdebugger>
<general>
<dbgshell></dbgshell>
<gdbpath></gdbpath>
<configGdbScript></configGdbScript>
<runShellScript></runShellScript>
<runGdbScript></runGdbScript>
<dbgshell/>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
@ -133,7 +133,7 @@
<includePaths>.;</includePaths>
</codecompletion>
<creategettersetter>
<prefixGet></prefixGet>
<prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
@ -157,13 +157,13 @@
</kdevfilecreate>
<kdevtrollproject>
<general>
<activedir>xinx</activedir>
<activedir>xinxprojectwizard</activedir>
</general>
<run>
<directoryradio>executable</directoryradio>
<mainprogram>/home/phoenix/logiciels/qt/xinx-trunk/xinx/xinx</mainprogram>
<programargs></programargs>
<globaldebugarguments></globaldebugarguments>
<programargs/>
<globaldebugarguments/>
<globalcwd>/home/phoenix/logiciels/qt/xinx-trunk</globalcwd>
<useglobalprogram>true</useglobalprogram>
<terminal>false</terminal>
@ -191,7 +191,7 @@
<runmultiplejobs>true</runmultiplejobs>
<numberofjobs>3</numberofjobs>
<dontact>false</dontact>
<makebin></makebin>
<makebin/>
<prio>0</prio>
<envvars/>
</make>

195
xinx/configurationfile.cpp

@ -158,12 +158,57 @@ inline bool ConfigurationVersion::operator<= ( ConfigurationVersion version ) co
return ! ( *this > version );
}
/* ConfigurationFileXmlReceiver */
class ConfigurationFileXmlReceiver : public QAbstractXmlReceiver {
public:
ConfigurationFileXmlReceiver( QXmlQuery * query, QString * version, int * build, QString * xmlPresentationFile, QString * rootPath )
: QAbstractXmlReceiver(), m_query( query ), m_version( version ), m_xmlPresentationFile( xmlPresentationFile ), m_rootPath( rootPath ), m_build( build ) {
};
virtual ~ConfigurationFileXmlReceiver() {};
virtual void atomicValue ( const QVariant & ) {};
virtual void attribute ( const QXmlName &, const QStringRef & ) {};
virtual void comment ( const QString & ) {};
virtual void endDocument () {};
virtual void endOfSequence () {};
virtual void namespaceBinding ( const QXmlName & ) {};
virtual void processingInstruction ( const QXmlName &, const QString & ) {};
virtual void startDocument () {};
virtual void startOfSequence () {};
virtual void endElement () {};
virtual void startElement ( const QXmlName & name ) {
m_currentElement = name.localName( m_query->namePool() );
};
virtual void characters ( const QStringRef & value ) {
if( m_currentElement == "numero" ) {
*m_version = value.toString();
} else
if( m_currentElement == "edition_speciale" ) {
*m_build = value.toString().toInt();
} else
if( m_currentElement == "xmlpres" ) {
*m_xmlPresentationFile = value.toString();
} else
if( m_currentElement == "rootPath" ) {
*m_rootPath = value.toString();
}
};
private:
QXmlQuery * m_query;
QString m_currentElement;
QString * m_version, * m_xmlPresentationFile, * m_rootPath;
int * m_build;
};
/* ConfigurationFile */
ConfigurationFile::ConfigurationFile( QObject * parent ) : QObject( parent ) {
ConfigurationFile::ConfigurationFile( QObject * parent ) : QObject( parent ), m_hasRead( false ) {
}
ConfigurationFile::ConfigurationFile( const QString & filename, QObject * parent ) : QObject( parent ), m_filename( filename ) {
ConfigurationFile::ConfigurationFile( const QString & filename, QObject * parent ) : QObject( parent ), m_filename( filename ), m_hasRead( false ) {
}
ConfigurationFile::ConfigurationFile( const ConfigurationFile & configuration ) : QObject() {
@ -177,7 +222,7 @@ ConfigurationFile & ConfigurationFile::operator=( const ConfigurationFile & p )
this->m_version = p.m_version;
this->m_filename = p.m_filename;
this->m_xmlPresentationFile = p.m_xmlPresentationFile;
this->setParent( p.parent() );
this->m_hasRead = p.m_hasRead;
return *this;
}
@ -186,120 +231,102 @@ const QString & ConfigurationFile::filename() const {
return m_filename;
}
ConfigurationVersion ConfigurationFile::version() {
if( m_version.isValid() ) return m_version;
try {
QFile sourceDocument;
sourceDocument.setFileName( m_filename );
if(! sourceDocument.open(QIODevice::ReadOnly))
throw ConfigurationVersionIncorectException( "" );
QString versionInfo;
int buildInfo = 0;
QXmlQuery query;
QXmlResultItems result;
query.bindVariable( "inputDocument", &sourceDocument );
query.setQuery( "declare default element namespace 'http://www.generix.fr/technicalframework/configuration';\n"
"doc($inputDocument)/config/version/numero/\n"
"string(text())" );
void ConfigurationFile::read() {
if( m_hasRead ) return;
if( !query.isValid() )
throw ConfigurationVersionIncorectException( "" );
query.evaluateTo( &result );
if( result.hasError() )
throw ConfigurationVersionIncorectException( "" );
// Initialisation
QString versionInfo;
int buildInfo = 0;
m_xmlPresentationFile = "Presentation.xml";
QXmlItem item( result.next() );
if( !item.isNull() ) versionInfo = item.toAtomicValue().toString();
// Open the file to read it
QFile sourceDocument;
sourceDocument.setFileName( m_filename );
if(! sourceDocument.open( QIODevice::ReadOnly ) ) {
qWarning( qPrintable( tr("Error while opening configuration file : %1").arg( sourceDocument.errorString() ) ) );
return;
}
sourceDocument.reset();
query.setQuery( "declare default element namespace 'http://www.generix.fr/technicalframework/configuration';\n"
"doc($inputDocument)/config/version/edition_speciale/\n"
"string(text())" );
// Open the query
QFile sourceCode;
sourceCode.setFileName( "scripts:conf_version.xq" );
if(! sourceCode.open( QIODevice::ReadOnly ) ) {
qWarning( qPrintable( tr("Error while opening version query : %1").arg( sourceCode.errorString() ) ) );
return ;
}
if( !query.isValid() )
throw ConfigurationVersionIncorectException( "" );
// Prepare the query
QXmlQuery query;
ConfigurationFileXmlReceiver receiver( &query, &versionInfo, &buildInfo, &m_xmlPresentationFile, &m_rootPath );
query.evaluateTo( &result );
item = QXmlItem( result.next() );
if( !item.isNull() ) buildInfo = item.toAtomicValue().toInt();
// Execute the query
query.bindVariable( "inputDocument", &sourceDocument );
query.setQuery( &sourceCode );
query.evaluateTo( &receiver );
// Interprete the result
try {
m_version = ConfigurationVersion( versionInfo, buildInfo );
return m_version;
} catch( ConfigurationVersionIncorectException ) {
return ConfigurationVersion();
m_version = ConfigurationVersion();
}
m_hasRead = true;
}
QString ConfigurationFile::xmlPresentationFile() {
if( ! m_xmlPresentationFile.isNull() ) return m_xmlPresentationFile;
m_xmlPresentationFile = "Presentation.xml";
QFile sourceDocument;
sourceDocument.setFileName( m_filename );
sourceDocument.open(QIODevice::ReadOnly);
QXmlQuery query;
QXmlResultItems result;
query.bindVariable( "inputDocument", &sourceDocument );
query.setQuery( "declare default element namespace 'http://www.generix.fr/technicalframework/configuration';\n"
"doc($inputDocument)/config/application/properties/\n"
"string(@xmlPresentationFile)" );
query.evaluateTo( &result );
if( result.hasError() ) return m_xmlPresentationFile;
QXmlItem item( result.next() );
if( !item.isNull() ) m_xmlPresentationFile = item.toAtomicValue().toString();
ConfigurationVersion ConfigurationFile::version() {
read();
return m_version;
}
QString ConfigurationFile::xmlPresentationFile() {
read();
return m_xmlPresentationFile;
}
QStringList ConfigurationFile::businessViewPerFiles( const QString & filename ) {
QStringList fileList;
QString relativeFileName = filename, rootPath;
read();
// Initialisation
QStringList businessViewList;
QString relativeFileName = filename;
relativeFileName.remove( m_rootPath );
while( relativeFileName.startsWith( '/' ) ) relativeFileName.remove( 0, 1 );
// Open the source document
QFile sourceDocument;
sourceDocument.setFileName( m_filename );
sourceDocument.open( QIODevice::ReadOnly );
if(! sourceDocument.open( QIODevice::ReadOnly ) ) {
qWarning( qPrintable( tr("Error while opening configuration file : %1").arg( sourceDocument.errorString() ) ) );
return businessViewList;
}
// Open the source query
QFile sourceCode;
sourceCode.setFileName( "scripts:conf_businessviewlist.xq" );
if(! sourceCode.open( QIODevice::ReadOnly ) ) {
qWarning( qPrintable( tr("Error while opening businessview list query : %1").arg( sourceCode.errorString() ) ) );
return businessViewList;
}
// Prepare the query
QXmlQuery query;
QXmlResultItems result;
query.bindVariable( "inputDocument", &sourceDocument );
query.setQuery( "declare default element namespace 'http://www.generix.fr/technicalframework/configuration';\n"
"doc($inputDocument)/config/application/presentation/\n"
"string(@rootPath)" );
query.bindVariable( "relativeFileName", QVariant::fromValue( relativeFileName ) );
query.setQuery( &sourceCode );
// Execute the query
query.evaluateTo( &result );
// Interprete the result
QXmlItem item( result.next() );
if( !item.isNull() ) rootPath = item.toAtomicValue().toString();
relativeFileName.remove( rootPath );
while( relativeFileName.startsWith( '/' ) ) relativeFileName.remove( 0, 1 );
sourceDocument.reset();
query.setQuery( "declare default element namespace 'http://www.generix.fr/technicalframework/configuration';\n"
"doc($inputDocument)/config/application/presentation/*[@fileRef='" + relativeFileName + "']/\n"
"string(@businessview)" );
query.evaluateTo( &result );
item = result.next();
while( !item.isNull() ) {
fileList << item.toAtomicValue().toString();
businessViewList << item.toAtomicValue().toString();
item = result.next();
}
return fileList;
return businessViewList;
}
bool ConfigurationFile::exists( const QString & directoryPath ) {

5
xinx/configurationfile.h

@ -33,7 +33,6 @@
#undef major
#undef minor
class ConfigurationVersionIncorectException : public XinxException {
public:
ConfigurationVersionIncorectException( QString version );
@ -195,6 +194,10 @@ private:
QString m_filename;
ConfigurationVersion m_version;
QString m_xmlPresentationFile;
QString m_rootPath;
bool m_hasRead;
void read();
};
/*!

21
xinx/customdialogimpl.cpp

@ -562,9 +562,9 @@ void PrivateCustomDialogImpl::showConfig() {//m_specifiqueTableView
// Plugins
m_parent->m_pluginListView->clear();
foreach( XinxPluginElement plugin, XinxPluginsLoader::self()->plugins() ) {
XinxPluginElement * e = new XinxPluginElement( plugin.plugin(), plugin.isStatic() );
e->setActivated( plugin.isActivated() );
foreach( XinxPluginElement * plugin, XinxPluginsLoader::self()->plugins() ) {
XinxPluginElement * e = new XinxPluginElement( plugin->plugin(), plugin->isStatic() );
e->setActivated( plugin->isActivated() );
m_parent->m_pluginListView->addPlugin( e );
}
}
@ -670,9 +670,13 @@ void PrivateCustomDialogImpl::storeConfig() {
// Plugins
foreach( PluginElement * plugin, m_parent->m_pluginListView->plugins() ) {
XinxPluginElement * element = dynamic_cast<XinxPluginElement*>( plugin );
QString name = element->plugin()->metaObject()->className();
QString name = dynamic_cast<XinxPluginElement*>( plugin )->plugin()->metaObject()->className();
bool isActivated = plugin->isActivated();
m_config.config().plugins[ name ] = isActivated;
if( XinxPluginsLoader::self()->plugin( name ) ) {
XinxPluginsLoader::self()->plugin( name )->setActivated( isActivated );
}
}
}
@ -824,13 +828,6 @@ CustomDialogImpl::CustomDialogImpl( QWidget * parent, Qt::WFlags f) : QDialog(
// Plugins
connect( m_pluginListView, SIGNAL(configurePlugin(PluginElement*)), d, SLOT(configurePlugin(PluginElement*)) );
connect( m_pluginListView, SIGNAL(aboutPlugin(PluginElement*)), d, SLOT(aboutPlugin(PluginElement*)) );
m_pluginListView->clear();
foreach( XinxPluginElement plugin, XinxPluginsLoader::self()->plugins() ) {
XinxPluginElement * e = new XinxPluginElement( plugin.plugin(), plugin.isStatic() );
e->setActivated( plugin.isActivated() );
m_pluginListView->addPlugin( e );
}
}
CustomDialogImpl::~CustomDialogImpl() {

2
xinx/main.cpp

@ -78,6 +78,8 @@ int main(int argc, char *argv[]) {
app.setOrganizationDomain( "Shadoware.Org" );
app.setApplicationName( "XINX" );
QDir::setSearchPaths( "datas", QStringList() ); // Modify by XinxConfig
QDir::addSearchPath( "scripts", QDir( QApplication::applicationDirPath() ).absoluteFilePath( "../scripts" ) );
if( app.isUnique() ) {
QPixmap pixmap(":/images/splash.png");
QSplashScreen splash(pixmap);

12
xinx/mainformimpl.cpp

@ -1234,9 +1234,9 @@ void PrivateMainformImpl::replace() {
bool PrivateMainformImpl::closeProject( bool session ) {
if( ! XINXProjectManager::self()->project() ) return false;
foreach( XinxPluginElement e, XinxPluginsLoader::self()->plugins() ) {
if( e.isActivated() && (! qobject_cast<IXinxPlugin*>( e.plugin() )->destroyProject( XINXProjectManager::self()->project() ) ))
qWarning( qPrintable(tr("Can't stop a project for plugin \"%1\"").arg( qobject_cast<IXinxPlugin*>( e.plugin() )->getPluginAttribute( IXinxPlugin::PLG_NAME ).toString() )) );
foreach( XinxPluginElement * e, XinxPluginsLoader::self()->plugins() ) {
if( e->isActivated() && (! qobject_cast<IXinxPlugin*>( e->plugin() )->destroyProject( XINXProjectManager::self()->project() ) ))
qWarning( qPrintable(tr("Can't stop a project for plugin \"%1\"").arg( qobject_cast<IXinxPlugin*>( e->plugin() )->getPluginAttribute( IXinxPlugin::PLG_NAME ).toString() )) );
}
m_parent->saveProject( session );
@ -1473,9 +1473,9 @@ void MainformImpl::openProject( const QString & filename ) {
XINXProjectManager::self()->setCurrentProject( project );
d->m_projectDock->setProjectPath( XINXProjectManager::self()->project() );
foreach( XinxPluginElement e, XinxPluginsLoader::self()->plugins() ) {
if( e.isActivated() && (! qobject_cast<IXinxPlugin*>( e.plugin() )->initializeProject( XINXProjectManager::self()->project() ) ))
qWarning( qPrintable(tr("Can't start a project for plugin \"%1\"").arg( qobject_cast<IXinxPlugin*>( e.plugin() )->getPluginAttribute( IXinxPlugin::PLG_NAME ).toString() )) );
foreach( XinxPluginElement * e, XinxPluginsLoader::self()->plugins() ) {
if( e->isActivated() && (! qobject_cast<IXinxPlugin*>( e->plugin() )->initializeProject( XINXProjectManager::self()->project() ) ))
qWarning( qPrintable(tr("Can't start a project for plugin \"%1\"").arg( qobject_cast<IXinxPlugin*>( e->plugin() )->getPluginAttribute( IXinxPlugin::PLG_NAME ).toString() )) );
}
} catch( XSLProjectException e ) {
delete project;

6
xinx/newprojectwizard.cpp

@ -41,9 +41,9 @@ NewProjectWizard::NewProjectWizard( QWidget * widget, Qt::WFlags f ) : QWizard(
setPage( Page_Versions, m_versions = new VersionsPageImpl );
int pageid = NewProjectWizard::Page_Versions + 1;
foreach( XinxPluginElement element, XinxPluginsLoader::self()->plugins() ) {
if( element.isActivated() && qobject_cast<IXinxPluginProjectConfiguration*>( element.plugin() ) ) {
IXinxPluginProjectConfiguration* interface = qobject_cast<IXinxPluginProjectConfiguration*>( element.plugin() );
foreach( XinxPluginElement * element, XinxPluginsLoader::self()->plugins() ) {
if( element->isActivated() && qobject_cast<IXinxPluginProjectConfiguration*>( element->plugin() ) ) {
IXinxPluginProjectConfiguration* interface = qobject_cast<IXinxPluginProjectConfiguration*>( element->plugin() );
QList<QWizardPage*> pages = interface->createNewProjectSettingsPages( pageid );
foreach( QWizardPage* page, pages ) {
m_wizardPages.append( qMakePair( interface, page ) );

6
xinx/projectpropertyimpl.cpp

@ -41,9 +41,9 @@ ProjectPropertyImpl::ProjectPropertyImpl( QWidget * parent, Qt::WFlags f) : QDia
foreach( revisionControl, XinxPluginsLoader::self()->revisionsControls() )
m_projectRCSComboBox->addItem( revisionControl.second, revisionControl.first );
foreach( XinxPluginElement element, XinxPluginsLoader::self()->plugins() ) {
if( element.isActivated() && qobject_cast<IXinxPluginProjectConfiguration*>( element.plugin() ) ) {
IXinxPluginProjectConfiguration* interface = qobject_cast<IXinxPluginProjectConfiguration*>( element.plugin() );
foreach( XinxPluginElement * element, XinxPluginsLoader::self()->plugins() ) {
if( element->isActivated() && qobject_cast<IXinxPluginProjectConfiguration*>( element->plugin() ) ) {
IXinxPluginProjectConfiguration* interface = qobject_cast<IXinxPluginProjectConfiguration*>( element->plugin() );
QWidget* widget = interface->createProjectSettingsPage();
if( widget ) {
m_pluginPages.append( qMakePair( interface, widget ) );

4
xinx/scriptmanager.cpp

@ -139,9 +139,7 @@ ScriptManager::~ScriptManager() {
}
void ScriptManager::loadScripts() {
QDir scriptDir = QApplication::applicationDirPath();
scriptDir.cdUp();
scriptDir.cd( "scripts" );
QDir scriptDir("scripts:");
QStringList filenames = scriptDir.entryList( QStringList("*.js"), QDir::Files );

4
xinx/ui/specifiquedlg.ui

@ -5,8 +5,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>451</width>
<height>316</height>
<width>391</width>
<height>445</height>
</rect>
</property>
<property name="windowTitle" >

Loading…
Cancel
Save