Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include "taz.h"
#include "ui_taz.h"
#include <QFileDialog>
// May not be needed:
#include <QFile>
#include <QMessageBox>
#include <QTextStream>
// Depends on debugging and testing
#include <QProcess>
#include <iostream>
#include <QObject>
Taz::Taz(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::Taz)
{
ui->setupUi(this);
}
Taz::~Taz()
{
delete ui;
}
void Taz::on_chooseButton_clicked()
{
// New behavior
QFileDialog dialog(this);
dialog.setViewMode(QFileDialog::Detail);
dialog.setFileMode(QFileDialog::ExistingFiles);
QStringList fileNames;
if (dialog.exec())
fileNames = dialog.selectedFiles();
QString program = "/bin/echo";
QStringList arguments;
fileNames << ">> /home/fred/fn.txt";
QProcess *myProcess = new QProcess(this);
myProcess->start(program, fileNames );
// NOT USING AT THE MOMENT:
// arguments << "fileNames" << ">> /home/fred/fn.txt";
// QProcess *myProcess = new QProcess(this);
// myProcess->start(program, arguments);
}
void Taz::on_CancelButton_clicked()
{
qApp->quit();
}
void Taz::on_shredButton_clicked()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment