Changeset 4019f37


Ignore:
Timestamp:
09/20/13 11:44:47 (13 months ago)
Author:
Ken Moore <ken@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
5bd70b2
Parents:
a194d99
Message:

Commit my current work in progress for the new life preserver UI

Location:
src-qt4/life-preserver
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src-qt4/life-preserver/LPGUtils.h

    r4d597a9 r4019f37  
    1212class LPGUtils{ 
    1313public: 
    14          
    15 } 
     14        static LPDataset loadPoolData(QString zpool); //Load backend data into container 
     15 
     16}; 
    1617 
    1718#endif 
  • src-qt4/life-preserver/LPMain.cpp

    r4d597a9 r4019f37  
    5353//          PRIVATE 
    5454// ============== 
    55 LPDataset LPMain::loadPoolData(QString pool){ 
    56   //Load the current information for the given zpool 
    57   qDebug() << "New Dataset: " << ds; 
    58   LPDataset DSC; 
    59   //List all the mountpoints in this dataset 
    60   QStringList subsets = LPBackend::listDatasetSubsets(ds); 
    61   QStringList lpsnaps = LPBackend::listLPSnapshots(ds); 
    62   //populate the list of snapshots available for each mountpoint 
    63   for(int i=0; i<subsets.length(); i++){ 
    64     //qDebug() << "Subset:" << subsets[i]; 
    65     QStringList snaps = LPBackend::listSnapshots(subsets[i]); 
    66     //qDebug() << " - Snapshots:" << snaps; 
    67     if(snaps.isEmpty()){ 
    68       //invalid subset - remove it from the list 
    69       subsets.removeAt(i); 
    70       i--; 
    71     }else{ 
    72       QStringList subsnaps; 
    73       //only list the valid snapshots that life preserver created 
    74       for(int s=0; s<lpsnaps.length(); s++){ 
    75         int index = snaps.indexOf(lpsnaps[s]); 
    76         if(index > -1){ subsnaps << lpsnaps[s]; snaps.removeAt(index); } 
    77       } 
    78       //Now list all the other available snapshots (no certain ordering) 
    79       if(!snaps.isEmpty()){ 
    80         subsnaps << "--"; //so we know that this is a divider between the sections 
    81         subsnaps << snaps; 
    82       } 
    83       DSC.subsetHash.insert(subsets[i],subsnaps); //add it to the internal container hash 
    84     } 
    85   } 
    86   //Get the time for the latest life-preserver snapshot (and total number) 
    87   //Find the index for the current list 
    88   int ci = 0; 
    89   while(ci < CLIST.length()){ 
    90     if(CLIST[ci].startsWith(ds+":::")){ break; } 
    91     else{ ci++; } 
    92   } 
    93   if(CLIST.isEmpty()){ ci = -1; } //catch for empty list 
    94   if(DSC.subsetHash.size() < 1){ 
    95     DSC.numberOfSnapshots = "0"; 
    96     DSC.latestSnapshot= ""; 
    97   }else{ 
    98     DSC.numberOfSnapshots = QString::number(lpsnaps.length()); 
    99     if(lpsnaps.isEmpty()){ DSC.latestSnapshot=""; } 
    100     else if(ci > -1 && ci < CLIST.length()){  
    101       QString sna = CLIST[ci].section(":::",1,1); 
    102       if(sna != "-"){ DSC.latestSnapshot= sna; } 
    103       else{ DSC.latestSnapshot = ""; }       
    104     }else{ DSC.latestSnapshot=lpsnaps[0]; } 
    105   } 
    106   //List the replication status 
    107   if(RLIST.contains(ds) && (ci > -1)){  
    108     QString rep = CLIST[ci].section(":::",2,2); 
    109     if(rep != "-"){ DSC.latestReplication = rep; } 
    110     else{ DSC.latestReplication= tr("Enabled"); } 
    111   }else{  
    112     DSC.latestReplication= tr("Disabled"); 
    113   } 
    114   //Return the dataset 
    115   return DSC; 
    116 } 
    11755 
    11856 
     
    13977  ui->action_SaveKeyToUSB->setEnabled(poolSelected); 
    14078  if(poolSelected){ 
    141     POOLDATA = loadPoolData(ui->combo_pools->currentText()); 
     79    POOLDATA = LPGUtils::loadPoolData(ui->combo_pools->currentText()); 
    14280    //Now list the status information 
    14381           
  • src-qt4/life-preserver/lPreserve.qrc

    r9a67431 r4019f37  
    11<RCC> 
    22  <qresource> 
     3    <file>images/next.png</file> 
     4    <file>images/previous.png</file> 
     5    <file>images/view.png</file> 
    36    <file>images/camera_add.png</file> 
    47    <file>images/upload.png</file> 
Note: See TracChangeset for help on using the changeset viewer.