Changeset 4efda4d


Ignore:
Timestamp:
01/16/14 08:50:15 (11 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3, releng/10.1
Children:
58a4795
Parents:
0542f38
Message:

Fix up exporting jails via the warden GUI.

While here, I made the export process a bit more "chatty" so the user
knows whats going on.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/warden-gui/dialogwarden.cpp

    rbd52c24 r4efda4d  
    735735                    this, 
    736736                    tr("Choose a directory to save the finished .wdn file:"), 
    737                     "/home", 
     737                    "/root", 
    738738                    QFileDialog::ShowDirsOnly ); 
    739739     
     
    744744     
    745745      // Lauch the command output dialog 
    746     /* 
    747       dialogOutput = new dialogDisplayOutput(0, "Exporting Jail", Qt::WStyle_Customize | Qt::WShowModal); 
     746      dialogOutput = new dialogDisplayOutput(); 
     747      dialogOutput->setModal(true); 
    748748      dialogOutput->programInit(FALSE); 
    749       dialogOutput->setDialogCaption("Exporting Jail: " + popupip); 
     749      dialogOutput->setDialogCaption(tr("Exporting Jail:") + " " + popupip); 
    750750      dialogOutput->setDialogText(""); 
     751      tmp = tr("Exporting Jail:") + " " + popupip + "\n"; 
     752      dialogOutput->appendDialogText(tmp); 
    751753      dialogOutput->show(); 
    752       */ 
    753  
    754             // Launch our working dialog to prevent further action until we are finished 
    755       workingDialog = new dialogWorking(); 
    756       workingDialog->setModal(true); 
    757       workingDialog->programInit(); 
    758       tmp = tr("Exporting Jail"); 
    759       workingDialog->setDialogTitle(tmp); 
    760       tmp = tr("Exporting Jail:") + " " + popupip; 
    761       workingDialog->setDialogText(tmp); 
    762       workingDialog->show(); 
    763      
    764           // Now start the script to stop this jail 
     754     
     755      // Now start the script to stop this jail 
    765756      exportJailProc = new QProcess( this ); 
    766757      QString program = "warden"; 
     
    769760       
    770761      // Connect the exited signal and start the process  
    771       // connect( exportJailProc, SIGNAL(readyReadStdout ()), this, SLOT(slotReadDisplayOutput() ) ); 
    772       connect( exportJailProc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotFinishedWorking() ) ); 
     762      connect( exportJailProc, SIGNAL(readyReadStandardOutput()), this, SLOT(slotReadExportOutput() ) ); 
     763      connect( exportJailProc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(slotFinishedExport() ) ); 
    773764      exportJailProc->start(program, args); 
    774765    
    775766} 
    776767 
     768void dialogWarden::slotFinishedExport() 
     769{ 
     770  dialogOutput->setCloseHide( false ); 
     771} 
    777772 
    778773void dialogWarden::slotListJailPkgs() 
     
    860855 
    861856 
    862 void dialogWarden::slotReadDisplayOutput() 
    863 { 
    864      
     857void dialogWarden::slotReadExportOutput() 
     858{ 
    865859    while ( exportJailProc->canReadLine() ) 
    866     { 
    867860        dialogOutput->appendDialogText(exportJailProc->readLine()); 
    868     } 
    869  
    870861} 
    871862 
  • src-qt4/warden-gui/dialogwarden.h

    r6c1dd87 r4efda4d  
    5151    void slotDeleteJail(); 
    5252    void slotFinishedWorking(); 
    53     void slotReadDisplayOutput(); 
    5453    void slotFinishedOutput(); 
    5554    void slotReadPkgsOutput(); 
     
    7372    void slotShowDialogCloseButton(); 
    7473    void slotServiceGUI(); 
     74    void slotReadExportOutput(); 
     75    void slotFinishedExport(); 
    7576 
    7677    void slotCheckForUpdates(); 
  • src-sh/warden/scripts/backend/exportjail.sh

    r1fffaadd r4efda4d  
    1212JAILNAME="$1" 
    1313OUTDIR="$2" 
     14 
     15if [ -z "${OUTDIR}" ]; then OUTDIR="$WTMP" ; fi 
    1416 
    1517if [ -z "${EXPORTNAME}" ] 
     
    3638 
    3739# First check if this jail is running, and stop it 
     40echo "Checking jail status..." 
    3841${PROGDIR}/scripts/backend/checkstatus.sh "${EXPORTNAME}" 
    3942if [ "$?" = "0" ] 
    4043then 
     44  echo "Stopping jail for export..." 
    4145  ${PROGDIR}/scripts/backend/stopjail.sh "${EXPORTNAME}" 
    4246fi 
     
    6468MASK6="${JMASK}" 
    6569 
    66 echo "Creating compressed archive of ${EXPORTNAME}... Please Wait..." >&1 
     70echo "Creating compressed archive of ${EXPORTNAME}... Please Wait..." 
    6771tar cvJf "${WTMP}/${EXPORTNAME}.txz" -C "${JAILDIR}" . 2>${WTMP}/${EXPORTNAME}.files 
    6872 
    6973cd ${WTMP} 
    7074 
     75echo "Creating jail metadata..." 
    7176LINES="`wc -l ${EXPORTNAME}.files | sed -e 's, ,,g' | cut -d '.' -f 1`" 
    7277 
     
    109114done 
    110115 
    111 if [ ! -z "${OUTDIR}" ] 
    112 then 
    113   mkdir -p ${OUTDIR} 2>/dev/null 
     116if [ ! -d "$OUTDIR" ] ; then 
     117  mkdir -p ${OUTDIR} 
     118fi 
     119if [ "$OUTDIR" != "$WTMP" ] ; then 
    114120  mv ${EXPORTNAME}.wdn ${OUTDIR}/ 
    115   echo "Created ${EXPORTNAME}.wdn in ${OUTDIR}" >&1 
    116 else  
    117   echo "Created ${EXPORTNAME}.wdn in ${WTMP}" >&1 
    118121fi 
     122echo "Created ${EXPORTNAME}.wdn in ${OUTDIR}" >&1 
    119123 
    120124exit 0 
Note: See TracChangeset for help on using the changeset viewer.