diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e584aa..8c214e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
-project(checks-parser VERSION 0.1 LANGUAGES CXX)
+project(checks-parser VERSION 0.0.4 LANGUAGES CXX)
option(BUILD_TRANSLATIONS "Build translations?" ON)
option(BUILD_EMAIL_TO_TEXT_MODE "Build email-to-text mode?" ON)
@@ -90,6 +90,9 @@ set(PROJECT_SOURCES
if (BUILD_OCR_MODE)
list(APPEND PROJECT_SOURCES image/checkimage.h image/checkimage.cpp)
+endif()
+
+if (BUILD_OFD_LOCAL_QR_SCAN)
list(APPEND PROJECT_SOURCES image_redactor/imageredactor.h image_redactor/imageredactor.cpp)
endif()
@@ -187,9 +190,7 @@ endif()
if (BUILD_OCR_MODE)
target_link_libraries(checks-parser PRIVATE -ltesseract)
endif()
-if (BUILD_OFD_BINARYEYE_SCAN OR BUILD_OFD_LOCAL_QR_SCAN)
- target_link_libraries(checks-parser PRIVATE -lcurl)
-endif()
+target_link_libraries(checks-parser PRIVATE -lcurl)
if (BUILD_OCR_MODE OR BUILD_OFD_LOCAL_QR_SCAN OR BUILD_OFD_BINARYEYE_SCAN)
find_package(OpenCV REQUIRED COMPONENTS core imgproc imgcodecs)
diff --git a/scenes/adjustpicturedialog.ui b/scenes/adjustpicturedialog.ui
index 69cf406..c22a77c 100644
--- a/scenes/adjustpicturedialog.ui
+++ b/scenes/adjustpicturedialog.ui
@@ -13,65 +13,42 @@
Dialog
-
-
-
- 450
- 450
- 341
- 32
-
-
-
- Qt::Horizontal
-
-
- QDialogButtonBox::Cancel|QDialogButtonBox::Ok
-
-
-
-
-
- 10
- 460
- 591
- 16
-
-
-
- 50
-
-
- Qt::Horizontal
-
-
-
-
-
- 10
- 0
- 511
- 18
-
-
-
- Please, zoom to qr code and adjust contrast so that qr code looks sharp
-
-
-
-
-
- 5
- 21
- 801
- 421
-
-
-
- buttonBox
+
+ -
+
+
+ -
+
+
+ 50
+
+
+ Qt::Orientation::Horizontal
+
+
+
+ -
+
+
+ Please, zoom to qr code and adjust contrast so that qr code looks sharp
+
+
+
+ -
+
+
+ Qt::Orientation::Horizontal
+
+
+ QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok
+
+
+
+
label
contrastSlider
graphicsView
+ buttonBox
diff --git a/translations/en_US.ts b/translations/en_US.ts
index 392f975..8c1226b 100644
--- a/translations/en_US.ts
+++ b/translations/en_US.ts
@@ -9,7 +9,7 @@
Dialog
-
+
Please, zoom to qr code and adjust contrast so that qr code looks sharp
Please, zoom to qr code and adjust contrast so that qr code looks sharp
@@ -27,36 +27,43 @@
EmailTextScene
+
Form
- Form
+ Form
Store type
Store type
+
Check content
- Check content
+ Check content
+
Parse
- Parse
+ Parse
+
Store:
- Store:
+ Store:
+
Back
- Back
+ Back
+
An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.
- An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.
+ An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.
+
Error in parsing
- Error in parsing
+ Error in parsing
diff --git a/translations/ru_RU.ts b/translations/ru_RU.ts
index 933da9a..5de696c 100644
--- a/translations/ru_RU.ts
+++ b/translations/ru_RU.ts
@@ -9,7 +9,7 @@
Диалог
-
+
Please, zoom to qr code and adjust contrast so that qr code looks sharp
Пожалуйста, приблизьте QR код и настройте контраст, чтобы он читался
@@ -27,36 +27,43 @@
EmailTextScene
+
Form
- Форма
+ Форма
Store type
Магазин
+
Check content
- Контент чека
+ Контент чека
+
Parse
- Парсить
+ Парсить
+
Store:
- Магазин:
+ Магазин:
+
Back
- Назад
+ Назад
+
An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.
- Произошла ошибка. Чек был прочитан неверно. Размеры векторов различаются. Пожалуйста, сообщите об этом разработчику.
+ Произошла ошибка. Чек был прочитан неверно. Размеры векторов различаются. Пожалуйста, сообщите об этом разработчику.
+
Error in parsing
- Ошибка в парсинге
+ Ошибка в парсинге
diff --git a/utils/utils.cpp b/utils/utils.cpp
index f0b7b0c..57361d2 100644
--- a/utils/utils.cpp
+++ b/utils/utils.cpp
@@ -1,24 +1,30 @@
#include "utils.h"
-
-#include
+#ifdef BUILD_OFD_BINARYEYE_SCAN
+# include
+# include
+# include
+# include
+#endif
+#ifdef BUILD_OFD_MODULE
+# include "../exceptions/ofdrequestexception.h"
+#endif
#include
#include
#include
#include
-#include
-#include
-#include
-#include
+#if defined(BUILD_OCR_MODE) || defined(BUILD_OFD_MODE)
+# include
+# include
+# include
+#endif
#include
#include
-#include "../exceptions/ofdrequestexception.h"
#include "settings/settings.h"
#include
#include
-#include
-#include
-#include
+
+#ifdef BUILD_OFD_BINARYEYE_SCAN
std::string get_local_ip_address() {
struct ifaddrs * ifAddrStruct=NULL;
struct ifaddrs * ifa=NULL;
@@ -44,6 +50,7 @@ std::string get_local_ip_address() {
throw std::runtime_error(QWidget::tr("Could not find any usable local IP address. If you beleive that this is problem with the program, please, contact the developer.").toStdString());
}
+#endif
std::string to_utf8(std::wstring wide_string) {
static std::wstring_convert> utf8_conv;
@@ -114,7 +121,7 @@ std::wstring substring_from_to(std::wstring& text, std::wstring from, std::wstri
return substring;
}
-
+#ifdef BUILD_OFD_MODE
std::wstring trim_html_response(std::wstring& check) {
std::wstring begin_check_marker = from_utf8("");
std::wstring end_check_marker = from_utf8("");
@@ -219,7 +226,9 @@ Check parseOfdRuAnswer(std::string html) {
return c;
}
+#endif // ifdef BUILD_OFD_MODE
+#ifdef BUILD_OFD_BINARYEYE_SCAN
void generate_qr_code(std::string data) {
QRcode *qrCode = QRcode_encodeString(data.c_str(), 2, QR_ECLEVEL_L, QR_MODE_8, 1);
if (qrCode == NULL) {
@@ -244,3 +253,4 @@ void generate_qr_code(std::string data) {
cv::imwrite(get_path_relative_to_home(".local/share/checks_parser/binaryeye_connection.png"), qrCodeImage);
QRcode_free(qrCode);
}
+#endif // ifdef BUILD_OFD_BINARYEYE_SCAN
diff --git a/utils/utils.h b/utils/utils.h
index b4cc663..b1663d6 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -5,7 +5,6 @@
#include
#include "../check/check.h"
-std::string get_local_ip_address();
std::string to_utf8(std::wstring wide_string);
std::wstring from_utf8(std::string string);
@@ -16,10 +15,15 @@ bool vector_contains_element(const std::vector &vector, const T &to_find);
std::vector split(std::string, std::string);
+#ifdef BUILD_OFD_MODULE
Check parseOfdRuAnswer(std::string);
std::wstring trim_html_response(std::wstring& check);
+#endif
+#ifdef BUILD_OFD_BINARYEYE_SCAN
void generate_qr_code(std::string data);
+std::string get_local_ip_address();
+#endif
#endif // UTILS_H