View Issue Details

IDProjectCategoryView StatusLast Update
0009419ScribusUsabilitypublic2012-07-01 20:35
Reportercezaryece Assigned Tocezaryece  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
PlatformLinux 
Product Version1.5.0svn 
Target Version1.5.0Fixed in Version1.5.0svn 
Summary0009419: Patch for YesToAll button in Contenst/Clear warning
DescriptionI prepare patch which add "Yes To All" button for warning box when you clear contents for more than one text frame, so warning appear only once and all selected frames will cleared.
Additional InformationIt is my first patch, so be patient for my uknowledge if something is wrong.
Patch is against 15608 rev.
TagsNo tags attached.
Patch

Relationships

has duplicate 0009803 closedjghali Make Edit/Contents/Clear warning appearing once 

Activities

cezaryece

2010-10-21 11:16

updater  

scribusdoc.diff (2,791 bytes)   
*** trunk/Scribus/scribus/scribusdoc.cpp	Thu Oct 21 12:47:10 2010
--- scribusdoc.cpp	Thu Oct 21 12:44:41 2010
***************
*** 8362,8367 ****
--- 8362,8369 ----
      if (selectedItemCount != 0)
      {
          PageItem *currItem;
+         bool ApplyToAll = false;
+         int t;
          for (uint i = 0; i < selectedItemCount; ++i)
          {
              currItem = itemSelection->itemAt(i);
***************
*** 8371,8385 ****
                                          ScCore->fileWatcher->removeFile(currItem->Pfile);
                          }
                          else
!                         if (currItem->asTextFrame() && ScCore->usingGUI())
                          {
                                  if (currItem->itemText.length() != 0 && (currItem->nextInChain() == 0 || currItem->prevInChain() == 0))
                                  {
!                                         int t = ScMessageBox::warning(m_ScMW, CommonStrings::trWarning,
                                                                                  tr("Do you really want to clear all your text?"),
                                                                                  QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
                                          if (t == QMessageBox::No)
                                                  continue;
                                  }
                          }
                          currItem->clearContents();
--- 8373,8395 ----
                      ScCore->fileWatcher->removeFile(currItem->Pfile);
              }
              else
!             if (currItem->asTextFrame() && ScCore->usingGUI() && !ApplyToAll)
              {
                  if (currItem->itemText.length() != 0 && (currItem->nextInChain() == 0 || currItem->prevInChain() == 0))
                  {
!                     if (i >= (selectedItemCount - 1))
!                         t = ScMessageBox::warning(m_ScMW, CommonStrings::trWarning,
                                          tr("Do you really want to clear all your text?"),
                                          QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
+                     else
+                         t = ScMessageBox::warning(m_ScMW, CommonStrings::trWarning,
+                                         tr("Do you really want to clear all your text?"),
+                                         QMessageBox::Yes, QMessageBox::No | QMessageBox::Default, QMessageBox::YesToAll);
+ 
                      if (t == QMessageBox::No)
                          continue;
+                     else if (t == QMessageBox::YesToAll)
+                         ApplyToAll = true;
                  }
              }
              currItem->clearContents();
scribusdoc.diff (2,791 bytes)   

plinnell

2010-10-22 21:08

viewer   ~0024692

Thanks for the patch. I will test and report.

cezaryece

2010-10-23 14:06

updater  

scribusdoc.cpp.diff (1,459 bytes)   
Index: Scribus/scribus/scribusdoc.cpp
===================================================================
--- Scribus/scribus/scribusdoc.cpp	(wersja 15626)
+++ Scribus/scribus/scribusdoc.cpp	(kopia robocza)
@@ -8362,6 +8362,8 @@
 	if (selectedItemCount != 0)
 	{
 		PageItem *currItem;
+		bool userDecide = false;
+		bool userWantClear = true;
 		for (uint i = 0; i < selectedItemCount; ++i)
 		{
 			currItem = itemSelection->itemAt(i);
@@ -8369,21 +8371,29 @@
 			{
 				if ((ScCore->fileWatcher->files().contains(currItem->Pfile) != 0) && (currItem->PictureIsAvailable))
 					ScCore->fileWatcher->removeFile(currItem->Pfile);
+			    currItem->clearContents();
 			}
 			else
-			if (currItem->asTextFrame() && ScCore->usingGUI())
+			if (currItem->asTextFrame())
 			{
+			    if (ScCore->usingGUI() && (! userDecide))
+			    {
 				if (currItem->itemText.length() != 0 && (currItem->nextInChain() == 0 || currItem->prevInChain() == 0))
 				{
 					int t = ScMessageBox::warning(m_ScMW, CommonStrings::trWarning,
 										tr("Do you really want to clear all your text?"),
 										QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
 					if (t == QMessageBox::No)
-						continue;
+					userWantClear = false;
+				    else
+					userWantClear = true;
+				    userDecide = true;   
 				}
 			}
+			    if (userWantClear)
 			currItem->clearContents();
 		}
+		}
 		updateFrameItems();
 		regionsChanged()->update(QRectF());
 		changed();
scribusdoc.cpp.diff (1,459 bytes)   

cezaryece

2010-10-23 14:13

updater   ~0024694

I have made new patch because first one was unusable as I heard.
After discusion with a_l_e I have change this patch and now it simply make warning window appear only once when first text frame is reached. "Yes" aply clearing for all selected text frames, "No" skip all selected text frames, but all selected other frames are cleared.
I hope this is more sensible, because Scribus not show for which text frame warning appear, so there is no reason to ask for each one.
Also I hope diff file will be applicable.

cezaryece

2010-10-23 14:16

updater   ~0024695

You can change summary of this ticket, now it is not "Yes To All" button. Now it should be "making Contents/Clear warning appearing once" instead.

cbradney

2010-11-04 17:03

administrator   ~0024806

I don't understand why the Yes to All option was taken away. If you have multiple selected, you might not want to clear them all...

cezaryece

2010-11-05 07:16

updater   ~0024812

If you don't want to clear all selected frames, what for you select unwanted frames?
And what for is warning for each frame if you don't see for which one?

jghali

2012-06-30 14:21

administrator   ~0028333

I applied the 'Yes to all' variant. If user use the 'Yes' button in case of multiple selection, he has at least the choice to stop directly in case of error.

Issue History

Date Modified Username Field Change
2010-10-21 11:16 cezaryece New Issue
2010-10-21 11:16 cezaryece File Added: scribusdoc.diff
2010-10-22 21:07 plinnell Assigned To => plinnell
2010-10-22 21:07 plinnell Status new => assigned
2010-10-22 21:08 plinnell Note Added: 0024692
2010-10-22 21:08 plinnell Target Version => 1.5.0svn
2010-10-23 14:06 cezaryece File Added: scribusdoc.cpp.diff
2010-10-23 14:13 cezaryece Note Added: 0024694
2010-10-23 14:16 cezaryece Note Added: 0024695
2010-11-04 17:03 cbradney Note Added: 0024806
2010-11-05 07:16 cezaryece Note Added: 0024812
2012-06-18 19:25 cbradney Assigned To plinnell => cezaryece
2012-06-30 14:21 jghali Note Added: 0028333
2012-06-30 14:21 jghali Status assigned => resolved
2012-06-30 14:21 jghali Fixed in Version => 1.5.0svn
2012-06-30 14:21 jghali Resolution open => fixed
2012-06-30 14:21 jghali Target Version 1.5.0svn => 1.5.0
2012-07-01 20:35 cbradney Status resolved => closed
2012-07-02 21:24 jghali Relationship added has duplicate 0009803