[qet] [4563] Element autonumbering.

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 4563
Author:   dfochi
Date:     2016-07-05 22:14:14 +0200 (Tue, 05 Jul 2016)
Log Message:
-----------
Element autonumbering. New tab inside autonumbering menu to assign formulas to element label. XML containing elements labels according ISO/IEC 81346 (./elements/10_electric/qet_labels.xml

Modified Paths:
--------------
    trunk/sources/ElementsCollection/elementslocation.cpp
    trunk/sources/ElementsCollection/elementslocation.h
    trunk/sources/bordertitleblock.h
    trunk/sources/diagram.cpp
    trunk/sources/diagramcommands.cpp
    trunk/sources/projectconfigpages.cpp
    trunk/sources/projectconfigpages.h
    trunk/sources/qetgraphicsitem/customelement.cpp
    trunk/sources/qetgraphicsitem/customelement.h
    trunk/sources/qetgraphicsitem/element.cpp
    trunk/sources/qetgraphicsitem/element.h
    trunk/sources/qetgraphicsitem/elementtextitem.cpp
    trunk/sources/qetgraphicsitem/masterelement.cpp
    trunk/sources/qetgraphicsitem/reportelement.cpp
    trunk/sources/qetgraphicsitem/simpleelement.cpp
    trunk/sources/qetgraphicsitem/slaveelement.cpp
    trunk/sources/qetproject.cpp
    trunk/sources/qetproject.h
    trunk/sources/ui/folioautonumbering.cpp
    trunk/sources/ui/folioautonumbering.h
    trunk/sources/ui/numparteditorw.cpp
    trunk/sources/ui/numparteditorw.h
    trunk/sources/ui/projectpropertiesdialog.cpp

Added Paths:
-----------
    trunk/elements/10_electric/qet_labels.xml
    trunk/sources/ui/elementautonumberingw.cpp
    trunk/sources/ui/elementautonumberingw.h
    trunk/sources/ui/elementautonumberingw.ui

Added: trunk/elements/10_electric/qet_labels.xml
===================================================================
--- trunk/elements/10_electric/qet_labels.xml	                        (rev 0)
+++ trunk/elements/10_electric/qet_labels.xml	2016-07-05 20:14:14 UTC (rev 4563)
@@ -0,0 +1,576 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--This xml is used for retrieving elements default labels according to ISO/IEC 81346-12
+    A prefix is assigned for each directory. Every element inside that directory
+    will be assigned the directory prefix unless it has a text with tag "label"
+    different than "_" inside its .elmt file. If a directory does not have a prefix the
+    element will assign its parent directory prefix and so on.
+    Prefix tag MUST be located AFTER its child categorys
+    Example:
+    <category name="310_relays_contactors&amp;contacts">
+      <category name="01_coils">
+        <prefix>K</prefix>
+      </category>
+      <category name="02_contacts_cross_referencing">
+        <category name="01_auxiliary_contacts"></category>
+        <category name="02_power_contacts"></category>
+        <category name="11_delayed_contacts"></category>
+        <category name="15_protection_contacts"></category>
+        <prefix>S</prefix>
+      </category>
+    Every Coil will be assigned "K" as a label
+    Auxiliary, power, delayed and protection contacts will be assigned "S" as a label.
+-->
+<labels>
+  <category name="10_allpole">
+    <category name="100_sheet_referencing"></category>
+    <category name="110_network_supplies"></category>
+    <category name="114_connections"></category>
+    <category name="120_cables&amp;wiring"></category>
+    <category name="130_terminals&amp;terminal_strips">
+      <category name="90_terminal_strips_diagram"></category>
+      <prefix>X</prefix>
+    </category>
+    <category name="140_connectors&amp;plugs">
+      <category name="01_connectors_pins"></category>
+      <category name="10_connectors_circular"></category>
+      <category name="15_connectors_dsub"></category>
+      <category name="20_socket_outlets"></category>
+      <category name="60_connectors_electronics"></category>
+      <prefix>X</prefix>
+    </category>
+    <category name="200_fuses&amp;protective_gears">
+      <category name="10_fuses">
+        <prefix>F</prefix>
+      </category>
+      <category name="11_circuit_breakers">
+        <prefix>F</prefix>
+      </category>
+      <category name="12_magneto_thermal_circuit_breakers">
+        <prefix>Q</prefix>
+      </category>
+      <category name="20_disconnecting_switches">
+        <prefix>Q</prefix>
+      </category>
+      <category name="30_thermal_relays">
+        <prefix>F</prefix>
+      </category>
+      <category name="50_residual_current_circuit_breaker">
+        <prefix>Q</prefix>
+      </category>
+      <category name="90_overvoltage_protections">
+        <prefix>F</prefix>
+      </category>
+    </category>
+    <category name="310_relays_contactors&amp;contacts">
+      <category name="01_coils">
+        <prefix>K</prefix>
+      </category>
+      <category name="02_contacts_cross_referencing">
+        <category name="01_auxiliary_contacts"></category>
+        <category name="02_power_contacts"></category>
+        <category name="11_delayed_contacts"></category>
+        <category name="15_protection_contacts"></category>
+        <prefix>S</prefix>
+      </category>
+      <category name="03_contacts">
+        <prefix>S</prefix>
+      </category>
+    </category>
+    <category name="330_transformers&amp;power_supplies">
+      <category name="10_transformers">
+        <prefix>T</prefix>
+      </category>
+      <category name="30_power_supplies">
+        <prefix>G</prefix>
+      </category>
+      <category name="40_uninterruptible_power_supply">
+        <prefix>RB</prefix>
+      </category>
+    </category>
+    <category name="340_converters&amp;inverters">
+      <category name="10_converters">
+        <prefix>T</prefix>
+      </category>
+      <category name="15_measuring_transducers"></category>
+      <category name="20_current_tansformers">
+        <prefix>L</prefix>
+      </category>
+      <category name="90_filters">
+        <prefix>KF</prefix>
+      </category>
+    </category>
+    <category name="380_signaling&amp;operating">
+      <category name="01_human_machine_interface"></category>
+      <category name="11_optical_signaling">
+        <prefix>H</prefix>
+      </category>
+      <category name="12_acoustic_signaling">
+        <prefix>H</prefix>
+      </category>
+      <category name="20_push_buttons">
+        <prefix>S</prefix>
+      </category>
+      <category name="21_selector_switches">
+        <prefix>S</prefix>
+      </category>
+      <category name="25_lever_switches">
+        <prefix>S</prefix>
+      </category>
+    </category>
+    <category name="390_sensors&amp;instruments">
+      <category name="01_sensors_capacitive"></category>
+      <category name="02_sensors_inductive"></category>
+      <category name="03_sensors_magnetic"></category>
+      <category name="04_sensors_optical"></category>
+      <category name="11_sensors_flow"></category>
+      <category name="12_sensors_level"></category>
+      <category name="13_sensors_pressure"></category>
+      <category name="14_sensors_humidity"></category>
+      <category name="15_sensors_temperature"></category>
+      <category name="16_sensors_ultrasonic"></category>
+      <category name="41_limit_switches">
+        <prefix>S</prefix>
+      </category>
+      <category name="60_timers">
+        <prefix>H</prefix>
+      </category>
+      <category name="70_meters&amp;measuring_indicators"></category>
+      <prefix>P</prefix>
+    </category>
+    <category name="391_consumers&amp;actuators">
+      <category name="10_engines">
+        <prefix>M</prefix>
+      </category>
+      <category name="20_valves">
+        <prefix>Y</prefix>
+      </category>
+      <category name="30_brakes">
+        <prefix>YB</prefix>
+      </category>
+      <category name="50_heatings">
+        <prefix>R</prefix>
+      </category>
+      <category name="60_lightings">
+        <prefix>EH</prefix>
+      </category>
+    </category>
+    <category name="392_generators&amp;sources">
+      <category name="10_generators">
+        <prefix>B</prefix>
+      </category>
+      <category name="20_power_units"></category>
+      <category name="30_batteries"></category>
+      <category name="70_voltage_current_sources">
+        <prefix>B</prefix>
+      </category>
+    </category>
+    <category name="395_electronics&amp;semiconductors">
+      <category name="01_resistors">
+        <prefix>R</prefix>
+      </category>
+      <category name="02_capacitors">
+        <prefix>C</prefix>
+      </category>
+      <category name="03_inductors">
+        <prefix>L</prefix>
+      </category>
+      <category name="09_disturbances"></category>
+      <category name="11_diodes">
+        <prefix>V</prefix>
+      </category>
+      <category name="12_transistors"></category>
+      <category name="13_thyristors"></category>
+      <category name="24piezo"></category>
+      <category name="31_integrated_circuits"></category>
+      <category name="41_PLC&amp;controllers"></category>
+      <category name="91_computer_science"></category>
+    </category>
+    <category name="450_high_voltage"></category>
+  </category>
+  <category name="11_singlepole">
+    <category name="140_connectors&amp;plugs">
+      <prefix>X</prefix>
+    </category>
+    <category name="200_fuses&amp;protective_gears">
+      <category name="10_fuses">
+        <prefix>F</prefix>
+      </category>
+      <category name="11_circuit_breakers">
+        <prefix>F</prefix>
+      </category>
+      <category name="12_magneto_thermal_circuit_breakers">
+        <prefix>Q</prefix>
+      </category>
+      <category name="20_disconnecting_switches">
+        <prefix>Q</prefix>
+      </category>
+      <category name="30_thermal_relays">
+        <prefix>F</prefix>
+      </category>
+      <category name="50_residual_current_circuit_breaker">
+        <prefix>Q</prefix>
+      </category>
+    </category>
+    <category name="330_transformers&amp;power_supplies">
+      <category name="10_transformers">
+        <prefix>T</prefix>
+      </category>
+      <category name="20_current_tansformers">
+        <prefix>L</prefix>
+      </category>
+    </category>
+    <category name="340_converters&amp;inverters">
+      <category name="10_converters">
+        <prefix>T</prefix>
+      </category>
+    </category>
+    <category name="392_generators&amp;sources">
+      <category name="10_generators"></category>
+    </category>
+    <category name="395_electronics&amp;semiconductors">
+      <category name="10_resistors">
+        <prefix>R</prefix>
+      </category>
+      <category name="20_capacitors">
+        <prefix>C</prefix>
+      </category>
+      <category name="30_inductors">
+        <prefix>L</prefix>
+      </category>
+    </category>
+    <category name="500_home_installation">
+      <category name="20_home_appliances"></category>
+      <category name="30_architectural"></category>
+      <category name="40_meters"></category>
+    </category>
+  </category>
+  <category name="20_manufacturers_articles">
+    <category name="abb">
+      <category name="20_frequency_drives"></category>
+    </category>
+    <category name="allen_bradley">
+      <category name="01_PLC&amp;controllers"></category>
+      <category name="09_safety_modules">
+        <category name="10_delayed_outputs"></category>
+      </category>
+      <category name="11_safety_switches"></category>
+      <category name="20_frequency_drives"></category>
+    </category>
+    <category name="april">
+      <category name="5000"></category>
+    </category>
+    <category name="arduino"></category>
+    <category name="aucom">
+      <category name="10_softstarter"></category>
+    </category>
+    <category name="balluff">
+      <category name="02_sensors_inductive"></category>
+      <category name="04_sensors_optical"></category>
+      <category name="51_transformers&amp;power_supply"></category>
+    </category>
+    <category name="bamo"></category>
+    <category name="becker"></category>
+    <category name="beckhoff">
+      <category name="80building_management"></category>
+    </category>
+    <category name="beka"></category>
+    <category name="bosch_rexroth"></category>
+    <category name="bti">
+      <category name="11_safety_switches"></category>
+    </category>
+    <category name="bwo">
+      <category name="09_vektor_c"></category>
+      <category name="10_vio64"></category>
+    </category>
+    <category name="campbell"></category>
+    <category name="chauvin_arnoux"></category>
+    <category name="citec">
+      <category name="06_sensors_pressure"></category>
+    </category>
+    <category name="crouzet">
+      <category name="01_PLC&amp;controllers"></category>
+    </category>
+    <category name="danfoss">
+      <category name="10_softstarter"></category>
+      <category name="20_frequency_drives"></category>
+    </category>
+    <category name="dold"></category>
+    <category name="eaton_moeller">
+      <category name="01_PLC&amp;controllers"></category>
+      <category name="200_fuses&amp;protective_gears">
+        <category name="11_circuit_breakers"></category>
+        <category name="12_magneto_thermal_circuit_breakers"></category>
+        <category name="20_disconnecting_switches"></category>
+      </category>
+    </category>
+    <category name="eliwel"></category>
+    <category name="endress_hauser"></category>
+    <category name="euchner">
+      <category name="09_safety_modules"></category>
+      <category name="11_safety_switches"></category>
+    </category>
+    <category name="eurotherm">
+      <category name="10_softstarters"></category>
+    </category>
+    <category name="festo"></category>
+    <category name="finder">
+      <category name="99_assembly_plan"></category>
+    </category>
+    <category name="fuji_electric">
+      <category name="20_frequency_drives"></category>
+    </category>
+    <category name="gce"></category>
+    <category name="geindustrial">
+      <category name="10_sofstarters"></category>
+    </category>
+    <category name="guitar">
+      <category name="capacitors"></category>
+      <category name="ouputjacks"></category>
+      <category name="pickups"></category>
+      <category name="potentiometers"></category>
+      <category name="special_purpose"></category>
+      <category name="switches"></category>
+    </category>
+    <category name="hiquel">
+      <category name="99_assembly_plan"></category>
+    </category>
+    <category name="ifm">
+      <category name="06_sensors_pressure"></category>
+      <category name="10_connection_technology"></category>
+    </category>
+    <category name="johnson_controls">
+      <category name="dx">
+        <category name="modules_extension"></category>
+      </category>
+    </category>
+    <category name="jumo"></category>
+    <category name="keyence">
+      <category name="100_safety_light_curtain"></category>
+    </category>
+    <category name="knx">
+      <category name="actionneur"></category>
+      <category name="capteurs"></category>
+      <category name="divers"></category>
+      <category name="poussoirs"></category>
+      <category name="powersupplies"></category>
+      <category name="recepteurs"></category>
+      <category name="transmetteurs"></category>
+    </category>
+    <category name="leroy_somer">
+      <category name="20_frequency_drives"></category>
+    </category>
+    <category name="leuze">
+      <category name="09_safety_modules"></category>
+    </category>
+    <category name="litecom"></category>
+    <category name="murr_elektronik">
+      <category name="370_fuses&amp;protective_gears"></category>
+    </category>
+    <category name="national_instrument">
+      <category name="01_PLC&amp;controllers">
+        <category name="crio"></category>
+      </category>
+    </category>
+    <category name="network"></category>
+    <category name="omron">
+      <category name="01_PLC&amp;controllers">
+        <category name="cj1">
+          <category name="taille1"></category>
+          <category name="taille2"></category>
+        </category>
+        <category name="cj2"></category>
+        <category name="cqm1">
+          <category name="taille1"></category>
+          <category name="taille2"></category>
+        </category>
+      </category>
+      <category name="03_relays"></category>
+      <category name="09_safety_modules"></category>
+      <category name="20_frequency_drives"></category>
+      <category name="99_assembly_plan"></category>
+    </category>
+    <category name="parker"></category>
+    <category name="perske"></category>
+    <category name="phoenix_contact"></category>
+    <category name="pic"></category>
+    <category name="pilz">
+      <category name="09_safety_modules">
+        <category name="pnoz"></category>
+      </category>
+      <category name="15_safety_switches">
+        <category name="psen"></category>
+      </category>
+    </category>
+    <category name="pro-face"></category>
+    <category name="raspberry"></category>
+    <category name="rittal"></category>
+    <category name="rockwell">
+      <category name="10_softstarters"></category>
+    </category>
+    <category name="satchwell"></category>
+    <category name="schaffner">
+      <category name="99_assembly_plan"></category>
+    </category>
+    <category name="schmersal"></category>
+    <category name="schneider_electric">
+      <category name="01_PLC&amp;controllers">
+        <category name="241"></category>
+        <category name="extension_tm3">
+          <category name="ana"></category>
+          <category name="tor"></category>
+        </category>
+        <category name="m221"></category>
+        <category name="m251"></category>
+        <category name="m340"></category>
+        <category name="magelis"></category>
+        <category name="telefast"></category>
+        <category name="tsx">
+          <category name="config"></category>
+          <category name="input"></category>
+          <category name="output"></category>
+        </category>
+        <category name="twido">
+          <category name="e-s_ana"></category>
+        </category>
+        <category name="zelio"></category>
+      </category>
+      <category name="08_control_relays"></category>
+      <category name="09_motor_starters"></category>
+      <category name="10_softstarter"></category>
+      <category name="20_frequency_drives"></category>
+      <category name="81_safety_switches"></category>
+      <category name="90_TAC_Xenta">
+        <category name="boitier_mural"></category>
+        <category name="ecran"></category>
+        <category name="module_ai"></category>
+        <category name="module_ao"></category>
+        <category name="module_di"></category>
+        <category name="module_repetiteur"></category>
+        <category name="module_serveur_web"></category>
+        <category name="module_ui_ao"></category>
+        <category name="module_ui_tor"></category>
+        <category name="peripheriques"></category>
+        <category name="regulateurs"></category>
+      </category>
+      <category name="99_assembly_plan"></category>
+      <category name="preventa">
+        <category name="09_safety_modules"></category>
+      </category>
+    </category>
+    <category name="sew">
+      <category name="20_frequency_drives"></category>
+    </category>
+    <category name="sfere"></category>
+    <category name="sick">
+      <category name="008_safety_controllers"></category>
+      <category name="009_safety_modules"></category>
+      <category name="100_safety_light_curtain"></category>
+      <category name="101_safety_switches"></category>
+    </category>
+    <category name="siemens">
+      <category name="01_PLC&amp;controllers">
+        <category name="6es5">
+          <category name="6es5_95"></category>
+          <category name="carte_entree"></category>
+          <category name="carte_sortie"></category>
+          <category name="cpu"></category>
+        </category>
+        <category name="6es7">
+          <category name="alimentations"></category>
+          <category name="cartes_ana_entree"></category>
+          <category name="cartes_ana_entree_sortie"></category>
+          <category name="cartes_ana_sortie"></category>
+          <category name="cartes_entree"></category>
+          <category name="cartes_sortie"></category>
+        </category>
+        <category name="6es7-1200">
+          <category name="communication_cards"></category>
+          <category name="cpu"></category>
+          <category name="digital_inputs_cards"></category>
+          <category name="digital_inputs-outputs_cards"></category>
+        </category>
+        <category name="6es7-200"></category>
+        <category name="6es7-312"></category>
+        <category name="6es7-313"></category>
+        <category name="6se7-300"></category>
+        <category name="config"></category>
+        <category name="cp_343-2"></category>
+        <category name="et200s">
+          <category name="cards_and_modules"></category>
+          <category name="channels"></category>
+          <category name="io_overviews"></category>
+          <category name="power_supply"></category>
+        </category>
+        <category name="interface_modules"></category>
+        <category name="logo"></category>
+        <category name="s7_300">
+          <category name="cards_and_modules"></category>
+          <category name="channels"></category>
+          <category name="io_overviews"></category>
+        </category>
+        <category name="sinumerik"></category>
+      </category>
+      <category name="02_human_machine_interface">
+        <category name="terminal_operateur"></category>
+      </category>
+      <category name="10_softstarter"></category>
+      <category name="20_frequency_drives"></category>
+      <category name="23_sinamics_drives"></category>
+      <category name="71_asynchronous_motors"></category>
+      <category name="73_servo_motors"></category>
+      <category name="80_building_management"></category>
+    </category>
+    <category name="sofrel">
+      <category name="01_PLC&amp;controllers">
+        <category name="s500"></category>
+      </category>
+    </category>
+    <category name="telemecanique">
+      <category name="20_frequency_drives"></category>
+    </category>
+    <category name="unitronics_plc"></category>
+    <category name="vega"></category>
+    <category name="vipa"></category>
+    <category name="wago">
+      <category name="01_PLC&amp;controllers"></category>
+    </category>
+    <category name="west"></category>
+    <category name="wit"></category>
+  </category>
+  <category name="90_american_standards">
+    <category name="15_allpole">
+      <category name="140_connectors&amp;plugs">
+        <category name="01_connectors_pins"></category>
+      </category>
+      <category name="200_fuses&amp;protective_gears">
+        <category name="11_circuit_breakers"></category>
+      </category>
+    </category>
+    <category name="16_singlepole"></category>
+  </category>
+  <category name="98_graphics">
+    <category name="01_auxiliary_symbols">
+      <category name="01_cross_ref_symbols">
+        <category name="01_with_linking_function">
+          <category name="01_parents"></category>
+          <category name="02_children"></category>
+        </category>
+        <category name="02_without_linking_function"></category>
+      </category>
+      <category name="20_switch_positions"></category>
+    </category>
+    <category name="11_tags&amp;comments"></category>
+    <category name="21_forms&amp;tabs"></category>
+    <category name="99_assembly_plan">
+      <category name="01_thumbnails_mounting_plate"></category>
+      <category name="21_signaling&amp;operating">
+        <category name="21_size_2x2"></category>
+        <category name="31_size_4x4"></category>
+      </category>
+    </category>
+  </category>
+  <category name="99_miscellaneous&amp;unsorted"></category>
+  <report>
+    <directories>361</directories>
+  </report>
+</labels>

Modified: trunk/sources/ElementsCollection/elementslocation.cpp
===================================================================
--- trunk/sources/ElementsCollection/elementslocation.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/ElementsCollection/elementslocation.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -125,6 +125,16 @@
 }
 
 /**
+ * @brief ElementsLocation::projectId
+ * This method is used to know if an element belongs to
+ * a project or not.
+ * @return Element Project Id
+ */
+int ElementsLocation::projectId() const {
+	return QETApp::projectId(m_project);
+}
+
+/**
  * @brief ElementsLocation::collectionPath
  * Return the path of the represented element relative to collection
  * if @protocol is true the path is prepended by the collection type (common://, custom:// or embed://)

Modified: trunk/sources/ElementsCollection/elementslocation.h
===================================================================
--- trunk/sources/ElementsCollection/elementslocation.h	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/ElementsCollection/elementslocation.h	2016-07-05 20:14:14 UTC (rev 4563)
@@ -44,6 +44,7 @@
 	
 	public:
 		QString baseName() const;
+		int projectId() const;
 
 		QString collectionPath(bool protocol = true) const;
 		QString projectCollectionPath() const;

Modified: trunk/sources/bordertitleblock.h
===================================================================
--- trunk/sources/bordertitleblock.h	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/bordertitleblock.h	2016-07-05 20:14:14 UTC (rev 4563)
@@ -101,7 +101,9 @@
 	DiagramContext additionalFields() const { return (additional_fields_); }
 	/// @return the value of the title block
 	QString autoPageNum() const { return(btb_auto_page_num_); }
-	
+	/// @return the value of the total number of folios
+	int folioTotal() const { return(folio_total_);}
+
 	// methods to get display options
 	/// @return true si le cartouche est affiche, false sinon
 	bool titleBlockIsDisplayed() const { return(display_titleblock_); }

Modified: trunk/sources/diagram.cpp
===================================================================
--- trunk/sources/diagram.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/diagram.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -855,9 +855,19 @@
 	{
 		case Element::Type:
 		{
-			const Element *elmt = static_cast<const Element*>(item);
+			Element *elmt = static_cast<Element*>(item);
 			foreach(ElementTextItem *eti, elmt->texts())
 				connect (eti, &ElementTextItem::diagramTextChanged, this, &Diagram::diagramTextChanged);
+			Element::kind linkType = elmt->linkType();
+			if ((linkType == Element::Simple) ||
+				(linkType == Element::Master) ||
+				(linkType == Element::Slave)  ||
+				(linkType == Element::Terminale)) {
+				CustomElement *celmt = static_cast<CustomElement*>(item);
+				celmt->parseLabels();
+			}
+
+			elmt->updateLabel();
 		}
 			break;
 

Modified: trunk/sources/diagramcommands.cpp
===================================================================
--- trunk/sources/diagramcommands.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/diagramcommands.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -190,7 +190,7 @@
 
 				//Reset the text field tagged "label
 				if (ElementTextItem *eti = e ->taggedText("label"))
-					eti -> setPlainText("_");
+				eti -> setPlainText("_");
 			}
 		}
 

Modified: trunk/sources/projectconfigpages.cpp
===================================================================
--- trunk/sources/projectconfigpages.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/projectconfigpages.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -28,6 +28,7 @@
 #include "selectautonumw.h"
 #include "numerotationcontext.h"
 #include "folioautonumbering.h"
+#include "elementautonumberingw.h"
 /**
 	Constructor
 	@param project Project this page is editing.
@@ -269,6 +270,10 @@
 
 	m_saw = new SelectAutonumW(conductor_tab_widget);
 
+	//Element Tab
+	element_tab_widget = new QWidget(this);
+	m_eaw = new ElementAutonumberingW(element_tab_widget);
+
 	//Folio Tab
 	folio_tab_widget = new QWidget(this);
 	folio_tab_widget->setObjectName("FolioTab");
@@ -296,7 +301,7 @@
  */
 void ProjectAutoNumConfigPage::initLayout() {
 
-	//Conductor tab
+	//Conductor Tab
 	tab_widget->addTab(conductor_tab_widget, tr("Conductor"));
 
 	QHBoxLayout *context_layout = new QHBoxLayout();
@@ -312,6 +317,9 @@
 	main_layout->addLayout(aux_layout);
 	conductor_tab_widget -> setLayout (main_layout);
 
+	//Element Tab
+	tab_widget->addTab(element_tab_widget,tr ("Element"));
+
 	// Folio Tab
 	tab_widget->addTab(folio_tab_widget, tr("Folio"));
 
@@ -345,6 +353,10 @@
 	foreach (QString str, keys) { m_context_cb -> addItem(str); }
 	}
 
