r17793 by fschmid - Enable dropping of objects to the symbol palette.

scribus-commit scribus-commit at lists.scribus.net
Tue Oct 9 19:37:07 UTC 2012


Author: fschmid
Date: Tue Oct  9 19:37:07 2012
New Revision: 17793

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17793
Log:
Enable dropping of objects to the symbol palette.

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/symbolpalette.cpp
    trunk/Scribus/scribus/ui/symbolpalette.h

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17793&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Tue Oct  9 19:37:07 2012
@@ -593,6 +593,7 @@
 	connect(symbolPalette, SIGNAL(paletteShown(bool)), scrActions["toolsSymbols"], SLOT(setChecked(bool)));
 	connect(symbolPalette, SIGNAL(startEdit(QString)), this, SLOT(editSymbolStart(QString)));
 	connect(symbolPalette, SIGNAL(endEdit()), this, SLOT(editSymbolEnd()));
+	connect(symbolPalette, SIGNAL(objectDropped()), this, SLOT(PutToPatterns()));
 	symbolPalette->installEventFilter(this);
 	symbolPalette->hide();
 

Modified: trunk/Scribus/scribus/ui/symbolpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17793&path=/trunk/Scribus/scribus/ui/symbolpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.cpp Tue Oct  9 19:37:07 2012
@@ -88,6 +88,9 @@
 		e->acceptProposedAction();
 		if (e->source() == this)
 			return;
+		QString text = e->mimeData()->text();
+		if ((text.startsWith("<SCRIBUSELEM")) || (text.startsWith("SCRIBUSELEMUTF8")))
+			emit objectDropped();
 	}
 	else
 		e->ignore();
@@ -154,6 +157,7 @@
 	editItemNames.clear();
 	languageChange();
 	connect(SymbolViewWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(handleDoubleClick(QListWidgetItem *)));
+	connect(SymbolViewWidget, SIGNAL(objectDropped()), this, SIGNAL(objectDropped()));
 }
 
 void SymbolPalette::handleDoubleClick(QListWidgetItem *item)

Modified: trunk/Scribus/scribus/ui/symbolpalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17793&path=/trunk/Scribus/scribus/ui/symbolpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/symbolpalette.h (original)
+++ trunk/Scribus/scribus/ui/symbolpalette.h Tue Oct  9 19:37:07 2012
@@ -62,6 +62,9 @@
 	void dropEvent(QDropEvent *e);
 	void startDrag(Qt::DropActions supportedActions);
 
+signals:
+	void objectDropped();
+
 private:
 	ScListWidgetDelegate* delegate;
 };
@@ -90,6 +93,7 @@
 signals:
 	void startEdit(QString);
 	void endEdit();
+	void objectDropped();
 
 protected:
 	SymbolView *SymbolViewWidget;




More information about the scribus-commit mailing list