mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-17 16:59:59 +01:00
QET is open without diagram, and tool bar are disabled.
Default properties is now a static method of the propertie class himself git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3400 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
31
sources/properties/reportproperties.cpp
Normal file
31
sources/properties/reportproperties.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2006-2014 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
|
||||
QElectroTech is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
QElectroTech is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "reportproperties.h"
|
||||
#include "qetapp.h"
|
||||
|
||||
ReportProperties::ReportProperties()
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief ReportProperties::defaultProperties
|
||||
* @return the default properties stored in the setting file
|
||||
*/
|
||||
QString ReportProperties::defaultProperties() {
|
||||
QSettings &settings= QETApp::settings();
|
||||
return(settings.value("diagrameditor/defaultreportlabel", "%f-%l%c").toString());
|
||||
}
|
||||
31
sources/properties/reportproperties.h
Normal file
31
sources/properties/reportproperties.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
Copyright 2006-2014 The QElectroTech Team
|
||||
This file is part of QElectroTech.
|
||||
|
||||
QElectroTech is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
QElectroTech is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#ifndef REPORTPROPERTIES_H
|
||||
#define REPORTPROPERTIES_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
class ReportProperties
|
||||
{
|
||||
public:
|
||||
ReportProperties();
|
||||
|
||||
static QString defaultProperties ();
|
||||
};
|
||||
|
||||
#endif // REPORTPROPERTIES_H
|
||||
@@ -16,6 +16,7 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "xrefproperties.h"
|
||||
#include "qetapp.h"
|
||||
|
||||
/**
|
||||
* @brief XRefProperties::XRefProperties
|
||||
@@ -95,6 +96,28 @@ void XRefProperties::fromXml(const QDomElement &xml_element) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief XRefProperties::defaultProperties
|
||||
* @return the default properties stored in the setting file
|
||||
* For the xref, there is 2 propreties.
|
||||
* For coil, stored with the string "coil" in the returned QHash.
|
||||
* For protection, stored with the string "protection" in the returned QHash.
|
||||
*/
|
||||
QHash<QString, XRefProperties> XRefProperties::defaultProperties() {
|
||||
QHash <QString, XRefProperties> hash;
|
||||
QStringList keys;
|
||||
keys << "coil" << "protection";
|
||||
|
||||
foreach (QString key, keys) {
|
||||
XRefProperties properties;
|
||||
QString str("diagrameditor/defaultxref");
|
||||
properties.fromSettings(QETApp::settings(), str += key);
|
||||
hash.insert(key, properties);
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
|
||||
bool XRefProperties::operator ==(const XRefProperties &xrp) const{
|
||||
return (m_show_power_ctc == xrp.m_show_power_ctc &&
|
||||
m_display == xrp.m_display &&
|
||||
|
||||
@@ -45,6 +45,8 @@ class XRefProperties : public PropertiesInterface
|
||||
virtual void toXml (QDomElement &xml_element) const;
|
||||
virtual void fromXml (const QDomElement &xml_element);
|
||||
|
||||
static QHash<QString, XRefProperties> defaultProperties();
|
||||
|
||||
bool operator == (const XRefProperties &xrp) const;
|
||||
bool operator != (const XRefProperties &xrp) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user