View Issue Details

IDProjectCategoryView StatusLast Update
0011144ScribusStory Editor / Text Framespublic2014-09-05 19:21
ReporterJLuc Assigned Tocezaryece  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
OSUbuntu 
Product Version1.5.0svn 
Summary0011144: Slow wysiwyg edit since footnotes merged
DescriptionSince the footnote branch has been merged, the wysiwyg edit of long texts has become slow, even if there is no footnote in the text frame.
Steps To Reproduce- create frame
- insert default false text (10 paragraphs of lorem ipsum)
- insert characters at the begining of the frame : after inserting 30 characters at a normal quick pace, it takes (here) 5 seconds for scribus to "type them on screen" and provide an updated display. (My computer is about a 1250 MHz intel core 2 duo with 4Go RAM, so not a rocket but not a snail).

When inserting only one character the delay can be felt aswell, not as badly but still it is a little hindrance.
Additional InformationThis happens whether the frame includes footnotes or not.

I guess this delay is induced becaus scribus checks all the text for footnotes so
as to update their display. So as to update footnote display in case it has to go to another linked text frame for example.

I have 2 ideas on how to avoid this :

- dont update footnotes display as soon a character is inserted a deleted : wait one full second of idle keyboard before doing the computation on the footnotes display update. Doing so : typing at quick pace would not be bothered with the computation delay. Only when the user takes a rest and takes the time to look at the result, scribus would update the screen.

- another possible help would be to record in the frames properties whether it has notes or not. And when it has no notes at all, never do these computations.
This would totally solve the "slow update feeling" for all frames with no notes, but would not help at all for the frames with a a note.

TagsNo tags attached.
Patch

Activities

cezaryece

2012-11-05 06:31

updater   ~0029146

There is any footnotes/marks checks if any exists in document yet.

JLuc

2013-06-23 11:20

developer  

sluggish.sla (51,871 bytes)

JLuc

2013-06-23 14:09

developer   ~0030330

ok so i'm not 100% sure it is related to footnotes merge. it would need testing a compiled version before the merge.

I uploaded a 2 pages test document : add aaaaaaaaas at the end of the text.
O, my 2GHz core 2 duo computer, it takes 0,5 seconds to update the display after each keystroke. That is i have to wait 5 seconds after typing a 10 letter words (or 3 seconds if it takes me 2 seconds to type the 10 letters). And CPU usage goes to 98% as soon as i type 4 letters in a row.

JLuc

2013-09-04 13:40

developer   ~0030552

Last edited: 2013-09-05 06:54

I now have a stronger computer
with a Intel® Core™ i7-3632QM CPU @ 2.20GHz × 8
and 4Go of RAM available (since it's a 32 bit OS).

It's better... but it still feels sluggish !


[edit] : I later updated computer with the 64 bit version of the OS that can now use the full 16Go of available RAM. That makes not a high end computer, but definitively not a low end.
Editing the uploaded SLA now is clearly not so slugish as described initialy anymore, even if the screen is a bit late compared to the keyboard. BTW htop shows that scribus keeps using up to 98 or even 100% of CPU when typing a dozen of characters in a row.

JLuc

2013-09-04 20:54

developer   ~0030557

Last edited: 2013-09-05 16:15

scribusEce independant git version seems to have found some issues and fixes :
http://www.scribus-ece.info/News/Properties%20Palette%20updates%20fixed/

I tested that version and it seems to bring slight improvements. Note that the #pragma for parrallel processing were not understood. So however its not as powerfull as changing computer, it might be one element of a global solution.

I upload what seems to be the relevant commit.
This patch calls the blockSignalsWithChildrens that Cezariece recently proposed in 0011712
It's for GIT scribusECE 1.5 independant version - but if these bugfixes are ok and provide to some speed improvements, it would be nice to port them to the 1.5 svn.

JLuc

2013-09-04 20:54

developer  

scribusECE git independant version patch = 0001-Faster-update-of-Properties-Palette-after-changin-selection-(fastering-text-input-and-changing-selection).patch (25,539 bytes)   
From cc75b0c7835bacbed44bc86dfb0242502b3db1ba Mon Sep 17 00:00:00 2001
From: cezaryece <czarek@oferuje.pl>
Date: Thu, 29 Aug 2013 11:44:01 +0200
Subject: [PATCH] Faster update of Properties Palette after changin selection
 (fastering text input and changing selection)

---
 Scribus/scribus/ui/propertiespalette.cpp       |   47 +++++++++++++------
 Scribus/scribus/ui/propertiespalette_group.cpp |   29 ++++++------
 Scribus/scribus/ui/propertiespalette_image.cpp |   46 ++++++++-----------
 Scribus/scribus/ui/propertiespalette_line.cpp  |   40 ++++++----------
 Scribus/scribus/ui/propertiespalette_shape.cpp |   29 ++++++------
 Scribus/scribus/ui/propertiespalette_table.cpp |    2 +
 Scribus/scribus/ui/propertiespalette_text.cpp  |   26 +++++------
 Scribus/scribus/ui/propertiespalette_xyz.cpp   |   58 ++++++++++--------------
 Scribus/scribus/util.cpp                       |    8 +++-
 Scribus/scribus/util.h                         |    3 ++
 10 files changed, 148 insertions(+), 140 deletions(-)

diff --git a/Scribus/scribus/ui/propertiespalette.cpp b/Scribus/scribus/ui/propertiespalette.cpp
index b580aba..e33baba 100644
--- a/Scribus/scribus/ui/propertiespalette.cpp
+++ b/Scribus/scribus/ui/propertiespalette.cpp
@@ -407,14 +407,38 @@ void PropertiesPalette::setCurrentItem(PageItem *i)
 		SelTab(TabStack->currentIndex());
 	}
 
