1 #pragma once
2 
3 #ifndef LEVELCREATEPOPUP_H
4 #define LEVELCREATEPOPUP_H
5 
6 #include "toonzqt/dvdialog.h"
7 #include "toonzqt/doublefield.h"
8 #include "toonzqt/intfield.h"
9 #include "toonzqt/filefield.h"
10 
11 // forward declaration
12 class QLabel;
13 class QComboBox;
14 // class DVGui::MeasuredDoubleLineEdit;
15 
16 //=============================================================================
17 // LevelCreatePopup
18 //-----------------------------------------------------------------------------
19 
20 class LevelCreatePopup final : public DVGui::Dialog {
21   Q_OBJECT
22 
23   DVGui::LineEdit *m_nameFld;
24   DVGui::IntLineEdit *m_fromFld;
25   DVGui::IntLineEdit *m_toFld;
26   QComboBox *m_levelTypeOm;
27   DVGui::IntLineEdit *m_stepFld;
28   DVGui::IntLineEdit *m_incFld;
29   DVGui::FileField *m_pathFld;
30   QLabel *m_widthLabel;
31   QLabel *m_heightLabel;
32   QLabel *m_dpiLabel;
33   DVGui::MeasuredDoubleLineEdit *m_widthFld;
34   DVGui::MeasuredDoubleLineEdit *m_heightFld;
35   DVGui::DoubleLineEdit *m_dpiFld;
36 
37 public:
38   LevelCreatePopup();
39 
40   void setSizeWidgetEnable(bool isEnable);
41   int getLevelType() const;
42 
43   void update();
44   bool apply();
45 
46 protected:
47   // set m_pathFld to the default path
48   void updatePath();
49   void nextName();
50   void showEvent(QShowEvent *) override;
51   bool levelExists(std::wstring levelName);
52 
53 public slots:
54   void onLevelTypeChanged(int index);
55   void onOkBtn();
56 
57   void onApplyButton();
58 };
59 
60 #endif  // LEVELCREATEPOPUP_H
61