Пример #1
0
void DialogConfigBooks::on_toolButtonOPenGroup_clicked()
{
    QFileDialog dlg;
QString homeDir=QDir::homePath () ;
    QString fn = dlg.getOpenFileName(0, tr("Open xml Files..."),
                                              homeDir   , trUtf8("ملف قائمة الكتب (group.xml );;xml (group.xml)"));
   qDebug()<<fn;
    if(!dlg.AcceptOpen)
     //   return;

    if (!fn.isEmpty())
    {

        QString groupPath=QDir::homePath()+"/.kirtasse/data/group.xml";
        QString groupPathNew=QDir::homePath()+"/.kirtasse/data/group.xml.old";
        QFile file;
        if(file.exists(groupPathNew))
            file.remove(groupPathNew);

        if(file.rename(groupPath,groupPathNew)) {
            if(file.copy(fn,groupPath)){
                Messages->treeChargeGroupe( ui->treeWidgetBooks,0,true);
                     ui->lineEditGroup->setText(fn);
                     ui->toolButtonGroupUpdat->setEnabled(true);
            }
        }
        if(ui->treeWidgetBooks->topLevelItemCount()<1)
           on_toolButtonGroupUpdat_clicked();
    }
}
void FastQSPWindow::loadGameDialog() {
  QFileDialog dlg;
  QString filename = dlg.getOpenFileName(
      this, "Load Game", saveDir.absolutePath(), "QSP save-game (*.sav)");
  if (!filename.isEmpty())
    loadGame(filename);
}
Пример #3
0
void FreeEMS_Loader::openFile() {

	QSettings loaderSettings(settingsFile, QSettings::IniFormat);
	loadDirectory = loaderSettings.value("lastDirectory").toString();
	QFileDialog fileDialog;
	fileDialog.setViewMode(QFileDialog::Detail);
	fileDialog.restoreGeometry(loaderSettings.value("lastOpenDialogGeo").toByteArray());
	QString qSNum;
	loadFileName = fileDialog.getOpenFileName(this, tr("Load s19 file"), loadDirectory, tr("s19 (*.s19)"));
	loaderSettings.setValue("lastOpenDialogGeo", fileDialog.saveGeometry());
	if (loadFileName.isNull()) {
		displayMessage(MESSAGE_ERROR, "no file selected");
		return;
	} else{
		loaderSettings.setValue("lastDirectory", loadFileName);
		loaderComms->setLoadFilename(loadFileName);
		displayMessage(MESSAGE_INFO,"Attempting to parse " + loadFileName);
		loaderComms->parseFile();
		if(loaderComms->numLoadableRecords() == 0){
			displayMessage(MESSAGE_ERROR, "no load-able records parsed");
		}else if(loaderComms->numBadSums()){
			displayMessage(MESSAGE_ERROR, "there are " + qSNum.setNum(loaderComms->numBadSums(), 10) + " records with bad checksums or lengths , loading will be disabled");
		} else {
			displayMessage(MESSAGE_INFO,"found " + 	qSNum.setNum(loaderComms->numLoadableRecords(), 10) +" load-able records in file");
			ui.pushLoad->setEnabled(true);
			m_fileLoaded = true;
		}
	}
}
void milxQtRegistrationAdvancedOptions::browseBtnClicked()
{
    QFileDialog fileOpener;
    fileOpener.setFileMode(QFileDialog::ExistingFile);
    QString filename = fileOpener.getOpenFileName(this, tr("Select File"));
    this->ui.lineParameterFile->setText(filename);
}
Пример #5
0
void
Dialog::on_loadImage_Btn_clicked()
{

    QFileDialog FileDialog;
    QString info=FileDialog.getOpenFileName(this,tr("Open Image"), "/home/nubot/ros_workspace/src/omni_vision/calibration/",
                                           tr("Image Files(*.jpg *.bmp *.png)"));
    if(!info.isEmpty())
    {
        std::string file_path=info.toStdString();
        cv::Mat img=cv::imread(file_path);
        cv::cvtColor(img,orignal_img_[0],CV_BGR2RGB);
        cv::cvtColor(orignal_img_[0],orignal_img_[2],CV_RGB2YUV);
        cv::cvtColor(orignal_img_[0],orignal_img_[1],CV_RGB2HSV);
        image[0]=QImage((const unsigned char*)(orignal_img_[0].data),
                         orignal_img_[0].cols,orignal_img_[0].rows,
                         orignal_img_[0].cols*orignal_img_[0].channels(),
                         QImage::Format_RGB888);
        segment_img_[0]=orignal_img_[0];
        is_screen_update_[0]=true;
        is_draw_Img_[0]=false;
        paint(image[0]);
        bufferImg_[0]=image[0];
        Img_selected_=0;
    }
}
Пример #6
0
void MainWindow::cargarSprites()
{

	QSettings settings("toglia3d","SpriteSceneViewer");
	QString rutaSpritesSetting = settings.value("rutaSprites", QString("/home")).toString();

	QFileDialog openDialog;
	//openDialog.exec();
	QString filtro = tr("*.2ds");
	rutaSprites = openDialog.getOpenFileName(
		this,
		tr("Abrir"),
		rutaSpritesSetting,
		filtro
	);

	if(!rutaSprites.isEmpty()){
		settings.setValue("rutaSprites",rutaSprites);
		mOgreWidget->CargarEscenario2d(rutaSprites.toStdString());

		QFile file(rutaSprites);
		if (file.open(QIODevice::ReadOnly)) {
			QDomDocument document;
			if (document.setContent(&file)) {
				DomModel *newModel = new DomModel(document, this);
				ui.arbolXML->setModel(newModel);
			}
			file.close();
		}
	}
}
Пример #7
0
void MainWindow::teamFileOpen(int TeamNumber)
{
	statusBar()->message(tr("Opening file..."));
	QFileDialog *TempFileDialog;
	TempFileDialog = new QFileDialog;
	TempFileDialog->setMode(QFileDialog::Directory);
	QString FileName = TempFileDialog->getOpenFileName(0,0,this,0,0);
	if (!FileName.isEmpty()) {
		if (GABotDoc->loadTeamFromFile(FileName,TeamNumber)) {
			if (TeamNumber) {
				statusBar()->message(tr("Loaded file "+FileName+" into Team B."), 5000);
				TeamBFileSave->setEnabled(TRUE);
			} else {
				statusBar()->message(tr("Loaded file "+FileName+" into Team A."), 5000);
				TeamAFileSave->setEnabled(TRUE);
			}
		} else {
			QMessageBox::warning(this,tr("Invalid file format"),
				tr("\nThe selected file is not a GA Bot XML file, you idiot."));
			statusBar()->message(tr("Opening aborted"), 1000);
		}
	} else {
		statusBar()->message(tr("Opening aborted"), 1000);
	}
	delete TempFileDialog;
}
Пример #8
0
void codecs::on_readBtn_clicked()
{
    QFileDialog *dialog = new QFileDialog();
    dialog->setDirectory(curDir);
    dialog->setWindowTitle("Open *any* file to decode if possible");

    readFileToBuffer(dialog->getOpenFileName());
}
Пример #9
0
void QtHistoTfuncPixmap::load(void)
{
	QFileDialog* fd = new QFileDialog(0);

	QString fn = fd->getOpenFileName(currentworkingdir, "*.tf2", this );
	loadfile(fn);
	delete fd;
}
Пример #10
0
void ImportConfig::on_cmdOpenCryptFile_clicked()
{
    QFileDialog certFileDialog;
    QString filename = certFileDialog.getOpenFileName(this, tr("Find import file"), QApplication::applicationDirPath(), tr("Import files (*.crypt)"));
    if (!filename.isEmpty()) {
        m_ui->txtImportPath->setText(filename);
    }
}
Пример #11
0
void EditNoteDialogue::chooseTextFile()
{
    QFileDialog dialog;
    QString file = dialog.getOpenFileName(this,tr("Choose a picture"));

    ui->textEdit->setText("define_text_file_note:"+file);
    ui->textEdit->setFocus();
    ui->textEdit->moveCursor (QTextCursor::End);
}
Пример #12
0
void QSimTestGUI::LoadFilePrompt(QString directory_key,QString filter){
  QFileDialog f;
  QString openDir = ini->value(directory_key,".").toString();
  QString filename = f.getOpenFileName(0,"Open File",openDir,filter);
  if(!filename.isEmpty()){
    ini->setValue(directory_key,QFileInfo(filename).absolutePath());
    LoadFile(filename);
  }
}
Пример #13
0
void MainWindow::openFile()
{
    QFileDialog *fileOpenDialog = new QFileDialog(this);
    QString fileName = fileOpenDialog->getOpenFileName();
    if (fileName.count() != 0)
        ui->fileEdit->setText(fileName);
    delete fileOpenDialog;

}
Пример #14
0
void MainWindow::on_actionOpen_Background_triggered()
{
    QFileDialog dialog;
    QString fileName = dialog.getOpenFileName(this, tr("Open File"), "/home/ren/Videos", tr("Images(*.png *.jpg *.tiff)"));
    if(fileName.isEmpty())
        return;
    background = new QImage(fileName);
    return;
}
Пример #15
0
void ImportConfig::on_cmdOpenOvpnFile_clicked()
{
    QFileDialog certFileDialog;
    QString filename (certFileDialog.getOpenFileName(this, QObject::tr("Find ovpn file"), AppFunc::getAppSavePath(), QObject::tr("OpenVPN configs (*.ovpn)")));

    if (!filename.isEmpty()) {
        m_ui->txtExistingOvpn->setText(filename);
    }
}
Пример #16
0
void MainWindow::importSessions(){
    QFileDialog dialog;
    QString fileName = dialog.getOpenFileName(this,tr("select file to open"),"","Archiev Files(*.saz *.zip)");
    QuaZip zip(fileName);
    if(!zip.open(QuaZip::mdUnzip)){
        qDebug()<<"cannot open "<<fileName;
        return;
    }
    QuaZipFileInfo info;
    QuaZipFile file(&zip);

    RyPipeData_ptr pipeData;

    QString name;
    for (bool more = zip.goToFirstFile(); more; more = zip.goToNextFile()) {

        if (!zip.getCurrentFileInfo(&info)) {
            qWarning("testRead(): getCurrentFileInfo(): %d\n", zip.getZipError());
            return;
        }

        if (!file.open(QIODevice::ReadOnly)) {
            qWarning("testRead(): file.open(): %d", file.getZipError());
            return;
        }

        name = file.getActualFileName();
        QByteArray ba = file.readAll();
        if(name.endsWith("_c.txt")){
            //pipeData.clear();
            pipeData = RyPipeData_ptr(new RyPipeData(0,0));
            pipeData->isImported = true;
            pipeData->parseRequest(&ba);
            onNewPipe(pipeData);
        }else if(name.endsWith("_s.txt")){
            pipeData->parseResponse(&ba);
            onPipeUpdate(pipeData);
            pipeData.clear();
        }

        if (file.getZipError() != UNZ_OK) {
            qWarning("testRead(): file.getFileName(): %d", file.getZipError());
            return ;
        }

        file.close();

        if (file.getZipError() != UNZ_OK) {
            qWarning("testRead(): file.close(): %d", file.getZipError());
            return ;
        }

    }

    zip.close();

}
Пример #17
0
void MainWindow::chooseFile()
{
    QFileDialog *fd = new QFileDialog;


    fileName = fd->getOpenFileName();

    if(!fileName.isEmpty())
        open->setText(fileName);
}
Пример #18
0
void MainWindow::wyswietl(){


    //QString image_name= ui->plik->text();
    QFileDialog *f = new QFileDialog();
    this->image_name=f->getOpenFileName(this,"Wybierz plik",".","*.jpg");
    this->image_resize_ratio=1.0;
    this->RedrawImage();

}
Пример #19
0
QString UIClient::chooseFile()
{
	QFileDialog *fd = new QFileDialog();
	filename = fd->getOpenFileName(this,
				  tr("Choose trans file"), tr("."));
	delete fd;
	ui->fileNameEdit->setText(filename);
	ui->progressBar->setValue(0);
	return filename;
}
Пример #20
0
void MainWindow::on_loadLstButton_clicked()
{
    QFileDialog loader;
    std::string fileName = loader.getOpenFileName(this, tr("Open File"), "../lst files",  tr("Files (*.lst*)") ).toStdString();
    this->repaint();
    loader.close();
    if( fileName != "")
       glWidget->LoadLST(fileName);

    glWidget->GenerateMeshFromLST();
}
Пример #21
0
void TimerDialog::showPlayerDialog() {
    QFileDialog* fd = new QFileDialog(this, QStringLiteral("Player"),
                                      QDir::homePath());
    fd->setMimeTypeFilters(
                QStringList{QStringLiteral("application/x-executable"),
                            QStringLiteral("application/x-sharedlib"),
                            QStringLiteral("application/x-shellscript"),
                            QStringLiteral("text/x-python")});
    if(fd->exec())
        ui->lineEditPlayer->setText(fd->getOpenFileName());
}
Пример #22
0
void MainWindow::on_pushButton_select_clicked()
{
    QFileDialog dialog;

    //QString fileName = dialog.getOpenFileName(this, tr("Open File"), QDir::currentPath(),tr("Videos(*.avi)"));
    QString fileName = dialog.getOpenFileName(this, tr("Open File"), "/home/ren/Videos",tr("Videos(*.avi *.avi.ln)"));
    if(fileName.isEmpty())
        return;

    if(dialog.close() == true)
        process(fileName,false);
}
void SpriteSceneConverter::cargar() {

    QSettings settings("toglia3d","SpriteSceneConverter");
    QString rutaCargarSetting = settings.value("rutaCargar", QString("/home")).toString();

    QFileDialog openDialog;
    //openDialog.exec();
    QString filtro = tr("*.mxml *.html *.htm");
    rutaCargarArchivo = openDialog.getOpenFileName(
                            this,
                            tr("Abrir"),
                            rutaCargarSetting,
                            filtro
                        );

    if(!rutaCargarArchivo.isEmpty()) {

        ui.archivoCargarEdit->setText(rutaCargarArchivo);

        QSettings settings("toglia3d","SpriteSceneConverter");
        settings.setValue("rutaCargar", rutaCargarArchivo.mid(0,rutaCargarArchivo.lastIndexOf("/")));

        if(rutaCargarArchivo.endsWith(".html") || rutaCargarArchivo.endsWith(".htm")) {
            //mModelo = leerHtml(rutaCargarArchivo);
        } else if(rutaCargarArchivo.endsWith(".mxml")) {

            limpiarTabla();

            QStringList labels;
            labels.append(QApplication::translate("","Nombre", 0, QApplication::UnicodeUTF8));
            labels.append(QApplication::translate("","Dimensión", 0, QApplication::UnicodeUTF8));
            labels.append(QApplication::translate("","Posición", 0, QApplication::UnicodeUTF8));
            labels.append(QApplication::translate("","Texturas", 0, QApplication::UnicodeUTF8));
            mModelo->setHorizontalHeaderLabels(labels);

            MXMLParser::parse(rutaCargarArchivo, mModelo);

            ui.elementosGroup->setEnabled(true);
            ui.elementosTabla->setEnabled(true);
            ui.exportarBoton->setEnabled(true);
            ui.todosSeleccionBoton->setEnabled(true);
            ui.limpiarSeleccionBoton->setEnabled(true);

            for (size_t i = 0; i < (size_t)mModelo->rowCount(); i++) {
                ui.elementosTabla->openPersistentEditor(mModelo->index(i, 3));
            }

        }

    }


}
Пример #24
0
/**
 * @brief MainWindow::open
 * Open new Mesh File
 */
