From 096a1b49a77082765378db9f6d449bb6c60389c4 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Fri, 31 May 2019 14:48:07 -0400 Subject: [PATCH] small fixes --- GUI/mainwindow.cpp | 5 ++--- include/common.h | 8 ++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/GUI/mainwindow.cpp b/GUI/mainwindow.cpp index 1d2e161..cdec206 100644 --- a/GUI/mainwindow.cpp +++ b/GUI/mainwindow.cpp @@ -108,7 +108,7 @@ MainWindow::MainWindow(QWidget *parent) : char buffer[1000] = {}; WinHttpReceiveResponse(request, NULL); WinHttpReadData(request, buffer, 1000, &bytesRead); - if (abs(strstr(buffer, "/tag/") - strstr(buffer, CURRENT_VERSION)) > 10) Host::AddConsoleOutput(UPDATE_AVAILABLE); + if (abs(strstr(buffer, "/tag/") - strstr(buffer, VERSION)) > 10) MESSAGE(UPDATE_AVAILABLE); } }).detach(); } @@ -326,8 +326,7 @@ void MainWindow::Settings() { auto settings = new QSettings(CONFIG_FILE, QSettings::IniFormat, this); auto layout = new QFormLayout(this); - auto save = new QPushButton(this); - save->setText(SAVE_SETTINGS); + auto save = new QPushButton(SAVE_SETTINGS, this); layout->addWidget(save); for (auto[value, label] : Array>{ { Host::defaultCodepage, DEFAULT_CODEPAGE }, diff --git a/include/common.h b/include/common.h index efcd004..cae90f6 100644 --- a/include/common.h +++ b/include/common.h @@ -19,6 +19,14 @@ #include #include +#ifdef _WIN64 +constexpr bool x64 = true; +#else +constexpr bool x64 = false; +#endif + +#define MESSAGE(text) MessageBoxW(NULL, text, L"Textractor", MB_OK) + template using Array = T[]; template