r19293 by craig - #12421: Remove clear contents warning. Set default shortcut for clear contents. Allow it to be pressed with item selected

scribus-commit scribus-commit at lists.scribus.net
Sat Jun 28 17:19:57 UTC 2014


Author: craig
Date: Sat Jun 28 17:19:56 2014
New Revision: 19293

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19293
Log:
#12421: Remove clear contents warning. Set default shortcut for clear contents. Allow it to be pressed with item selected

Modified:
    trunk/Scribus/scribus/actionmanager.cpp
    trunk/Scribus/scribus/canvasmode.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h

Modified: trunk/Scribus/scribus/actionmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19293&path=/trunk/Scribus/scribus/actionmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/actionmanager.cpp (original)
+++ trunk/Scribus/scribus/actionmanager.cpp Sat Jun 28 17:19:56 2014
@@ -1860,6 +1860,7 @@
 	defKeys.insert("editCut", QKeySequence::Cut);
 	defKeys.insert("editCopy", QKeySequence::Copy);
 	defKeys.insert("editPaste", QKeySequence::Paste);
+	defKeys.insert("editClearContents", Qt::CTRL+Qt::SHIFT+Qt::Key_Delete);
 	defKeys.insert("editCopyContents", Qt::CTRL+Qt::SHIFT+Qt::Key_C);
 	defKeys.insert("editPasteContents", Qt::CTRL+Qt::SHIFT+Qt::Key_V);
 	defKeys.insert("editPasteContentsAbs", Qt::CTRL+Qt::ALT+Qt::SHIFT+Qt::Key_V);
@@ -1873,7 +1874,7 @@
 	//Item Menu
 	defKeys.insert("itemDuplicate", Qt::CTRL+Qt::Key_D);
 	defKeys.insert("itemMulDuplicate", Qt::CTRL+Qt::SHIFT+Qt::Key_D);
-	defKeys.insert("itemDelete", Qt::CTRL+Qt::Key_K);
+	defKeys.insert("itemDelete", QKeySequence::Delete);
 	defKeys.insert("itemGroup", Qt::CTRL+Qt::Key_G);
 	defKeys.insert("itemUngroup", Qt::CTRL+Qt::SHIFT+Qt::Key_G);
 	defKeys.insert("itemLock", Qt::CTRL+Qt::Key_L);

Modified: trunk/Scribus/scribus/canvasmode.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19293&path=/trunk/Scribus/scribus/canvasmode.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode.cpp (original)
+++ trunk/Scribus/scribus/canvasmode.cpp Sat Jun 28 17:19:56 2014
@@ -1135,6 +1135,7 @@
 void CanvasMode::commonkeyPressEvent_NormalNodeEdit(QKeyEvent *e)
 {
 	int kk = e->key();
+	Qt::KeyboardModifiers buttonModifiers = e->modifiers();
 	QString uc = e->text();
 	ScribusMainWindow* mainWindow = m_view->m_ScMW;
 	QList<QMdiSubWindow *> windows;
@@ -1187,7 +1188,6 @@
 		scrActions["stickyTools"]->setChecked(false);
 		return;
 	}
-	Qt::KeyboardModifiers buttonModifiers = e->modifiers();
 	/**If we have a doc and we are not changing the page or zoom level in the status bar */
 	if ((!m_view->m_ScMW->zoomSpinBox->hasFocus()) && (!m_view->m_ScMW->pageSelector->hasFocus()))
 	{
@@ -1391,23 +1391,15 @@
 			{
 			case Qt::Key_Backspace:
 			case Qt::Key_Delete:
-				m_doc->itemSelection_DeleteItem();
+					if (buttonModifiers==Qt::NoModifier)
+						m_doc->itemSelection_DeleteItem();
+					else
+					{
+						QKeySequence currKeySeq = QKeySequence(kk | buttonModifiers);
+						if (currKeySeq.matches(scrActions["editClearContents"]->shortcut())==QKeySequence::ExactMatch)
+							scrActions["editClearContents"]->trigger();
+					}
 				break;
-				/* CB: Stop using inflexible hardcoded keys here, actions for lower/raise work without this
-					per note above with shortcuts.
-			case Qt::Key_PageUp:
-				if (!currItem->locked())
-				{
-					m_view->RaiseItem();
-				}
-				break;
-			case Qt::Key_PageDown:
-				if (!currItem->locked())
-				{
-					m_view->LowerItem();
-				}
-				break;
-				*/
 			case Qt::Key_Left:
 				if (!currItem->locked())
 				{

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19293&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Jun 28 17:19:56 2014
@@ -11643,7 +11643,7 @@
 	changed();
 }
 
-void ScribusDoc::itemSelection_ClearItem(Selection* customSelection)
+void ScribusDoc::itemSelection_ClearItem(Selection* customSelection, bool useWarning)
 {
 	Selection* itemSelection = (customSelection != 0) ? customSelection : m_Selection;
 	assert(itemSelection != 0);
@@ -11651,7 +11651,7 @@
 	uint selectedItemCount = itemSelection->count();
 	if (selectedItemCount <= 0)
 		return;
-	if (ScCore->usingGUI())
+	if (ScCore->usingGUI() && useWarning)
 	{
 		int t = QMessageBox::warning(m_ScMW, CommonStrings::trWarning, tr("Do you really want to clear the content of all selected frames?"),  QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
 		if (t == QMessageBox::No)

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19293&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Sat Jun 28 17:19:56 2014
@@ -1445,7 +1445,7 @@
 	//FIXME : change to process a selection
 	void item_setFrameShape(PageItem* item, int frameType, int count, double* points); 
 
-	void itemSelection_ClearItem(Selection* customSelection=0);
+	void itemSelection_ClearItem(Selection* customSelection=0, bool useWarning=false);
 	void itemSelection_TruncateItem(Selection* customSelection=0);
 	//! Delete the items in the current selection. When force is true, we do not warn the user and make SE happy too. Force is used from @sa Page::restorePageItemCreation
 	void itemSelection_DeleteItem(Selection* customSelection=0, bool forceDeletion=false);




More information about the scribus-commit mailing list