Ejemplo n.º 1
0
void K3b::VcdJob::slotVcdxBuildFinished( int exitCode, QProcess::ExitStatus exitStatus )
{
    if ( exitStatus == QProcess::NormalExit ) {
        // TODO: check the process' exitStatus()
        switch ( exitCode ) {
        case 0:
            emit infoMessage( i18n( "Cue/Bin files successfully created." ), K3b::Job::MessageSuccess );
            m_imageFinished = true;
            break;
        default:
            emit infoMessage( i18n( "%1 returned an unknown error (code %2)." , QString("vcdxbuild") , exitCode ),
                              K3b::Job::MessageError );
            emit infoMessage( i18n( "Please send me an email with the last output." ), K3b::Job::MessageError );
            cancelAll();
            jobFinished( false );
            return ;
        }
    } else {
        emit infoMessage( i18n( "%1 did not exit cleanly." , QString("Vcdxbuild") ), K3b::Job::MessageError );
        cancelAll();
        jobFinished( false );
        return ;
    }

    //remove xml-file
    delete d->xmlFile;
    d->xmlFile = 0;

    qDebug() << QString( "(K3b::VcdJob) create only image: %1" ).arg( vcdDoc() ->onlyCreateImages() );
    if ( !vcdDoc() ->onlyCreateImages() )
        startWriterjob();
    else
        jobFinished( true );
}
Ejemplo n.º 2
0
void MainWindow::open(std::unique_ptr<Project> project) {
    assert(project);

    project_ = std::move(project);

    imageChanged();
    instructionsChanged();
    treeChanged();

    /* Log messages to the log window. */
    project_->setLogToken(logToken_);

    /* Connect the project to the slots for updating views. */
    connect(project_.get(), SIGNAL(nameChanged()), this, SLOT(updateGuiState()));
    connect(project_.get(), SIGNAL(imageChanged()), this, SLOT(imageChanged()));
    connect(project_.get(), SIGNAL(instructionsChanged()), this, SLOT(instructionsChanged()));
    connect(project_.get(), SIGNAL(treeChanged()), this, SLOT(treeChanged()));

    /* Connect the project to the progress dialog. */
    connect(project_->commandQueue(), SIGNAL(nextCommand()), this, SLOT(updateGuiState()));
    connect(project_->commandQueue(), SIGNAL(idle()), this, SLOT(updateGuiState()));
    connect(progressDialog_, SIGNAL(canceled()), project_.get(), SLOT(cancelAll()));

    /* Delegate "Cancel All" to the project. */
    connect(cancelAllAction_, SIGNAL(triggered()), project_.get(), SLOT(cancelAll()));

    updateGuiState();
}
Ejemplo n.º 3
0
void K3b::VcdJob::cancel()
{
    cancelAll();

    emit canceled();
    jobFinished( false );
}
Ejemplo n.º 4
0
void Looper::quit()
{
    assert (lthread::this_thread::get_id() == mThreadId && "quit() called from outside the loop!");

    cancelAll();
    mQuit = true;
}
Ejemplo n.º 5
0
void Uploader::upload(const QString &fileName)
{
  if (fileName.isEmpty()) {
    return;
  }

  QVariantHash options;
  QSettings *s = ScreenshotManager::instance()->settings();
  options["type"] = "imgur";
  options["networkManager"].setValue(mNetworkAccessManager);
  options["anonymous"] = s->value("upload/imgur/anonymous", true).toBool();
  options["album"]     = s->value("upload/imgur/album", "").toString();
  options["access_token"]  = s->value("upload/imgur/access_token", "").toString();
  options["refresh_token"] = s->value("upload/imgur/refresh_token", "").toString();

  if (options["access_token"].toString().isEmpty() || options["refresh_token"].toString().isEmpty())
  {
    options["anonymous"] = true;
  }

  ImgurUploader *uploader = new ImgurUploader(options);

  connect(uploader, &ImgurUploader::uploaded       , this, &Uploader::uploaded);
  connect(uploader, &ImgurUploader::error          , this, &Uploader::uploaderError);
  connect(uploader, &ImgurUploader::progressChange , this, &Uploader::progressChange);
  connect(uploader, &ImgurUploader::needAuthRefresh, this, &Uploader::imgurAuthRefresh);

  connect(this    , SIGNAL(cancelAll()), uploader, SLOT(cancel()));

  uploader->upload(fileName);
  mUploaders.append(uploader);
}
Ejemplo n.º 6
0
// Cancels the data source's pending loads.  Conceptually, a data source only loads
// one document at a time, but one document may have many related resources. 
// stopLoading will stop all loads initiated by the data source, 
// but not loads initiated by child frames' data sources -- that's the WebFrame's job.
void DocumentLoader::stopLoading()
{
    // In some rare cases, calling FrameLoader::stopLoading could set m_loading to false.
    // (This can happen when there's a single XMLHttpRequest currently loading and stopLoading causes it
    // to stop loading. Because of this, we need to save it so we don't return early.
    bool loading = m_loading;
    
    if (m_committed) {
        // Attempt to stop the frame if the document loader is loading, or if it is done loading but
        // still  parsing. Failure to do so can cause a world leak.
        Document* doc = m_frame->document();
        
        if (loading || doc->parsing())
            m_frame->loader()->stopLoading(UnloadEventPolicyNone);
    }

    // Always cancel multipart loaders
    cancelAll(m_multipartSubresourceLoaders);

    // Appcache uses ResourceHandle directly, DocumentLoader doesn't count these loads.
    m_applicationCacheHost->stopLoadingInFrame(m_frame);

    if (!loading) {
        // If something above restarted loading we might run into mysterious crashes like 
        // https://bugs.webkit.org/show_bug.cgi?id=62764 and <rdar://problem/9328684>
        ASSERT(!m_loading);
        return;
    }

    // We might run in to infinite recursion if we're stopping loading as the result of 
    // detaching from the frame, so break out of that recursion here.
    // See <rdar://problem/9673866> for more details.
    if (m_isStopping)
        return;
    
    RefPtr<Frame> protectFrame(m_frame);
    RefPtr<DocumentLoader> protectLoader(this);

    m_isStopping = true;

    FrameLoader* frameLoader = DocumentLoader::frameLoader();
    
    if (m_mainResourceLoader)
        // Stop the main resource loader and let it send the cancelled message.
        m_mainResourceLoader->cancel();
    else if (!m_subresourceLoaders.isEmpty())
        // The main resource loader already finished loading. Set the cancelled error on the 
        // document and let the subresourceLoaders send individual cancelled messages below.
        setMainDocumentError(frameLoader->cancelledError(m_request));
    else
        // If there are no resource loaders, we need to manufacture a cancelled message.
        // (A back/forward navigation has no resource loaders because its resources are cached.)
        mainReceivedError(frameLoader->cancelledError(m_request), true);
    
    stopLoadingSubresources();
    stopLoadingPlugIns();
    
    m_isStopping = false;
}
Ejemplo n.º 7
0
//=============================================================================
// METHOD: SPELLipcMessageMailbox::shutdown
//=============================================================================
void SPELLipcMessageMailbox::shutdown()
{
    {
        SPELLmonitor m(m_lock);
        DEBUG("[Mailbox-" + m_name + "] Shutdown")
        m_working = false;
    }
    cancelAll();
}
Ejemplo n.º 8
0
//=============================================================================
// METHOD: SPELLipcMessageMailbox::shutdown
//=============================================================================
void SPELLipcMessageMailbox::shutdown()
{
    {
        SPELLmonitor m(m_lock);
        DEBUG(NAME + "Shutdown")
        m_working = false;
    }
    cancelAll();
}
Ejemplo n.º 9
0
	void NodeVersionLoader::shutdown()
	{
		if (disposed)
			return;
		
		disposed = true;
		service.post([this] { cancelAll(); });
		work.reset();
		thread.join();
	}
