diff --git a/src/main.cpp b/src/main.cpp index 110d9eb..5622493 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,7 +19,12 @@ int main(int argc, char *argv[]) if(upFile.exists()) upFile.remove(); - QMessageBox::information(&w, "Up to Date", "You are now up to date!"); + QMessageBox::StandardButton reply; + QMessageBox::question(&w, "Up to Date", "You are now up to date! Would you like to view the changelog?", QMessageBox::Yes|QMessageBox::No); + if(reply == QMessageBox::Yes) + { + QDesktopServices::openUrl(QString("http://kalebklein.com/portfolio/post/checkmate")); + } } } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a379772..4b5de60 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -14,9 +14,10 @@ MainWindow::MainWindow(QWidget *parent) : this->establishUIConnections(); this->working = false; - this->lVersion = 18; // Important! This is the version checker!!!!!!! - this->version = "2.2"; + this->lVersion = 19; // Important! This is the version checker!!!!!!! + this->version = "2.3"; this->gversion = "2.1.2"; + this->hashType = -1; } MainWindow::~MainWindow() @@ -147,6 +148,24 @@ void MainWindow::onValidateButtonClicked() } else { + if(this->hashType == -1) + { + switch(hash.length()) + { + case 32: + setHashType("md5"); + break; + case 40: + setHashType("sha1"); + break; + case 64: + setHashType("sha256"); + break; + default: + setHashType("md5"); + } + } + this->mThread->setFileLocation(file); this->mThread->setHashType(this->hashType); connect(mThread, SIGNAL(CalculationPerformed(QString)), this, SLOT(onCalculationPerformed(QString))); @@ -181,6 +200,9 @@ void MainWindow::onCalculationPerformed(QString hash) // revert working to false this->working = false; + + // set hashType back to -1 + this->hashType = -1; } void MainWindow::alert(QString title, QString message, bool critical)