+	//Element Tab
+	if (!project_->elementAutoNum().isEmpty())
+		m_eaw->setContext(project_->elementAutoNum());
+
 	//Folio Tab
 	QList <QString> keys_2 = project_->folioAutoNum().keys();
 	if (!keys_2.isEmpty()){
@@ -375,6 +387,9 @@
 	connect (m_saw, SIGNAL (applyPressed()), this, SLOT (saveContext()));
 	connect (m_remove_pb, SIGNAL (clicked()), this, SLOT(removeContext()));
 
+	//Element Tab
+	connect (m_eaw, SIGNAL (applyPressed()), this, SLOT (saveContext_3()));
+
 	//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()));
@@ -449,6 +464,14 @@
 }
 
 /**
+ * @brief ProjectAutoNumConfigPage::saveContext_3
+ * Save the current displayed Element formula in project
+ */
+void ProjectAutoNumConfigPage::saveContext_3() {
+	project()->addElementAutoNum (m_eaw->formula());
+}
+
+/**
  * @brief ProjectAutoNumConfigPage::applyAutoNum
  * Apply auto folio numbering, New Folios or Selected Folios
  */
@@ -508,7 +531,7 @@
  */
 void ProjectAutoNumConfigPage::tabChanged(int i){
 	if (i>0){
-		if (tab_widget->currentIndex()==2){
+		if (tab_widget->currentIndex()==3){
 			tab_widget->resize(470,tab_widget->height());
 		}
 		else {

Modified: trunk/sources/projectconfigpages.h
===================================================================
--- trunk/sources/projectconfigpages.h	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/projectconfigpages.h	2016-07-05 20:14:14 UTC (rev 4563)
@@ -35,6 +35,7 @@
 class QComboBox;
 class QPushButton;
 class FolioAutonumberingW;
+class ElementAutonumberingW;
 
 /**
 	This class, derived from ConfigPage, aims at providing the basic skeleton
@@ -142,10 +143,11 @@
 	private slots:
 		void updateContext(QString);
 		void saveContext();
-		void removeContext();
+		void removeContext(); //conductor
 		void updateContext_2(QString);
-		void saveContext_2();
+		void saveContext_2(); //folio
 		void removeContext_2();
+		void saveContext_3(); //element
 
 		void applyAutoNum();
 
@@ -159,21 +161,22 @@
 
 	//Attributes
 	private:
-		QTabWidget          *tab_widget;
-		QWidget             *element_widget;
-		QWidget             *conductor_tab_widget;
-		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;
+		QTabWidget            *tab_widget;
+		QWidget               *conductor_tab_widget;
+		QWidget               *element_tab_widget;
+		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;
+		ElementAutonumberingW *m_eaw;
 
 };
 

Modified: trunk/sources/qetgraphicsitem/customelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/customelement.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/qetgraphicsitem/customelement.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -1,17 +1,17 @@
 /*
 	Copyright 2006-2016 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/>.
 */
@@ -23,6 +23,7 @@
 #include <iostream>
 #include "terminal.h"
 #include "diagramposition.h"
+#include "diagramcontent.h"
 
 /**
 	Constructeur de la classe CustomElement. Permet d'instancier un element
@@ -67,7 +68,7 @@
 	buildFromXml(location.xml(), &elmt_state);
 	if (state) *state = elmt_state;
 	if (elmt_state) return;
-	
+
 	if (state) *state = 0;
 }
 
@@ -86,13 +87,13 @@
 	@return true si le chargement a reussi, false sinon
 */
 bool CustomElement::buildFromXml(const QDomElement &xml_def_elmt, int *state) {
-	
+
 	if (xml_def_elmt.tagName() != "definition" || xml_def_elmt.attribute("type") != "element")
 	{
 		if (state) *state = 4;
 		return(false);
 	}
-	
+
 	// verifie basiquement que la version actuelle est capable de lire ce fichier
 	if (xml_def_elmt.hasAttribute("version")) {
 		bool conv_ok;
@@ -105,7 +106,7 @@
 			) << std::endl;
 		}
 	}
-	
+
 	// ces attributs doivent etre presents et valides
 	int w, h, hot_x, hot_y;
 	if (
@@ -118,35 +119,35 @@
 		if (state) *state = 5;
 		return(false);
 	}
-	
+
 	setSize(w, h);
 	setHotspot(QPoint(hot_x, hot_y));
-	
+
 		//the definition must have childs
 	if (xml_def_elmt.firstChild().isNull())
 	{
 		if (state) *state = 6;
 		return(false);
 	}
-	
+
 	// initialisation du QPainter (pour dessiner l'element)
 	QPainter qp;
 	qp.begin(&drawing);
-	
+
 	QPainter low_zoom_qp;
 	low_zoom_qp.begin(&low_zoom_drawing);
 	QPen tmp;
 	tmp.setWidthF(1.0); // ligne vaudou pour prise en compte du setCosmetic - ne pas enlever
 	tmp.setCosmetic(true);
 	low_zoom_qp.setPen(tmp);
-	
+
 	// extrait les noms de la definition XML
 	names.fromXml(xml_def_elmt);
 	setToolTip(name());
 
 	//load kind informations
 	kind_informations_.fromXml(xml_def_elmt.firstChildElement("kindInformations"), "kindInformation");
-	
+
 	// parcours des enfants de la definition : parties du dessin
 	int parsed_elements_count = 0;
 	for (QDomNode node = xml_def_elmt.firstChild() ; !node.isNull() ; node = node.nextSibling()) {
@@ -173,11 +174,11 @@
 			}
 		}
 	}
-	
+
 	// fin du dessin
 	qp.end();
 	low_zoom_qp.end();
-	
+
 	// il doit y avoir au moins un element charge
 	if (!parsed_elements_count) {
 		if (state) *state = 8;
@@ -264,6 +265,89 @@
 }
 
 /**
+	Retrieves the element label stored in file ./elements/ * /qet_labels.xml
+	The labels are applied to all elements inside a folder. If an element
+	has a specific label, it will be applied. See qet_labels.xml for more
+	instructions.
+*/
+void CustomElement::parseLabels() {
+	if ((this->taggedText("label")!= NULL) && (location().projectId()!=-1) && (this->taggedText("label")->toPlainText()=="_")) { //element is being added
+		QXmlStreamReader rxml;
+		QString path[10];
+		QString prefix;
+		int i = -1;
+		ElementsLocation current_location = location();
+		int dirLevel = -1;
+
+		//Add location name to path array
+		while(current_location.parent().name()!="Imported elements" ) {
+			i++;
+			path[i]=current_location.fileName();
+			current_location = current_location.parent();
+			dirLevel++;
+		}
+
+		// Only Electric labels created so far
+		if (current_location.name()!= "Electric") return;
+		QString qet_labels = "10_electric/qet_labels.xml";
+		QString filepath = QETApp::commonElementsDir().append(qet_labels);
+		QFile file(filepath);
+		file.isReadable();
+		if (!file.open(QFile::ReadOnly | QFile::Text)) return;
+		rxml.setDevice(&file);
+		rxml.readNext();
+
+		while(!rxml.atEnd()) {
+				if (rxml.attributes().value("name").toString() == path[i]) {
+					rxml.readNext();
+					i=i-1;
+					//reached element directory
+					if (i==0) {
+						for (int j=i; j<= dirLevel; j = j +1){
+							//if there is a prefix available apply prefix
+							if(rxml.name()=="prefix") {
+								prefix = rxml.readElementText();
+								DiagramContext &dc = this->rElementInformations();
+								//if there is a formula to assign, assign it
+								if (!location().project()->elementAutoNum().isEmpty() && this->linkType()!=Element::Slave) {
+									QString formula = location().project()->elementAutoNum();
+									formula.replace("%prefix", prefix);
+									dc.addValue("label", formula);
+									this->setTaggedText("label",formula);
+								} else { //assign only prefix
+									dc.addValue("label", prefix);
+									this->setTaggedText("label", prefix);
+								}
+								this->setElementInformations(dc);
+								return;
+							}
+							//if there isn't a prefix available, find parent prefix in parent folder
+							else {
+								while (rxml.readNextStartElement() && rxml.name()!="prefix") {
+									rxml.skipCurrentElement();
+									rxml.readNext();
+								}
+							}
+						}
+					}
+				}
+				rxml.readNext();
+		}
+	}
+	//apply formula to specific label
+	else if ((this->taggedText("label")!= NULL) && (location().projectId()!=-1) &&
+			 (!location().project()->elementAutoNum().isEmpty()) && (this->linkType()!=Element::Slave)) {
+		QString formula = location().project()->elementAutoNum();
+		DiagramContext &dc = this->rElementInformations();
+		QString prefix = this->taggedText("label")->toPlainText();
+		formula.replace("%prefix", prefix);
+		dc.addValue("label", formula);
+		this->setTaggedText("label",formula);
+		this->setElementInformations(dc);
+	}
+}
+
+/**
 	Analyse et prend en compte un element XML decrivant une partie du dessin
 	de l'element perso. Si l'analyse reussit, la partie est ajoutee au dessin.
 	Cette partie peut etre une borne, une ligne, une ellipse, un cercle, un arc
@@ -294,7 +378,7 @@
 	La ligne est definie par les attributs suivants :
 		- x1, y1 : reels, coordonnees d'une extremite de la ligne
 		- x2, y2 : reels, coordonnees de l'autre extremite de la ligne
-		
+
 	@param e L'element XML a analyser
 	@param qp Le QPainter a utiliser pour dessiner l'element perso
 	@return true si l'analyse reussit, false sinon
@@ -306,19 +390,19 @@
 	if (!QET::attributeIsAReal(e, QString("y1"), &y1)) return(false);
 	if (!QET::attributeIsAReal(e, QString("x2"), &x2)) return(false);
 	if (!QET::attributeIsAReal(e, QString("y2"), &y2)) return(false);
-	
+
 	Qet::EndType first_end = Qet::endTypeFromString(e.attribute("end1"));
 	Qet::EndType second_end = Qet::endTypeFromString(e.attribute("end2"));
 	qreal length1, length2;
 	if (!QET::attributeIsAReal(e, QString("length1"), &length1)) length1 = 1.5;
 	if (!QET::attributeIsAReal(e, QString("length2"), &length2)) length2 = 1.5;
-	
+
 	qp.save();
 	setPainterStyle(e, qp);
 	QPen t = qp.pen();
 	t.setJoinStyle(Qt::MiterJoin);
 	qp.setPen(t);
-	
+
 	QLineF line(x1, y1, x2, y2);
 
 	//Add line to the list
@@ -327,10 +411,10 @@
 
 	QPointF point1(line.p1());
 	QPointF point2(line.p2());
-	
+
 	qreal line_length(line.length());
 	qreal pen_width = qp.pen().widthF();
-	
+
 	// determine s'il faut dessiner les extremites
 	bool draw_1st_end, draw_2nd_end;
 	qreal reduced_line_length = line_length - (length1 * PartLine::requiredLengthForEndType(first_end));
@@ -341,7 +425,7 @@
 		reduced_line_length = line_length - (length2 * PartLine::requiredLengthForEndType(second_end));
 	}
 	draw_2nd_end = second_end && reduced_line_length >= 0;
-	
+
 	// dessine la premiere extremite
 	QPointF start_point, stop_point;
 	if (draw_1st_end) {
@@ -355,12 +439,12 @@
 		} else if (first_end == Qet::Simple) {
 			qp.drawPolyline(QPolygonF() << four_points1[3] << point1 << four_points1[2]);
 			start_point = point1;
-			
+
 		} else if (first_end == Qet::Triangle) {
 			qp.drawPolygon(QPolygonF() << four_points1[0] << four_points1[2] << point1 << four_points1[3]);
 			start_point = four_points1[0];
 		}
-		
+
 		// ajuste le depart selon l'epaisseur du trait
 		if (pen_width && (first_end == Qet::Simple || first_end == Qet::Circle)) {
 			start_point = QLineF(start_point, point2).pointAt(pen_width / 2.0 / line_length);
@@ -368,7 +452,7 @@
 	} else {
 		start_point = point1;
 	}
-	
+
 	// dessine la seconde extremite
 	if (draw_2nd_end) {
 		QList<QPointF> four_points2(PartLine::fourEndPoints(point2, point1, length2));
@@ -385,7 +469,7 @@
 			qp.drawPolygon(QPolygonF() << four_points2[0] << four_points2[2] << point2 << four_points2[3] << four_points2[0]);
 			stop_point = four_points2[0];
 		}
-		
+
 		// ajuste l'arrivee selon l'epaisseur du trait
 		if (pen_width && (second_end == Qet::Simple || second_end == Qet::Circle)) {
 			stop_point = QLineF(point1, stop_point).pointAt((line_length - (pen_width / 2.0)) / line_length);
@@ -393,9 +477,9 @@
 	} else {
 		stop_point = point2;
 	}
-	
+
 	qp.drawLine(start_point, stop_point);
-	
+
 	qp.restore();
 	return(true);
 }
@@ -408,7 +492,7 @@
 		- y : ordonnee du coin superieur gauche du rectangle
 		- width : largeur du rectangle
 		- height : hauteur du rectangle
-		
+
 	@param e L'element XML a analyser
 	@param qp Le QPainter a utiliser pour dessiner l'element perso
 	@return true si l'analyse reussit, false sinon
@@ -427,12 +511,12 @@
 
 	qp.save();
 	setPainterStyle(e, qp);
-	
+
 	// force le type de jointures pour les rectangles
 	QPen p = qp.pen();
 	p.setJoinStyle(Qt::MiterJoin);
 	qp.setPen(p);
-	
+
 	qp.drawRect(QRectF(rect_x, rect_y, rect_w, rect_h));
 	qp.restore();
 	return(true);
@@ -445,7 +529,7 @@
 		- x : abscisse du coin superieur gauche de la quadrature du cercle
 		- y : ordonnee du coin superieur gauche de la quadrature du cercle
 		- diameter : diametre du cercle
-		
+
 	@param e L'element XML a analyser
 	@param qp Le QPainter a utiliser pour dessiner l'element perso
 	@return true si l'analyse reussit, false sinon
@@ -477,7 +561,7 @@
 		- y : ordonnee du coin superieur gauche du rectangle dans lequel s'inscrit l'ellipse
 		- width : dimension de la diagonale horizontale de l'ellipse
 		- height : dimension de la diagonale verticale de l'ellipse
-		
+
 	@param e L'element XML a analyser
 	@param qp Le QPainter a utiliser pour dessiner l'element perso
 	@return true si l'analyse reussit, false sinon
@@ -515,7 +599,7 @@
 		- start : angle de depart : l'angle "0 degre" est a trois heures
 		- angle : etendue (en degres) de l'arc de cercle ; une valeur positive
 		va dans le sens contraire des aiguilles d'une montre
-		
+
 	@param e L'element XML a analyser
 	@param qp Le QPainter a utiliser pour dessiner l'element perso
 	@return true si l'analyse reussit, false sinon
@@ -529,7 +613,7 @@
 	if (!QET::attributeIsAReal(e, QString("height"),  &arc_h))  return(false);
 	if (!QET::attributeIsAReal(e, QString("start"),   &arc_s))  return(false);
 	if (!QET::attributeIsAReal(e, QString("angle"),   &arc_a))  return(false);
-	
+
 	qp.save();
 	setPainterStyle(e, qp);
 
@@ -612,15 +696,15 @@
 		!QET::attributeIsAnInteger(e, "size", &size) ||\
 		!e.hasAttribute("text")
 	) return(false);
-	
+
 	qp.save();
 	setPainterStyle(e, qp);
-	
+
 	// determine la police a utiliser et en recupere les metriques associees
 	QFont used_font = QETApp::diagramTextsFont(size);
 	QFontMetrics qfm(used_font);
 	QColor text_color = (e.attribute("color") != "white"? Qt::black : Qt::white);
-	
+
 	// instancie un QTextDocument (comme la classe QGraphicsTextItem) pour
 	// generer le rendu graphique du texte
 	QTextDocument text_document;
@@ -638,18 +722,18 @@
 	eti -> setRotationAngle(original_rotation_angle);
 	eti -> setFollowParentRotations(e.attribute("rotate") == "true");
 	list_texts_ << eti;
-	
-	// Se positionne aux coordonnees indiquees dans la description du texte	
+
+	// Se positionne aux coordonnees indiquees dans la description du texte
 	qp.setTransform(QTransform(), false);
 	qp.translate(pos_x, pos_y);
-	
+
 	// Pivote le systeme de coordonnees du QPainter pour effectuer le rendu
 	// dans le bon sens
 	qreal default_rotation_angle = 0.0;
 	if (QET::attributeIsAReal(e, "rotation", &default_rotation_angle)) {
 		qp.rotate(default_rotation_angle);
 	}
-	
+
 	/*
 		Deplace le systeme de coordonnees du QPainter pour effectuer le rendu au
 		bon endroit ; note : on soustrait l'ascent() de la police pour
@@ -657,12 +741,12 @@
 		indiquee correspond a la baseline.
 	*/
 	QPointF qpainter_offset(0.0, -qfm.ascent());
-	
+
 		//adjusts the offset by the margin of the text document
 	text_document.setDocumentMargin(0.0);
-	
+
 	qp.translate(qpainter_offset);
-	
+
 	// force the palette used to render the QTextDocument
 	QAbstractTextDocumentLayout::PaintContext ctx;
 	ctx.palette.setColor(QPalette::Text, text_color);
@@ -691,26 +775,38 @@
 		!QET::attributeIsAReal(e, "y", &pos_y) ||\
 		!QET::attributeIsAnInteger(e, "size", &size)
 	) return(0);