-	xyzPal->handleSelectionChanged();
-	shapePal->handleSelectionChanged();
-	groupPal->handleSelectionChanged();
-	imagePal->handleSelectionChanged();
-	linePal->handleSelectionChanged();
-	textPal->handleSelectionChanged();
-	tablePal->handleSelectionChanged();
-
+#pragma omp parallel sections
+	{
+#pragma omp section
+		{
+			xyzPal->handleSelectionChanged();
+		}
+ #pragma omp section
+		{
+			shapePal->handleSelectionChanged();
+		}
+#pragma omp section
+		{
+			groupPal->handleSelectionChanged();
+		}
+#pragma omp section
+		{
+			imagePal->handleSelectionChanged();
+		}
+#pragma omp section
+		{
+			linePal->handleSelectionChanged();
+		}
+#pragma omp section
+		{
+			textPal->handleSelectionChanged();
+		}
+#pragma omp section
+		{
+			tablePal->handleSelectionChanged();
+		}
+	}
+	
 	if (m_item->asOSGFrame())
 	{
 		TabStack->setItemEnabled(idXYZItem, true);
@@ -594,14 +618,11 @@ void  PropertiesPalette::handleSelectionChanged()
 	int currentTab = TabStack->currentIndex();
 	if (TabStack->isItemEnabled(currentTab) && (TabStack->currentIndex() != currentTab))
 		TabStack->setCurrentIndex(currentTab);
+	if (currItem)
+		setCurrentItem(currItem);
 	updateGeometry();
 	repaint();
 	connect(TabStack, SIGNAL(currentChanged(int)), this, SLOT(SelTab(int)));
-
-	if (currItem)
-	{
-		setCurrentItem(currItem);
-	}
 }
 
 void PropertiesPalette::unitChange()
diff --git a/Scribus/scribus/ui/propertiespalette_group.cpp b/Scribus/scribus/ui/propertiespalette_group.cpp
index f76d513..5d93854 100644
--- a/Scribus/scribus/ui/propertiespalette_group.cpp
+++ b/Scribus/scribus/ui/propertiespalette_group.cpp
@@ -137,11 +137,11 @@ void PropertiesPalette_Group::setDoc(ScribusDoc *d)
 	if((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning()))
 		return;
 
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 	
 	disconnect(this->transPalWidget, SIGNAL(NewTrans(double)), 0, 0);
 	disconnect(this->transPalWidget, SIGNAL(NewBlend(int)), 0, 0);
@@ -166,17 +166,17 @@ void PropertiesPalette_Group::setDoc(ScribusDoc *d)
 	connect(this->transPalWidget, SIGNAL(NewPattern(QString)), this, SLOT(handleGroupPatternMask(QString)));
 	connect(this->transPalWidget, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), this, SLOT(handleGroupPatternMaskProps(double, double, double, double, double, double, double, bool, bool)));
 
