Item::Item(void) { style = Runtime::getInstance()->getStyle(); name = "GuiItem"; _id = incrementId(); init(); }
Item::Item(std::string iname) { style = Runtime::getInstance()->getStyle(); name = iname; _id = incrementId(); init(); }
/** Connect the copy engine instance provided previously to the management */ int Core::connectCopyEngine(const Ultracopier::CopyMode &mode,bool ignoreMode,const CopyEngineManager::returnCopyEngine &returnInformations) { if(returnInformations.canDoOnlyCopy) { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Mode force for unknow reason"); ignoreMode=false;//force mode if need, normaly not used } CopyInstance newItem; newItem.engine=returnInformations.engine; if(newItem.engine!=NULL) { PluginInterface_Themes *theme=ThemesManager::themesManager->getThemesInstance(); if(theme!=NULL) { newItem.id=incrementId(); newItem.lastProgression=0; newItem.interface=theme; newItem.ignoreMode=ignoreMode; newItem.mode=mode; newItem.type=returnInformations.type; newItem.transferListOperation=returnInformations.transferListOperation; newItem.numberOfFile=0; newItem.numberOfTransferedFile=0; newItem.currentProgression=0; newItem.totalProgression=0; newItem.action=Ultracopier::Idle; newItem.lastProgression=0;//store the real byte transfered, used in time remaining calculation newItem.isPaused=false; newItem.isRunning=false; newItem.haveError=false; newItem.lastConditionalSync.start(); newItem.nextConditionalSync=new QTimer(); newItem.nextConditionalSync->setSingleShot(true); newItem.copyEngineIsSync=true; newItem.canceled=false; if(!ignoreMode) { newItem.interface->forceCopyMode(mode); newItem.engine->forceMode(mode); } if(copyList.size()==0) forUpateInformation.start(); copyList << newItem; connectEngine(copyList.count()-1); connectInterfaceAndSync(copyList.count()-1); return newItem.id; } ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to load the interface, copy aborted"); delete newItem.engine; QMessageBox::critical(NULL,tr("Error"),tr("Unable to load the interface, copy aborted")); } else { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to load the copy engine, copy aborted"); QMessageBox::critical(NULL,tr("Error"),tr("Unable to load the copy engine, copy aborted")); } return -1; }