r18227 by fschmid - Initialize all the import plugins the same way.

scribus-commit scribus-commit at lists.scribus.net
Wed Mar 27 20:52:53 UTC 2013


Author: fschmid
Date: Wed Mar 27 20:52:53 2013
New Revision: 18227

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18227
Log:
Initialize all the import plugins the same way.

Modified:
    trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
    trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp
    trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp
    trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp
    trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp
    trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
    trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp
    trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
    trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp

Modified: trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18227&path=/trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp Wed Mar 27 20:52:53 2013
@@ -49,28 +49,22 @@
 {
 	// Set action info in languageChange, so we only have to do it in one
 	// place. This includes registering file format support.
+	registerFormats();
 	languageChange();
 }
-/*
-void ImportAIPlugin::addToMainWindowMenu(ScribusMainWindow *mw)
-{
-	importAction->setEnabled(true);
-	connect( importAction, SIGNAL(triggered()), SLOT(import()) );
-	mw->scrMenuMgr->addMenuItem(importAction, "FileImport");
-}
-*/
+
 void ImportAIPlugin::languageChange()
 {
 	importAction->setText( tr("Import AI..."));
-	// (Re)register file format support
+	FileFormat* fmt = getFormatByExt("ai");
+	fmt->trName = FormatsManager::instance()->nameOfFormat(FormatsManager::AI); // Human readable name
+	fmt->filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::AI); // QFileDialog filter
+}
+
+ImportAIPlugin::~ImportAIPlugin()
+{
 	unregisterAll();
-	registerFormats();
-}
-
-ImportAIPlugin::~ImportAIPlugin()
-{
-	unregisterAll();
-};
+}
 
 const QString ImportAIPlugin::fullTrName() const
 {

Modified: trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18227&path=/trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp Wed Mar 27 20:52:53 2013
@@ -66,7 +66,7 @@
 ImportCgmPlugin::~ImportCgmPlugin()
 {
 	unregisterAll();
-};
+}
 
 const QString ImportCgmPlugin::fullTrName() const
 {

Modified: trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18227&path=/trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp Wed Mar 27 20:52:53 2013
@@ -44,28 +44,22 @@
 {
 	// Set action info in languageChange, so we only have to do it in one
 	// place. This includes registering file format support.
+	registerFormats();
 	languageChange();
 }
-/*
-void ImportXfigPlugin::addToMainWindowMenu(ScribusMainWindow *mw)
-{
-	importAction->setEnabled(true);
-	connect( importAction, SIGNAL(triggered()), SLOT(import()) );
-	mw->scrMenuMgr->addMenuItem(importAction, "FileImport");
-}
-*/
+
 void ImportCvgPlugin::languageChange()
 {
 	importAction->setText( tr("Import Cvg..."));
-	// (Re)register file format support
-	unregisterAll();
-	registerFormats();
+	FileFormat* fmt = getFormatByExt("cvg");
+	fmt->trName = FormatsManager::instance()->nameOfFormat(FormatsManager::CVG); // Human readable name
+	fmt->filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::CVG); // QFileDialog filter
 }
 
 ImportCvgPlugin::~ImportCvgPlugin()
 {
 	unregisterAll();
-};
+}
 
 const QString ImportCvgPlugin::fullTrName() const
 {

Modified: trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18227&path=/trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp Wed Mar 27 20:52:53 2013
@@ -67,7 +67,7 @@
 ImportDrwPlugin::~ImportDrwPlugin()
 {
 	unregisterAll();
-};
+}
 
 const QString ImportDrwPlugin::fullTrName() const
 {

Modified: trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18227&path=/trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp Wed Mar 27 20:52:53 2013
@@ -60,6 +60,9 @@
 	FileFormat* fmt = getFormatByExt("idml");
 	fmt->trName = tr("Adobe Indesign IDML");
 	fmt->filter = tr("Adobe Indesign IDML (*.idml *.IDML)");
+	FileFormat* fmt2 = getFormatByExt("idms");
+	fmt2->trName = tr("Adobe Indesign IDMS");
+	fmt2->filter = tr("Adobe Indesign IDMS (*.idms *.IDMS)");
 }
 
 ImportIdmlPlugin::~ImportIdmlPlugin()

Modified: trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18227&path=/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp Wed Mar 27 20:52:53 2013
@@ -76,17 +76,10 @@
 {
 	// Set action info in languageChange, so we only have to do
 	// it in one place. This includes registering file formats.
+	registerFormats();
 	languageChange();
 }