void MainWindow::open(){
QFileDialog     *fd;
QString         filter;

  fd = new QFileDialog();
  fd->setDirectory(sampleDir);
  FileName = fd->getOpenFileName(this,tr("Open Mesh Files"),sampleDir,"Mesh Files ( *.ply)", &filter);
  if (!FileName.isEmpty()){
    ui->glwidget->setMeshFile(FileName.toStdString());
    ui->glwidget->initialize();
  }
}
Пример #25
0
void MainWindow::OpenFile(void){
    QFileDialog     *fd;
    QString         filter;

      fd = new QFileDialog();
      fd->setDirectory(sampleDir);
      FileName = fd->getOpenFileName(this,tr("Open Mesh Files"),sampleDir,"Mesh Files ( *.ply)", &filter);
      if (!FileName.isEmpty()){
        glwidget->setMeshFile(FileName);
        glwidget->loadMesh();
      }

}
Пример #26
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QString filename;
    QFileDialog ss;
    filename = ss.getOpenFileName(this, tr("Open File"),
                                  "/home",
                                  tr("Images (*.png *.xpm *.jpg)"));

}
void CreateTorrentWindow::on_browse_clicked()
{
    QFileDialog *fdg = new QFileDialog;

    //Choose a file to create a torrent file of that file
    QString fileName = fdg->getOpenFileName(this, tr("Choose a file to create torrent file"),
                                           ".",
                                           tr("All files (*.*)"));

    if (fileName.isEmpty())
        return;
    this->filename = fileName;
    ui->lineEdit->setText(this->filename);      //Set that filename in textEdit
}
void FormAssignStudentList::on_pushButton_getPath_clicked()
{
    QFileDialog dialog;
    filename = dialog.getOpenFileName(this, "Student Selection .CSV", "home/","Comma Seperated Value(*.csv)");
    ui->lineEdit_editPath->setText(filename);



    if(filename != NULL){
        processCSVFile(filename);
        ui->tableView_student->setModel(model);
    }

}
Пример #29
0
void MainWindow::OpenFileShader(void){
    QFileDialog     *fd;
    QString         filter;

      fd = new QFileDialog();
      fd->setDirectory(sampleDir);
      FileName = fd->getOpenFileName(this,tr("Open Shader Files"),sampleDir,"Shader Files ( *.vert | *.frag)", &filter);
      fd->hide();

      if (!FileName.isEmpty()){
        glwidget->setShaderFile(FileName);
        glwidget->loadShader();
      }
}
Пример #30
0
QString FileDialog::openFile()
{
    mIsGood = true;

    QFileDialog fd;
    QString file = fd.getOpenFileName(0,QString("Select file"));

    QFile f(file);
    if(file == "" || !f.exists())
    {
        mIsGood = false;
    }

    return file;
}