-	
+
 	ElementTextItem *eti = new ElementTextItem(e.attribute("text"), this);
 	eti -> setFont(QETApp::diagramTextsFont(size));
 	eti -> setTagg(e.attribute("tagg", "other"));
-	
+
+	if (e.attribute("tagg")=="label") {
+		DiagramContext &dc = this->rElementInformations();
+		dc.addValue("label", e.attribute("text"));
+		this->setElementInformations(dc);
+		this->setTaggedText("label", e.attribute("text"));
+	}
+	else if (e.attribute("tagg")=="function") {
+		DiagramContext &dc = this->rElementInformations();
+		dc.addValue("function", e.attribute("text"));
+		this->setElementInformations(dc);
+	}
+
 	// position the text field
 	eti -> setOriginalPos(QPointF(pos_x, pos_y));
 	eti -> setPos(pos_x, pos_y);
-	
+
 	// rotation of the text field
 	qreal original_rotation_angle = 0.0;
 	QET::attributeIsAReal(e, "rotation", &original_rotation_angle);
 	eti -> setOriginalRotationAngle(original_rotation_angle);
 	eti -> setRotationAngle(original_rotation_angle);
-	
+
 	// behavior when the parent element is rotated
 	eti -> setFollowParentRotations(e.attribute("rotate") == "true");