-	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
 }
 
 void PropertiesPalette_Group::unsetDoc()
 {
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 
 	m_haveDoc  = false;
 	m_haveItem = false;
@@ -252,7 +252,7 @@ void PropertiesPalette_Group::handleSelectionChanged()
 		setCurrentItem(currItem);
 	}
 	updateGeometry();
-	repaint();
+	//repaint();
 }
 
 void PropertiesPalette_Group::handleUpdateRequest(int updateFlags)
@@ -278,6 +278,8 @@ void PropertiesPalette_Group::setCurrentItem(PageItem *item)
 	m_haveItem = false;
 	m_item = item;
 
+	blockSignalsWithChildrens(this,true);
+	
 	bool   mirrorX, mirrorY;
 	double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
 	m_item->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
@@ -339,6 +341,7 @@ void PropertiesPalette_Group::setCurrentItem(PageItem *item)
 		textFlowUsesImageClipping->setEnabled(false);
 	}
 	displayTextFlowMode(m_item->textFlowMode());
+	blockSignalsWithChildrens(this,false);
 }
 
 void PropertiesPalette_Group::displayTextFlowMode(PageItem::TextFlowMode mode)
diff --git a/Scribus/scribus/ui/propertiespalette_image.cpp b/Scribus/scribus/ui/propertiespalette_image.cpp
index 92bac01..d3a041c 100644
--- a/Scribus/scribus/ui/propertiespalette_image.cpp
+++ b/Scribus/scribus/ui/propertiespalette_image.cpp
@@ -135,11 +135,11 @@ void PropertiesPalette_Image::setDoc(ScribusDoc *d)
 	if((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning()))
 		return;
 
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 
 	m_doc  = d;
 	m_item = NULL;
@@ -161,17 +161,17 @@ void PropertiesPalette_Image::setDoc(ScribusDoc *d)
 	imgDpiX->setValues( 1, 30000, 2, 1);
 	imgDpiY->setValues( 1, 30000, 2, 1);
 
-	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
 }
 
 void PropertiesPalette_Image::unsetDoc()
 {
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 
 	m_haveDoc  = false;
 	m_haveItem = false;
@@ -416,7 +416,7 @@ void PropertiesPalette_Image::handleSelectionChanged()
 		setCurrentItem(currItem);
 	}
 	updateGeometry();
-	repaint();
+	//repaint();
 }
 
 void PropertiesPalette_Image::handleUpdateRequest(int updateFlags)
@@ -441,10 +441,10 @@ void PropertiesPalette_Image::setCurrentItem(PageItem *item)
 
 	m_haveItem = false;
 	m_item = item;
-
+	blockSignalsWithChildrens(this,true);
 	if (m_item->asImageFrame())
 	{
-		imagePageNumber->blockSignals(true);
+
 		if(m_item->PictureIsAvailable)
 		{
 			imagePageNumber->setMaximum(m_item->pixm.imgInfo.numberOfPages);
@@ -456,14 +456,8 @@ void PropertiesPalette_Image::setCurrentItem(PageItem *item)
 
 		compressionMethod->setCurrentIndex(m_item->OverrideCompressionMethod ? m_item->CompressionMethodIndex + 1 : 0);
 		compressionQuality->setCurrentIndex(m_item->OverrideCompressionQuality ? m_item->CompressionQualityIndex + 1 : 0);
-		imagePageNumber->blockSignals(false);
-
-		imageXScaleSpinBox->blockSignals(true);
-		imageYScaleSpinBox->blockSignals(true);
-		imageXOffsetSpinBox->blockSignals(true);
-		imageYOffsetSpinBox->blockSignals(true);
-		imageRotation->blockSignals(true);
 
+		
 		imgEffectsButton->setVisible(m_item->PictureIsAvailable && m_item->isRaster);
 		imgExtProperties->setVisible(m_item->PictureIsAvailable && m_item->pixm.imgInfo.valid);
 		bool setter = m_item->ScaleType;
@@ -505,11 +499,8 @@ void PropertiesPalette_Image::setCurrentItem(PageItem *item)
 		//imageYOffsetSpinBox->setEnabled(setter);
 		//imageRotation->setEnabled(setter);
 
-		imageXScaleSpinBox->blockSignals(false);
-		imageYScaleSpinBox->blockSignals(false);
-		imageXOffsetSpinBox->blockSignals(false);
-		imageYOffsetSpinBox->blockSignals(false);
-		imageRotation->blockSignals(false);
+		foreach (QWidget* obj, findChildren<QWidget *>())
+			obj->blockSignals(false);
 	}
 	m_haveItem = true;
 
@@ -531,6 +522,7 @@ void PropertiesPalette_Image::setCurrentItem(PageItem *item)
 	{
 		setEnabled(false);
 	}
+	blockSignalsWithChildrens(this,false);
 }
 
 void PropertiesPalette_Image::handleLocalXY()
