Browse Source

Some bug correction

v0.8.0
Ulrich Van Den Hekke 14 years ago
parent
commit
c2edc8db56
  1. 16
      WARNING
  2. 19
      libxinx/appsettings.cpp
  3. 6
      libxinx/appsettings.h
  4. 6
      libxinx/config.xml
  5. 15
      libxinx/plugininterfaces.h
  6. 3
      libxinx/xinxconfig.cpp
  7. 8
      plugins/services/webservicesfiletype.h
  8. 54
      plugins/webplugin/filetypeplugin.h
  9. 4
      plugins/webplugin/xsl/xmltexteditor.cpp
  10. 6
      plugins/xsd/xsdedit.cpp
  11. 6
      plugins/xslgui/xslgui.cpp
  12. 38
      xinx/customdialogimpl.cpp
  13. 13
      xinx/specifiquedlgimpl.cpp
  14. 1
      xinx/specifiquedlgimpl.h

16
WARNING

@ -8,17 +8,17 @@ @@ -8,17 +8,17 @@
* Crash quand essai d'utilisation de Ctrl+Shift+Bas
* Quand ca marche, le curseur ne suit pas la ligne
* Quand j'ai une selection plantage.
- Le surligner automatique/non automatique ne fonctionne pas. ==> le fichier de config est chargé après le plugins
- Le surligner automatique/non automatique ne fonctionne pas. ==> le fichier de config est charge apres le plugins
* Le surligner ne marche pas quand recherche espace.
- Probleme lors d'ouverture de fichier qui n'existe plus ?
- Ctrl+D pour dupliquer ne fonctionne pas : plantage
- Si ajout de // sur une ligne de l'editeur ....
- Ctrl+Enter ne fonctionne plus
* Si ajout de // sur une ligne de l'editeur ....
* Ctrl+Enter ne fonctionne plus
- Verifier
- Que les parametre sur la specificite d'un type de fichier fonctionne toujours
* Verifier
* Que les parametre sur la specificite d'un type de fichier fonctionne toujours
- Lenteur :
- Problème lors de enter suivis directe d'un tab
- Si Ok dans boite de dialogue propriété projet.
- après sauvegarde ? ==> Remettre les plugins au carr
- Probleme lors de enter suivis directe d'un tab
- Si Ok dans boite de dialogue propriete projet.
- apres sauvegarde ? ==> Remettre les plugins au carr

19
libxinx/appsettings.cpp

