Browse Source

Merge epuration branches to trunk

v0.9.0
Ulrich Van Den Hekke 13 years ago
parent
commit
79f038ef5d
  1. 46
      WARNING
  2. 16
      components/components.pro
  3. 27
      components/directoryedit.cpp
  4. 30
      components/directoryedit.h
  5. 174
      components/ui/xinxlistwidget.ui
  6. 9
      components/xinxlistwidgetimpl.cpp
  7. 1
      ext/qcodeedit/example/main.cpp
  8. 29
      framework/contentview/contentviewparser.cpp
  9. 122
      framework/core/appsettings.cpp
  10. 31
      framework/core/appsettings.h
  11. 17
      framework/core/config.xml
  12. 14
      framework/core/xinxconfig.cpp
  13. 10
      framework/core/xinxconfig.h
  14. 50
      framework/editors/abstracteditor.cpp
  15. 2
      framework/editors/bookmarkeditorinterface.h
  16. 23
      framework/editors/xinxformatscheme.cpp
  17. 10
      framework/editors/xinxformatscheme.h
  18. 12
      framework/framework.pro
  19. 110
      framework/plugins/plugininterfaces.h
  20. 4
      framework/plugins/xinxpluginelement.cpp
  21. 1
      framework/plugins/xinxpluginelement.h
  22. 3
      framework/plugins/xinxpluginsloader.cpp
  23. 119
      framework/project/externalfileresolver.cpp
  24. 54
      framework/project/externalfileresolver.h
  25. 88
      framework/project/newprojecttemplate.cpp
  26. 56
      framework/project/newprojecttemplate.h
  27. 241
      framework/project/xinxproject.cpp
  28. 146
      framework/project/xinxproject.h
  29. 130
      framework/rcs/rcsmanager.cpp
  30. 92
      framework/rcs/rcsmanager.h
  31. 52
      framework/scripts/scriptmanager.cpp
  32. 3
      framework/scripts/scriptmanager.h
  33. 2
      framework/snipets/snipetmanager.cpp
  34. 13
      plugins/core/config/editorsconfigformimpl.cpp
  35. 3
      plugins/core/config/editorsconfigformimpl.h
  36. 34
      plugins/core/config/webpluginprojectpropertyform.ui
  37. 12
      plugins/core/config/xmlpresconfigformimpl.cpp
  38. 3
      plugins/core/config/xmlpresconfigformimpl.h
  39. 18
      plugins/core/core.pro
  40. 23
      plugins/core/docks/datastream/xmlpresentationdockthread.cpp
  41. 4
      plugins/core/docks/datastream/xmlpresentationdockthread.h
  42. 122
      plugins/core/editors/parsing/xsltparser.cpp
  43. 2
      plugins/core/editors/parsing/xsltparser.h
  44. 3
      plugins/core/editors/widgeteditor/xsl/xslfileeditor.cpp
  45. 59
      plugins/core/plugindefinition/coreplugin.cpp
  46. 17
      plugins/core/plugindefinition/coreplugin.h
  47. 63
      plugins/core/plugindefinition/filetypeplugin.cpp
  48. 7
      plugins/core/plugindefinition/filetypeplugin.h
  49. 52
      plugins/core/pluginproperty/parserprojectproperty.ui
  50. 127
      plugins/core/pluginproperty/parserprojectpropertyimpl.cpp
  51. 67
      plugins/core/pluginproperty/parserprojectpropertyimpl.h
  52. 97
      plugins/core/pluginproperty/searchpathlistprjpageform.cpp
  53. 59
      plugins/core/pluginproperty/searchpathlistprjpageform.h
  54. 32
      plugins/core/pluginproperty/searchpathlistprjpageform.ui
  55. 85
      plugins/core/pluginresolver/manualfileresolver.cpp
  56. 47
      plugins/core/pluginresolver/manualfileresolver.h
  57. 12
      plugins/cvsplugin/customizeplugin.cpp
  58. 4
      plugins/cvsplugin/customizeplugin.h
  59. 11
      plugins/generix/config/config.xml
  60. 56
      plugins/generix/config/customgenerix.ui
  61. 85
      plugins/generix/config/customgeneriximpl.cpp
  62. 62
      plugins/generix/config/customgeneriximpl.h
  63. 194
      plugins/generix/config/generixsettings.cpp
  64. 64
      plugins/generix/config/generixsettings.h
  65. 52
      plugins/generix/config/selfgenerixsettings.cpp
  66. 43
      plugins/generix/config/selfgenerixsettings.h
  67. 122
      plugins/generix/config/specifiquemodelindex.cpp
  68. 46
      plugins/generix/config/specifiquemodelindex.h
  69. 59
      plugins/generix/configuration/configurationfile.cpp
  70. 32
      plugins/generix/configuration/configurationfile.h
  71. 49
      plugins/generix/configuration/configurationfileedit.cpp
  72. 42
      plugins/generix/configuration/configurationfileedit.h
  73. 108
      plugins/generix/configuration/configurationmanager.cpp
  74. 55
      plugins/generix/configuration/configurationmanager.h
  75. 267
      plugins/generix/configuration/gceconfiguration.cpp
  76. 50
      plugins/generix/configuration/gceconfiguration.h
  77. 321
      plugins/generix/configuration/gceconfigurationdef.cpp
  78. 55
      plugins/generix/configuration/gceconfigurationdef.h
  79. 26
      plugins/generix/configuration/gceinterface.cpp
  80. 47
      plugins/generix/configuration/gceinterface.h
  81. 57
      plugins/generix/configuration/gceinterfacefactory.cpp
  82. 33
      plugins/generix/configuration/gceinterfacefactory.h
  83. 360
      plugins/generix/configuration/gceproperties.cpp
  84. 54
      plugins/generix/configuration/gceproperties.h
  85. 0
      plugins/generix/configuration/threadedconfigurationfile.cpp
  86. 0
      plugins/generix/configuration/threadedconfigurationfile.h
  87. 2
      plugins/generix/docks/dictionary/dictionarydockwidgetimpl.cpp
  88. 186
      plugins/generix/docks/project/generixprojectdock.cpp
  89. 60
      plugins/generix/docks/project/generixprojectdock.h
  90. 71
      plugins/generix/docks/project/gnxprojectdock.ui
  91. 102
      plugins/generix/generix.pro
  92. 164
      plugins/generix/plugindefinition/generix.cpp
  93. 34
      plugins/generix/plugindefinition/generix.h
  94. 10
      plugins/generix/plugindefinition/generix.qrc
  95. 0
      plugins/generix/plugindefinition/images/firefox_logo.png
  96. BIN
      plugins/generix/plugindefinition/images/france.png
  97. 0
      plugins/generix/plugindefinition/images/germany.png
  98. 0
      plugins/generix/plugindefinition/images/ie_logo.png
  99. 0
      plugins/generix/plugindefinition/images/italy.png
  100. 0
      plugins/generix/plugindefinition/images/portugal.png
  101. Some files were not shown because too many files have changed in this diff Show More