diff --git a/Scribus/scribus/ui/propertiespalette_line.cpp b/Scribus/scribus/ui/propertiespalette_line.cpp
index 33d7a8c..4c7a2c7 100644
--- a/Scribus/scribus/ui/propertiespalette_line.cpp
+++ b/Scribus/scribus/ui/propertiespalette_line.cpp
@@ -124,11 +124,11 @@ void PropertiesPalette_Line::setDoc(ScribusDoc *d)
 	if((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning()))
 		return;
 
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 
 	m_doc  = d;
 	m_item = NULL;
@@ -145,17 +145,17 @@ void PropertiesPalette_Line::setDoc(ScribusDoc *d)
 	startArrow->rebuildList(&m_doc->arrowStyles());
 	endArrow->rebuildList(&m_doc->arrowStyles());
 
-	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
 }
 
 void PropertiesPalette_Line::unsetDoc()
 {
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 
 	m_haveDoc  = false;
 	m_haveItem = false;
@@ -224,7 +224,7 @@ void PropertiesPalette_Line::handleSelectionChanged()
 		setCurrentItem(currItem);
 	}
 	updateGeometry();
-	repaint();
+	//repaint();
 }
 
 void PropertiesPalette_Line::handleUpdateRequest(int updateFlags)
@@ -252,12 +252,7 @@ void PropertiesPalette_Line::setCurrentItem(PageItem *item)
 	m_haveItem = false;
 	m_item = item;
 
-	lineStyles->blockSignals(true);
-	startArrow->blockSignals(true);
-	endArrow->blockSignals(true);
-	startArrowScale->blockSignals(true);
-	endArrowScale->blockSignals(true);
-	lineMode->blockSignals(true);
+	blockSignalsWithChildrens(this,true);
 
 	if ((m_item->asLine()) || (m_item->asPolyLine()) || (m_item->asSpiral()))
 	{
@@ -317,12 +312,7 @@ void PropertiesPalette_Line::setCurrentItem(PageItem *item)
 	else
 		lineMode->setCurrentIndex(0);
 
-	lineStyles->blockSignals(false);
-	startArrow->blockSignals(false);
-	endArrow->blockSignals(false);
-	startArrowScale->blockSignals(false);
-	endArrowScale->blockSignals(false);
-	lineMode->blockSignals(false);
+	blockSignalsWithChildrens(this,false);
 
 	setter = false;
 
diff --git a/Scribus/scribus/ui/propertiespalette_shape.cpp b/Scribus/scribus/ui/propertiespalette_shape.cpp
index 5d25d01..0b23042 100644
--- a/Scribus/scribus/ui/propertiespalette_shape.cpp
+++ b/Scribus/scribus/ui/propertiespalette_shape.cpp
@@ -93,11 +93,11 @@ void PropertiesPalette_Shape::setDoc(ScribusDoc *d)
 	if((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning()))
 		return;
 
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 
 	m_doc  = d;
 	m_item = NULL;
@@ -109,17 +109,17 @@ void PropertiesPalette_Shape::setDoc(ScribusDoc *d)
 
 	roundRect->setValues( -300, 300, 2, 0);
 
-	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
 }
 
 void PropertiesPalette_Shape::unsetDoc()
 {
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 
 	m_haveDoc  = false;
 	m_haveItem = false;
@@ -313,7 +313,7 @@ void PropertiesPalette_Shape::handleSelectionChanged()
 	}
 	setCurrentItem(currItem);
 	updateGeometry();
