summaryrefslogtreecommitdiff
path: root/CopyEngineManager.cpp
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2013-03-21 11:01:59 +0100
committerThomas Preud'homme <robotux@celest.fr>2013-03-21 11:01:59 +0100
commite297dbd8052ef4e66f069e2dd1865ae7fa8af28e (patch)
tree342fea0a2f6f33b8b62dad2d1729f8209da1a1ba /CopyEngineManager.cpp
parent8f9f382e1c97cab2e72e97495650c73ac4b97314 (diff)
Imported Upstream version 0.3.1.0
Diffstat (limited to 'CopyEngineManager.cpp')
-rw-r--r--CopyEngineManager.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/CopyEngineManager.cpp b/CopyEngineManager.cpp
index 758d9b2..4808fc7 100644
--- a/CopyEngineManager.cpp
+++ b/CopyEngineManager.cpp
@@ -13,19 +13,20 @@
CopyEngineManager::CopyEngineManager(OptionDialog *optionDialog)
{
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"start");
+ connect(languages, SIGNAL(newLanguageLoaded(QString)), &facilityEngine,SLOT(retranslate()),Qt::DirectConnection);
this->optionDialog=optionDialog;
//setup the ui layout
plugins->lockPluginListEdition();
+ connect(this,SIGNAL(previouslyPluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection);
+ connect(plugins,SIGNAL(onePluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)),Qt::QueuedConnection);
+ connect(plugins,SIGNAL(onePluginWillBeRemoved(PluginsAvailable)), this,SLOT(onePluginWillBeRemoved(PluginsAvailable)),Qt::DirectConnection);
+ connect(plugins,SIGNAL(pluginListingIsfinish()), this,SLOT(allPluginIsloaded()),Qt::QueuedConnection);
QList<PluginsAvailable> list=plugins->getPluginsByCategory(PluginType_CopyEngine);
foreach(PluginsAvailable currentPlugin,list)
- onePluginAdded(currentPlugin);
- connect(plugins,SIGNAL(onePluginAdded(PluginsAvailable)), this,SLOT(onePluginAdded(PluginsAvailable)));
- connect(plugins,SIGNAL(onePluginWillBeRemoved(PluginsAvailable)), this,SLOT(onePluginWillBeRemoved(PluginsAvailable)),Qt::DirectConnection);
- connect(plugins,SIGNAL(pluginListingIsfinish()), this,SLOT(allPluginIsloaded()));
+ emit previouslyPluginAdded(currentPlugin);
plugins->unlockPluginListEdition();
//load the options
isConnected=false;
- connect(languages, SIGNAL(newLanguageLoaded(QString)), &facilityEngine,SLOT(retranslate()));
}
void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
@@ -90,7 +91,7 @@ void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
newItem.canDoOnlyCopy=newItem.factory->canDoOnlyCopy();
newItem.type=newItem.factory->getCopyType();
newItem.transferListOperation=newItem.factory->getTransferListOperation();
- optionDialog->addCopyEngineWidget(newItem.name,newItem.optionsWidget);
+ optionDialog->addPluginOptionWidget(PluginType_CopyEngine,newItem.name,newItem.optionsWidget);
ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"plugin: "+newItem.name+" loaded, send options");
//emit newCopyEngineOptions(plugin.path,newItem.name,newItem.optionsWidget);
pluginList << newItem;
@@ -130,7 +131,6 @@ void CopyEngineManager::onePluginWillBeUnloaded(const PluginsAvailable &plugin)
{
if(pluginList.at(index).path==plugin.path)
{
- optionDialog->removeCopyEngineWidget(pluginList.at(index).name);
delete pluginList.at(index).options;
delete pluginList.at(index).factory;
pluginList.at(index).pointer->unload();
@@ -210,6 +210,7 @@ CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const CopyM
int index=0;
while(index<pluginList.size())
{
+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("Check matching: %1").arg(pluginList.at(index).name));
if(pluginList.at(index).name==name)
{
if(mode==Move && pluginList.at(index).canDoOnlyCopy)
@@ -228,8 +229,8 @@ CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const CopyM
}
index++;
}
- ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Cannot find any engine with this name");
- QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any engine with this name"));
+ ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,QString("Cannot find any engine with this name: %1").arg(name));
+ QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any engine with this name: %1").arg(name));
temp.engine=NULL;
temp.type=File;
temp.canDoOnlyCopy=true;