mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 02:10:52 +01:00
Remove the second color of conductor.
Add double click on the handler, open the conducteur properties dialog git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/branches/0.60@5034 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -250,9 +250,6 @@ void ConductorProperties::toXml(QDomElement &e) const
|
||||
if (color != QColor(Qt::black))
|
||||
e.setAttribute("color", color.name());
|
||||
|
||||
e.setAttribute("bicolor", m_bicolor? "true" : "false");
|
||||
e.setAttribute("color2", m_color_2.name());
|
||||
e.setAttribute("dash-size", QString::number(m_dash_size));
|
||||
|
||||
if (type == Single)
|
||||
singleLineProperties.toXml(e);
|
||||
@@ -285,14 +282,6 @@ void ConductorProperties::fromXml(QDomElement &e)
|
||||
QColor xml_color= QColor(e.attribute("color"));
|
||||
color = (xml_color.isValid()? xml_color : QColor(Qt::black));
|
||||
|
||||
QString bicolor_str = e.attribute("bicolor", "false");
|
||||
m_bicolor = bicolor_str == "true"? true : false;
|
||||
|
||||
QColor xml_color_2 = QColor(e.attribute("color2"));
|
||||
m_color_2 = xml_color_2.isValid()? xml_color_2 : QColor(Qt::black);
|
||||
|
||||
m_dash_size = e.attribute("dash-size", QString::number(1)).toInt();
|
||||
|
||||
// read style of conductor
|
||||
readStyle(e.attribute("style"));
|
||||
|
||||
@@ -329,9 +318,6 @@ void ConductorProperties::fromXml(QDomElement &e)
|
||||
void ConductorProperties::toSettings(QSettings &settings, const QString &prefix) const
|
||||
{
|
||||
settings.setValue(prefix + "color", color.name());
|
||||
settings.setValue(prefix + "bicolor", m_bicolor);
|
||||
settings.setValue(prefix + "color2", m_color_2.name());
|
||||
settings.setValue(prefix + "dash-size", m_dash_size);
|
||||
settings.setValue(prefix + "style", writeStyle());
|
||||
settings.setValue(prefix + "type", typeToString(type));
|
||||
settings.setValue(prefix + "text", text);
|
||||
@@ -356,12 +342,6 @@ void ConductorProperties::fromSettings(QSettings &settings, const QString &prefi
|
||||
QColor settings_color = QColor(settings.value(prefix + "color").toString());
|
||||
color = (settings_color.isValid()? settings_color : QColor(Qt::black));
|
||||
|
||||
QColor settings_color_2 = QColor(settings.value(prefix + "color2").toString());
|
||||
m_color_2 = (settings_color_2.isValid()? settings_color_2 : QColor(Qt::black));
|
||||
|
||||
m_bicolor = settings.value(prefix + "bicolor", false).toBool();
|
||||
m_dash_size = settings.value(prefix + "dash-size", 1).toInt();
|
||||
|
||||
QString setting_type = settings.value(prefix + "type", typeToString(Multi)).toString();
|
||||
type = (setting_type == typeToString(Single)? Single : Multi);
|
||||
|
||||
@@ -418,9 +398,6 @@ void ConductorProperties::applyForEqualAttributes(QList<ConductorProperties> lis
|
||||
{
|
||||
ConductorProperties cp = clist.first();
|
||||
color = cp.color;
|
||||
m_bicolor = cp.m_bicolor;
|
||||
m_color_2 = cp.m_color_2;
|
||||
m_dash_size = cp.m_dash_size;
|
||||
text = cp.text;
|
||||
m_formula = cp.m_formula;
|
||||
m_function = cp.m_function;
|
||||
@@ -452,39 +429,6 @@ void ConductorProperties::applyForEqualAttributes(QList<ConductorProperties> lis
|
||||
if (equal)
|
||||
color = c_value;
|
||||
equal = true;
|
||||
|
||||
//bicolor
|
||||
b_value = clist.first().m_bicolor;
|
||||
for(ConductorProperties cp : clist)
|
||||
{
|
||||
if (cp.m_bicolor != b_value)
|
||||
equal = false;
|
||||
}
|
||||
if (equal)
|
||||
m_bicolor = b_value;
|
||||
equal = true;
|
||||
|
||||
//second color
|
||||
c_value = clist.first().m_color_2;
|
||||
for(ConductorProperties cp : clist)
|
||||
{
|
||||
if (cp.m_color_2 != c_value)
|
||||
equal = false;
|
||||
}
|
||||
if (equal)
|
||||
m_color_2 = c_value;
|
||||
equal = true;
|
||||
|
||||
//Dash size
|
||||
i_value = clist.first().m_dash_size;
|
||||
for(ConductorProperties cp : clist)
|
||||
{
|
||||
if (cp.m_dash_size != i_value)
|
||||
equal = false;
|
||||
}
|
||||
if (equal)
|
||||
m_dash_size = i_value;
|
||||
equal = true;
|
||||
|
||||
//text
|
||||
s_value = clist.first().text;
|
||||
@@ -621,9 +565,6 @@ bool ConductorProperties::operator==(const ConductorProperties &other) const
|
||||
return(
|
||||
other.type == type &&\
|
||||
other.color == color &&\
|
||||
other.m_bicolor == m_bicolor &&\
|
||||
other.m_color_2 == m_color_2 &&\
|
||||
other.m_dash_size == m_dash_size &&\
|
||||
other.style == style &&\
|
||||
other.text == text &&\
|
||||
other.m_formula == m_formula &&\
|
||||
|
||||
Reference in New Issue
Block a user