Changeset e9e7e28


Ignore:
Timestamp:
02/14/14 07:06:49 (10 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
b0eb497
Parents:
a74d9df
Message:

Finish cleaning up the diagnostic sheet generation for pc-bugreport: completely works now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/pc-bugreport/toolbox.cpp

    ra238837 re9e7e28  
    77#include <QProcess> 
    88#include <QDate> 
     9#include <QDebug> 
     10#include <QMessageBox> 
    911 
    1012#define PREFIX "/usr/local/" 
     
    7173void Toolbox::on_actionDiagnostic_report_triggered() 
    7274{ 
     75        qDebug() << "Generate Diagnostic Sheet"; 
    7376        //Generate the diagnostic file on the user desktop 
    7477        QString filename = QDir::homePath()+"/Desktop/diagnostic-"+QDate::currentDate().toString("yyyyMMdd")+".txt"; 
    7578        QString username = getenv("LOGNAME"); 
    76         QString cmd = "/usr/local/share/pcbsd/scripts/GetDiagSheet.sh "+filename+" "+username; 
     79        QString cmd = "/usr/local/share/pcbsd/scripts/GenDiagSheet.sh "+filename+" "+username; 
    7780        QProcess p; 
    7881        p.setProcessEnvironment(QProcessEnvironment::systemEnvironment()); 
     82        //qDebug() << " - cmd:" << cmd; 
     83        if(QFile::exists(filename)){ QFile::remove(filename); } //remove any old file first 
    7984        p.start(cmd); 
    8085        while(p.waitForFinished(200)){ 
    8186          QApplication::processEvents(); 
    8287        } 
    83         //Now show the info dialog for the newly generated diagnostic file 
    84         ShowInfoDialog *dlg = new ShowInfoDialog(this); 
    85         dlg->show(filename); 
    86          
     88        if(QFile::exists(filename)){ 
     89          qDebug() << " - success"; 
     90          //Now show the info dialog for the newly generated diagnostic file 
     91          ShowInfoDialog *dlg = new ShowInfoDialog(this); 
     92          dlg->show(filename); 
     93        }else{ 
     94          qDebug() << " - failure"; 
     95          QMessageBox::warning(this, tr("Failure"), tr("Failed to create diagnostic sheet")); 
     96        } 
    8797} 
    8898 
Note: See TracChangeset for help on using the changeset viewer.