mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Added view mode in Cross References - included Folio Field
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4491 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -331,7 +331,7 @@ void ProjectAutoNumConfigPage::initLayout() {
|
|||||||
//Auto Numbering Tab
|
//Auto Numbering Tab
|
||||||
tab_widget->addTab(autoNumbering_tab_widget,tr ("Folio Auto Numbering"));
|
tab_widget->addTab(autoNumbering_tab_widget,tr ("Folio Auto Numbering"));
|
||||||
|
|
||||||
tab_widget->resize(440,590);
|
tab_widget->resize(455,590);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -514,7 +514,7 @@ void ProjectAutoNumConfigPage::tabChanged(int i){
|
|||||||
tab_widget->resize(470,tab_widget->height());
|
tab_widget->resize(470,tab_widget->height());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tab_widget->resize(440,tab_widget->height());
|
tab_widget->resize(455,tab_widget->height());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ XRefProperties::XRefProperties()
|
|||||||
m_show_power_ctc = true;
|
m_show_power_ctc = true;
|
||||||
m_display = Cross;
|
m_display = Cross;
|
||||||
m_snap_to = Bottom;
|
m_snap_to = Bottom;
|
||||||
|
m_view_mode = Index;
|
||||||
m_prefix_keys << "power" << "delay" << "switch";
|
m_prefix_keys << "power" << "delay" << "switch";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,6 +41,8 @@ void XRefProperties::toSettings(QSettings &settings, const QString prefix) const
|
|||||||
settings.setValue(prefix + "showpowerctc", m_show_power_ctc);
|
settings.setValue(prefix + "showpowerctc", m_show_power_ctc);
|
||||||
QString display = m_display == Cross? "cross" : "contacts";
|
QString display = m_display == Cross? "cross" : "contacts";
|
||||||
settings.setValue(prefix + "displayhas", display);
|
settings.setValue(prefix + "displayhas", display);
|
||||||
|
QString view_mode = m_view_mode == Index? "index" : "foliolabel";
|
||||||
|
settings.setValue(prefix + "viewmode", view_mode);
|
||||||
QString snap = m_snap_to == Bottom? "bottom" : "label";
|
QString snap = m_snap_to == Bottom? "bottom" : "label";
|
||||||
settings.setValue(prefix + "snapto", snap);
|
settings.setValue(prefix + "snapto", snap);
|
||||||
foreach (QString key, m_prefix.keys()) {
|
foreach (QString key, m_prefix.keys()) {
|
||||||
@@ -57,6 +60,8 @@ void XRefProperties::fromSettings(const QSettings &settings, const QString prefi
|
|||||||
m_show_power_ctc = settings.value(prefix + "showpowerctc", false).toBool();
|
m_show_power_ctc = settings.value(prefix + "showpowerctc", false).toBool();
|
||||||
QString display = settings.value(prefix + "displayhas", "cross").toString();
|
QString display = settings.value(prefix + "displayhas", "cross").toString();
|
||||||
display == "cross"? m_display = Cross : m_display = Contacts;
|
display == "cross"? m_display = Cross : m_display = Contacts;
|
||||||
|
QString view_mode = settings.value(prefix + "viewmode", "index").toString();
|
||||||
|
view_mode == "index"? m_view_mode = Index : m_view_mode = FolioLabel;
|
||||||
QString snap = settings.value(prefix + "snapto", "label").toString();
|
QString snap = settings.value(prefix + "snapto", "label").toString();
|
||||||
snap == "bottom"? m_snap_to = Bottom : m_snap_to = Label;
|
snap == "bottom"? m_snap_to = Bottom : m_snap_to = Label;
|
||||||
foreach (QString key, m_prefix_keys) {
|
foreach (QString key, m_prefix_keys) {
|
||||||
@@ -73,6 +78,8 @@ void XRefProperties::toXml(QDomElement &xml_element) const {
|
|||||||
xml_element.setAttribute("showpowerctc", m_show_power_ctc? "true" : "false");
|
xml_element.setAttribute("showpowerctc", m_show_power_ctc? "true" : "false");
|
||||||
QString display = m_display == Cross? "cross" : "contacts";
|
QString display = m_display == Cross? "cross" : "contacts";
|
||||||
xml_element.setAttribute("displayhas", display);
|
xml_element.setAttribute("displayhas", display);
|
||||||
|
QString view_mode = m_view_mode == Index? "index" : "foliolabel";
|
||||||
|
xml_element.setAttribute("viewmode", view_mode);
|
||||||
QString snap = m_snap_to == Bottom? "bottom" : "label";
|
QString snap = m_snap_to == Bottom? "bottom" : "label";
|
||||||
xml_element.setAttribute("snapto", snap);
|
xml_element.setAttribute("snapto", snap);
|
||||||
foreach (QString key, m_prefix.keys()) {
|
foreach (QString key, m_prefix.keys()) {
|
||||||
@@ -89,6 +96,8 @@ void XRefProperties::fromXml(const QDomElement &xml_element) {
|
|||||||
m_show_power_ctc = xml_element.attribute("showpowerctc") == "true";
|
m_show_power_ctc = xml_element.attribute("showpowerctc") == "true";
|
||||||
QString display = xml_element.attribute("displayhas", "cross");
|
QString display = xml_element.attribute("displayhas", "cross");
|
||||||
display == "cross"? m_display = Cross : m_display = Contacts;
|
display == "cross"? m_display = Cross : m_display = Contacts;
|
||||||
|
QString view_mode = xml_element.attribute("viewmode", "index");
|
||||||
|
view_mode == "index"? m_view_mode = Index : m_view_mode = FolioLabel;
|
||||||
QString snap = xml_element.attribute("snapto", "label");
|
QString snap = xml_element.attribute("snapto", "label");
|
||||||
snap == "bottom"? m_snap_to = Bottom : m_snap_to = Label;
|
snap == "bottom"? m_snap_to = Bottom : m_snap_to = Label;
|
||||||
foreach (QString key, m_prefix_keys) {
|
foreach (QString key, m_prefix_keys) {
|
||||||
@@ -125,6 +134,7 @@ QHash<QString, XRefProperties> XRefProperties::defaultProperties()
|
|||||||
bool XRefProperties::operator ==(const XRefProperties &xrp) const{
|
bool XRefProperties::operator ==(const XRefProperties &xrp) const{
|
||||||
return (m_show_power_ctc == xrp.m_show_power_ctc &&
|
return (m_show_power_ctc == xrp.m_show_power_ctc &&
|
||||||
m_display == xrp.m_display &&
|
m_display == xrp.m_display &&
|
||||||
|
m_view_mode == xrp.m_view_mode &&
|
||||||
m_snap_to == xrp.m_snap_to &&
|
m_snap_to == xrp.m_snap_to &&
|
||||||
m_prefix == xrp.m_prefix);
|
m_prefix == xrp.m_prefix);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ class XRefProperties : public PropertiesInterface
|
|||||||
Contacts
|
Contacts
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum ViewMode {
|
||||||
|
Index,
|
||||||
|
FolioLabel
|
||||||
|
};
|
||||||
|
|
||||||
enum SnapTo {
|
enum SnapTo {
|
||||||
Bottom,
|
Bottom,
|
||||||
Label
|
Label
|
||||||
@@ -56,6 +61,9 @@ class XRefProperties : public PropertiesInterface
|
|||||||
void setDisplayHas (const DisplayHas dh) {m_display = dh;}
|
void setDisplayHas (const DisplayHas dh) {m_display = dh;}
|
||||||
DisplayHas displayHas () const {return m_display;}
|
DisplayHas displayHas () const {return m_display;}
|
||||||
|
|
||||||
|
void setViewMode (const ViewMode vm) {m_view_mode = vm;}
|
||||||
|
ViewMode viewMode () const {return m_view_mode;}
|
||||||
|
|
||||||
void setSnapTo (const SnapTo st) {m_snap_to = st;}
|
void setSnapTo (const SnapTo st) {m_snap_to = st;}
|
||||||
SnapTo snapTo () const {return m_snap_to;}
|
SnapTo snapTo () const {return m_snap_to;}
|
||||||
|
|
||||||
@@ -65,6 +73,7 @@ class XRefProperties : public PropertiesInterface
|
|||||||
private:
|
private:
|
||||||
bool m_show_power_ctc;
|
bool m_show_power_ctc;
|
||||||
DisplayHas m_display;
|
DisplayHas m_display;
|
||||||
|
ViewMode m_view_mode;
|
||||||
SnapTo m_snap_to;
|
SnapTo m_snap_to;
|
||||||
QHash <QString, QString> m_prefix;
|
QHash <QString, QString> m_prefix;
|
||||||
QStringList m_prefix_keys;
|
QStringList m_prefix_keys;
|
||||||
|
|||||||
@@ -89,8 +89,16 @@ QPainterPath CrossRefItem::shape() const{
|
|||||||
* if @add_prefix is true, prefix (for power and delay contact) is added to the poistion text.
|
* if @add_prefix is true, prefix (for power and delay contact) is added to the poistion text.
|
||||||
*/
|
*/
|
||||||
QString CrossRefItem::elementPositionText(const Element *elmt, const bool &add_prefix) const{
|
QString CrossRefItem::elementPositionText(const Element *elmt, const bool &add_prefix) const{
|
||||||
|
|
||||||
QString txt;
|
QString txt;
|
||||||
txt += QString::number(elmt->diagram()->folioIndex() + 1);
|
XRefProperties::ViewMode vw = m_properties.viewMode();
|
||||||
|
if (vw == XRefProperties::Index)
|
||||||
|
{
|
||||||
|
txt += QString::number(elmt->diagram()->folioIndex() + 1);
|
||||||
|
}
|
||||||
|
else if (vw == XRefProperties::FolioLabel){
|
||||||
|
txt += elmt->diagram()->border_and_titleblock.folio();
|
||||||
|
}
|
||||||
txt += "-";
|
txt += "-";
|
||||||
txt += elmt->diagram()->convertPosition(elmt -> scenePos()).toString();
|
txt += elmt->diagram()->convertPosition(elmt -> scenePos()).toString();
|
||||||
if (add_prefix) {
|
if (add_prefix) {
|
||||||
|
|||||||
@@ -289,7 +289,7 @@
|
|||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QComboBox" name="auto_page_cb">
|
<widget class="QComboBox" name="auto_page_cb">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@@ -299,7 +299,7 @@
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QPushButton" name="m_edit_autofolionum_pb">
|
<widget class="QPushButton" name="m_edit_autofolionum_pb">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@@ -323,6 +323,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="7" column="1">
|
<item row="7" column="1">
|
||||||
<widget class="QLabel" name="label_9">
|
<widget class="QLabel" name="label_9">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Page Num:</string>
|
<string>Page Num:</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -344,23 +350,23 @@
|
|||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Vous pouvez définir ici vos propres associations noms/valeurs pour que le cartouche en tienne compte. Exemple :
|
<string>Vous pouvez définir ici vos propres associations noms/valeurs pour que le cartouche en tienne compte. Exemple :
|
||||||
associer le nom "volta" et la valeur "1745" remplacera %{volta} par 1745 dans le cartouche.</string>
|
associer le nom "volta" et la valeur "1745" remplacera %{volta} par 1745 dans le cartouche.</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</item>
|
||||||
</item>
|
</layout>
|
||||||
</layout>
|
</widget>
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -110,6 +110,8 @@ void XRefPropertiesWidget::saveProperties(int index) {
|
|||||||
|
|
||||||
if (ui->m_display_has_cross_rb->isChecked()) xrp.setDisplayHas(XRefProperties::Cross);
|
if (ui->m_display_has_cross_rb->isChecked()) xrp.setDisplayHas(XRefProperties::Cross);
|
||||||
else if (ui->m_display_has_contacts_rb->isChecked()) xrp.setDisplayHas(XRefProperties::Contacts);
|
else if (ui->m_display_has_contacts_rb->isChecked()) xrp.setDisplayHas(XRefProperties::Contacts);
|
||||||
|
if (ui->m_display_folio_index_rb->isChecked()) xrp.setViewMode (XRefProperties::Index);
|
||||||
|
else if (ui->m_display_folio_label_rb->isChecked()) xrp.setViewMode (XRefProperties::FolioLabel);
|
||||||
if (ui->m_snap_to_cb->itemData(ui->m_snap_to_cb->currentIndex()).toString() == "bottom")
|
if (ui->m_snap_to_cb->itemData(ui->m_snap_to_cb->currentIndex()).toString() == "bottom")
|
||||||
xrp.setSnapTo(XRefProperties::Bottom);
|
xrp.setSnapTo(XRefProperties::Bottom);
|
||||||
else xrp.setSnapTo(XRefProperties::Label);
|
else xrp.setSnapTo(XRefProperties::Label);
|
||||||
@@ -137,6 +139,14 @@ void XRefPropertiesWidget::updateDisplay() {
|
|||||||
ui->m_display_has_contacts_rb->setChecked(true);
|
ui->m_display_has_contacts_rb->setChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XRefProperties::ViewMode vw = xrp.viewMode();
|
||||||
|
if (vw == XRefProperties::Index) {
|
||||||
|
ui->m_display_folio_index_rb->setChecked(true);
|
||||||
|
}
|
||||||
|
else if (vw == XRefProperties::FolioLabel) {
|
||||||
|
ui->m_display_folio_label_rb->setChecked(true);
|
||||||
|
}
|
||||||
|
|
||||||
if (xrp.snapTo() == XRefProperties::Bottom)
|
if (xrp.snapTo() == XRefProperties::Bottom)
|
||||||
ui->m_snap_to_cb->setCurrentIndex(ui->m_snap_to_cb->findData("bottom"));
|
ui->m_snap_to_cb->setCurrentIndex(ui->m_snap_to_cb->findData("bottom"));
|
||||||
else ui->m_snap_to_cb->setCurrentIndex(ui->m_snap_to_cb->findData("label"));
|
else ui->m_snap_to_cb->setCurrentIndex(ui->m_snap_to_cb->findData("label"));
|
||||||
|
|||||||
@@ -49,19 +49,56 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="m_display_has_cross_rb">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<property name="text">
|
<item>
|
||||||
<string>Afficher en croix</string>
|
<widget class="QRadioButton" name="m_display_has_contacts_rb">
|
||||||
</property>
|
<property name="text">
|
||||||
</widget>
|
<string>Afficher en contacts</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="m_display_has_cross_rb">
|
||||||
|
<property name="text">
|
||||||
|
<string>Afficher en croix</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="m_display_has_contacts_rb">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="text">
|
<property name="title">
|
||||||
<string>Afficher en contacts</string>
|
<string>View Mode</string>
|
||||||
</property>
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout_6">
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="m_display_folio_label_rb">
|
||||||
|
<property name="text">
|
||||||
|
<string>View Folio Label</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoExclusive">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QRadioButton" name="m_display_folio_index_rb">
|
||||||
|
<property name="text">
|
||||||
|
<string>View Folio Index</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoExclusive">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
Reference in New Issue
Block a user