예제 #1
0
QString FormatDBSupportTask::generateReport() const {
    QString res;
    if (isCanceled()) {
        res += QString(tr("Blast database creation has been cancelled")) + "<br>";
        if (QFile::exists(externalToolLog)) {
            res += prepareLink(externalToolLog);
        }
        return res;
    }
    if (!hasError()) {
        res += QString(tr("Blast database has been successfully created") + "<br><br>");
        res += QString(tr("Source sequences: "));
        foreach(const QString &filePath, settings.inputFilesPath){
            res += prepareLink(filePath);
            if(filePath.size() > 1){
                res += "<br>    ";
            }
        }
        res += "<br>";
        res += QString(tr("Database file path: %1")).arg(QDir::toNativeSeparators(settings.outputPath)) + "<br>";
        QString type = settings.isInputAmino ? "protein" : "nucleotide";
        res += QString(tr("Type: %1")).arg(type) + "<br>";
        if (QFile::exists(externalToolLog)) {
            res += QString(tr("Formatdb log file path: "));
            res += prepareLink(externalToolLog);
        }
    }else{
QString FacebookPostWidget::prepareStatus( const QString &txt ) 
{
	FacebookPost* post = static_cast<FacebookPost*>(currentPost());

    kDebug()<<"content: " << post->content;
    kDebug()<<"title: " << post->title;
    kDebug()<<"caption: " << post->caption;
    kDebug()<<"description: " << post->description;
    kDebug()<<"story: " << post->story;
    kDebug()<<"link: " << post->link;
	
	QString content = Choqok::UI::PostWidget::prepareStatus(post->content); 
	QString title = /*Choqok::UI::PostWidget::prepareStatus*/(post->title);
	QString caption = /*Choqok::UI::PostWidget::prepareStatus*/(post->caption);
	QString description = Choqok::UI::PostWidget::prepareStatus(post->description);
	QString story = Choqok::UI::PostWidget::prepareStatus(post->story);
	QString link = /*Choqok::UI::PostWidget::prepareStatus*/(post->link);
    QString status;
    if( !story.isEmpty() )
        status += story + " <br/> ";
    if( !link.isEmpty() )
        status += prepareLink(link, title, caption, description) + "<br/>";
    if( !content.isEmpty() )
        status += content;

    /* You cannot show an image this way in a QTextBrowser
     * You need to download it first, via Choqok::MediaManager and then add it as a resource
     * just like what we did in Image preview plugin.
     * I put the false in if, to prevent it to show for now*/
	if (false && !post->iconUrl.isEmpty())
	  status += QString("<a href = \"%1\"> <img src = \"%2\"/> </a>").arg(link).arg(post->iconUrl);
	  
   //QString status = Choqok::UI::PostWidget::prepareStatus(txt);
   kDebug()<< status;
   return status;
}