mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-06 05:10:52 +01:00
Cross ref item: user can select if xref must be displayed has a table or a contacts list.
Option is found in config dialog under the tab Cross ref. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3033 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -31,6 +31,7 @@ XRefPropertiesWidget::XRefPropertiesWidget(XRefProperties properties, QWidget *p
|
||||
m_properties(properties)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->m_display_has_cross_rb, SIGNAL(toggled(bool)), ui->m_show_power_cb, SLOT(setEnabled(bool)));
|
||||
updateDisplay();
|
||||
}
|
||||
|
||||
@@ -40,6 +41,7 @@ XRefPropertiesWidget::XRefPropertiesWidget(XRefProperties properties, QWidget *p
|
||||
*/
|
||||
XRefPropertiesWidget::~XRefPropertiesWidget()
|
||||
{
|
||||
disconnect(ui->m_display_has_cross_rb, SIGNAL(toggled(bool)), ui->m_show_power_cb, SLOT(setEnabled(bool)));
|
||||
delete ui;
|
||||
}
|
||||
|
||||
@@ -58,7 +60,10 @@ void XRefPropertiesWidget::setProperties(const XRefProperties &properties) {
|
||||
* @return the propertie edited by this widget
|
||||
*/
|
||||
XRefProperties XRefPropertiesWidget::properties() {
|
||||
m_properties.setShowPowerContac(ui->cb_show_power->isChecked());
|
||||
if (ui->m_display_has_cross_rb->isChecked()) m_properties.setDisplayHas(XRefProperties::Cross);
|
||||
else if (ui->m_display_has_contacts_rb->isChecked()) m_properties.setDisplayHas(XRefProperties::Contacts);
|
||||
m_properties.setShowPowerContac(ui->m_show_power_cb->isChecked());
|
||||
|
||||
return m_properties;
|
||||
}
|
||||
|
||||
@@ -68,7 +73,9 @@ XRefProperties XRefPropertiesWidget::properties() {
|
||||
* @param ro
|
||||
*/
|
||||
void XRefPropertiesWidget::setReadOnly(bool ro) {
|
||||
ui->cb_show_power->setDisabled(ro);
|
||||
ui->m_display_has_cross_rb->setDisabled(ro);
|
||||
ui->m_display_has_contacts_rb->setDisabled(ro);
|
||||
ui->m_show_power_cb->setDisabled(ro);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,5 +83,14 @@ void XRefPropertiesWidget::setReadOnly(bool ro) {
|
||||
* Update display with the content of the properties
|
||||
*/
|
||||
void XRefPropertiesWidget::updateDisplay() {
|
||||
ui->cb_show_power->setChecked(m_properties.showPowerContact());
|
||||
XRefProperties::DisplayHas dh = m_properties.displayHas();
|
||||
if (dh == XRefProperties::Cross) {
|
||||
ui->m_display_has_cross_rb->setChecked(true);
|
||||
}
|
||||
else if (dh == XRefProperties::Contacts) {
|
||||
ui->m_display_has_contacts_rb->setChecked(true);
|
||||
}
|
||||
|
||||
ui->m_show_power_cb->setChecked(m_properties.showPowerContact());
|
||||
ui->m_show_power_cb->setDisabled(!ui->m_display_has_cross_rb->isChecked());
|
||||
}
|
||||
|
||||
@@ -15,7 +15,34 @@
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="cb_show_power">
|
||||
<widget class="QGroupBox" name="m_display_gb">
|
||||
<property name="title">
|
||||
<string>Représentation:</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_display_has_cross_rb">
|
||||
<property name="text">
|
||||
<string>Afficher en croix</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_display_has_contacts_rb">
|
||||
<property name="text">
|
||||
<string>Afficher en contacts</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="m_show_power_cb">
|
||||
<property name="text">
|
||||
<string>Afficher les contacts de puissance dans la croix</string>
|
||||
</property>
|
||||
|
||||
Reference in New Issue
Block a user