r19473 by craig - #12428: Allow symbol deletion from the Symbols window by pressing delete/backspace. Franz.. if more needs doing to ensure all is healthy, please complete the patch
scribus-commit
scribus-commit at lists.scribus.net
Tue Sep 2 20:16:17 UTC 2014
Author: craig
Date: Tue Sep 2 20:16:17 2014
New Revision: 19473
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19473
Log:
#12428: Allow symbol deletion from the Symbols window by pressing delete/backspace. Franz.. if more needs doing to ensure all is healthy, please complete the patch
Modified:
trunk/Scribus/scribus/ui/symbolpalette.cpp
trunk/Scribus/scribus/ui/symbolpalette.h
Modified: trunk/Scribus/scribus/ui/symbolpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19473&path=/trunk/Scribus/scribus/ui/symbolpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.cpp Tue Sep 2 20:16:17 2014
@@ -97,6 +97,7 @@
else
e->ignore();
}
+
bool SymbolView::viewportEvent(QEvent *event)
{
@@ -273,3 +274,29 @@
{
setWindowTitle( tr( "Symbols" ) );
}
+
+void SymbolPalette::keyPressEvent(QKeyEvent* e)
+{
+ if (!m_doc)
+ return;
+ switch (e->key())
+ {
+ case Qt::Key_Backspace:
+ case Qt::Key_Delete:
+ {
+ QListWidgetItem* it = SymbolViewWidget->currentItem();
+ if (it != NULL)
+ {
+ if (m_doc->docPatterns.contains(it->text()))
+ {
+ m_doc->docPatterns.remove(it->text());
+ updateSymbolList();
+ e->accept();
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+}
Modified: trunk/Scribus/scribus/ui/symbolpalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19473&path=/trunk/Scribus/scribus/ui/symbolpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.h (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.h Tue Sep 2 20:16:17 2014
@@ -26,6 +26,7 @@
#include <QDragLeaveEvent>
#include <QDragMoveEvent>
#include <QDropEvent>
+#include <QKeyEvent>
#include <QImage>
#include <QListWidget>
#include <QMouseEvent>
@@ -89,6 +90,7 @@
void handleDoubleClick(QListWidgetItem *item);
void handleUpdateRequest(int);
void languageChange();
+ void keyPressEvent(QKeyEvent *e);
signals:
void startEdit(QString);
More information about the scribus-commit
mailing list