[qet] [4601] Add new settings value for save or not elements informations in copy/

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 4601
Author:   scorpio810
Date:     2016-08-04 11:54:43 +0200 (Thu, 04 Aug 2016)
Log Message:
-----------
Add new settings value for save or not elements informations in copy/
paste

Modified Paths:
--------------
    trunk/sources/configpages.cpp
    trunk/sources/configpages.h
    trunk/sources/diagramcommands.cpp

Modified: trunk/sources/configpages.cpp
===================================================================
--- trunk/sources/configpages.cpp	2016-08-02 01:35:55 UTC (rev 4600)
+++ trunk/sources/configpages.cpp	2016-08-04 09:54:43 UTC (rev 4601)
@@ -234,6 +234,7 @@
 	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/save-label", true).toBool();
 	bool highlight_integrated_elements = settings.value("diagrameditor/highlight-integrated-elements", true).toBool();
 	QString default_element_informations = settings.value("elementeditor/default-informations", "").toString();
 	
@@ -243,6 +244,7 @@
 	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_);
 	m_zoom_out_beyond_folio = new QCheckBox(tr("Autoriser le dézoom au delà du folio"), this);
 	
 	elements_management_ = new QGroupBox(tr("Gestion des éléments"), this);
@@ -260,6 +262,7 @@
 	use_system_colors_ -> setChecked(use_system_colors);
 
 	use_trackpad_ -> setChecked(use_trackpad);
+	save_label_paste_ -> setChecked(save_label_paste);
 
 	if (tabbed) {
 		tabbed_mode_ -> setChecked(true);
@@ -281,6 +284,7 @@
 	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_ -> setLayout(projects_view_mode_layout);
 	
 	QVBoxLayout *elements_management_layout = new QVBoxLayout();
@@ -343,6 +347,7 @@
 	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/save-label", save_label_paste_ -> isChecked());
 	settings.setValue("diagrameditor/zoom-out-beyond-of-folio", m_zoom_out_beyond_folio->isChecked());
 }
 

Modified: trunk/sources/configpages.h
===================================================================
--- trunk/sources/configpages.h	2016-08-02 01:35:55 UTC (rev 4600)
+++ trunk/sources/configpages.h	2016-08-04 09:54:43 UTC (rev 4601)
@@ -97,6 +97,7 @@
 	QGroupBox *appearance_;
 	QCheckBox *use_system_colors_;
 	QCheckBox *use_trackpad_;
+	QCheckBox *save_label_paste_;
 	QGroupBox *projects_view_mode_;
 	QRadioButton *windowed_mode_;
 	QRadioButton *tabbed_mode_;

Modified: trunk/sources/diagramcommands.cpp
===================================================================
--- trunk/sources/diagramcommands.cpp	2016-08-02 01:35:55 UTC (rev 4600)
+++ trunk/sources/diagramcommands.cpp	2016-08-04 09:54:43 UTC (rev 4601)
@@ -169,6 +169,7 @@
 void PasteDiagramCommand::redo()
 {
 	diagram -> showMe();
+	QSettings settings;
 
 	if (first_redo) {
 		first_redo = false;
@@ -192,7 +193,8 @@
 					eti->setPlainText("_");
 				if (ElementTextItem *eti = e->taggedText("tension-protocol"))
 					eti->setPlainText("_");
-			} /*else {
+			}
+				if (settings.value("diagramcommands/save-label", true).toBool()){
 				//Reset the information about the label, the comment and location
 				e -> rElementInformations().addValue("label", "");
 				e -> rElementInformations().addValue("comment", "");
@@ -201,7 +203,7 @@
 				//Reset the text field tagged "label
 				if (ElementTextItem *eti = e ->taggedText("label"))
 				eti -> setPlainText("_");
-			}*/
+			}
 		}
 
 			//Reset the text of conductors


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/