/// \note Can be call without queue because all call will be serialized
/// \todo all this part
void copyEngine::errorOnFolder(QFileInfo fileInfo,QString errorString,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog)
{
	if(stopIt)
		return;
	ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath()+", error: "+errorString);
	if(thread==NULL)
	{
		ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread");
		return;
	}
	//load the always action
	tempFileErrorAction=alwaysDoThisActionForFolderError;
	switch(tempFileErrorAction)
	{
		case FileError_Skip:
		case FileError_Retry:
		case FileError_PutToEndOfTheList:
			thread->setFolderErrorAction(tempFileErrorAction);
		break;
		default:
			if(dialogIsOpen)
			{
				errorQueueItem newItem;
				newItem.errorString=errorString;
				newItem.inode=fileInfo;
				newItem.mkPath=false;
				newItem.rmPath=false;
				newItem.scan=thread;
				newItem.transfer=NULL;
				errorQueue << newItem;
				return;
			}
			dialogIsOpen=true;
			ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog");
			emit error(fileInfo.absoluteFilePath(),fileInfo.size(),fileInfo.lastModified(),errorString);
			fileErrorDialog dialog(interface,fileInfo,errorString);
			dialog.exec();/// \bug crash when external close
			FileErrorAction newAction=dialog.getAction();
			ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction));
			if(newAction==FileError_Cancel)
			{
				emit cancelAll();
				return;
			}
			if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError)
				setComboBoxFolderError(newAction);
			dialogIsOpen=false;
			thread->setFolderErrorAction(newAction);
			if(!isCalledByShowOneNewDialog)
				emit queryOneNewDialog();
			return;
		break;
	}
	ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop");
}
/// \note Can be call without queue because all call will be serialized
void copyEngine::folderAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,scanFileOrFolder * thread,bool isCalledByShowOneNewDialog)
{
	if(stopIt)
		return;
	ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"folder already exists: "+source.absoluteFilePath()+", destination: "+destination.absoluteFilePath());
	if(thread==NULL)
	{
		ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread");
		return;
	}
	//load the always action
	tempFolderExistsAction=alwaysDoThisActionForFolderExists;
	switch(tempFolderExistsAction)
	{
		case FolderExists_Skip:
		case FolderExists_Rename:
		case FolderExists_Merge:
			thread->setFolderExistsAction(tempFolderExistsAction);
		break;
		default:
			if(dialogIsOpen)
			{
				alreadyExistsQueueItem newItem;
				newItem.source=source;
				newItem.destination=destination;
				newItem.isSame=isSame;
				newItem.transfer=NULL;
				newItem.scan=thread;
				alreadyExistsQueue << newItem;
				return;
			}
			dialogIsOpen=true;
			ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog");
			folderExistsDialog dialog(interface,source,isSame,destination,firstRenamingRule,otherRenamingRule);
			dialog.exec();/// \bug crash when external close
			FolderExistsAction newAction=dialog.getAction();
			ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction));
			if(newAction==FolderExists_Cancel)
			{
				emit cancelAll();
				return;
			}
			if(dialog.getAlways() && newAction!=alwaysDoThisActionForFolderExists)
				setComboBoxFolderColision(newAction);
			if(!dialog.getAlways() && newAction==FolderExists_Rename)
				thread->setFolderExistsAction(newAction,dialog.getNewName());
			else
				thread->setFolderExistsAction(newAction);
			dialogIsOpen=false;
			if(!isCalledByShowOneNewDialog)
				emit queryOneNewDialog();
			return;
		break;
	}
}
Ejemplo n.º 12
0
// Cancels the data source's pending loads.  Conceptually, a data source only loads
// one document at a time, but one document may have many related resources.
// stopLoading will stop all loads initiated by the data source,
// but not loads initiated by child frames' data sources -- that's the WebFrame's job.
void DocumentLoader::stopLoading(DatabasePolicy databasePolicy)
{
    // In some rare cases, calling FrameLoader::stopLoading could set m_loading to false.
    // (This can happen when there's a single XMLHttpRequest currently loading and stopLoading causes it
    // to stop loading. Because of this, we need to save it so we don't return early.
    bool loading = m_loading;

    if (m_committed) {
        // Attempt to stop the frame if the document loader is loading, or if it is done loading but
        // still  parsing. Failure to do so can cause a world leak.
        Document* doc = m_frame->document();

        if (loading || doc->parsing())
            m_frame->loader()->stopLoading(UnloadEventPolicyNone, databasePolicy);
    }

    // Always cancel multipart loaders
    cancelAll(m_multipartSubresourceLoaders);

    // Appcache uses ResourceHandle directly, DocumentLoader doesn't count these loads.
#if ENABLE(OFFLINE_WEB_APPLICATIONS)
    m_applicationCacheHost->stopLoadingInFrame(m_frame);
#endif

    if (!loading)
        return;

    RefPtr<Frame> protectFrame(m_frame);
    RefPtr<DocumentLoader> protectLoader(this);

    m_isStopping = true;

    FrameLoader* frameLoader = DocumentLoader::frameLoader();

    if (m_mainResourceLoader)
        // Stop the main resource loader and let it send the cancelled message.
        m_mainResourceLoader->cancel();
    else if (!m_subresourceLoaders.isEmpty())
        // The main resource loader already finished loading. Set the cancelled error on the
        // document and let the subresourceLoaders send individual cancelled messages below.
        setMainDocumentError(frameLoader->cancelledError(m_request));
    else
        // If there are no resource loaders, we need to manufacture a cancelled message.
        // (A back/forward navigation has no resource loaders because its resources are cached.)
        mainReceivedError(frameLoader->cancelledError(m_request), true);

    stopLoadingSubresources();
    stopLoadingPlugIns();

    m_isStopping = false;
}
Ejemplo n.º 13
0
void K3b::VcdJob::slotWriterJobFinished( bool success )
{
    if ( m_canceled )
        return ;

    if ( m_currentcopy >= m_doc->copies() ) {
        // remove bin-file if it is unfinished or the user selected to remove image
        if ( QFile::exists( m_doc->vcdImage() ) ) {
            if ( (!m_doc->onTheFly() && m_doc->removeImages()) || !m_imageFinished ) {
                emit infoMessage( i18n( "Removing Binary file %1" , m_doc->vcdImage() ), K3b::Job::MessageSuccess );
                QFile::remove
                    ( m_doc->vcdImage() );
                m_doc->setVcdImage( "" );
            }
        }

        // remove cue-file if it is unfinished or the user selected to remove image
        if ( QFile::exists( m_cueFile ) ) {
            if ( (!m_doc->onTheFly() && m_doc->removeImages()) || !m_imageFinished ) {
                emit infoMessage( i18n( "Removing Cue file %1" , m_cueFile ), K3b::Job::MessageSuccess );
                QFile::remove
                    ( m_cueFile );
                m_cueFile = "";
            }
        }
    }

    if ( success ) {
        // allright
        // the writerJob should have emitted the "simulation/writing successful" signal
        if ( m_currentcopy >= m_doc->copies() ) {
            if ( k3bcore->globalSettings()->ejectMedia() ) {
                K3b::Device::eject( m_doc->burner() );
            }
            jobFinished( true );
        } else {
            if( !K3b::eject( m_doc->burner() ) ) {
                blockingInformation( i18n("K3b was unable to eject the written disk. Please do so manually.") );
            }
            m_currentcopy++;
            startWriterjob();
        }
    } else {
        cancelAll();
        jobFinished( false );
    }
}
Ejemplo n.º 14
0
void K3b::VcdJob::xmlGen()
{
    delete d->xmlFile;
    d->xmlFile = new QTemporaryFile;

    if( d->xmlFile->open() ) {
        qDebug() << "(K3b::VcdJob) writing XML data to" << d->xmlFile->fileName();

        K3b::VcdXmlView xmlView( m_doc );
        xmlView.write( *d->xmlFile );

        //    emit infoMessage( i18n( "XML-file successfully created" ), K3b::Job::MessageSuccess );
        emit debuggingOutput( "K3b::VcdXml:", xmlView.xmlString() );

        vcdxBuild();
    }
    else {
        qDebug() << "(K3b::VcdJob) could not write xmlfile.";
        emit infoMessage( i18n( "Could not write correct XML file." ), K3b::Job::MessageError );
        cancelAll();
        jobFinished( false );
    }
}
Ejemplo n.º 15
0
void DocumentLoader::stopLoadingPlugIns()
{
    cancelAll(m_plugInStreamLoaders);
}
/// \note Can be call without queue because all call will be serialized
void copyEngine::errorOnFile(QFileInfo fileInfo,QString errorString,TransferThread * thread,bool isCalledByShowOneNewDialog)
{
	if(stopIt)
		return;
	ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file have error: "+fileInfo.absoluteFilePath()+", error: "+errorString);
	if(thread==NULL)
	{
		ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread");
		return;
	}
	//load the action
	tempFileErrorAction=alwaysDoThisActionForFileError;
	switch(tempFileErrorAction)
	{
		case FileError_Skip:
			thread->skip();
		return;
		case FileError_Retry:
			thread->retryAfterError();
		return;
		case FileError_PutToEndOfTheList:
			/// \todo do the read transfer locator and put at the end
			ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"todo list item not found");
		return;
		default:
			if(dialogIsOpen)
			{
				errorQueueItem newItem;
				newItem.errorString=errorString;
				newItem.inode=fileInfo;
				newItem.mkPath=false;
				newItem.rmPath=false;
				newItem.scan=NULL;
				newItem.transfer=thread;
				errorQueue << newItem;
				return;
			}
			dialogIsOpen=true;
			ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog");
			emit error(fileInfo.absoluteFilePath(),fileInfo.size(),fileInfo.lastModified(),errorString);
			fileErrorDialog dialog(interface,fileInfo,errorString);
			emit isInPause(true);
			dialog.exec();/// \bug crash when external close
			FileErrorAction newAction=dialog.getAction();
			emit isInPause(false);
			ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction));
			if(newAction==FileError_Cancel)
			{
				emit cancelAll();
				return;
			}
			if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError)
			{
				alwaysDoThisActionForFileError=newAction;
				switch(newAction)
				{
					default:
					case FileError_Skip:
						emit newErrorAction("skip");
					break;
					case FileError_PutToEndOfTheList:
						emit newErrorAction("putToEndOfTheList");
					break;
				}
			}
			switch(newAction)
			{
				case FileError_Skip:
					thread->skip();
				break;
				case FileError_Retry:
					thread->retryAfterError();
				break;
				case FileError_PutToEndOfTheList:
					thread->putAtBottom();
					/// \todo do the read transfer locator and put at the end
                                        ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"todo");
				break;
				default:
					ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"file error action wrong");
				break;
			}
			dialogIsOpen=false;
			if(!isCalledByShowOneNewDialog)
				emit queryOneNewDialog();
			else
				ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"isCalledByShowOneNewDialog==true then not show other dial");
			return;
		break;
	}
	ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop");
}
/// \note Can be call without queue because all call will be serialized
void copyEngine::fileAlreadyExists(QFileInfo source,QFileInfo destination,bool isSame,TransferThread * thread,bool isCalledByShowOneNewDialog)
{
	if(stopIt)
		return;
	if(thread==NULL)
	{
		ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Critical,"unable to locate the thread");
		return;
	}
	//load the action
	if(isSame)
	{
		ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file is same: "+source.absoluteFilePath());
		tempFileExistsAction=alwaysDoThisActionForFileExists;
		if(tempFileExistsAction==FileExists_Overwrite || tempFileExistsAction==FileExists_OverwriteIfNewer || tempFileExistsAction==FileExists_OverwriteIfNotSameModificationDate)
			tempFileExistsAction=FileExists_NotSet;
		switch(tempFileExistsAction)
		{
			case FileExists_Skip:
			case FileExists_Rename:
				thread->setFileExistsAction(tempFileExistsAction);
			break;
			default:
				if(dialogIsOpen)
				{
					alreadyExistsQueueItem newItem;
					newItem.source=source;
					newItem.destination=destination;
					newItem.isSame=isSame;
					newItem.transfer=thread;
					newItem.scan=NULL;
					alreadyExistsQueue << newItem;
					return;
				}
				dialogIsOpen=true;
				ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog");
				fileIsSameDialog dialog(interface,source,firstRenamingRule,otherRenamingRule);
				emit isInPause(true);
				dialog.exec();/// \bug crash when external close
				FileExistsAction newAction=dialog.getAction();
				emit isInPause(false);
				ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction));
				if(newAction==FileExists_Cancel)
				{
					emit cancelAll();
					return;
				}
				if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileExists)
				{
					alwaysDoThisActionForFileExists=newAction;
					listThread->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists);
					switch(newAction)
					{
						default:
						case FileExists_Skip:
							emit newCollisionAction("skip");
						break;
						case FileExists_Rename:
							emit newCollisionAction("rename");
						break;
					}
				}
				if(dialog.getAlways() || newAction!=FileExists_Rename)
					thread->setFileExistsAction(newAction);
				else
					thread->setFileRename(dialog.getNewName());
				dialogIsOpen=false;
				if(!isCalledByShowOneNewDialog)
					emit queryOneNewDialog();
				return;
			break;
		}
	}
	else
	{
		ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file already exists: "+source.absoluteFilePath()+", destination: "+destination.absoluteFilePath());
		tempFileExistsAction=alwaysDoThisActionForFileExists;
		switch(tempFileExistsAction)
		{
			case FileExists_Skip:
			case FileExists_Rename:
			case FileExists_Overwrite:
			case FileExists_OverwriteIfNewer:
			case FileExists_OverwriteIfNotSameModificationDate:
				ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"always do this action: "+QString::number(tempFileExistsAction));
				thread->setFileExistsAction(tempFileExistsAction);
			break;
			default:
				if(dialogIsOpen)
				{
					ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,QString("dialog open, put in queue: %1 %2")
								 .arg(source.absoluteFilePath())
								 .arg(destination.absoluteFilePath())
								 );
					alreadyExistsQueueItem newItem;
					newItem.source=source;
					newItem.destination=destination;
					newItem.isSame=isSame;
					newItem.transfer=thread;
					newItem.scan=NULL;
					alreadyExistsQueue << newItem;
					return;
				}
				dialogIsOpen=true;
				ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog");
				fileExistsDialog dialog(interface,source,destination,firstRenamingRule,otherRenamingRule);
				emit isInPause(true);
				dialog.exec();/// \bug crash when external close
				FileExistsAction newAction=dialog.getAction();
				emit isInPause(false);
				ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction));
				if(newAction==FileExists_Cancel)
				{
					emit cancelAll();
					return;
				}
				if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileExists)
				{
					alwaysDoThisActionForFileExists=newAction;
					listThread->setAlwaysFileExistsAction(alwaysDoThisActionForFileExists);
					switch(newAction)
					{
						default:
						case FileExists_Skip:
							emit newCollisionAction("skip");
						break;
						case FileExists_Rename:
							emit newCollisionAction("rename");
						break;
						case FileExists_Overwrite:
							emit newCollisionAction("overwrite");
						break;
						case FileExists_OverwriteIfNewer:
							emit newCollisionAction("overwriteIfNewer");
						break;
						case FileExists_OverwriteIfNotSameModificationDate:
							emit newCollisionAction("overwriteIfNotSameModificationDate");
						break;
					}
				}
				if(dialog.getAlways() || newAction!=FileExists_Rename)
					thread->setFileExistsAction(newAction);
				else
					thread->setFileRename(dialog.getNewName());
				dialogIsOpen=false;
				if(!isCalledByShowOneNewDialog)
				{
					ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"emit queryOneNewDialog()");
					emit queryOneNewDialog();
				}
				return;
			break;
		}
	}
	ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop");
}
Ejemplo n.º 18
0
void Uploader::cancel()
{
  mUploaders.clear();
  mProgress = 0;
  emit cancelAll();
}
Ejemplo n.º 19
0
void K3b::VcdJob::vcdxBuild()
{
    emit newTask( i18n( "Creating image files" ) );

    m_stage = stageUnknown;
    firstTrack = true;
    delete m_process;
    m_process = new K3b::Process();
    m_process->setSplitStdout( true );

    emit infoMessage( i18n( "Creating Cue/Bin files..." ), K3b::Job::MessageInfo );
    const K3b::ExternalBin* bin = k3bcore ->externalBinManager() ->binObject( "vcdxbuild" );
    if ( !bin ) {
        qDebug() << "(K3b::VcdJob) could not find vcdxbuild executable";
        emit infoMessage( i18n( "Could not find %1 executable." , QString("vcdxbuild") ), K3b::Job::MessageError );
        emit infoMessage( i18n( "To create Video CDs you have to install VcdImager version %1." ,QString( ">= 0.7.12") ), K3b::Job::MessageInfo );
        emit infoMessage( i18n( "You can find this on your distribution disks or download it from http://www.vcdimager.org" ), K3b::Job::MessageInfo );
        cancelAll();
        jobFinished( false );
        return ;
    }

    if ( bin->version() < K3b::Version( "0.7.12" ) ) {
        qDebug() << "(K3b::VcdJob) vcdxbuild executable too old!";
        emit infoMessage( i18n( "%1 executable too old: need version %2 or greater." ,QString( "Vcdxbuild" ),QString( "0.7.12" )), K3b::Job::MessageError );
        emit infoMessage( i18n( "You can find this on your distribution disks or download it from http://www.vcdimager.org" ), K3b::Job::MessageInfo );
        cancelAll();
        jobFinished( false );
        return ;
    }

    if ( !bin->copyright().isEmpty() )
        emit infoMessage( i18n( "Using %1 %2 – Copyright © %3" , bin->name() , bin->version() ,bin->copyright() ), MessageInfo );

    *m_process << bin;

    // additional user parameters from config
    const QStringList& params = k3bcore->externalBinManager() ->program( "vcdxbuild" ) ->userParameters();
    for ( QStringList::const_iterator it = params.begin(); it != params.end(); ++it )
        *m_process << *it;


    if ( vcdDoc() ->vcdOptions() ->Sector2336() ) {
        qDebug() << "(K3b::VcdJob) Write 2336 Sectors = on";
        *m_process << "--sector-2336";
    }

    *m_process << "--progress" << "--gui";

    *m_process << QString( "--cue-file=%1" ).arg( m_cueFile );

    *m_process << QString( "--bin-file=%1" ).arg( m_doc->vcdImage() );

    *m_process << d->xmlFile->fileName();

    connect( m_process, SIGNAL(stdoutLine(QString)),
             this, SLOT(slotParseVcdxBuildOutput(QString)) );
    connect( m_process, SIGNAL(finished(int,QProcess::ExitStatus)),
             this, SLOT(slotVcdxBuildFinished(int,QProcess::ExitStatus)) );

    // vcdxbuild commandline parameters
    qDebug() << "***** vcdxbuild parameters:";
    QString s = m_process->joinedArgs();
    qDebug() << s << flush;
    emit debuggingOutput( "vcdxbuild command:", s );

    if ( !m_process->start( KProcess::MergedChannels ) ) {
        qDebug() << "(K3b::VcdJob) could not start vcdxbuild";
        emit infoMessage( i18n( "Could not start %1." , QString("vcdxbuild") ), K3b::Job::MessageError );
        cancelAll();
        jobFinished( false );
    }
}
Ejemplo n.º 20
0
void ItemTaskGroup::finish()
{
	cancelAll();
}
//rmpath event
void copyEngine::rmPathErrorOnFolder(QFileInfo folder,QString errorString,bool isCalledByShowOneNewDialog)
{
	if(stopIt)
		return;
	ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"file have error: "+folder.absoluteFilePath()+", error: "+errorString);
	//load the always action
	tempFileErrorAction=alwaysDoThisActionForFolderError;
	error_index=0;
	switch(tempFileErrorAction)
	{
		case FileError_Skip:
			listThread->rmPathQueue.skip();
		return;
		case FileError_Retry:
			listThread->rmPathQueue.retry();
		return;
		default:
			if(dialogIsOpen)
			{
				errorQueueItem newItem;
				newItem.errorString=errorString;
				newItem.inode=folder;
				newItem.mkPath=false;
				newItem.rmPath=true;
				newItem.scan=NULL;
				newItem.transfer=NULL;
				errorQueue << newItem;
				return;
			}
			dialogIsOpen=true;
			ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"show dialog");
			emit error(folder.absoluteFilePath(),folder.size(),folder.lastModified(),errorString);
			fileErrorDialog dialog(interface,folder,errorString,false);
			dialog.exec();/// \bug crash when external close
			FileErrorAction newAction=dialog.getAction();
			ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"close dialog: "+QString::number(newAction));
			if(newAction==FileError_Cancel)
			{
				emit cancelAll();
				return;
			}
			if(dialog.getAlways() && newAction!=alwaysDoThisActionForFileError)
			{
				setComboBoxFolderError(newAction);
				alwaysDoThisActionForFolderError=newAction;
			}
			dialogIsOpen=false;
			ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"do the action");
			switch(newAction)
			{
				case FileError_Skip:
					listThread->rmPathQueue.skip();
				break;
				case FileError_Retry:
					listThread->rmPathQueue.retry();
				break;
				default:
					ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Warning,"Unknow switch case: "+QString::number(newAction));
				break;
			}
			if(!isCalledByShowOneNewDialog)
				emit queryOneNewDialog();
			return;
		break;
	}
	ULTRACOPIER_DEBUGCONSOLE(DebugLevel_Notice,"stop");
}
Ejemplo n.º 22
0
DmWidget::DmWidget(QWidget *parent) :
    QWidget(parent)
{
    //installEventFilter(this);

    setObjectName("dmwidget");

    setStyleSheet("QWidget#dmwidget {padding-right: 90px; border-radius: 7px; background-color: rgba(55, 55, 55, 210); color: #fff; font-size: 15px;} QLineEdit { border-radius: 2px; background-color: rgba(55, 55, 55, 210); color: #fff; } QLabel { color: #fff;  } ");

    setMaximumSize(QSize(420, 320));

    setFixedSize(QSize(250, 80));


    QVBoxLayout *layout = new QVBoxLayout(this);
    QHBoxLayout *topLayout = new QHBoxLayout();
    QHBoxLayout *middleLayout = new QHBoxLayout();
    layout->addLayout(topLayout);
    layout->addLayout(middleLayout);

    m_wlTitle = new QLabel(this);
    m_wlTitle->setText("Ac/Dc - Back In Black");
    m_wlTitle->setStyleSheet("font-size: 12px;");
    m_wlTitle->setAlignment(Qt::AlignCenter);
    topLayout->addWidget(m_wlTitle);

    //middleLayout
    m_wlMb = new QLabel(this);
    m_wlMb->setStyleSheet("font-size: 10px;");
    m_wlMb->setText("5/25 Mb");
    middleLayout->addWidget(m_wlMb);

    m_wlQueue = new QLabel(this);
    m_wlQueue->setStyleSheet("font-size: 10px;");
    m_wlQueue->setText("In queue: 5");
    m_wlQueue->setAlignment(Qt::AlignRight);
    middleLayout->addWidget(m_wlQueue);

    m_wProgress = new QProgressBar(this);
    m_wProgress->setStyleSheet(":horizontal {border-radius: 0px; background: #BDBDBD;} ::chunk:horizontal { background: #000;}");
    m_wProgress->setFixedHeight(3);
    m_wProgress->setRange(0, 100);
    m_wProgress->setValue(25);
    layout->addWidget(m_wProgress);

    m_wbCancel = new StyledButton(tr("Cancel"), this);
    m_wbCancel->setFixedSize(50, 20);
    layout->addWidget(m_wbCancel);

    connect(m_wbCancel, SIGNAL(clicked()), this, SIGNAL(cancelAll()));
    connect(m_wbCancel, SIGNAL(clicked()), this, SLOT(onCancelAll()));



    //layout->addWidget(m_wList);

    hide();
    repaint();

    m_effect = new QGraphicsOpacityEffect(this);
    m_effect->setOpacity(0.0);

    setGraphicsEffect(m_effect);

    m_animation = new QPropertyAnimation(m_effect, "opacity");
    m_animation->setDuration(550);
}
Ejemplo n.º 23
0
void SoundCloudService::clear()
{
    cancelAll();
    ::OnlineService::clear();
}
Ejemplo n.º 24
0
//-------------------------------------------------------------------------------------
ScriptCallbacks::~ScriptCallbacks()
{
	// DEBUG_MSG("ScriptCallbacks::~ScriptCallbacks: timers_size(%d).\n", map_.size());
	cancelAll();
}
Ejemplo n.º 25
0
void DocumentLoader::stopLoadingSubresources()
{
    cancelAll(m_subresourceLoaders);
}
Ejemplo n.º 26
0
 void FtpCoordinator::cancelUpload() {
     LOG_DEBUG << "#";
     emit cancelAll();
 }