2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2015-02-20 14:56:22 +00:00
|
|
|
Copyright 2006-2015 The QElectroTech Team
|
2007-12-01 10:47:15 +00:00
|
|
|
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/>.
|
|
|
|
*/
|
2007-11-18 00:22:19 +00:00
|
|
|
#include "configpages.h"
|
2008-08-14 22:51:08 +00:00
|
|
|
#include "borderpropertieswidget.h"
|
2008-07-30 12:44:57 +00:00
|
|
|
#include "conductorpropertieswidget.h"
|
2010-12-20 02:45:36 +00:00
|
|
|
#include "titleblockpropertieswidget.h"
|
|
|
|
#include "bordertitleblock.h"
|
2009-05-01 14:41:33 +00:00
|
|
|
#include "qeticons.h"
|
2009-08-09 12:51:02 +00:00
|
|
|
#include "exportpropertieswidget.h"
|
2014-01-18 19:04:39 +00:00
|
|
|
#include "ui/reportpropertiewidget.h"
|
2014-04-11 09:51:21 +00:00
|
|
|
#include "ui/xrefpropertieswidget.h"
|
2014-09-20 20:04:02 +00:00
|
|
|
#include "qetproject.h"
|
2014-10-26 11:57:38 +00:00
|
|
|
#include "reportproperties.h"
|
2015-09-16 15:11:13 +00:00
|
|
|
#include "qetapp.h"
|
2007-11-18 00:22:19 +00:00
|
|
|
|
|
|
|
/**
|
2014-09-20 20:04:02 +00:00
|
|
|
* @brief NewDiagramPage::NewDiagramPage
|
|
|
|
* Default constructor
|
|
|
|
* @param project, If project, edit the propertie of Project
|
|
|
|
* else edit the properties by default of QElectroTech
|
|
|
|
* @param parent, parent widget
|
|
|
|
*/
|
|
|
|
NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent) :
|
|
|
|
ConfigPage (parent),
|
|
|
|
m_project (project)
|
|
|
|
{
|
|
|
|
//By default we set the global default properties
|
2014-01-18 19:04:39 +00:00
|
|
|
|
|
|
|
// dimensions by default for diagram
|
2015-04-09 09:39:34 +00:00
|
|
|
bpw = new BorderPropertiesWidget(BorderProperties::defaultProperties());
|
2014-01-18 19:04:39 +00:00
|
|
|
// default titleblock properties
|
2015-04-17 11:45:49 +00:00
|
|
|
QList <TitleBlockTemplatesCollection *> c;
|
|
|
|
c << QETApp::commonTitleBlockTemplatesCollection() << QETApp::customTitleBlockTemplatesCollection();
|
2015-04-25 08:43:00 +00:00
|
|
|
if (m_project) c << m_project->embeddedTitleBlockTemplatesCollection();
|
2015-04-17 11:45:49 +00:00
|
|
|
ipw = new TitleBlockPropertiesWidget(c, TitleBlockProperties::defaultProperties(), true);
|
2014-01-18 19:04:39 +00:00
|
|
|
// default conductor properties
|
2014-10-26 11:57:38 +00:00
|
|
|
cpw = new ConductorPropertiesWidget(ConductorProperties::defaultProperties());
|
2014-01-18 19:04:39 +00:00
|
|
|
// default propertie of report label
|
2014-10-26 11:57:38 +00:00
|
|
|
rpw = new ReportPropertieWidget(ReportProperties::defaultProperties());
|
2014-04-11 09:51:21 +00:00
|
|
|
// default properties of xref
|
2014-10-26 11:57:38 +00:00
|
|
|
xrefpw = new XRefPropertiesWidget(XRefProperties::defaultProperties(), this);
|
2014-09-20 20:04:02 +00:00
|
|
|
|
|
|
|
//If there is a project, we edit his properties
|
|
|
|
if (m_project) {
|
|
|
|
bpw -> setProperties (m_project -> defaultBorderProperties());
|
|
|
|
cpw -> setProperties (m_project -> defaultConductorProperties());
|
|
|
|
ipw -> setProperties (m_project -> defaultTitleBlockProperties());
|
|
|
|
rpw -> setReportProperties (m_project -> defaultReportProperties());
|
|
|
|
xrefpw -> setProperties (m_project -> defaultXRefProperties());
|
|
|
|
}
|
|
|
|
|
|
|
|
// main tab widget
|
|
|
|
QTabWidget *tab_widget = new QTabWidget(this);
|
|
|
|
QWidget *diagram_widget = new QWidget();
|
|
|
|
QVBoxLayout *diagram_layout = new QVBoxLayout(diagram_widget);
|
|
|
|
|
|
|
|
diagram_layout -> addWidget(bpw);
|
|
|
|
diagram_layout -> addWidget(ipw);
|
|
|
|
|
2015-12-28 15:19:55 +00:00
|
|
|
tab_widget -> addTab (diagram_widget, tr("Folio"));
|
2014-09-20 20:04:02 +00:00
|
|
|
tab_widget -> addTab (cpw, tr("Conducteur"));
|
2015-01-27 21:36:56 +00:00
|
|
|
tab_widget -> addTab (rpw, tr("Reports de folio"));
|
2015-03-02 20:14:56 +00:00
|
|
|
tab_widget -> addTab (xrefpw, tr("Références croisées"));
|
2014-09-20 20:04:02 +00:00
|
|
|
|
2007-11-18 00:22:19 +00:00
|
|
|
QVBoxLayout *vlayout1 = new QVBoxLayout();
|
2014-01-18 19:04:39 +00:00
|
|
|
vlayout1->addWidget(tab_widget);
|
|
|
|
|
2007-11-18 00:22:19 +00:00
|
|
|
setLayout(vlayout1);
|
|
|
|
}
|
|
|
|
|
2014-09-20 20:04:02 +00:00
|
|
|
/**
|
|
|
|
* @brief NewDiagramPage::~NewDiagramPage
|
|
|
|
*/
|
2007-11-18 00:22:19 +00:00
|
|
|
NewDiagramPage::~NewDiagramPage() {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-09-20 20:04:02 +00:00
|
|
|
* @brief NewDiagramPage::applyConf
|
|
|
|
* Apply conf for this page.
|
|
|
|
* If there is a project, save in the project,
|
|
|
|
* else save to the default conf of QElectroTech
|
|
|
|
*/
|
2007-11-18 00:22:19 +00:00
|
|
|
void NewDiagramPage::applyConf() {
|
2014-09-20 20:04:02 +00:00
|
|
|
if (m_project) { //If project we save to the project
|
|
|
|
if (m_project -> isReadOnly()) return;
|
|
|
|
bool modified_project = false;
|
|
|
|
|
|
|
|
BorderProperties new_border_prop = bpw -> properties();
|
|
|
|
if (m_project -> defaultBorderProperties() != new_border_prop) {
|
|
|
|
m_project -> setDefaultBorderProperties(bpw -> properties());
|
|
|
|
modified_project = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
TitleBlockProperties new_tbt_prop = ipw -> properties();
|
|
|
|
if (m_project -> defaultTitleBlockProperties() != new_tbt_prop) {
|
|
|
|
m_project -> setDefaultTitleBlockProperties(ipw -> properties());
|
|
|
|
modified_project = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
ConductorProperties new_conductor_prop = cpw -> properties();
|
|
|
|
if (m_project -> defaultConductorProperties() != new_conductor_prop) {
|
|
|
|
m_project -> setDefaultConductorProperties(cpw -> properties());
|
|
|
|
modified_project = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
QString new_report_prop = rpw -> ReportProperties();
|
|
|
|
if (m_project -> defaultReportProperties() != new_report_prop) {
|
|
|
|
m_project -> setDefaultReportProperties(new_report_prop);
|
|
|
|
modified_project = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
QHash<QString, XRefProperties> new_xref_properties = xrefpw -> properties();
|
|
|
|
if (m_project -> defaultXRefProperties() != new_xref_properties) {
|
|
|
|
m_project -> setDefaultXRefProperties(new_xref_properties);
|
|
|
|
modified_project = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (modified_project) {
|
|
|
|
m_project -> setModified(modified_project);
|
|
|
|
}
|
|
|
|
|
|
|
|
} else { //Else we save to the default value
|
2015-09-16 15:11:13 +00:00
|
|
|
QSettings settings;
|
2014-09-20 20:04:02 +00:00
|
|
|
|
|
|
|
// dimensions des nouveaux schemas
|
|
|
|
bpw -> properties().toSettings(settings, "diagrameditor/default");
|
|
|
|
|
|
|
|
// proprietes du cartouche
|
|
|
|
ipw-> properties().toSettings(settings, "diagrameditor/default");
|
|
|
|
|
|
|
|
// proprietes par defaut des conducteurs
|
|
|
|
cpw -> properties().toSettings(settings, "diagrameditor/defaultconductor");
|
|
|
|
|
|
|
|
// default report propertie
|
|
|
|
rpw->toSettings(settings, "diagrameditor/defaultreport");
|
|
|
|
|
|
|
|
// default xref properties
|
|
|
|
QHash <QString, XRefProperties> hash_xrp = xrefpw -> properties();
|
|
|
|
foreach (QString key, hash_xrp.keys()) {
|
|
|
|
XRefProperties xrp = hash_xrp[key];
|
|
|
|
QString str("diagrameditor/defaultxref");
|
|
|
|
xrp.toSettings(settings, str += key);
|
|
|
|
}
|
2014-07-03 08:52:14 +00:00
|
|
|
}
|
2007-11-18 00:22:19 +00:00
|
|
|
}
|
|
|
|
|
2014-09-20 20:04:02 +00:00
|
|
|
/**
|
|
|
|
* @brief NewDiagramPage::icon
|
|
|
|
* @return icon of this page
|
|
|
|
*/
|
2007-11-18 00:22:19 +00:00
|
|
|
QIcon NewDiagramPage::icon() const {
|
2015-03-13 09:04:04 +00:00
|
|
|
if (m_project) return(QET::Icons::NewDiagram);
|
2015-03-10 14:47:03 +00:00
|
|
|
return(QET::Icons::Projects);
|
2007-11-18 00:22:19 +00:00
|
|
|
}
|
|
|
|
|
2014-09-20 20:04:02 +00:00
|
|
|
/**
|
|
|
|
* @brief NewDiagramPage::title
|
|
|
|
* @return title of this page
|
|
|
|
*/
|
2007-11-18 00:22:19 +00:00
|
|
|
QString NewDiagramPage::title() const {
|
2015-03-21 10:43:39 +00:00
|
|
|
if (m_project) return(tr("Nouveau folio", "configuration page title"));
|
2014-09-21 13:04:54 +00:00
|
|
|
return(tr("Nouveau projet", "configuration page title"));
|
2009-04-03 19:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Constructeur
|
|
|
|
@param parent QWidget parent
|
|
|
|
*/
|
2015-09-16 15:11:13 +00:00
|
|
|
GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage(parent)
|
|
|
|
{
|
|
|
|
//Conf of QElectroTech
|
|
|
|
QSettings settings;
|
2009-05-24 17:46:44 +00:00
|
|
|
bool use_system_colors = settings.value("usesystemcolors", "true").toBool();
|
2009-04-05 12:33:20 +00:00
|
|
|
bool tabbed = settings.value("diagrameditor/viewmode", "tabbed") == "tabbed";
|
2009-04-03 19:30:25 +00:00
|
|
|
bool integrate_elements = settings.value("diagrameditor/integrate-elements", true).toBool();
|
2015-03-29 12:15:25 +00:00
|
|
|
bool zoom_out_folio = settings.value("diagrameditor/zoom-out-beyond-of-folio", false).toBool();
|
2014-09-01 14:56:11 +00:00
|
|
|
bool use_trackpad = settings.value("diagramview/gestures", false).toBool();
|
2012-04-29 20:29:40 +00:00
|
|
|
bool highlight_integrated_elements = settings.value("diagrameditor/highlight-integrated-elements", true).toBool();
|
2010-02-14 16:28:45 +00:00
|
|
|
QString default_element_informations = settings.value("elementeditor/default-informations", "").toString();
|
2009-04-03 19:30:25 +00:00
|
|
|
|
2009-05-24 17:46:44 +00:00
|
|
|
appearance_ = new QGroupBox(tr("Apparence"), this);
|
2015-03-02 20:14:56 +00:00
|
|
|
use_system_colors_ = new QCheckBox(tr("Utiliser les couleurs du système"), appearance_);
|
2009-04-03 19:30:25 +00:00
|
|
|
projects_view_mode_ = new QGroupBox(tr("Projets"), this);
|
2015-12-28 15:19:55 +00:00
|
|
|
windowed_mode_ = new QRadioButton(tr("Utiliser des fenêtres (appliqué au prochain lancement de QElectroTech)"), projects_view_mode_);
|
|
|
|
tabbed_mode_ = new QRadioButton(tr("Utiliser des onglets (appliqué au prochain lancement de QElectroTech)"), projects_view_mode_);
|
2015-03-02 20:14:56 +00:00
|
|
|
use_trackpad_ = new QCheckBox(tr("Utiliser les gestes du pavé tactile"), projects_view_mode_);
|
2015-03-29 12:15:25 +00:00
|
|
|
m_zoom_out_beyond_folio = new QCheckBox(tr("Autoriser le dézoom au delà du folio"), this);
|
2009-04-03 19:30:25 +00:00
|
|
|
|
2015-03-02 20:14:56 +00:00
|
|
|
elements_management_ = new QGroupBox(tr("Gestion des éléments"), this);
|
|
|
|
integrate_elements_ = new QCheckBox(tr("Intégrer automatiquement les éléments dans les projets (recommandé)"));
|
|
|
|
highlight_integrated_elements_ = new QCheckBox(tr("Mettre en valeur dans le panel les éléments fraîchement intégrés", "configuration option"));
|
2010-02-14 16:28:45 +00:00
|
|
|
default_element_infos_label_ = new QLabel(
|
|
|
|
tr(
|
2015-03-02 20:14:56 +00:00
|
|
|
"Chaque élément embarque des informations sur ses auteurs, sa licence, ou tout autre renseignement que vous jugerez utile dans un champ libre. "
|
|
|
|
"Vous pouvez spécifier ici la valeur par défaut de ce champ pour les éléments que vous créerez :"
|
2010-02-14 16:28:45 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
default_element_infos_label_ -> setWordWrap(true);
|
|
|
|
default_element_infos_textfield_ = new QTextEdit();
|
|
|
|
default_element_infos_textfield_ -> setAcceptRichText(false);
|
2009-04-03 19:30:25 +00:00
|
|
|
|
2009-05-24 17:46:44 +00:00
|
|
|
use_system_colors_ -> setChecked(use_system_colors);
|
2014-08-29 02:33:38 +00:00
|
|
|
|
|
|
|
use_trackpad_ -> setChecked(use_trackpad);
|
|
|
|
|
2009-04-03 19:30:25 +00:00
|
|
|
if (tabbed) {
|
|
|
|
tabbed_mode_ -> setChecked(true);
|
|
|
|
} else {
|
|
|
|
windowed_mode_ -> setChecked(true);
|
|
|
|
}
|
2015-03-24 23:10:15 +00:00
|
|
|
|
2015-03-29 12:15:25 +00:00
|
|
|
m_zoom_out_beyond_folio -> setChecked(zoom_out_folio);
|
2009-04-03 19:30:25 +00:00
|
|
|
|
|
|
|
integrate_elements_ -> setChecked(integrate_elements);
|
2012-04-29 20:29:40 +00:00
|
|
|
highlight_integrated_elements_ -> setChecked(highlight_integrated_elements);
|
2010-02-14 16:28:45 +00:00
|
|
|
default_element_infos_textfield_ -> setPlainText(default_element_informations);
|
2009-04-03 19:30:25 +00:00
|
|
|
|
2009-05-24 17:46:44 +00:00
|
|
|
QVBoxLayout *appearance_layout = new QVBoxLayout();
|
|
|
|
appearance_layout -> addWidget(use_system_colors_);
|
|
|
|
appearance_ -> setLayout(appearance_layout);
|
|
|
|
|
2015-03-24 23:10:15 +00:00
|
|
|
QVBoxLayout *projects_view_mode_layout = new QVBoxLayout;
|
2009-04-03 19:30:25 +00:00
|
|
|
projects_view_mode_layout -> addWidget(windowed_mode_);
|
|
|
|
projects_view_mode_layout -> addWidget(tabbed_mode_);
|
2015-03-29 12:15:25 +00:00
|
|
|
projects_view_mode_layout -> addWidget(m_zoom_out_beyond_folio);
|
2015-12-28 15:19:55 +00:00
|
|
|
projects_view_mode_layout -> addWidget(use_trackpad_);
|
2009-04-03 19:30:25 +00:00
|
|
|
projects_view_mode_ -> setLayout(projects_view_mode_layout);
|
|
|
|
|
|
|
|
QVBoxLayout *elements_management_layout = new QVBoxLayout();
|
|
|
|
elements_management_layout -> addWidget(integrate_elements_);
|
2012-04-29 20:29:40 +00:00
|
|
|
elements_management_layout -> addWidget(highlight_integrated_elements_);
|
2010-02-14 16:28:45 +00:00
|
|
|
elements_management_layout -> addWidget(default_element_infos_label_);
|
|
|
|
elements_management_layout -> addWidget(default_element_infos_textfield_);
|
2009-04-03 19:30:25 +00:00
|
|
|
elements_management_ -> setLayout(elements_management_layout);
|
2014-01-21 19:23:44 +00:00
|
|
|
|
|
|
|
//setup lang combo box selection widget
|
|
|
|
lang_group_box = new QGroupBox(tr("Langue"), this);
|
|
|
|
QHBoxLayout *lang_layout = new QHBoxLayout(lang_group_box);
|
|
|
|
lang_combo_box = new QComboBox();
|
2015-12-28 15:19:55 +00:00
|
|
|
lang_label = new QLabel(tr("La nouvelle langue sera prise en compte au prochain lancement de QElectroTech."));
|
2014-01-21 19:23:44 +00:00
|
|
|
lang_layout->addWidget(lang_combo_box);
|
|
|
|
lang_layout->addWidget(lang_label);
|
|
|
|
fillLang(settings);
|
2009-04-03 19:30:25 +00:00
|
|
|
|
|
|
|
QVBoxLayout *vlayout1 = new QVBoxLayout();
|
|
|
|
|
|
|
|
QLabel *title_label_ = new QLabel(title());
|
|
|
|
vlayout1 -> addWidget(title_label_);
|
|
|
|
|
|
|
|
QFrame *horiz_line_ = new QFrame();
|
|
|
|
horiz_line_ -> setFrameShape(QFrame::HLine);
|
|
|
|
vlayout1 -> addWidget(horiz_line_);
|
|
|
|
|
2009-05-24 17:46:44 +00:00
|
|
|
vlayout1 -> addWidget(appearance_);
|
2009-04-03 19:30:25 +00:00
|
|
|
vlayout1 -> addWidget(projects_view_mode_);
|
|
|
|
vlayout1 -> addWidget(elements_management_);
|
2014-01-21 19:23:44 +00:00
|
|
|
vlayout1 -> addWidget(lang_group_box);
|
2009-04-03 19:30:25 +00:00
|
|
|
vlayout1 -> addStretch();
|
|
|
|
|
|
|
|
setLayout(vlayout1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Destructeur
|
|
|
|
GeneralConfigurationPage::~GeneralConfigurationPage() {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-01-21 19:23:44 +00:00
|
|
|
* @brief GeneralConfigurationPage::applyConf
|
|
|
|
* Write all configuration in settings file
|
|
|
|
*/
|
2015-09-16 15:11:13 +00:00
|
|
|
void GeneralConfigurationPage::applyConf()
|
|
|
|
{
|
|
|
|
QSettings settings;
|
2009-04-03 19:30:25 +00:00
|
|
|
|
2009-05-24 17:46:44 +00:00
|
|
|
bool was_using_system_colors = settings.value("usesystemcolors", "true").toBool();
|
|
|
|
bool must_use_system_colors = use_system_colors_ -> isChecked();
|
|
|
|
settings.setValue("usesystemcolors", must_use_system_colors);
|
|
|
|
if (was_using_system_colors != must_use_system_colors) {
|
|
|
|
QETApp::instance() -> useSystemPalette(must_use_system_colors);
|
|
|
|
}
|
2014-01-21 19:23:44 +00:00
|
|
|
|
|
|
|
settings.setValue("lang", lang_combo_box->itemData(lang_combo_box->currentIndex()).toString());
|
2009-05-24 17:46:44 +00:00
|
|
|
|
2009-04-03 19:30:25 +00:00
|
|
|
QString view_mode = tabbed_mode_ -> isChecked() ? "tabbed" : "windowed";
|
|
|
|
settings.setValue("diagrameditor/viewmode", view_mode) ;
|
|
|
|
|
|
|
|
settings.setValue("diagrameditor/integrate-elements", integrate_elements_ -> isChecked());
|
2012-04-29 20:29:40 +00:00
|
|
|
settings.setValue("diagrameditor/highlight-integrated-elements", highlight_integrated_elements_ -> isChecked());
|
2010-02-14 16:28:45 +00:00
|
|
|
settings.setValue("elementeditor/default-informations", default_element_infos_textfield_ -> toPlainText());
|
2014-08-29 02:33:38 +00:00
|
|
|
settings.setValue("diagramview/gestures", use_trackpad_ -> isChecked());
|
2015-03-29 12:15:25 +00:00
|
|
|
settings.setValue("diagrameditor/zoom-out-beyond-of-folio", m_zoom_out_beyond_folio->isChecked());
|
2009-04-03 19:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// @return l'icone de cette page
|
|
|
|
QIcon GeneralConfigurationPage::icon() const {
|
2009-05-01 14:41:33 +00:00
|
|
|
return(QET::Icons::Settings);
|
2009-04-03 19:30:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// @return le titre de cette page
|
|
|
|
QString GeneralConfigurationPage::title() const {
|
2015-03-02 20:14:56 +00:00
|
|
|
return(tr("Général", "configuration page title"));
|
2007-11-18 00:22:19 +00:00
|
|
|
}
|
2009-08-09 12:51:02 +00:00
|
|
|
|
2014-01-21 19:23:44 +00:00
|
|
|
/**
|
|
|
|
* @brief GeneralConfigurationPage::fillLang
|
|
|
|
* fill all available lang in @lang_combo_box
|
|
|
|
*/
|
|
|
|
void GeneralConfigurationPage::fillLang(QSettings &settings) {
|
2015-03-02 20:14:56 +00:00
|
|
|
lang_combo_box->addItem(QET::Icons::translation, tr("Système"), "system");
|
2014-01-21 19:23:44 +00:00
|
|
|
lang_combo_box->insertSeparator(1);
|
|
|
|
|
|
|
|
// all lang available on lang directory
|
2014-01-23 08:34:47 +00:00
|
|
|
lang_combo_box->addItem(QET::Icons::ar, tr("Arabe"), "ar");
|
2014-01-23 08:55:21 +00:00
|
|
|
lang_combo_box->addItem(QET::Icons::catalonia, tr("Catalan"), "ca");
|
2015-03-02 20:14:56 +00:00
|
|
|
lang_combo_box->addItem(QET::Icons::cs, tr("Tchèque"), "cs");
|
2014-01-23 08:43:20 +00:00
|
|
|
lang_combo_box->addItem(QET::Icons::de, tr("Allemand"), "de");
|
2014-01-23 08:34:47 +00:00
|
|
|
lang_combo_box->addItem(QET::Icons::gr, tr("Grec"), "el");
|
|
|
|
lang_combo_box->addItem(QET::Icons::en, tr("Anglais"), "en");
|
|
|
|
lang_combo_box->addItem(QET::Icons::es, tr("Espagnol"), "es");
|
2015-03-02 20:14:56 +00:00
|
|
|
lang_combo_box->addItem(QET::Icons::fr, tr("Français"), "fr");
|
2014-01-23 08:34:47 +00:00
|
|
|
lang_combo_box->addItem(QET::Icons::hr, tr("Croate"), "hr");
|
|
|
|
lang_combo_box->addItem(QET::Icons::it, tr("Italien"), "it");
|
|
|
|
lang_combo_box->addItem(QET::Icons::pl, tr("Polonais"), "pl");
|
|
|
|
lang_combo_box->addItem(QET::Icons::pt, tr("Portugais"), "pt");
|
|
|
|
lang_combo_box->addItem(QET::Icons::ro, tr("Roumains"), "ro");
|
|
|
|
lang_combo_box->addItem(QET::Icons::ru, tr("Russe"), "ru");
|
2015-03-02 20:14:56 +00:00
|
|
|
lang_combo_box->addItem(QET::Icons::sl, tr("Slovène"), "sl");
|
2014-04-17 14:41:45 +00:00
|
|
|
lang_combo_box->addItem(QET::Icons::nl, tr("Pays-Bas"), "nl");
|
2014-05-19 16:35:13 +00:00
|
|
|
lang_combo_box->addItem(QET::Icons::be, tr("Belgique-Flemish"), "be");
|
2014-01-21 19:23:44 +00:00
|
|
|
|
|
|
|
//set curent index to the lang found in setting file
|
|
|
|
//if lang doesn't exist set to system
|
|
|
|
for (int i=0; i<lang_combo_box->count(); i++) {
|
|
|
|
if (lang_combo_box->itemData(i).toString() == settings.value("lang").toString()) {
|
|
|
|
lang_combo_box->setCurrentIndex(i);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lang_combo_box->setCurrentIndex(0);
|
|
|
|
}
|
|
|
|
|
2009-08-09 12:51:02 +00:00
|
|
|
/**
|
|
|
|
Constructeur
|
|
|
|
@param parent QWidget parent
|
|
|
|
*/
|
|
|
|
ExportConfigPage::ExportConfigPage(QWidget *parent) : ConfigPage(parent) {
|
|
|
|
// epw contient les options d'export
|
2014-10-26 11:57:38 +00:00
|
|
|
epw = new ExportPropertiesWidget(ExportProperties::defaultExportProperties());
|
2009-08-09 12:51:02 +00:00
|
|
|
|
|
|
|
// layout vertical contenant le titre, une ligne horizontale et epw
|
|
|
|
QVBoxLayout *vlayout1 = new QVBoxLayout();
|
|
|
|
|
|
|
|
QLabel *title = new QLabel(this -> title());
|
|
|
|
vlayout1 -> addWidget(title);
|
|
|
|
|
|
|
|
QFrame *horiz_line = new QFrame();
|
|
|
|
horiz_line -> setFrameShape(QFrame::HLine);
|
|
|
|
vlayout1 -> addWidget(horiz_line);
|
|
|
|
vlayout1 -> addWidget(epw);
|
2009-11-22 16:12:22 +00:00
|
|
|
vlayout1 -> addStretch();
|
2009-08-09 12:51:02 +00:00
|
|
|
|
|
|
|
// activation du layout
|
|
|
|
setLayout(vlayout1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Destructeur
|
|
|
|
ExportConfigPage::~ExportConfigPage() {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
Applique la configuration de cette page
|
|
|
|
*/
|
2015-09-16 15:11:13 +00:00
|
|
|
void ExportConfigPage::applyConf()
|
|
|
|
{
|
|
|
|
QSettings settings;
|
2009-08-09 12:51:02 +00:00
|
|
|
epw -> exportProperties().toSettings(settings, "export/default");
|
|
|
|
}
|
|
|
|
|
|
|
|
/// @return l'icone de cette page
|
|
|
|
QIcon ExportConfigPage::icon() const {
|
|
|
|
return(QET::Icons::DocumentExport);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// @return le titre de cette page
|
|
|
|
QString ExportConfigPage::title() const {
|
|
|
|
return(tr("Export", "configuration page title"));
|
|
|
|
}
|
|
|
|
|
2009-11-22 16:12:22 +00:00
|
|
|
/**
|
|
|
|
Constructeur
|
|
|
|
@param parent QWidget parent
|
|
|
|
*/
|
|
|
|
PrintConfigPage::PrintConfigPage(QWidget *parent) : ConfigPage(parent) {
|
|
|
|
// epw contient les options d'export
|
2014-10-26 11:57:38 +00:00
|
|
|
epw = new ExportPropertiesWidget(ExportProperties::defaultPrintProperties());
|
2009-11-22 16:12:22 +00:00
|
|
|
epw -> setPrintingMode(true);
|
|
|
|
|
|
|
|
// layout vertical contenant le titre, une ligne horizontale et epw
|
|
|
|
QVBoxLayout *vlayout1 = new QVBoxLayout();
|
|
|
|
|
|
|
|
QLabel *title = new QLabel(this -> title());
|
|
|
|
vlayout1 -> addWidget(title);
|
|
|
|
|
|
|
|
QFrame *horiz_line = new QFrame();
|
|
|
|
horiz_line -> setFrameShape(QFrame::HLine);
|
|
|
|
vlayout1 -> addWidget(horiz_line);
|
|
|
|
vlayout1 -> addWidget(epw);
|
|
|
|
vlayout1 -> addStretch();
|
|
|
|
|
|
|
|
// activation du layout
|
|
|
|
setLayout(vlayout1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Destructeur
|
|
|
|
PrintConfigPage::~PrintConfigPage() {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2015-09-16 15:11:13 +00:00
|
|
|
* @brief PrintConfigPage::applyConf
|
|
|
|
* Apply the config of this page
|
|
|
|
*/
|
|
|
|
void PrintConfigPage::applyConf()
|
|
|
|
{
|
2009-11-22 16:12:22 +00:00
|
|
|
QString prefix = "print/default";
|
|
|
|
|
2015-09-16 15:11:13 +00:00
|
|
|
QSettings settings;
|
2009-11-22 16:12:22 +00:00
|
|
|
epw -> exportProperties().toSettings(settings, prefix);
|
|
|
|
|
|
|
|
// annule l'enregistrement de certaines proprietes non pertinentes
|
|
|
|
settings.remove(prefix + "path");
|
|
|
|
settings.remove(prefix + "format");
|
|
|
|
settings.remove(prefix + "area");
|
|
|
|
}
|
|
|
|
|
|
|
|
/// @return l'icone de cette page
|
|
|
|
QIcon PrintConfigPage::icon() const {
|
|
|
|
return(QET::Icons::Printer);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// @return le titre de cette page
|
|
|
|
QString PrintConfigPage::title() const {
|
|
|
|
return(tr("Impression", "configuration page title"));
|
|
|
|
}
|