-	
+
 	list_texts_ << eti;
-	
+
 	return(eti);
 }
 
@@ -720,7 +816,7 @@
 	Une borne est definie par les attributs suivants :
 		- x, y : coordonnees de la borne
 		- orientation  : orientation de la borne = Nord (n), Sud (s), Est (e) ou Ouest (w)
-		
+
 	@param e L'element XML a analyser
 	@return Un pointeur vers l'objet Terminal ainsi cree, 0 sinon
 */
@@ -762,12 +858,12 @@
 		- une pour l'Est
 		- une pour le Sud
 		- une pour l'Ouest
-	 
+
 	Pour chaque orientation, on indique si elle est :
 		- l'orientation par defaut : d
 		- une orientation autorisee : y
 		- une orientation interdire : n
-		
+
 	Exemple : "dnny" represente un element par defaut oriente vers le nord et qui
 	peut etre oriente vers l'ouest mais pas vers le sud ou vers l'est.
 	@param e Element XML
@@ -826,7 +922,7 @@
 			- hachures gauche
 			- hachures  droite
 			- none : pas de contour
-			
+
 	Les autres valeurs ne sont pas prises en compte.
 	@param e L'element XML a parser
 	@param qp Le QPainter a modifier en fonction des styles
@@ -835,14 +931,14 @@
 	// recupere le QPen et la QBrush du QPainter
 	QPen pen = qp.pen();
 	QBrush brush = qp.brush();
