1 #pragma once
2 
3 #ifndef MAGPIEFILEIMPORTPOPUP_H
4 #define MAGPIEFILEIMPORTPOPUP_H
5 
6 #include "toonzqt/dvdialog.h"
7 #include "tfilepath.h"
8 
9 class FlipBook;
10 
11 namespace DVGui {
12 class IntLineEdit;
13 class FileField;
14 class LineEdit;
15 }
16 
17 class MagpieInfo {
18   QList<QString> m_actorActs;
19   QList<QString> m_comments;
20   QList<QString> m_actsIdentifier;
21   QString m_fileName;
22 
23 public:
24   MagpieInfo(TFilePath path);
25 
getFrameCount()26   int getFrameCount() const { return m_comments.size(); }
27 
getComments()28   QList<QString> getComments() const { return m_comments; }
getActorActs()29   QList<QString> getActorActs() const { return m_actorActs; }
getActsIdentifier()30   QList<QString> getActsIdentifier() const { return m_actsIdentifier; }
getFileName()31   QString getFileName() const { return m_fileName; }
32 };
33 
34 //=============================================================================
35 // MagpieFileImportPopup
36 //-----------------------------------------------------------------------------
37 
38 class MagpieFileImportPopup final : public DVGui::Dialog {
39   Q_OBJECT
40 
41   MagpieInfo *m_info;
42 
43   DVGui::FileField *m_levelField;
44   DVGui::IntLineEdit *m_fromField;
45   DVGui::IntLineEdit *m_toField;
46 
47   QList<QPair<QLabel *, DVGui::IntLineEdit *>> m_actFields;
48 
49   FlipBook *m_flipbook;
50   TFilePath m_levelPath;
51 
52 public:
53   MagpieFileImportPopup();
54 
55   void setFilePath(TFilePath path);
56 
57 protected:
58   void showEvent(QShowEvent *) override;
59   void hideEvent(QHideEvent *) override;
60 
61 protected slots:
62   void onLevelPathChanged();
63   void onOkPressed();
64 
65 signals:
66   void closeButtonPressed();
67   void doubleClick();
68 };
69 
70 #endif  // MAGPIEFILEIMPORTPOPUP_H
71