Changes in / [59f367e:33f74f7]


Ignore:
Location:
src-qt4/life-preserver
Files:
2 added
4 edited

Legend:

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

    r845aaf6 r284b216  
    316316} 
    317317 
     318// ====================== 
     319//          Device Management 
     320// ====================== 
     321QStringList LPBackend::listDevices(){ 
     322  //Scan the system for all valid da* and ada* devices (USB/SCSI, SATA) 
     323  //Return format: "<device node> (<device information>)" 
     324  QDir devDir("/dev"); 
     325  QStringList devs = devDir.entryList(QStringList() << "da*"<<"ada*", QDir::System | QDir::NoSymLinks, QDir::Name); 
     326  QStringList camOut = LPBackend::getCmdOutput("camcontrol devlist"); 
     327  QStringList output, flist;     
     328  for(int i=0; i<devs.length(); i++){ 
     329    flist = camOut.filter("("+devs[i]+","); 
     330    //still need to add an additional device filter to weed out devices currently in use. 
     331    if(!flist.isEmpty()){ output << devs[i] + " ("+flist[0].section(">",0,0).remove("<").simplified()+")"; } 
     332  } 
     333  return output; 
     334} 
     335 
     336bool LPBackend::isMounted(QString device){ 
     337  qDebug() << "Device mount check not implemented yet"; 
     338  return false; 
     339} 
     340 
     341bool LPBackend::unmountDevice(QString device){ 
     342  qDebug() << "Device unmounting not implemented yet"; 
     343  return false; 
     344} 
    318345 
    319346// ========================= 
  • src-qt4/life-preserver/LPBackend.h

    r845aaf6 r284b216  
    3838        static QStringList findValidUSBDevices(); 
    3939        static bool copySSHKey(QString mountPath, QString localHost); 
     40        //Device Management 
     41        static QStringList listDevices(); 
     42        static bool isMounted(QString device); 
     43        static bool unmountDevice(QString device); 
     44        //Mirroring Management 
     45 
    4046         
    4147private: 
  • src-qt4/life-preserver/mainUI.cpp

    raac7789e r284b216  
    490490} 
    491491 
    492  
    493492// ============= 
    494493//      PROTECTED 
  • src-qt4/life-preserver/mainUI.ui

    r9a67431 r284b216  
    241241   </property> 
    242242  </action> 
     243  <action name="actionMirrorDataset"> 
     244   <property name="icon"> 
     245    <iconset resource="lPreserve.qrc"> 
     246     <normaloff>:/images/drive-removable-media.png</normaloff>:/images/drive-removable-media.png</iconset> 
     247   </property> 
     248   <property name="text"> 
     249    <string>Mirror Dataset to USB</string> 
     250   </property> 
     251  </action> 
    243252 </widget> 
    244253 <resources> 
Note: See TracChangeset for help on using the changeset viewer.