This commit is contained in:
leca 2024-09-01 16:15:00 +03:00
parent f9b0b75062
commit 5c6700f621
5 changed files with 83 additions and 109 deletions

View File

@ -3,9 +3,9 @@
#include "../goods/goods.h" #include "../goods/goods.h"
#include <vector> #include <vector>
class Check class Check {
{
std::vector<Goods> goods; std::vector<Goods> goods;
public: public:
Check(); Check();
void add_goods(Goods); void add_goods(Goods);

View File

@ -5,6 +5,7 @@
#include "outputdialog.h" #include "outputdialog.h"
#include "settings.h" #include "settings.h"
#include <iostream> #include <iostream>
#include <QFileDialog>
MainWindow::MainWindow(QWidget *parent) MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow) { : QMainWindow(parent), ui(new Ui::MainWindow) {
@ -35,14 +36,16 @@ void MainWindow::setupStoresList() {
} }
void MainWindow::on_checkType_currentIndexChanged(int index) { void MainWindow::on_checkType_currentIndexChanged(int index) {
switch (index) {
case 0: ui->inputHolder->setCurrentIndex(index);
ui->checkInfoText->setVisible(true); // switch (index) {
break; // case 0:
case 1: // ui->checkInfoText->setVisible(true);
ui->checkInfoText->setVisible(false); // break;
break; // case 1:
} // ui->checkInfoText->setVisible(false);
// break;
// }
} }
void MainWindow::on_parseButton_clicked() { void MainWindow::on_parseButton_clicked() {
@ -72,3 +75,12 @@ void MainWindow::on_storeType_currentIndexChanged(int index) {
std::string module = parser.search_modules()[index]; std::string module = parser.search_modules()[index];
parser.set_module(module); parser.set_module(module);
} }
void MainWindow::on_chooseImageButton_clicked() {
QString filename = QFileDialog::getOpenFileName();
std::cout << filename.toStdString() << std::endl;
// this->options.set_path(filename.toStdString());
ui->pathLabel->setText("Path to export: " + filename);
}

View File

@ -31,6 +31,8 @@ private slots:
void on_storeType_currentIndexChanged(int index); void on_storeType_currentIndexChanged(int index);
void on_chooseImageButton_clicked();
private: private:
Ui::MainWindow *ui; Ui::MainWindow *ui;
}; };

View File

@ -66,28 +66,29 @@
</item> </item>
<item> <item>
<property name="text"> <property name="text">
<string>Image (not yet implemented)</string> <string>Image (OCR)</string>
</property> </property>
</item> </item>
</widget> </widget>
<widget class="QWidget" name="checkInfoText" native="true"> <widget class="QStackedWidget" name="inputHolder">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>10</x>
<y>70</y> <y>80</y>
<width>421</width> <width>501</width>
<height>511</height> <height>471</height>
</rect> </rect>
</property> </property>
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="page_5">
<widget class="QLabel" name="checkContentLabel"> <widget class="QLabel" name="checkContentLabel">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>10</x>
<y>10</y> <y>10</y>
<width>121</width> <width>101</width>
<height>18</height> <height>18</height>
</rect> </rect>
</property> </property>
@ -98,82 +99,42 @@
<widget class="QPlainTextEdit" name="checkContent"> <widget class="QPlainTextEdit" name="checkContent">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>10</x>
<y>40</y> <y>50</y>
<width>401</width> <width>431</width>
<height>411</height> <height>401</height>
</rect> </rect>
</property> </property>
<property name="plainText">
<string/>
</property>
</widget> </widget>
<widget class="QPushButton" name="parseButton"> </widget>
<widget class="QWidget" name="page_6">
<widget class="QLabel" name="pathLabel">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>20</x> <x>110</x>
<y>480</y> <y>20</y>
<width>161</width>
<height>18</height>
</rect>
</property>
<property name="text">
<string>Path to image: </string>
</property>
</widget>
<widget class="QPushButton" name="chooseImageButton">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>80</width> <width>80</width>
<height>26</height> <height>26</height>
</rect> </rect>
</property> </property>
<property name="text"> <property name="text">
<string>Parse</string> <string>Choose</string>
</property> </property>
</widget> </widget>
</widget> </widget>
<widget class="QTabWidget" name="tabWidget">
<property name="geometry">
<rect>
<x>460</x>
<y>270</y>
<width>301</width>
<height>221</height>
</rect>
</property>
<property name="tabPosition">
<enum>QTabWidget::TabPosition::North</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::TabShape::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<property name="elideMode">
<enum>Qt::TextElideMode::ElideNone</enum>
</property>
<property name="documentMode">
<bool>true</bool>
</property>
<property name="tabsClosable">
<bool>false</bool>
</property>
<property name="tabBarAutoHide">
<bool>true</bool>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Text</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Image</string>
</attribute>
</widget>
</widget>
<widget class="QStackedWidget" name="stackedWidget">
<property name="geometry">
<rect>
<x>460</x>
<y>60</y>
<width>241</width>
<height>151</height>
</rect>
</property>
<widget class="QWidget" name="page_5"/>
<widget class="QWidget" name="page_6"/>
</widget> </widget>
</widget> </widget>
<widget class="QMenuBar" name="menubar"> <widget class="QMenuBar" name="menubar">

View File

@ -102,7 +102,6 @@ void update_settings(OutputOptions &options, ColumnType t, std::string name,
void OutputDialog::on_chooseFileButton_clicked() { void OutputDialog::on_chooseFileButton_clicked() {
QString filename = QFileDialog::getSaveFileName(); QString filename = QFileDialog::getSaveFileName();
std::cout << filename.toStdString() << std::endl;
this->options.set_path(filename.toStdString()); this->options.set_path(filename.toStdString());
ui->pathLabel->setText("Path to export: " + filename); ui->pathLabel->setText("Path to export: " + filename);
} }