Restore commit 4476

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4478 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
scorpio810 2016-05-13 15:00:22 +00:00
parent f077361856
commit 662e3b20d2
31 changed files with 1999 additions and 849 deletions

View File

@ -1,271 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 3.5.1, 2016-01-18T18:52:49. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{6eea4121-5ff9-4cef-b169-5ef0ff03834b}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.5.1 GCC 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.5.1 GCC 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.55.gcc_64_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/davi/Documents/qelectro/build-qelectrotech-Desktop_Qt_5_5_1_GCC_64bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/davi/Documents/qelectro/build-qelectrotech-Desktop_Qt_5_5_1_GCC_64bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibraryAuto">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qelectrotech</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/davi/Documents/qelectro/qet-0.5_original/qelectrotech.pro</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">qelectrotech.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">18</value>
</data>
<data>
<variable>Version</variable>
<value type="int">18</value>
</data>
</qtcreator>

View File

@ -243,6 +243,7 @@ TitleBlockProperties BorderTitleBlock::exportTitleBlock() {
ip.folio = folio(); ip.folio = folio();
ip.template_name = titleBlockTemplateName(); ip.template_name = titleBlockTemplateName();
ip.display_at = m_edge; ip.display_at = m_edge;
ip.auto_page_num = autoPageNum();
ip.context = additional_fields_; ip.context = additional_fields_;
ip.collection = QET::QetCollection::Embedded; ip.collection = QET::QetCollection::Embedded;
@ -259,6 +260,7 @@ void BorderTitleBlock::importTitleBlock(const TitleBlockProperties &ip) {
setTitle(ip.title); setTitle(ip.title);
setFileName(ip.filename); setFileName(ip.filename);
setFolio(ip.folio); setFolio(ip.folio);
setAutoPageNum(ip.auto_page_num);
if (m_edge != ip.display_at) if (m_edge != ip.display_at)
{ {
m_edge = ip.display_at; m_edge = ip.display_at;
@ -685,6 +687,7 @@ void BorderTitleBlock::updateDiagramContextForTitleBlock(const DiagramContext &i
context.addValue("folio", btb_final_folio_); context.addValue("folio", btb_final_folio_);
context.addValue("folio-id", folio_index_); context.addValue("folio-id", folio_index_);
context.addValue("folio-total", folio_total_); context.addValue("folio-total", folio_total_);
context.addValue("auto_page_num", btb_auto_page_num_);
titleblock_template_renderer_ -> setContext(context); titleblock_template_renderer_ -> setContext(context);
} }
@ -711,7 +714,7 @@ QString BorderTitleBlock::incrementLetters(const QString &string) {
@param total nombre total de schemas dans le projet @param total nombre total de schemas dans le projet
@param project_properties Project-wide properties, to be merged with diagram-wide ones. @param project_properties Project-wide properties, to be merged with diagram-wide ones.
*/ */
void BorderTitleBlock::setFolioData(int index, int total, const DiagramContext &project_properties) { void BorderTitleBlock::setFolioData(int index, int total, QString autonum, const DiagramContext &project_properties) {
if (index < 1 || total < 1 || index > total) return; if (index < 1 || total < 1 || index > total) return;
// memorise les informations // memorise les informations
@ -720,8 +723,14 @@ void BorderTitleBlock::setFolioData(int index, int total, const DiagramContext &
// regenere le contenu du champ folio // regenere le contenu du champ folio
btb_final_folio_ = btb_folio_; btb_final_folio_ = btb_folio_;
if (btb_final_folio_.contains("%autonum")){
btb_final_folio_.replace("%autonum", autonum);
btb_folio_ = btb_final_folio_;
}
btb_final_folio_.replace("%id", QString::number(folio_index_)); btb_final_folio_.replace("%id", QString::number(folio_index_));
btb_final_folio_.replace("%total", QString::number(folio_total_)); btb_final_folio_.replace("%total", QString::number(folio_total_));
updateDiagramContextForTitleBlock(project_properties); updateDiagramContextForTitleBlock(project_properties);
} }

View File

@ -23,6 +23,7 @@
#include <QObject> #include <QObject>
#include <QRectF> #include <QRectF>
#include <QDate> #include <QDate>
#include "numerotationcontext.h"
class QPainter; class QPainter;
class DiagramPosition; class DiagramPosition;
class TitleBlockTemplate; class TitleBlockTemplate;
@ -107,6 +108,8 @@ class BorderTitleBlock : public QObject
/// @return true si la bordure est affichee, false sinon /// @return true si la bordure est affichee, false sinon
bool borderIsDisplayed() const { return(display_border_); } bool borderIsDisplayed() const { return(display_border_); }
QString autoPageNum() const { return(btb_auto_page_num_); }
// methods to set dimensions // methods to set dimensions
void setColumnsCount(int); void setColumnsCount(int);
void setRowsCount(int); void setRowsCount(int);
@ -132,9 +135,11 @@ class BorderTitleBlock : public QObject
} }
/// @param author the new value of the "Folio" field /// @param author the new value of the "Folio" field
void setFolio(const QString &folio) { btb_folio_ = folio; } void setFolio(const QString &folio) { btb_folio_ = folio; }
void setFolioData(int, int, const DiagramContext & = DiagramContext()); void setFolioData(int, int, QString = NULL, const DiagramContext & = DiagramContext());
/// @param author the new value of the "File" field /// @param author the new value of the "File" field
void setFileName(const QString &filename) { btb_filename_ = filename; } void setFileName(const QString &filename) { btb_filename_ = filename; }
/// @param author the new value of the "Auto Page Num" field
void setAutoPageNum(const QString &auto_page_num) { btb_auto_page_num_ = auto_page_num;}
void titleBlockToXml(QDomElement &); void titleBlockToXml(QDomElement &);
void titleBlockFromXml(const QDomElement &); void titleBlockFromXml(const QDomElement &);
@ -203,6 +208,7 @@ class BorderTitleBlock : public QObject
QString btb_title_; QString btb_title_;
QString btb_folio_; QString btb_folio_;
QString btb_final_folio_; QString btb_final_folio_;
QString btb_auto_page_num_;
int folio_index_; int folio_index_;
int folio_total_; int folio_total_;
QString btb_filename_; QString btb_filename_;

View File

@ -37,6 +37,10 @@ class ConfigDialog : public QDialog {
private: private:
ConfigDialog(const ConfigDialog &); ConfigDialog(const ConfigDialog &);
public:
QList<ConfigPage *> pages;
// methods // methods
public slots: public slots:
void applyConf(); void applyConf();
@ -52,6 +56,8 @@ class ConfigDialog : public QDialog {
QListWidget *pages_list; QListWidget *pages_list;
QStackedWidget *pages_widget; QStackedWidget *pages_widget;
QDialogButtonBox *buttons; QDialogButtonBox *buttons;
QList<ConfigPage *> pages;
}; };
#endif #endif

View File

@ -35,8 +35,9 @@
* else edit the properties by default of QElectroTech * else edit the properties by default of QElectroTech
* @param parent, parent widget * @param parent, parent widget
*/ */
NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent) : NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent, ProjectPropertiesDialog *ppd) :
ConfigPage (parent), ConfigPage (parent),
ppd_ (ppd),
m_project (project) m_project (project)
{ {
//By default we set the global default properties //By default we set the global default properties
@ -47,7 +48,7 @@ NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent) :
QList <TitleBlockTemplatesCollection *> c; QList <TitleBlockTemplatesCollection *> c;
c << QETApp::commonTitleBlockTemplatesCollection() << QETApp::customTitleBlockTemplatesCollection(); c << QETApp::commonTitleBlockTemplatesCollection() << QETApp::customTitleBlockTemplatesCollection();
if (m_project) c << m_project->embeddedTitleBlockTemplatesCollection(); if (m_project) c << m_project->embeddedTitleBlockTemplatesCollection();
ipw = new TitleBlockPropertiesWidget(c, TitleBlockProperties::defaultProperties(), true); ipw = new TitleBlockPropertiesWidget(c, TitleBlockProperties::defaultProperties(), true, project, parent);
// default conductor properties // default conductor properties
cpw = new ConductorPropertiesWidget(ConductorProperties::defaultProperties()); cpw = new ConductorPropertiesWidget(ConductorProperties::defaultProperties());
// default propertie of report label // default propertie of report label
@ -64,6 +65,8 @@ NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent) :
xrefpw -> setProperties (m_project -> defaultXRefProperties()); xrefpw -> setProperties (m_project -> defaultXRefProperties());
} }
connect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab()));
// main tab widget // main tab widget
QTabWidget *tab_widget = new QTabWidget(this); QTabWidget *tab_widget = new QTabWidget(this);
QWidget *diagram_widget = new QWidget(); QWidget *diagram_widget = new QWidget();
@ -87,6 +90,7 @@ NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent) :
* @brief NewDiagramPage::~NewDiagramPage * @brief NewDiagramPage::~NewDiagramPage
*/ */
NewDiagramPage::~NewDiagramPage() { NewDiagramPage::~NewDiagramPage() {
disconnect(ipw,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(changeToAutoFolioTab()));
} }
/** /**
@ -173,10 +177,48 @@ QIcon NewDiagramPage::icon() const {
* @return title of this page * @return title of this page
*/ */
QString NewDiagramPage::title() const { QString NewDiagramPage::title() const {
if (m_project) return(tr("Nouveau folio", "configuration page title")); if (m_project) return(tr("Nouveau folio", "configuration page title"));
return(tr("Nouveau projet", "configuration page title")); return(tr("Nouveau projet", "configuration page title"));
} }
/**
* @brief NewDiagramPage::changeToAutoFolioTab
* Set the current tab to Autonum
*/
void NewDiagramPage::changeToAutoFolioTab(){
if (m_project){
ppd_->setCurrentPage(ProjectPropertiesDialog::Autonum);
ppd_->changeToFolio();
ppd_->exec();
}
}
/**
* @brief NewDiagramPage::setFolioAutonum
* Set temporary TBP to use in auto folio num
*/
void NewDiagramPage::setFolioAutonum(QString autoNum){
TitleBlockProperties tbptemp = ipw->propertiesAutoNum(autoNum);
ipw->setProperties(tbptemp);
applyConf();
}
/**
* @brief NewDiagramPage::saveCurrentTbp
* Save current TBP to retrieve after auto folio num
*/
void NewDiagramPage::saveCurrentTbp(){
savedTbp = ipw->properties();
}
/**
* @brief NewDiagramPage::loadSavedTbp
* Retrieve saved auto folio num
*/
void NewDiagramPage::loadSavedTbp(){
ipw->setProperties(savedTbp);
applyConf();
}
/** /**
Constructeur Constructeur

View File

@ -19,6 +19,8 @@
#define CONFIG_PAGES_H #define CONFIG_PAGES_H
#include <QtWidgets> #include <QtWidgets>
#include "configpage.h" #include "configpage.h"
#include "projectpropertiesdialog.h" //davi
#include "titleblockpropertieswidget.h" //davi
class BorderPropertiesWidget; class BorderPropertiesWidget;
class ConductorPropertiesWidget; class ConductorPropertiesWidget;
class TitleBlockPropertiesWidget; class TitleBlockPropertiesWidget;
@ -26,6 +28,7 @@ class ExportPropertiesWidget;
class ReportPropertieWidget; class ReportPropertieWidget;
class XRefPropertiesWidget; class XRefPropertiesWidget;
class QETProject; class QETProject;
class TitleBlockProperties;
/** /**
This configuration page enables users to define the properties of new This configuration page enables users to define the properties of new
@ -35,10 +38,16 @@ class NewDiagramPage : public ConfigPage {
Q_OBJECT Q_OBJECT
// constructors, destructor // constructors, destructor
public: public:
NewDiagramPage(QETProject *project = 0, QWidget * = 0); NewDiagramPage(QETProject *project = 0, QWidget * = 0, ProjectPropertiesDialog *teste = NULL);
virtual ~NewDiagramPage(); virtual ~NewDiagramPage();
private: private:
NewDiagramPage(const NewDiagramPage &); NewDiagramPage(const NewDiagramPage &);
public slots:
void changeToAutoFolioTab();
void setFolioAutonum(QString);
void saveCurrentTbp();
void loadSavedTbp();
// methods // methods
public: public:
@ -48,12 +57,14 @@ class NewDiagramPage : public ConfigPage {
// attributes // attributes
private: private:
ProjectPropertiesDialog *ppd_;
QETProject *m_project; ///< Project to edit propertie QETProject *m_project; ///< Project to edit propertie
BorderPropertiesWidget *bpw; ///< Widget to edit default diagram dimensions BorderPropertiesWidget *bpw; ///< Widget to edit default diagram dimensions
TitleBlockPropertiesWidget *ipw; ///< Widget to edit default title block properties TitleBlockPropertiesWidget *ipw; ///< Widget to edit default title block properties
ConductorPropertiesWidget *cpw; ///< Widget to edit default conductor properties ConductorPropertiesWidget *cpw; ///< Widget to edit default conductor properties
ReportPropertieWidget *rpw; ///< Widget to edit default report label ReportPropertieWidget *rpw; ///< Widget to edit default report label
XRefPropertiesWidget *xrefpw; ///< Widget to edit default xref properties XRefPropertiesWidget *xrefpw; ///< Widget to edit default xref properties
TitleBlockProperties savedTbp; ///< Used to save current TBP and retrieve later
}; };

View File

@ -235,6 +235,7 @@ void Diagram::keyPressEvent(QKeyEvent *e)
bool transmit_event = true; bool transmit_event = true;
if (!isReadOnly()) { if (!isReadOnly()) {
QPointF movement; QPointF movement;
if (!this->selectedContent().elements.isEmpty()) {
switch(e -> key()) { switch(e -> key()) {
case Qt::Key_Left: movement = QPointF(-xGrid, 0.0); break; case Qt::Key_Left: movement = QPointF(-xGrid, 0.0); break;
case Qt::Key_Right: movement = QPointF(+xGrid, 0.0); break; case Qt::Key_Right: movement = QPointF(+xGrid, 0.0); break;
@ -250,6 +251,7 @@ void Diagram::keyPressEvent(QKeyEvent *e)
} }
if (transmit_event) { if (transmit_event) {
QGraphicsScene::keyPressEvent(e); QGraphicsScene::keyPressEvent(e);
}
} }
} }

View File

@ -30,6 +30,7 @@
#include "templatelocation.h" #include "templatelocation.h"
#include "qetapp.h" #include "qetapp.h"
#include "qetproject.h" #include "qetproject.h"
#include "projectview.h"
#include "integrationmoveelementshandler.h" #include "integrationmoveelementshandler.h"
#include "integrationmovetemplateshandler.h" #include "integrationmovetemplateshandler.h"
#include "qetdiagrameditor.h" #include "qetdiagrameditor.h"
@ -589,7 +590,22 @@ void DiagramView::focusInEvent(QFocusEvent *e) {
*/ */
void DiagramView::keyPressEvent(QKeyEvent *e) { void DiagramView::keyPressEvent(QKeyEvent *e) {
if (m_event_interface && m_event_interface->keyPressEvent(e)) return; if (m_event_interface && m_event_interface->keyPressEvent(e)) return;
ProjectView *current_project = this->diagramEditor()->acessCurrentProject();
switch(e -> key())
{
case Qt::Key_PageUp:
current_project->changeTabUp();
return;
case Qt::Key_PageDown:
current_project->changeTabDown();
return;
case Qt::Key_Home:
current_project->changeFirstTab();
return;
case Qt::Key_End:
current_project->changeLastTab();
return;
}
switchToVisualisationModeIfNeeded(e); switchToVisualisationModeIfNeeded(e);
QGraphicsView::keyPressEvent(e); QGraphicsView::keyPressEvent(e);
} }

