Example #1
0
// =====================
// ===== PRIVATE SLOTS =====
// =====================
//UI update functions
void mainUI::updateBEList(){
  ui->tree_BE->clear();
  QStringList blist = beadmList();
  for(int i=0; i<blist.length(); i++){
    //List all the data <name>::<isrunning>::<isactivated>::<mountpoint>::<space>::<datecreated>::<timecreated>
    QStringList cols;
      cols << blist[i].section("::",0,0); // [0] name
      cols << blist[i].section("::",1,1); // [1] is running
      cols << blist[i].section("::",2,2); // [2] is default for next boot
      //Don't use GRUB default BE setting - this is itself part of a boot environment and might not be globally correct
      if(G_defaultBE != i){ G_defaultBE = i; }
      cols << blist[i].section("::",5,6); // [3] date
      cols << blist[i].section("::",3,3); // [4] mountpoints
      cols << blist[i].section("::",4,4); // [5] size
    //Create the new treewidgetitem
    QTreeWidgetItem *item = new QTreeWidgetItem(cols);
	  
    //Add the item to the list
    ui->tree_BE->addTopLevelItem(item);
    //qDebug() << "BE Item:" << cols;
  }
  //Now re-size the columns appropriately
  for(int i=0; i<6; i++){ ui->tree_BE->resizeColumnToContents(i); }
}
Example #2
0
// =====================
// ===== PRIVATE SLOTS =====
// =====================
//UI update functions
void mainUI::updateBEList(){
  ui->tree_BE->clear();
  QStringList blist = beadmList();
  for(int i=0; i<blist.length(); i++){
    //List all the data <name>::<isrunning>::<isactivated>::<mountpoint>::<space>::<datecreated>::<timecreated>
    QStringList cols;
      cols << blist[i].section("::",0,0); // [0] name
      cols << blist[i].section("::",1,1); // [1] is running
      // [2] is default for next boot
      if(G_defaultBE == i){ cols << "Yes"; }
      else{ cols << "No"; }
      cols << blist[i].section("::",5,6); // [3] date
      cols << blist[i].section("::",3,3); // [4] mountpoints
      cols << blist[i].section("::",4,4); // [5] size
    //Create the new treewidgetitem
    QTreeWidgetItem *item = new QTreeWidgetItem(cols);
	  
    //Add the item to the list
    ui->tree_BE->addTopLevelItem(item);
    //qDebug() << "BE Item:" << cols;
  }
  //Now re-size the columns appropriately
  for(int i=0; i<6; i++){ ui->tree_BE->resizeColumnToContents(i); }
}