Changes in / [aad2985:e5bf1b4a]


Ignore:
Location:
src-qt4
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/life-preserver/LPWatcher.cpp

    rb5a7675 r23f66b8  
    331331            LOGS.insert(60,"RUNNING"); 
    332332            LOGS.insert(61,pool); 
    333             LOGS.insert(62, QString(tr("Resilvering: %1")).arg(percent) ); 
    334             LOGS.insert(63, QString(tr("Resilvering: %1 (%2 remaining)")).arg(percent, remain) ); 
     333            LOGS.insert(62, QString(tr("Scrubbing: %1 (%2 remaining)")).arg(percent, remain) ); 
     334            LOGS.insert(63, QString(tr("Scrubbing: %1 (%2 remaining)")).arg(percent, remain) ); 
    335335            LOGS.insert(64, timestamp); 
    336336            LOGS.insert(65, timestamp.section(" ",3,3) ); 
     
    338338          } 
    339339          if(isnew){ emit MessageAvailable("scrub"); } 
    340           if(LOGS.value(50) == "RUNNING"){ 
    341             //Resilvering is done - remove the info and send a ping 
    342             LOGS.insert(50,"FINISHED"); 
    343             LOGS.insert(51,pool); 
    344             LOGS.insert(52, tr("Resilvering complete")); 
    345             LOGS.insert(53, tr("Resilvering completed successfully")); 
    346             LOGS.insert(54, timestamp); 
    347             LOGS.insert(55, timestamp.section(" ",3,3) ); 
    348             emit MessageAvailable("resilvering"); 
     340          if(LOGS.contains(50) ){ 
     341            //Only resilvering OR scrub is shown at a time - so remove the resilver info 
     342            LOGS.remove(50); 
     343            LOGS.remove(51); 
     344            LOGS.remove(52); 
     345            LOGS.remove(53); 
     346            LOGS.remove(54); 
     347            LOGS.remove(55); 
    349348          } 
    350349        // --------- RESILVERING ------- 
    351         }else if(zstat[i].contains("resilver")){ 
     350        }else if(zstat[i].contains("resilver in progress")){ 
     351          //Resilvering is currently running 
     352          timestamp = zstat[i].section(" ",5,9,QString::SectionSkipEmpty); 
     353          //need info from the next two lines 
     354          i++; QString timeleft = zstat[i].section(" ",7,7,QString::SectionSkipEmpty); 
     355          i++; QString percent = zstat[i].section(" ", 2,2,QString::SectionSkipEmpty); 
    352356          //Setup the running re-silvering progress 
    353           if(LOGS.value(50)!= " " && LOGS.value(50)!="RUNNING"){newresilver=true; } 
     357          if(LOGS.value(50)!="RUNNING"){newresilver=true; } 
    354358          LOGS.insert(50, "RUNNING"); 
    355359          // 51 - need to put the actual device in here (not available on this line) 
    356           LOGS.insert(52, tr("Resilvering in progress")); 
    357           if(newresilver){ LOGS.insert(53, tr("Resilvering started") ); } 
    358           else{ LOGS.insert(53, tr("Resilvering in progress")); } 
     360          LOGS.insert(52, QString(tr("Resilvering: %1 (%2 remaining)")).arg(percent, timeleft) ); 
     361          if(newresilver){ LOGS.insert(53, QString(tr("Resilvering Started: %1 remaining ")).arg( timeleft) ); } 
     362          else{ LOGS.insert(53,QString(tr("Resilvering: %1 (%2 remaining)")).arg(percent, timeleft) ); } 
    359363          LOGS.insert(54, timestamp); 
    360364          LOGS.insert(55, timestamp.section(" ",3,3) ); 
    361           if(isnew){ emit MessageAvailable("resilvering"); } 
     365          if(LOGS.contains(60) ){ 
     366            //Only resilvering OR scrub is shown at a time - so remove the scrub info 
     367            LOGS.remove(60); 
     368            LOGS.remove(61); 
     369            LOGS.remove(62); 
     370            LOGS.remove(63); 
     371            LOGS.remove(64); 
     372            LOGS.remove(65); 
     373          } 
     374        }else if(zstat[i].contains("resilvered")){ 
     375          //Resilvering is finished 
     376          timestamp = zstat[i].section(" ",9,13,QString::SectionSkipEmpty); 
     377          QString timecomplete = zstat[i].section(" ",4,4,QString::SectionSkipEmpty); 
     378          QString errors = zstat[i].section(" ", 6,6,QString::SectionSkipEmpty); 
     379          //Setup the running re-silvering progress 
     380          if(LOGS.value(50)!= " "){newresilver=true; } //don't display message for first run 
     381          if(errors.toInt() > 0){  
     382            LOGS.insert(50, "ERROR"); 
     383            LOGS.insert(52, QString(tr("Resilver completed in &1 with %2 errors")).arg(timecomplete, errors) ); 
     384            LOGS.insert(53, QString(tr("Resilver completed in &1 with %2 errors")).arg(timecomplete, errors) ); 
     385          }else{ 
     386            LOGS.insert(50, "FINISHED"); 
     387            LOGS.insert(52, QString(tr("Resilver completed successfully in &1")).arg(timecomplete) ); 
     388            LOGS.insert(53, QString(tr("Resilver completed successfully in &1")).arg(timecomplete) );  
     389          } 
     390          // 51 - need to put the actual device in here (not available on this line) 
     391          LOGS.insert(54, timestamp); 
     392          LOGS.insert(55, timestamp.section(" ",3,3) ); 
     393          if(LOGS.contains(60) ){ 
     394            //Only resilvering OR scrub is shown at a time - so remove the scrub info 
     395            LOGS.remove(60); 
     396            LOGS.remove(61); 
     397            LOGS.remove(62); 
     398            LOGS.remove(63); 
     399            LOGS.remove(64); 
     400            LOGS.remove(65); 
     401          } 
    362402        } 
    363403      }else if(zstat[i].startsWith("errors:")){ 
     
    365405          qDebug() << "New zpool status error line that needs parsing:" << zstat[i]; 
    366406        } 
    367       }else if( state != "ONLINE" ){ 
     407      }else if( state != "ONLINE" || !LOGS.value(50).isEmpty() ){ 
    368408        //Check for state/resilvering of all real devices 
    369409        if(zstat[i].contains("NAME\tSTATE\tREAD")){continue;} //nothing on this header line 
  • src-qt4/pc-mounttray/mountTray.cpp

    rb3ee7b3 r74b4950  
    2121  MTINIT=true; //set the flag that the mount tray is initializing; 
    2222  getInitialUsername(); //try to detect the non-root user who is running the program with root permissions 
     23  getFileManager(); 
     24     
    2325  loadSavedSettings(); 
    2426   
     
    287289} 
    288290 
     291void MountTray::getFileManager(){ 
     292  //Check for broken DE's that need a FM manually set 
     293  FMCMD = "xdg-open"; //the default auto-detection application 
     294    QStringList DEI = pcbsd::Utils::runShellCommand("de-info"); 
     295    QStringList broken; broken << "LXDE"; 
     296    for(int i=0; i<DEI.length(); i++){ 
     297      if(DEI[i].contains("DE name:")){ //this is always at the top of the output 
     298        QString DE = DEI[i].section(":",1,1).simplified(); 
     299        qDebug() << "-Desktop Detected:" << DE; 
     300        if( !broken.contains( DE ) ){ break; } //this DE is fine 
     301      }else if(DEI[i].contains("File manager:")){ 
     302        FMCMD = DEI[i].section(":",1,1).section(" ",0,0, QString::SectionSkipEmpty).simplified(); 
     303        break; 
     304      } 
     305    } 
     306  qDebug() << "-File Manager:" << FMCMD; 
     307} 
    289308void MountTray::slotOpenMediaDir(){ 
    290309  openMediaDir(MOUNTDIR); 
     
    303322  //Open the default file manager to the given directory as that user 
    304323  qDebug() << "Opening the media directory with user permissions"; 
    305   QString cmd = "su -m "+USERNAME+" -c \"xdg-open \'"+dir+"\' \""; 
     324  QString cmd = "su -m "+USERNAME+" -c \""+FMCMD+" \'"+dir+"\' \""; 
    306325  if(DEBUG_MODE){ qDebug() << " -cmd:" << cmd ; } 
    307326  cmd.prepend("("); cmd.append(") &"); 
  • src-qt4/pc-mounttray/mountTray.h

    r11b9eef r74b4950  
    7575  bool MTINIT; 
    7676 
     77  //CMD to use for opening the file manager 
     78  QString FMCMD; 
     79 
    7780  void updateMenu(); 
    7881  void scanInitialDevices(); 
     
    8184  void startupDevdProc(); 
    8285  void getInitialUsername(); 
     86  void getFileManager(); 
    8387  void loadSavedSettings(); 
    8488  void saveCurrentSettings(); 
Note: See TracChangeset for help on using the changeset viewer.