-	repaint();
+	//repaint();
 }
 
 void PropertiesPalette_Shape::handleUpdateRequest(int updateFlags)
@@ -337,6 +337,7 @@ void PropertiesPalette_Shape::setCurrentItem(PageItem *item)
 
 	if (item && !m_doc)
 		setDoc(item->doc());
+	blockSignalsWithChildrens(this,true);
 
 	m_haveItem = false;
 	m_item = item;
@@ -370,6 +371,8 @@ void PropertiesPalette_Shape::setCurrentItem(PageItem *item)
 	setSizeLocked(m_item->sizeLocked());
 //	nonZero->setChecked(!m_item->fillRule);
 //	evenOdd->setChecked(m_item->fillRule);
+	blockSignalsWithChildrens(this,false);
+	
 
 	// Frame type 3 is obsolete: CR 2005-02-06
 	//if (((i->itemType() == PageItem::TextFrame) || (i->itemType() == PageItem::ImageFrame) || (i->itemType() == 3)) &&  (!i->ClipEdited))
diff --git a/Scribus/scribus/ui/propertiespalette_table.cpp b/Scribus/scribus/ui/propertiespalette_table.cpp
index b5aae89..fad94d3 100644
--- a/Scribus/scribus/ui/propertiespalette_table.cpp
+++ b/Scribus/scribus/ui/propertiespalette_table.cpp
@@ -113,8 +113,10 @@ void PropertiesPalette_Table::handleSelectionChanged()
 
 	sideSelector->setSelection(TableSideSelector::All);
 
+	blockSignalsWithChildrens(this,true);
 	updateFillControls();
 	updateStyleControls();
+	blockSignalsWithChildrens(this,false);
 }
 
 void PropertiesPalette_Table::handleCellSelectionChanged()
diff --git a/Scribus/scribus/ui/propertiespalette_text.cpp b/Scribus/scribus/ui/propertiespalette_text.cpp
index eb3e5e2..927db24 100644
--- a/Scribus/scribus/ui/propertiespalette_text.cpp
+++ b/Scribus/scribus/ui/propertiespalette_text.cpp
@@ -179,11 +179,11 @@ void PropertiesPalette_Text::setDoc(ScribusDoc *d)
 	if((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning()))
 		return;
 
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 
 	m_doc  = d;
 	m_item = NULL;
@@ -211,19 +211,19 @@ void PropertiesPalette_Text::setDoc(ScribusDoc *d)
 	paraStyleCombo->setDoc(m_doc);
 	charStyleCombo->setDoc(m_doc);
 
-	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
 	connectSignals(true);
 }
 
 void PropertiesPalette_Text::unsetDoc()
 {
 	disconnectSignals(true);
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 
 	m_haveDoc  = false;
 	m_haveItem = false;
@@ -317,7 +317,7 @@ void PropertiesPalette_Text::handleSelectionChanged()
 	}
 	connectSignals(true);
 	updateGeometry();
-	repaint();
+	//repaint();
 }
 
 void PropertiesPalette_Text::handleUpdateRequest(int updateFlags)
diff --git a/Scribus/scribus/ui/propertiespalette_xyz.cpp b/Scribus/scribus/ui/propertiespalette_xyz.cpp
index bf007e9..bc25920 100644
--- a/Scribus/scribus/ui/propertiespalette_xyz.cpp
+++ b/Scribus/scribus/ui/propertiespalette_xyz.cpp
@@ -156,11 +156,11 @@ void PropertiesPalette_XYZ::setDoc(ScribusDoc *d)
 	if((d == (ScribusDoc*) m_doc) || (m_ScMW && m_ScMW->scriptIsRunning()))
 		return;
 
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 
 	m_doc  = d;
 	m_item = NULL;
@@ -188,17 +188,17 @@ void PropertiesPalette_XYZ::setDoc(ScribusDoc *d)
 
 	updateSpinBoxConstants();
 
