mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-07 22:22:33 +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:
@@ -33,6 +33,8 @@ XRefProperties::XRefProperties()
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -43,6 +45,8 @@ void XRefProperties::toSettings(QSettings &settings, const QString prefix) const
|
||||
*/
|
||||
void XRefProperties::fromSettings(const QSettings &settings, const QString prefix) {
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -52,6 +56,8 @@ void XRefProperties::fromSettings(const QSettings &settings, const QString prefi
|
||||
*/
|
||||
void XRefProperties::toXml(QDomElement &xml_element) const {
|
||||
xml_element.setAttribute("showpowerctc", m_show_power_ctc? "true" : "fasle");
|
||||
QString display = m_display == Cross? "cross" : "contacts";
|
||||
xml_element.setAttribute("displayhas", display);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -61,10 +67,13 @@ void XRefProperties::toXml(QDomElement &xml_element) const {
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
bool XRefProperties::operator !=(const XRefProperties &xrp) const {
|
||||
|
||||
@@ -29,6 +29,11 @@ class XRefProperties : public PropertiesInterface
|
||||
public:
|
||||
XRefProperties();
|
||||
|
||||
enum DisplayHas {
|
||||
Cross,
|
||||
Contacts
|
||||
};
|
||||
|
||||
virtual void toSettings (QSettings &settings, const QString = QString()) const;
|
||||
virtual void fromSettings (const QSettings &settings, const QString = QString());
|
||||
virtual void toXml (QDomElement &xml_element) const;
|
||||
@@ -40,8 +45,12 @@ class XRefProperties : public PropertiesInterface
|
||||
void setShowPowerContac (const bool a) {m_show_power_ctc = a;}
|
||||
bool showPowerContact () const {return m_show_power_ctc;}
|
||||
|
||||
void setDisplayHas (const DisplayHas dh) {m_display = dh;}
|
||||
DisplayHas displayHas () const {return m_display;}
|
||||
|
||||
private:
|
||||
bool m_show_power_ctc;
|
||||
DisplayHas m_display;
|
||||
};
|
||||
|
||||
#endif // XREFPROPERTIES_H
|
||||
|
||||
Reference in New Issue
Block a user