@ -4,7 +4,6 @@ @@ -4,7 +4,6 @@
#include <QLocale>
#include <QDir>
#include <QApplication>
#include <QStyle>
#include "appsettings.h"
@ -291,7 +290,9 @@ void AppSettings::setSettingsDescriptions( AppSettingsSettings * settings, const @@ -291,7 +290,9 @@ void AppSettings::setSettingsDescriptions( AppSettingsSettings * settings, const
AppSettings::AppSettings::struct_extentions AppSettings::getDefaultExtentions() {
struct_extentions value;
value.canBeSpecifique = true;
value.canBeSaveAsSpecifique = true;
value.canBeFindInConfiguration = false;
value.canBeCommitToRcs = true;
return value;
}
@ -300,8 +301,10 @@ AppSettings::AppSettings::struct_extentions AppSettings::getSettingsExtentions( @@ -300,8 +301,10 @@ AppSettings::AppSettings::struct_extentions AppSettings::getSettingsExtentions(
struct_extentions value;
settings->beginGroup( path );
value.customPath = settings->value( "Custom Path", defaultValue.customPath ).toString();
value.canBeSpecifique = settings->value( "Can Be Specifique", defaultValue.canBeSpecifique ).toBool();
value.specifiqueSubDirectory = settings->value( "Specifique Sub Directory", defaultValue.specifiqueSubDirectory ).toString();
value.canBeSaveAsSpecifique = settings->value( "Can Be Save As Specifique", defaultValue.canBeSaveAsSpecifique ).toBool();
value.canBeFindInConfiguration = settings->value( "Can Be Find In Configuration", defaultValue.canBeFindInConfiguration ).toBool();
value.canBeCommitToRcs = settings->value( "Can Be Commit To RCS", defaultValue.canBeCommitToRcs ).toBool();
settings->endGroup();
return value;
@ -311,8 +314,10 @@ void AppSettings::setSettingsExtentions( AppSettingsSettings * settings, const Q @@ -311,8 +314,10 @@ void AppSettings::setSettingsExtentions( AppSettingsSettings * settings, const Q
struct_extentions defaultValue = getDefaultExtentions();
settings->beginGroup( path );
settings->setValue( "Custom Path", value.customPath, defaultValue.customPath );
settings->setValue( "Can Be Specifique", value.canBeSpecifique, defaultValue.canBeSpecifique );
settings->setValue( "Specifique Sub Directory", value.specifiqueSubDirectory, defaultValue.specifiqueSubDirectory );
settings->setValue( "Can Be Save As Specifique", value.canBeSaveAsSpecifique, defaultValue.canBeSaveAsSpecifique );
settings->setValue( "Can Be Find In Configuration", value.canBeFindInConfiguration, defaultValue.canBeFindInConfiguration );
settings->setValue( "Can Be Commit To RCS", value.canBeCommitToRcs, defaultValue.canBeCommitToRcs );
settings->endGroup();
}
@ -368,7 +373,7 @@ AppSettings::AppSettings::struct_globals AppSettings::getDefaultGlobals() { @@ -368,7 +373,7 @@ AppSettings::AppSettings::struct_globals AppSettings::getDefaultGlobals() {
value.language = QLocale::system().name();
value.position = QPoint( 200,200 );
value.size = QSize( 400,400 );
value.maximized = false;;
value.maximized = false;
value.plugins = getDefaultHash_bool();
value.descriptions = getDefaultDescriptions();
value.project = getDefaultProject();

6
libxinx/appsettings.h

@ -71,8 +71,10 @@ public: @@ -71,8 +71,10 @@ public:
};
struct struct_extentions {
QString customPath;
bool canBeSpecifique;
QString specifiqueSubDirectory;
bool canBeSaveAsSpecifique;
bool canBeFindInConfiguration;
bool canBeCommitToRcs;
};
struct struct_xmlpres {

6
libxinx/config.xml

@ -12,8 +12,10 @@ @@ -12,8 +12,10 @@
<value name="Show name attribute if exists" type="bool" default="true"/>
</type>
<type name="Extentions">
<value name="Custom Path" type="string"/>
<value name="Can Be Specifique" type="bool" default="yes"/>
<value name="Specifique Sub Directory" type="string"/>
<value name="Can Be Save As Specifique" type="bool" default="yes"/>
<value name="Can Be Find In Configuration" type="bool" default="no"/>
<value name="Can Be Commit To RCS" type="bool" default="yes"/>
</type>
<type name="Descriptions">
<value name="Datas" type="string" defaultInstruction="QDir( qApp->applicationDirPath() ).absoluteFilePath( &quot;../xml&quot; )"/>

15
libxinx/plugininterfaces.h

@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
// Xinx header
#include <filecontentstructure.h>
#include <appsettings.h>
class XINXConfig;
class QObject;
@ -160,18 +161,6 @@ public: @@ -160,18 +161,6 @@ public:
*/
class IFileTypePlugin {
public:
/*!
* Structure indicate if a file type plugin can be save as specifique and the
* directory where the file must be stored if it can. This is the default value,
* Real value are stored in the configuration.
*/
struct struct_properties {
bool canBeCommitToRCS; //!< not yet implemented
bool canBeFindInConfiguration; //!< not yet implemented
bool canBeSaveAsSpecifique;
QString specifiqueSubDirectory;
};
//! Destroy a file type
virtual ~IFileTypePlugin() {};
@ -183,7 +172,7 @@ public: @@ -183,7 +172,7 @@ public:
virtual QIcon icon() = 0;
//! Return some properties for the file type
virtual struct_properties properties() = 0;
virtual AppSettings::struct_extentions properties() = 0;
//! Create an editor with the given filename
virtual AbstractEditor * createEditor( const QString & filename = QString() ) = 0;

3
libxinx/xinxconfig.cpp

@ -149,6 +149,9 @@ AppSettings::struct_globals XINXConfig::getDefaultGlobals() { @@ -149,6 +149,9 @@ AppSettings::struct_globals XINXConfig::getDefaultGlobals() {
value.files[ plugin->description() ].customPath = plugin->properties().specifiqueSubDirectory;
}
*/
foreach( IFileTypePlugin * plugin , XinxPluginsLoader::self()->fileTypes() ) {
value.files[ plugin->description() ] = plugin->properties();
}
#ifndef Q_WS_WIN
value.xinxTrace = "/tmp/xinx_trace.html";

8
plugins/services/webservicesfiletype.h

@ -32,9 +32,9 @@ public: @@ -32,9 +32,9 @@ public:
virtual QString match() { return "*.fws"; };
virtual QIcon icon() { return QIcon( ":/services/images/typefws.png" ); };
virtual struct_properties properties() {
struct_properties p;
p.canBeCommitToRCS = true;
virtual AppSettings::struct_extentions properties() {
AppSettings::struct_extentions p;
p.canBeCommitToRcs = true;
p.canBeFindInConfiguration = false;
p.canBeSaveAsSpecifique = false;
p.specifiqueSubDirectory = QString();
@ -57,4 +57,4 @@ public: @@ -57,4 +57,4 @@ public:
}
};
#endif // _WEBSERVICESFILETYPE_H_
#endif // _WEBSERVICESFILETYPE_H_

54
plugins/webplugin/filetypeplugin.h

@ -75,22 +75,18 @@ public: @@ -75,22 +75,18 @@ public:
QHash<QString,QTextCharFormat> formats = defaultsFormat();
foreach( QString key, formats.keys() )
XINXConfig::self()->config().formats[ key ] = formats[ key ];
struct_properties property = properties();
XINXConfig::self()->config().files[ description() ].canBeSpecifique = property.canBeSaveAsSpecifique;
XINXConfig::self()->config().files[ description() ].customPath = property.specifiqueSubDirectory;
}
virtual QString description() { return tr( "XML File" ); };
virtual QString match() { return "*.xml"; };
virtual QIcon icon() { return QIcon( ":/images/typexml.png" ); };
virtual struct_properties properties() {
struct_properties p;
p.canBeCommitToRCS = true;
virtual AppSettings::struct_extentions properties() {
AppSettings::struct_extentions p;
p.canBeCommitToRcs = true;
p.canBeFindInConfiguration = false;
p.canBeSaveAsSpecifique = true;
p.specifiqueSubDirectory = QString();
p.specifiqueSubDirectory = "xml/";
return p;
};
@ -154,9 +150,9 @@ public: @@ -154,9 +150,9 @@ public:
virtual QString match() { return "*.xsl"; };
virtual QIcon icon() { return QIcon( ":/images/typexsl.png" ); };
virtual struct_properties properties() {
struct_properties p;
p.canBeCommitToRCS = true;
virtual AppSettings::struct_extentions properties() {
AppSettings::struct_extentions p;
p.canBeCommitToRcs = true;
p.canBeFindInConfiguration = true;
p.canBeSaveAsSpecifique = true;
p.specifiqueSubDirectory = QString();
@ -189,9 +185,9 @@ public: @@ -189,9 +185,9 @@ public:
virtual QString match() { return "*.htm *.html *.xhtml"; };
virtual QIcon icon() { return QIcon( ":/images/typehtml.png" ); };
virtual struct_properties properties() {
struct_properties p;
p.canBeCommitToRCS = true;
virtual AppSettings::struct_extentions properties() {
AppSettings::struct_extentions p;
p.canBeCommitToRcs = true;
p.canBeFindInConfiguration = false;
p.canBeSaveAsSpecifique = false;
p.specifiqueSubDirectory = QString();
@ -217,19 +213,15 @@ public: @@ -217,19 +213,15 @@ public:
QHash<QString,QTextCharFormat> formats = defaultsFormat();
foreach( QString key, formats.keys() )
XINXConfig::self()->config().formats[ key ] = formats[ key ];
struct_properties property = properties();
XINXConfig::self()->config().files[ description() ].canBeSpecifique = property.canBeSaveAsSpecifique;
XINXConfig::self()->config().files[ description() ].customPath = property.specifiqueSubDirectory;
}
virtual QString description() { return tr( "JavaScript" ); };
virtual QString match() { return "*.js"; };
virtual QIcon icon() { return QIcon( ":/images/typejs.png" ); };
virtual struct_properties properties() {
struct_properties p;
p.canBeCommitToRCS = true;
virtual AppSettings::struct_extentions properties() {
AppSettings::struct_extentions p;
p.canBeCommitToRcs = true;
p.canBeFindInConfiguration = false;
p.canBeSaveAsSpecifique = true;
p.specifiqueSubDirectory = "js/";
@ -290,19 +282,15 @@ public: @@ -290,19 +282,15 @@ public:
QHash<QString,QTextCharFormat> formats = defaultsFormat();
foreach( QString key, formats.keys() )
XINXConfig::self()->config().formats[ key ] = formats[ key ];
struct_properties property = properties();
XINXConfig::self()->config().files[ description() ].canBeSpecifique = property.canBeSaveAsSpecifique;
XINXConfig::self()->config().files[ description() ].customPath = property.specifiqueSubDirectory;
}
virtual QString description() { return tr( "Cascading Style Sheet" ); };
virtual QString match() { return "*.css"; };
virtual QIcon icon() { return QIcon( ":/images/typecss.png" ); };
virtual struct_properties properties() {
struct_properties p;
p.canBeCommitToRCS = true;
virtual AppSettings::struct_extentions properties() {
AppSettings::struct_extentions p;
p.canBeCommitToRcs = true;
p.canBeFindInConfiguration = false;
p.canBeSaveAsSpecifique = true;
p.specifiqueSubDirectory = "css/";
@ -374,10 +362,6 @@ public: @@ -374,10 +362,6 @@ public:
foreach( QString key, formats.keys() )
XINXConfig::self()->config().formats[ key ] = formats[ key ];
struct_properties property = properties();
XINXConfig::self()->config().files[ description() ].canBeSpecifique = property.canBeSaveAsSpecifique;
XINXConfig::self()->config().files[ description() ].customPath = property.specifiqueSubDirectory;
QTemporaryFile temporaryXqFile;
if( temporaryXqFile.open() ) {
QTextStream textStream( &temporaryXqFile );
@ -424,9 +408,9 @@ public: @@ -424,9 +408,9 @@ public:
virtual QString match() { return "*.xq"; };
virtual QIcon icon() { return QIcon( ":/images/typexq.png" ); };
virtual struct_properties properties() {
struct_properties p;
p.canBeCommitToRCS = false;
virtual AppSettings::struct_extentions properties() {
AppSettings::struct_extentions p;
p.canBeCommitToRcs = false;
p.canBeFindInConfiguration = false;
p.canBeSaveAsSpecifique = false;
p.specifiqueSubDirectory = QString();

4
plugins/webplugin/xsl/xmltexteditor.cpp

@ -405,13 +405,13 @@ void XmlTextEditor::key_shenter( bool back ) { @@ -405,13 +405,13 @@ void XmlTextEditor::key_shenter( bool back ) {
cursor.moveTo( cursor.selectionStart() );
cursor.movePosition( 2, QDocumentCursor::Left, QDocumentCursor::MoveAnchor );
}
cursor = find( QRegExp("=\"[^\"]*\""), cursor, flags ).selectionEnd();
cursor = find( QRegExp("=\"[^\"]*\""), cursor, flags );
if( ! cursor.isNull() ) {
QDocumentCursor newCursor = textCursor();
newCursor.moveTo( cursor.selectionStart() );
newCursor.movePosition( 2, QDocumentCursor::Right );
newCursor.movePosition( cursor.selectionEnd().position() - cursor.selectionStart().position() - 1, QDocumentCursor::Right, QDocumentCursor::KeepAnchor );
newCursor.movePosition( cursor.selectionEnd().position() - cursor.selectionStart().position() - 3, QDocumentCursor::Right, QDocumentCursor::KeepAnchor );
setTextCursor( newCursor );
}
}

6
plugins/xsd/xsdedit.cpp

@ -35,9 +35,9 @@ public: @@ -35,9 +35,9 @@ public:
virtual QString match() { return "*.xsd"; };
virtual QIcon icon() { return QIcon( ":/xsd/images/typexsd.png" ); };
virtual struct_properties properties() {
struct_properties p;
p.canBeCommitToRCS = true;
virtual AppSettings::struct_extentions properties() {
AppSettings::struct_extentions p;
p.canBeCommitToRcs = true;
p.canBeFindInConfiguration = false;
p.canBeSaveAsSpecifique = false;
p.specifiqueSubDirectory = "";

6
plugins/xslgui/xslgui.cpp

@ -35,9 +35,9 @@ public: @@ -35,9 +35,9 @@ public:
virtual QString match() { return "*.xui"; };
virtual QIcon icon() { return QIcon( ":/xslgui/images/typexui.png" ); };
virtual struct_properties properties() {
struct_properties p;
p.canBeCommitToRCS = true;
virtual AppSettings::struct_extentions properties() {
AppSettings::struct_extentions p;
p.canBeCommitToRcs = true;
p.canBeFindInConfiguration = true;
p.canBeSaveAsSpecifique = true;
p.specifiqueSubDirectory = "xui/";

38
xinx/customdialogimpl.cpp

@ -193,7 +193,7 @@ int SpecifiqueModelIndex::rowCount( const QModelIndex & parent ) const { @@ -193,7 +193,7 @@ int SpecifiqueModelIndex::rowCount( const QModelIndex & parent ) const {
int SpecifiqueModelIndex::columnCount( const QModelIndex & parent ) const {
Q_UNUSED( parent );
return 3;
return 5;
}
QVariant SpecifiqueModelIndex::headerData ( int section, Qt::Orientation orientation, int role ) const {
@ -202,9 +202,13 @@ QVariant SpecifiqueModelIndex::headerData ( int section, Qt::Orientation orienta @@ -202,9 +202,13 @@ QVariant SpecifiqueModelIndex::headerData ( int section, Qt::Orientation orienta
case 0 :
return tr( "File type" );
case 1 :
return tr( "Can be specifique" );
return tr( "Can be save as specifique" );
case 2 :
return tr( "Sub-directory" );
case 3 :
return tr( "Can be Commited" );
case 4 :
return tr( "Is in configuration.xml" );
}
return QVariant();
}
@ -215,10 +219,16 @@ bool SpecifiqueModelIndex::setData ( const QModelIndex & index, const QVariant & @@ -215,10 +219,16 @@ bool SpecifiqueModelIndex::setData ( const QModelIndex & index, const QVariant &
AppSettings::struct_extentions ext = m_extentions.value( key );
switch( index.column() ) {
case 1:
ext.canBeSpecifique = value.toBool();
ext.canBeSaveAsSpecifique = value.toBool();
break;
case 2:
ext.customPath = value.toString();
ext.specifiqueSubDirectory = value.toString();
break;
case 3:
ext.canBeCommitToRcs = value.toBool();
break;
case 4:
ext.canBeFindInConfiguration = value.toBool();
break;
}
m_extentions.insert( key, ext );
@ -229,24 +239,18 @@ bool SpecifiqueModelIndex::setData ( const QModelIndex & index, const QVariant & @@ -229,24 +239,18 @@ bool SpecifiqueModelIndex::setData ( const QModelIndex & index, const QVariant &
}
QVariant SpecifiqueModelIndex::data ( const QModelIndex & index, int role ) const {
if( index.isValid() && ( role == Qt::DisplayRole ) ) {
switch( index.column() ) {
case 0 :
return m_extentions.keys().at( index.row() );
case 1 :
return m_extentions.values().at( index.row() ).canBeSpecifique;
case 2 :
return m_extentions.values().at( index.row() ).customPath;
}
}
if( index.isValid() && ( role == Qt::EditRole ) ) {
if( index.isValid() && ( ( role == Qt::DisplayRole ) || ( role == Qt::EditRole ) ) ) {
switch( index.column() ) {
case 0 :
return m_extentions.keys().at( index.row() );
case 1 :
return m_extentions.values().at( index.row() ).canBeSpecifique;
return m_extentions.values().at( index.row() ).canBeSaveAsSpecifique;
case 2 :
return m_extentions.values().at( index.row() ).customPath;
return m_extentions.values().at( index.row() ).specifiqueSubDirectory;
case 3 :
return m_extentions.values().at( index.row() ).canBeCommitToRcs;
case 4 :
return m_extentions.values().at( index.row() ).canBeFindInConfiguration;
}
}

13
xinx/specifiquedlgimpl.cpp

@ -66,14 +66,19 @@ bool SpecifiqueDialogImpl::isSpecifique( const QString & filename ) { @@ -66,14 +66,19 @@ bool SpecifiqueDialogImpl::isSpecifique( const QString & filename ) {
bool SpecifiqueDialogImpl::canBeSaveAsSpecifique( const QString & filename ) {
return XINXProjectManager::self()->project() &&
XINXProjectManager::self()->project()->options().testFlag( XSLProject::hasSpecifique ) &&
XINXConfig::self()->matchedFileType( filename ).canBeSpecifique &&
XINXConfig::self()->matchedFileType( filename ).canBeSaveAsSpecifique &&
QFileInfo( filename ).absolutePath().contains( XINXProjectManager::self()->project()->projectPath() );
}
bool SpecifiqueDialogImpl::isInConfigurationFile( const QString & filename ) {
return XINXConfig::self()->matchedFileType( filename ).canBeFindInConfiguration &&
QFileInfo( filename ).absolutePath().contains( XINXProjectManager::self()->project()->projectPath() );
}
bool SpecifiqueDialogImpl::canBeAddedToRepository( const QString & filename ) {
Q_UNUSED( filename );
return XINXProjectManager::self()->project() && ( ! XINXProjectManager::self()->project()->projectRCS().isEmpty() );
return XINXProjectManager::self()->project() && ( ! XINXProjectManager::self()->project()->projectRCS().isEmpty() ) && ( XINXConfig::self()->matchedFileType( filename ).canBeCommitToRcs );
}
void SpecifiqueDialogImpl::setLastPlace( const QString & pathname ) {
@ -99,7 +104,7 @@ void SpecifiqueDialogImpl::setFileName( const QString & filename ) { @@ -99,7 +104,7 @@ void SpecifiqueDialogImpl::setFileName( const QString & filename ) {
m_specifiqueCheckBox->setEnabled( (! filename.isEmpty() ) && ( ! isSpecifique( filename ) ) && canBeSaveAsSpecifique( filename ) );
m_repositoryCheckBox->setEnabled( canBeAddedToRepository( filename ) );
if( (! filename.isEmpty() ) && canBeSaveAsSpecifique( filename ) ) {
if( (! filename.isEmpty() ) && canBeSaveAsSpecifique( filename ) && isInConfigurationFile( filename ) ) {
m_instance = ThreadedConfigurationFile::businessViewOfFile( filename );
connect( m_instance, SIGNAL(businessViewFinded(QStringList)), this, SLOT(businessViewFinded(QStringList)) );
m_instance->start( QThread::IdlePriority );
@ -113,7 +118,7 @@ QString SpecifiqueDialogImpl::path() const { @@ -113,7 +118,7 @@ QString SpecifiqueDialogImpl::path() const {
if( m_specifiqueCheckBox->isChecked() ) {
QString newFilename = m_filename.isEmpty() ? m_defaultFileName : m_filename;
AppSettings::struct_extentions customFile = XINXConfig::self()->matchedFileType( newFilename );
return QDir( XINXProjectManager::self()->project()->processedSpecifiquePath() ).absoluteFilePath( customFile.customPath );
return QDir( XINXProjectManager::self()->project()->processedSpecifiquePath() ).absoluteFilePath( customFile.specifiqueSubDirectory );
} else if( !m_filename.isEmpty() )
return QFileInfo( m_filename ).absolutePath();
else

1
xinx/specifiquedlgimpl.h

@ -49,6 +49,7 @@ private: @@ -49,6 +49,7 @@ private:
static bool isSpecifique( const QString & filename );
static bool canBeSaveAsSpecifique( const QString & filename );
static bool isInConfigurationFile( const QString & filename );
static bool canBeAddedToRepository( const QString & filename );
static QString m_lastPlace;

Loading…
Cancel
Save