LibrePCB Developers Documentation
mainwindow.h
Go to the documentation of this file.
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3 
5 #include <librepcb/common/uuid.h>
6 
7 #include <QtCore>
8 #include <QtWidgets>
9 
10 namespace Ui {
11 class MainWindow;
12 }
13 
14 namespace parseagle {
15 class Symbol;
16 class Package;
17 class DeviceSet;
18 } // namespace parseagle
19 
20 namespace librepcb {
21 
22 namespace eagleimport {
23 class ConverterDb;
24 }
25 
26 class MainWindow : public QMainWindow {
27  Q_OBJECT
28 
29 public:
30  explicit MainWindow(QWidget* parent = 0);
31  ~MainWindow();
32 
33 private slots:
34  void on_inputBtn_clicked();
35  void on_outputBtn_clicked();
36  void on_btnAbort_clicked();
37  void on_btnConvertSymbols_clicked();
38  void on_btnConvertDevices_clicked();
39  void on_pushButton_2_clicked();
40  void on_btnPathsFromIni_clicked();
41  void on_toolButton_clicked();
42  void on_toolButton_2_clicked();
43  void on_toolButton_3_clicked();
44  void on_toolButton_4_clicked();
45  void on_uuidListBtn_clicked();
46 
47 private:
48  enum class ConvertFileType_t {
49  Symbols_to_Symbols,
50  Packages_to_PackagesAndDevices,
51  Devices_to_Components
52  };
53 
54  void reset();
55  void addError(const QString& msg,
56  const librepcb::FilePath& inputFile = librepcb::FilePath(),
57  int inputLine = 0);
58  void convertAllFiles(ConvertFileType_t type);
59  void convertFile(ConvertFileType_t type, eagleimport::ConverterDb& db,
60  const librepcb::FilePath& filepath);
61  bool convertSymbol(eagleimport::ConverterDb& db,
62  const parseagle::Symbol& symbol);
63  bool convertPackage(eagleimport::ConverterDb& db,
64  const parseagle::Package& package);
65  bool convertDevice(eagleimport::ConverterDb& db,
66  const parseagle::DeviceSet& deviceSet);
67 
68  // Attributes
69  Ui::MainWindow* ui;
74 };
75 
76 } // namespace librepcb
77 
78 #endif // MAINWINDOW_H
QString mlastInputDirectory
Definition: mainwindow.h:71
int mConvertedElementsCount
Definition: mainwindow.h:73
Definition: mainwindow.h:10
Definition: airwiresbuilder.cpp:32
The ConverterDb class.
Definition: converterdb.h:47
Definition: mainwindow.h:26
Ui::MainWindow * ui
Definition: mainwindow.h:69
This class represents absolute, well-formatted paths to files or directories.
Definition: filepath.h:127
ConvertFileType_t
Definition: mainwindow.h:48
Definition: deviceconverter.h:34
bool mAbortConversion
Definition: mainwindow.h:70
Definition: mainwindow.h:10
int mReadedElementsCount
Definition: mainwindow.h:72