-/*
-void OODrawImportPlugin::addToMainWindowMenu(ScribusMainWindow *mw)
-{
-	// Then hook up the action
-	importAction->setEnabled(true);
-	connect( importAction, SIGNAL(triggered()), SLOT(import()) );
-	mw->scrMenuMgr->addMenuItem(importAction, "FileImport");
-}
-*/
+
 OODrawImportPlugin::~OODrawImportPlugin()
 {
 	unregisterAll();
@@ -96,9 +89,12 @@
 void OODrawImportPlugin::languageChange()
 {
 	importAction->setText( tr("Import &OpenOffice.org Draw..."));
-	// (Re)register file formats
-	unregisterAll();
-	registerFormats();
+	FileFormat* fmt = getFormatByExt("odg");
+	fmt->trName = tr("OpenDocument 1.0 Draw", "Import/export format name");
+	fmt->filter = tr("OpenDocument 1.0 Draw (*.odg *.ODG)");
+	FileFormat* fmt2 = getFormatByExt("sxd");
+	fmt2->trName = tr("OpenOffice.org 1.x Draw", "Import/export format name");
+	fmt2->filter = tr("OpenOffice.org 1.x Draw (*.sxd *.SXD)");
 }
 
 const QString OODrawImportPlugin::fullTrName() const

Modified: trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18227&path=/trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp Wed Mar 27 20:52:53 2013
@@ -44,15 +44,16 @@
 {
 	// Set action info in languageChange, so we only have to do it in one
 	// place. This includes registering file format support.
+	registerFormats();
 	languageChange();
 }
 
 void ImportPctPlugin::languageChange()
 {
 	importAction->setText( tr("Import Pict..."));
-	// (Re)register file format support
-	unregisterAll();
-	registerFormats();
+	FileFormat* fmt = getFormatByExt("pct");
+	fmt->trName = FormatsManager::instance()->nameOfFormat(FormatsManager::PCT); // Human readable name
+	fmt->filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::PCT); // QFileDialog filter
 }
 
 ImportPctPlugin::~ImportPctPlugin()

Modified: trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18227&path=/trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp Wed Mar 27 20:52:53 2013
@@ -49,22 +49,25 @@
 {
 	// Set action info in languageChange, so we only have to do it in one
 	// place. This includes registering file format support.
+	registerFormats();
 	languageChange();
 }
-/*
-void ImportXfigPlugin::addToMainWindowMenu(ScribusMainWindow *mw)
-{
-	importAction->setEnabled(true);
-	connect( importAction, SIGNAL(triggered()), SLOT(import()) );
-	mw->scrMenuMgr->addMenuItem(importAction, "FileImport");
-}
-*/
+
 void ImportPdfPlugin::languageChange()
 {
 	importAction->setText( tr("Import PDF..."));
-	// (Re)register file format support
-	unregisterAll();
-	registerFormats();
+	FileFormat* fmt = getFormatByExt("pdf");
+	fmt->trName = FormatsManager::instance()->nameOfFormat(FormatsManager::PDF); // Human readable name
+	fmt->filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::PDF); // QFileDialog filter
+	if (ScCore->haveGS())
+	{
+		FileFormat* fmt2 = getFormatByExt("eps");
+		fmt2->trName = FormatsManager::instance()->nameOfFormat(FormatsManager::EPS);
+		fmt2->filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::EPS);
+		FileFormat* fmt3 = getFormatByExt("ps");
+		fmt3->trName = FormatsManager::instance()->nameOfFormat(FormatsManager::PS);
+		fmt3->filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::PS);
+	}
 }
 
 ImportPdfPlugin::~ImportPdfPlugin()

Modified: trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18227&path=/trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp Wed Mar 27 20:52:53 2013
@@ -47,14 +47,7 @@
 	registerFormats();
 	languageChange();
 }
-/*
-void ImportXfigPlugin::addToMainWindowMenu(ScribusMainWindow *mw)
-{
-	importAction->setEnabled(true);
-	connect( importAction, SIGNAL(triggered()), SLOT(import()) );
-	mw->scrMenuMgr->addMenuItem(importAction, "FileImport");
-}
-*/
+
 void ImportSmlPlugin::languageChange()
 {
 	importAction->setText( tr("Import Sml..."));




More information about the scribus-commit mailing list