-	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	connect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//	connect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
 }
 
 void PropertiesPalette_XYZ::unsetDoc()
 {
-	if (m_doc)
-	{
-		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
-		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
-	}
+//	if (m_doc)
+//	{
+//		disconnect(m_doc->m_Selection, SIGNAL(selectionChanged()), this, SLOT(handleSelectionChanged()));
+//		disconnect(m_doc             , SIGNAL(docChanged())      , this, SLOT(handleSelectionChanged()));
+//	}
 
 	m_haveDoc  = false;
 	m_haveItem = false;
@@ -298,17 +298,7 @@ void PropertiesPalette_XYZ::setCurrentItem(PageItem *i)
 
 	connect(nameEdit, SIGNAL(Leaved()), this, SLOT(handleNewName()));
 
-//CB replaces old emits from PageItem::emitAllToGUI()
-	disconnect(xposSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewX()));
-	disconnect(yposSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewY()));
-	disconnect(widthSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewW()));
-	disconnect(heightSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewH()));
-	disconnect(doLock, SIGNAL(clicked()), this, SLOT(handleLock()));
-	disconnect(noPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
-	disconnect(noResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
-	disconnect(flipH, SIGNAL(clicked()), this, SLOT(handleFlipH()));
-	disconnect(flipV, SIGNAL(clicked()), this, SLOT(handleFlipV()));
-	disconnect(rotationSpin, SIGNAL(valueChanged(double)), this, SLOT(handleRotation()));
+	blockSignalsWithChildrens(this,true);
 
 	double selX = m_item->xPos();
 	double selY = m_item->yPos();
@@ -332,17 +322,7 @@ void PropertiesPalette_XYZ::setCurrentItem(PageItem *i)
 		rr = 360 - rr;
 	rotationSpin->setValue(fabs(rr));
 
-//CB TODO reconnect PP signals from here
-	connect(xposSpin    , SIGNAL(valueChanged(double)), this, SLOT(handleNewX()));
-	connect(yposSpin    , SIGNAL(valueChanged(double)), this, SLOT(handleNewY()));
-	connect(widthSpin   , SIGNAL(valueChanged(double)), this, SLOT(handleNewW()));
-	connect(heightSpin  , SIGNAL(valueChanged(double)), this, SLOT(handleNewH()));
-	connect(doLock  , SIGNAL(clicked()), this, SLOT(handleLock()));
-	connect(noPrint , SIGNAL(clicked()), this, SLOT(handlePrint()));
-	connect(noResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
-	connect(flipH   , SIGNAL(clicked()), this, SLOT(handleFlipH()));
-	connect(flipV   , SIGNAL(clicked()), this, SLOT(handleFlipV()));
-	connect(rotationSpin, SIGNAL(valueChanged(double)), this, SLOT(handleRotation()));
+	blockSignalsWithChildrens(this,false);
 
 	bool setter = false;
 	xposSpin->setEnabled(!setter);
@@ -542,7 +522,7 @@ void PropertiesPalette_XYZ::handleSelectionChanged()
 		setCurrentItem(currItem);
 	}
 	updateGeometry();
-	repaint();
+	//repaint();
 }
 
 void PropertiesPalette_XYZ::unitChange()
@@ -638,6 +618,8 @@ void PropertiesPalette_XYZ::displayWH(double x, double y)
 	m_haveItem = false;
 	QTransform ma;
 	QPoint dp;
+	disconnect(widthSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewW()));
+	disconnect(heightSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewH()));
 	if ((m_lineMode) && (m_item->asLine()))
 	{
 		ma.translate(static_cast<double>(xposSpin->value()) / m_unitRatio, static_cast<double>(yposSpin->value()) / m_unitRatio);
@@ -652,6 +634,8 @@ void PropertiesPalette_XYZ::displayWH(double x, double y)
 		widthSpin->setValue(x*m_unitRatio);
 		heightSpin->setValue(y*m_unitRatio);
 	}
+	connect(widthSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewW()));
+	connect(heightSpin, SIGNAL(valueChanged(double)), this, SLOT(handleNewH()));
 	m_haveItem = tmp;
 }
 
@@ -664,7 +648,11 @@ void PropertiesPalette_XYZ::displayRotation(double r)
 	if (r > 0)
 		rr = 360 - rr;
 	m_haveItem = false;
+
+	disconnect(rotationSpin, SIGNAL(valueChanged(double)), this, SLOT(handleRotation()));
 	rotationSpin->setValue(fabs(rr));
+	connect(rotationSpin, SIGNAL(valueChanged(double)), this, SLOT(handleRotation()));
+
 	m_haveItem = tmp;
 }
 
