Ignore:
Timestamp:
08/26/13 11:44:54 (16 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, releng/10.1
Children:
2ac57ce
Parents:
da39501
Message:

Clean up the tooltip for the life preserver tray: will now list the latest snapshot for each managed dataset/zpool.
Also clean up the ordering of the available snapshots - they should always list in the proper chronological order for snapshots that life-preserver created, with an additional section at the end for any other snapshots that are available for that data subset.

File:
1 edited

Legend:

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

    r33a568a r539d8eb  
    5151  //List all the mountpoints in this dataset 
    5252  QStringList subsets = LPBackend::listDatasetSubsets(ds); 
     53  QStringList lpsnaps = LPBackend::listLPSnapshots(ds); 
    5354  //populate the list of snapshots available for each mountpoint 
    5455  for(int i=0; i<subsets.length(); i++){ 
     
    6162      i--; 
    6263    }else{ 
    63       DSC.subsetHash.insert(subsets[i],snaps); //add it to the internal container hash 
     64      QStringList subsnaps; 
     65      //only list the valid snapshots that life preserver created 
     66      for(int s=0; s<lpsnaps.length(); s++){ 
     67        int index = snaps.indexOf(lpsnaps[s]); 
     68        if(index > -1){ subsnaps << lpsnaps[s]; snaps.removeAt(index); } 
     69      } 
     70      //Now list all the other available snapshots (no certain ordering) 
     71      if(!snaps.isEmpty()){ 
     72        subsnaps << "--"; //so we know that this is a divider between the sections 
     73        subsnaps << snaps; 
     74      } 
     75      DSC.subsetHash.insert(subsets[i],subsnaps); //add it to the internal container hash 
    6476    } 
    6577  } 
     
    7688    DSC.latestSnapshot= ""; 
    7789  }else{ 
    78     QStringList fSnap = DSC.subsetHash[subsets[0]].filter("auto-"); //filtered snapshot list (just life preserver snapshots) 
    79     DSC.numberOfSnapshots = QString::number(fSnap.length()); 
    80     if(fSnap.isEmpty()){ DSC.latestSnapshot=""; } 
     90    DSC.numberOfSnapshots = QString::number(lpsnaps.length()); 
     91    if(lpsnaps.isEmpty()){ DSC.latestSnapshot=""; } 
    8192    else if(ci > -1 && ci < CLIST.length()){  
    8293      QString sna = CLIST[ci].section(":::",1,1); 
    8394      if(sna != "-"){ DSC.latestSnapshot= sna; } 
    8495      else{ DSC.latestSnapshot = ""; }       
    85     }else{ DSC.latestSnapshot=fSnap[0]; } 
     96    }else{ DSC.latestSnapshot=lpsnaps[0]; } 
    8697  } 
    8798  //List the replication status 
     
    186197        QMenu *menu = new QMenu(subsets[i],this); 
    187198        for(int s =0; s<snaps.length(); s++){ 
    188           QAction *act = new QAction(snaps[s],this); 
     199          if(snaps[s] == "--"){ menu->addSeparator(); } 
     200          else{ 
     201            QAction *act = new QAction(snaps[s],this); 
    189202                act->setWhatsThis(ds+":::"+subsets[i]+":::"+snaps[s]); 
    190           menu->addAction(act); 
     203            menu->addAction(act); 
     204          } 
    191205        } 
    192206        revMenu->addMenu(menu); 
Note: See TracChangeset for help on using the changeset viewer.