-	
+
 	// attributs par defaut
 	pen.setJoinStyle(Qt::BevelJoin);
 	pen.setCapStyle(Qt::SquareCap);
-	
+
 	// recupere la liste des couples style / valeur
 	QStringList styles = e.attribute("style").split(";", QString::SkipEmptyParts);
-	
+
 	// agit sur le QPen et la QBrush en fonction des valeurs rencontrees
 	QRegExp rx("^\\s*([a-z-]+)\\s*:\\s*([a-z-]+)\\s*$");
 	foreach (QString style, styles) {
@@ -949,11 +1045,11 @@
 			}
 		}
 	}
-	
-	// affectation du QPen et de la QBrush modifies au QPainter 
+
+	// affectation du QPen et de la QBrush modifies au QPainter
 	qp.setPen(pen);
 	qp.setBrush(brush);
-	
+
 	// mise en place (ou non) de l'antialiasing
 	setQPainterAntiAliasing(qp, e.attribute("antialias") == "true");
 }

Modified: trunk/sources/qetgraphicsitem/customelement.h
===================================================================
--- trunk/sources/qetgraphicsitem/customelement.h	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/qetgraphicsitem/customelement.h	2016-07-05 20:14:14 UTC (rev 4563)
@@ -72,6 +72,7 @@
 	virtual QList<QVector<qreal> *> arcs() const;
 	virtual int terminalsCount() const;
 	virtual void paint(QPainter *, const QStyleOptionGraphicsItem *);
