Skip to content

Instantly share code, notes, and snippets.

@Fred-Barclay
Created September 8, 2016 21:12
Show Gist options
  • Save Fred-Barclay/f0454d31681fe3744659cd18dfd62403 to your computer and use it in GitHub Desktop.
Save Fred-Barclay/f0454d31681fe3744659cd18dfd62403 to your computer and use it in GitHub Desktop.
#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