View File

@ -67,14 +67,14 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
prj_activate = new QAction(QET::Icons::ProjectFile, tr("Basculer vers ce projet"), this); prj_activate = new QAction(QET::Icons::ProjectFile, tr("Basculer vers ce projet"), this);
prj_close = new QAction(QET::Icons::DocumentClose, tr("Fermer ce projet"), this); prj_close = new QAction(QET::Icons::DocumentClose, tr("Fermer ce projet"), this);
prj_edit_prop = new QAction(QET::Icons::DialogInformation, tr("Propriétés du projet"), this); prj_edit_prop = new QAction(QET::Icons::DialogInformation, tr("Propriétés du projet"), this);
prj_prop_diagram = new QAction(QET::Icons::DialogInformation, tr("Propriétés du folio"), this); prj_prop_diagram = new QAction(QET::Icons::DialogInformation, tr("Propriétés du folio"), this);
prj_add_diagram = new QAction(QET::Icons::DiagramAdd, tr("Ajouter un folio"), this); prj_add_diagram = new QAction(QET::Icons::DiagramAdd, tr("Ajouter un folio"), this);
prj_del_diagram = new QAction(QET::Icons::DiagramDelete, tr("Supprimer ce folio"), this); prj_del_diagram = new QAction(QET::Icons::DiagramDelete, tr("Supprimer ce folio"), this);
prj_move_diagram_up = new QAction(QET::Icons::GoUp, tr("Remonter ce folio"), this); prj_move_diagram_up = new QAction(QET::Icons::GoUp, tr("Remonter ce folio"), this);
prj_move_diagram_down = new QAction(QET::Icons::GoDown, tr("Abaisser ce folio"), this); prj_move_diagram_down = new QAction(QET::Icons::GoDown, tr("Abaisser ce folio"), this);
prj_move_diagram_upx10 = new QAction(QET::Icons::GoUp, tr("Remonter ce folio x10"), this); prj_move_diagram_upx10 = new QAction(QET::Icons::GoUp, tr("Remonter ce folio x10"), this);
prj_move_diagram_top = new QAction(QET::Icons::GoUp, tr("Remonter ce folio au debut"), this); prj_move_diagram_top = new QAction(QET::Icons::GoUp, tr("Remonter ce folio au debut"), this);
prj_move_diagram_downx10 = new QAction(QET::Icons::GoDown, tr("Abaisser ce folio x10"), this); prj_move_diagram_downx10 = new QAction(QET::Icons::GoDown, tr("Abaisser ce folio x10"), this);
tbt_add = new QAction(QET::Icons::TitleBlock, tr("Nouveau modèle"), this); tbt_add = new QAction(QET::Icons::TitleBlock, tr("Nouveau modèle"), this);
tbt_edit = new QAction(QET::Icons::TitleBlock, tr("Éditer ce modèle"), this); tbt_edit = new QAction(QET::Icons::TitleBlock, tr("Éditer ce modèle"), this);
tbt_remove = new QAction(QET::Icons::TitleBlock, tr("Supprimer ce modèle"), this); tbt_remove = new QAction(QET::Icons::TitleBlock, tr("Supprimer ce modèle"), this);
@ -777,6 +777,19 @@ void ElementsPanelWidget::deleteElement() {
} }
} }
/**
Treat key press event inside elements panel widget
*/
void ElementsPanelWidget::keyPressEvent (QKeyEvent *e) {
switch(e -> key()) {
case Qt::Key_Delete: //delete diagram through elements panel widget
if (Diagram *selected_diagram = elements_panel -> selectedDiagram()) {
emit(requestForDiagramDeletion(selected_diagram));
}
}
return;
}
/** /**
Lance l'editeur d'element pour l'element filename Lance l'editeur d'element pour l'element filename
@param location Emplacement de l'element a editer @param location Emplacement de l'element a editer

View File

@ -111,6 +111,9 @@ class ElementsPanelWidget : public QWidget {
void loadingFinished(); void loadingFinished();
void filterEdited(const QString &); void filterEdited(const QString &);
protected:
virtual void keyPressEvent (QKeyEvent *e);
private: private:
void launchElementEditor(const ElementsLocation &); void launchElementEditor(const ElementsLocation &);
void launchCategoryEditor(const ElementsLocation &); void launchCategoryEditor(const ElementsLocation &);

View File

@ -27,7 +27,7 @@
#include "ui/xrefpropertieswidget.h" #include "ui/xrefpropertieswidget.h"
#include "selectautonumw.h" #include "selectautonumw.h"
#include "numerotationcontext.h" #include "numerotationcontext.h"
#include "folioautonumbering.h"
/** /**
Constructor Constructor
@param project Project this page is editing. @param project Project this page is editing.
@ -141,7 +141,6 @@ void ProjectMainConfigPage::applyProjectConf() {
project_ -> setProjectProperties(new_properties); project_ -> setProjectProperties(new_properties);
modified_project = true; modified_project = true;
} }
if (modified_project) { if (modified_project) {
project_ -> setModified(true); project_ -> setModified(true);
} }
@ -186,6 +185,8 @@ void ProjectMainConfigPage::initLayout() {
main_layout0 -> addWidget(project_variables_label_); main_layout0 -> addWidget(project_variables_label_);
main_layout0 -> addWidget(project_variables_); main_layout0 -> addWidget(project_variables_);
setLayout(main_layout0); setLayout(main_layout0);
this -> setMinimumWidth(630);
} }
/** /**
@ -250,17 +251,44 @@ void ProjectAutoNumConfigPage::applyProjectConf() {}
* Init some widget of this page * Init some widget of this page
*/ */
void ProjectAutoNumConfigPage::initWidgets() { void ProjectAutoNumConfigPage::initWidgets() {
m_label = new QLabel(tr("Numérotations disponibles :", "availables numerotations"), this);
m_context_cb = new QComboBox(this); tab_widget = new QTabWidget(this);
tab_widget->setMinimumWidth(440);
//Conductor Tab
conductor_tab_widget = new QWidget(this);
m_label = new QLabel(tr("Numérotations disponibles :", "availables numerotations"), conductor_tab_widget);
m_context_cb = new QComboBox(conductor_tab_widget);
m_context_cb->setEditable(true); m_context_cb->setEditable(true);
m_context_cb->lineEdit()->setClearButtonEnabled(true); m_context_cb->lineEdit()->setClearButtonEnabled(true);
m_context_cb->addItem(tr("Nom de la nouvelle numérotation")); m_context_cb->addItem(tr("Nom de la nouvelle numérotation"));
m_remove_pb = new QPushButton(QET::Icons::EditDelete, QString(), this); m_remove_pb = new QPushButton(QET::Icons::EditDelete, QString(), conductor_tab_widget);
m_remove_pb -> setToolTip(tr("Supprimer la numérotation")); m_remove_pb -> setToolTip(tr("Supprimer la numérotation"));
m_saw = new SelectAutonumW(this); m_saw = new SelectAutonumW(conductor_tab_widget);
//Folio Tab
folio_tab_widget = new QWidget(this);
m_label_2 = new QLabel(tr("Numérotations disponibles :", "availables numerotations"), folio_tab_widget);
m_context_cb_2 = new QComboBox(folio_tab_widget);
m_context_cb_2->setEditable(true);
m_context_cb_2->lineEdit()->setClearButtonEnabled(true);
m_context_cb_2->addItem(tr("Nom de la nouvelle numérotation"));
m_remove_pb_2 = new QPushButton(QET::Icons::EditDelete, QString(), folio_tab_widget);
m_remove_pb_2 -> setToolTip(tr("Supprimer la numérotation"));
m_saw_2 = new SelectAutonumW(folio_tab_widget);
/* //AutoNumbering Tab - Needs Further Testing
autoNumbering_tab_widget = new QWidget(this);
m_faw = new FolioAutonumberingW(project(),autoNumbering_tab_widget);
*/
} }
/** /**
@ -268,15 +296,40 @@ void ProjectAutoNumConfigPage::initWidgets() {
* Init the layout of this page * Init the layout of this page
*/ */
void ProjectAutoNumConfigPage::initLayout() { void ProjectAutoNumConfigPage::initLayout() {
QHBoxLayout *context_layout = new QHBoxLayout(); //Conductor tab
tab_widget->addTab(conductor_tab_widget, tr("Conductor"));
QHBoxLayout *context_layout = new QHBoxLayout();
context_layout -> addWidget (m_label); context_layout -> addWidget (m_label);
context_layout -> addWidget (m_context_cb); context_layout -> addWidget (m_context_cb);
context_layout -> addWidget (m_remove_pb); context_layout -> addWidget (m_remove_pb);
QVBoxLayout *main_layout = new QVBoxLayout(this); QVBoxLayout *main_layout = new QVBoxLayout();
this -> setLayout (main_layout); QVBoxLayout *aux_layout = new QVBoxLayout();
main_layout -> addLayout (context_layout); aux_layout->addLayout(context_layout);
main_layout -> addWidget (m_saw); aux_layout->addWidget(m_saw);
main_layout->addLayout(aux_layout);
conductor_tab_widget -> setLayout (main_layout);
// Folio Tab
tab_widget->addTab(folio_tab_widget, tr("Folio"));
QHBoxLayout *context_layout_2 = new QHBoxLayout();
context_layout_2 -> addWidget (m_label_2);
context_layout_2 -> addWidget (m_context_cb_2);
context_layout_2 -> addWidget (m_remove_pb_2);
QVBoxLayout *main_layout_2 = new QVBoxLayout();
QVBoxLayout *aux_layout_2 = new QVBoxLayout();
aux_layout_2->addLayout(context_layout_2);
aux_layout_2->addWidget(m_saw_2);
main_layout_2->addLayout(aux_layout_2);
folio_tab_widget -> setLayout (main_layout_2);
//Auto Numbering Tab - Needs Further Testing
// tab_widget->addTab(autoNumbering_tab_widget,tr ("Folio Auto Numbering"));
} }
/** /**
@ -284,9 +337,20 @@ void ProjectAutoNumConfigPage::initLayout() {
* Read value stored on project, and update display * Read value stored on project, and update display
*/ */
void ProjectAutoNumConfigPage::readValuesFromProject() { void ProjectAutoNumConfigPage::readValuesFromProject() {
//Conductor Tab
QList <QString> keys = project_->conductorAutoNum().keys(); QList <QString> keys = project_->conductorAutoNum().keys();
if (keys.isEmpty()) return; if (!keys.isEmpty()){
foreach (QString str, keys) { m_context_cb -> addItem(str); } foreach (QString str, keys) { m_context_cb -> addItem(str); }
}
//Folio Tab
QList <QString> keys_2 = project_->folioAutoNum().keys();
if (!keys_2.isEmpty()){
foreach (QString str, keys_2) { m_context_cb_2 -> addItem(str);}
}
//Folio AutoNumbering Tab - Needs Further Testing
// m_faw->setContext(keys_2);
} }
/** /**
@ -301,14 +365,28 @@ void ProjectAutoNumConfigPage::adjustReadOnly() {
* setup some connections * setup some connections
*/ */
void ProjectAutoNumConfigPage::buildConnections() { void ProjectAutoNumConfigPage::buildConnections() {
connect(tab_widget,SIGNAL(currentChanged(int)),this,SLOT(tabChanged(int)));
//Conductor Tab
connect (m_context_cb, SIGNAL (currentIndexChanged(QString)), this, SLOT (updateContext(QString))); connect (m_context_cb, SIGNAL (currentIndexChanged(QString)), this, SLOT (updateContext(QString)));
connect (m_saw, SIGNAL (applyPressed()), this, SLOT (saveContext())); connect (m_saw, SIGNAL (applyPressed()), this, SLOT (saveContext()));
connect (m_remove_pb, SIGNAL(clicked()), this, SLOT(removeContext())); connect (m_remove_pb, SIGNAL (clicked()), this, SLOT(removeContext()));
//Folio Tab
connect (m_context_cb_2, SIGNAL (currentIndexChanged(QString)), this, SLOT (updateContext_2(QString)));
connect (m_saw_2, SIGNAL (applyPressed()), this, SLOT (saveContext_2()));
connect (m_remove_pb_2, SIGNAL (clicked()), this, SLOT (removeContext_2()));
/* //Auto Folio Numbering - Needs Further Testing
connect (m_faw, SIGNAL (applyPressed()), this, SLOT (applyAutoNum()));
connect (m_faw, SIGNAL (m_autonumber_tabs_rb_clicked()), this, SLOT (tabChanged(int)));
*/
} }
/** /**
* @brief ProjectAutoNumConfigPage::updateContext * @brief ProjectAutoNumConfigPage::updateContext
* Display the current selected context * Display the current selected context for conductor
* @param str, key of context stored in project * @param str, key of context stored in project
*/ */
void ProjectAutoNumConfigPage::updateContext(QString str) { void ProjectAutoNumConfigPage::updateContext(QString str) {
@ -316,9 +394,19 @@ void ProjectAutoNumConfigPage::updateContext(QString str) {
else m_saw ->setContext(project_->conductorAutoNum(str)); else m_saw ->setContext(project_->conductorAutoNum(str));
} }
/**
* @brief ProjectAutoNumConfigPage::updateContext_2
* Display the current selected context for folio
* @param str, key of context stored in project
*/
void ProjectAutoNumConfigPage::updateContext_2(QString str) {
if (str == tr("Nom de la nouvelle numérotation")) m_saw_2 -> setContext(NumerotationContext());
else m_saw_2 ->setContext(project_->folioAutoNum(str));
}
/** /**
* @brief ProjectAutoNumConfigPage::saveContext * @brief ProjectAutoNumConfigPage::saveContext
* Save the current displayed context in project * Save the current displayed conductor context in project
*/ */
void ProjectAutoNumConfigPage::saveContext() { void ProjectAutoNumConfigPage::saveContext() {
// If the text is the default text "Name of new numerotation" save the edited context // If the text is the default text "Name of new numerotation" save the edited context
@ -338,9 +426,57 @@ void ProjectAutoNumConfigPage::saveContext() {
} }
} }
/**
* @brief ProjectAutoNumConfigPage::saveContext_2
* Save the current displayed folio context in project
*/
void ProjectAutoNumConfigPage::saveContext_2() {
// If the text is the default text "Name of new numerotation" save the edited context
// With the the name "No name"
if (m_context_cb_2 -> currentText() == tr("Nom de la nouvelle numérotation")) {
project_->addFolioAutoNum (tr("Sans nom"), m_saw_2 -> toNumContext());
m_context_cb_2 -> addItem(tr("Sans nom"));
}
// If the text isn't yet to the autonum of the project, add this new item to the combo box.
else if ( !project_ -> folioAutoNum().keys().contains( m_context_cb_2->currentText())) {
project()->addFolioAutoNum(m_context_cb_2->currentText(), m_saw_2->toNumContext());
m_context_cb_2 -> addItem(m_context_cb_2->currentText());
}
// Else, the text already exist in the autonum of the project, just update the context
else {
project_->addFolioAutoNum (m_context_cb_2 -> currentText(), m_saw_2 -> toNumContext());
}
}
/**
* @brief ProjectAutoNumConfigPage::applyAutoNum
* Apply auto folio numbering, New Folios or Selected Folios
*/
/*
void ProjectAutoNumConfigPage::applyAutoNum() {
if (m_faw->newFolios){
int foliosRemaining = m_faw->newFoliosNumber();
emit (saveCurrentTbp());
emit (setAutoNum(m_faw->autoNumSelected()));
while (foliosRemaining > 0){
project()->autoFolioNumberingNewFolios();
foliosRemaining = foliosRemaining-1;
}
emit (loadSavedTbp());
}
else{
QString autoNum = m_faw->autoNumSelected();
int fromFolio = m_faw->fromFolio();
int toFolio = m_faw->toFolio();
project_->autoFolioNumberingSelectedFolios(fromFolio,toFolio,autoNum);
}
}
*/
/** /**
* @brief ProjectAutoNumConfigPage::removeContext * @brief ProjectAutoNumConfigPage::removeContext
* Remove from project the current numerotation context * Remove from project the current conductor numerotation context
*/ */
void ProjectAutoNumConfigPage::removeContext() { void ProjectAutoNumConfigPage::removeContext() {
//if default text, return //if default text, return
@ -348,3 +484,37 @@ void ProjectAutoNumConfigPage::removeContext() {
project_ -> removeConductorAutonum (m_context_cb -> currentText() ); project_ -> removeConductorAutonum (m_context_cb -> currentText() );
m_context_cb -> removeItem (m_context_cb -> currentIndex() ); m_context_cb -> removeItem (m_context_cb -> currentIndex() );
} }
/**
* @brief ProjectAutoNumConfigPage::removeContext_2
* Remove from project the current folio numerotation context
*/
void ProjectAutoNumConfigPage::removeContext_2() {
//if default text, return
if ( m_context_cb_2 -> currentText() == tr("Nom de la nouvelle numérotation") ) return;
project_ -> removeFolioAutoNum (m_context_cb_2 -> currentText() );
m_context_cb_2 -> removeItem (m_context_cb_2 -> currentIndex() );
}
/**
* @brief ProjectAutoNumConfigPage::changeToTab
* @param tab index
* Change to Selected Tab
*/
void ProjectAutoNumConfigPage::changeToTab(int i){
tab_widget->setCurrentIndex(i);
}
/**
* @brief ProjectAutoNumConfigPage::tabChanged
* @param tab index
* Used to resize window to correct size
*/
void ProjectAutoNumConfigPage::tabChanged(int i){
if (i>0){
if (tab_widget->currentIndex()==2){
tab_widget->resize(470,tab_widget->height());
}
else {
tab_widget->adjustSize();
}
}
}

View File

@ -20,6 +20,8 @@
#ifndef PROJECTCONFIGPAGES_H #ifndef PROJECTCONFIGPAGES_H
#define PROJECTCONFIGPAGES_H #define PROJECTCONFIGPAGES_H
#include "configpage.h" #include "configpage.h"
#include <QtWidgets>
class QLabel; class QLabel;
class QLineEdit; class QLineEdit;
class QETProject; class QETProject;
@ -32,6 +34,7 @@ class XRefPropertiesWidget;
class SelectAutonumW; class SelectAutonumW;
class QComboBox; class QComboBox;
class QPushButton; class QPushButton;
class FolioAutonumberingW;
/** /**
This class, derived from ConfigPage, aims at providing the basic skeleton This class, derived from ConfigPage, aims at providing the basic skeleton
@ -128,27 +131,49 @@ class ProjectAutoNumConfigPage : public ProjectConfigPage {
virtual QString title() const; virtual QString title() const;
virtual QIcon icon() const; virtual QIcon icon() const;
virtual void applyProjectConf(); virtual void applyProjectConf();
virtual void changeToTab(int);
protected: protected:
virtual void initWidgets(); virtual void initWidgets();
virtual void initLayout(); virtual void initLayout();
virtual void readValuesFromProject(); virtual void readValuesFromProject();
virtual void adjustReadOnly(); virtual void adjustReadOnly();
private: private:
void buildConnections(); void buildConnections();
private slots: private slots:
void updateContext(QString); void updateContext(QString);
void saveContext(); void saveContext();
void removeContext(); void removeContext();
void updateContext_2(QString);
void saveContext_2();
void removeContext_2();
// void applyAutoNum(); - Needs Further Testing
void tabChanged(int);
signals:
void setAutoNum(QString);
void setAutoNum(int,int);
void saveCurrentTbp();
void loadSavedTbp();
//Attributes //Attributes
private: private:
QLabel *m_label; QTabWidget *tab_widget;
QComboBox *m_context_cb; QWidget *element_widget;
QPushButton *m_remove_pb; QWidget *conductor_tab_widget;
SelectAutonumW *m_saw; QWidget *folio_tab_widget;
QWidget *autoNumbering_tab_widget;
QScrollArea *scrollArea;
QLabel *m_label;
QLabel *m_label_2;
QComboBox *m_context_cb;
QComboBox *m_context_cb_2;
QPushButton *m_remove_pb;
QPushButton *m_remove_pb_2;
SelectAutonumW *m_saw;
SelectAutonumW *m_saw_2;
FolioAutonumberingW *m_faw;
}; };

View File

@ -32,7 +32,6 @@
#include "qettemplateeditor.h" #include "qettemplateeditor.h"
#include "diagramfoliolist.h" #include "diagramfoliolist.h"
#include "projectpropertiesdialog.h" #include "projectpropertiesdialog.h"
#include <QTabWidget> #include <QTabWidget>
/** /**
@ -79,8 +78,9 @@ void ProjectView::setProject(QETProject *project) {
if (!project_) { if (!project_) {
project_ = project; project_ = project;
connect(project_, SIGNAL(projectTitleChanged(QETProject *, const QString &)), this, SLOT(updateWindowTitle())); connect(project_, SIGNAL(projectTitleChanged(QETProject *, const QString &)), this, SLOT(updateWindowTitle()));
connect(project_, SIGNAL(projectModified (QETProject *, bool)), this, SLOT(updateWindowTitle())); connect(project_, SIGNAL(projectModified (QETProject *, bool)), this, SLOT(updateWindowTitle()));
connect(project_, SIGNAL(readOnlyChanged (QETProject *, bool)), this, SLOT(adjustReadOnlyState())); connect(project_, SIGNAL(readOnlyChanged (QETProject *, bool)), this, SLOT(adjustReadOnlyState()));
connect(project_, SIGNAL(addAutoNumDiagram()), this, SLOT(addNewDiagram()));
adjustReadOnlyState(); adjustReadOnlyState();
loadDiagrams(); loadDiagrams();
} }
@ -138,6 +138,83 @@ void ProjectView::closeEvent(QCloseEvent *qce) {
} }
} }
/**
@brief change current diagramview to next folio
*/
void ProjectView::changeTabDown(){
DiagramView *nextDiagramView = this->nextDiagram();
if (nextDiagramView!=NULL){
rebuildDiagramsMap();
m_tab -> setCurrentWidget(nextDiagramView);
}
}
/**
@return next folio of current diagramview
*/
DiagramView *ProjectView::nextDiagram() {
int current_tab_index = m_tab -> currentIndex();
int next_tab_index = current_tab_index + 1; //get next tab index
if (next_tab_index<diagram_ids_.count()) //if next tab index >= greatest tab the last tab is activated so no need to change tab.
return(diagram_ids_[next_tab_index]);
else
return NULL;
}
/**
@brief change current diagramview to previous tab
*/
void ProjectView::changeTabUp(){
DiagramView *previousDiagramView = this->previousDiagram();
if (previousDiagramView!=NULL){
rebuildDiagramsMap();
m_tab -> setCurrentWidget(previousDiagramView);
}
}
/**
@return previous folio of current diagramview
*/
DiagramView *ProjectView::previousDiagram() {
int current_tab_index = m_tab -> currentIndex();
int previous_tab_index = current_tab_index - 1; //get previous tab index
if (previous_tab_index>=0) //if previous tab index = 0 then the first tab is activated so no need to change tab.
return(diagram_ids_[previous_tab_index]);
else
return NULL;
}
/**
@brief change current diagramview to last tab
*/
void ProjectView::changeLastTab(){
DiagramView *lastDiagramView = this->lastDiagram();
m_tab->setCurrentWidget(lastDiagramView);
}
/**
@return last folio of current project
*/
DiagramView *ProjectView::lastDiagram(){
return(diagram_ids_.last());
}
/**
@brief change current diagramview to first tab
*/
void ProjectView::changeFirstTab(){
DiagramView *firstDiagramView = this->firstDiagram();
m_tab->setCurrentWidget(firstDiagramView);
}
/**
@return first folio of current project
*/
DiagramView *ProjectView::firstDiagram(){
return(diagram_ids_.first());
}
/** /**
Cette methode essaye de fermer successivement les editeurs d'element puis Cette methode essaye de fermer successivement les editeurs d'element puis
les schemas du projet. L'utilisateur peut refuser de fermer un schema ou un les schemas du projet. L'utilisateur peut refuser de fermer un schema ou un
@ -260,7 +337,7 @@ QString ProjectView::askUserForFilePath(bool assign) {
this, this,
tr("Enregistrer sous", "dialog title"), tr("Enregistrer sous", "dialog title"),
project_ -> currentDir(), project_ -> currentDir(),
tr("Projet QElectroTech (*.qet)", "filetypes allowed when saving a project file") tr("Projet QElectroTech (*.qet)", "filetypes allowed when saving a project file")
); );
// if no filepath is provided, return an empty string // if no filepath is provided, return an empty string
@ -368,8 +445,8 @@ void ProjectView::removeDiagram(DiagramView *diagram_view) {
//Ask confirmation to user. //Ask confirmation to user.
int answer = QET::QetMessageBox::question( int answer = QET::QetMessageBox::question(
this, this,
tr("Supprimer le folio ?", "message box title"), tr("Supprimer le folio ?", "message box title"),
tr("Êtes-vous sûr de vouloir supprimer ce folio du projet ? Ce changement est irréversible.", "message box content"), tr("Êtes-vous sûr de vouloir supprimer ce folio du projet ? Ce changement est irréversible.", "message box content"),
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel, QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
QMessageBox::No QMessageBox::No
); );
@ -700,12 +777,12 @@ int ProjectView::cleanProject() {
} }
// construit un petit dialogue pour parametrer le nettoyage // construit un petit dialogue pour parametrer le nettoyage
QCheckBox *clean_tbt = new QCheckBox(tr("Supprimer les modèles de cartouche inutilisés dans le projet")); QCheckBox *clean_tbt = new QCheckBox(tr("Supprimer les modèles de cartouche inutilisés dans le projet"));
QCheckBox *clean_elements = new QCheckBox(tr("Supprimer les éléments inutilisés dans le projet")); QCheckBox *clean_elements = new QCheckBox(tr("Supprimer les éléments inutilisés dans le projet"));
QCheckBox *clean_categories = new QCheckBox(tr("Supprimer les catégories vides")); QCheckBox *clean_categories = new QCheckBox(tr("Supprimer les catégories vides"));
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
clean_tbt -> setChecked(true); clean_tbt -> setChecked(true);
clean_elements -> setChecked(true); clean_elements -> setChecked(true);
clean_categories -> setChecked(true); clean_categories -> setChecked(true);
@ -751,7 +828,7 @@ int ProjectView::cleanProject() {
Initialize actions for this widget. Initialize actions for this widget.
*/ */
void ProjectView::initActions() { void ProjectView::initActions() {
add_new_diagram_ = new QAction(QET::Icons::AddFolio, tr("Ajouter un folio"), this); add_new_diagram_ = new QAction(QET::Icons::AddFolio, tr("Ajouter un folio"), this);
connect(add_new_diagram_, SIGNAL(triggered()), this, SLOT(addNewDiagram())); connect(add_new_diagram_, SIGNAL(triggered()), this, SLOT(addNewDiagram()));
} }
@ -766,7 +843,7 @@ void ProjectView::initWidgets() {
fallback_widget_ = new QWidget(); fallback_widget_ = new QWidget();
fallback_label_ = new QLabel( fallback_label_ = new QLabel(
tr( tr(
"Ce projet ne contient aucun folio", "Ce projet ne contient aucun folio",
"label displayed when a project contains no diagram" "label displayed when a project contains no diagram"
) )
); );

View File

@ -56,6 +56,10 @@ class ProjectView : public QWidget {
QList<Diagram *> getDiagrams(ProjectSaveOptions options); QList<Diagram *> getDiagrams(ProjectSaveOptions options);
DiagramView *currentDiagram() const; DiagramView *currentDiagram() const;
void closeEvent(QCloseEvent *); void closeEvent(QCloseEvent *);
void changeTabUp();
void changeTabDown();
void changeFirstTab();
void changeLastTab();
public slots: public slots:
void addNewDiagram(); void addNewDiagram();
@ -109,6 +113,10 @@ class ProjectView : public QWidget {
void initLayout(); void initLayout();
void loadDiagrams(); void loadDiagrams();
DiagramView *findDiagram(Diagram *); DiagramView *findDiagram(Diagram *);
DiagramView *nextDiagram();
DiagramView *previousDiagram();
DiagramView *firstDiagram();
DiagramView *lastDiagram();
void rebuildDiagramsMap(); void rebuildDiagramsMap();
bool tryClosing(); bool tryClosing();
bool tryClosingElementEditors(); bool tryClosingElementEditors();

View File

@ -1524,6 +1524,34 @@ ProjectView *QETDiagramEditor::viewForFile(const QString &filepath) const {
return(0); return(0);
} }
/**
* @brief QETDiagramEditor::acessCurrentProject
* Retrieve current Project open in diagram editor
*/
ProjectView *QETDiagramEditor::acessCurrentProject (){
QMdiSubWindow *current_window = workspace.activeSubWindow();
if (!current_window) return(0);
QWidget *current_widget = current_window -> widget();
if (!current_widget) return(0);
if (ProjectView *project_view = qobject_cast<ProjectView *>(current_widget)) {
return(project_view);
}
return(0);
}
/**
* @brief QETDiagramEditor::acessCurrentDiagramView
* Retrieve current DiagramView used in diagram editor
*/
DiagramView *QETDiagramEditor::acessCurrentDiagramView () {
if (ProjectView *project_view = currentProject()) {
return(project_view -> currentDiagram());
}
return(0);
}
/** /**
met a jour le menu "Fenetres" met a jour le menu "Fenetres"
*/ */

View File

@ -65,6 +65,8 @@ class QETDiagramEditor : public QETMainWindow {
bool openAndAddProject (const QString &, bool = true, bool = true); bool openAndAddProject (const QString &, bool = true, bool = true);
QList<QString> editedFiles () const; QList<QString> editedFiles () const;
ProjectView *viewForFile (const QString &) const; ProjectView *viewForFile (const QString &) const;
ProjectView *acessCurrentProject ();
DiagramView *acessCurrentDiagramView ();
protected: protected:
virtual bool event(QEvent *); virtual bool event(QEvent *);

View File

@ -34,6 +34,8 @@
#include "integrationmovetemplateshandler.h" #include "integrationmovetemplateshandler.h"
#include "xmlelementcollection.h" #include "xmlelementcollection.h"
#include "importelementdialog.h" #include "importelementdialog.h"
#include "numerotationcontextcommands.h"
#include <QStandardPaths> #include <QStandardPaths>
@ -54,7 +56,8 @@ QETProject::QETProject(int diagrams, QObject *parent) :
titleblocks_ (this ), titleblocks_ (this ),
folioSheetsQuantity (0 ), folioSheetsQuantity (0 ),
m_auto_conductor (true ), m_auto_conductor (true ),
m_elements_collection (nullptr) m_elements_collection (nullptr),
m_auto_folio (true )
{ {
// 0 a n schema(s) vide(s) // 0 a n schema(s) vide(s)
int diagrams_count = qMax(0, diagrams); int diagrams_count = qMax(0, diagrams);
@ -91,7 +94,8 @@ QETProject::QETProject(const QString &path, QObject *parent) :
titleblocks_ (this ), titleblocks_ (this ),
folioSheetsQuantity (0 ), folioSheetsQuantity (0 ),
m_auto_conductor (true ), m_auto_conductor (true ),
m_elements_collection (nullptr) m_elements_collection (nullptr),
m_auto_folio (true )
{ {
//Open the file //Open the file
QFile project_file(path); QFile project_file(path);
@ -442,9 +446,17 @@ QHash <QString, NumerotationContext> QETProject::conductorAutoNum() const {
return m_conductor_autonum; return m_conductor_autonum;
} }
/**
* @brief QETProject::folioAutoNum
* @return All value of conductor autonum stored in project
*/
QHash <QString, NumerotationContext> QETProject::folioAutoNum() const {
return m_folio_autonum;
}
/** /**
* @brief QETProject::addConductorAutoNum * @brief QETProject::addConductorAutoNum
* Add a new numerotation context. If key already exist, * Add a new conductor numerotation context. If key already exist,
* replace old context by the new context * replace old context by the new context
* @param key * @param key
* @param context * @param context
@ -453,18 +465,38 @@ void QETProject::addConductorAutoNum(QString key, NumerotationContext context) {
m_conductor_autonum.insert(key, context); m_conductor_autonum.insert(key, context);
} }
/**
* @brief QETProject::addFolioAutoNum
* Add a new folio numerotation context. If key already exist,
* replace old context by the new context
* @param key
* @param context
*/
void QETProject::addFolioAutoNum(QString key, NumerotationContext context) {
m_folio_autonum.insert(key, context);
}
/** /**
* @brief QETProject::removeConductorAutonum * @brief QETProject::removeConductorAutonum
* Remove the Numerotation Context stored with key * Remove Conductor Numerotation Context stored with key
* @param key * @param key
*/ */
void QETProject::removeConductorAutonum(QString key) { void QETProject::removeConductorAutonum(QString key) {
m_conductor_autonum.remove(key); m_conductor_autonum.remove(key);
} }
/**
* @brief QETProject::removeFolioAutonum
* Remove Folio Numerotation Context stored with key
* @param key
*/
void QETProject::removeFolioAutoNum(QString key) {
m_folio_autonum.remove(key);
}
/** /**
* @brief QETProject::conductorAutoNum * @brief QETProject::conductorAutoNum
* Return the numerotation context stored with @key. * Return conductor numerotation context stored with @key.
* If key is not found, return an empty numerotation context * If key is not found, return an empty numerotation context
* @param key * @param key
*/ */
@ -473,6 +505,17 @@ NumerotationContext QETProject::conductorAutoNum (const QString &key) const {
else return NumerotationContext(); else return NumerotationContext();
} }
/**
* @brief QETProject::folioAutoNum
* Return folio numerotation context stored with @key.
* If key is not found, return an empty numerotation context
* @param key
*/
NumerotationContext QETProject::folioAutoNum (const QString &key) const {
if (m_folio_autonum.contains(key)) return m_folio_autonum[key];
else return NumerotationContext();
}
/** /**
* @brief QETProject::autoConductor * @brief QETProject::autoConductor
* @return true if use of auto conductor is authorized. * @return true if use of auto conductor is authorized.
@ -483,6 +526,16 @@ bool QETProject::autoConductor() const
return m_auto_conductor; return m_auto_conductor;
} }
/**
* @brief QETProject::autoFolio
* @return true if use of auto folio is authorized.
* See also Q_PROPERTY autoFolio
*/
bool QETProject::autoFolio() const
{
return m_auto_folio;
}
/** /**
* @brief QETProject::setAutoConductor * @brief QETProject::setAutoConductor
* @param ac * @param ac
@ -495,6 +548,46 @@ void QETProject::setAutoConductor(bool ac)
m_auto_conductor = ac; m_auto_conductor = ac;
} }
/**
* @brief QETProject::setAutoFolio
* @param ac
* Enable the use of auto folio if true
* See also Q_PROPERTY autoConductor
*/
void QETProject::setAutoFolio(bool af)
{
if (af != m_auto_folio)
m_auto_folio = af;
}
/**
* @brief QETProject::autoFolioNumberingNewFolios
* emit Signal to add new Diagram with autonum
* properties
*/
void QETProject::autoFolioNumberingNewFolios(){
emit addAutoNumDiagram();
}
/**
* @brief QETProject::autoFolioNumberingNewFolios
* @param autonum used, index from selected tabs "from" and "to"
* rename folios with selected autonum
*/
void QETProject::autoFolioNumberingSelectedFolios(int from, int to, QString autonum){
int total_folio = diagrams_.count();
DiagramContext project_wide_properties = project_properties_;
for (int i=from; i<=to; i++) {
QString title = diagrams_[i] -> title();
NumerotationContext nC = folioAutoNum(autonum);
NumerotationContextCommands nCC = NumerotationContextCommands(nC);
diagrams_[i] -> border_and_titleblock.setFolio("%autonum");
diagrams_[i] -> border_and_titleblock.setFolioData(i + 1, total_folio, nCC.toRepresentedString(), project_wide_properties);
diagrams_[i] -> project() -> addFolioAutoNum(autonum,nCC.next());
diagrams_[i] -> update();
}
}
/** /**
@return un document XML representant le projet @return un document XML representant le projet
*/ */
@ -1157,7 +1250,7 @@ void QETProject::readDefaultPropertiesXml(QDomDocument &xml_project)
m_default_xref_properties = XRefProperties:: defaultProperties(); m_default_xref_properties = XRefProperties:: defaultProperties();
//Read values indicate in project //Read values indicate in project
QDomElement border_elmt, titleblock_elmt, conductors_elmt, report_elmt, xref_elmt, conds_autonums; QDomElement border_elmt, titleblock_elmt, conductors_elmt, report_elmt, xref_elmt, conds_autonums, folio_autonums;
for (QDomNode child = newdiagrams_elmt.firstChild() ; !child.isNull() ; child = child.nextSibling()) for (QDomNode child = newdiagrams_elmt.firstChild() ; !child.isNull() ; child = child.nextSibling())
{ {
@ -1176,6 +1269,8 @@ void QETProject::readDefaultPropertiesXml(QDomDocument &xml_project)
xref_elmt = child_elmt; xref_elmt = child_elmt;
else if (child_elmt.tagName() == "conductors_autonums") else if (child_elmt.tagName() == "conductors_autonums")
conds_autonums = child_elmt; conds_autonums = child_elmt;
else if (child_elmt.tagName()== "folio_autonums")
folio_autonums = child_elmt;
} }
// size, titleblock, conductor, report, conductor autonum // size, titleblock, conductor, report, conductor autonum
@ -1201,6 +1296,15 @@ void QETProject::readDefaultPropertiesXml(QDomDocument &xml_project)
m_conductor_autonum.insert(elmt.attribute("title"), nc); m_conductor_autonum.insert(elmt.attribute("title"), nc);
} }
} }
if (!folio_autonums.isNull())
{
foreach (QDomElement elmt, QET::findInDomElement(folio_autonums, "folio_autonum"))
{
NumerotationContext nc;
nc.fromXml(elmt);
m_folio_autonum.insert(elmt.attribute("title"), nc);
}
}
} }
/** /**
@ -1261,6 +1365,15 @@ void QETProject::writeDefaultPropertiesXml(QDomElement &xml_element) {
conds_autonums.appendChild(cond_autonum); conds_autonums.appendChild(cond_autonum);
} }
xml_element.appendChild(conds_autonums); xml_element.appendChild(conds_autonums);
//Export Folio Autonums
QDomElement folio_autonums = xml_document.createElement("folio_autonums");
foreach (QString key, folioAutoNum().keys()) {
QDomElement folio_autonum = folioAutoNum(key).toXml(xml_document, "folio_autonum");
folio_autonum.setAttribute("title", key);
folio_autonums.appendChild(folio_autonum);
}
xml_element.appendChild(folio_autonums);
} }
/** /**
@ -1416,7 +1529,17 @@ void QETProject::updateDiagramsFolioData() {
project_wide_properties.addValue("projecttitle", title()); project_wide_properties.addValue("projecttitle", title());
for (int i = 0 ; i < total_folio ; ++ i) { for (int i = 0 ; i < total_folio ; ++ i) {
diagrams_[i] -> border_and_titleblock.setFolioData(i + 1, total_folio, project_wide_properties); QString title = diagrams_[i] -> title();
QString autopagenum = diagrams_[i]->border_and_titleblock.autoPageNum();
NumerotationContext nC = folioAutoNum(autopagenum);
NumerotationContextCommands nCC = NumerotationContextCommands(nC);
if((diagrams_[i]->border_and_titleblock.folio().contains("%autonum"))&&(!autopagenum.isNull())){
diagrams_[i] -> border_and_titleblock.setFolioData(i + 1, total_folio, nCC.toRepresentedString(), project_wide_properties);
diagrams_[i]->project()->addFolioAutoNum(autopagenum,nCC.next());
}
else{
diagrams_[i] -> border_and_titleblock.setFolioData(i + 1, total_folio, NULL, project_wide_properties);
}
diagrams_[i] -> update(); diagrams_[i] -> update();
} }
} }

View File

@ -115,12 +115,21 @@ class QETProject : public QObject
void setDefaultXRefProperties(QHash <QString, XRefProperties> hash); void setDefaultXRefProperties(QHash <QString, XRefProperties> hash);
QHash <QString, NumerotationContext> conductorAutoNum() const; QHash <QString, NumerotationContext> conductorAutoNum() const;
QHash <QString, NumerotationContext> folioAutoNum() const;
void addConductorAutoNum (QString key, NumerotationContext context); void addConductorAutoNum (QString key, NumerotationContext context);
void addFolioAutoNum (QString key, NumerotationContext context);
void removeConductorAutonum (QString key); void removeConductorAutonum (QString key);
void removeFolioAutoNum (QString key);
NumerotationContext conductorAutoNum(const QString &key) const; NumerotationContext conductorAutoNum(const QString &key) const;
NumerotationContext folioAutoNum(const QString &key) const;
bool autoConductor () const; bool autoConductor () const;
bool autoFolio () const;
void setAutoConductor (bool ac); void setAutoConductor (bool ac);
void setAutoFolio (bool af);
void autoFolioNumberingNewFolios ();
void autoFolioNumberingSelectedFolios(int, int, QString);
QDomDocument toXml(); QDomDocument toXml();
bool close(); bool close();
QETResult write(); QETResult write();
@ -162,6 +171,7 @@ class QETProject : public QObject
void readOnlyChanged(QETProject *, bool); void readOnlyChanged(QETProject *, bool);
void reportPropertiesChanged(QString); void reportPropertiesChanged(QString);
void XRefPropertiesChanged (); void XRefPropertiesChanged ();
void addAutoNumDiagram();
private slots: private slots:
void updateDiagramsFolioData(); void updateDiagramsFolioData();
@ -226,10 +236,12 @@ class QETProject : public QObject
QUndoStack *undo_stack_; QUndoStack *undo_stack_;
/// Conductor auto numerotation /// Conductor auto numerotation
QHash <QString, NumerotationContext> m_conductor_autonum; QHash <QString, NumerotationContext> m_conductor_autonum;
QHash <QString, NumerotationContext> m_folio_autonum;
/// Folio List Sheets quantity for this project. /// Folio List Sheets quantity for this project.
int folioSheetsQuantity; int folioSheetsQuantity;
bool m_auto_conductor; bool m_auto_conductor;
XmlElementCollection *m_elements_collection; XmlElementCollection *m_elements_collection;
bool m_auto_folio;
}; };
Q_DECLARE_METATYPE(QETProject *) Q_DECLARE_METATYPE(QETProject *)
#endif #endif

View File

@ -48,6 +48,7 @@ bool TitleBlockProperties::operator==(const TitleBlockProperties &ip) {
ip.date == date &&\ ip.date == date &&\
ip.filename == filename &&\ ip.filename == filename &&\
ip.folio == folio &&\ ip.folio == folio &&\
ip.auto_page_num == auto_page_num &&\
ip.template_name == template_name &&\ ip.template_name == template_name &&\
ip.context == context &&\ ip.context == context &&\
ip.display_at == display_at &&\ ip.display_at == display_at &&\
@ -73,6 +74,7 @@ void TitleBlockProperties::toXml(QDomElement &e) const {
e.setAttribute("title", title); e.setAttribute("title", title);
e.setAttribute("filename", filename); e.setAttribute("filename", filename);
e.setAttribute("folio", folio); e.setAttribute("folio", folio);
e.setAttribute("auto_page_num", auto_page_num);
e.setAttribute("date", exportDate()); e.setAttribute("date", exportDate());
e.setAttribute("displayAt", (display_at == Qt::BottomEdge? "bottom" : "right")); e.setAttribute("displayAt", (display_at == Qt::BottomEdge? "bottom" : "right"));
if (!template_name.isEmpty()) if (!template_name.isEmpty())
@ -98,6 +100,7 @@ void TitleBlockProperties::fromXml(const QDomElement &e) {
if (e.hasAttribute("title")) title = e.attribute("title"); if (e.hasAttribute("title")) title = e.attribute("title");
if (e.hasAttribute("filename")) filename = e.attribute("filename"); if (e.hasAttribute("filename")) filename = e.attribute("filename");
if (e.hasAttribute("folio")) folio = e.attribute("folio"); if (e.hasAttribute("folio")) folio = e.attribute("folio");
if (e.hasAttribute("auto_page_num")) auto_page_num = e.attribute("auto_page_num");
if (e.hasAttribute("date")) setDateFromString(e.attribute("date")); if (e.hasAttribute("date")) setDateFromString(e.attribute("date"));
if (e.hasAttribute("displayAt")) display_at = (e.attribute("displayAt") == "bottom" ? Qt::BottomEdge : Qt::RightEdge); if (e.hasAttribute("displayAt")) display_at = (e.attribute("displayAt") == "bottom" ? Qt::BottomEdge : Qt::RightEdge);
@ -126,6 +129,7 @@ void TitleBlockProperties::toSettings(QSettings &settings, const QString &prefix
settings.setValue(prefix + "author", author); settings.setValue(prefix + "author", author);
settings.setValue(prefix + "filename", filename); settings.setValue(prefix + "filename", filename);
settings.setValue(prefix + "folio", folio); settings.setValue(prefix + "folio", folio);
settings.setValue(prefix + "auto_page_num", auto_page_num);
settings.setValue(prefix + "date", exportDate()); settings.setValue(prefix + "date", exportDate());
settings.setValue(prefix + "displayAt", (display_at == Qt::BottomEdge? "bottom" : "right")); settings.setValue(prefix + "displayAt", (display_at == Qt::BottomEdge? "bottom" : "right"));
settings.setValue(prefix + "titleblocktemplate", template_name.isEmpty()? QString() : template_name); settings.setValue(prefix + "titleblocktemplate", template_name.isEmpty()? QString() : template_name);
@ -143,6 +147,7 @@ void TitleBlockProperties::fromSettings(QSettings &settings, const QString &pref
author = settings.value(prefix + "author").toString(); author = settings.value(prefix + "author").toString();
filename = settings.value(prefix + "filename").toString(); filename = settings.value(prefix + "filename").toString();
folio = settings.value(prefix + "folio", "%id/%total").toString(); folio = settings.value(prefix + "folio", "%id/%total").toString();
auto_page_num = settings.value(prefix + "auto_page_num").toString();
setDateFromString(settings.value(prefix + "date").toString()); setDateFromString(settings.value(prefix + "date").toString());
display_at = (settings.value(prefix + "displayAt", QVariant("bottom")).toString() == "bottom" ? Qt::BottomEdge : Qt::RightEdge); display_at = (settings.value(prefix + "displayAt", QVariant("bottom")).toString() == "bottom" ? Qt::BottomEdge : Qt::RightEdge);
template_name = settings.value(prefix + "titleblocktemplate").toString(); template_name = settings.value(prefix + "titleblocktemplate").toString();

View File

@ -53,6 +53,7 @@ class TitleBlockProperties {
QDate date; ///< Date (displayed by the default template) QDate date; ///< Date (displayed by the default template)
QString filename; ///< Filename (displayed by the default template) QString filename; ///< Filename (displayed by the default template)
QString folio; ///< Folio information (displayed by the default template) QString folio; ///< Folio information (displayed by the default template)
QString auto_page_num;
DateManagement useDate; ///< Wheter to use the date attribute DateManagement useDate; ///< Wheter to use the date attribute
QString template_name; ///< Name of the template used to render the title block - an empty string means "the default template provided by the application" QString template_name; ///< Name of the template used to render the title block - an empty string means "the default template provided by the application"
DiagramContext context; ///< Container for the additional, user-defined fields DiagramContext context; ///< Container for the additional, user-defined fields

View File

@ -55,12 +55,14 @@ DiagramPropertiesDialog::DiagramPropertiesDialog(Diagram *diagram, QWidget *pare
//Title block widget //Title block widget
TitleBlockPropertiesWidget *titleblock_infos; TitleBlockPropertiesWidget *titleblock_infos;
if (QETProject *parent_project = diagram -> project()) { if (QETProject *parent_project = diagram -> project()) {
titleblock_infos = new TitleBlockPropertiesWidget(parent_project -> embeddedTitleBlockTemplatesCollection(), titleblock, false, this); titleblock_infos = new TitleBlockPropertiesWidget(parent_project -> embeddedTitleBlockTemplatesCollection(), titleblock, false, diagram->project(), this);
connect(titleblock_infos, SIGNAL(editTitleBlockTemplate(QString, bool)), diagram->views().first(), SIGNAL(editTitleBlockTemplate(QString, bool))); connect(titleblock_infos, SIGNAL(editTitleBlockTemplate(QString, bool)), diagram->views().first(), SIGNAL(editTitleBlockTemplate(QString, bool)));
} }
else else
titleblock_infos = new TitleBlockPropertiesWidget(titleblock, false, this); titleblock_infos = new TitleBlockPropertiesWidget(titleblock, false, diagram->project(), this);
titleblock_infos -> setReadOnly(diagram_is_read_only); titleblock_infos -> setReadOnly(diagram_is_read_only);
connect(titleblock_infos,SIGNAL(openAutoNumFolioEditor(QString)),this,SLOT(editAutoFolioNum()));
titleblock_infos->setMinimumSize(590,480); //Minimum Size needed for correct display
//Conductor widget //Conductor widget
ConductorPropertiesWidget *cpw = new ConductorPropertiesWidget(conductors, this); ConductorPropertiesWidget *cpw = new ConductorPropertiesWidget(conductors, this);
@ -124,7 +126,7 @@ void DiagramPropertiesDialog::diagramPropertiesDialog(Diagram *diagram, QWidget
/** /**
* @brief DiagramPropertiesDialog::editAutonum * @brief DiagramPropertiesDialog::editAutonum
* Open the autonum editor * Open conductor autonum editor
*/ */
void DiagramPropertiesDialog::editAutonum() { void DiagramPropertiesDialog::editAutonum() {
ProjectPropertiesDialog ppd (m_diagram->project(), this); ProjectPropertiesDialog ppd (m_diagram->project(), this);
@ -132,3 +134,14 @@ void DiagramPropertiesDialog::editAutonum() {
ppd.exec(); ppd.exec();
m_asw -> setItems (m_diagram -> project() -> conductorAutoNum().keys()); m_asw -> setItems (m_diagram -> project() -> conductorAutoNum().keys());
} }
/**
* @brief DiagramPropertiesDialog::editAutonum
* Open folio autonum editor
*/
void DiagramPropertiesDialog::editAutoFolioNum () {
ProjectPropertiesDialog ppd (m_diagram->project(), this);
ppd.setCurrentPage(ProjectPropertiesDialog::Autonum);
ppd.changeToFolio();
ppd.exec();
}

View File

@ -37,6 +37,7 @@ class DiagramPropertiesDialog : public QDialog {
public slots: public slots:
void editAutonum (); void editAutonum ();
void editAutoFolioNum ();
private: private:
Diagram *m_diagram; Diagram *m_diagram;

View File

@ -0,0 +1,218 @@
/*
Copyright 2006-2015 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#include "folioautonumbering.h"
#include "ui_folioautonumbering.h"
#include <QMessageBox>
#include <QPushButton>
#include <QtWidgets>
#include "qdebug.h"
#include "qetproject.h"
#include "diagram.h"
/**
* Constructor
*/
FolioAutonumberingW::FolioAutonumberingW(QETProject *project, QWidget *parent) :
QWidget(parent),
project_(project),
ui(new Ui::FolioAutonumberingW)
{
ui->setupUi(this);
applyEnable(false);
ui->m_from_cb->setEnabled(false);
ui->m_new_tabs_sb->setEnabled(false);
ui->m_to_cb->setEnabled(false);
}
/**
* Destructor
*/
FolioAutonumberingW::~FolioAutonumberingW()
{
delete ui;
}
/**
* @brief FolioAutonumberingW::setContext
* construct autonums in the comboBox selected in the @autonum_chooser QcomboBox
*/
void FolioAutonumberingW::setContext(QList <QString> autonums) {
foreach (QString str, autonums) { ui->m_autonums_cb->addItem(str);}
}
/**
* @brief FolioAutonumberingW::autoNumSelected
* returns the current autonum selected
*/
QString FolioAutonumberingW::autoNumSelected(){
return ui->m_autonums_cb->currentText();
}
/**
* @brief FolioAutonumberingW::fromFolio
* returns the current "From Folio" index
*/
int FolioAutonumberingW::fromFolio(){
return ui->m_from_cb->currentIndex()-1;
}
/**
* @brief FolioAutonumberingW::toFolio
* returns the current "To Folio" index
*/
int FolioAutonumberingW::toFolio(){
return ui->m_to_cb->currentIndex()+this->fromFolio()+1;
}
/**
* @brief FolioAutonumberingW::newFoliosNumber
* returns the number of folios to create
*/
int FolioAutonumberingW::newFoliosNumber(){
return ui->m_new_tabs_sb->value();
}
/**
* @brief FolioAutonumberingW::updateFolioList
* update Folio List in From and To ComboBox
*/
void FolioAutonumberingW::updateFolioList(){
ui -> m_from_cb->clear();
ui -> m_to_cb->clear();
if (newFolios){
this -> on_m_create_new_tabs_rb_clicked();
} else {
this -> on_m_autonumber_tabs_rb_clicked();
}
}
/**
* @brief FolioAutonumberingW::on_m_create_new_tabs_rb_clicked
* Enable New Tabs SpinBox
*/
void FolioAutonumberingW::on_m_create_new_tabs_rb_clicked() {
ui->m_from_cb->setEnabled(false);
ui->m_to_cb->setEnabled(false);
ui->m_new_tabs_sb->setEnabled(true);
applyEnable();
newFolios = true;
}
/**
* @brief FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked
* Enable From ComboBox, fill From ComboBox
*/
void FolioAutonumberingW::on_m_autonumber_tabs_rb_clicked() {
ui->m_new_tabs_sb->setEnabled(false);
ui->m_from_cb->setEnabled(true);
ui->m_to_cb->setEnabled(true);
if (ui->m_from_cb->count()<=0){
ui->m_from_cb->clear();
ui->m_from_cb->addItem("");
foreach (Diagram *diagram, project_->diagrams()){
ui->m_from_cb->addItem(diagram->title());
}
}
applyEnable();
newFolios = false;
}
/**
* @brief FolioAutonumberingW::on_m_new_tabs_sb_valueChanged
* Enable Apply if any new folio is to be created
*/
void FolioAutonumberingW::on_m_new_tabs_sb_valueChanged(){
if (ui->m_new_tabs_sb->value()>0) applyEnable(true);
else applyEnable(false);
}
/**
* @brief FolioAutonumberingW::on_m_from_cb_currentIndexChanged
* Enable To ComboBox
*/
void FolioAutonumberingW::on_m_from_cb_currentIndexChanged(){
int index = ui->m_from_cb->currentIndex();
ui->m_to_cb->clear();
if (index > 0){
ui->m_to_cb->setEnabled(true);
for (int i=index;i<project_->diagrams().size();i++)
ui->m_to_cb->addItem(project_->diagrams().at(i)->title());
applyEnable(true);
}
else{
applyEnable();
}
}
/**
* @brief SelectAutonumW::on_buttonBox_clicked
* Action on @buttonBox clicked
*/
void FolioAutonumberingW::on_buttonBox_clicked(QAbstractButton *button) {
//transform button to int
int answer = ui -> buttonBox -> buttonRole(button);
switch (answer) {
//help dialog - not implemented yet -
case QDialogButtonBox::HelpRole:
break;
/*QMessageBox::information (this, tr("Folio Autonumbering", "title window"),
tr("C'est ici que vous pouvez définir la manière dont sera numéroté les nouveaux conducteurs.\n"
"-Une numérotation est composée d'une variable minimum.\n"
"-Vous pouvez ajouter ou supprimer une variable de numérotation par le biais des boutons - et +.\n"
"-Une variable de numérotation comprant: un type, une valeur et une incrémentation.\n"
"\n-les types \"Chiffre 1\", \"Chiffre 01\" et \"Chiffre 001\", représente un type numérique définie dans le champs \"Valeur\", "
"qui s'incrémente à chaque nouveau conducteur de la valeur du champ \"Incrémentation\".\n"
"-\"Chiffre 01\" et \"Chiffre 001\", sont respectivement représenté sur le schéma par deux et trois digits minimum.\n"
"Si le chiffre définie dans le champs Valeur posséde moins de digits que le type choisit,"
"celui-ci sera précédé par un ou deux 0 afin de respecter son type.\n"
"\n-Le type \"Texte\", représente un texte fixe.\nLe champs \"Incrémentation\" n'est pas utilisé.\n"
"\n-Le type \"N° folio\" représente le n° du folio en cours.\nLes autres champs ne sont pas utilisés.",
"help dialog about the autonumerotation")); */
case QDialogButtonBox::ApplyRole:
applyEnable(true);
emit applyPressed();
updateFolioList();
break;
}
}
/**
* @brief SelectAutonumW::applyEnable
* enable/disable the apply button
*/
void FolioAutonumberingW::applyEnable(bool b) {
if (b){
bool valid = true;
if (ui->m_create_new_tabs_rb->isChecked()){
if (ui->m_new_tabs_sb->value()==0) valid = false;
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(valid);
}
else{
if (ui->m_to_cb->currentText()=="") valid = false;
ui->buttonBox->button(QDialogButtonBox::Apply)->setEnabled(valid);
}
}
else{
ui -> buttonBox -> button(QDialogButtonBox::Apply) -> setEnabled(b);
}
}

View File

@ -0,0 +1,72 @@
/*
Copyright 2006-2015 The QElectroTech Team
This file is part of QElectroTech.
QElectroTech is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
QElectroTech is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FOLIOAUTONUMBERING_H
#define FOLIOAUTONUMBERING_H
#include <QWidget>
#include "numerotationcontext.h"
class NumPartEditorW;
class QAbstractButton;
class QETProject;
namespace Ui {
class FolioAutonumberingW;
}
class FolioAutonumberingW : public QWidget
{
Q_OBJECT
//METHODS
public:
explicit FolioAutonumberingW(QETProject *project, QWidget *parent = 0);
~FolioAutonumberingW();
void setContext (QList <QString> autonums);
NumerotationContext toNumContext() const;
QString autoNumSelected();
int newFoliosNumber();
bool newFolios;
int fromFolio();
int toFolio();
// SIGNALS
signals:
void applyPressed();
void m_autonumber_tabs_rb_clicked();
//SLOTS
private slots:
void on_m_create_new_tabs_rb_clicked();
void on_m_autonumber_tabs_rb_clicked();
void on_m_new_tabs_sb_valueChanged();
void on_buttonBox_clicked(QAbstractButton *);
void on_m_from_cb_currentIndexChanged();
void applyEnable (bool = true);
//ATTRIBUTES
private:
QETProject *project_;
Ui::FolioAutonumberingW *ui;
QList <NumPartEditorW *> num_part_list_;
NumerotationContext m_context;
void updateFolioList();
};
#endif // FOLIOAUTONUMBERING_H

View File

@ -0,0 +1,295 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FolioAutonumberingW</class>
<widget class="QWidget" name="FolioAutonumberingW">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>467</width>
<height>550</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>460</width>
<height>0</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>50</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>450</width>
<height>253</height>
</size>
</property>
<property name="sizeIncrement">
<size>
<width>0</width>
<height>50</height>
</size>
</property>
<property name="mouseTracking">
<bool>false</bool>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignHCenter|Qt::AlignTop</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>448</width>
<height>497</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>430</width>
<height>250</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<item row="2" column="1" colspan="2">
<widget class="QGroupBox" name="Options">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Numbering Options</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="2" column="1">
<widget class="QComboBox" name="m_to_cb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>New Tabs</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="m_from_cb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="m_new_tabs_sb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximum">
<number>999</number>
</property>
<property name="displayIntegerBase">
<number>10</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>To</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>From</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QGroupBox" name="Select">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Select:</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QRadioButton" name="m_create_new_tabs_rb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Create New Tabs</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="m_autonumber_tabs_rb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Autonumber Selected Tabs</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Folio Auto Numbering:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QComboBox" name="m_autonums_cb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Help|QDialogButtonBox::Reset</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -28,11 +28,18 @@
* @param parent : parent widget of this dialog * @param parent : parent widget of this dialog
*/ */
ProjectPropertiesDialog::ProjectPropertiesDialog(QETProject *project, QWidget *parent) { ProjectPropertiesDialog::ProjectPropertiesDialog(QETProject *project, QWidget *parent) {
NewDiagramPage *newDiagramPage = new NewDiagramPage(project,parent,this);
ProjectAutoNumConfigPage *projectAutoNumConfigPage = new ProjectAutoNumConfigPage (project);
m_properties_dialog = new ConfigDialog (parent); m_properties_dialog = new ConfigDialog (parent);
m_properties_dialog -> setWindowTitle(QObject::tr("Propriétés du projet", "window title")); m_properties_dialog -> setWindowTitle(QObject::tr("Propriétés du projet", "window title"));
m_properties_dialog -> addPage(new ProjectMainConfigPage (project)); m_properties_dialog -> addPage(new ProjectMainConfigPage (project));
m_properties_dialog -> addPage(new NewDiagramPage (project)); m_properties_dialog -> addPage(newDiagramPage);
m_properties_dialog -> addPage(new ProjectAutoNumConfigPage (project)); m_properties_dialog -> addPage(projectAutoNumConfigPage);
connect(projectAutoNumConfigPage,SIGNAL(setAutoNum(QString)),newDiagramPage,SLOT(setFolioAutonum(QString)));
connect(projectAutoNumConfigPage,SIGNAL(saveCurrentTbp()),newDiagramPage,SLOT(saveCurrentTbp()));
connect(projectAutoNumConfigPage,SIGNAL(loadSavedTbp()),newDiagramPage,SLOT(loadSavedTbp()));
m_properties_dialog->setMinimumHeight(690);
} }
/** /**
@ -58,3 +65,12 @@ void ProjectPropertiesDialog::exec() {
void ProjectPropertiesDialog::setCurrentPage(ProjectPropertiesDialog::Page p) { void ProjectPropertiesDialog::setCurrentPage(ProjectPropertiesDialog::Page p) {
m_properties_dialog -> setCurrentPage(static_cast <int> (p)); m_properties_dialog -> setCurrentPage(static_cast <int> (p));
} }
/**
* @brief ProjectPropertiesDialog::changeToFolio
* Change the current displayed tab to folio tab.
*/
void ProjectPropertiesDialog::changeToFolio() {
ProjectAutoNumConfigPage *autoNumPage = static_cast <ProjectAutoNumConfigPage*>(m_properties_dialog->pages.at(2));
autoNumPage->changeToTab(1);
}

View File

@ -17,6 +17,7 @@
*/ */
#ifndef PROJECTPROPERTIESDIALOG_H #ifndef PROJECTPROPERTIESDIALOG_H
#define PROJECTPROPERTIESDIALOG_H #define PROJECTPROPERTIESDIALOG_H
#include <QtCore>
class QETProject; class QETProject;
class QWidget; class QWidget;
@ -26,8 +27,7 @@ class ConfigDialog;
* @brief The ProjectPropertiesDialog class * @brief The ProjectPropertiesDialog class
* this class builds a dialog to edit whole properties of a project * this class builds a dialog to edit whole properties of a project
*/ */
class ProjectPropertiesDialog class ProjectPropertiesDialog : public QObject {
{
public: public:
enum Page { enum Page {
Main = 0, Main = 0,
@ -39,6 +39,7 @@ class ProjectPropertiesDialog
~ProjectPropertiesDialog(); ~ProjectPropertiesDialog();
void exec(); void exec();
void setCurrentPage(ProjectPropertiesDialog::Page); void setCurrentPage(ProjectPropertiesDialog::Page);
void changeToFolio();
private: private:
ConfigDialog *m_properties_dialog; ConfigDialog *m_properties_dialog;

View File

@ -6,183 +6,289 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>432</width> <width>466</width>
<height>273</height> <height>506</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QGroupBox" name="definition_groupe"> <widget class="QScrollArea" name="scrollArea">
<property name="title"> <property name="sizePolicy">
<string>Définition</string> <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_3"> <property name="minimumSize">
<item> <size>
<layout class="QHBoxLayout" name="horizontalLayout"> <width>430</width>
<property name="spacing"> <height>455</height>
<number>0</number> </size>
</property> </property>
<item> <property name="sizeIncrement">
<spacer name="horizontalSpacer_2"> <size>
<property name="orientation"> <width>0</width>
<enum>Qt::Horizontal</enum> <height>0</height>
</property> </size>
<property name="sizeHint" stdset="0"> </property>
<size> <property name="mouseTracking">
<width>40</width> <bool>false</bool>
<height>20</height> </property>
</size> <property name="layoutDirection">
</property> <enum>Qt::LeftToRight</enum>
</spacer> </property>
</item> <property name="verticalScrollBarPolicy">
<item> <enum>Qt::ScrollBarAsNeeded</enum>
<widget class="QPushButton" name="remove_button"> </property>
<property name="toolTip"> <property name="horizontalScrollBarPolicy">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Supprimer une variable de numérotation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <enum>Qt::ScrollBarAlwaysOff</enum>
</property> </property>
<property name="text"> <property name="sizeAdjustPolicy">
<string/> <enum>QAbstractScrollArea::AdjustToContents</enum>
</property> </property>
<property name="icon"> <property name="widgetResizable">
<iconset resource="../../qelectrotech.qrc"> <bool>true</bool>
<normaloff>:/ico/22x22/list-remove.png</normaloff>:/ico/22x22/list-remove.png</iconset> </property>
</property> <property name="alignment">
<property name="flat"> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
<bool>false</bool> </property>
</property> <widget class="QWidget" name="scrollAreaWidgetContents">
</widget> <property name="geometry">
</item> <rect>
<item> <x>0</x>
<widget class="QPushButton" name="add_button"> <y>0</y>
<property name="toolTip"> <width>460</width>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ajouter une variable de numérotation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <height>453</height>
</property> </rect>
<property name="text"> </property>
<string/> <property name="sizePolicy">
</property> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<property name="icon"> <horstretch>0</horstretch>
<iconset resource="../../qelectrotech.qrc"> <verstretch>0</verstretch>
<normaloff>:/ico/22x22/list-add.png</normaloff>:/ico/22x22/list-add.png</iconset> </sizepolicy>
</property> </property>
<property name="flat"> <property name="minimumSize">
<bool>false</bool> <size>
</property> <width>460</width>
</widget> <height>450</height>
</item> </size>
<item> </property>
<widget class="QPushButton" name="m_previous_pb"> <layout class="QVBoxLayout" name="verticalLayout_2">
<property name="toolTip"> <property name="sizeConstraint">
<string>Précédent</string> <enum>QLayout::SetFixedSize</enum>
</property> </property>
<property name="text"> <item>
<string/> <widget class="QGroupBox" name="definition_groupe">
</property> <property name="sizePolicy">
<property name="icon"> <sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<iconset resource="../../qelectrotech.qrc"> <horstretch>0</horstretch>
<normaloff>:/ico/16x16/arrow-left.png</normaloff>:/ico/16x16/arrow-left.png</iconset> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
</item> <property name="title">
<item> <string>Définition</string>
<widget class="QPushButton" name="m_next_pb"> </property>
<property name="toolTip"> <property name="alignment">
<string>Suivant</string> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property> </property>
<property name="text"> <layout class="QVBoxLayout" name="verticalLayout_3">
<string/> <property name="sizeConstraint">
</property> <enum>QLayout::SetFixedSize</enum>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/16x16/arrow-right.png</normaloff>:/ico/16x16/arrow-right.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="editor_layout">
<property name="spacing">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="label_layout">
<property name="spacing">
<number>0</number>
</property> </property>
<item> <item>
<widget class="QLabel" name="type_label"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="text"> <property name="spacing">
<string>Type</string> <number>0</number>
</property> </property>
<property name="alignment"> <property name="sizeConstraint">
<set>Qt::AlignCenter</set> <enum>QLayout::SetDefaultConstraint</enum>
</property> </property>
</widget> <item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="remove_button">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Supprimer une variable de numérotation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/list-remove.png</normaloff>:/ico/22x22/list-remove.png</iconset>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="add_button">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ajouter une variable de numérotation&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/list-add.png</normaloff>:/ico/22x22/list-add.png</iconset>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_previous_pb">
<property name="toolTip">
<string>Précédent</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/16x16/arrow-left.png</normaloff>:/ico/16x16/arrow-left.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_next_pb">
<property name="toolTip">
<string>Suivant</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/16x16/arrow-right.png</normaloff>:/ico/16x16/arrow-right.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="value_label"> <layout class="QVBoxLayout" name="editor_layout" stretch="0">
<property name="text"> <property name="spacing">
<string>Valeur</string> <number>0</number>
</property> </property>
<property name="alignment"> <property name="sizeConstraint">
<set>Qt::AlignCenter</set> <enum>QLayout::SetDefaultConstraint</enum>
</property> </property>
</widget> <item>
<layout class="QHBoxLayout" name="label_layout" stretch="0,0,0">
<property name="spacing">
<number>0</number>
</property>
<property name="sizeConstraint">
<enum>QLayout::SetDefaultConstraint</enum>
</property>
<item>
<widget class="QLabel" name="type_label">
<property name="text">
<string>Type</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="value_label">
<property name="text">
<string>Valeur</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="increase_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Incrémentation</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item> </item>
<item> <item>
<widget class="QLabel" name="increase_label"> <spacer name="verticalSpacer">
<property name="sizePolicy"> <property name="orientation">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred"> <enum>Qt::Vertical</enum>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="text"> <property name="sizeType">
<string>Incrémentation</string> <enum>QSizePolicy::MinimumExpanding</enum>
</property> </property>
<property name="alignment"> <property name="sizeHint" stdset="0">
<set>Qt::AlignCenter</set> <size>
<width>20</width>
<height>30</height>
</size>
</property> </property>
</widget> </spacer>
</item> </item>
</layout> </layout>
</item> </widget>
</layout> </item>
</item> </layout>
</layout> </widget>
</widget> </widget>
</item> </item>
<item>
<spacer name="verticalSpacer">
<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> <item>
<widget class="QDialogButtonBox" name="buttonBox"> <widget class="QDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="standardButtons"> <property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Help|QDialogButtonBox::Reset</set> <set>QDialogButtonBox::Apply|QDialogButtonBox::Help|QDialogButtonBox::Reset</set>
</property> </property>

View File

@ -29,13 +29,13 @@
* @param current_date if true, display the radio button "current date" * @param current_date if true, display the radio button "current date"
* @param parent parent widget * @param parent parent widget
*/ */
TitleBlockPropertiesWidget::TitleBlockPropertiesWidget(const TitleBlockProperties &titleblock, bool current_date, QWidget *parent) : TitleBlockPropertiesWidget::TitleBlockPropertiesWidget(const TitleBlockProperties &titleblock, bool current_date, QETProject *project, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::TitleBlockPropertiesWidget) ui(new Ui::TitleBlockPropertiesWidget)
{ {
ui->setupUi(this); ui->setupUi(this);
initDialog(current_date); initDialog(current_date, project);
setProperties(titleblock); setProperties(titleblock);
} }
/** /**
@ -46,12 +46,12 @@ TitleBlockPropertiesWidget::TitleBlockPropertiesWidget(const TitleBlockPropertie
* @param current_date if true, display the radio button "current date" * @param current_date if true, display the radio button "current date"
* @param parent parent widget * @param parent parent widget
*/ */
TitleBlockPropertiesWidget::TitleBlockPropertiesWidget(TitleBlockTemplatesCollection *tbt_collection, const TitleBlockProperties &titleblock, bool current_date, QWidget *parent) : TitleBlockPropertiesWidget::TitleBlockPropertiesWidget(TitleBlockTemplatesCollection *tbt_collection, const TitleBlockProperties &titleblock, bool current_date, QETProject *project, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::TitleBlockPropertiesWidget) ui(new Ui::TitleBlockPropertiesWidget)
{ {
ui->setupUi(this); ui->setupUi(this);
initDialog(current_date); initDialog(current_date,project);
addCollection(tbt_collection); addCollection(tbt_collection);
updateTemplateList(); updateTemplateList();
setProperties(titleblock); setProperties(titleblock);
@ -65,12 +65,12 @@ TitleBlockPropertiesWidget::TitleBlockPropertiesWidget(TitleBlockTemplatesCollec
* @param current_date if true, display the radio button "current date" * @param current_date if true, display the radio button "current date"
* @param parent parent widget * @param parent parent widget
*/ */
TitleBlockPropertiesWidget::TitleBlockPropertiesWidget(QList<TitleBlockTemplatesCollection *> tbt_collection, const TitleBlockProperties &titleblock, bool current_date, QWidget *parent) : TitleBlockPropertiesWidget::TitleBlockPropertiesWidget(QList<TitleBlockTemplatesCollection *> tbt_collection, const TitleBlockProperties &titleblock, bool current_date, QETProject *project, QWidget *parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::TitleBlockPropertiesWidget) ui(new Ui::TitleBlockPropertiesWidget)
{ {
ui->setupUi(this); ui->setupUi(this);
initDialog(current_date); initDialog(current_date,project);
foreach (TitleBlockTemplatesCollection *c, tbt_collection) foreach (TitleBlockTemplatesCollection *c, tbt_collection)
addCollection(c); addCollection(c);
updateTemplateList(); updateTemplateList();
@ -96,6 +96,7 @@ void TitleBlockPropertiesWidget::setProperties(const TitleBlockProperties &prope
ui -> m_file_le -> setText (properties.filename); ui -> m_file_le -> setText (properties.filename);
ui -> m_folio_le -> setText (properties.folio); ui -> m_folio_le -> setText (properties.folio);
ui -> m_display_at_cb -> setCurrentIndex(properties.display_at == Qt::BottomEdge ? 0 : 1); ui -> m_display_at_cb -> setCurrentIndex(properties.display_at == Qt::BottomEdge ? 0 : 1);
ui->auto_page_cb->setCurrentText(properties.auto_page_num);
//About date //About date
ui -> m_date_now_pb -> setDisabled(true); ui -> m_date_now_pb -> setDisabled(true);
@ -172,6 +173,46 @@ TitleBlockProperties TitleBlockPropertiesWidget::properties() const {
prop.context = m_dcw -> context(); prop.context = m_dcw -> context();
prop.auto_page_num = ui->auto_page_cb->currentText();
return prop;
}
/**
* @brief TitleBlockPropertiesWidget::properties
* @return return properties to enable folio autonum
*/
TitleBlockProperties TitleBlockPropertiesWidget::propertiesAutoNum(QString autoNum) const {
TitleBlockProperties prop;
prop.title = ui -> m_title_le -> text();
prop.author = ui -> m_author_le -> text();
prop.filename = ui -> m_file_le -> text();
prop.folio = "%autonum";
prop.display_at = ui -> m_display_at_cb -> currentIndex() == 0 ? Qt::BottomEdge : Qt::RightEdge;
if (ui->m_no_date_rb->isChecked()) {
prop.useDate = TitleBlockProperties::UseDateValue;
prop.date = QDate();
}
else if (ui -> m_fixed_date_rb -> isChecked()) {
prop.useDate = TitleBlockProperties::UseDateValue;
prop.date = ui->m_date_edit->date();
}
else if (ui->m_current_date_rb->isVisible() && ui->m_current_date_rb->isChecked()) {
prop.useDate = TitleBlockProperties::CurrentDate;
prop.date = QDate::currentDate();
}
if (!currentTitleBlockTemplateName().isEmpty())
{
prop.template_name = currentTitleBlockTemplateName();
prop.collection = m_map_index_to_collection_type.at(ui->m_tbt_cb->currentIndex());
}
prop.context = m_dcw -> context();
prop.auto_page_num = autoNum;
return prop; return prop;
} }
@ -220,7 +261,7 @@ void TitleBlockPropertiesWidget::addCollection(TitleBlockTemplatesCollection *tb
* Init this dialog * Init this dialog
* @param current_date true for display current date radio button * @param current_date true for display current date radio button
*/ */
void TitleBlockPropertiesWidget::initDialog(const bool &current_date) { void TitleBlockPropertiesWidget::initDialog(const bool &current_date, QETProject *project) {
m_dcw = new DiagramContextWidget(); m_dcw = new DiagramContextWidget();
ui -> m_tab2_vlayout -> addWidget(m_dcw); ui -> m_tab2_vlayout -> addWidget(m_dcw);
@ -239,6 +280,19 @@ void TitleBlockPropertiesWidget::initDialog(const bool &current_date) {
ui -> m_tbt_pb -> setMenu(m_tbt_menu); ui -> m_tbt_pb -> setMenu(m_tbt_menu);
connect(ui->m_tbt_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCurrentTitleBlockTemplate(int))); connect(ui->m_tbt_cb, SIGNAL(currentIndexChanged(int)), this, SLOT(changeCurrentTitleBlockTemplate(int)));
if (project!= NULL){
keys_2 = project -> folioAutoNum().keys();
foreach (QString str, keys_2) { ui -> auto_page_cb -> addItem(str); }
if (ui->auto_page_cb->currentText()==NULL)
ui->auto_page_cb->addItem("Create an Auto Folio Numbering");
}
else{
ui->auto_page_cb->hide();
ui->m_edit_autofolionum_pb->hide();
ui->label_9->hide();
}
} }
/** /**
@ -342,3 +396,15 @@ void TitleBlockPropertiesWidget::changeCurrentTitleBlockTemplate(int index)
void TitleBlockPropertiesWidget::on_m_date_now_pb_clicked() { void TitleBlockPropertiesWidget::on_m_date_now_pb_clicked() {
ui -> m_date_edit -> setDate(QDate::currentDate()); ui -> m_date_edit -> setDate(QDate::currentDate());
} }
/**
* @brief TitleBlockPropertiesWidget::on_m_edit_autofolionum_pb_clicked
* Open Auto Folio Num dialog
*/
void TitleBlockPropertiesWidget::on_m_edit_autofolionum_pb_clicked() {
emit openAutoNumFolioEditor(ui->auto_page_cb->currentText());
if (ui->auto_page_cb->currentText()!="Create an Auto Folio Numbering")
{
//still to implement: load current auto folio num settings
}
}

View File

@ -18,11 +18,15 @@
#ifndef TITLEBLOCKPROPERTIESWIDGET_H #ifndef TITLEBLOCKPROPERTIESWIDGET_H
#define TITLEBLOCKPROPERTIESWIDGET_H #define TITLEBLOCKPROPERTIESWIDGET_H
#include "qetproject.h"
#include <QWidget> #include <QWidget>
#include "titleblockproperties.h" #include "titleblockproperties.h"
#include "diagramcontextwidget.h" #include "diagramcontextwidget.h"
#include "qet.h" #include "qet.h"
#include "numerotationcontext.h"
class NumerotationContext;
class QETProject;
class QMenu; class QMenu;
class TitleBlockTemplatesCollection; class TitleBlockTemplatesCollection;
@ -35,13 +39,15 @@ class TitleBlockPropertiesWidget : public QWidget
Q_OBJECT Q_OBJECT
public: public:
explicit TitleBlockPropertiesWidget(const TitleBlockProperties &titleblock = TitleBlockProperties(), bool current_date = false, QWidget *parent = 0); explicit TitleBlockPropertiesWidget(const TitleBlockProperties &titleblock = TitleBlockProperties(), bool current_date = false, QETProject *project = NULL, QWidget *parent = 0);
explicit TitleBlockPropertiesWidget(TitleBlockTemplatesCollection *tbt_collection, const TitleBlockProperties &titleblock = TitleBlockProperties(), bool current_date = false, QWidget *parent = 0); explicit TitleBlockPropertiesWidget(TitleBlockTemplatesCollection *tbt_collection, const TitleBlockProperties &titleblock = TitleBlockProperties(), bool current_date = false, QETProject *project = NULL, QWidget *parent = 0);
explicit TitleBlockPropertiesWidget(QList <TitleBlockTemplatesCollection *> tbt_collection, const TitleBlockProperties &titleblock = TitleBlockProperties(), bool current_date = false, QWidget *parent = 0); explicit TitleBlockPropertiesWidget(QList <TitleBlockTemplatesCollection *> tbt_collection, const TitleBlockProperties &titleblock = TitleBlockProperties(), bool current_date = false, QETProject *project = NULL, QWidget *parent = 0);
~TitleBlockPropertiesWidget(); ~TitleBlockPropertiesWidget();
void setProperties(const TitleBlockProperties &properties); void setProperties(const TitleBlockProperties &properties);
TitleBlockProperties properties() const; TitleBlockProperties properties() const;
TitleBlockProperties propertiesAutoNum(QString autoNum) const;
void setPropertiesWithAutoNum(const TitleBlockProperties &properties, QString autoNum);
void setTitleBlockTemplatesVisible(const bool &visible); void setTitleBlockTemplatesVisible(const bool &visible);
void setReadOnly (const bool &ro); void setReadOnly (const bool &ro);
@ -49,7 +55,7 @@ class TitleBlockPropertiesWidget : public QWidget
private: private:
void addCollection (TitleBlockTemplatesCollection *tbt_collection); void addCollection (TitleBlockTemplatesCollection *tbt_collection);
QString currentTitleBlockTemplateName () const; QString currentTitleBlockTemplateName () const;
void initDialog(const bool &current_date); void initDialog(const bool &current_date, QETProject *project);
int getIndexFor (const QString &tbt_name, const QET::QetCollection collection) const; int getIndexFor (const QString &tbt_name, const QET::QetCollection collection) const;
private slots: private slots:
@ -58,9 +64,12 @@ class TitleBlockPropertiesWidget : public QWidget
void updateTemplateList(); void updateTemplateList();
void changeCurrentTitleBlockTemplate(int); void changeCurrentTitleBlockTemplate(int);
void on_m_date_now_pb_clicked(); void on_m_date_now_pb_clicked();
void on_m_edit_autofolionum_pb_clicked();
signals: signals:
void editTitleBlockTemplate(const QString &, bool); void editTitleBlockTemplate(const QString &, bool);
void set_auto_page_num() const;
void openAutoNumFolioEditor (QString);
private: private:
Ui::TitleBlockPropertiesWidget *ui; Ui::TitleBlockPropertiesWidget *ui;
@ -69,6 +78,7 @@ class TitleBlockPropertiesWidget : public QWidget
QMenu *m_tbt_menu; QMenu *m_tbt_menu;
QList <TitleBlockTemplatesCollection *> m_tbt_collection_list; QList <TitleBlockTemplatesCollection *> m_tbt_collection_list;
QList <QET::QetCollection> m_map_index_to_collection_type; QList <QET::QetCollection> m_map_index_to_collection_type;
QList <QString> keys_2;
}; };
#endif // TITLEBLOCKPROPERTIESWIDGET_H #endif // TITLEBLOCKPROPERTIESWIDGET_H

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>530</width> <width>572</width>
<height>452</height> <height>590</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -33,256 +33,316 @@
<number>9</number> <number>9</number>
</property> </property>
<item> <item>
<widget class="QGroupBox" name="m_tbt_gb"> <widget class="QScrollArea" name="scrollArea">
<property name="title"> <property name="widgetResizable">
<string>Informations des cartouches</string> <bool>true</bool>
</property> </property>
<property name="checkable"> <widget class="QWidget" name="scrollAreaWidgetContents_1">
<bool>false</bool> <property name="geometry">
</property> <rect>
<property name="checked"> <x>0</x>
<bool>false</bool> <y>0</y>
</property> <width>552</width>
<layout class="QVBoxLayout" name="verticalLayout_3"> <height>570</height>
<item> </rect>
<layout class="QHBoxLayout" name="m_tbt_hlayout" stretch="0,1,0"> </property>
<property name="sizeConstraint"> <layout class="QVBoxLayout" name="verticalLayout_5">
<enum>QLayout::SetDefaultConstraint</enum> <item>
</property> <widget class="QGroupBox" name="m_tbt_gb">
<item> <property name="title">
<widget class="QLabel" name="m_tbt_label"> <string>Informations des cartouches</string>
<property name="text"> </property>
<string>Modèle :</string> <property name="checkable">
</property> <bool>false</bool>
</widget> </property>
</item> <property name="checked">
<item> <bool>false</bool>
<widget class="QComboBox" name="m_tbt_cb"/> </property>
</item> <layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QPushButton" name="m_tbt_pb">
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/16x16/label.png</normaloff>:/ico/16x16/label.png</iconset>
</property>
<property name="flat">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="tabPosition">
<enum>QTabWidget::South</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="elideMode">
<enum>Qt::ElideNone</enum>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
</property>
<property name="tabsClosable">
<bool>false</bool>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Principales</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item> <item>
<layout class="QGridLayout" name="gridLayout_4"> <layout class="QHBoxLayout" name="m_tbt_hlayout" stretch="0,1,0">
<item row="5" column="2"> <property name="sizeConstraint">
<widget class="QLineEdit" name="m_folio_le"> <enum>QLayout::SetDefaultConstraint</enum>
<property name="toolTip"> </property>
<string>Disponible en tant que %folio pour les modèles de cartouches</string> <item>
<widget class="QLabel" name="m_tbt_label">
<property name="text">
<string>Modèle :</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1"> <item>
<widget class="QLabel" name="label_3"> <widget class="QComboBox" name="m_tbt_cb"/>
<property name="text">
<string>Auteur :</string>
</property>
</widget>
</item> </item>
<item row="7" column="1"> <item>
<widget class="QLabel" name="label"> <widget class="QPushButton" name="m_tbt_pb">
<property name="text"> <property name="text">
<string>Afficher :</string> <string/>
</property> </property>
</widget> <property name="icon">
</item> <iconset resource="../../qelectrotech.qrc">
<item row="6" column="2"> <normaloff>:/ico/16x16/label.png</normaloff>:/ico/16x16/label.png</iconset>
<widget class="QLabel" name="label_7">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property> </property>
<property name="text"> <property name="flat">
<string>Les variables suivantes sont utilisables dans le champ Folio :
- %id : numéro du folio courant dans le projet
- %total : nombre total de folios dans le projet</string>
</property>
<property name="scaledContents">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="3" column="2">
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1,0">
<item row="0" column="0">
<widget class="QRadioButton" name="m_no_date_rb">
<property name="text">
<string>Pas de date</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="m_current_date_rb">
<property name="text">
<string>Date courante</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="m_date_now_pb">
<property name="toolTip">
<string>Appliquer la date actuelle</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/start.png</normaloff>:/ico/22x22/start.png</iconset>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDateEdit" name="m_date_edit">
<property name="toolTip">
<string>Disponible en tant que %date pour les modèles de cartouches</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="calendarPopup">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="m_fixed_date_rb">
<property name="text">
<string>Date fixe :</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Date :</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Fichier :</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="m_title_le">
<property name="toolTip">
<string>Disponible en tant que %title pour les modèles de cartouches</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Titre :</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="m_author_le">
<property name="toolTip">
<string>Disponible en tant que %author pour les modèles de cartouches</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Folio :</string>
</property>
</widget>
</item>
<item row="4" column="2">
<widget class="QLineEdit" name="m_file_le">
<property name="toolTip">
<string>Disponible en tant que %filename pour les modèles de cartouches</string>
</property>
</widget>
</item>
<item row="7" column="2">
<widget class="QComboBox" name="m_display_at_cb">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Affiche le cartouche en bas (horizontalement) ou à droite (verticalement) du folio.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>en bas</string>
</property>
</item>
<item>
<property name="text">
<string>à droite (expérimental)</string>
</property>
</item>
</widget> </widget>
</item> </item>
</layout> </layout>
</item> </item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Personnalisées</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<layout class="QVBoxLayout" name="m_tab2_vlayout"> <widget class="QTabWidget" name="tabWidget">
<item> <property name="sizePolicy">
<widget class="QLabel" name="label_8"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<property name="text"> <horstretch>0</horstretch>
<string>Vous pouvez définir ici vos propres associations noms/valeurs pour que le cartouche en tienne compte. Exemple : <verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="tabPosition">
<enum>QTabWidget::South</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="elideMode">
<enum>Qt::ElideNone</enum>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
</property>
<property name="tabsClosable">
<bool>false</bool>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Principales</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout_4">
<item row="4" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Fichier :</string>
</property>
</widget>
</item>
<item row="6" column="2">
<widget class="QLabel" name="label_7">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="text">
<string>Les variables suivantes sont utilisables dans le champ Folio :
- %id : numéro du folio courant dans le projet
- %total : nombre total de folios dans le projet
- %autonum : Folio Auto Numeration</string>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Date :</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Folio :</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Titre :</string>
</property>
</widget>
</item>
<item row="5" column="2">
<widget class="QLineEdit" name="m_folio_le">
<property name="toolTip">
<string>Disponible en tant que %folio pour les modèles de cartouches</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLineEdit" name="m_title_le">
<property name="toolTip">
<string>Disponible en tant que %title pour les modèles de cartouches</string>
</property>
</widget>
</item>
<item row="8" column="2">
<widget class="QComboBox" name="m_display_at_cb">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Affiche le cartouche en bas (horizontalement) ou à droite (verticalement) du folio.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<item>
<property name="text">
<string>en bas</string>
</property>
</item>
<item>
<property name="text">
<string>à droite (expérimental)</string>
</property>
</item>
</widget>
</item>
<item row="4" column="2">
<widget class="QLineEdit" name="m_file_le">
<property name="toolTip">
<string>Disponible en tant que %filename pour les modèles de cartouches</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Auteur :</string>
</property>
</widget>
</item>
<item row="3" column="2">
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,1,0">
<item row="0" column="0">
<widget class="QRadioButton" name="m_no_date_rb">
<property name="text">
<string>Pas de date</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QRadioButton" name="m_current_date_rb">
<property name="text">
<string>Date courante</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="m_date_now_pb">
<property name="toolTip">
<string>Appliquer la date actuelle</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/22x22/start.png</normaloff>:/ico/22x22/start.png</iconset>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDateEdit" name="m_date_edit">
<property name="toolTip">
<string>Disponible en tant que %date pour les modèles de cartouches</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="calendarPopup">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QRadioButton" name="m_fixed_date_rb">
<property name="text">
<string>Date fixe :</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="2">
<widget class="QLineEdit" name="m_author_le">
<property name="toolTip">
<string>Disponible en tant que %author pour les modèles de cartouches</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="label">
<property name="text">
<string>Afficher :</string>
</property>
</widget>
</item>
<item row="7" column="2">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QComboBox" name="auto_page_cb">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="m_edit_autofolionum_pb">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>16</width>
<height>16</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../qelectrotech.qrc">
<normaloff>:/ico/16x16/configure.png</normaloff>:/ico/16x16/configure.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item row="7" column="1">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Page Num:</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Personnalisées</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QVBoxLayout" name="m_tab2_vlayout">
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>Vous pouvez définir ici vos propres associations noms/valeurs pour que le cartouche en tienne compte. Exemple :
associer le nom &quot;volta&quot; et la valeur &quot;1745&quot; remplacera %{volta} par 1745 dans le cartouche.</string> associer le nom &quot;volta&quot; et la valeur &quot;1745&quot; remplacera %{volta} par 1745 dans le cartouche.</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
@ -300,6 +360,10 @@ associer le nom &quot;volta&quot; et la valeur &quot;1745&quot; remplacera %{vol
</widget> </widget>
</item> </item>
</layout> </layout>
</widget>
</widget>
</item>
</layout>
</widget> </widget>
<resources> <resources>
<include location="../../qelectrotech.qrc"/> <include location="../../qelectrotech.qrc"/>