+	virtual void parseLabels();
 	QString typeId() const;
 	ElementsLocation location() const;
 	QString name() const;
@@ -93,6 +94,7 @@
 	virtual bool validOrientationAttribute(const QDomElement &);
 	virtual void setPainterStyle(QDomElement &, QPainter &);
 	ElementTextItem* setTaggedText(const QString &tagg, const QString &newstr, const bool noeditable=false);
+
 };
 
 /**

Modified: trunk/sources/qetgraphicsitem/element.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/element.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/qetgraphicsitem/element.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -659,5 +659,7 @@
 	label.replace("%F", elmt->diagram() -> border_and_titleblock.folio());
 	label.replace("%c", QString::number(elmt->diagram() -> convertPosition(elmt -> scenePos()).number()));
 	label.replace("%l", elmt->diagram() -> convertPosition(elmt -> scenePos()).letter());
+	label.replace("%id", QString::number(elmt->diagram()->folioIndex()+1));
+	label.replace("%total", QString::number(elmt->diagram()->border_and_titleblock.folioTotal()));
 	return label;
 }

Modified: trunk/sources/qetgraphicsitem/element.h
===================================================================
--- trunk/sources/qetgraphicsitem/element.h	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/qetgraphicsitem/element.h	2016-07-05 20:14:14 UTC (rev 4563)
@@ -120,8 +120,9 @@
 		kind              link_type_;
 
 	signals:
-		void linkedElementChanged(); //This signal is emtied when the linked elements with this element change
+		void linkedElementChanged(); //This signal is emited when the linked elements with this element change
 		void elementInfoChange(DiagramContext old_info, DiagramContext new_info);
+		void updateLabel(); //This signal is emited to update element's label
 
 		//METHODS related to information
 	public:
@@ -162,7 +163,7 @@
 	
 	// selection-related methods
 	void select();
-	void deselect();	
+	void deselect();
 	
 	virtual void rotateBy(const qreal &);
 	virtual void editProperty();

Modified: trunk/sources/qetgraphicsitem/elementtextitem.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/elementtextitem.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/qetgraphicsitem/elementtextitem.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -254,6 +254,7 @@
 			if (m_first_move) {
 				//We signal the beginning of movement to the parent diagram
 				int moved_texts_count = diagram_ptr -> beginMoveElementTexts(this);
+				parent_element_ -> setHighlighted(true);
 
 				//If there is one texte to move, we highlight the parent element.
 				if (moved_texts_count == 1 && parent_element_) {

Modified: trunk/sources/qetgraphicsitem/masterelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/masterelement.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/qetgraphicsitem/masterelement.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -33,8 +33,9 @@
 {
 	link_type_ = Master;
 	connect(this, SIGNAL(elementInfoChange(DiagramContext, DiagramContext)), this, SLOT(updateLabel(DiagramContext, DiagramContext)));
-	connect(this, SIGNAL(xChanged()),this, SLOT(changeElementInfo()));
-	connect(this, SIGNAL(yChanged()),this, SLOT(changeElementInfo()));
+	connect(this, SIGNAL(xChanged()),    this, SLOT(changeElementInfo()));
+	connect(this, SIGNAL(yChanged()),    this, SLOT(changeElementInfo()));
+	connect(this, SIGNAL(updateLabel()), this, SLOT(changeElementInfo()));
 }
 
 /**
@@ -61,8 +62,9 @@
 
 		if (!cri_) cri_ = new CrossRefItem(this); //create cross ref item if not yet
 
-		connect(elmt, SIGNAL(xChanged()), cri_, SLOT(updateLabel()));
-		connect(elmt, SIGNAL(yChanged()), cri_, SLOT(updateLabel()));
+		connect(elmt, SIGNAL(xChanged()),    cri_, SLOT(updateLabel()));
+		connect(elmt, SIGNAL(yChanged()),    cri_, SLOT(updateLabel()));
+		connect(elmt, SIGNAL(updateLabel()), cri_, SLOT(updateLabel()));
 		cri_ -> updateLabel();
 		emit linkedElementChanged();
 	}
@@ -98,8 +100,9 @@
 		elmt -> setHighlighted (false);
 
 			//update the graphics cross ref
-		disconnect(elmt, SIGNAL(xChanged()), cri_, SLOT(updateLabel()));
-		disconnect(elmt, SIGNAL(yChanged()), cri_, SLOT(updateLabel()));
+		disconnect(elmt, SIGNAL(xChanged()),    cri_, SLOT(updateLabel()));
+		disconnect(elmt, SIGNAL(yChanged()),    cri_, SLOT(updateLabel()));
+		disconnect(elmt, SIGNAL(updateLabel()), cri_, SLOT(updateLabel()));
 
 		cri_ -> updateLabel();
 		aboutDeleteXref();

Modified: trunk/sources/qetgraphicsitem/reportelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/reportelement.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/qetgraphicsitem/reportelement.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -219,10 +219,7 @@
 	{
 		Element *elmt = connected_elements.at(0);
 		QString label = label_;
-		label.replace("%f", QString::number(elmt->diagram()->folioIndex()+1));
-		label.replace("%F", elmt->diagram() -> border_and_titleblock.folio());
-		label.replace("%c", QString::number(elmt->diagram() -> convertPosition(elmt -> scenePos()).number()));
-		label.replace("%l", elmt->diagram() -> convertPosition(elmt -> scenePos()).letter());
+		label = assignVariables(label,elmt);
 		m_text_field -> setPlainText(label);
 	}
 	else

Modified: trunk/sources/qetgraphicsitem/simpleelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/simpleelement.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/qetgraphicsitem/simpleelement.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -35,6 +35,7 @@
 	connect(this, SIGNAL(elementInfoChange(DiagramContext, DiagramContext)), this, SLOT(updateLabel(DiagramContext, DiagramContext)));
 	connect(this, SIGNAL(xChanged()),this, SLOT(changeElementInfo()));
 	connect(this, SIGNAL(yChanged()),this, SLOT(changeElementInfo()));
+	connect(this, SIGNAL(updateLabel()),this,SLOT(changeElementInfo()));
 }
 
 /**

Modified: trunk/sources/qetgraphicsitem/slaveelement.cpp
===================================================================
--- trunk/sources/qetgraphicsitem/slaveelement.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/qetgraphicsitem/slaveelement.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -64,6 +64,7 @@
 		connect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
 		connect(diagram()->project(), SIGNAL(diagramRemoved(QETProject*,Diagram*)),             this, SLOT(updateLabel()));
 		connect(elmt -> diagram(),    SIGNAL(XRefPropertiesChanged()),                          this, SLOT(updateLabel()));
+		connect(elmt,                 SIGNAL(updateLabel()),                                    this, SLOT(updateLabel()));
 
 		updateLabel();
 		elmt -> linkToElement(this);
@@ -104,6 +105,7 @@
 		disconnect(diagram()->project(), SIGNAL(projectDiagramsOrderChanged(QETProject*,int,int)), this, SLOT(updateLabel()));
 		disconnect(diagram()->project(), SIGNAL(diagramRemoved(QETProject*,Diagram*)),             this, SLOT(updateLabel()));
 		disconnect(elmt -> diagram(),    SIGNAL(XRefPropertiesChanged()),                          this, SLOT(updateLabel()));
+		disconnect(elmt,                 SIGNAL(updateLabel()),                                    this, SLOT(updateLabel()));
 
 		delete Xref_item; Xref_item = NULL;
 

Modified: trunk/sources/qetproject.cpp
===================================================================
--- trunk/sources/qetproject.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/qetproject.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -409,6 +409,14 @@
 }
 
 /**
+ * @brief QETProject::elementAutoNum
+ * @return Formula of element autonum stored in project
+ */
+QString QETProject::elementAutoNum() const {
+	return m_element_autonum;
+}
+
+/**
  * @brief QETProject::folioAutoNum
  * @return All value of conductor autonum stored in project
  */
