This commit is contained in:
Dagen Brock 2017-02-04 22:20:35 -06:00
parent ecec861b1c
commit 0bc028c056

View File

@ -9,7 +9,7 @@
#include "qformlayout.h" #include "qformlayout.h"
#include "qdialogbuttonbox.h" #include "qdialogbuttonbox.h"
const QString MainWindow::programName = QString("buckshot"); const QString MainWindow::programName = QString("buckshot");
const QString MainWindow::version = QString("0.03"); const QString MainWindow::version = QString("0.03h"); // hotfix
const QString MainWindow::imageName = QString("saved"); const QString MainWindow::imageName = QString("saved");
MainWindow::MainWindow(QWidget *parent) : MainWindow::MainWindow(QWidget *parent) :
@ -41,13 +41,13 @@ MainWindow::MainWindow(QWidget *parent) :
// POPULATE RESOLUTION COMBOBOX // POPULATE RESOLUTION COMBOBOX
QStringList inputResolutions; QStringList inputResolutions;
inputResolutions << "40 x 48 - Full Scale LGR" inputResolutions << "40 x 48 - Full Scale LGR"
<< "80 x 48 - Full Scale DLGR" << "80 x 48 - Full Scale DLGR"
<< "140 x 192 - Full Scale (HGR & DHGR)" << "140 x 192 - Full Scale (HGR & DHGR)"
<< "280 x 192 - Double Width Scale (HGR & DHGR)" << "280 x 192 - Double Width Scale (HGR & DHGR)"
<< "320 x 200 - Classic Size" << "320 x 200 - Classic Size"
<< "560 x 384 - Quadruple Width, Double Height Scale" << "560 x 384 - Quadruple Width, Double Height Scale"
<< "640 x 400 - Classic Size" << "640 x 400 - Classic Size"
<< "640 x 480 - Classic Size"; << "640 x 480 - Classic Size";
ui->comboBox_inputResolution->addItems(inputResolutions); ui->comboBox_inputResolution->addItems(inputResolutions);
// POPULATE DITHERING COMBOBOX // POPULATE DITHERING COMBOBOX
@ -161,41 +161,41 @@ void MainWindow::on_pushButton_sourceFilename_clicked()
void MainWindow::updateInputSize() void MainWindow::updateInputSize()
{ {
switch (ui->comboBox_inputResolution->currentIndex()) { switch (ui->comboBox_inputResolution->currentIndex()) {
case 0: case 0:
inputWidth = 40; inputWidth = 40;
inputHeight = 48; inputHeight = 48;
break; break;
case 1: case 1:
inputWidth = 80; inputWidth = 80;
inputHeight = 48; inputHeight = 48;
break; break;
case 2: case 2:
inputWidth = 140; inputWidth = 140;
inputHeight = 192; inputHeight = 192;
break; break;
case 3: case 3:
inputWidth = 280; inputWidth = 280;
inputHeight = 192; inputHeight = 192;
break; break;
case 4: case 4:
inputWidth = 320; inputWidth = 320;
inputHeight = 200; inputHeight = 200;
break; break;
case 5: case 5:
inputWidth = 560; inputWidth = 560;
inputHeight = 384; inputHeight = 384;
break; break;
case 6: case 6:
inputWidth = 640; inputWidth = 640;
inputHeight = 400; inputHeight = 400;
break; break;
case 7: case 7:
inputWidth = 640; inputWidth = 640;
inputHeight = 480; inputHeight = 480;
break; break;
default: default:
qDebug() << "default, error?"; qDebug() << "default, error?";
break; break;
} }
QSize sourceSize = ui->label_source->pixmap()->size(); QSize sourceSize = ui->label_source->pixmap()->size();
@ -230,21 +230,21 @@ void MainWindow::on_pushButton_preview_clicked()
// NOW FIND OUR OUTPUT FORMAT // NOW FIND OUR OUTPUT FORMAT
QString outputFormat = "H"; // HIRES QString outputFormat = "H"; // HIRES
switch (ui->comboBox_outputFormat->currentIndex()) { switch (ui->comboBox_outputFormat->currentIndex()) {
case 0: case 0:
outputFormat = "L"; outputFormat = "L";
break; break;
case 1: case 1:
outputFormat = "DL"; outputFormat = "DL";
break; break;
case 2: case 2:
outputFormat = "H"; outputFormat = "H";
break; break;
case 3: case 3:
outputFormat = "D"; outputFormat = "D";
break; break;
case 4: case 4:
outputFormat = "mono"; outputFormat = "mono";
break; break;
} }
QString tempDir = "/tmp"; QString tempDir = "/tmp";
@ -405,6 +405,9 @@ void MainWindow::on_pushButton_saveImage_clicked()
// PROMPT FOR SAVE FILENAME AND COPY (HOPEFULLY) TO SAVE FILENAME // PROMPT FOR SAVE FILENAME AND COPY (HOPEFULLY) TO SAVE FILENAME
QString saveFile = QFileDialog::getSaveFileName(0, "Save file", QDir::currentPath(), filters, &defaultFilter); QString saveFile = QFileDialog::getSaveFileName(0, "Save file", QDir::currentPath(), filters, &defaultFilter);
if (QFile::exists(saveFile)) {
QFile::remove(saveFile);
}
QFile::copy(a2filename, saveFile); QFile::copy(a2filename, saveFile);
} }
@ -642,10 +645,10 @@ void MainWindow::on_pushButton_saveToProdos_clicked()
QString addfile_output = QString(addfile_process.readAllStandardOutput()); QString addfile_output = QString(addfile_process.readAllStandardOutput());
// IF FILE ALREADY EXISTS, ASK IF THEY WANT TO OVERWRITE // IF FILE ALREADY EXISTS, ASK IF THEY WANT TO OVERWRITE
if (addfile_output.contains("A file already exist with the same nam")) { if (addfile_output.contains("A file already exist with the same name")) {
QMessageBox::StandardButton reply; QMessageBox::StandardButton reply;
reply = QMessageBox::question(this, "File exists in image", "File exists, Replace?", reply = QMessageBox::question(this, "File exists in image", "File exists, Replace?",
QMessageBox::Yes|QMessageBox::No); QMessageBox::Yes|QMessageBox::No);
if (reply == QMessageBox::Yes) { if (reply == QMessageBox::Yes) {
// ../tools/Cadius DELETEFILE <[2mg|hdv|po]_image_path> <prodos_file_path> // ../tools/Cadius DELETEFILE <[2mg|hdv|po]_image_path> <prodos_file_path>