diff --git a/Scribus/scribus/util.cpp b/Scribus/scribus/util.cpp
index 6ee7da0..e161331 100644
--- a/Scribus/scribus/util.cpp
+++ b/Scribus/scribus/util.cpp
@@ -30,6 +30,7 @@ for which a new license (GPL+exception) is in place.
 #include <QDomElement>
 #include <QMessageBox>
 #include <QProcess>
+#include <QWidget>
 
 #include "pageitem.h"
 #include "pageitem_table.h"
@@ -1191,4 +1192,9 @@ void getUniqueName(QString &name, QStringList list, QString separator, bool prep
 	} while (list.contains(newName));
 	name = newName;
 }
-
+void blockSignalsWithChildrens(QWidget * w, bool block)
+{
+	w->blockSignals(block);
+	foreach (QWidget* obj, w->findChildren<QWidget *>())
+		blockSignalsWithChildrens(obj, block);
+}
diff --git a/Scribus/scribus/util.h b/Scribus/scribus/util.h
index a94d8d3..a1e4977 100644
--- a/Scribus/scribus/util.h
+++ b/Scribus/scribus/util.h
@@ -174,4 +174,7 @@ void SCRIBUS_API setWidgetBoldFont(QWidget* w, bool wantBold);
  * if exist then seprator and numbers are pre/append to name while it will be unique
 */
 void SCRIBUS_API getUniqueName(QString &name, QStringList list, QString separator = "", bool prepend = false);
+
+//set blockSingnals to widget and all childs
+void SCRIBUS_API blockSignalsWithChildrens(QWidget * w, bool block);
 #endif
-- 
1.7.9.5

cbradney

2013-09-05 19:26

administrator   ~0030562

Cezary, Jean makes some comments in 0011712 that may mean some charges are required, can you please provide us a patch that includes the block signals for children code plus this one?

jghali

2013-09-16 21:07

administrator   ~0030598

I've applied part of the patch with some modifications. The use of OpenMP in this patch is not correct as gui elements must only be used from main thread.

JLuc

2014-09-05 19:21

developer   ~0033531

Updated drivers could have improved the issue as they did for me today for the same issue (using https://01.org/linuxgraphics/downloads)

Issue History

Date Modified Username Field Change
2012-11-02 10:07 JLuc New Issue
2012-11-05 06:31 cezaryece Note Added: 0029146
2012-11-06 19:32 cbradney Assigned To => cezaryece
2012-11-06 19:32 cbradney Status new => assigned
2013-06-23 11:20 JLuc File Added: sluggish.sla
2013-06-23 14:09 JLuc Note Added: 0030330
2013-09-04 13:40 JLuc Note Added: 0030552
2013-09-04 14:01 JLuc Note Edited: 0030552
2013-09-04 20:54 JLuc Note Added: 0030557
2013-09-04 20:54 JLuc File Added: scribusECE git independant version patch = 0001-Faster-update-of-Properties-Palette-after-changin-selection-(fastering-text-input-and-changing-selection).patch
2013-09-04 21:00 JLuc Note Edited: 0030557
2013-09-04 22:57 JLuc Note Edited: 0030552
2013-09-04 22:57 JLuc Note Edited: 0030552
2013-09-04 23:31 JLuc Note Edited: 0030557
2013-09-05 06:47 JLuc Note Edited: 0030552
2013-09-05 06:53 JLuc Note Edited: 0030552
2013-09-05 06:54 JLuc Note Edited: 0030552
2013-09-05 06:55 JLuc Note Edited: 0030557
2013-09-05 06:56 JLuc Note Edited: 0030557
2013-09-05 07:01 JLuc Note Edited: 0030557
2013-09-05 07:01 JLuc Note Edited: 0030557
2013-09-05 16:15 JLuc Note Edited: 0030557
2013-09-05 19:26 cbradney Note Added: 0030562
2013-09-16 21:07 jghali Note Added: 0030598
2014-09-05 19:21 JLuc Note Added: 0033531
2014-09-05 19:21 JLuc Status assigned => closed
2014-09-05 19:21 JLuc Resolution open => no change required
2015-09-17 20:08 Kunda Category Story Editor / Text Frames => Story Ed/Txt Frames
2015-09-17 20:12 Kunda Category Story Ed/Txt Frames => Story Editor / Text Frames