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
|
||||
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());
|
||||
}
|
||||
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_display = Cross;
|
||||
m_snap_to = Bottom;
|
||||
m_view_mode = Index;
|
||||
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);
|
||||
QString display = m_display == Cross? "cross" : "contacts";
|
||||
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";
|
||||
settings.setValue(prefix + "snapto", snap);
|
||||
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();
|
||||
QString display = settings.value(prefix + "displayhas", "cross").toString();
|
||||
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();
|
||||
snap == "bottom"? m_snap_to = Bottom : m_snap_to = Label;
|
||||
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");
|
||||
QString display = m_display == Cross? "cross" : "contacts";
|
||||
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";
|
||||
xml_element.setAttribute("snapto", snap);
|
||||
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";
|
||||
QString display = xml_element.attribute("displayhas", "cross");
|
||||
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");
|
||||
snap == "bottom"? m_snap_to = Bottom : m_snap_to = Label;
|
||||
foreach (QString key, m_prefix_keys) {
|
||||
@@ -125,6 +134,7 @@ QHash<QString, XRefProperties> XRefProperties::defaultProperties()
|
||||
bool XRefProperties::operator ==(const XRefProperties &xrp) const{
|
||||
return (m_show_power_ctc == xrp.m_show_power_ctc &&
|
||||
m_display == xrp.m_display &&
|
||||
m_view_mode == xrp.m_view_mode &&
|
||||
m_snap_to == xrp.m_snap_to &&
|
||||
m_prefix == xrp.m_prefix);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,11 @@ class XRefProperties : public PropertiesInterface
|
||||
Contacts
|
||||
};
|
||||
|
||||
enum ViewMode {
|
||||
Index,
|
||||
FolioLabel
|
||||
};
|
||||
|
||||
enum SnapTo {
|
||||
Bottom,
|
||||
Label
|
||||
@@ -56,6 +61,9 @@ class XRefProperties : public PropertiesInterface
|
||||
void setDisplayHas (const DisplayHas dh) {m_display = dh;}
|
||||
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;}
|
||||
SnapTo snapTo () const {return m_snap_to;}
|
||||
|
||||
@@ -65,6 +73,7 @@ class XRefProperties : public PropertiesInterface
|
||||
private:
|
||||
bool m_show_power_ctc;
|
||||
DisplayHas m_display;
|
||||
ViewMode m_view_mode;
|
||||
SnapTo m_snap_to;
|
||||
QHash <QString, QString> m_prefix;
|
||||
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.
|
||||
*/
|
||||
QString CrossRefItem::elementPositionText(const Element *elmt, const bool &add_prefix) const{
|
||||
|
||||
QString txt;
|
||||
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 += elmt->diagram()->convertPosition(elmt -> scenePos()).toString();
|
||||
if (add_prefix) {
|
||||
|
||||
@@ -289,7 +289,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QComboBox" name="auto_page_cb">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -299,7 +299,7 @@
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="m_edit_autofolionum_pb">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
@@ -323,6 +323,12 @@
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<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">
|
||||
<string>Page Num:</string>
|
||||
</property>
|
||||
|
||||
@@ -110,6 +110,8 @@ void XRefPropertiesWidget::saveProperties(int index) {
|
||||
|
||||
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);
|
||||
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")
|
||||
xrp.setSnapTo(XRefProperties::Bottom);
|
||||
else xrp.setSnapTo(XRefProperties::Label);
|
||||
@@ -137,6 +139,14 @@ void XRefPropertiesWidget::updateDisplay() {
|
||||
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)
|
||||
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"));
|
||||
|
||||
@@ -48,8 +48,17 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_display_has_contacts_rb">
|
||||
<property name="text">
|
||||
<string>Afficher en contacts</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_display_has_cross_rb">
|
||||
<property name="text">
|
||||
@@ -57,11 +66,39 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="m_display_has_contacts_rb">
|
||||
<property name="text">
|
||||
<string>Afficher en contacts</string>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>View Mode</string>
|
||||
</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>
|
||||
</item>
|
||||
</layout>
|
||||
|
||||
Reference in New Issue
Block a user