mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 22:00:35 +01:00
Autonumbering dock widget : add a "configure" push button to quickly open the dialog used for create the auto numbering rules.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4925 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -22,18 +22,19 @@
|
|||||||
#include "diagram.h"
|
#include "diagram.h"
|
||||||
#include "titleblockproperties.h"
|
#include "titleblockproperties.h"
|
||||||
#include "numerotationcontext.h"
|
#include "numerotationcontext.h"
|
||||||
|
#include "projectpropertiesdialog.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief AutoNumberingDockWidget::AutoNumberingDockWidget
|
* @brief AutoNumberingDockWidget::AutoNumberingDockWidget
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param parent : parent widget
|
* @param parent : parent widget
|
||||||
*/
|
*/
|
||||||
AutoNumberingDockWidget::AutoNumberingDockWidget(QWidget *parent, QETProject *project) :
|
AutoNumberingDockWidget::AutoNumberingDockWidget(QWidget *parent) :
|
||||||
QDockWidget(parent),
|
QDockWidget(parent),
|
||||||
ui(new Ui::AutoNumberingDockWidget),
|
ui(new Ui::AutoNumberingDockWidget)
|
||||||
m_project(project)
|
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
this->setDisabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -57,28 +58,63 @@ void AutoNumberingDockWidget::clear()
|
|||||||
ui->m_folio_cb->clear();
|
ui->m_folio_cb->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AutoNumberingDockWidget::projectClosed()
|
||||||
|
{
|
||||||
|
m_project = nullptr;
|
||||||
|
m_project_view = nullptr;
|
||||||
|
clear();
|
||||||
|
this->setDisabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief AutoNumberingDockWidget::setProject
|
* @brief AutoNumberingDockWidget::setProject
|
||||||
* @param project: project to be setted
|
* @param project: project to be setted
|
||||||
* @param projectview: projectview to be setted
|
* @param projectview: projectview to be setted
|
||||||
* assign Project and ProjectView, connect all signals and setContext
|
* assign Project and ProjectView, connect all signals and setContext
|
||||||
*/
|
*/
|
||||||
void AutoNumberingDockWidget::setProject(QETProject *project, ProjectView *projectview) {
|
void AutoNumberingDockWidget::setProject(QETProject *project, ProjectView *projectview)
|
||||||
|
{
|
||||||
|
//Disconnect previous project
|
||||||
|
if (m_project && m_project_view)
|
||||||
|
{
|
||||||
|
//Conductor Signals
|
||||||
|
disconnect(m_project, SIGNAL(conductorAutoNumChanged()),this,SLOT(conductorAutoNumChanged()));
|
||||||
|
disconnect (m_project,SIGNAL(conductorAutoNumRemoved()), this,SLOT(conductorAutoNumChanged()));
|
||||||
|
disconnect (m_project,SIGNAL(conductorAutoNumAdded()), this,SLOT(conductorAutoNumChanged()));
|
||||||
|
disconnect(m_project_view,SIGNAL(diagramActivated(DiagramView*)),this,SLOT(setConductorActive(DiagramView*)));
|
||||||
|
|
||||||
|
//Element Signals
|
||||||
|
disconnect (m_project,SIGNAL(elementAutoNumRemoved(QString)), this,SLOT(elementAutoNumChanged()));
|
||||||
|
disconnect (m_project,SIGNAL(elementAutoNumAdded(QString)), this,SLOT(elementAutoNumChanged()));
|
||||||
|
|
||||||
|
//Folio Signals
|
||||||
|
disconnect (m_project,SIGNAL(folioAutoNumRemoved()), this,SLOT(folioAutoNumChanged()));
|
||||||
|
disconnect (m_project,SIGNAL(folioAutoNumAdded()), this,SLOT(folioAutoNumChanged()));
|
||||||
|
disconnect (this,
|
||||||
|
SIGNAL(folioAutoNumChanged(QString)),
|
||||||
|
&m_project_view->currentDiagram()->diagram()->border_and_titleblock,
|
||||||
|
SLOT (slot_setAutoPageNum(QString)));
|
||||||
|
disconnect(m_project, SIGNAL(defaultTitleBlockPropertiesChanged()),this,SLOT(setActive()));
|
||||||
|
|
||||||
|
//Conductor, Element and Folio Signals
|
||||||
|
disconnect(m_project, &QETProject::destroyed, this, &AutoNumberingDockWidget::projectClosed);
|
||||||
|
}
|
||||||
|
|
||||||
m_project = project;
|
m_project = project;
|
||||||
m_project_view = projectview;
|
m_project_view = projectview;
|
||||||
|
this->setEnabled(true);
|
||||||
|
|
||||||
//Conductor Signals
|
//Conductor Signals
|
||||||
connect(m_project, SIGNAL(conductorAutoNumChanged()),this,SLOT(conductorAutoNumChanged()));
|
connect(m_project, SIGNAL(conductorAutoNumChanged()),this,SLOT(conductorAutoNumChanged()));
|
||||||
connect (m_project,SIGNAL(conductorAutoNumRemoved()), this,SLOT(conductorAutoNumChanged()));
|
connect(m_project,SIGNAL(conductorAutoNumRemoved()), this,SLOT(conductorAutoNumChanged()));
|
||||||
connect (m_project,SIGNAL(conductorAutoNumAdded()), this,SLOT(conductorAutoNumChanged()));
|
connect(m_project,SIGNAL(conductorAutoNumAdded()), this,SLOT(conductorAutoNumChanged()));
|
||||||
connect(m_project_view,SIGNAL(diagramActivated(DiagramView*)),this,SLOT(setConductorActive(DiagramView*)));
|
connect(m_project_view,SIGNAL(diagramActivated(DiagramView*)),this,SLOT(setConductorActive(DiagramView*)));
|
||||||
|
|
||||||
//Element Signals
|
//Element Signals
|
||||||
connect (m_project,SIGNAL(elementAutoNumRemoved(QString)), this,SLOT(elementAutoNumChanged()));
|
connect (m_project,SIGNAL(elementAutoNumRemoved(QString)), this,SLOT(elementAutoNumChanged()));
|
||||||
connect (m_project,SIGNAL(elementAutoNumAdded(QString)), this,SLOT(elementAutoNumChanged()));
|
connect (m_project,SIGNAL(elementAutoNumAdded(QString)), this,SLOT(elementAutoNumChanged()));
|
||||||
|
|
||||||
//Folio Signals
|
//Folio Signals
|
||||||
connect (m_project,SIGNAL(folioAutoNumRemoved()), this,SLOT(folioAutoNumChanged()));
|
connect (m_project,SIGNAL(folioAutoNumRemoved()), this,SLOT(folioAutoNumChanged()));
|
||||||
connect (m_project,SIGNAL(folioAutoNumAdded()), this,SLOT(folioAutoNumChanged()));
|
connect (m_project,SIGNAL(folioAutoNumAdded()), this,SLOT(folioAutoNumChanged()));
|
||||||
connect (this,
|
connect (this,
|
||||||
@@ -87,10 +123,10 @@ void AutoNumberingDockWidget::setProject(QETProject *project, ProjectView *proje
|
|||||||
SLOT (slot_setAutoPageNum(QString)));
|
SLOT (slot_setAutoPageNum(QString)));
|
||||||
connect(m_project, SIGNAL(defaultTitleBlockPropertiesChanged()),this,SLOT(setActive()));
|
connect(m_project, SIGNAL(defaultTitleBlockPropertiesChanged()),this,SLOT(setActive()));
|
||||||
|
|
||||||
//Conductor, Element and Folio Signals
|
//Conductor, Element and Folio Signals
|
||||||
connect(m_project_view,SIGNAL(projectClosed(ProjectView*)),this,SLOT(clear()));
|
connect(m_project, &QETProject::destroyed, this, &AutoNumberingDockWidget::projectClosed);
|
||||||
|
|
||||||
//Set Combobox Context
|
//Set Combobox Context
|
||||||
setContext();
|
setContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,3 +297,13 @@ void AutoNumberingDockWidget::on_m_folio_cb_activated(int) {
|
|||||||
}
|
}
|
||||||
emit(folioAutoNumChanged(current_autonum));
|
emit(folioAutoNumChanged(current_autonum));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AutoNumberingDockWidget::on_m_configure_pb_clicked()
|
||||||
|
{
|
||||||
|
if (m_project)
|
||||||
|
{
|
||||||
|
ProjectPropertiesDialog ppd (m_project, this);
|
||||||
|
ppd.setCurrentPage(ProjectPropertiesDialog::Autonum);
|
||||||
|
ppd.exec();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class AutoNumberingDockWidget : public QDockWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AutoNumberingDockWidget(QWidget *parent = 0, QETProject *project = nullptr);
|
explicit AutoNumberingDockWidget(QWidget *parent = 0);
|
||||||
~AutoNumberingDockWidget();
|
~AutoNumberingDockWidget();
|
||||||
|
|
||||||
void setContext();
|
void setContext();
|
||||||
@@ -49,14 +49,17 @@ class AutoNumberingDockWidget : public QDockWidget
|
|||||||
void elementAutoNumChanged();
|
void elementAutoNumChanged();
|
||||||
void folioAutoNumChanged();
|
void folioAutoNumChanged();
|
||||||
void clear();
|
void clear();
|
||||||
|
void projectClosed();
|
||||||
|
|
||||||
|
void on_m_configure_pb_clicked();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void folioAutoNumChanged(QString);
|
void folioAutoNumChanged(QString);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AutoNumberingDockWidget *ui;
|
Ui::AutoNumberingDockWidget *ui;
|
||||||
QETProject* m_project;
|
QETProject* m_project = nullptr;
|
||||||
ProjectView* m_project_view;
|
ProjectView* m_project_view = nullptr;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,89 +6,77 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>334</width>
|
||||||
<height>300</height>
|
<height>335</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Autonumerotation Séléction</string>
|
<string>Autonumerotation Séléction</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="dockWidgetContents">
|
<widget class="QWidget" name="dockWidgetContents">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="sizeConstraint">
|
<item row="3" column="1">
|
||||||
<enum>QLayout::SetMaximumSize</enum>
|
<widget class="QComboBox" name="m_element_cb"/>
|
||||||
</property>
|
</item>
|
||||||
<property name="leftMargin">
|
<item row="4" column="0">
|
||||||
<number>0</number>
|
<widget class="QLabel" name="label_3">
|
||||||
</property>
|
<property name="text">
|
||||||
<property name="topMargin">
|
<string>Folio</string>
|
||||||
<number>0</number>
|
</property>
|
||||||
</property>
|
</widget>
|
||||||
<property name="rightMargin">
|
</item>
|
||||||
<number>0</number>
|
<item row="2" column="1">
|
||||||
</property>
|
<widget class="QComboBox" name="m_conductor_cb"/>
|
||||||
<property name="bottomMargin">
|
</item>
|
||||||
<number>0</number>
|
<item row="3" column="0">
|
||||||
</property>
|
<widget class="QLabel" name="label">
|
||||||
<item>
|
<property name="text">
|
||||||
<widget class="QGroupBox" name="groupBox">
|
<string>Element</string>
|
||||||
<property name="title">
|
</property>
|
||||||
<string/>
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>Conductor</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QComboBox" name="m_folio_cb"/>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<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="5" column="1">
|
||||||
|
<widget class="QPushButton" name="m_configure_pb">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Configurer les règles d'auto numérotation</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Configurer</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../qelectrotech.qrc">
|
||||||
|
<normaloff>:/ico/16x16/configure.png</normaloff>:/ico/16x16/configure.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
||||||
<item>
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Element</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QComboBox" name="m_element_cb"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QComboBox" name="m_conductor_cb"/>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label_2">
|
|
||||||
<property name="text">
|
|
||||||
<string>Conductor</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Folio</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<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="2" column="1">
|
|
||||||
<widget class="QComboBox" name="m_folio_cb"/>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="../../../qelectrotech.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user