@@ -428,6 +436,15 @@
 }
 
 /**
+ * @brief QETProject::addElementAutoNum
+ * Add the new formula
+ * @param formula
+ */
+void QETProject::addElementAutoNum(QString formula) {
+	m_element_autonum = formula;
+}
+
+/**
  * @brief QETProject::addFolioAutoNum
  * Add a new folio numerotation context. If key already exist,
  * replace old context by the new context
@@ -1176,7 +1193,7 @@
 	m_default_xref_properties	   = XRefProperties::      defaultProperties();
 
 		//Read values indicate in project
-	QDomElement border_elmt, titleblock_elmt, conductors_elmt, report_elmt, xref_elmt, conds_autonums, folio_autonums;
+	QDomElement border_elmt, titleblock_elmt, conductors_elmt, report_elmt, xref_elmt, conds_autonums, folio_autonums, element_autonums;
 
 	for (QDomNode child = newdiagrams_elmt.firstChild() ; !child.isNull() ; child = child.nextSibling())
 	{
@@ -1197,9 +1214,11 @@
 			conds_autonums = child_elmt;
 		else if (child_elmt.tagName()== "folio_autonums")
 			folio_autonums = child_elmt;
+		else if (child_elmt.tagName()== "element_autonums")
+			element_autonums = child_elmt;
 	}
 
-		// size, titleblock, conductor, report, conductor autonum
+		// size, titleblock, conductor, report, conductor autonum, folio autonum, element autonum
 	if (!border_elmt.isNull())	   default_border_properties_.fromXml(border_elmt);
 	if (!titleblock_elmt.isNull()) default_titleblock_properties_.fromXml(titleblock_elmt);
 	if (!conductors_elmt.isNull()) default_conductor_properties_.fromXml(conductors_elmt);
@@ -1231,6 +1250,10 @@
 			m_folio_autonum.insert(elmt.attribute("title"), nc);
 		}
 	}
+	if (!element_autonums.isNull())
+	{
+		m_element_autonum = element_autonums.attribute("formula");
+	}
 }
 
 /**
@@ -1300,6 +1323,11 @@
 		folio_autonums.appendChild(folio_autonum);
 	}
 	xml_element.appendChild(folio_autonums);
+
+	//Export Element Autonums
+	QDomElement element_autonums = xml_document.createElement("element_autonums");
+	element_autonums.setAttribute("formula", m_element_autonum);
+	xml_element.appendChild(element_autonums);
 }
 
 /**

Modified: trunk/sources/qetproject.h
===================================================================
--- trunk/sources/qetproject.h	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/qetproject.h	2016-07-05 20:14:14 UTC (rev 4563)
@@ -109,11 +109,13 @@
 		QHash <QString, NumerotationContext> conductorAutoNum() const;
 		QHash <QString, NumerotationContext> folioAutoNum() const;
 		void addConductorAutoNum (QString key, NumerotationContext context);
-		void addFolioAutoNum    (QString key, NumerotationContext context);
+		void addElementAutoNum   (QString formula);
+		void addFolioAutoNum     (QString key, NumerotationContext context);
 		void removeConductorAutonum (QString key);
 		void removeFolioAutoNum (QString key);
 		NumerotationContext conductorAutoNum(const QString &key) const;
 		NumerotationContext folioAutoNum(const QString &key)    const;
+		QString elementAutoNum() const;
 
 		bool autoConductor    () const;
 		bool autoFolio  () const;
@@ -218,7 +220,10 @@
 	QUndoStack *undo_stack_;
 	/// Conductor auto numerotation
 	QHash <QString, NumerotationContext> m_conductor_autonum;
+	/// Folio auto numbering
 	QHash <QString, NumerotationContext> m_folio_autonum;
+	/// Element Auto Numbering
+	QString m_element_autonum;
 	/// Folio List Sheets quantity for this project.
 	int folioSheetsQuantity;
 	bool m_auto_conductor;

Added: trunk/sources/ui/elementautonumberingw.cpp
===================================================================
--- trunk/sources/ui/elementautonumberingw.cpp	                        (rev 0)
+++ trunk/sources/ui/elementautonumberingw.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -0,0 +1,92 @@
+/*
+	Copyright 2006-2016 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 "elementautonumberingw.h"
+#include "ui_elementautonumberingw.h"
+#include <QMessageBox>
+#include <QPushButton>
+#include <QtWidgets>
+
+/**
+ * Constructor
+ */
+ElementAutonumberingW::ElementAutonumberingW(QWidget *parent) :
+	QWidget(parent),
+	ui(new Ui::ElementAutonumberingW)
+
+{
+	ui->setupUi(this);
+	applyEnable(false);
+}
+
+/**
+ * Destructor
+ */
+ElementAutonumberingW::~ElementAutonumberingW()
+{
+	delete ui;
+}
+
+/**
+ * @brief ElementAutonumberingW::setContext
+ * @param formula to be inserted into context
+ */
+void ElementAutonumberingW::setContext(QString formula) {
+	ui->m_formula_le->insert(formula);
+}
+
+/**
+ * @brief ElementAutonumberingW::formula
+ * @return formula to be stored into project
+ */
+QString ElementAutonumberingW::formula() {
+	return ui->m_formula_le->text();
+}
+
+/**
+ * @brief ElementAutonumberingW::on_m_formula_le_textChanged
+ * Update Apply Button
+ */
+void ElementAutonumberingW::on_m_formula_le_textChanged() {
+	if (!ui->m_formula_le->text().isEmpty())
+		applyEnable(true);
+	else applyEnable(false);
+}
+
+/**
+ * @brief ElementAutonumberingW::on_buttonBox_clicked
+ * Action on @buttonBox clicked
+ */
+void ElementAutonumberingW::on_buttonBox_clicked(QAbstractButton *button) {
+	//transform button to int
+	int answer = ui -> buttonBox -> buttonRole(button);
+
+	switch (answer) {
+		case QDialogButtonBox::ApplyRole:
+			applyEnable(true);
+			emit applyPressed();
+			break;
+	}
+}
+
+/**
+ * @brief ElementAutonumberingW::applyEnable
+ * enable/disable the apply button
+ */
+void ElementAutonumberingW::applyEnable(bool b) {
+		ui -> buttonBox -> button(QDialogButtonBox::Apply) -> setEnabled(b);
+}

