[qet] qet/qet: [5374] Diagram editor, add two news feature: |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 5374
Author: blacksun
Date: 2018-05-24 20:08:06 +0200 (Thu, 24 May 2018)
Log Message:
-----------
Diagram editor, add two news feature:
1- QET create a backup file, use to restor the project when a crash occur
2- User can enable and edit autosave.
Modified Paths:
--------------
trunk/qelectrotech.pro
trunk/sources/configpages.cpp
trunk/sources/configpages.h
trunk/sources/qetapp.cpp
trunk/sources/qetapp.h
trunk/sources/qetproject.cpp
trunk/sources/qetproject.h
Added Paths:
-----------
trunk/sources/ui/configpage/
trunk/sources/ui/configpage/generalconfigurationpage.cpp
trunk/sources/ui/configpage/generalconfigurationpage.h
trunk/sources/ui/configpage/generalconfigurationpage.ui
Modified: trunk/qelectrotech.pro
===================================================================
--- trunk/qelectrotech.pro 2018-05-24 13:40:54 UTC (rev 5373)
+++ trunk/qelectrotech.pro 2018-05-24 18:08:06 UTC (rev 5374)
@@ -89,11 +89,17 @@
sources/ElementsCollection \
sources/ElementsCollection/ui \
sources/autoNum \
- sources/autoNum/ui
+ sources/autoNum/ui \
+ sources/ui/configpage
# Fichiers sources
-HEADERS += $$files(sources/*.h) $$files(sources/ui/*.h) $$files(sources/editor/*.h) $$files(sources/titleblock/*.h) $$files(sources/richtext/*.h) $$files(sources/qetgraphicsitem/*.h) $$files(sources/factory/*.h) \
+HEADERS += $$files(sources/*.h) $$files(sources/ui/*.h) \
+ $$files(sources/editor/*.h) \
+ $$files(sources/titleblock/*.h) \
+ $$files(sources/richtext/*.h) \
+ $$files(sources/qetgraphicsitem/*.h) \
+ $$files(sources/factory/*.h) \
$$files(sources/properties/*.h) \
$$files(sources/editor/ui/*.h) \
$$files(sources/editor/esevent/*.h) \
@@ -104,9 +110,16 @@
$$files(sources/ElementsCollection/*.h) \
$$files(sources/ElementsCollection/ui/*.h) \
$$files(sources/autoNum/*.h) \
- $$files(sources/autoNum/ui/*.h)
+ $$files(sources/autoNum/ui/*.h) \
+ $$files(sources/ui/configpage/*.h)
-SOURCES += $$files(sources/*.cpp) $$files(sources/editor/*.cpp) $$files(sources/titleblock/*.cpp) $$files(sources/richtext/*.cpp) $$files(sources/ui/*.cpp) $$files(sources/qetgraphicsitem/*.cpp) $$files(sources/factory/*.cpp) \
+SOURCES += $$files(sources/*.cpp) \
+ $$files(sources/editor/*.cpp) \
+ $$files(sources/titleblock/*.cpp) \
+ $$files(sources/richtext/*.cpp) \
+ $$files(sources/ui/*.cpp) \
+ $$files(sources/qetgraphicsitem/*.cpp) \
+ $$files(sources/factory/*.cpp) \
$$files(sources/properties/*.cpp) \
$$files(sources/editor/ui/*.cpp) \
$$files(sources/editor/esevent/*.cpp) \
@@ -117,7 +130,8 @@
$$files(sources/ElementsCollection/*.cpp) \
$$files(sources/ElementsCollection/ui/*.cpp) \
$$files(sources/autoNum/*.cpp) \
- $$files(sources/autoNum/ui/*.cpp)
+ $$files(sources/autoNum/ui/*.cpp) \
+ $$files(sources/ui/configpage/*.cpp)
# Liste des fichiers qui seront incorpores au binaire en tant que ressources Qt
RESOURCES += qelectrotech.qrc
@@ -136,7 +150,8 @@
$$files(sources/ui/*.ui) \
$$files(sources/editor/ui/*.ui) \
$$files(sources/ElementsCollection/ui/*.ui) \
- $$files(sources/autoNum/ui/*.ui)
+ $$files(sources/autoNum/ui/*.ui) \
+ $$files(sources/ui/configpage/*.ui)
UI_SOURCES_DIR = sources/ui/
UI_HEADERS_DIR = sources/ui/
Modified: trunk/sources/configpages.cpp
===================================================================
--- trunk/sources/configpages.cpp 2018-05-24 13:40:54 UTC (rev 5373)
+++ trunk/sources/configpages.cpp 2018-05-24 18:08:06 UTC (rev 5374)
@@ -229,223 +229,6 @@
Constructeur
@param parent QWidget parent
*/
-GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage(parent)
-{
- //Conf of QElectroTech
- QSettings settings;
- bool use_system_colors = settings.value("usesystemcolors", "true").toBool();
- bool tabbed = settings.value("diagrameditor/viewmode", "tabbed") == "tabbed";
- bool zoom_out_folio = settings.value("diagrameditor/zoom-out-beyond-of-folio", false).toBool();
- bool use_trackpad = settings.value("diagramview/gestures", false).toBool();
- bool save_label_paste = settings.value("diagramcommands/erase-label-on-copy", true).toBool();
- bool panel_folio = settings.value("genericpanel/folio", true).toBool();
- bool highlight_integrated_elements = settings.value("diagrameditor/highlight-integrated-elements", true).toBool();
- bool terminal_exportlist = settings.value("nomenclature-exportlist", true).toBool();
- QString default_element_informations = settings.value("elementeditor/default-informations", "").toString();
-
- appearance_ = new QGroupBox(tr("Apparence"), this);
- use_system_colors_ = new QCheckBox(tr("Utiliser les couleurs du système"), appearance_);
- projects_view_mode_ = new QGroupBox(tr("Projets"), this);
- 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_);
- use_trackpad_ = new QCheckBox(tr("Utiliser les gestes du pavé tactile"), projects_view_mode_);
- save_label_paste_ = new QCheckBox(tr("Ne pas conserver les labels des éléments lors des copier coller"), projects_view_mode_);
- folio_panel_ = new QCheckBox(tr("Utiliser les labels de folio à la place de leurs ID"), projects_view_mode_);
- terminal_exportlist_ = new QCheckBox(tr("Exporter les bornes dans la nomenclature"), projects_view_mode_);
- m_zoom_out_beyond_folio = new QCheckBox(tr("Autoriser le dézoom au delà du folio"), this);
-
- QString fontInfos = settings.value("diagramitemfont").toString() + " " +
- settings.value("diagramitemsize").toString() + " (" +
- settings.value("diagramitemstyle").toString() + ")";
- font_label = new QLabel(tr("Police des champs de texte"));
- fontButton = new QPushButton(fontInfos);
- fontButton->setMinimumHeight(28);
-
- QString foliolistfontInfos = settings.value("foliolistfont").toString() + " " +
- settings.value("foliolistsize").toString() + " (" +
- settings.value("folioliststyle").toString() + ")";
- foliolist_font_label = new QLabel(tr("Police des champs textes des pages sommaires"));
- foliolist_fontButton = new QPushButton(foliolistfontInfos);
- foliolist_fontButton->setMinimumHeight(28);
-
- elements_management_ = new QGroupBox(tr("Gestion des éléments"), this);
- highlight_integrated_elements_ = new QCheckBox(tr("Mettre en valeur dans le panel les éléments fraîchement intégrés", "configuration option"));
- default_element_infos_label_ = new QLabel(
- tr(
- "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 :"
- )
- );
- default_element_infos_label_ -> setWordWrap(true);
- default_element_infos_textfield_ = new QTextEdit();
- default_element_infos_textfield_ -> setAcceptRichText(false);
-
- use_system_colors_ -> setChecked(use_system_colors);
-
- use_trackpad_ -> setChecked(use_trackpad);
- save_label_paste_ -> setChecked(save_label_paste);
- folio_panel_ ->setChecked(panel_folio);
- terminal_exportlist_ ->setChecked(terminal_exportlist);
-
- if (tabbed) {
- tabbed_mode_ -> setChecked(true);
- } else {
- windowed_mode_ -> setChecked(true);
- }
-
- m_zoom_out_beyond_folio -> setChecked(zoom_out_folio);
-
- highlight_integrated_elements_ -> setChecked(highlight_integrated_elements);
- default_element_infos_textfield_ -> setPlainText(default_element_informations);
-
- QVBoxLayout *appearance_layout = new QVBoxLayout();
- appearance_layout -> addWidget(use_system_colors_);
- appearance_ -> setLayout(appearance_layout);
-
- QVBoxLayout *projects_view_mode_layout = new QVBoxLayout;
- QHBoxLayout *font_view_layout = new QHBoxLayout;
- QHBoxLayout *foliolist_font_view_layout = new QHBoxLayout;
- projects_view_mode_layout -> addWidget(windowed_mode_);
- projects_view_mode_layout -> addWidget(tabbed_mode_);
- projects_view_mode_layout -> addWidget(m_zoom_out_beyond_folio);
- projects_view_mode_layout -> addWidget(use_trackpad_);
- projects_view_mode_layout -> addWidget(save_label_paste_);
- projects_view_mode_layout -> addWidget(folio_panel_);
- projects_view_mode_layout -> addWidget(terminal_exportlist_);
- font_view_layout->addWidget(font_label, 1);
- font_view_layout->addWidget(fontButton, 0);
- foliolist_font_view_layout->addWidget(foliolist_font_label, 1);
- foliolist_font_view_layout->addWidget(foliolist_fontButton, 0);
- projects_view_mode_layout-> addLayout(font_view_layout);
- projects_view_mode_layout-> addLayout(foliolist_font_view_layout);
- projects_view_mode_ -> setLayout(projects_view_mode_layout);
-
-
- connect(fontButton, SIGNAL(clicked()), this, SLOT(setFont()));
- connect(foliolist_fontButton, SIGNAL(clicked()), this, SLOT(setFoliolistFont()));
-
-
-
- QVBoxLayout *elements_management_layout = new QVBoxLayout();
- elements_management_layout -> addWidget(highlight_integrated_elements_);
- elements_management_layout -> addWidget(default_element_infos_label_);
- elements_management_layout -> addWidget(default_element_infos_textfield_);
- elements_management_ -> setLayout(elements_management_layout);
-
- //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();
- lang_label = new QLabel(tr("La nouvelle langue sera prise en compte au prochain lancement de QElectroTech."));
- lang_layout->addWidget(lang_combo_box);
- lang_layout->addWidget(lang_label);
- fillLang(settings);
-
- 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_);
-
- vlayout1 -> addWidget(appearance_);
- vlayout1 -> addWidget(projects_view_mode_);
- vlayout1 -> addWidget(elements_management_);
- vlayout1 -> addWidget(lang_group_box);
- vlayout1 -> addStretch();
-
- setLayout(vlayout1);
-}
-
-/// Destructeur
-GeneralConfigurationPage::~GeneralConfigurationPage() {
-}
-
-/**
- * @brief GeneralConfigurationPage::applyConf
- * Write all configuration in settings file
- */
-void GeneralConfigurationPage::applyConf()
-{
- QSettings settings;
-
- 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);
- }
-
- settings.setValue("lang", lang_combo_box->itemData(lang_combo_box->currentIndex()).toString());
-
- QString view_mode = tabbed_mode_ -> isChecked() ? "tabbed" : "windowed";
- settings.setValue("diagrameditor/viewmode", view_mode) ;
-
- settings.setValue("diagrameditor/highlight-integrated-elements", highlight_integrated_elements_ -> isChecked());
- settings.setValue("elementeditor/default-informations", default_element_infos_textfield_ -> toPlainText());
- settings.setValue("diagramview/gestures", use_trackpad_ -> isChecked());
- settings.setValue("diagramcommands/erase-label-on-copy", save_label_paste_ -> isChecked());
- settings.setValue("diagrameditor/zoom-out-beyond-of-folio", m_zoom_out_beyond_folio->isChecked());
- settings.setValue("genericpanel/folio",folio_panel_->isChecked());
- settings.setValue("nomenclature/terminal-exportlist",terminal_exportlist_->isChecked());
-}
-
-/// @return l'icone de cette page
-QIcon GeneralConfigurationPage::icon() const {
- return(QET::Icons::Settings);
-}
-
-/// @return le titre de cette page
-QString GeneralConfigurationPage::title() const {
- return(tr("Général", "configuration page title"));
-}
-
-/**
- * @brief GeneralConfigurationPage::fillLang
- * fill all available lang in @lang_combo_box
- */
-void GeneralConfigurationPage::fillLang(QSettings &settings) {
- lang_combo_box->addItem(QET::Icons::translation, tr("Système"), "system");
- lang_combo_box->insertSeparator(1);
-
- // all lang available on lang directory
- lang_combo_box->addItem(QET::Icons::ar, tr("Arabe"), "ar");
- lang_combo_box->addItem(QET::Icons::br, tr("Brézilien"), "pt_br");
- lang_combo_box->addItem(QET::Icons::catalonia, tr("Catalan"), "ca");
- lang_combo_box->addItem(QET::Icons::cs, tr("Tchèque"), "cs");
- lang_combo_box->addItem(QET::Icons::de, tr("Allemand"), "de");
- lang_combo_box->addItem(QET::Icons::da, tr("Danois"), "da");
- 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");
- lang_combo_box->addItem(QET::Icons::fr, tr("Français"), "fr");
- 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");
- lang_combo_box->addItem(QET::Icons::sl, tr("Slovène"), "sl");
- lang_combo_box->addItem(QET::Icons::nl, tr("Pays-Bas"), "nl");
- lang_combo_box->addItem(QET::Icons::be, tr("Belgique-Flemish"), "be");
-
- //set current 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);
-}
-
-/**
- Constructeur
- @param parent QWidget parent
-*/
ExportConfigPage::ExportConfigPage(QWidget *parent) : ConfigPage(parent) {
// epw contient les options d'export
epw = new ExportPropertiesWidget(ExportProperties::defaultExportProperties());
@@ -544,43 +327,4 @@
QString PrintConfigPage::title() const {
return(tr("Impression", "configuration page title"));
}
-/**
- * @brief GeneralConfigurationPage::setFont
- * Apply font to config
- */
-void GeneralConfigurationPage::setFont()
-{
- bool ok;
- QSettings settings;
- QFont font = QFontDialog::getFont(&ok, QFont("Sans Serif", 9), this);
- if (ok) {
- settings.setValue("diagramitemfont", font.family());
- settings.setValue("diagramitemsize", font.pointSize());
- settings.setValue("diagramitemweight", font.weight());
- settings.setValue("diagramitemstyle", font.styleName());
- QString fontInfos = settings.value("diagramitemfont").toString() + " " +
- settings.value("diagramitemsize").toString() + " (" +
- settings.value("diagramitemstyle").toString() + ")";
- fontButton->setText(fontInfos);
- }
-}
-/**
- * @brief GeneralConfigurationPage::setFoliolistFont
- * * Apply font to summary pages
- */
-void GeneralConfigurationPage::setFoliolistFont()
-{
- bool ok;
- QSettings settings;
- QFont font = QFontDialog::getFont(&ok, QFont("Sans Serif", 9), this);
- if (ok) {
- settings.setValue("foliolistfont", font.family());
- settings.setValue("foliolistsize", font.pointSize());
- settings.setValue("foliolistweight", font.weight());
- settings.setValue("folioliststyle", font.styleName());
- QString fontInfos = settings.value("foliolistfont").toString() + " " +
- settings.value("foliolistsize").toString() + " (" +
- settings.value("folioliststyle").toString() + ")";
- foliolist_fontButton->setText(fontInfos);
- }
-}
+
Modified: trunk/sources/configpages.h
===================================================================
--- trunk/sources/configpages.h 2018-05-24 13:40:54 UTC (rev 5373)
+++ trunk/sources/configpages.h 2018-05-24 18:08:06 UTC (rev 5374)
@@ -70,60 +70,6 @@
};
/**
- This configuration page enables users to specify various options,most of
- them applying to the whole application.
-*/
-class GeneralConfigurationPage : public ConfigPage {
- Q_OBJECT
- // constructors, destructor
- public:
- GeneralConfigurationPage(QWidget * = nullptr);
- ~GeneralConfigurationPage() override;
- private:
- GeneralConfigurationPage(const GeneralConfigurationPage &);
-
- // methods
- public:
- void applyConf() override;
- QString title() const override;
- QIcon icon() const override;
-
- private:
- void fillLang(QSettings &);
-
-public slots:
- void setFont();
- void setFoliolistFont();
-
- // attributes
- private:
- QLabel *title_label_;
- QFrame *horiz_line_;
- QGroupBox *appearance_;
- QCheckBox *use_system_colors_;
- QCheckBox *use_trackpad_;
- QCheckBox *save_label_paste_;
- QCheckBox *folio_panel_;
- QCheckBox *terminal_exportlist_;
- QGroupBox *projects_view_mode_;
- QRadioButton *windowed_mode_;
- QRadioButton *tabbed_mode_;
- QCheckBox *m_zoom_out_beyond_folio;
- QLabel *warning_view_mode_;
- QGroupBox *elements_management_;
- QCheckBox *highlight_integrated_elements_;
- QLabel *default_element_infos_label_;
- QTextEdit *default_element_infos_textfield_;
- QGroupBox *lang_group_box;
- QComboBox *lang_combo_box;
- QLabel *lang_label;
- QLabel *font_label;
- QPushButton *fontButton;
- QLabel *foliolist_font_label;
- QPushButton *foliolist_fontButton;
-};
-
-/**
This configuration page enables users to set default export options.
*/
class ExportConfigPage : public ConfigPage {
Modified: trunk/sources/qetapp.cpp
===================================================================
--- trunk/sources/qetapp.cpp 2018-05-24 13:40:54 UTC (rev 5373)
+++ trunk/sources/qetapp.cpp 2018-05-24 18:08:06 UTC (rev 5374)
@@ -29,6 +29,10 @@
#include "recentfiles.h"
#include "qeticons.h"
#include "templatescollection.h"
+#include "generalconfigurationpage.h"
+#include "qetmessagebox.h"
+#include "projectview.h"
+
#include <cstdlib>
#include <iostream>
#define QUOTE(x) STRINGIFY(x)
@@ -46,13 +50,13 @@
QString QETApp::config_dir = QString();
#endif
QString QETApp::lang_dir = QString();
-TitleBlockTemplatesFilesCollection *QETApp::common_tbt_collection_;
-TitleBlockTemplatesFilesCollection *QETApp::custom_tbt_collection_;
+TitleBlockTemplatesFilesCollection *QETApp::m_common_tbt_collection;
+TitleBlockTemplatesFilesCollection *QETApp::m_custom_tbt_collection;
ElementsCollectionCache *QETApp::collections_cache_ = nullptr;
QMap<uint, QETProject *> QETApp::registered_projects_ = QMap<uint, QETProject *>();
uint QETApp::next_project_id = 0;
-RecentFiles *QETApp::projects_recent_files_ = nullptr;
-RecentFiles *QETApp::elements_recent_files_ = nullptr;
+RecentFiles *QETApp::m_projects_recent_files = nullptr;
+RecentFiles *QETApp::m_elements_recent_files = nullptr;
TitleBlockTemplate *QETApp::default_titleblock_template_ = nullptr;
/**
@@ -62,7 +66,7 @@
*/
QETApp::QETApp(int &argc, char **argv) :
QETSingleApplication(argc, argv, QString("qelectrotech-" + QETApp::userName())),
- splash_screen_(nullptr),
+ m_splash_screen(nullptr),
non_interactive_execution_(false)
{
parseArguments();
@@ -114,20 +118,43 @@
openFiles(qet_arguments_);
}
buildSystemTrayMenu();
- splash_screen_ -> hide();
+ m_splash_screen -> hide();
+
+ checkBackupFiles();
}
-/// Destructeur
-QETApp::~QETApp() {
- elements_recent_files_ -> save();
- projects_recent_files_ -> save();
- delete splash_screen_;
- delete elements_recent_files_;
- delete projects_recent_files_;
- delete qsti;
- if (custom_tbt_collection_) delete custom_tbt_collection_;
- if (common_tbt_collection_) delete common_tbt_collection_;
+/**
+ * @brief QETApp::~QETApp
+ */
+QETApp::~QETApp()
+{
+ m_elements_recent_files->save();
+ m_projects_recent_files->save();
+
+ delete m_splash_screen;
+ delete m_elements_recent_files;
+ delete m_projects_recent_files;
+ delete m_qsti;
+
+ if (m_custom_tbt_collection)
+ delete m_custom_tbt_collection;
+ if (m_common_tbt_collection)
+ delete m_common_tbt_collection;
+
ElementFactory::dropInstance();
+
+ //Delete all backup files
+ QDir dir(configDir() + "backup");
+ if(dir.exists())
+ {
+ QStringList extension_filter("*.qet");
+ QStringList list = dir.entryList(extension_filter);
+ for(QString str : list)
+ {
+ QFile file(dir.path() + "/" + str);
+ file.remove();
+ }
+ }
}
/**
@@ -197,7 +224,7 @@
case QSystemTrayIcon::Context:
// affichage du menu
buildSystemTrayMenu();
- qsti -> contextMenu() -> show();
+ m_qsti -> contextMenu() -> show();
break;
case QSystemTrayIcon::DoubleClick:
case QSystemTrayIcon::Trigger:
@@ -354,13 +381,13 @@
by QElecrotTech
*/
TitleBlockTemplatesFilesCollection *QETApp::commonTitleBlockTemplatesCollection() {
- if (!common_tbt_collection_) {
- common_tbt_collection_ = new TitleBlockTemplatesFilesCollection(QETApp::commonTitleBlockTemplatesDir());
- common_tbt_collection_ -> setTitle(tr("Cartouches QET", "title of the title block templates collection provided by QElectroTech"));
- common_tbt_collection_ -> setProtocol(QETAPP_COMMON_TBT_PROTOCOL);
- common_tbt_collection_ -> setCollection(QET::QetCollection::Common);
+ if (!m_common_tbt_collection) {
+ m_common_tbt_collection = new TitleBlockTemplatesFilesCollection(QETApp::commonTitleBlockTemplatesDir());
+ m_common_tbt_collection -> setTitle(tr("Cartouches QET", "title of the title block templates collection provided by QElectroTech"));
+ m_common_tbt_collection -> setProtocol(QETAPP_COMMON_TBT_PROTOCOL);
+ m_common_tbt_collection -> setCollection(QET::QetCollection::Common);
}
- return(common_tbt_collection_);
+ return(m_common_tbt_collection);
}
/**
@@ -368,13 +395,13 @@
by the end user
*/
TitleBlockTemplatesFilesCollection *QETApp::customTitleBlockTemplatesCollection() {
- if (!custom_tbt_collection_) {
- custom_tbt_collection_ = new TitleBlockTemplatesFilesCollection(QETApp::customTitleBlockTemplatesDir());
- custom_tbt_collection_ -> setTitle(tr("Cartouches utilisateur", "title of the user's title block templates collection"));
- custom_tbt_collection_ -> setProtocol(QETAPP_CUSTOM_TBT_PROTOCOL);
- custom_tbt_collection_ -> setCollection(QET::QetCollection::Custom);
+ if (!m_custom_tbt_collection) {
+ m_custom_tbt_collection = new TitleBlockTemplatesFilesCollection(QETApp::customTitleBlockTemplatesDir());
+ m_custom_tbt_collection -> setTitle(tr("Cartouches utilisateur", "title of the user's title block templates collection"));
+ m_custom_tbt_collection -> setProtocol(QETAPP_CUSTOM_TBT_PROTOCOL);
+ m_custom_tbt_collection -> setCollection(QET::QetCollection::Custom);
}
- return(custom_tbt_collection_);
+ return(m_custom_tbt_collection);
}
/**
@@ -384,8 +411,8 @@
QList<TitleBlockTemplatesCollection *> QETApp::availableTitleBlockTemplatesCollections() {
QList<TitleBlockTemplatesCollection *> collections_list;
- collections_list << common_tbt_collection_;
- collections_list << custom_tbt_collection_;
+ collections_list << m_common_tbt_collection;
+ collections_list << m_custom_tbt_collection;
foreach(QETProject *opened_project, registered_projects_) {
collections_list << opened_project -> embeddedTitleBlockTemplatesCollection();
@@ -400,9 +427,9 @@
*/
TitleBlockTemplatesCollection *QETApp::titleBlockTemplatesCollection(const QString &protocol) {
if (protocol == QETAPP_COMMON_TBT_PROTOCOL) {
- return(common_tbt_collection_);
+ return(m_common_tbt_collection);
} else if (protocol == QETAPP_CUSTOM_TBT_PROTOCOL) {
- return(custom_tbt_collection_);
+ return(m_custom_tbt_collection);
} else {
QETProject *project = QETApp::projectFromString(protocol);
if (project) {
@@ -938,7 +965,7 @@
Nettoie certaines choses avant que l'application ne quitte
*/
void QETApp::cleanup() {
- qsti -> hide();
+ m_qsti -> hide();
}
/**
@@ -970,7 +997,7 @@
@return La liste des fichiers recents pour les projets
*/
RecentFiles *QETApp::projectsRecentFiles() {
- return(projects_recent_files_);
+ return(m_projects_recent_files);
}
/**
@@ -977,7 +1004,7 @@
@return La liste des fichiers recents pour les elements
*/
RecentFiles *QETApp::elementsRecentFiles() {
- return(elements_recent_files_);
+ return(m_elements_recent_files);
}
/**
@@ -1403,8 +1430,8 @@
*/
void QETApp::initSplashScreen() {
if (non_interactive_execution_) return;
- splash_screen_ = new QSplashScreen(QPixmap(":/ico/splash.png"));
- splash_screen_ -> show();
+ m_splash_screen = new QSplashScreen(QPixmap(":/ico/splash.png"));
+ m_splash_screen -> show();
setSplashScreenStep(tr("Chargement...", "splash screen caption"));
}
@@ -1414,9 +1441,9 @@
rien.
*/
void QETApp::setSplashScreenStep(const QString &message) {
- if (!splash_screen_) return;
+ if (!m_splash_screen) return;
if (!message.isEmpty()) {
- splash_screen_ -> showMessage(message, Qt::AlignBottom | Qt::AlignLeft);
+ m_splash_screen -> showMessage(message, Qt::AlignBottom | Qt::AlignLeft);
}
processEvents();
}
@@ -1460,10 +1487,10 @@
// fichiers recents
// note : les icones doivent etre initialisees avant ces instructions (qui creent des menus en interne)
- projects_recent_files_ = new RecentFiles("projects");
- projects_recent_files_ -> setIconForFiles(QET::Icons::ProjectFile);
- elements_recent_files_ = new RecentFiles("elements");
- elements_recent_files_ -> setIconForFiles(QET::Icons::Element);
+ m_projects_recent_files = new RecentFiles("projects");
+ m_projects_recent_files -> setIconForFiles(QET::Icons::ProjectFile);
+ m_elements_recent_files = new RecentFiles("elements");
+ m_elements_recent_files -> setIconForFiles(QET::Icons::Element);
}
/**
@@ -1503,11 +1530,11 @@
connect(new_element, SIGNAL(triggered()), this, SLOT(newElementEditor()));
// initialisation de l'icone du systray
- qsti = new QSystemTrayIcon(QET::Icons::QETLogo, this);
- qsti -> setToolTip(tr("QElectroTech", "systray icon tooltip"));
- connect(qsti, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(systray(QSystemTrayIcon::ActivationReason)));
- qsti -> setContextMenu(menu_systray);
- qsti -> show();
+ m_qsti = new QSystemTrayIcon(QET::Icons::QETLogo, this);
+ m_qsti -> setToolTip(tr("QElectroTech", "systray icon tooltip"));
+ connect(m_qsti, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(systray(QSystemTrayIcon::ActivationReason)));
+ m_qsti -> setContextMenu(menu_systray);
+ m_qsti -> show();
}
/**
@@ -1604,6 +1631,82 @@
menu_systray -> addAction(quitter_qet);
}
+/**
+ * @brief QETApp::checkBackupFiles
+ * Check for backup files.
+ * If backup was found, open a dialog and ask user what to do.
+ */
+void QETApp::checkBackupFiles()
+{
+ //Delete all backup files
+ QDir dir(configDir() + "backup");
+ if(dir.exists())
+ {
+ QStringList extension_filter("*.qet");
+ QStringList list = dir.entryList(extension_filter);
+ if(list.isEmpty())
+ return;
+
+ QString text;
+ if(list.size() == 1)
+ text.append(tr("<b>Le fichier de restauration suivant a été trouvé,<br>"
+ "Voulez-vous l'ouvrir ?</b><br>"));
+ else
+ text.append(tr("<b>Les fichiers de restauration suivant on été trouvé,<br>"
+ "Voulez-vous les ouvrir ?</b><br>"));
+ for(QString name : list)
+ text.append("<br>" + name);
+
+ if (QET::QetMessageBox::question(nullptr, tr("Fichier de restauration"), text, QMessageBox::Ok|QMessageBox::Cancel) == QMessageBox::Ok)
+ {
+ QStringList files_list;
+ for(QString str : list)
+ files_list << dir.path() + "/" + str;
+
+ QList<QETDiagramEditor *> diagrams_editors = diagramEditors();
+
+ //If there is opened editors, we find those who are visible
+ if (diagrams_editors.count())
+ {
+ QList<QETDiagramEditor *> visible_diagrams_editors;
+ for(QETDiagramEditor *de : diagrams_editors) {
+ if (de->isVisible())
+ visible_diagrams_editors << de;
+ }
+
+ //We take the first visible, or the first one
+ QETDiagramEditor *de_open;
+ if (visible_diagrams_editors.count()) {
+ de_open = visible_diagrams_editors.first();
+ }
+ else
+ {
+ de_open = diagrams_editors.first();
+ de_open -> setVisible(true);
+ }
+
+ for(QString file : files_list) {
+ de_open -> openAndAddProject(file);
+ }
+ }
+ else {
+ new QETDiagramEditor(files_list);
+ }
+
+ //Because the file was open from backup, we remove the file path of each project opened,
+ //for avoid user to save in the backup directory
+ for(QETDiagramEditor *editor : diagramEditors())
+ {
+ for(ProjectView *pv : editor->openedProjects())
+ {
+ if(files_list.contains(pv->project()->filePath()))
+ pv->project()->setFilePath(QString());
+ }
+ }
+ }
+ }
+}
+
/// Met a jour les booleens concernant l'etat des fenetres
void QETApp::fetchWindowStats(
const QList<QETDiagramEditor *> &diagrams,
Modified: trunk/sources/qetapp.h
===================================================================
--- trunk/sources/qetapp.h 2018-05-24 13:40:54 UTC (rev 5373)
+++ trunk/sources/qetapp.h 2018-05-24 18:08:06 UTC (rev 5374)
@@ -50,188 +50,195 @@
/**
This class represents the QElectroTech application.
*/
-class QETApp : public QETSingleApplication {
+class QETApp : public QETSingleApplication
+{
Q_OBJECT
- // constructors, destructor
+ // constructors, destructor
public:
- QETApp(int &, char **);
- ~QETApp() override;
+ QETApp(int &, char **);
+ ~QETApp() override;
private:
- QETApp(const QETApp &);
+ QETApp(const QETApp &);
- // methods
+ // methods
public:
- static QETApp *instance();
- void setLanguage(const QString &);
- static QString langFromSetting ();
- void switchLayout(Qt::LayoutDirection);
- static void printHelp();
- static void printVersion();
- static void printLicense();
-
- static ElementsCollectionCache *collectionCache();
- static QStringList elementInfoKeys();
- static QString elementTranslatedInfoKey(const QString &);
- static QString elementInfoToVar(const QString &info);
-
- static TitleBlockTemplatesFilesCollection *commonTitleBlockTemplatesCollection();
- static TitleBlockTemplatesFilesCollection *customTitleBlockTemplatesCollection();
- static QList<TitleBlockTemplatesCollection *> availableTitleBlockTemplatesCollections();
- static TitleBlockTemplatesCollection *titleBlockTemplatesCollection(const QString &);
-
- static QString userName();
- static QString commonElementsDir();
- static QString customElementsDir();
- static QString commonElementsDirN();
- static QString customElementsDirN();
- static QString commonTitleBlockTemplatesDir();
- static QString customTitleBlockTemplatesDir();
- static bool registerProject(QETProject *);
- static bool unregisterProject(QETProject *);
- static QMap<uint, QETProject *> registeredProjects();
- static QETProject *project(const uint &);
- static int projectId(const QETProject *);
- static QString configDir();
- static QString languagesPath();
- static QString realPath(const QString &);
- static QString symbolicPath(const QString &);
- static QStringList handledFileExtensions();
- static QStringList handledFiles(const QList<QUrl> &);
- static RecentFiles *projectsRecentFiles();
- static RecentFiles *elementsRecentFiles();
+ static QETApp *instance();
+ void setLanguage(const QString &);
+ static QString langFromSetting ();
+ void switchLayout(Qt::LayoutDirection);
+ static void printHelp();
+ static void printVersion();
+ static void printLicense();
+
+ static ElementsCollectionCache *collectionCache();
+ static QStringList elementInfoKeys();
+ static QString elementTranslatedInfoKey(const QString &);
+ static QString elementInfoToVar(const QString &info);
+
+ static TitleBlockTemplatesFilesCollection *commonTitleBlockTemplatesCollection();
+ static TitleBlockTemplatesFilesCollection *customTitleBlockTemplatesCollection();
+ static QList<TitleBlockTemplatesCollection *> availableTitleBlockTemplatesCollections();
+ static TitleBlockTemplatesCollection *titleBlockTemplatesCollection(const QString &);
+
+ static QString userName();
+ static QString commonElementsDir();
+ static QString customElementsDir();
+ static QString commonElementsDirN();
+ static QString customElementsDirN();
+ static QString commonTitleBlockTemplatesDir();
+ static QString customTitleBlockTemplatesDir();
+ static bool registerProject(QETProject *);
+ static bool unregisterProject(QETProject *);
+ static QMap<uint, QETProject *> registeredProjects();
+ static QETProject *project(const uint &);
+ static int projectId(const QETProject *);
+ static QString configDir();
+ static QString languagesPath();
+ static QString realPath(const QString &);
+ static QString symbolicPath(const QString &);
+ static QStringList handledFileExtensions();
+ static QStringList handledFiles(const QList<QUrl> &);
+ static RecentFiles *projectsRecentFiles();
+ static RecentFiles *elementsRecentFiles();
+
#ifdef QET_ALLOW_OVERRIDE_CED_OPTION
public:
- static void overrideCommonElementsDir(const QString &);
+ static void overrideCommonElementsDir(const QString &);
private:
- static QString common_elements_dir; ///< Directory containing the common elements collection
+ static QString common_elements_dir; ///< Directory containing the common elements collection
#endif
+
#ifdef QET_ALLOW_OVERRIDE_CTBTD_OPTION
public:
- static void overrideCommonTitleBlockTemplatesDir(const QString &);
+ static void overrideCommonTitleBlockTemplatesDir(const QString &);
private:
- static QString common_tbt_dir_; ///< Directory containing the common title block templates collection
+ static QString common_tbt_dir_; ///< Directory containing the common title block templates collection
#endif
+
#ifdef QET_ALLOW_OVERRIDE_CD_OPTION
public:
- static void overrideConfigDir(const QString &);
+ static void overrideConfigDir(const QString &);
private:
- static QString config_dir; ///< Directory containing the user configuration and the custom elements collection
+ static QString config_dir; ///< Directory containing the user configuration and the custom elements collection
#endif
+
public:
- static void overrideLangDir(const QString &);
- static QString lang_dir; ///< Directory containing localization files.
- static QFont diagramTextsFont(qreal = -1.0);
- static QFont diagramTextsItemFont(qreal = -1.0);
- static QFont foliolistTextsFont(qreal = -1.0);
- static QETDiagramEditor *diagramEditorForFile(const QString &);
- static QETDiagramEditor *diagramEditorAncestorOf (const QWidget *child);
- static QList<QETDiagramEditor *> diagramEditors();
- static QList<QETElementEditor *> elementEditors();
- static QList<QETElementEditor *> elementEditors(QETProject *);
- static QList<QETTitleBlockTemplateEditor *> titleBlockTemplateEditors();
- static QList<QETTitleBlockTemplateEditor *> titleBlockTemplateEditors(QETProject *);
- static QTextOrientationSpinBoxWidget *createTextOrientationSpinBoxWidget();
- static TitleBlockTemplate *defaultTitleBlockTemplate();
+ static void overrideLangDir(const QString &);
+ static QString lang_dir; ///< Directory containing localization files.
+ static QFont diagramTextsFont(qreal = -1.0);
+ static QFont diagramTextsItemFont(qreal = -1.0);
+ static QFont foliolistTextsFont(qreal = -1.0);
+ static QETDiagramEditor *diagramEditorForFile(const QString &);
+ static QETDiagramEditor *diagramEditorAncestorOf (const QWidget *child);
+ static QList<QETDiagramEditor *> diagramEditors();
+ static QList<QETElementEditor *> elementEditors();
+ static QList<QETElementEditor *> elementEditors(QETProject *);
+ static QList<QETTitleBlockTemplateEditor *> titleBlockTemplateEditors();
+ static QList<QETTitleBlockTemplateEditor *> titleBlockTemplateEditors(QETProject *);
+ static QTextOrientationSpinBoxWidget *createTextOrientationSpinBoxWidget();
+ static TitleBlockTemplate *defaultTitleBlockTemplate();
protected:
+
#ifdef Q_OS_DARWIN
bool event(QEvent *);
#endif
- // attributes
+ // attributes
private:
- QTranslator qtTranslator;
- QTranslator qetTranslator;
- QSystemTrayIcon *qsti;
- QSplashScreen *splash_screen_;
- QMenu *menu_systray;
- QAction *quitter_qet;
- QAction *reduce_appli;
- QAction *restore_appli;
- QAction *reduce_diagrams;
- QAction *restore_diagrams;
- QAction *reduce_elements;
- QAction *restore_elements;
- QAction *reduce_templates;
- QAction *restore_templates;
- QAction *new_diagram;
- QAction *new_element;
- QHash<QMainWindow *, QByteArray> window_geometries;
- QHash<QMainWindow *, QByteArray> window_states;
- bool every_editor_reduced;
- bool every_diagram_reduced;
- bool every_diagram_visible;
- bool every_element_reduced;
- bool every_element_visible;
- bool every_template_reduced;
- bool every_template_visible;
- QSignalMapper signal_map;
- QETArguments qet_arguments_; ///< Comand-line arguments parser
- bool non_interactive_execution_; ///< Whether the application will end without any user interaction
- QPalette initial_palette_; ///< System color palette
+ QTranslator qtTranslator;
+ QTranslator qetTranslator;
+ QSystemTrayIcon *m_qsti;
+ QSplashScreen *m_splash_screen;
+ QMenu *menu_systray;
+ QAction *quitter_qet;
+ QAction *reduce_appli;
+ QAction *restore_appli;
+ QAction *reduce_diagrams;
+ QAction *restore_diagrams;
+ QAction *reduce_elements;
+ QAction *restore_elements;
+ QAction *reduce_templates;
+ QAction *restore_templates;
+ QAction *new_diagram;
+ QAction *new_element;
+ QHash<QMainWindow *, QByteArray> window_geometries;
+ QHash<QMainWindow *, QByteArray> window_states;
+ bool every_editor_reduced;
+ bool every_diagram_reduced;
+ bool every_diagram_visible;
+ bool every_element_reduced;
+ bool every_element_visible;
+ bool every_template_reduced;
+ bool every_template_visible;
+ QSignalMapper signal_map;
+ QETArguments qet_arguments_; ///< Comand-line arguments parser
+ bool non_interactive_execution_; ///< Whether the application will end without any user interaction
+ QPalette initial_palette_; ///< System color palette
+
+ static TitleBlockTemplatesFilesCollection *m_common_tbt_collection;
+ static TitleBlockTemplatesFilesCollection *m_custom_tbt_collection;
+ static ElementsCollectionCache *collections_cache_;
+ static QMap<uint, QETProject *> registered_projects_;
+ static uint next_project_id;
+ static RecentFiles *m_projects_recent_files;
+ static RecentFiles *m_elements_recent_files;
+ static TitleBlockTemplate *default_titleblock_template_;
- static TitleBlockTemplatesFilesCollection *common_tbt_collection_;
- static TitleBlockTemplatesFilesCollection *custom_tbt_collection_;
- static ElementsCollectionCache *collections_cache_;
- static QMap<uint, QETProject *> registered_projects_;
- static uint next_project_id;
- static RecentFiles *projects_recent_files_;
- static RecentFiles *elements_recent_files_;
- static TitleBlockTemplate *default_titleblock_template_;
-
public slots:
- void systray(QSystemTrayIcon::ActivationReason);
- void reduceEveryEditor();
- void restoreEveryEditor();
- void reduceDiagramEditors();
- void restoreDiagramEditors();
- void reduceElementEditors();
- void restoreElementEditors();
- void reduceTitleBlockTemplateEditors();
- void restoreTitleBlockTemplateEditors();
- void newDiagramEditor();
- void newElementEditor();
- bool closeEveryEditor();
- void setMainWindowVisible(QMainWindow *, bool);
- void invertMainWindowVisibility(QWidget *);
- void useSystemPalette(bool);
- void quitQET();
- void checkRemainingWindows();
- void messageReceived(const QString &);
- void openFiles(const QETArguments &);
- void openProjectFiles(const QStringList &);
- void openElementFiles(const QStringList &);
- void openElementLocations(const QList<ElementsLocation> &);
- void openTitleBlockTemplate(const TitleBlockTemplateLocation &, bool = false);
- void openTitleBlockTemplate(const QString &);
- void openTitleBlockTemplateFiles(const QStringList &);
- void configureQET();
- void aboutQET();
+ void systray(QSystemTrayIcon::ActivationReason);
+ void reduceEveryEditor();
+ void restoreEveryEditor();
+ void reduceDiagramEditors();
+ void restoreDiagramEditors();
+ void reduceElementEditors();
+ void restoreElementEditors();
+ void reduceTitleBlockTemplateEditors();
+ void restoreTitleBlockTemplateEditors();
+ void newDiagramEditor();
+ void newElementEditor();
+ bool closeEveryEditor();
+ void setMainWindowVisible(QMainWindow *, bool);
+ void invertMainWindowVisibility(QWidget *);
+ void useSystemPalette(bool);
+ void quitQET();
+ void checkRemainingWindows();
+ void messageReceived(const QString &);
+ void openFiles(const QETArguments &);
+ void openProjectFiles(const QStringList &);
+ void openElementFiles(const QStringList &);
+ void openElementLocations(const QList<ElementsLocation> &);
+ void openTitleBlockTemplate(const TitleBlockTemplateLocation &, bool = false);
+ void openTitleBlockTemplate(const QString &);
+ void openTitleBlockTemplateFiles(const QStringList &);
+ void configureQET();
+ void aboutQET();
private slots:
- void cleanup();
+ void cleanup();
private:
- template <class T> QList<T *> detectWindows() const;
- template <class T> void setMainWindowsVisible(bool);
- QList<QWidget *> floatingToolbarsAndDocksForMainWindow(QMainWindow *) const;
- void parseArguments();
- void initSplashScreen();
- void setSplashScreenStep(const QString & = QString());
- void initLanguage();
- void initStyle();
- void initConfiguration();
- void initSystemTray();
- void buildSystemTrayMenu();
- void fetchWindowStats(
- const QList<QETDiagramEditor *> &,
- const QList<QETElementEditor *> &,
- const QList<QETTitleBlockTemplateEditor *> &
- );
- template <class T> void addWindowsListToMenu(QMenu *, const QList<T *> &);
- static int projectIdFromString(const QString &);
- static QETProject *projectFromString(const QString &);
+ template <class T> QList<T *> detectWindows() const;
+ template <class T> void setMainWindowsVisible(bool);
+ QList<QWidget *> floatingToolbarsAndDocksForMainWindow(QMainWindow *) const;
+ void parseArguments();
+ void initSplashScreen();
+ void setSplashScreenStep(const QString & = QString());
+ void initLanguage();
+ void initStyle();
+ void initConfiguration();
+ void initSystemTray();
+ void buildSystemTrayMenu();
+ void checkBackupFiles();
+ void fetchWindowStats(
+ const QList<QETDiagramEditor *> &,
+ const QList<QETElementEditor *> &,
+ const QList<QETTitleBlockTemplateEditor *> &
+ );
+ template <class T> void addWindowsListToMenu(QMenu *, const QList<T *> &);
+ static int projectIdFromString(const QString &);
+ static QETProject *projectFromString(const QString &);
};
#endif
Modified: trunk/sources/qetproject.cpp
===================================================================
--- trunk/sources/qetproject.cpp 2018-05-24 13:40:54 UTC (rev 5373)
+++ trunk/sources/qetproject.cpp 2018-05-24 18:08:06 UTC (rev 5374)
@@ -32,9 +32,11 @@
#include "numerotationcontextcommands.h"
#include "assignvariables.h"
-
+#include <QTimer>
#include <QStandardPaths>
+static int BACKUP_INTERVAL = 300000; //interval in ms of backup
+
/**
Constructeur par defaut - cree un schema contenant une collection
d'elements vide et un schema vide.
@@ -63,8 +65,26 @@
setupTitleBlockTemplatesCollection();
- undo_stack_ = new QUndoStack();
- connect(undo_stack_, SIGNAL(cleanChanged(bool)), this, SLOT(undoStackChanged(bool)));
+ m_undo_stack = new QUndoStack();
+ connect(m_undo_stack, SIGNAL(cleanChanged(bool)), this, SLOT(undoStackChanged(bool)));
+
+ m_save_backup_timer.setInterval(BACKUP_INTERVAL);
+ connect(&m_save_backup_timer, &QTimer::timeout, this, &QETProject::writeBackup);
+ m_save_backup_timer.start();
+
+ QSettings settings;
+ int autosave_interval = settings.value("diagrameditor/autosave-interval", 0).toInt();
+ if(autosave_interval > 0)
+ {
+ int ms = autosave_interval*60*1000;
+ m_autosave_timer.setInterval(ms);
+ connect(&m_autosave_timer, &QTimer::timeout, [this]()
+ {
+ if(!this->m_file_path.isEmpty())
+ this->write();
+ });
+ m_autosave_timer.start();
+ }
}
/**
@@ -111,8 +131,27 @@
setReadOnly(true);
}
- undo_stack_ = new QUndoStack();
- connect(undo_stack_, SIGNAL(cleanChanged(bool)), this, SLOT(undoStackChanged(bool)));
+ m_undo_stack = new QUndoStack();
+ connect(m_undo_stack, SIGNAL(cleanChanged(bool)), this, SLOT(undoStackChanged(bool)));
+
+ m_save_backup_timer.setInterval(BACKUP_INTERVAL);
+ connect(&m_save_backup_timer, &QTimer::timeout, this, &QETProject::writeBackup);
+ m_save_backup_timer.start();
+ writeBackup();
+
+ QSettings settings;
+ int autosave_interval = settings.value("diagrameditor/autosave-interval", 0).toInt();
+ if(autosave_interval > 0)
+ {
+ int ms = autosave_interval*60*1000;
+ m_autosave_timer.setInterval(ms);
+ connect(&m_autosave_timer, &QTimer::timeout, [this]()
+ {
+ if(!this->m_file_path.isEmpty())
+ this->write();
+ });
+ m_autosave_timer.start();
+ }
}
/**
@@ -122,7 +161,18 @@
QETProject::~QETProject()
{
qDeleteAll(m_diagrams_list);
- delete undo_stack_;
+ delete m_undo_stack;
+
+ //Project is closed without crash, we can safely remove the backup file.
+ if (!m_file_path.isEmpty())
+ {
+ QDir dir(QETApp::configDir() + "/backup");
+ if(!dir.exists())
+ return;
+
+ QString project_name = m_file_path.split("/").last();
+ dir.remove(project_name);
+ }
}
/**
@@ -187,7 +237,7 @@
@return le chemin du fichier dans lequel ce projet est enregistre
*/
QString QETProject::filePath() {
- return(file_path_);
+ return(m_file_path);
}
/**
@@ -195,15 +245,15 @@
@param filepath Nouveau chemin de fichier
*/
void QETProject::setFilePath(const QString &filepath) {
- file_path_ = filepath;
+ m_file_path = filepath;
// le chemin a change : on reevalue la necessite du mode lecture seule
- QFileInfo file_path_info(file_path_);
+ QFileInfo file_path_info(m_file_path);
if (file_path_info.isWritable()) {
setReadOnly(false);
}
- emit(projectFilePathChanged(this, file_path_));
+ emit(projectFilePathChanged(this, m_file_path));
emit(projectInformationsChanged(this));
}
@@ -214,10 +264,10 @@
*/
QString QETProject::currentDir() const {
QString current_directory;
- if (file_path_.isEmpty()) {
+ if (m_file_path.isEmpty()) {
current_directory = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
} else {
- current_directory = QFileInfo(file_path_).absoluteDir().absolutePath();
+ current_directory = QFileInfo(m_file_path).absoluteDir().absolutePath();
}
return(current_directory);
}
@@ -240,14 +290,14 @@
"Projet « %1 : %2»",
"displayed title for a ProjectView - %1 is the project title, -%2 is the project path"
)
- ).arg(project_title_).arg (file_path_);
- } else if (!file_path_.isEmpty()) {
+ ).arg(project_title_).arg (m_file_path);
+ } else if (!m_file_path.isEmpty()) {
final_title = QString(
tr(
"Projet %1",
"displayed title for a title-less project - %1 is the file name"
)
- ).arg(QFileInfo(file_path_).completeBaseName());
+ ).arg(QFileInfo(m_file_path).completeBaseName());
} else {
final_title = QString(
tr(
@@ -800,12 +850,12 @@
QETResult QETProject::write()
{
// this operation requires a filepath
- if (file_path_.isEmpty())
+ if (m_file_path.isEmpty())
return(QString("unable to save project to file: no filepath was specified"));
// if the project was opened read-only and the file is still non-writable, do not save the project
- if (isReadOnly() && !QFileInfo(file_path_).isWritable())
- return(QString("the file %1 was opened read-only and thus will not be written").arg(file_path_));
+ if (isReadOnly() && !QFileInfo(m_file_path).isWritable())
+ return(QString("the file %1 was opened read-only and thus will not be written").arg(m_file_path));
//Get the project in xml
@@ -813,7 +863,7 @@
xml_project.appendChild(xml_project.importNode(toXml().documentElement(), true));
QString error_message;
- if (!QET::writeXmlFile(xml_project, file_path_, &error_message)) return(error_message);
+ if (!QET::writeXmlFile(xml_project, m_file_path, &error_message)) return(error_message);
setModified(false);
return(QETResult());
@@ -823,7 +873,7 @@
@return true si le projet est en mode readonly, false sinon
*/
bool QETProject::isReadOnly() const {
- return(read_only_ && read_only_file_path_ == file_path_);
+ return(read_only_ && read_only_file_path_ == m_file_path);
}
/**
@@ -836,7 +886,7 @@
if (read_only_ != read_only)
{
//keep the file to which this project is read-only
- read_only_file_path_ = file_path_;
+ read_only_file_path_ = m_file_path;
read_only_ = read_only;
emit(readOnlyChanged(this, read_only));
}
@@ -1598,6 +1648,30 @@
}
/**
+ * @brief QETProject::writeBackup
+ * Write a backup file of this project, in the case that QET crash
+ */
+void QETProject::writeBackup()
+{
+ if(m_file_path.isEmpty())
+ return;
+
+ QDir dir(QETApp::configDir() + "/backup");
+ if(!dir.exists())
+ {
+ dir.cdUp();
+ dir.mkdir("backup");
+ dir.cd("backup");
+ }
+
+ QDomDocument xml_project;
+ xml_project.appendChild(xml_project.importNode(toXml().documentElement(), true));
+
+ QString project_name = m_file_path.split("/").last();
+ QET::writeXmlFile(xml_project, dir.absoluteFilePath(project_name));
+}
+
+/**
@return true if project options (title, project-wide properties, settings
for new diagrams, diagrams order...) were modified, false otherwise.
*/
@@ -1634,7 +1708,7 @@
bool QETProject::projectWasModified() {
if ( projectOptionsWereModified() ||
- !undo_stack_ -> isClean() ||
+ !m_undo_stack -> isClean() ||
titleblocks_.templates().count() )
return(true);
Modified: trunk/sources/qetproject.h
===================================================================
--- trunk/sources/qetproject.h 2018-05-24 13:40:54 UTC (rev 5373)
+++ trunk/sources/qetproject.h 2018-05-24 18:08:06 UTC (rev 5374)
@@ -34,6 +34,7 @@
class NumerotationContext;
class QUndoStack;
class XmlElementCollection;
+class QTimer;
/**
This class represents a QET project. Typically saved as a .qet file, it
@@ -55,7 +56,6 @@
private:
QETProject(const QETProject &);
- void init ();
// enums
public:
@@ -163,7 +163,7 @@
bool projectOptionsWereModified();
DiagramContext projectProperties();
void setProjectProperties(const DiagramContext &);
- QUndoStack* undoStack() {return undo_stack_;}
+ QUndoStack* undoStack() {return m_undo_stack;}
public slots:
Diagram *addNewDiagram();
@@ -204,7 +204,6 @@
private:
void setupTitleBlockTemplatesCollection();
-
void readProjectXml(QDomDocument &xml_project);
void readDiagramsXml(QDomDocument &xml_project);
void readElementsCollectionXml(QDomDocument &xml_project);
@@ -215,11 +214,12 @@
void writeDefaultPropertiesXml(QDomElement &);
void addDiagram(Diagram *);
NamesList namesListForIntegrationCategory();
+ void writeBackup();
// attributes
private:
/// File path this project is saved to
- QString file_path_;
+ QString m_file_path;
/// Current state of the project
ProjectState state_;
/// Diagrams carried by the project
@@ -249,7 +249,7 @@
/// project-wide variables that will be made available to child diagrams
DiagramContext project_properties_;
/// undo stack for this project
- QUndoStack *undo_stack_;
+ QUndoStack *m_undo_stack;
/// Conductor auto numerotation
QHash <QString, NumerotationContext> m_conductor_autonum;//Title and NumContext hash
QString m_current_conductor_autonum;
@@ -264,6 +264,8 @@
XmlElementCollection *m_elements_collection;
bool m_freeze_new_elements;
bool m_freeze_new_conductors;
+ QTimer m_save_backup_timer,
+ m_autosave_timer;
};
Q_DECLARE_METATYPE(QETProject *)
Added: trunk/sources/ui/configpage/generalconfigurationpage.cpp
===================================================================
--- trunk/sources/ui/configpage/generalconfigurationpage.cpp (rev 0)
+++ trunk/sources/ui/configpage/generalconfigurationpage.cpp 2018-05-24 18:08:06 UTC (rev 5374)
@@ -0,0 +1,204 @@
+/*
+ Copyright 2006-2018 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 "generalconfigurationpage.h"
+#include "ui_generalconfigurationpage.h"
+#include "qeticons.h"
+#include "qetapp.h"
+
+#include <QSettings>
+#include <QFontDialog>
+
+/**
+ * @brief GeneralConfigurationPage::GeneralConfigurationPage
+ * @param parent
+ */
+GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
+ ConfigPage(parent),
+ ui(new Ui::GeneralConfigurationPage)
+{
+ ui->setupUi(this);
+
+ QSettings settings;
+
+ ui->m_use_system_color_cb->setChecked(settings.value("usesystemcolors", "true").toBool());
+ bool tabbed = settings.value("diagrameditor/viewmode", "tabbed") == "tabbed";
+ if(tabbed)
+ ui->m_use_tab_mode_rb->setChecked(true);
+ else
+ ui->m_use_windows_mode_rb->setChecked(true);
+ ui->m_zoom_out_beyond_folio->setChecked(settings.value("diagrameditor/zoom-out-beyond-of-folio", false).toBool());
+ ui->m_use_gesture_trackpad->setChecked(settings.value("diagramview/gestures", false).toBool());
+ ui->m_save_label_paste->setChecked(settings.value("diagramcommands/erase-label-on-copy", true).toBool());
+ ui->m_use_folio_label->setChecked(settings.value("genericpanel/folio", true).toBool());
+ ui->m_export_terminal->setChecked(settings.value("nomenclature-exportlist", true).toBool());
+ ui->m_autosave_sb->setValue(settings.value("diagrameditor/autosave-interval", 0).toInt());
+
+ QString fontInfos = settings.value("diagramitemfont").toString() + " " +
+ settings.value("diagramitemsize").toString() + " (" +
+ settings.value("diagramitemstyle").toString() + ")";
+ ui->m_font_pb->setText(fontInfos);
+
+ QString foliolistfontInfos = settings.value("foliolistfont").toString() + " " +
+ settings.value("foliolistsize").toString() + " (" +
+ settings.value("folioliststyle").toString() + ")";
+ ui->m_folio_list_pb->setText(foliolistfontInfos);
+
+ ui->m_highlight_integrated_elements->setChecked(settings.value("diagrameditor/highlight-integrated-elements", true).toBool());
+ ui->m_default_elements_info->setPlainText(settings.value("elementeditor/default-informations", "").toString());
+
+ fillLang();
+}
+
+GeneralConfigurationPage::~GeneralConfigurationPage()
+{
+ delete ui;
+}
+
+/**
+ * @brief GeneralConfigurationPage::applyConf
+ * Write all configuration in settings file
+ */
+void GeneralConfigurationPage::applyConf()
+{
+ QSettings settings;
+
+ bool was_using_system_colors = settings.value("usesystemcolors", "true").toBool();
+ bool must_use_system_colors = ui->m_use_system_color_cb->isChecked();
+ settings.setValue("usesystemcolors", must_use_system_colors);
+ if (was_using_system_colors != must_use_system_colors) {
+ QETApp::instance()->useSystemPalette(must_use_system_colors);
+ }
+
+ settings.setValue("lang", ui->m_lang_cb->itemData(ui->m_lang_cb->currentIndex()).toString());
+
+ QString view_mode = ui->m_use_tab_mode_rb->isChecked() ? "tabbed" : "windowed";
+ settings.setValue("diagrameditor/viewmode", view_mode) ;
+
+ settings.setValue("diagrameditor/highlight-integrated-elements", ui->m_highlight_integrated_elements->isChecked());
+ settings.setValue("elementeditor/default-informations", ui->m_default_elements_info->toPlainText());
+ settings.setValue("diagramview/gestures", ui->m_use_gesture_trackpad->isChecked());
+ settings.setValue("diagramcommands/erase-label-on-copy", ui->m_save_label_paste->isChecked());
+ settings.setValue("diagrameditor/zoom-out-beyond-of-folio", ui->m_zoom_out_beyond_folio->isChecked());
+ settings.setValue("genericpanel/folio",ui->m_use_folio_label->isChecked());
+ settings.setValue("nomenclature/terminal-exportlist",ui->m_export_terminal->isChecked());
+ settings.setValue("diagrameditor/autosave-interval", ui->m_autosave_sb->value());
+}
+
+/**
+ * @brief GeneralConfigurationPage::title
+ * @return The title of this page
+ */
+QString GeneralConfigurationPage::title() const {
+ return(tr("Général", "configuration page title"));
+}
+
+/**
+ * @brief GeneralConfigurationPage::icon
+ * @return The icon of this page
+ */
+QIcon GeneralConfigurationPage::icon() const {
+ return(QET::Icons::Settings);
+}
+
+/**
+ * @brief GeneralConfigurationPage::fillLang
+ * fill all available lang
+ */
+void GeneralConfigurationPage::fillLang()
+{
+ ui->m_lang_cb->addItem(QET::Icons::translation, tr("Système"), "system");
+ ui->m_lang_cb->insertSeparator(1);
+
+ // all lang available on lang directory
+ ui->m_lang_cb->addItem(QET::Icons::ar, tr("Arabe"), "ar");
+ ui->m_lang_cb->addItem(QET::Icons::br, tr("Brézilien"), "pt_br");
+ ui->m_lang_cb->addItem(QET::Icons::catalonia, tr("Catalan"), "ca");
+ ui->m_lang_cb->addItem(QET::Icons::cs, tr("Tchèque"), "cs");
+ ui->m_lang_cb->addItem(QET::Icons::de, tr("Allemand"), "de");
+ ui->m_lang_cb->addItem(QET::Icons::da, tr("Danois"), "da");
+ ui->m_lang_cb->addItem(QET::Icons::gr, tr("Grec"), "el");
+ ui->m_lang_cb->addItem(QET::Icons::en, tr("Anglais"), "en");
+ ui->m_lang_cb->addItem(QET::Icons::es, tr("Espagnol"), "es");
+ ui->m_lang_cb->addItem(QET::Icons::fr, tr("Français"), "fr");
+ ui->m_lang_cb->addItem(QET::Icons::hr, tr("Croate"), "hr");
+ ui->m_lang_cb->addItem(QET::Icons::it, tr("Italien"), "it");
+ ui->m_lang_cb->addItem(QET::Icons::pl, tr("Polonais"), "pl");
+ ui->m_lang_cb->addItem(QET::Icons::pt, tr("Portugais"), "pt");
+ ui->m_lang_cb->addItem(QET::Icons::ro, tr("Roumains"), "ro");
+ ui->m_lang_cb->addItem(QET::Icons::ru, tr("Russe"), "ru");
+ ui->m_lang_cb->addItem(QET::Icons::sl, tr("Slovène"), "sl");
+ ui->m_lang_cb->addItem(QET::Icons::nl, tr("Pays-Bas"), "nl");
+ ui->m_lang_cb->addItem(QET::Icons::be, tr("Belgique-Flemish"), "be");
+
+ //set current index to the lang found in setting file
+ //if lang doesn't exist set to system
+ QSettings settings;
+ for (int i=0; i<ui->m_lang_cb->count(); i++)
+ {
+ if (ui->m_lang_cb->itemData(i).toString() == settings.value("lang").toString())
+ {
+ ui->m_lang_cb->setCurrentIndex(i);
+ return;
+ }
+ }
+ ui->m_lang_cb->setCurrentIndex(0);
+}
+
+/**
+ * @brief GeneralConfigurationPage::on_m_font_pb_clicked
+ * Apply font to config
+ */
+void GeneralConfigurationPage::on_m_font_pb_clicked()
+{
+ bool ok;
+ QSettings settings;
+ QFont font = QFontDialog::getFont(&ok, QFont("Sans Serif", 9), this);
+ if (ok)
+ {
+ settings.setValue("diagramitemfont", font.family());
+ settings.setValue("diagramitemsize", font.pointSize());
+ settings.setValue("diagramitemweight", font.weight());
+ settings.setValue("diagramitemstyle", font.styleName());
+ QString fontInfos = settings.value("diagramitemfont").toString() + " " +
+ settings.value("diagramitemsize").toString() + " (" +
+ settings.value("diagramitemstyle").toString() + ")";
+ ui->m_font_pb->setText(fontInfos);
+ }
+}
+
+/**
+ * @brief GeneralConfigurationPage::on_m_folio_list_pb_clicked
+ * Apply font to summary pages
+ */
+void GeneralConfigurationPage::on_m_folio_list_pb_clicked()
+{
+ bool ok;
+ QSettings settings;
+ QFont font = QFontDialog::getFont(&ok, QFont("Sans Serif", 9), this);
+ if (ok)
+ {
+ settings.setValue("foliolistfont", font.family());
+ settings.setValue("foliolistsize", font.pointSize());
+ settings.setValue("foliolistweight", font.weight());
+ settings.setValue("folioliststyle", font.styleName());
+ QString fontInfos = settings.value("foliolistfont").toString() + " " +
+ settings.value("foliolistsize").toString() + " (" +
+ settings.value("folioliststyle").toString() + ")";
+ ui->m_folio_list_pb->setText(fontInfos);
+ }
+}
Added: trunk/sources/ui/configpage/generalconfigurationpage.h
===================================================================
--- trunk/sources/ui/configpage/generalconfigurationpage.h (rev 0)
+++ trunk/sources/ui/configpage/generalconfigurationpage.h 2018-05-24 18:08:06 UTC (rev 5374)
@@ -0,0 +1,51 @@
+/*
+ Copyright 2006-2018 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 GENERALCONFIGURATIONPAGE_H
+#define GENERALCONFIGURATIONPAGE_H
+
+#include <QWidget>
+#include "configpage.h"
+
+namespace Ui {
+ class GeneralConfigurationPage;
+}
+
+class GeneralConfigurationPage : public ConfigPage
+{
+ Q_OBJECT
+
+ public:
+ explicit GeneralConfigurationPage(QWidget *parent = 0);
+ ~GeneralConfigurationPage();
+
+ virtual void applyConf() override;
+ virtual QString title() const override;
+ virtual QIcon icon() const override;
+
+ private slots:
+ void on_m_font_pb_clicked();
+ void on_m_folio_list_pb_clicked();
+
+ private:
+ void fillLang();
+
+ private:
+ Ui::GeneralConfigurationPage *ui;
+};
+
+#endif // GENERALCONFIGURATIONPAGE_H
Added: trunk/sources/ui/configpage/generalconfigurationpage.ui
===================================================================
--- trunk/sources/ui/configpage/generalconfigurationpage.ui (rev 0)
+++ trunk/sources/ui/configpage/generalconfigurationpage.ui 2018-05-24 18:08:06 UTC (rev 5374)
@@ -0,0 +1,229 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>GeneralConfigurationPage</class>
+ <widget class="QWidget" name="GeneralConfigurationPage">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>827</width>
+ <height>662</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>Général</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="Line" name="line">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Apparence</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QCheckBox" name="m_use_system_color_cb">
+ <property name="text">
+ <string>Utiliser les couleurs du système</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Projets</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="8" column="2">
+ <widget class="QPushButton" name="m_font_pb">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Interval de la sauvegarde automatique (appliqué au prochain lancement de QElectroTech)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="2">
+ <widget class="QPushButton" name="m_folio_list_pb">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item row="4" column="0">
+ <widget class="QCheckBox" name="m_save_label_paste">
+ <property name="text">
+ <string>Ne pas conserver les labels des éléments lors des copier coller</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QRadioButton" name="m_use_tab_mode_rb">
+ <property name="text">
+ <string>Utilisé des onglets (appliqué au proc&hain lancement de QElectroTech)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="0">
+ <widget class="QCheckBox" name="m_use_gesture_trackpad">
+ <property name="text">
+ <string>Utiliser les gestes du pavé tactile</string>
+ </property>
+ </widget>
+ </item>
+ <item row="9" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Police des champs textes des pages sommaires</string>
+ </property>
+ </widget>
+ </item>
+ <item row="8" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>Police des champs de texte</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="0">
+ <widget class="QCheckBox" name="m_export_terminal">
+ <property name="text">
+ <string>Exporter les bornes dans la nomenclature</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="2">
+ <widget class="QSpinBox" name="m_autosave_sb">
+ <property name="frame">
+ <bool>true</bool>
+ </property>
+ <property name="specialValueText">
+ <string>Désactivé</string>
+ </property>
+ <property name="suffix">
+ <string comment="minute"> min</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="0">
+ <widget class="QRadioButton" name="m_use_windows_mode_rb">
+ <property name="text">
+ <string>Utiliser des fenêtres (appliqué au prochain lancement de &QElectroTech)</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="0">
+ <widget class="QCheckBox" name="m_zoom_out_beyond_folio">
+ <property name="text">
+ <string>Autoriser le dézoom au delà du folio</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="0">
+ <widget class="QCheckBox" name="m_use_folio_label">
+ <property name="text">
+ <string>Utiliser les labels de folio à la place de leurs ID</string>
+ </property>
+ </widget>
+ </item>
+ <item row="7" column="1">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>Gestion des éléments</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QCheckBox" name="m_highlight_integrated_elements">
+ <property name="text">
+ <string>Mettre en valeur dans le panel les éléments fraîchement intégrés</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>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 :</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QTextEdit" name="m_default_elements_info"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_4">
+ <property name="title">
+ <string>Langue</string>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QComboBox" name="m_lang_cb"/>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>Appliqué au prochain lancement de QElectroTech</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>