116 lines
2.9 KiB
C++
116 lines
2.9 KiB
C++
#ifndef MAINWINDOW_H
|
|
#define MAINWINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include "../controller/maincontroller.h"
|
|
#include "editpdfwidget.h"
|
|
#include "previewpdfwidget.h"
|
|
#include "importeddataview.h"
|
|
#include <QHBoxLayout>
|
|
#include <QMenuBar>
|
|
#include <QMessageBox>
|
|
#include <QToolBar>
|
|
#include <QDockWidget>
|
|
#include <QStatusBar>
|
|
#include <QProgressBar>
|
|
#include <QAction>
|
|
#include <QTimer>
|
|
|
|
class VedomostTableModel;
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
MainWindow(MainController* controller,QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
// Метод для открытия проекта по пути (используется из командной строки)
|
|
void openProjectFile(const QString &filePath);
|
|
|
|
|
|
protected:
|
|
void closeEvent(QCloseEvent *event) override;
|
|
|
|
private:
|
|
void setUp();
|
|
void setWidgets();
|
|
void setUpLayout();
|
|
void setUpConnections();
|
|
void updateWindowTitle();
|
|
bool askForSave();
|
|
void disableInterfaceExceptProjectActions();
|
|
void enableInterface();
|
|
void updateStatusBar();
|
|
void updateViewMenuState();
|
|
|
|
MainController* m_controller;
|
|
QString m_currentProjectPath;
|
|
|
|
EditPDFWidget* m_editWidget;
|
|
PreviewPdfWidget* m_pdfWidget;
|
|
ImportedDataView* m_dataView;
|
|
|
|
QDockWidget *m_dataPanelDockWidget;
|
|
|
|
QDockWidget *m_pdfPanelDockWidget;
|
|
|
|
QToolBar *m_toolBar;
|
|
QToolBar *m_toolBar2;
|
|
|
|
QWidget *m_centralWidget;
|
|
|
|
QStatusBar *m_statusBar;
|
|
|
|
QMenuBar *m_menuBar;
|
|
QMenu *m_fileMenu;
|
|
QMenu *m_exportMenu;
|
|
QMenu *m_viewMenu;
|
|
QMenu *m_helpMenu;
|
|
|
|
// Элементы для асинхронного парсинга
|
|
QProgressBar *m_progressBar;
|
|
QAction *m_cancelParsingAction;
|
|
bool m_isParsing;
|
|
|
|
private slots:
|
|
void onHelpAbout();
|
|
void onHelpManual();
|
|
void onFileNew();
|
|
void onFileOpen();
|
|
bool onFileSave();
|
|
void onFileSaveAs();
|
|
void onFileImportAltium();
|
|
void onProjectSettings();
|
|
void onFileExit();
|
|
void onExportSpecification();
|
|
void onExportPerechen();
|
|
void onExportPurchaseList();
|
|
void onExportSpecificationPcb();
|
|
void onExportAll();
|
|
void onExportSpecificationToCsv();
|
|
void onExportPerechenToCsv();
|
|
void onExportPurchaseListToCsv();
|
|
void onExportSpecificationPcbToCsv();
|
|
void onExportSimpleListToCsv();
|
|
void onUndo();
|
|
void onRedo();
|
|
|
|
// Слоты для управления видом
|
|
void onViewDataPanel();
|
|
void onViewPdfPreview();
|
|
void onViewResetLayout();
|
|
|
|
// Слоты для асинхронного парсинга
|
|
void onParsingStarted();
|
|
void onParsingFinished(bool success);
|
|
void onParsingProgress(int percentage);
|
|
void onParsingError(const QString &error);
|
|
|
|
// Метод для получения модели перечня элементов (для экспорта)
|
|
PerechenTableModel* getPerechenTableModel() const;
|
|
|
|
};
|
|
#endif // MAINWINDOW_H
|