added functionality to email text and ocr scenes

This commit is contained in:
leca 2025-03-11 23:31:08 +03:00
parent 4c7a25c53e
commit 1ae724f925
20 changed files with 679 additions and 348 deletions

View File

@ -39,6 +39,8 @@ set(PROJECT_SOURCES
emailtextscene.h emailtextscene.cpp scenes/emailtextscene.ui
ocrscene.h ocrscene.cpp scenes/ocrscene.ui
ofdscene.h ofdscene.cpp scenes/ofdscene.ui
outputdialog.h outputdialog.cpp scenes/outputdialog.ui
# adjustpicturedialog.h adjustpicturedialog.cpp scenes/adjustpicturedialog.ui
)
set(TRANSLATION_SOURCES
@ -47,6 +49,8 @@ set(TRANSLATION_SOURCES
emailtextscene.cpp emailtextscene.h scenes/emailtextscene.ui
ocrscene.cpp ocrscene.h scenes/ocrscene.ui
ofdscene.cpp ofdscene.h scenes/ofdscene.ui
outputdialog.h outputdialog.cpp scenes/outputdialog.ui
# adjustpicturedialog.h adjustpicturedialog.cpp scenes/adjustpicturedialog.ui
)
set(TS_FILES

View File

@ -5,10 +5,16 @@ Check::Check() {}
void Check::add_goods(Goods goods) { this->goods.push_back(goods); }
void Check::add_goods(std::vector<Goods> &goods) {
for (auto g : goods) {
this->goods.push_back(g);
}
}
double Check::calculae_total_price() {
double total = 0.0;
for (Goods g : this->goods) {
for (Goods &g : goods) {
total += g.calculate_total_price();
}

View File

@ -9,6 +9,7 @@ class Check {
public:
Check();
void add_goods(Goods);
void add_goods(std::vector<Goods> &goods);
double calculae_total_price();

View File

@ -1,14 +1,45 @@
#include "emailtextscene.h"
#include "ui_emailtextscene.h"
#include <QMessageBox>
#include <iostream>
#include <outputdialog.h>
#include <check/check.h>
EmailTextScene::EmailTextScene(QWidget *parent)
: QWidget(parent)
, ui(new Ui::EmailTextScene)
{
, ui(new Ui::EmailTextScene) {
ui->setupUi(this);
auto modules = parser.get_modules_names();
for (auto &module : modules) {
ui->store_combo_box->addItem(QString::fromStdString(module));
}
}
EmailTextScene::~EmailTextScene()
{
EmailTextScene::~EmailTextScene() {
delete ui;
}
void EmailTextScene::on_parse_button_clicked() {
std::wstring checkContent = ui->check_content->toPlainText().toStdWString();
parser.set_module(parser.search_modules()[ui->store_combo_box->currentIndex()]);
std::vector<Goods> goods = parser.parse(checkContent);
if (goods.size() == 0) {
QMessageBox infoDialog;
infoDialog.setText(tr("An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer."));
infoDialog.setIcon(QMessageBox::Critical);
infoDialog.setWindowTitle(tr("Error in parsing"));
infoDialog.exec();
return;
}
Check check;
check.add_goods(goods);
OutputDialog d(this, check);
d.show();
d.exec();
}

View File

@ -1,6 +1,7 @@
#ifndef EMAILTEXTSCENE_H
#define EMAILTEXTSCENE_H
#include "parser/parser.h"
#include <QWidget>
namespace Ui {
@ -15,8 +16,12 @@ public:
explicit EmailTextScene(QWidget *parent = nullptr);
~EmailTextScene();
private slots:
void on_parse_button_clicked();
private:
Ui::EmailTextScene *ui;
Parser parser;
};
#endif // EMAILTEXTSCENE_H

View File

@ -17,6 +17,9 @@
#include <QStackedLayout>
#include <QTextStream>
#include <QTranslator>
#include <emailtextscene.h>
#include <ocrscene.h>
#include <ofdscene.h>
#include <qpushbutton.h>
#include <parser/parser.h>
@ -48,31 +51,38 @@ int main(int argc, char *argv[]) {
QObject::connect(text_from_email_button, &QPushButton::clicked, [&]() {
// Text from email scene
sceneLayout->setCurrentIndex(1);
sceneLayout->widget(1)->show();
});
QObject::connect(ocr_button, &QPushButton::clicked, [&]() {
// OCR scene
sceneLayout->setCurrentIndex(2);
sceneLayout->widget(2)->show();
});
QObject::connect(ofd_button, &QPushButton::clicked, [&]() {
// OCR scene
sceneLayout->setCurrentIndex(3);
sceneLayout->widget(3)->show();
});
// Text from email setup
QWidget *emailtextscene = loadUI(window, ":/scenes/scenes/emailtextscene.ui");
// // Text from email setup
// QWidget *emailtextscene = loadUI(window, ":/scenes/scenes/emailtextscene.ui");
// emailtextscene->show();
//OCR scene
QWidget *ocrscene = loadUI(window, ":/scenes/scenes/ocrscene.ui");
// QWidget *ocrscene = loadUI(window, ":/scenes/scenes/ocrscene.ui");
//OFD scene
QWidget *ofdscene = loadUI(window, ":/scenes/scenes/ofdscene.ui");
// QWidget *ofdscene = loadUI(window, ":/scenes/scenes/ofdscene.ui");
EmailTextScene *emailTextScene = new EmailTextScene();
OCRScene *ocrscene = new OCRScene();
OFDScene *ofdscene = new OFDScene();
sceneLayout->addWidget(mainwindowscene);
sceneLayout->addWidget(emailtextscene);
sceneLayout->addWidget(emailTextScene);
sceneLayout->addWidget(ocrscene);
sceneLayout->addWidget(ofdscene);

View File

@ -1,10 +1,13 @@
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <iostream>
MainWindow::MainWindow(QWidget *parent)
: QWidget(parent)
, ui(new Ui::MainWindow) {
ui->setupUi(this);
std::cout << "test" << std::endl;
}
MainWindow::~MainWindow() {

View File

@ -1,12 +1,73 @@
#include "ocrscene.h"
#include "ui_ocrscene.h"
#include <QFileDialog>
#include <QMessageBox>
#include <outputdialog.h>
#include <image/checkimage.h>
#include <check/check.h>
OCRScene::OCRScene(QWidget *parent)
: QWidget(parent)
, ui(new Ui::OCRScene) {
ui->setupUi(this);
auto modules = parser.get_modules_names();
for (auto &module : modules) {
ui->store_combo_box->addItem(QString::fromStdString(module));
}
}
OCRScene::~OCRScene() {
delete ui;
}
void OCRScene::on_parse_button_clicked() {
std::wstring checkContent = ui->check_text_edit->toPlainText().toStdWString();
parser.set_module(parser.search_modules()[ui->store_combo_box->currentIndex()]);
std::vector<Goods> goods = parser.parse(checkContent);
if (goods.size() == 0) {
QMessageBox infoDialog;
infoDialog.setText(tr("An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer."));
infoDialog.setIcon(QMessageBox::Critical);
infoDialog.setWindowTitle(tr("Error in parsing"));
infoDialog.exec();
return;
}
Check check;
check.add_goods(goods);
OutputDialog d(this, check);
d.show();
d.exec();
}
void OCRScene::on_choose_image_button_clicked() {
QString filename = QFileDialog::getOpenFileName();
if (filename == "") {
QMessageBox infoDialog;
infoDialog.setText(tr("Please, select a picture to scan"));
infoDialog.setIcon(QMessageBox::Critical);
infoDialog.setWindowTitle(tr("Picture was not selected"));
infoDialog.exec();
return;
}
std::string new_text = "Selected: " + filename.toStdString();
ui->path_to_image_label->setText(tr("Path to image: ")+ filename);
CheckImage i(filename.toStdString());
std::string parsed = i.parse_text();
ui->check_text_edit->setPlainText(QString::fromStdString(parsed));
}

View File

@ -1,6 +1,7 @@
#ifndef OCRSCENE_H
#define OCRSCENE_H
#include "parser/parser.h"
#include <QWidget>
namespace Ui {
@ -15,8 +16,14 @@ public:
explicit OCRScene(QWidget *parent = nullptr);
~OCRScene();
private slots:
void on_parse_button_clicked();
void on_choose_image_button_clicked();
private:
Ui::OCRScene *ui;
Parser parser;
};
#endif // OCRSCENE_H

View File

@ -1,215 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OutputDialog</class>
<widget class="QDialog" name="OutputDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>586</width>
<height>431</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="geometry">
<rect>
<x>410</x>
<y>390</y>
<width>166</width>
<height>26</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
<widget class="QLabel" name="pathLabel">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>271</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>Path to export: </string>
</property>
</widget>
<widget class="QPushButton" name="chooseFileButton">
<property name="geometry">
<rect>
<x>290</x>
<y>20</y>
<width>80</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Choose</string>
</property>
</widget>
<widget class="QCheckBox" name="printHeaderCheckBox">
<property name="geometry">
<rect>
<x>10</x>
<y>50</y>
<width>371</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>Print header</string>
</property>
</widget>
<widget class="QTableWidget" name="tableWidget">
<property name="geometry">
<rect>
<x>10</x>
<y>130</y>
<width>401</width>
<height>221</height>
</rect>
</property>
<row>
<property name="text">
<string>Goods name</string>
</property>
</row>
<row>
<property name="text">
<string>Goods price</string>
</property>
</row>
<row>
<property name="text">
<string>Goods quantity</string>
</property>
</row>
<row>
<property name="text">
<string>Goods net weight</string>
</property>
</row>
<row>
<property name="text">
<string>Goods total</string>
</property>
</row>
<column>
<property name="text">
<string>position</string>
</property>
</column>
<column>
<property name="text">
<string>name</string>
</property>
</column>
<item row="0" column="0">
<property name="text">
<string>1</string>
</property>
</item>
<item row="0" column="1">
<property name="text">
<string>Name</string>
</property>
</item>
<item row="1" column="0">
<property name="text">
<string>2</string>
</property>
</item>
<item row="1" column="1">
<property name="text">
<string>Price</string>
</property>
</item>
<item row="2" column="0">
<property name="text">
<string>3</string>
</property>
</item>
<item row="2" column="1">
<property name="text">
<string>Quantity</string>
</property>
</item>
<item row="3" column="0">
<property name="text">
<string>4</string>
</property>
</item>
<item row="3" column="1">
<property name="text">
<string>Net weight</string>
</property>
</item>
<item row="4" column="0">
<property name="text">
<string>5</string>
</property>
</item>
<item row="4" column="1">
<property name="text">
<string>Total price</string>
</property>
</item>
</widget>
<widget class="QCheckBox" name="printTotalCheckBox">
<property name="geometry">
<rect>
<x>10</x>
<y>90</y>
<width>381</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>Print total</string>
</property>
</widget>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>OutputDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>OutputDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -31,7 +31,7 @@ StoreModule::StoreModule(std::string path) {
std::vector<std::string> StoreModule::parse_name(std::wstring str) {
std::vector<std::string> result;
std::wregex r(this->goods_name_regex, std::regex::collate);
std::wregex r(this->goods_name_regex, std::regex_constants::multiline);
for (std::wsregex_iterator it{str.begin(), str.end(), r}, end{}; it != end;
it++) {

View File

@ -4,6 +4,7 @@
#include "../settings/settings.h"
#include "../utils/utils.h"
#include <iostream>
#include <fstream>
#if __GNUC__ < 8 && __clang_major__ < 17
# include <experimental/filesystem>
@ -14,6 +15,27 @@
using namespace std::filesystem;
#endif
static void dumpVectorsToStdErr(std::vector<std::string> &goods_names, std::vector<std::string> &goods_prices, std::vector<std::string>& goods_quantities) {
std::cerr << goods_names.size() << " " << goods_prices.size() << " " << goods_quantities.size() << std::endl;
std::cerr << "Found goods names: ";
for (auto &goods_name : goods_names) {
std::cerr << goods_name << " ";
}
std::cerr << std::endl;
std::cerr << "Found goods prices: ";
for (auto &goods_price : goods_prices) {
std::cerr << goods_price << " ";
}
std::cerr << std::endl;
std::cerr << "Found goods names: ";
for (auto &goods_quantity : goods_quantities) {
std::cerr << goods_quantity << " ";
}
std::cerr << std::endl;
}
Parser::Parser() {}
std::vector<std::string> Parser::search_modules() {
@ -31,13 +53,28 @@ std::vector<std::string> Parser::search_modules() {
std::vector<std::string> modules_files;
for (auto file : directory_iterator(path)) {
for (auto &file : directory_iterator(path)) {
modules_files.push_back(file.path());
}
return modules_files;
}
std::vector<std::string> Parser::get_modules_names() {
std::vector<std::string> modules = this->search_modules();
std::vector<std::string> names = {};
for (std::string &modulePath : modules) {
std::ifstream inputFile(modulePath);
nlohmann::json module = nlohmann::json::parse(inputFile);
std::string name = module["name"];
names.push_back(name);
}
return names;
}
void Parser::set_module(std::string path) { module = StoreModule(path); }
std::vector<Goods> Parser::parse(std::wstring check_plaintext) {
@ -53,6 +90,9 @@ std::vector<Goods> Parser::parse(std::wstring check_plaintext) {
if (goods_names.size() != goods_prices.size() ||
goods_names.size() != goods_quantities.size() ||
goods_prices.size() != goods_quantities.size()) {
dumpVectorsToStdErr(goods_names, goods_prices, goods_quantities);
//Error. Amount of names, prices or quantities are not equal. That means, that some regex(es) has mismatched.
return {};
}

View File

@ -15,6 +15,8 @@ public:
std::vector<std::string> search_modules();
std::vector<std::string> get_modules_names();
std::vector<std::string> check_updates();
void set_module(std::string);

View File

@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/scenes">
<file>scenes/outputdialog.ui</file>
<file>scenes/emailtextscene.ui</file>
<file>scenes/ocrscene.ui</file>
<file>scenes/mainwindow.ui</file>

View File

@ -14,30 +14,7 @@
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="1">
<widget class="QTextEdit" name="check_content"/>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="parse_button">
<property name="text">
<string>Parse</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="back_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Back</string>
</property>
</widget>
</item>
<item row="1" column="1" alignment="Qt::AlignmentFlag::AlignHCenter">
<item row="2" column="0" colspan="3">
<widget class="QLabel" name="check_content_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
@ -50,6 +27,52 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QPushButton" name="parse_button">
<property name="text">
<string>Parse</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="store_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Store:</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QTextEdit" name="check_content"/>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="back_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Back</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="store_combo_box">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>

View File

@ -23,7 +23,30 @@
<property name="topMargin">
<number>8</number>
</property>
<item row="1" column="0">
<item row="1" column="2">
<widget class="QComboBox" name="store_combo_box">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="5" column="0" colspan="3">
<widget class="QPushButton" name="parse_button">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Parse</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QPushButton" name="choose_image_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
@ -42,36 +65,7 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="path_to_image_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Path to image:</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="instructions_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Recognized text will be shown below as soon as image will be processed. Please, edit it</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="QTextEdit" name="check_text_edit"/>
</item>
<item row="0" column="0" colspan="2">
<item row="0" column="0" colspan="3">
<widget class="QPushButton" name="back_button">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -84,16 +78,45 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<widget class="QPushButton" name="parse_button">
<item row="3" column="0" colspan="3">
<widget class="QLabel" name="instructions_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Parse</string>
<string>Recognized text will be shown below as soon as image will be processed. Please, edit it</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="path_to_image_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Path to image:</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<widget class="QTextEdit" name="check_text_edit"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="QLabel" name="store_label">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Store:</string>
</property>
</widget>
</item>

187
scenes/outputdialog.ui Normal file
View File

@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OutputDialog</class>
<widget class="QDialog" name="OutputDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>892</width>
<height>537</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="pathLabel">
<property name="text">
<string>Path to export: </string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="chooseFileButton">
<property name="text">
<string>Choose</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="printHeaderCheckBox">
<property name="text">
<string>Print header</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="printTotalCheckBox">
<property name="text">
<string>Print total</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QTableWidget" name="tableWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<row>
<property name="text">
<string>Goods name</string>
</property>
</row>
<row>
<property name="text">
<string>Goods price</string>
</property>
</row>
<row>
<property name="text">
<string>Goods quantity</string>
</property>
</row>
<row>
<property name="text">
<string>Goods net weight</string>
</property>
</row>
<row>
<property name="text">
<string>Goods total</string>
</property>
</row>
<column>
<property name="text">
<string>position</string>
</property>
</column>
<column>
<property name="text">
<string>name</string>
</property>
</column>
<item row="0" column="0">
<property name="text">
<string>1</string>
</property>
</item>
<item row="0" column="1">
<property name="text">
<string>Name</string>
</property>
</item>
<item row="1" column="0">
<property name="text">
<string>2</string>
</property>
</item>
<item row="1" column="1">
<property name="text">
<string>Price</string>
</property>
</item>
<item row="2" column="0">
<property name="text">
<string>3</string>
</property>
</item>
<item row="2" column="1">
<property name="text">
<string>Quantity</string>
</property>
</item>
<item row="3" column="0">
<property name="text">
<string>4</string>
</property>
</item>
<item row="3" column="1">
<property name="text">
<string>Net weight</string>
</property>
</item>
<item row="4" column="0">
<property name="text">
<string>5</string>
</property>
</item>
<item row="4" column="1">
<property name="text">
<string>Total price</string>
</property>
</item>
</widget>
</item>
<item row="4" column="2">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>OutputDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>OutputDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -28,20 +28,39 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="49"/>
<source>Store type</source>
<translation type="obsolete">Store type</translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="26"/>
<source>Check content</source>
<translation type="unfinished">Check content</translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="23"/>
<location filename="../scenes/emailtextscene.ui" line="33"/>
<source>Parse</source>
<translation type="unfinished">Parse</translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="36"/>
<location filename="../scenes/emailtextscene.ui" line="46"/>
<source>Store:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="62"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../emailtextscene.cpp" line="31"/>
<source>An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.</source>
<translation type="unfinished">An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.</translation>
</message>
<message>
<location filename="../emailtextscene.cpp" line="33"/>
<source>Error in parsing</source>
<translation type="unfinished">Error in parsing</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -206,30 +225,60 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="41"/>
<location filename="../scenes/ocrscene.ui" line="64"/>
<source>Choose</source>
<translation type="unfinished">Choose</translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="54"/>
<location filename="../scenes/ocrscene.ui" line="103"/>
<source>Path to image:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="67"/>
<location filename="../scenes/ocrscene.ui" line="119"/>
<source>Store:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="90"/>
<source>Recognized text will be shown below as soon as image will be processed. Please, edit it</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="83"/>
<location filename="../scenes/ocrscene.ui" line="77"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="96"/>
<location filename="../scenes/ocrscene.ui" line="45"/>
<source>Parse</source>
<translation type="unfinished">Parse</translation>
</message>
<message>
<location filename="../ocrscene.cpp" line="36"/>
<source>An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.</source>
<translation type="unfinished">An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.</translation>
</message>
<message>
<location filename="../ocrscene.cpp" line="38"/>
<source>Error in parsing</source>
<translation type="unfinished">Error in parsing</translation>
</message>
<message>
<location filename="../ocrscene.cpp" line="56"/>
<source>Please, select a picture to scan</source>
<translation type="unfinished">Please, select a picture to scan</translation>
</message>
<message>
<location filename="../ocrscene.cpp" line="58"/>
<source>Picture was not selected</source>
<translation type="unfinished">Picture was not selected</translation>
</message>
<message>
<location filename="../ocrscene.cpp" line="64"/>
<source>Path to image: </source>
<translation type="unfinished">Path to image: </translation>
</message>
</context>
<context>
<name>OFDScene</name>
@ -300,7 +349,7 @@
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="162"/>
<source>Choose image</source>
<source>Choose image on your PC</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -317,92 +366,114 @@
<context>
<name>OutputDialog</name>
<message>
<location filename="../scenes/outputdialog.ui" line="14"/>
<source>Dialog</source>
<translation type="vanished">Dialog</translation>
<translation>Dialog</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="20"/>
<source>Path to export: </source>
<translation type="vanished">Path to export: </translation>
<translation>Path to export: </translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="27"/>
<source>Choose</source>
<translation type="vanished">Choose</translation>
<translation>Choose</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="34"/>
<source>Print header</source>
<translation type="vanished">Print header</translation>
<translation>Print header</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="55"/>
<source>Goods name</source>
<translation type="vanished">Goods name</translation>
<translation>Goods name</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="60"/>
<source>Goods price</source>
<translation type="vanished">Goods price</translation>
<translation>Goods price</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="65"/>
<source>Goods quantity</source>
<translation type="vanished">Goods quality</translation>
<translation>Goods quality</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="70"/>
<source>Goods net weight</source>
<translation type="vanished">Goods net weight</translation>
<translation>Goods net weight</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="75"/>
<source>Goods total</source>
<translation type="vanished">Goods total</translation>
<translation>Goods total</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="80"/>
<source>position</source>
<translation type="vanished">position</translation>
<translation>position</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="85"/>
<source>name</source>
<translation type="vanished">name</translation>
<translation>name</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="90"/>
<source>1</source>
<translation type="vanished">1</translation>
<translation>1</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="95"/>
<source>Name</source>
<translation type="vanished">Name</translation>
<translation>Name</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="100"/>
<source>2</source>
<translation type="vanished">2</translation>
<translation>2</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="105"/>
<source>Price</source>
<translation type="vanished">Price</translation>
<translation>Price</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="110"/>
<source>3</source>
<translation type="vanished">3</translation>
<translation>3</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="115"/>
<source>Quantity</source>
<translation type="vanished">Quantity</translation>
<translation>Quantity</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="120"/>
<source>4</source>
<translation type="vanished">4</translation>
<translation>4</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="125"/>
<source>Net weight</source>
<translation type="vanished">Net Weight</translation>
<translation>Net Weight</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="130"/>
<source>5</source>
<translation type="vanished">5</translation>
<translation>5</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="135"/>
<source>Total price</source>
<translation type="vanished">Total price</translation>
<translation>Total price</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="41"/>
<source>Print total</source>
<translation type="vanished">Print total</translation>
<translation>Print total</translation>
</message>
</context>
<context>

View File

@ -28,20 +28,39 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="49"/>
<source>Store type</source>
<translation type="obsolete">Магазин</translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="26"/>
<source>Check content</source>
<translation type="unfinished">Контент чека</translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="23"/>
<location filename="../scenes/emailtextscene.ui" line="33"/>
<source>Parse</source>
<translation type="unfinished">Парсить</translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="36"/>
<location filename="../scenes/emailtextscene.ui" line="46"/>
<source>Store:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/emailtextscene.ui" line="62"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../emailtextscene.cpp" line="31"/>
<source>An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.</source>
<translation type="unfinished">Произошла ошибка. Чек был прочитан неверно. Размеры векторов различаются. Пожалуйста, сообщите об этом разработчику.</translation>
</message>
<message>
<location filename="../emailtextscene.cpp" line="33"/>
<source>Error in parsing</source>
<translation type="unfinished">Ошибка в парсинге</translation>
</message>
</context>
<context>
<name>MainWindow</name>
@ -206,30 +225,60 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="41"/>
<location filename="../scenes/ocrscene.ui" line="64"/>
<source>Choose</source>
<translation type="unfinished">Выбрать</translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="54"/>
<location filename="../scenes/ocrscene.ui" line="103"/>
<source>Path to image:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="67"/>
<location filename="../scenes/ocrscene.ui" line="119"/>
<source>Store:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="90"/>
<source>Recognized text will be shown below as soon as image will be processed. Please, edit it</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="83"/>
<location filename="../scenes/ocrscene.ui" line="77"/>
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../scenes/ocrscene.ui" line="96"/>
<location filename="../scenes/ocrscene.ui" line="45"/>
<source>Parse</source>
<translation type="unfinished">Парсить</translation>
</message>
<message>
<location filename="../ocrscene.cpp" line="36"/>
<source>An error has occured. Check was matched incorrectly. Vector sizes are different. Please, contact the developer.</source>
<translation type="unfinished">Произошла ошибка. Чек был прочитан неверно. Размеры векторов различаются. Пожалуйста, сообщите об этом разработчику.</translation>
</message>
<message>
<location filename="../ocrscene.cpp" line="38"/>
<source>Error in parsing</source>
<translation type="unfinished">Ошибка в парсинге</translation>
</message>
<message>
<location filename="../ocrscene.cpp" line="56"/>
<source>Please, select a picture to scan</source>
<translation type="unfinished">Пожалуйста, выберете изображение для сканирования</translation>
</message>
<message>
<location filename="../ocrscene.cpp" line="58"/>
<source>Picture was not selected</source>
<translation type="unfinished">Изображение не было выбрано</translation>
</message>
<message>
<location filename="../ocrscene.cpp" line="64"/>
<source>Path to image: </source>
<translation type="unfinished">Путь к изображению: </translation>
</message>
</context>
<context>
<name>OFDScene</name>
@ -300,7 +349,7 @@
</message>
<message>
<location filename="../scenes/ofdscene.ui" line="162"/>
<source>Choose image</source>
<source>Choose image on your PC</source>
<translation type="unfinished"></translation>
</message>
<message>
@ -317,92 +366,114 @@
<context>
<name>OutputDialog</name>
<message>
<location filename="../scenes/outputdialog.ui" line="14"/>
<source>Dialog</source>
<translation type="vanished">Диалог</translation>
<translation>Диалог</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="20"/>
<source>Path to export: </source>
<translation type="vanished">Путь для экспорта: </translation>
<translation>Путь для экспорта: </translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="27"/>
<source>Choose</source>
<translation type="vanished">Выбрать</translation>
<translation>Выбрать</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="34"/>
<source>Print header</source>
<translation type="vanished">Печатать заголовок</translation>
<translation>Печатать заголовок</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="55"/>
<source>Goods name</source>
<translation type="vanished">Имя товара</translation>
<translation>Имя товара</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="60"/>
<source>Goods price</source>
<translation type="vanished">Цена товара</translation>
<translation>Цена товара</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="65"/>
<source>Goods quantity</source>
<translation type="vanished">Количество товара</translation>
<translation>Количество товара</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="70"/>
<source>Goods net weight</source>
<translation type="vanished">Масса нетто товара</translation>
<translation>Масса нетто товара</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="75"/>
<source>Goods total</source>
<translation type="vanished">Всего за товар</translation>
<translation>Всего за товар</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="80"/>
<source>position</source>
<translation type="vanished">позиция</translation>
<translation>позиция</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="85"/>
<source>name</source>
<translation type="vanished">алиас</translation>
<translation>алиас</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="90"/>
<source>1</source>
<translation type="vanished">1</translation>
<translation>1</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="95"/>
<source>Name</source>
<translation type="vanished">Имя</translation>
<translation>Имя</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="100"/>
<source>2</source>
<translation type="vanished">2</translation>
<translation>2</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="105"/>
<source>Price</source>
<translation type="vanished">Цена</translation>
<translation>Цена</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="110"/>
<source>3</source>
<translation type="vanished">3</translation>
<translation>3</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="115"/>
<source>Quantity</source>
<translation type="vanished">Количество</translation>
<translation>Количество</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="120"/>
<source>4</source>
<translation type="vanished">4</translation>
<translation>4</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="125"/>
<source>Net weight</source>
<translation type="vanished">Масса нетто</translation>
<translation>Масса нетто</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="130"/>
<source>5</source>
<translation type="vanished">5</translation>
<translation>5</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="135"/>
<source>Total price</source>
<translation type="vanished">Всего</translation>
<translation>Всего</translation>
</message>
<message>
<location filename="../scenes/outputdialog.ui" line="41"/>
<source>Print total</source>
<translation type="vanished">Печатать Итого</translation>
<translation>Печатать Итого</translation>
</message>
</context>
<context>