RuleConditionDynamic::RuleConditionDynamic( Device * deviceLeft, const std::string & memberLeft, Device * deviceRight, const std::string & memberRight, const Operator * op ) { setDevices(deviceLeft,deviceRight); setMemberIdentifiers(memberLeft,memberRight); setOperator(op); }
// INITIALIZE THE DEVICE LIST WITH THE DISKS AVAILABLE FOR USE void DialogNewPool::setDevices(QList<vdev_t> *disks) { QList<vdev_t>::const_iterator it=disks->constBegin(); while(it!=disks->constEnd()) { // DETERMINE IF THE DEVICE IS AVAILABLE if((*it).Partitions.count()!=0) { // DISK IS NOT AVAILABLE, CHECK PARTITIONS RECURSIVELY setDevices((QList<vdev_t> *)&((*it).Partitions)); } else { if((*it).PartType=="freebsd-zfs" && (*it).InPool.isEmpty()) { // THIS IS AN EMPTY ZFS PARTITION QTreeWidgetItem *item=new QTreeWidgetItem(ui->vdevList); QString sz; sz=" ("+printBytes((*it).Size)+")"; item->setText(0,(*it).Name+sz+"\n[freebsd-zfs]"); item->setText(1," "); item->setData(0,Qt::UserRole,(*it).Name); item->setIcon(0,QIcon(":/icons/kdf.png")); item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); item->setCheckState(1,Qt::Unchecked); } else { if((*it).PartType.isEmpty() && (*it).InPool.isEmpty() && (*it).Size!=0) { // THIS IS AN EMPTY DISK QTreeWidgetItem *item=new QTreeWidgetItem(ui->vdevList); QString sz; sz=" ("+printBytes((*it).Size)+")"; if(!(*it).PartType.isEmpty()) { sz+=" [" + (*it).PartType + "]"; } sz+="\n"; item->setText(0,(*it).Name + sz + (*it).Description); item->setText(1," "); item->setData(0,Qt::UserRole,(*it).Name); item->setIcon(0,QIcon(":/icons/drive-harddisk.png")); item->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); item->setCheckState(1,Qt::Unchecked); } } } ++it; } Vdevcount=0; }
void Config::showDisabled(bool show) { qDebug() << "[Config] disabled targets shown:" << show; if(show) QMessageBox::warning(this, tr("Showing disabled targets"), tr("You just enabled showing targets that are marked disabled. " "Disabled targets are not recommended to end users. Please " "use this option only if you know what you are doing.")); setDevices(); }
BOOL CRaidAnalyzerDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX); ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE); if (pSysMenu != NULL) { BOOL bNameValid; CString strAboutMenu; bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX); ASSERT(bNameValid); if (!strAboutMenu.IsEmpty()) { pSysMenu->AppendMenu(MF_SEPARATOR); pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu); } } SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon m_TabDialogs->InsertItem(0,_T("Parity Check")); //m_TabDialogs->InsertItem(1,_T("MAIN DIALOG")); //m_TabDialogs->InsertItem(2,_T("Speed Test HDD")); m_TabDialogs->Init(); //CDiskFactory diskfactory; //IDevice *pDevice = new CDiskDevice(); // //= diskfactory.CreateDevice(); //CDiviceList devList; //devList.AddDevice(pDevice); //devList.RemoveAll(); ////delete pDevice; //pDevice->SetNumber(10); //if (pDevice != NULL) // delete pDevice; //m_TabDialogs->InsertItem(0,_T("Parity Check")); //m_TabDialogs->Init(); //IDevice *pDevice = new CDiskDevice(); //pDevice->SetBytesPerSector(512); //delete pDevice; m_Drives.getDiskNames(); m_pListDrives = static_cast<CListCtrl*> ( GetDlgItem ( IDC_LIST_DRIVES ) ); setDevices(m_pListDrives,&m_Drives,m_vecDrives); m_pListSelected = static_cast<CListBox*> ( GetDlgItem ( IDC_SELECTED_LIST ) ); m_pEditReport = static_cast < CEdit *> ( GetDlgItem ( IDC_EDIT_PARITY_LOG ) ); m_pEditReport->SetLimitText(UINT_MAX); m_ReportLog = new CLog(_T("Parity Check"),m_pEditReport); //m_TabDialogs.m_pParityDlg->setLog(m_ReportLog); m_pEditMinLBA = static_cast < CEdit *> ( GetDlgItem ( IDC_MIN_LBA ) ); m_pEditMinLBA->SetWindowTextW(_T("0")); m_pEditMaxLBA = static_cast < CEdit *> ( GetDlgItem ( IDC_MAX_LBA ) ); m_pEditMaxLBA->SetWindowTextW(_T("1000")); m_dwProgressPos = 0; m_MainProgress.SetRange(0,PROGRESS_COUNT); m_MainProgress.SetStep(1); //pCuttingDialog = new CCuttingSectorsDlg(this); //pCuttingDialog->Create(CCuttingSectorsDlg::IDD); return TRUE; // return TRUE unless you set the focus to a control }
Config::Config(QWidget *parent,int index) : QDialog(parent) { programPath = qApp->applicationDirPath() + "/"; ui.setupUi(this); ui.tabConfiguration->setCurrentIndex(index); ui.radioManualProxy->setChecked(true); QRegExpValidator *proxyValidator = new QRegExpValidator(this); QRegExp validate("[0-9]*"); proxyValidator->setRegExp(validate); ui.proxyPort->setValidator(proxyValidator); // build language list and sort alphabetically QStringList langs = findLanguageFiles(); for(int i = 0; i < langs.size(); ++i) lang.insert(languageName(langs.at(i)) + QString(" (%1)").arg(langs.at(i)), langs.at(i)); lang.insert(DEFAULT_LANG, DEFAULT_LANG_CODE); QMap<QString, QString>::const_iterator i = lang.constBegin(); while (i != lang.constEnd()) { ui.listLanguages->addItem(i.key()); i++; } ComboBoxViewDelegate *delegate = new ComboBoxViewDelegate(this); ui.mountPoint->setItemDelegate(delegate); #if !defined(DBG) ui.mountPoint->setEditable(false); #endif ui.listLanguages->setSelectionMode(QAbstractItemView::SingleSelection); ui.proxyPass->setEchoMode(QLineEdit::Password); ui.treeDevices->setAlternatingRowColors(true); ui.listLanguages->setAlternatingRowColors(true); /* Explicitly set some widgets to have left-to-right layout */ ui.treeDevices->setLayoutDirection(Qt::LeftToRight); ui.mountPoint->setLayoutDirection(Qt::LeftToRight); ui.proxyHost->setLayoutDirection(Qt::LeftToRight); ui.proxyPort->setLayoutDirection(Qt::LeftToRight); ui.proxyUser->setLayoutDirection(Qt::LeftToRight); ui.proxyPass->setLayoutDirection(Qt::LeftToRight); ui.listLanguages->setLayoutDirection(Qt::LeftToRight); ui.cachePath->setLayoutDirection(Qt::LeftToRight); ui.comboTts->setLayoutDirection(Qt::LeftToRight); this->setModal(true); connect(ui.buttonOk, SIGNAL(clicked()), this, SLOT(accept())); connect(ui.buttonCancel, SIGNAL(clicked()), this, SLOT(abort())); connect(ui.radioNoProxy, SIGNAL(toggled(bool)), this, SLOT(setNoProxy(bool))); connect(ui.radioSystemProxy, SIGNAL(toggled(bool)), this, SLOT(setSystemProxy(bool))); connect(ui.refreshMountPoint, SIGNAL(clicked()), this, SLOT(refreshMountpoint())); connect(ui.buttonAutodetect,SIGNAL(clicked()),this,SLOT(autodetect())); connect(ui.buttonCacheBrowse, SIGNAL(clicked()), this, SLOT(browseCache())); connect(ui.buttonCacheClear, SIGNAL(clicked()), this, SLOT(cacheClear())); connect(ui.configTts, SIGNAL(clicked()), this, SLOT(configTts())); connect(ui.configEncoder, SIGNAL(clicked()), this, SLOT(configEnc())); connect(ui.comboTts, SIGNAL(currentIndexChanged(int)), this, SLOT(updateTtsState(int))); connect(ui.treeDevices, SIGNAL(itemSelectionChanged()), this, SLOT(updateEncState())); connect(ui.testTTS,SIGNAL(clicked()),this,SLOT(testTts())); connect(ui.showDisabled, SIGNAL(toggled(bool)), this, SLOT(showDisabled(bool))); connect(ui.mountPoint, SIGNAL(editTextChanged(QString)), this, SLOT(updateMountpoint(QString))); connect(ui.mountPoint, SIGNAL(currentIndexChanged(int)), this, SLOT(updateMountpoint(int))); // delete this dialog after it finished automatically. connect(this, SIGNAL(finished(int)), this, SLOT(deleteLater())); setUserSettings(); setDevices(); }