46
WARNING

@ -1,26 +1,24 @@ @@ -1,26 +1,24 @@
- Paste (Ctrl+V) doesn't work
* From word
* Rechercher/Remplacer : ne remplace pas
* Can't paste when i'm from XDME
* I have a crash in use (QVector index out of bound)
* Bookmark bar doesn't work
* If i have an error and i press <ENTER> before the error is correct, the line is red
* Attention la marque suit la ligne pas le numero de ligne.
* Bookmark sauvegarde mais invisible lors de la restauration
* 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 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
- We must find a method to tell if a file can be save to subversion/cvs !!
* Verifier
* Que les parametre sur la specificite d'un type de fichier fonctionne toujours
- XINXConfig : Delete the storing of extentions, and matchedFileType ==> Think to a new mode of work
- FileTypePlugin : Remove the properties type (where we said if the file can be in conf, repository, and project direcoty).
- XINX Project : ProjectOption ==> Find a new method to do this.
- XINX Project : Replace logProjectDirectory by dataFileDirectory (configuration of xmlpresentation ?) ==> à réinclude dans le plugin de présentation
- XINX Project : Replace searchPathList by a new way to resolve import.
- XINX Project : Move preloadedCache (the preloaded file can be stored in the project directory)
- XINX Project : Remove default lang, and default nav, specifique path name, specifique prefix, searchPathList, indexOfSpecifiquePath, processSpecifiquePath...
- ConfigurationFile : Remove file configurationfile.cpp/.h
- XINX Project : Remove the method that replace <PROJECT>, <NAV>, ... in processed file path from the project
- SpecifiqueDialogImpl : Move in the plugin directory. This dialog should be rewritten
- MainFormImpl : Remove extentionOfFileName in the mainform dialog (i think that this method is not used)
- MainFormImpl : Add link to the open, save, ... dialog (don't forget add all file to RCS, maybe have a RCS Manager)
- MainFormImpl : selectedCompareWithStd removed
- In the project directory dock : remove the list of prefix
- ProjectPropertyImpl : cleaned
- Lenteur :
- Probleme lors de enter suivis directe d'un tab
- Si Ok dans boite de dialogue propriete projet.
- apres sauvegarde ? ==> Remettre les plugins au carr
- To Test : Custom dialog ==> Generix page of custom dialog is now in generix plugin.
- Manage a type of project (to plugin know if the project is authorized). The type of plugin can be defined by the plugin
- Change the type of XINX project (.xinx_project).
- Make the new XINX version wizard.
- Check each page to validate value

16
components/components.pro

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
include(../project_mode.pri)
TEMPLATE = lib
unix:VERSION = 0.9.0.0
CONFIG += dll
win32 : QMAKE_LFLAGS_SHLIB *= -no-undefined -enable-runtime-pseudo-reloc
win32:QMAKE_LFLAGS_SHLIB *= -no-undefined \
-enable-runtime-pseudo-reloc
DESTDIR += ./
INCLUDEPATH += ../ext/qcodeedit/lib \
../ext/qcodeedit/lib/document \
@ -14,7 +14,7 @@ LIBS = -L../ext/qcodeedit \ @@ -14,7 +14,7 @@ LIBS = -L../ext/qcodeedit \
-lqcodeedit
TARGET = xinxcmp
FORMS = ui/xinxlistwidget.ui \
ui/customscheme.ui
ui/customscheme.ui
HEADERS = p_pluginselector.h \
pluginselector.h \
directoryedit.h \
@ -23,8 +23,8 @@ HEADERS = p_pluginselector.h \ @@ -23,8 +23,8 @@ HEADERS = p_pluginselector.h \
pluginelement.h \
borderlayout.h \
customschemeimpl.h \
qmenuview.h \
stringcombobox.h \
qmenuview.h \
stringcombobox.h \
xinxlineedit.h
SOURCES = directoryedit.cpp \
xinxcolorcombo.cpp \
@ -33,10 +33,8 @@ SOURCES = directoryedit.cpp \ @@ -33,10 +33,8 @@ SOURCES = directoryedit.cpp \
pluginelement.cpp \
borderlayout.cpp \
customschemeimpl.cpp \
qmenuview.cpp \
stringcombobox.cpp \
qmenuview.cpp \
stringcombobox.cpp \
xinxlineedit.cpp
TRANSLATIONS += translations/xinxcomponents_fr.ts
RESOURCES = xinxpluginselector.qrc

27
components/directoryedit.cpp

@ -47,7 +47,7 @@ QVariant CompleterDirModel::data( const QModelIndex &index, int role ) const { @@ -47,7 +47,7 @@ QVariant CompleterDirModel::data( const QModelIndex &index, int role ) const {
/* DirectoryEdit */
DirectoryEdit::DirectoryEdit( QWidget * parent ) : QLineEdit( parent ) {
DirectoryEdit::DirectoryEdit( QWidget * parent ) : QLineEdit( parent ), m_fileMustExist( true ) {
connect( this, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString)) );
QCompleter * completer = new QCompleter( this );
this->setCompleter( completer );
@ -58,11 +58,30 @@ DirectoryEdit::DirectoryEdit( const QString & contents, QWidget * parent ) : QLi @@ -58,11 +58,30 @@ DirectoryEdit::DirectoryEdit( const QString & contents, QWidget * parent ) : QLi
connect( this, SIGNAL(textChanged(QString)), this, SLOT(slotTextChanged(QString)) );
}
void DirectoryEdit::setFileMustExist( bool value ) {
if( value != m_fileMustExist ) {
m_fileMustExist = value;
slotTextChanged( this->text() );
}
}
bool DirectoryEdit::fileMustExist() const {
return m_fileMustExist;
}
void DirectoryEdit::setFilter( const QString & filter ) {
m_filter = filter;
}
const QString & DirectoryEdit::filter() const {
return m_filter;
}
void DirectoryEdit::slotTextChanged( QString text ) {
QFile file ( text );
QPalette palette( this->palette() );
if( file.exists() ) {
if( (!m_fileMustExist) || file.exists() ) {
palette.setColor( QPalette::Text, QColor() );
} else {
palette.setColor( QPalette::Text, Qt::red );
@ -77,8 +96,10 @@ void DirectoryEdit::changePath( QWidget * parent, const QString & defaultValue, @@ -77,8 +96,10 @@ void DirectoryEdit::changePath( QWidget * parent, const QString & defaultValue,
if( directory )
value = QFileDialog::getExistingDirectory( parent, tr("Change the path"), value );
else if( m_fileMustExist )
value = QFileDialog::getOpenFileName( parent, tr("Change the file"), value, m_filter, &m_filter );
else
value = QFileDialog::getOpenFileName( parent, tr("Change the file"), value );
value = QFileDialog::getSaveFileName( parent, tr("Change the file"), value, m_filter, &m_filter );
if( ! value.isEmpty() ) {
this->setText( QDir::toNativeSeparators( value ) );

30
components/directoryedit.h

@ -60,6 +60,7 @@ class DirectoryEdit : public QLineEdit { @@ -60,6 +60,7 @@ class DirectoryEdit : public QLineEdit {
Q_CLASSINFO("Author", "Ulrich Van Den Hekke")
Q_CLASSINFO("URL", "http://xinx.shadoware.org")
Q_CLASSINFO("Licence", "GPL v2 or later")
Q_PROPERTY( bool fileMustExist READ fileMustExist WRITE setFileMustExist )
public:
/*!
* Construct a DirectoryEdit object.
@ -72,6 +73,31 @@ public: @@ -72,6 +73,31 @@ public:
* \param parent The parent widget of the object.
*/
DirectoryEdit( const QString & contents, QWidget * parent = 0 );
/*!
* Set to false, if the file can't not exist and you don't want to warn user
* \param value true if you want the user
* \sa warnIfExist
*/
void setFileMustExist( bool value );
/*!
* Return true if you want to warn the user when the file doesn't exist.
* \sa setWarnIfExist
*/
bool fileMustExist() const;
/*!
* Set the filter to use to change load a file
* \param filter The new filter to use
* \sa filter
*/
void setFilter( const QString & filter );
/*!
* Get the filter used to change the file
* \sa setFilter
*/
const QString & filter() const;
public slots:
/*!
* Open a dialog to change the path in the line editor.
@ -86,6 +112,10 @@ protected slots: @@ -86,6 +112,10 @@ protected slots:
* directory \e text not exist.
*/
void slotTextChanged( QString text );
private:
bool m_fileMustExist;
QString m_filter;
};
class PrivateDirectoryEditWidget;

174
components/ui/xinxlistwidget.ui

@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>XinxListWidget</class>
<widget class="QWidget" name="XinxListWidget" >
<property name="geometry" >
<widget class="QWidget" name="XinxListWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@ -9,97 +10,104 @@ @@ -9,97 +10,104 @@
<height>240</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string/>
</property>
<layout class="QHBoxLayout" >
<property name="margin" >
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QListWidget" name="m_list" />
<widget class="QLineEdit" name="m_addEdit"/>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="margin" >
<number>0</number>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QToolButton" name="m_btnAdd" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>Add</string>
</property>
<property name="icon" >
<iconset resource="../xinxpluginselector.qrc" >
<normaloff>:/images/add.png</normaloff>:/images/add.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="m_btnDel" >
<property name="text" >
<string>Delete</string>
</property>
<property name="icon" >
<iconset resource="../xinxpluginselector.qrc" >
<normaloff>:/images/remove.png</normaloff>:/images/remove.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="m_btnDef" >
<property name="text" >
<string>Default</string>
</property>
<property name="icon" >
<iconset resource="../xinxpluginselector.qrc" >
<normaloff>:/images/checkbox.png</normaloff>:/images/checkbox.png</iconset>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="m_btnUp" >
<property name="text" >
<string>Up</string>
</property>
<property name="icon" >
<iconset resource="../xinxpluginselector.qrc" >
<normaloff>:/images/up.png</normaloff>:/images/up.png</iconset>
</property>
</widget>
<widget class="QListWidget" name="m_list"/>
</item>
<item>
<widget class="QToolButton" name="m_btnDown" >
<property name="text" >
<string>Down</string>
<layout class="QVBoxLayout">
<property name="spacing">
<number>6</number>
</property>
<property name="icon" >
<iconset resource="../xinxpluginselector.qrc" >
<normaloff>:/images/down.png</normaloff>:/images/down.png</iconset>
<property name="margin">
<number>0</number>
</property>
</widget>
<item>
<widget class="QPushButton" name="m_btnAdd">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>&amp;Add</string>
</property>
<property name="icon">
<iconset resource="../xinxpluginselector.qrc">
<normaloff>:/images/add.png</normaloff>:/images/add.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_btnDel">
<property name="text">
<string>&amp;Remove</string>
</property>
<property name="icon">
<iconset resource="../xinxpluginselector.qrc">
<normaloff>:/images/remove.png</normaloff>:/images/remove.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_btnDef">
<property name="text">
<string>&amp;Default</string>
</property>
<property name="icon">
<iconset resource="../xinxpluginselector.qrc">
<normaloff>:/images/checkbox.png</normaloff>:/images/checkbox.png</iconset>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="m_btnUp">
<property name="text">
<string>Move &amp;Up</string>
</property>
<property name="icon">
<iconset resource="../xinxpluginselector.qrc">
<normaloff>:/images/up.png</normaloff>:/images/up.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_btnDown">
<property name="text">
<string>Move &amp;Down</string>
</property>
<property name="icon">
<iconset resource="../xinxpluginselector.qrc">
<normaloff>:/images/down.png</normaloff>:/images/down.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
@ -112,7 +120,7 @@ @@ -112,7 +120,7 @@
<tabstop>m_btnDef</tabstop>
</tabstops>
<resources>
<include location="../xinxpluginselector.qrc" />
<include location="../xinxpluginselector.qrc"/>
</resources>
<connections/>
</ui>

9
components/xinxlistwidgetimpl.cpp

@ -123,7 +123,10 @@ QString XinxListWidgetImpl::defaultProposedValue() const { @@ -123,7 +123,10 @@ QString XinxListWidgetImpl::defaultProposedValue() const {
}
void XinxListWidgetImpl::setDefaultProposedValue( const QString & value ) {
m_defaultProposedValue = value;
if( value != m_defaultProposedValue ) {
m_addEdit->setText( value );
m_defaultProposedValue = value;
}
}
void XinxListWidgetImpl::on_m_btnDef_clicked() {
@ -136,11 +139,9 @@ void XinxListWidgetImpl::on_m_btnDef_clicked() { @@ -136,11 +139,9 @@ void XinxListWidgetImpl::on_m_btnDef_clicked() {
}
void XinxListWidgetImpl::on_m_btnAdd_clicked() {
QListWidgetItem * item = new QListWidgetItem( m_defaultProposedValue.isEmpty() ? "..." : m_defaultProposedValue, m_list );
QListWidgetItem * item = new QListWidgetItem( m_addEdit->text(), m_list );
item->setFlags( item->flags() | Qt::ItemIsEditable );
m_list->addItem( item );
m_list->setCurrentItem( item );
m_list->editItem( item );
m_btnDel->setEnabled( m_list->count() > 0 );
m_btnDef->setEnabled( m_list->count() > 0 );

1
ext/qcodeedit/example/main.cpp

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
#include "window.h"
#include <stdio.h>
#include <QApplication>

29
framework/contentview/contentviewparser.cpp

@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
#include <contentview/contentviewcache.h>
#include <contentview/contentviewnode.h>
#include <project/xinxproject.h>
#include <project/externalfileresolver.h>
// Qt header
#include <QStack>
@ -105,29 +106,13 @@ void ContentViewParser::removeAttachedNode( ContentViewNode * n ) { @@ -105,29 +106,13 @@ void ContentViewParser::removeAttachedNode( ContentViewNode * n ) {
}
QString ContentViewParser::locationOf( const QString & relativeFilename ) {
QStringList searchList;
const QString name = filename();
if( ! name.isEmpty() )
searchList << QFileInfo( name ).absolutePath();
if( XINXProjectManager::self()->project() )
searchList += XINXProjectManager::self()->project()->processedSearchPathList();
QString absPath = QString();
bool finded = false;
foreach( const QString & path, searchList ) {
absPath = QDir( path ).absoluteFilePath( relativeFilename );
if( QFile::exists( absPath ) ) {
finded = true;
break;
}
}
if( finded )
return absPath;
QString fn = filename();
if( XINXProjectManager::self()->project() && fn.isEmpty() )
fn = XINXProjectManager::self()->project()->projectPath();
else
fn = QFileInfo( filename() ).absolutePath();
return relativeFilename;
return ExternalFileResolver::self()->resolveFileName( relativeFilename, fn );
}
void ContentViewParser::createContentViewNode( ContentViewNode * parent, const QString & filename ) {

122
framework/core/appsettings.cpp

@ -82,13 +82,13 @@ void AppSettings::setDefault() { @@ -82,13 +82,13 @@ void AppSettings::setDefault() {
void AppSettings::save() {
d->createSettings();
setSettingsGlobals( d->m_settings, "", d->m_globals );
setSettingsGlobals( d->m_settings, "0.9", d->m_globals );
d->deleteSettings();
}
void AppSettings::load() {
d->createSettings();
d->m_globals = getSettingsGlobals( d->m_settings, "", getDefaultGlobals() );
d->m_globals = getSettingsGlobals( d->m_settings, "0.9", getDefaultGlobals() );
d->deleteSettings();
}
@ -165,39 +165,6 @@ void AppSettings::setSettingsQformat( AppSettingsSettings * settings, const QStr @@ -165,39 +165,6 @@ void AppSettings::setSettingsQformat( AppSettingsSettings * settings, const QStr
settings->endGroup();
}
AppSettings::AppSettings::struct_configurationEditor AppSettings::getDefaultConfigurationEditor() {
struct_configurationEditor value;
value.activateConfigurationEditor = false;
value.autoLoadConfigurationFile = true;
value.autoSaveConfigurationFile = false;
return value;
}
AppSettings::AppSettings::struct_configurationEditor AppSettings::getSettingsConfigurationEditor( AppSettingsSettings * settings, const QString & path, const AppSettings::AppSettings::struct_configurationEditor & defaultValue ) {
struct_configurationEditor value;
settings->beginGroup( path );
value.activateConfigurationEditor = settings->value( "Activate Configuration Editor", defaultValue.activateConfigurationEditor ).toBool();
value.autoLoadConfigurationFile = settings->value( "Auto load configuration file", defaultValue.autoLoadConfigurationFile ).toBool();
value.autoSaveConfigurationFile = settings->value( "Auto save configuration file", defaultValue.autoSaveConfigurationFile ).toBool();
settings->endGroup();
return value;
}
void AppSettings::setSettingsConfigurationEditor( AppSettingsSettings * settings, const QString & path, const AppSettings::AppSettings::struct_configurationEditor & value ) {
struct_configurationEditor defaultValue = getDefaultConfigurationEditor();
settings->beginGroup( path );
settings->setValue( "Activate Configuration Editor", value.activateConfigurationEditor, defaultValue.activateConfigurationEditor );
settings->setValue( "Auto load configuration file", value.autoLoadConfigurationFile, defaultValue.autoLoadConfigurationFile );
settings->setValue( "Auto save configuration file", value.autoSaveConfigurationFile, defaultValue.autoSaveConfigurationFile );
settings->endGroup();
}
AppSettings::AppSettings::struct_editor AppSettings::getDefaultEditor() {
struct_editor value;
@ -293,7 +260,6 @@ AppSettings::AppSettings::struct_project AppSettings::getDefaultProject() { @@ -293,7 +260,6 @@ AppSettings::AppSettings::struct_project AppSettings::getDefaultProject() {
value.openTheLastProjectAtStart = false;
value.saveWithSessionByDefault = false;
value.defaultPath = QDir( qApp->applicationDirPath() ).absoluteFilePath( "project" );
value.defaultProjectPathName = "projet";
value.closeVersionManagementLog = true;
value.automaticProjectDirectoryRefreshTimeout = 500;
@ -309,7 +275,6 @@ AppSettings::AppSettings::struct_project AppSettings::getSettingsProject( AppSet @@ -309,7 +275,6 @@ AppSettings::AppSettings::struct_project AppSettings::getSettingsProject( AppSet
value.saveWithSessionByDefault = settings->value( "Save With Session By Default", defaultValue.saveWithSessionByDefault ).toBool();
value.defaultPath = settings->value( "Default Path", defaultValue.defaultPath ).toString();
value.recentProjectFiles = settings->value( "Recent Project Files", defaultValue.recentProjectFiles ).toStringList();
value.defaultProjectPathName = settings->value( "Default Project Path Name", defaultValue.defaultProjectPathName ).toString();
value.closeVersionManagementLog = settings->value( "Close Version Management Log", defaultValue.closeVersionManagementLog ).toBool();
value.automaticProjectDirectoryRefreshTimeout = settings->value( "Automatic Project Directory Refresh Timeout", defaultValue.automaticProjectDirectoryRefreshTimeout ).toInt();
@ -326,48 +291,12 @@ void AppSettings::setSettingsProject( AppSettingsSettings * settings, const QStr @@ -326,48 +291,12 @@ void AppSettings::setSettingsProject( AppSettingsSettings * settings, const QStr
settings->setValue( "Save With Session By Default", value.saveWithSessionByDefault, defaultValue.saveWithSessionByDefault );
settings->setValue( "Default Path", value.defaultPath, defaultValue.defaultPath );
settings->setValue( "Recent Project Files", value.recentProjectFiles, defaultValue.recentProjectFiles );
settings->setValue( "Default Project Path Name", value.defaultProjectPathName, defaultValue.defaultProjectPathName );
settings->setValue( "Close Version Management Log", value.closeVersionManagementLog, defaultValue.closeVersionManagementLog );
settings->setValue( "Automatic Project Directory Refresh Timeout", value.automaticProjectDirectoryRefreshTimeout, defaultValue.automaticProjectDirectoryRefreshTimeout );
settings->endGroup();
}
AppSettings::AppSettings::struct_extentions AppSettings::getDefaultExtentions() {
struct_extentions value;
value.canBeSaveAsSpecifique = true;
value.canBeFindInConfiguration = false;
value.canBeCommitToRcs = true;
return value;
}
AppSettings::AppSettings::struct_extentions AppSettings::getSettingsExtentions( AppSettingsSettings * settings, const QString & path, const AppSettings::AppSettings::struct_extentions & defaultValue ) {
struct_extentions value;
settings->beginGroup( path );
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;
}
void AppSettings::setSettingsExtentions( AppSettingsSettings * settings, const QString & path, const AppSettings::AppSettings::struct_extentions & value ) {
struct_extentions defaultValue = getDefaultExtentions();
settings->beginGroup( path );
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();
}
AppSettings::AppSettings::struct_globals AppSettings::getDefaultGlobals() {
struct_globals value;
@ -378,9 +307,7 @@ AppSettings::AppSettings::struct_globals AppSettings::getDefaultGlobals() { @@ -378,9 +307,7 @@ AppSettings::AppSettings::struct_globals AppSettings::getDefaultGlobals() {
value.project = getDefaultProject();
value.rcs = getDefaultRcs();
value.editor = getDefaultEditor();
value.configurationEditor = getDefaultConfigurationEditor();
value.snipets = getDefaultSnipets();
value.files = getDefaultHash_struct_extentions();
value.formats = getDefaultHash_struct_qformat();
return value;
@ -401,10 +328,8 @@ AppSettings::AppSettings::struct_globals AppSettings::getSettingsGlobals( AppSet @@ -401,10 +328,8 @@ AppSettings::AppSettings::struct_globals AppSettings::getSettingsGlobals( AppSet
value.project = getSettingsProject( settings, "Project", defaultValue.project );
value.rcs = getSettingsRcs( settings, "RCS", defaultValue.rcs );
value.editor = getSettingsEditor( settings, "Editor", defaultValue.editor );
value.configurationEditor = getSettingsConfigurationEditor( settings, "Configuration Editor", defaultValue.configurationEditor );
value.snipets = getSettingsSnipets( settings, "Snipets", defaultValue.snipets );
value.tools = getSettingsHash_QString( settings, "Tools", defaultValue.tools );
value.files = getSettingsHash_struct_extentions( settings, "Files", defaultValue.files );
value.formats = getSettingsHash_struct_qformat( settings, "Formats", defaultValue.formats );
settings->endGroup();
@ -426,10 +351,8 @@ void AppSettings::setSettingsGlobals( AppSettingsSettings * settings, const QStr @@ -426,10 +351,8 @@ void AppSettings::setSettingsGlobals( AppSettingsSettings * settings, const QStr
setSettingsProject( settings, "Project", value.project );
setSettingsRcs( settings, "RCS", value.rcs );
setSettingsEditor( settings, "Editor", value.editor );
setSettingsConfigurationEditor( settings, "Configuration Editor", value.configurationEditor );
setSettingsSnipets( settings, "Snipets", value.snipets );
setSettingsHash_QString( settings, "Tools", value.tools );
setSettingsHash_struct_extentions( settings, "Files", value.files );
setSettingsHash_struct_qformat( settings, "Formats", value.formats );
settings->endGroup();
@ -493,47 +416,6 @@ void AppSettings::setSettingsHash_QString( AppSettingsSettings * settings, const @@ -493,47 +416,6 @@ void AppSettings::setSettingsHash_QString( AppSettingsSettings * settings, const
settings->endGroup();
}
QHash<QString,AppSettings::struct_extentions> AppSettings::getDefaultHash_struct_extentions() {
QHash<QString,struct_extentions> value;
return value;
}
QHash<QString,AppSettings::struct_extentions> AppSettings::getSettingsHash_struct_extentions( AppSettingsSettings * settings, const QString & path, const QHash<QString,AppSettings::struct_extentions> & defaultValue ) {
QHash<QString,struct_extentions> value;
settings->beginGroup( path );
QStringList keys = settings->childKeys() + settings->childGroups();
foreach( const QString & key, keys ) {
struct_extentions def;
if( defaultValue.contains( key ) )
def = defaultValue[ key ];
else
def = getDefaultExtentions();
value[ key ] = getSettingsExtentions( settings, key, def );
}
foreach( const QString & defaultValueKey, defaultValue.keys() ) {
if( ! value.contains( defaultValueKey ) ) {
value[ defaultValueKey ] = defaultValue[ defaultValueKey ];
}
}
settings->endGroup();
return value;
}
void AppSettings::setSettingsHash_struct_extentions( AppSettingsSettings * settings, const QString & path, const QHash<QString,AppSettings::struct_extentions> & value ) {
QHash<QString,struct_extentions> defaultValue = getDefaultHash_struct_extentions();
settings->beginGroup( path );
foreach( const QString & key, value.keys() ) {
setSettingsExtentions( settings, key, value[ key ] );
}
settings->endGroup();
}
QHash<QString,AppSettings::struct_qformat> AppSettings::getDefaultHash_struct_qformat() {
QHash<QString,struct_qformat> value;

31
framework/core/appsettings.h

@ -8,15 +8,14 @@ @@ -8,15 +8,14 @@
#include <QSettings>
#include <QString>
#include <QStringList>
#include <QColor>
#include <QFont>
#include <QColor>
#include <QPoint>
#include <QSize>
#include <QByteArray>
#include <QHash>
#include <QHash>
#include <QHash>
#include <QHash>
class PrivateAppSettings;
@ -44,12 +43,6 @@ public: @@ -44,12 +43,6 @@ public:
QColor background;
};
struct struct_configurationEditor {
bool activateConfigurationEditor;
bool autoLoadConfigurationFile;
bool autoSaveConfigurationFile;
};
struct struct_editor {
QString defaultTextCodec;
bool autoindentOnSaving;
@ -76,18 +69,10 @@ public: @@ -76,18 +69,10 @@ public:
bool saveWithSessionByDefault;
QString defaultPath;
QStringList recentProjectFiles;
QString defaultProjectPathName;
bool closeVersionManagementLog;
int automaticProjectDirectoryRefreshTimeout;
};
struct struct_extentions {
QString specifiqueSubDirectory;
bool canBeSaveAsSpecifique;
bool canBeFindInConfiguration;
bool canBeCommitToRcs;
};
struct struct_globals {
QString language;
QPoint position;
@ -100,10 +85,8 @@ public: @@ -100,10 +85,8 @@ public:
struct_project project;
struct_rcs rcs;
struct_editor editor;
struct_configurationEditor configurationEditor;
struct_snipets snipets;
QHash<QString,QString> tools;
QHash<QString,struct_extentions> files;
QHash<QString,struct_qformat> formats;
};
@ -128,10 +111,6 @@ protected: @@ -128,10 +111,6 @@ protected:
virtual AppSettings::struct_qformat getSettingsQformat( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_qformat & defaultValue );
virtual void setSettingsQformat( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_qformat & value );
virtual struct_configurationEditor getDefaultConfigurationEditor();
virtual AppSettings::struct_configurationEditor getSettingsConfigurationEditor( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_configurationEditor & defaultValue );
virtual void setSettingsConfigurationEditor( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_configurationEditor & value );
virtual struct_editor getDefaultEditor();
virtual AppSettings::struct_editor getSettingsEditor( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_editor & defaultValue );
virtual void setSettingsEditor( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_editor & value );
@ -144,10 +123,6 @@ protected: @@ -144,10 +123,6 @@ protected:
virtual AppSettings::struct_project getSettingsProject( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_project & defaultValue );
virtual void setSettingsProject( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_project & value );
virtual struct_extentions getDefaultExtentions();
virtual AppSettings::struct_extentions getSettingsExtentions( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_extentions & defaultValue );
virtual void setSettingsExtentions( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_extentions & value );
virtual struct_globals getDefaultGlobals();
virtual AppSettings::struct_globals getSettingsGlobals( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_globals & defaultValue );
virtual void setSettingsGlobals( AppSettingsSettings * settings, const QString & path, const AppSettings::struct_globals & value );
@ -158,10 +133,6 @@ protected: @@ -158,10 +133,6 @@ protected:
virtual QHash<QString,QString> getSettingsHash_QString( AppSettingsSettings * settings, const QString & path, const QHash<QString,QString> & defaultValue );
virtual void setSettingsHash_QString( AppSettingsSettings * settings, const QString & path, const QHash<QString,QString> & value );
virtual QHash<QString,struct_extentions> getDefaultHash_struct_extentions();
virtual QHash<QString,AppSettings::struct_extentions> getSettingsHash_struct_extentions( AppSettingsSettings * settings, const QString & path, const QHash<QString,AppSettings::struct_extentions> & defaultValue );
virtual void setSettingsHash_struct_extentions( AppSettingsSettings * settings, const QString & path, const QHash<QString,AppSettings::struct_extentions> & value );
virtual QHash<QString,struct_qformat> getDefaultHash_struct_qformat();
virtual QHash<QString,AppSettings::struct_qformat> getSettingsHash_struct_qformat( AppSettingsSettings * settings, const QString & path, const QHash<QString,AppSettings::struct_qformat> & defaultValue );
virtual void setSettingsHash_struct_qformat( AppSettingsSettings * settings, const QString & path, const QHash<QString,AppSettings::struct_qformat> & value );

17
framework/core/config.xml

@ -1,20 +1,13 @@ @@ -1,20 +1,13 @@
<config classname="App Settings" organization="Shadoware.Org" application="XINX">
<config classname="App Settings" organization="Shadoware.Org" application="XINX" path="0.9">
<include>#include &lt;QLocale&gt;</include>
<include>#include &lt;QDir&gt;</include>
<include>#include &lt;QApplication&gt;</include>
<type name="Extentions">
<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="Project">
<value name="Last opened project" type="string"/>
<value name="Open the last project at start" type="bool" default="no"/>
<value name="Save With Session By Default" type="bool" default="no"/>
<value name="Default Path" type="string" defaultInstruction="QDir( qApp->applicationDirPath() ).absoluteFilePath( &quot;project&quot; )"/>
<value name="Recent Project Files" type="stringlist"/>
<value name="Default Project Path Name" type="string" default="projet"/>
<value name="Close Version Management Log" type="bool" default="true"/>
<value name="Automatic Project Directory Refresh Timeout" type="int" default="500"/>
</type>
@ -36,11 +29,6 @@ @@ -36,11 +29,6 @@
<value name="Close Button on each Tab" type="bool" default="false"/>
<value name="Automatic Model Refresh Timeout" type="int" default="1000"/>
</type>
<type name="Configuration Editor">
<value name="Activate Configuration Editor" type="bool" default="no"/>
<value name="Auto load configuration file" type="bool" default="true"/>
<value name="Auto save configuration file" type="bool" default="false"/>
</type>
<type name="QFormat">
<value name="italic" type="bool" default="false"/>
<value name="bold" type="bool" default="false"/>
@ -68,11 +56,8 @@ @@ -68,11 +56,8 @@
<value name="Project" type="Project"/>
<value name="RCS" type="RCS"/>
<value name="Editor" type="Editor"/>
<value name="Configuration Editor" type="Configuration Editor"/>
<value name="Snipets" type="Snipets"/>
<value name="Tools" type="hash:string" default="QString()"/>
<value name="Files" type="hash:Extentions"/>
<value name="Formats" type="hash:QFormat"/>
</config>

14
framework/core/xinxconfig.cpp

@ -135,15 +135,6 @@ void XINXConfig::addDefaultTool( const QString & tool, const QString & defaultVa @@ -135,15 +135,6 @@ void XINXConfig::addDefaultTool( const QString & tool, const QString & defaultVa
}
}
void XINXConfig::addDefaultExtention( const QString & type, const struct AppSettings::struct_extentions & properties ) {
if( ! config().files.contains( type ) ) {
config().files[ type ] = properties;
// Store imediately the hashtable
AppSettingsSettings settings("Shadoware.Org", "XINX");
setSettingsHash_struct_extentions( &settings, "Files", config().files );
}
}
XINXConfig * XINXConfig::self() {
if( s_self == 0 ) {
s_self = new XINXConfig();
@ -152,11 +143,6 @@ XINXConfig * XINXConfig::self() { @@ -152,11 +143,6 @@ XINXConfig * XINXConfig::self() {
return s_self;
}
AppSettings::struct_extentions XINXConfig::matchedFileType( const QString & filename ) {
IFileTypePlugin * plugin = XinxPluginsLoader::self()->matchedFileType( filename );
return config().files.value( plugin->description() );
}
AppSettings::struct_globals XINXConfig::getDefaultGlobals() {
struct_globals value = AppSettings::getDefaultGlobals();

10
framework/core/xinxconfig.h

@ -90,16 +90,6 @@ public: @@ -90,16 +90,6 @@ public:
*/
void addDefaultTool( const QString & tool, const QString & defaultValue );
/*!
* Add a new extention in the configuration with a default value
* \param type The type to add (XML File)
* \param properties Default properties to add
*/
void addDefaultExtention( const QString & type, const struct AppSettings::struct_extentions & properties );
/*! Search the file type for the corresponding filename */
struct_extentions matchedFileType( const QString & filename );
/*! Assign a configuration to another */
XINXConfig & operator=( const XINXConfig& p );
signals:

50
framework/editors/abstracteditor.cpp

@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
#include "project/xinxproject.h"
#include "borderlayout.h"
#include "core/xinxconfig.h"
#include "plugins/xinxpluginsloader.h"
// Qt header
#include <QAction>
@ -99,12 +100,23 @@ QString AbstractEditor::getLongTitle() const { @@ -99,12 +100,23 @@ QString AbstractEditor::getLongTitle() const {
void AbstractEditor::loadFromFile( const QString & fileName ) {
if( ! fileName.isEmpty() ) setWatcher( fileName );
QFile file( m_lastFileName );
if( ! file.open( QIODevice::ReadOnly ) ) {
qCritical( qPrintable(tr("Can't open file for reading %1 : %2").arg( m_lastFileName ).arg( file.errorString() )) );
QIODevice * file = new QFile( m_lastFileName );
foreach( XinxPluginElement * e, XinxPluginsLoader::self()->plugins() ) {
if( e->isActivated() && qobject_cast<IXinxInputOutputPlugin*>( e->plugin() ) ) {
file = qobject_cast<IXinxInputOutputPlugin*>( e->plugin() )->loadFile( m_lastFileName );
if( file ) break;
}
}
if( ! file )
file = new QFile( m_lastFileName );
if( ! file->open( QIODevice::ReadOnly ) ) {
qCritical( qPrintable(tr("Can't open file for reading %1 : %2").arg( m_lastFileName ).arg( file->errorString() )) );
return;
}
loadFromDevice( file );
loadFromDevice( *file );
delete file;
setModified( false );
}
@ -114,9 +126,21 @@ void AbstractEditor::saveToFile( const QString & fileName ) { @@ -114,9 +126,21 @@ void AbstractEditor::saveToFile( const QString & fileName ) {
if( ( fileName.isEmpty() || ( fileName == m_lastFileName ) )
&& XINXConfig::self()->config().editor.createBackupFile ) {
if( QFile::exists( fileName + ".bak" ) ) QFile::remove( fileName + ".bak" );
QFile::copy( fileName, fileName + ".bak" );
}
if( QFile::exists( fileName + ".bak" ) )
QFile::remove( fileName + ".bak" );
QFile::copy( fileName, fileName + ".bak" );
}
/* Create the device */
QIODevice * file = 0;
foreach( XinxPluginElement * e, XinxPluginsLoader::self()->plugins() ) {
if( e->isActivated() && qobject_cast<IXinxInputOutputPlugin*>( e->plugin() ) ) {
file = qobject_cast<IXinxInputOutputPlugin*>( e->plugin() )->saveFile( fileName, m_lastFileName );
if( file ) break;
}
}
if( ! file )
file = new QFile( fileName );
/* Change the file name */
if( ! fileName.isEmpty() ) setWatcher( fileName );
@ -126,15 +150,17 @@ void AbstractEditor::saveToFile( const QString & fileName ) { @@ -126,15 +150,17 @@ void AbstractEditor::saveToFile( const QString & fileName ) {
qApp->processEvents();
/* Open the file for writting an save */
QFile file( m_lastFileName );
if( ! file.open( QIODevice::WriteOnly ) ) {
qCritical( qPrintable(tr("Can't open file for writing %1 : %2").arg( m_lastFileName ).arg( file.errorString() )) );
if( ! file->open( QIODevice::WriteOnly ) ) {
delete file;
qCritical( qPrintable(tr("Can't open file for writing %1 : %2").arg( m_lastFileName ).arg( file->errorString() )) );
m_isSaving = false;
activateWatcher();
return;
}
saveToDevice( file );
file.close();
saveToDevice( *file );
file->close();
delete file;
m_isSaving = false;
activateWatcher();

2
framework/editors/bookmarkeditorinterface.h

@ -70,7 +70,7 @@ signals: @@ -70,7 +70,7 @@ signals:
* \param minValue The first bound
* \param maxValue The second bound
*/
virtual void bookmarkModified( int minValue, int maxValue );
void bookmarkModified( int minValue, int maxValue );
};
#endif // BOOKMARKEDITORINTERFACE_H

23
framework/editors/xinxformatscheme.cpp

@ -30,6 +30,10 @@ XinxFormatScheme::XinxFormatScheme( XINXConfig * parent ) : QFormatScheme( paren @@ -30,6 +30,10 @@ XinxFormatScheme::XinxFormatScheme( XINXConfig * parent ) : QFormatScheme( paren
createStandardFormat();
}
XinxFormatScheme::XinxFormatScheme() : m_config( 0 ) {
createStandardFormat();
}
XinxFormatScheme::~XinxFormatScheme() {
}
@ -38,7 +42,11 @@ void XinxFormatScheme::createStandardFormat() { @@ -38,7 +42,11 @@ void XinxFormatScheme::createStandardFormat() {
QFormat searchFormat, braceMatchFormat, braceMismatchFormat;
// Init search format
searchFormat.background = m_config->config().editor.highlightWord;
if( m_config )
searchFormat.background = m_config->config().editor.highlightWord;
else
searchFormat.background = Qt::yellow;
setFormat( "search", searchFormat );
// Init match format
@ -59,6 +67,8 @@ void XinxFormatScheme::updateFormatsFromConfig() { @@ -59,6 +67,8 @@ void XinxFormatScheme::updateFormatsFromConfig() {
// Reload from config file ;)
createStandardFormat();
if( ! m_config ) return;
foreach( const QString & format, m_config->config().formats.keys() ) {
if( m_nameSpace.isEmpty() || format.startsWith( m_nameSpace + "_" ) ) {
if( m_config->config().formats.contains( format ) ) {
@ -82,6 +92,8 @@ void XinxFormatScheme::updateFormatsFromConfig() { @@ -82,6 +92,8 @@ void XinxFormatScheme::updateFormatsFromConfig() {
}
void XinxFormatScheme::putFormatsToConfig() {
if( ! m_config ) return;
foreach( const QString & f, formats() ) {
if( ( f == "normal" ) || ( f == "match" ) || ( f == "search" ) || ( f == "braceMatch" ) || ( f == "braceMismatch" ) ) continue;
XINXConfig::struct_qformat conf;
@ -105,3 +117,12 @@ void XinxFormatScheme::setNameSpace( const QString & value ) { @@ -105,3 +117,12 @@ void XinxFormatScheme::setNameSpace( const QString & value ) {
const QString & XinxFormatScheme::nameSpace() const {
return m_nameSpace;
}
XinxFormatScheme& XinxFormatScheme::operator=(const XinxFormatScheme& p) {
this->m_nameSpace = m_nameSpace;
foreach( const QString & f, p.formats() ) {
this->setFormat( f, p.format( f ) );
}
return *this;
}

10
framework/editors/xinxformatscheme.h

@ -33,16 +33,24 @@ class XinxFormatScheme : public QFormatScheme { @@ -33,16 +33,24 @@ class XinxFormatScheme : public QFormatScheme {
Q_OBJECT
public:
/*!
* Create a XinxFormatFactory.
* Create a XinxFormatScheme.
*/
XinxFormatScheme( XINXConfig * parent );
/*!
* Create a XinxFormatScheme from nothing
*/
XinxFormatScheme();
//! Destroy the format factory
virtual ~XinxFormatScheme();
//! Update the list of format (can't delete existing format)
void updateFormatsFromConfig();
void putFormatsToConfig();
//! Copy value from a format scheme to another
XinxFormatScheme& operator=(const XinxFormatScheme& p);
protected:
//! Create standards formats
void createStandardFormat();

12
framework/framework.pro

@ -32,7 +32,6 @@ HEADERS = rcs/rcs.h \ @@ -32,7 +32,6 @@ HEADERS = rcs/rcs.h \
core/xinxconfig.h \
core/xinxcore.h \
core/xinxthread.h \
core/configurationfile.h \
project/xinxproject.h \
project/dirrcsmodel.h \
project/flattreeview.h \
@ -71,7 +70,10 @@ HEADERS = rcs/rcs.h \ @@ -71,7 +70,10 @@ HEADERS = rcs/rcs.h \
scripts/scriptmanager.h \
scripts/documentsearch.h \
editors/editorfactory.h \
editors/bookmarktexteditorinterface.h
editors/bookmarktexteditorinterface.h \
project/externalfileresolver.h \
rcs/rcsmanager.h \
project/newprojecttemplate.h
SOURCES = rcs/rcs.cpp \
plugins/xinxpluginsloader.cpp \
plugins/xinxpluginelement.cpp \
@ -81,7 +83,6 @@ SOURCES = rcs/rcs.cpp \ @@ -81,7 +83,6 @@ SOURCES = rcs/rcs.cpp \
core/xinxcore.cpp \
core/xinxthread.cpp \
core/exceptions.cpp \
core/configurationfile.cpp \
project/xinxproject.cpp \
project/dirrcsmodel.cpp \
project/flattreeview.cpp \
@ -118,7 +119,10 @@ SOURCES = rcs/rcs.cpp \ @@ -118,7 +119,10 @@ SOURCES = rcs/rcs.cpp \
scripts/scriptmanager.cpp \
scripts/documentsearch.cpp \
editors/editorfactory.cpp \
editors/bookmarktexteditorinterface.cpp
editors/bookmarktexteditorinterface.cpp \
project/externalfileresolver.cpp \
rcs/rcsmanager.cpp \
project/newprojecttemplate.cpp
FORMS = snipets/callsnipetdlg.ui \
snipets/snipetpropertydlg.ui \
snipets/categorypropertydlg.ui

110
framework/plugins/plugininterfaces.h

@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
#include <QStringList>
#include <QTextCharFormat>
#include <QIcon>
#include <QWizardPage>
// Xinx header
#include <core/appsettings.h>
@ -83,14 +84,35 @@ public: @@ -83,14 +84,35 @@ public:
/*! List of tools with the default value where find the tool */
virtual QList< QPair<QString,QString> > pluginTools() { return QList< QPair<QString,QString> >(); }
//! Call when a new project is created or opened
virtual bool initializeProject( XinxProject * project ) { Q_UNUSED( project ); return true; }
//! Call before the project is closed
virtual bool destroyProject( XinxProject * project ) { Q_UNUSED( project ); return true; }
//! Return a list of action (order in menu) used for dynamic action
virtual XinxAction::MenuList actions() { return XinxAction::MenuList(); }
};
/*!
* This interface is used to change the input/output of XINX
*/
class IXinxInputOutputPlugin : public virtual IXinxPlugin {
public:
//! Destroy a Input/Output plugin
virtual ~IXinxInputOutputPlugin() {};
//! Call when a new project is created or opened
virtual bool loadProject( XinxProject * project ) = 0;
//! Call before the project is closed
virtual bool closeProject( XinxProject * project ) = 0;
//! Call when a file is loaded
virtual QIODevice * loadFile( const QString & filename ) = 0;
/*!
* For the given \e filename, get a a dialog box to save the file. If the
* the accept boolean is true, XINX don't call other plugin. If the file
* return false, the save is cancelled, else, the save is called.
*/
virtual QString getFilename( const QString & filename, const QString & filter, bool saveAs, bool & accept, QWidget * widget = 0 ) = 0;
//! Call when a file is saved
virtual QIODevice * saveFile( const QString & filename, const QString & oldfilename ) = 0;
};
/*!
* This interface is used to propose one page of configuration. For each page, the program
* can modify settings and save or restore value.
@ -110,6 +132,23 @@ public: @@ -110,6 +132,23 @@ public:
virtual bool loadSettingsDialog() = 0;
//! Save settings to dialog box
virtual bool saveSettingsDialog() = 0;
//! This method is called in the inverse case of \e saveSettingsDialog(). If the dialog must made process on cancel.
virtual bool cancelSettingsDialog() = 0;
//! Validate dialog
virtual bool isSettingsValid() = 0;
//! Is visible
virtual bool isVisible() = 0;
};
/*!
* This class contains necessary method to use in a project property page.
*/
class IXinxPluginProjectConfigurationPage : public IXinxPluginConfigurationPage {
public:
virtual ~IXinxPluginProjectConfigurationPage() {}
//! Set the project to use in the dialog to load and save settings.
virtual void setProject( XinxProject * project ) = 0;
};
/*!
@ -121,7 +160,7 @@ public: @@ -121,7 +160,7 @@ public:
*
* Xinx integrate the widget in the configuration dialog.
*/
class IXinxPluginConfiguration {
class IXinxPluginConfiguration : virtual public IXinxPlugin {
public:
//! Destroy the interface
virtual ~IXinxPluginConfiguration() {}
@ -130,26 +169,34 @@ public: @@ -130,26 +169,34 @@ public:
virtual QList<IXinxPluginConfigurationPage*> createSettingsDialog( QWidget * parent ) = 0;
};
/*!
* New</