[qet] qet/qet: [4921] Improve some widget |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 4921
Author: blacksun
Date: 2017-02-26 20:39:36 +0100 (Sun, 26 Feb 2017)
Log Message:
-----------
Improve some widget
Modified Paths:
--------------
trunk/sources/autoNum/ui/selectautonumw.cpp
trunk/sources/autoNum/ui/selectautonumw.h
trunk/sources/autoNum/ui/selectautonumw.ui
trunk/sources/projectconfigpages.cpp
trunk/sources/projectconfigpages.h
Modified: trunk/sources/autoNum/ui/selectautonumw.cpp
===================================================================
--- trunk/sources/autoNum/ui/selectautonumw.cpp 2017-02-26 18:30:34 UTC (rev 4920)
+++ trunk/sources/autoNum/ui/selectautonumw.cpp 2017-02-26 19:39:36 UTC (rev 4921)
@@ -34,6 +34,7 @@
{
ui->setupUi(this);
+ ui->m_comboBox->lineEdit()->setClearButtonEnabled(true);
if (m_edited_type == 0)
{
m_feaw = new FormulaAutonumberingW();
@@ -162,6 +163,11 @@
return "";
}
+QComboBox *SelectAutonumW::contextComboBox() const
+{
+ return ui->m_comboBox;
+}
+
/**
* @brief SelectAutonumW::on_buttonBox_clicked
* Action on @buttonBox clicked
@@ -227,14 +233,6 @@
}
/**
- * @brief SelectAutonumW::applyEnableOnContextChanged
- * enable/disable the apply button after changing the autonum name
- */
-void SelectAutonumW::applyEnableOnContextChanged(QString) {
- applyEnable(true);
-}
-
-/**
* @brief SelectAutonumW::applyEnable
* enable/disable the apply button
*/
@@ -276,7 +274,8 @@
* @brief SelectAutonumW::on_m_next_pb_clicked
* Increase NumerotationContext
*/
-void SelectAutonumW::on_m_next_pb_clicked() {
+void SelectAutonumW::on_m_next_pb_clicked()
+{
NumerotationContextCommands ncc (toNumContext());
setContext(ncc.next());
applyEnable(true);
@@ -286,8 +285,20 @@
* @brief SelectAutonumW::on_m_previous_pb_clicked
* Decrease NumerotationContext
*/
-void SelectAutonumW::on_m_previous_pb_clicked() {
+void SelectAutonumW::on_m_previous_pb_clicked()
+{
NumerotationContextCommands ncc (toNumContext());
setContext(ncc.previous());
applyEnable(true);
}
+
+void SelectAutonumW::on_m_comboBox_currentTextChanged(const QString &arg1)
+{
+ Q_UNUSED(arg1);
+ applyEnable(true);
+}
+
+void SelectAutonumW::on_m_remove_pb_clicked()
+{
+ emit removeClicked();
+}
Modified: trunk/sources/autoNum/ui/selectautonumw.h
===================================================================
--- trunk/sources/autoNum/ui/selectautonumw.h 2017-02-26 18:30:34 UTC (rev 4920)
+++ trunk/sources/autoNum/ui/selectautonumw.h 2017-02-26 19:39:36 UTC (rev 4921)
@@ -25,6 +25,7 @@
class NumPartEditorW;
class QAbstractButton;
class FormulaAutonumberingW;
+class QComboBox;
namespace Ui {
class SelectAutonumW;
@@ -44,24 +45,25 @@
NumerotationContext toNumContext() const;
void contextToFormula ();
QString formula();
+ QComboBox *contextComboBox() const;
signals:
void applyPressed();
+ void removeClicked();
- //SLOT
- public slots:
- void applyEnableOnContextChanged(QString);
-
+ //SLOT
private slots:
void on_add_button_clicked();
void on_remove_button_clicked();
void on_buttonBox_clicked(QAbstractButton *);
void applyEnable (bool = true);
-
- //ATTRIBUTES
void on_m_next_pb_clicked();
void on_m_previous_pb_clicked();
-
+ void on_m_comboBox_currentTextChanged(const QString &arg1);
+
+ //ATTRIBUTES
+ void on_m_remove_pb_clicked();
+
private:
Ui::SelectAutonumW *ui;
QList <NumPartEditorW *> num_part_list_;
Modified: trunk/sources/autoNum/ui/selectautonumw.ui
===================================================================
--- trunk/sources/autoNum/ui/selectautonumw.ui 2017-02-26 18:30:34 UTC (rev 4920)
+++ trunk/sources/autoNum/ui/selectautonumw.ui 2017-02-26 19:39:36 UTC (rev 4921)
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>616</width>
- <height>421</height>
+ <width>473</width>
+ <height>175</height>
</rect>
</property>
<property name="sizePolicy">
@@ -21,6 +21,56 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Numérotations disponibles :</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_3">
+ <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="QComboBox" name="m_comboBox">
+ <property name="editable">
+ <bool>true</bool>
+ </property>
+ <item>
+ <property name="text">
+ <string>Nom de la nouvelle numérotation</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="m_remove_pb">
+ <property name="toolTip">
+ <string>Supprimer la numérotation</string>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="icon">
+ <iconset resource="../../../qelectrotech.qrc">
+ <normaloff>:/ico/16x16/edit-delete.png</normaloff>:/ico/16x16/edit-delete.png</iconset>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
<widget class="QWidget" name="m_widget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
Modified: trunk/sources/projectconfigpages.cpp
===================================================================
--- trunk/sources/projectconfigpages.cpp 2017-02-26 18:30:34 UTC (rev 4920)
+++ trunk/sources/projectconfigpages.cpp 2017-02-26 19:39:36 UTC (rev 4921)
@@ -262,92 +262,24 @@
tab_widget->addTab(m_amw, tr("Management"));
//Conductor tab
- QWidget *conductor_widget = new QWidget();
- QVBoxLayout *conductor_layout = new QVBoxLayout(conductor_widget);
- QHBoxLayout *bp_conductor_layout = new QHBoxLayout();
-
- QLabel *label_conductor = new QLabel(tr("Numérotations disponibles :", "availables numerotations"));
- m_context_cb_conductor= new QComboBox();
- m_context_cb_conductor->setEditable(true);
- m_context_cb_conductor->lineEdit()->setClearButtonEnabled(true);
- m_context_cb_conductor->addItem(tr("Nom de la nouvelle numérotation"));
-
- m_remove_pb_conductor= new QPushButton(QET::Icons::EditDelete, QString());
- m_remove_pb_conductor-> setToolTip(tr("Supprimer la numérotation"));
-
m_saw_conductor = new SelectAutonumW(1);
+ tab_widget->addTab(m_saw_conductor, tr("Conducteur"));
- bp_conductor_layout->addWidget(label_conductor);
- bp_conductor_layout->addStretch();
- bp_conductor_layout->addWidget(m_context_cb_conductor);
- bp_conductor_layout->addWidget(m_remove_pb_conductor);
-
- conductor_layout->addLayout(bp_conductor_layout);
- conductor_layout->addWidget(m_saw_conductor);
-
- tab_widget->addTab(conductor_widget, tr("Conducteur"));
-
//Element tab
- QWidget *element_widget = new QWidget();
- QVBoxLayout *element_layout = new QVBoxLayout(element_widget);
- QHBoxLayout *bp_element_layout = new QHBoxLayout();
-
- QLabel *label_element = new QLabel(tr("Numérotations disponibles :", "availables numerotations"));
-
- m_context_cb_element = new QComboBox();
- m_context_cb_element->setEditable(true);
- m_context_cb_element->lineEdit()->setClearButtonEnabled(true);
- m_context_cb_element->addItem(tr("Nom de la nouvelle numérotation"));
-
- m_remove_pb_element = new QPushButton(QET::Icons::EditDelete, QString());
- m_remove_pb_element -> setToolTip(tr("Supprimer la numérotation"));
-
m_saw_element = new SelectAutonumW(0);
+ tab_widget->addTab(m_saw_element, tr("Element"));
- bp_element_layout->addWidget(label_element);
- bp_element_layout->addStretch();
- bp_element_layout->addWidget(m_context_cb_element);
- bp_element_layout->addWidget(m_remove_pb_element);
-
- element_layout->addLayout(bp_element_layout);
- element_layout->addWidget(m_saw_element);
-
- tab_widget->addTab(element_widget, tr("Element"));
-
//Folio Tab
- QWidget *folio_widget = new QWidget();
- QVBoxLayout *folio_layout = new QVBoxLayout(folio_widget);
- QHBoxLayout *bp_folio_layout = new QHBoxLayout();
-
- QLabel *label_folio = new QLabel(tr("Numérotations disponibles :", "availables numerotations"));
-
- m_context_cb_folio = new QComboBox();
- m_context_cb_folio->setEditable(true);
- m_context_cb_folio->lineEdit()->setClearButtonEnabled(true);
- m_context_cb_folio->addItem(tr("Nom de la nouvelle numérotation"));
-
- m_remove_pb_folio = new QPushButton(QET::Icons::EditDelete, QString());
- m_remove_pb_folio -> setToolTip(tr("Supprimer la numérotation"));
-
m_saw_folio = new SelectAutonumW(2);
+ tab_widget->addTab(m_saw_folio, tr("Folio"));
- bp_folio_layout->addWidget(label_folio);
- bp_folio_layout->addStretch();
- bp_folio_layout->addWidget(m_context_cb_folio);
- bp_folio_layout->addWidget(m_remove_pb_folio);
-
- folio_layout->addLayout(bp_folio_layout);
- folio_layout->addWidget(m_saw_folio);
-
- tab_widget->addTab(folio_widget, tr("Folio"));
-
//AutoNumbering Tab
m_faw = new FolioAutonumberingW(project());
tab_widget->addTab(m_faw, tr("Folio autonumérotation"));
- m_main_layout = new QHBoxLayout();
- m_main_layout->addWidget(tab_widget);
- setLayout(m_main_layout);
+ QHBoxLayout *main_layout = new QHBoxLayout();
+ main_layout->addWidget(tab_widget);
+ setLayout(main_layout);
}
/**
@@ -354,27 +286,22 @@
* @brief ProjectAutoNumConfigPage::readValuesFromProject
* Read value stored on project, and update display
*/
-void ProjectAutoNumConfigPage::readValuesFromProject() {
- //Conductor Tab
- QList <QString> keys_conductor = m_project->conductorAutoNum().keys();
- if (!keys_conductor.isEmpty()){
- foreach (QString str, keys_conductor) { m_context_cb_conductor-> addItem(str); }
- }
-
- //Element Tab
- QList <QString> keys_element = m_project->elementAutoNum().keys();
- if (!keys_element.isEmpty()){
- foreach (QString str, keys_element) { m_context_cb_element -> addItem(str);}
- }
-
- //Folio Tab
- QList <QString> keys_folio = m_project->folioAutoNum().keys();
- if (!keys_folio.isEmpty()){
- foreach (QString str, keys_folio) { m_context_cb_folio -> addItem(str);}
- }
-
- //Folio AutoNumbering Tab
- m_faw->setContext(keys_folio);
+void ProjectAutoNumConfigPage::readValuesFromProject()
+{
+ //Conductor Tab
+ const QStringList strlc(m_project->conductorAutoNum().keys());
+ m_saw_conductor->contextComboBox()->addItems(strlc);
+
+ //Element Tab
+ const QStringList strle(m_project->elementAutoNum().keys());
+ m_saw_element->contextComboBox()->addItems(strle);
+
+ //Folio Tab
+ const QStringList strlf(m_project->folioAutoNum().keys());
+ m_saw_folio->contextComboBox()->addItems(strlf);
+
+ //Folio AutoNumbering Tab
+ m_faw->setContext(m_project->folioAutoNum().keys());
}
/**
@@ -388,32 +315,27 @@
* @brief ProjectAutoNumConfigPage::buildConnections
* setup some connections
*/
-void ProjectAutoNumConfigPage::buildConnections() {
-
- //connect(m_tab_widget,SIGNAL(currentChanged(int)),this,SLOT(tabChanged(int)));
-
- //Management Tab
+void ProjectAutoNumConfigPage::buildConnections()
+{
+ //Management Tab
connect (m_amw, SIGNAL(applyPressed()), this, SLOT(applyManagement()));
- //Conductor Tab
- connect (m_context_cb_conductor, SIGNAL (currentTextChanged(QString)), m_saw_conductor, SLOT (applyEnableOnContextChanged(QString)));
- connect (m_context_cb_conductor, SIGNAL (currentIndexChanged(QString)), this, SLOT (updateContext_conductor(QString)));
- connect (m_saw_conductor, SIGNAL (applyPressed()), this, SLOT (saveContext_conductor()));
- connect (m_remove_pb_conductor, SIGNAL (clicked()), this, SLOT (removeContext_conductor()));
+ //Conductor Tab
+ connect(m_saw_conductor, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextConductor);
+ connect(m_saw_conductor, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextConductor);
+ connect(m_saw_conductor->contextComboBox(), SIGNAL(currentIndexChanged(QString)), this, SLOT(updateContextConductor(QString)));
//Element Tab
- connect (m_context_cb_element, SIGNAL (currentTextChanged(QString)), m_saw_element, SLOT(applyEnableOnContextChanged(QString)));
- connect (m_context_cb_element, SIGNAL (currentIndexChanged(QString)), this, SLOT (updateContextElement(QString)));
- connect (m_saw_element, SIGNAL (applyPressed()), this, SLOT (saveContextElement()));
- connect (m_remove_pb_element, SIGNAL (clicked()), this, SLOT (removeContextElement()));
+ connect(m_saw_element, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextElement);
+ connect(m_saw_element, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextElement);
+ connect(m_saw_element->contextComboBox(), SIGNAL(currentIndexChanged(QString)), this, SLOT(updateContextElement(QString)));
- //Folio Tab
- connect (m_context_cb_folio, SIGNAL (currentTextChanged(QString)), m_saw_folio, SLOT(applyEnableOnContextChanged(QString)));
- connect (m_context_cb_folio, SIGNAL (currentIndexChanged(QString)), this, SLOT (updateContext_folio(QString)));
- connect (m_saw_folio, SIGNAL (applyPressed()), this, SLOT (saveContext_folio()));
- connect (m_remove_pb_folio, SIGNAL (clicked()), this, SLOT (removeContext_folio()));
+ //Folio Tab
+ connect(m_saw_folio, &SelectAutonumW::applyPressed, this, &ProjectAutoNumConfigPage::saveContextFolio);
+ connect(m_saw_folio, &SelectAutonumW::removeClicked, this, &ProjectAutoNumConfigPage::removeContextFolio);
+ connect(m_saw_folio->contextComboBox(), SIGNAL(currentIndexChanged(QString)), this, SLOT(updateContextFolio(QString)));
- // Auto Folio Numbering
+ // Auto Folio Numbering
connect (m_faw, SIGNAL (applyPressed()), this, SLOT (applyAutoNum()));
}
@@ -422,7 +344,7 @@
* Display the current selected context for conductor
* @param str, key of context stored in project
*/
-void ProjectAutoNumConfigPage::updateContext_conductor(QString str) {
+void ProjectAutoNumConfigPage::updateContextConductor(QString str) {
if (str == tr("Nom de la nouvelle numérotation")) m_saw_conductor -> setContext(NumerotationContext());
else m_saw_conductor ->setContext(m_project->conductorAutoNum(str));
}
@@ -432,7 +354,7 @@
* Display the current selected context for folio
* @param str, key of context stored in project
*/
-void ProjectAutoNumConfigPage::updateContext_folio(QString str) {
+void ProjectAutoNumConfigPage::updateContextFolio(QString str) {
if (str == tr("Nom de la nouvelle numérotation")) m_saw_folio -> setContext(NumerotationContext());
else m_saw_folio ->setContext(m_project->folioAutoNum(str));
}
@@ -462,26 +384,26 @@
{
// 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_element->currentText() == tr("Nom de la nouvelle numérotation"))
+ if (m_saw_element->contextComboBox()->currentText() == tr("Nom de la nouvelle numérotation"))
{
QString title(tr("Sans nom"));
m_project->addElementAutoNum (title, m_saw_element -> toNumContext());
m_project->setCurrrentElementAutonum(title);
- m_context_cb_element->addItem(tr("Sans nom"));
+ m_saw_element->contextComboBox()->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 ( !m_project -> elementAutoNum().keys().contains( m_context_cb_element->currentText()))
+ else if ( !m_project -> elementAutoNum().keys().contains( m_saw_element->contextComboBox()->currentText()))
{
- m_project->addElementAutoNum(m_context_cb_element->currentText(), m_saw_element->toNumContext());
- m_project->setCurrrentElementAutonum(m_context_cb_element->currentText());
- m_context_cb_element->addItem(m_context_cb_element->currentText());
+ m_project->addElementAutoNum(m_saw_element->contextComboBox()->currentText(), m_saw_element->toNumContext());
+ m_project->setCurrrentElementAutonum(m_saw_element->contextComboBox()->currentText());
+ m_saw_element->contextComboBox()->addItem(m_saw_element->contextComboBox()->currentText());
}
// Else, the text already exist in the autonum of the project, just update the context
else
{
- m_project->addElementAutoNum (m_context_cb_element -> currentText(), m_saw_element -> toNumContext());
- m_project->setCurrrentElementAutonum(m_context_cb_element->currentText());
+ m_project->addElementAutoNum (m_saw_element->contextComboBox() -> currentText(), m_saw_element -> toNumContext());
+ m_project->setCurrrentElementAutonum(m_saw_element->contextComboBox()->currentText());
}
}
@@ -492,10 +414,10 @@
void ProjectAutoNumConfigPage::removeContextElement()
{
//if default text, return
- if (m_context_cb_element->currentText() == tr("Nom de la nouvelle numérotation"))
+ if (m_saw_element->contextComboBox()->currentText() == tr("Nom de la nouvelle numérotation"))
return;
- m_project->removeElementAutoNum (m_context_cb_element->currentText());
- m_context_cb_element->removeItem (m_context_cb_element->currentIndex());
+ m_project->removeElementAutoNum (m_saw_element->contextComboBox()->currentText());
+ m_saw_element->contextComboBox()->removeItem (m_saw_element->contextComboBox()->currentIndex());
}
/**
@@ -502,27 +424,28 @@
* @brief ProjectAutoNumConfigPage::saveContext_conductor
* Save the current displayed conductor context in project
*/
-void ProjectAutoNumConfigPage::saveContext_conductor() {
- // 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_conductor-> currentText() == tr("Nom de la nouvelle numérotation"))
+void ProjectAutoNumConfigPage::saveContextConductor()
+{
+ // If the text is the default text "Name of new numerotation" save the edited context
+ // With the the name "No name"
+ if (m_saw_conductor->contextComboBox()-> currentText() == tr("Nom de la nouvelle numérotation"))
{
m_project->addConductorAutoNum (tr("Sans nom"), m_saw_conductor -> toNumContext());
project()->setCurrentConductorAutoNum(tr("Sans nom"));
- m_context_cb_conductor-> addItem(tr("Sans nom"));
+ m_saw_conductor->contextComboBox()-> 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 ( !m_project -> conductorAutoNum().keys().contains( m_context_cb_conductor->currentText()))
+ else if ( !m_project -> conductorAutoNum().keys().contains( m_saw_conductor->contextComboBox()->currentText()))
{
- project()->addConductorAutoNum(m_context_cb_conductor->currentText(), m_saw_conductor->toNumContext());
- project()->setCurrentConductorAutoNum(m_context_cb_conductor->currentText());
- m_context_cb_conductor-> addItem(m_context_cb_conductor->currentText());
+ project()->addConductorAutoNum(m_saw_conductor->contextComboBox()->currentText(), m_saw_conductor->toNumContext());
+ project()->setCurrentConductorAutoNum(m_saw_conductor->contextComboBox()->currentText());
+ m_saw_conductor->contextComboBox()-> addItem(m_saw_conductor->contextComboBox()->currentText());
}
// Else, the text already exist in the autonum of the project, just update the context
else
{
- project()->setCurrentConductorAutoNum(m_context_cb_conductor->currentText());
- m_project->addConductorAutoNum (m_context_cb_conductor-> currentText(), m_saw_conductor -> toNumContext());
+ project()->setCurrentConductorAutoNum(m_saw_conductor->contextComboBox()->currentText());
+ m_project->addConductorAutoNum (m_saw_conductor->contextComboBox()-> currentText(), m_saw_conductor -> toNumContext());
}
project()->conductorAutoNumAdded();
}
@@ -531,21 +454,21 @@
* @brief ProjectAutoNumConfigPage::saveContext_folio
* Save the current displayed folio context in project
*/
-void ProjectAutoNumConfigPage::saveContext_folio() {
+void ProjectAutoNumConfigPage::saveContextFolio() {
// 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_folio -> currentText() == tr("Nom de la nouvelle numérotation")) {
+ if (m_saw_folio->contextComboBox() -> currentText() == tr("Nom de la nouvelle numérotation")) {
m_project->addFolioAutoNum (tr("Sans nom"), m_saw_folio -> toNumContext());
- m_context_cb_folio -> addItem(tr("Sans nom"));
+ m_saw_folio->contextComboBox() -> 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 ( !m_project -> folioAutoNum().keys().contains( m_context_cb_folio->currentText())) {
- project()->addFolioAutoNum(m_context_cb_folio->currentText(), m_saw_folio->toNumContext());
- m_context_cb_folio -> addItem(m_context_cb_folio->currentText());
+ else if ( !m_project -> folioAutoNum().keys().contains( m_saw_folio->contextComboBox()->currentText())) {
+ project()->addFolioAutoNum(m_saw_folio->contextComboBox()->currentText(), m_saw_folio->toNumContext());
+ m_saw_folio->contextComboBox() -> addItem(m_saw_folio->contextComboBox()->currentText());
}
// Else, the text already exist in the autonum of the project, just update the context
else {
- m_project->addFolioAutoNum (m_context_cb_folio -> currentText(), m_saw_folio -> toNumContext());
+ m_project->addFolioAutoNum (m_saw_folio->contextComboBox() -> currentText(), m_saw_folio -> toNumContext());
}
project()->folioAutoNumAdded();
}
@@ -672,11 +595,11 @@
* @brief ProjectAutoNumConfigPage::removeContext
* Remove from project the current conductor numerotation context
*/
-void ProjectAutoNumConfigPage::removeContext_conductor() {
+void ProjectAutoNumConfigPage::removeContextConductor() {
//if default text, return
- if ( m_context_cb_conductor-> currentText() == tr("Nom de la nouvelle numérotation") ) return;
- m_project -> removeConductorAutoNum (m_context_cb_conductor-> currentText() );
- m_context_cb_conductor-> removeItem (m_context_cb_conductor-> currentIndex() );
+ if ( m_saw_conductor->contextComboBox()-> currentText() == tr("Nom de la nouvelle numérotation") ) return;
+ m_project -> removeConductorAutoNum (m_saw_conductor->contextComboBox()-> currentText() );
+ m_saw_conductor->contextComboBox()-> removeItem (m_saw_conductor->contextComboBox()-> currentIndex() );
project()->conductorAutoNumRemoved();
}
@@ -684,11 +607,11 @@
* @brief ProjectAutoNumConfigPage::removeContext_folio
* Remove from project the current folio numerotation context
*/
-void ProjectAutoNumConfigPage::removeContext_folio() {
+void ProjectAutoNumConfigPage::removeContextFolio() {
//if default text, return
- if ( m_context_cb_folio -> currentText() == tr("Nom de la nouvelle numérotation") ) return;
- m_project -> removeFolioAutoNum (m_context_cb_folio -> currentText() );
- m_context_cb_folio -> removeItem (m_context_cb_folio -> currentIndex() );
+ if ( m_saw_folio->contextComboBox() -> currentText() == tr("Nom de la nouvelle numérotation") ) return;
+ m_project -> removeFolioAutoNum (m_saw_folio->contextComboBox() -> currentText() );
+ m_saw_folio->contextComboBox() -> removeItem (m_saw_folio->contextComboBox() -> currentIndex() );
project()->folioAutoNumRemoved();
}
Modified: trunk/sources/projectconfigpages.h
===================================================================
--- trunk/sources/projectconfigpages.h 2017-02-26 18:30:34 UTC (rev 4920)
+++ trunk/sources/projectconfigpages.h 2017-02-26 19:39:36 UTC (rev 4921)
@@ -28,13 +28,9 @@
class ReportPropertieWidget;
class XRefPropertiesWidget;
class SelectAutonumW;
-class QComboBox;
-class QPushButton;
class FolioAutonumberingW;
class FormulaAutonumberingW;
class AutoNumberingManagementW;
-class QScrollArea;
-class QHBoxLayout;
/**
This class, derived from ConfigPage, aims at providing the basic skeleton
@@ -140,12 +136,12 @@
private:
void buildConnections();
private slots:
- void updateContext_conductor(QString);//conductor
- void saveContext_conductor();
- void removeContext_conductor();
- void updateContext_folio(QString);//folio
- void saveContext_folio();
- void removeContext_folio();
+ void updateContextConductor(QString);//conductor
+ void saveContextConductor();
+ void removeContextConductor();
+ void updateContextFolio(QString);//folio
+ void saveContextFolio();
+ void removeContextFolio();
void updateContextElement(QString);//element
void saveContextElement();
void removeContextElement();
@@ -161,19 +157,6 @@
//Attributes
private:
- QHBoxLayout *m_main_layout = nullptr;
- QWidget *m_management_tab_widget;
- QWidget *conductor_tab_widget;
- QWidget *element_tab_widget;
- QWidget *folio_tab_widget;
- QWidget *autoNumbering_tab_widget;
- QScrollArea *scrollArea;
- QComboBox *m_context_cb_conductor;
- QComboBox *m_context_cb_folio;
- QComboBox *m_context_cb_element;
- QPushButton *m_remove_pb_conductor;
- QPushButton *m_remove_pb_folio;
- QPushButton *m_remove_pb_element;
SelectAutonumW *m_saw_conductor;
SelectAutonumW *m_saw_folio;
SelectAutonumW *m_saw_element;