Added: trunk/sources/ui/elementautonumberingw.h
===================================================================
--- trunk/sources/ui/elementautonumberingw.h	                        (rev 0)
+++ trunk/sources/ui/elementautonumberingw.h	2016-07-05 20:14:14 UTC (rev 4563)
@@ -0,0 +1,64 @@
+/*
+	Copyright 2006-2016 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 ELEMENTAUTONUMBERINGW_H
+#define ELEMENTAUTONUMBERINGW_H
+
+#include <QWidget>
+
+class QAbstractButton;
+
+namespace Ui {
+		class ElementAutonumberingW;
+}
+
+/**
+	This class implements the element autonumbering widget.
+	It loads the current formula applied to new elements and allows
+	the user to overwrite it with a new formula. Formula is added
+	while parsing label in customelement.cpp
+*/
+class ElementAutonumberingW : public QWidget
+{
+	Q_OBJECT
+	
+	//METHODS
+	public:
+		explicit ElementAutonumberingW(QWidget *parent = 0);
+		~ElementAutonumberingW();
+		QString formula();
+		void setContext(QString);
+
+
+	private:
+
+	// SIGNALS
+	signals:
+		void applyPressed();
+
+	//SLOTS
+	private slots:
+		void on_m_formula_le_textChanged();
+		void on_buttonBox_clicked(QAbstractButton *);
+		void applyEnable (bool = true);
+
+	//ATTRIBUTES
+	private:
+		Ui::ElementAutonumberingW *ui;
+};
+
+#endif // ELEMENTAUTONUMBERINGW_H

Added: trunk/sources/ui/elementautonumberingw.ui
===================================================================
--- trunk/sources/ui/elementautonumberingw.ui	                        (rev 0)
+++ trunk/sources/ui/elementautonumberingw.ui	2016-07-05 20:14:14 UTC (rev 4563)
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>ElementAutonumberingW</class>
+ <widget class="QWidget" name="ElementAutonumberingW">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>460</width>
+    <height>550</height>
+   </rect>
+  </property>
+  <property name="sizePolicy">
+   <sizepolicy hsizetype="Preferred" 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="Preferred" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>50</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="minimumSize">
+      <size>
+       <width>0</width>
+       <height>0</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>440</width>
+        <height>495</height>
+       </rect>
+      </property>
+      <property name="sizePolicy">
+       <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="minimumSize">
+       <size>
+        <width>0</width>
+        <height>0</height>
+       </size>
+      </property>
+      <layout class="QGridLayout" name="gridLayout">
+       <property name="sizeConstraint">
+        <enum>QLayout::SetFixedSize</enum>
+       </property>
+       <item row="4" 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>
+       <item row="1" column="1" rowspan="2" colspan="2">
+        <widget class="QGroupBox" name="groupBox">
+         <property name="title">
+          <string>Auto Naming Pattern:</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_4">
+          <item row="0" column="1">
+           <widget class="QLineEdit" name="m_formula_le">
+            <property name="inputMask">
+             <string notr="true"/>
+            </property>
+            <property name="text">
+             <string notr="true"/>
+            </property>
+            <property name="placeholderText">
+             <string>Insert Formula Here e.g.: %prefix%l%c</string>
+            </property>
+           </widget>
+          </item>
+          <item row="0" column="0">
+           <widget class="QLabel" name="label_5">
+            <property name="text">
+             <string>Formula:</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="0" rowspan="2" colspan="3">
+           <widget class="QLabel" name="label">
+            <property name="text">
+             <string>You can use the following variables to your formula:
+ -%prefix: Default Element Prefix
+ -%l: Element Line
+ -%c: Element Column
+ -%F: Folio Name
+ -%f or %id: Folio ID
+ -%total: Total of folios
+You can also assign any other titleblock variable 
+that you create. Text and number inputs are also available</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </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</set>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

Modified: trunk/sources/ui/folioautonumbering.cpp
===================================================================
--- trunk/sources/ui/folioautonumbering.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/ui/folioautonumbering.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -135,7 +135,7 @@
  * @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(){
+void FolioAutonumberingW::on_m_new_tabs_sb_valueChanged(int){
 	if (ui->m_new_tabs_sb->value()>0) applyEnable(true);
 	else applyEnable(false);
 }
@@ -144,7 +144,7 @@
  * @brief FolioAutonumberingW::on_m_from_cb_currentIndexChanged
  *	Enable To ComboBox
  */
-void FolioAutonumberingW::on_m_from_cb_currentIndexChanged(){
+void FolioAutonumberingW::on_m_from_cb_currentIndexChanged(int){
 	int index = ui->m_from_cb->currentIndex();
 	ui->m_to_cb->clear();
 	if (index > 0){

Modified: trunk/sources/ui/folioautonumbering.h
===================================================================
--- trunk/sources/ui/folioautonumbering.h	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/ui/folioautonumbering.h	2016-07-05 20:14:14 UTC (rev 4563)
@@ -26,7 +26,7 @@
 class QETProject;
 
 namespace Ui {
-        class FolioAutonumberingW;
+		class FolioAutonumberingW;
 }
 
 class FolioAutonumberingW : public QWidget
@@ -35,16 +35,16 @@
 	
 	//METHODS
 	public:
-        explicit FolioAutonumberingW(QETProject *project, QWidget *parent = 0);
-        ~FolioAutonumberingW();
+		explicit FolioAutonumberingW(QETProject *project, QWidget *parent = 0);
+		~FolioAutonumberingW();
 
-        void setContext (QList <QString> autonums);
+		void setContext (QList <QString> autonums);
 		NumerotationContext toNumContext() const;
-        QString autoNumSelected();
-        int newFoliosNumber();
-        bool newFolios;
-        int fromFolio();
-        int toFolio();
+		QString autoNumSelected();
+		int newFoliosNumber();
+		bool newFolios;
+		int fromFolio();
+		int toFolio();
 
 	// SIGNALS
 	signals:
@@ -53,20 +53,20 @@
 
 	//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_m_create_new_tabs_rb_clicked();
+		void on_m_autonumber_tabs_rb_clicked();
+		void on_m_new_tabs_sb_valueChanged(int);
 		void on_buttonBox_clicked(QAbstractButton *);
-        void on_m_from_cb_currentIndexChanged();
+		void on_m_from_cb_currentIndexChanged(int);
 		void applyEnable (bool = true);
 
 	//ATTRIBUTES
 	private:
-        QETProject *project_;
-        Ui::FolioAutonumberingW *ui;
+		QETProject *project_;
+		Ui::FolioAutonumberingW *ui;
 		QList <NumPartEditorW *> num_part_list_;
 		NumerotationContext m_context;
-        void updateFolioList();
+		void updateFolioList();
 };
 
 #endif // FOLIOAUTONUMBERING_H

Modified: trunk/sources/ui/numparteditorw.cpp
===================================================================
--- trunk/sources/ui/numparteditorw.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/ui/numparteditorw.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -149,7 +149,7 @@
  * @brief NumPartEditorW::on_increase_spinBox_valueChanged
  * emit changed when @increase_spinBox value changed
  */
-void NumPartEditorW::on_increase_spinBox_valueChanged() {
+void NumPartEditorW::on_increase_spinBox_valueChanged(int) {
 	if (!ui -> value_field -> text().isEmpty()) emit changed();
 }
 

Modified: trunk/sources/ui/numparteditorw.h
===================================================================
--- trunk/sources/ui/numparteditorw.h	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/ui/numparteditorw.h	2016-07-05 20:14:14 UTC (rev 4563)
@@ -49,7 +49,7 @@
 	private slots:
 	void on_type_combo_activated(int);
 	void on_value_field_textEdited();
-	void on_increase_spinBox_valueChanged();
+	void on_increase_spinBox_valueChanged(int);
 	void setType (NumPartEditorW::type t, bool=false);
 
 	signals:

Modified: trunk/sources/ui/projectpropertiesdialog.cpp
===================================================================
--- trunk/sources/ui/projectpropertiesdialog.cpp	2016-07-03 12:00:27 UTC (rev 4562)
+++ trunk/sources/ui/projectpropertiesdialog.cpp	2016-07-05 20:14:14 UTC (rev 4563)
@@ -72,5 +72,5 @@
  */
 void ProjectPropertiesDialog::changeToFolio() {
    ProjectAutoNumConfigPage *autoNumPage = static_cast <ProjectAutoNumConfigPage*>(m_properties_dialog->pages.at(2));
-   autoNumPage->changeToTab(1);
+   autoNumPage->changeToTab(2);
 }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/