src/dialogs.h

changeset 667
31540c1f22ea
parent 606
3dd6f343ec06
equal deleted inserted replaced
666:c595cfb4791c 667:31540c1f22ea
1 /* 1 /*
2 * LDForge: LDraw parts authoring CAD 2 * LDForge: LDraw parts authoring CAD
3 * Copyright (C) 2013 Santeri Piippo 3 * Copyright (C) 2013, 2014 Santeri Piippo
4 * 4 *
5 * This program is free software: you can redistribute it and/or modify 5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or 7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version. 8 * (at your option) any later version.
18 18
19 #ifndef LDFORGE_DIALOGS_H 19 #ifndef LDFORGE_DIALOGS_H
20 #define LDFORGE_DIALOGS_H 20 #define LDFORGE_DIALOGS_H
21 21
22 #include <QDialog> 22 #include <QDialog>
23 #include "common.h" 23 #include "main.h"
24 #include "types.h" 24 #include "types.h"
25 25
26 class Ui_ExtProgPath; 26 class Ui_ExtProgPath;
27 class QRadioButton; 27 class QRadioButton;
28 class QCheckBox; 28 class QCheckBox;
39 class Ui_OverlayUI; 39 class Ui_OverlayUI;
40 class Ui_LDPathUI; 40 class Ui_LDPathUI;
41 class Ui_OpenProgressUI; 41 class Ui_OpenProgressUI;
42 42
43 class OverlayDialog : public QDialog 43 class OverlayDialog : public QDialog
44 { Q_OBJECT 44 {
45 Q_OBJECT
45 46
46 public: 47 public:
47 explicit OverlayDialog (QWidget* parent = null, Qt::WindowFlags f = 0); 48 explicit OverlayDialog (QWidget* parent = null, Qt::WindowFlags f = 0);
48 virtual ~OverlayDialog(); 49 virtual ~OverlayDialog();
49 50
50 str fpath() const; 51 QString fpath() const;
51 int ofsx() const; 52 int ofsx() const;
52 int ofsy() const; 53 int ofsy() const;
53 double lwidth() const; 54 double lwidth() const;
54 double lheight() const; 55 double lheight() const;
55 int camera() const; 56 int camera() const;
65 void fillDefaults (int newcam); 66 void fillDefaults (int newcam);
66 }; 67 };
67 68
68 // ============================================================================= 69 // =============================================================================
69 class LDrawPathDialog : public QDialog 70 class LDrawPathDialog : public QDialog
70 { Q_OBJECT 71 {
72 Q_OBJECT
71 73
72 public: 74 public:
73 explicit LDrawPathDialog (const bool validDefault, QWidget* parent = null, Qt::WindowFlags f = 0); 75 explicit LDrawPathDialog (const bool validDefault, QWidget* parent = null, Qt::WindowFlags f = 0);
74 virtual ~LDrawPathDialog(); 76 virtual ~LDrawPathDialog();
75 str filename() const; 77 QString filename() const;
76 void setPath (str path); 78 void setPath (QString path);
77 79
78 private: 80 private:
79 Q_DISABLE_COPY (LDrawPathDialog) 81 Q_DISABLE_COPY (LDrawPathDialog)
80 const bool m_validDefault; 82 const bool m_validDefault;
81 Ui_LDPathUI* ui; 83 Ui_LDPathUI* ui;
89 void slot_accept(); 91 void slot_accept();
90 }; 92 };
91 93
92 // ============================================================================= 94 // =============================================================================
93 class OpenProgressDialog : public QDialog 95 class OpenProgressDialog : public QDialog
94 { Q_OBJECT 96 {
95 READ_PROPERTY (int, progress, setProgress) 97 Q_OBJECT
96 DECLARE_PROPERTY (int, numLines, setNumLines) 98 PROPERTY (public, int, Progress, NUM_OPS, STOCK_WRITE)
99 PROPERTY (public, int, NumLines, NUM_OPS, CUSTOM_WRITE)
97 100
98 public: 101 public:
99 explicit OpenProgressDialog (QWidget* parent = null, Qt::WindowFlags f = 0); 102 explicit OpenProgressDialog (QWidget* parent = null, Qt::WindowFlags f = 0);
100 virtual ~OpenProgressDialog(); 103 virtual ~OpenProgressDialog();
101 104
108 void updateValues(); 111 void updateValues();
109 }; 112 };
110 113
111 // ============================================================================= 114 // =============================================================================
112 class ExtProgPathPrompt : public QDialog 115 class ExtProgPathPrompt : public QDialog
113 { Q_OBJECT 116 {
117 Q_OBJECT
114 118
115 public: 119 public:
116 explicit ExtProgPathPrompt (str progName, QWidget* parent = 0, Qt::WindowFlags f = 0); 120 explicit ExtProgPathPrompt (QString progName, QWidget* parent = 0, Qt::WindowFlags f = 0);
117 virtual ~ExtProgPathPrompt(); 121 virtual ~ExtProgPathPrompt();
118 str getPath() const; 122 QString getPath() const;
119 123
120 public slots: 124 public slots:
121 void findPath(); 125 void findPath();
122 126
123 private: 127 private:
124 Ui_ExtProgPath* ui; 128 Ui_ExtProgPath* ui;
125 }; 129 };
126 130
127 // ============================================================================= 131 // =============================================================================
128 class AboutDialog : public QDialog 132 class AboutDialog : public QDialog
129 { Q_OBJECT 133 {
134 Q_OBJECT
130 135
131 public: 136 public:
132 AboutDialog (QWidget* parent = null, Qt::WindowFlags f = 0); 137 AboutDialog (QWidget* parent = null, Qt::WindowFlags f = 0);
133 138
134 private slots: 139 private slots:
135 void slot_mail(); 140 void slot_mail();
136 }; 141 };
137 142
138 void bombBox (const str& message); 143 void bombBox (const QString& message);
139 144
140 #endif // LDFORGE_DIALOGS_H 145 #endif // LDFORGE_DIALOGS_H

mercurial