NodePanel::NodePanel(QWidget* parent) : rviz::Panel(parent) { doOnce = true; start = time(0); curThread = -1; myThreads.reserve(10); QHBoxLayout* topic_layout = new QHBoxLayout; QDir recoredDir("../../devel/lib/igvc/"); QStringList allFiles = recoredDir.entryList( QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst); output_topic_editor_ = new QComboBox(); for (int i = 0; i < allFiles.size(); i++) { output_topic_editor_->addItem(allFiles[i]); } topic_layout->addWidget(output_topic_editor_); m_button = new QPushButton("Launch", this); m_button->setGeometry(QRect(QPoint(100, 100), QSize(200, 50))); topic_layout->addWidget(m_button); close_btn = new NumButton("Close", this); close_btn->setGeometry(QRect(QPoint(100, 100), QSize(200, 50))); topic_layout->addWidget(close_btn); connect(m_button, SIGNAL(released()), this, SLOT(handleButton())); layout = new QVBoxLayout; layout->addLayout(topic_layout); setLayout(layout); }
void MainWindow::on_folderPushButton_clicked() { QFileDialog folderDlg; folder = folderDlg.getExistingDirectory(0,"Caption",QString(),QFileDialog::ShowDirsOnly); ui->folderLineEdit->setText(folder); QDir recoredDir(folder); allFiles = recoredDir.entryList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst); videos = allFiles.filter(format,Qt::CaseSensitive); ui->joinPushButton->setEnabled(true); }
QStringList Helpers::getListOfDirs(const QString directory) const { QDir recoredDir(directory); const QStringList allDirNames = recoredDir.entryList(QDir::NoDotAndDotDot | QDir::Dirs); QStringListIterator iter(allDirNames); QStringList allDirs; while (iter.hasNext()) allDirs.append(directory + "/" + iter.next() + "/"); return allDirs; }
WideGraph::WideGraph(QSettings * settings, QWidget *parent) : QDialog(parent), ui(new Ui::WideGraph), m_settings (settings) { ui->setupUi(this); setWindowTitle ("Wide Graph"); setWindowFlags (Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint); setMaximumWidth (MAX_SCREENSIZE); setMaximumHeight (880); ui->widePlot->setCursor(Qt::CrossCursor); ui->widePlot->setMaximumHeight(800); ui->widePlot->m_bCurrent=false; connect(ui->widePlot, SIGNAL(freezeDecode1(int)),this, SLOT(wideFreezeDecode(int))); connect(ui->widePlot, SIGNAL(setFreq1(int,int)),this, SLOT(setFreq2(int,int))); //Restore user's settings m_settings->beginGroup("WideGraph"); restoreGeometry (m_settings->value ("geometry", saveGeometry ()).toByteArray ()); ui->widePlot->setPlotZero(m_settings->value("PlotZero", 0).toInt()); ui->widePlot->setPlotGain(m_settings->value("PlotGain", 0).toInt()); ui->zeroSpinBox->setValue(ui->widePlot->getPlotZero()); ui->gainSpinBox->setValue(ui->widePlot->getPlotGain()); int n = m_settings->value("FreqSpan",2).toInt(); int w = m_settings->value("PlotWidth",1000).toInt(); m_bFlatten=m_settings->value("Flatten",true).toBool(); ui->cbFlatten->setChecked(m_bFlatten); ui->widePlot->m_w=w; ui->freqSpanSpinBox->setValue(n); ui->widePlot->setNSpan(n); m_waterfallAvg = m_settings->value("WaterfallAvg",5).toInt(); ui->waterfallAvgSpinBox->setValue(m_waterfallAvg); ui->widePlot->m_bCurrent=m_settings->value("Current",false).toBool(); ui->widePlot->m_bCumulative=m_settings->value("Cumulative",true).toBool(); ui->widePlot->m_bLinearAvg=m_settings->value("LinearAvg",false).toBool(); if(ui->widePlot->m_bCurrent) ui->spec2dComboBox->setCurrentIndex(0); if(ui->widePlot->m_bCumulative) ui->spec2dComboBox->setCurrentIndex(1); if(ui->widePlot->m_bLinearAvg) ui->spec2dComboBox->setCurrentIndex(2); int nbpp=m_settings->value("BinsPerPixel",2).toInt(); ui->widePlot->setBinsPerPixel(nbpp); ui->widePlot->setStartFreq(m_settings->value("StartFreq",0).toInt()); ui->fStartSpinBox->setValue(ui->widePlot->startFreq()); m_waterfallPalette=m_settings->value("WaterfallPalette","Default").toString(); int m_fMin = m_settings->value ("fMin", 2500).toInt (); ui->fMinSpinBox->setValue (m_fMin); setRxRange (m_fMin); m_settings->endGroup(); QDir recoredDir("Palettes"); QStringList allFiles = recoredDir.entryList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst); int index=0; foreach(QString file, allFiles) { QString t=file.mid(0,file.length()-4); ui->paletteComboBox->addItem(t); if(t==m_waterfallPalette) { ui->paletteComboBox->setCurrentIndex(index); } index++; }
// Creates an index.html showing all containing files and folders for the folder/path submitted to the method void MainWindow::createSingleHTMLIndex(QString currentPath, QString targetFolder) { // write log ui->textEdit->moveCursor (QTextCursor::End); newTimestampString = generateTimestampString(); ui->textEdit->insertPlainText ("\n"+newTimestampString+ "- Indexing: "+currentPath+"\n"); QString filename=targetFolder+"/index.html"; QFile file( filename ); if ( file.open(QIODevice::ReadWrite) ) { QDir recoredDir(currentPath); QStringList allFolders = recoredDir.entryList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs); //(QDir::Filter::Files,QDir::SortFlag::NoSort) //QStringList allFiles = recoredDir.entryList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::Files); //(QDir::Filter::Files,QDir::SortFlag::NoSort) // Create file QTextStream stream( &file ); // deleting the former content file.write(""); file.resize(file.pos()); // write the new content stream << "<!DOCTYPE html>\n"; stream << "<head>\n"; stream << "<meta charset='UTF-8'>"; stream << "<title>DirGister</title>\n"; stream << "<link rel='shortcut icon'' type='image/png'' href='https://raw.githubusercontent.com/yafp/dirgister/master/dirgister.ico'/>\n"; stream << "<script src='//code.jquery.com/jquery-1.11.3.min.js'></script>\n"; stream << "<link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css'>\n"; stream << "<style>"; stream << "body { margin:0px; color: DimGray;}"; stream << "h1 { margin-top: 0;}"; stream << "h2 { color: DimGray; font-size: 20; border-bottom: solid 2px DimGray; padding-bottom: 6px;}"; stream << "h3 { color: DimGray; font-size: 8;}"; stream << "a { color: DimGray; text-decoration: none;}"; stream << "a:visited { color: DimGray;}"; stream << "#header { background-color: Gainsboro; color: DimGray; padding: 15px; margin-top: 0px; a{ color: DimGray;} }"; stream << "#content {padding-left: 10px; padding-right: 10px; }"; stream << "</style>"; stream << "</head>\n"; stream << "<body>\n"; stream << "<div id='header'>"; stream << "<h1><i class='fa fa-list-alt'></i> DirGister</h1>\n"; // run the following part only on the sub-pages if(srcFolder != currentPath) // on all sub-pages -> add a backlink-navigation to upper dir { stream << "<h3><a href='../index.html'><i class='fa fa-arrow-circle-left'></i></a> "+currentPath+"</h3>"; } else // main-page { stream << "<h3>"+currentPath+"</h3>"; } stream << "</div>"; // close header div stream << "<div id='content'>"; // Handle folders // if(allFolders.count() != 0) // found folders { stream << "<h2><i class='fa fa-folder'></i> Folders ("+QString::number(allFolders.count())+")</h2>\n"; QString newTarget; foreach (QString str, allFolders) { stream << "<a href='"; stream << QString("%1").arg(str)+"/index.html"; stream << "'><i class='fa fa-folder-o'></i> "; stream << QString("%1").arg(str); stream << "</a><br>"; newTarget = targetFolder+"/"+QString("%1").arg(str); QDir().mkdir(newTarget); // write log ui->textEdit->moveCursor (QTextCursor::End); newTimestampString = generateTimestampString(); ui->textEdit->insertPlainText (newTimestampString+ "- Found folder: "+str+"\n"); }
// // Cherche les maps disponible dans le répertoire QStringList Launcher::readDirectory(QString dir) { QDir recoredDir(dir); QStringList allMaps = recoredDir.entryList(QDir::NoDotAndDotDot | QDir::System | QDir::Hidden | QDir::AllDirs | QDir::Files, QDir::DirsFirst); return (allMaps); }