mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-24 03:10:52 +01:00
New fields titleblock properties %machine and %locmach can now be called
in the element rules autonum git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4628 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -56,6 +56,8 @@ NumPartEditorW::NumPartEditorW (NumerotationContext &context, int i, QWidget *pa
|
||||
else if (strl.at(0)=="string") setType(NumPartEditorW::string);
|
||||
else if (strl.at(0)=="idfolio") setType(NumPartEditorW::idfolio);
|
||||
else if (strl.at(0)=="folio") setType(NumPartEditorW::folio);
|
||||
else if (strl.at(0)=="machine") setType(NumPartEditorW::machine);
|
||||
else if (strl.at(0)=="locmach") setType(NumPartEditorW::locmach);
|
||||
else if (strl.at(0)=="elementline") setType(NumPartEditorW::elementline);
|
||||
else if (strl.at(0)=="elementcolumn") setType(NumPartEditorW::elementcolumn);
|
||||
else if (strl.at(0)=="elementprefix") setType(NumPartEditorW::elementprefix);
|
||||
@@ -89,7 +91,7 @@ void NumPartEditorW::setVisibleItems() {
|
||||
else
|
||||
items << tr("Chiffre 1") << tr("Chiffre 1 - Folio") << tr("Chiffre 01")
|
||||
<< tr("Chiffre 01 - Folio") << tr("Chiffre 001") << tr("Chiffre 001 - Folio")
|
||||
<< tr("Texte") << tr("N° folio") << tr("Folio")
|
||||
<< tr("Texte") << tr("N° folio") << tr("Folio") << tr("Machine") << tr("Locmach")
|
||||
<< tr("Element Line") << tr("Element Column") << tr("Element Prefix");
|
||||
ui->type_cb->insertItems(0,items);
|
||||
}
|
||||
@@ -129,6 +131,12 @@ NumerotationContext NumPartEditorW::toNumContext() {
|
||||
case folio:
|
||||
type_str = "folio";
|
||||
break;
|
||||
case machine:
|
||||
type_str = "machine";
|
||||
break;
|
||||
case locmach:
|
||||
type_str = "locmach";
|
||||
break;
|
||||
case elementline:
|
||||
type_str = "elementline";
|
||||
break;
|
||||
@@ -151,7 +159,7 @@ NumerotationContext NumPartEditorW::toNumContext() {
|
||||
* @return true if value field isn't empty or if type is folio
|
||||
*/
|
||||
bool NumPartEditorW::isValid() {
|
||||
if (type_ == folio || type_ == idfolio || type_ == elementline ||
|
||||
if (type_ == folio || type_ == idfolio || type_ == elementline || type_ == machine || type_ == locmach ||
|
||||
type_ == elementcolumn || type_ == elementprefix) {return true;}
|
||||
else if(ui -> value_field -> text().isEmpty()) {return false;}
|
||||
else return true;
|
||||
@@ -180,6 +188,10 @@ void NumPartEditorW::on_type_cb_activated(int) {
|
||||
setType(idfolio);
|
||||
else if (ui->type_cb->currentText() == tr("Folio"))
|
||||
setType(folio);
|
||||
else if (ui->type_cb->currentText() == tr("Machine"))
|
||||
setType(machine);
|
||||
else if (ui->type_cb->currentText() == tr("Locmach"))
|
||||
setType(locmach);
|
||||
else if (ui->type_cb->currentText() == tr("Element Line"))
|
||||
setType(elementline);
|
||||
else if (ui->type_cb->currentText() == tr("Element Column"))
|
||||
@@ -217,7 +229,7 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
|
||||
//if @t is a numeric type and preview type @type_ isn't a numeric type
|
||||
//or @fnum is true, we set numeric behavior
|
||||
if ( ((t==unit || t==unitfolio || t==ten || t==tenfolio || t==hundred || t==hundredfolio) &&
|
||||
(type_==string || type_==folio || type_==idfolio ||
|
||||
(type_==string || type_==folio || type_==machine || type_==locmach ||type_==idfolio ||
|
||||
type_==elementcolumn || type_==elementline || type_==elementprefix))
|
||||
|| fnum) {
|
||||
ui -> value_field -> clear();
|
||||
@@ -227,7 +239,7 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
|
||||
ui -> increase_spinBox -> setValue(1);
|
||||
}
|
||||
//@t isn't a numeric type
|
||||
else if (t == string || t == folio || t == idfolio || t == elementline ||
|
||||
else if (t == string || t == folio || t == idfolio || t == elementline || t == machine || t == locmach ||
|
||||
t == elementcolumn || t == elementprefix) {
|
||||
ui -> value_field -> clear();
|
||||
ui -> increase_spinBox -> setDisabled(true);
|
||||
@@ -239,6 +251,14 @@ void NumPartEditorW::setType(NumPartEditorW::type t, bool fnum) {
|
||||
ui -> value_field -> setDisabled(true);
|
||||
ui -> increase_spinBox -> setDisabled(true);
|
||||
}
|
||||
else if (t==machine) {
|
||||
ui -> value_field -> setDisabled(true);
|
||||
ui -> increase_spinBox -> setDisabled(true);
|
||||
}
|
||||
else if (t==locmach) {
|
||||
ui -> value_field -> setDisabled(true);
|
||||
ui -> increase_spinBox -> setDisabled(true);
|
||||
}
|
||||
else if (t==idfolio) {
|
||||
ui -> value_field -> setDisabled(true);
|
||||
ui -> increase_spinBox -> setDisabled(true);
|
||||
@@ -284,8 +304,12 @@ void NumPartEditorW::setCurrentIndex(NumPartEditorW::type t) {
|
||||
i = ui->type_cb->findText(tr("N° folio"));
|
||||
else if (t == folio)
|
||||
i = ui->type_cb->findText(tr("Folio"));
|
||||
else if (t == machine)
|
||||
i = ui->type_cb->findText(tr("Machine"));
|
||||
else if (t == locmach)
|
||||
i = ui->type_cb->findText(tr("Locmach"));
|
||||
else if (t == elementline)
|
||||
i = ui->type_cb->findText(tr("Element Line"));
|
||||
i = ui->type_cb->findText(tr("Element Line"));
|
||||
else if (t == elementcolumn)
|
||||
i = ui->type_cb->findText(tr("Element Column"));
|
||||
else if (t == elementprefix)
|
||||
|
||||
Reference in New Issue
Block a user