void wizardDisk::populateDiskTree() { QStringList tmpList, zMnts; QString tmp, opts; treeMounts->clear(); treeMounts->setHeaderLabels(QStringList() << "ID" << tr("ZFS Mounts") << tr("ZFS Options") ); treeMounts->setColumnCount(3); labelFreeSpace->setVisible(false); lineFreeMB->setVisible(false); pushSizeMount->setVisible(false); treeMounts->header()->setSectionHidden(0, true); treeMounts->header()->setDefaultSectionSize(150); zMnts = sysFinalDiskLayout.at(0).at(2).split(","); // Now loop through ZFS mounts for (int i=0; i < zMnts.count(); ++i) { tmpList.clear(); opts = zMnts.at(i).section("(", 1, 1).section(")", 0, 0); tmpList << tmp.setNum(i+1) << zMnts.at(i).split("(").at(0) << opts ; QTreeWidgetItem *mItem = new QTreeWidgetItem(treeMounts, tmpList); mItem->setToolTip(2, opts); } treeMounts->setCurrentItem(treeMounts->findItems("0", Qt::MatchFixedString).at(0)); slotTreeDiskChanged(); }
void wizardDisk::populateDiskTree() { QStringList tmpList, zMnts; QString tmp, opts; // If installing to Free Space, show the option to change partition size labelNewPartition->setVisible(false); spinNewPartition->setVisible(false); spinNewPartition->setRange(0, 0); spinNewPartition->setValue(0); if ( comboPartition->currentIndex() != 0 && comboPartition->currentText().contains("Unused") ) { spinNewPartition->setRange(5000, this->getDiskSliceSize()); spinNewPartition->setValue(getDiskSliceSize()); labelNewPartition->setVisible(true); spinNewPartition->setVisible(true); } treeMounts->clear(); treeMounts->setHeaderLabels(QStringList() << "ID" << tr("ZFS Mounts") << tr("ZFS Options") ); treeMounts->setColumnCount(3); labelFreeSpace->setVisible(false); lineFreeMB->setVisible(false); treeMounts->header()->setSectionHidden(0, true); treeMounts->header()->setDefaultSectionSize(150); zMnts = sysFinalDiskLayout.at(0).at(2).split(","); // Now loop through ZFS mounts for (int i=0; i < zMnts.count(); ++i) { tmpList.clear(); opts = zMnts.at(i).section("(", 1, 1).section(")", 0, 0); tmpList << tmp.setNum(i+1) << zMnts.at(i).split("(").at(0) << opts ; QTreeWidgetItem *mItem = new QTreeWidgetItem(treeMounts, tmpList); mItem->setToolTip(2, opts); } treeMounts->setCurrentItem(treeMounts->findItems("0", Qt::MatchFixedString).at(0)); slotTreeDiskChanged(); if ( restoreMode ) { treeMounts->setEnabled(false); pushRemoveMount->setEnabled(false); pushAddMount->setEnabled(false); labelMounts->setText(tr("The original system datasets / mount-points will be automatically restored.")); } }