Wed, 08 May 2013 14:57:48 +0300
Viewport no longer offsets stuff based on bbox size, that was stupid. Only use bbox size for initial zoom.
179
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
3 | * Copyright (C) 2013 Santeri Piippo |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | * |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | * |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | * |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | #ifndef LDRAWPATHDIALOG_H |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | #define LDRAWPATHDIALOG_H |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | #include <qdialog.h> |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | #include "common.h" |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
25 | class QLabel; |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
26 | class QLineEdit; |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
27 | class QDialogButtonBox; |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
28 | |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
29 | class LDrawPathDialog : public QDialog { |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
30 | Q_OBJECT |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
31 | |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
32 | public: |
180
16306e69a895
Moved LDraw path setting out of the configuration dialog to the LDraw path dialog, it does the job better.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
179
diff
changeset
|
33 | explicit LDrawPathDialog (const bool validDefault, QWidget* parent = null, Qt::WindowFlags f = 0); |
179
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | str path () const; |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
35 | void setPath (str path); |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
36 | void (*callback ()) () const { return m_callback; } |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
37 | void setCallback (void (*callback) ()) { m_callback = callback; } |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
39 | private: |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
40 | Q_DISABLE_COPY (LDrawPathDialog) |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
41 | |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
42 | QLabel* lb_resolution; |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
43 | QLineEdit* le_path; |
180
16306e69a895
Moved LDraw path setting out of the configuration dialog to the LDraw path dialog, it does the job better.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
179
diff
changeset
|
44 | QPushButton* btn_findPath, *btn_tryConfigure, *btn_cancel; |
179
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
45 | QDialogButtonBox* dbb_buttons; |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
46 | void (*m_callback) (); |
180
16306e69a895
Moved LDraw path setting out of the configuration dialog to the LDraw path dialog, it does the job better.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
179
diff
changeset
|
47 | const bool m_validDefault; |
179
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
48 | |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
49 | QPushButton* okButton (); |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
50 | |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
51 | private slots: |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
52 | void slot_findPath (); |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
53 | void slot_tryConfigure (); |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
54 | void slot_exit (); |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
55 | }; |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
56 | |
f98391b179ab
Added a dialog for inquering the user's LDraw directory, not having it set leads to crashing...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
57 | #endif // LDRAWPATHDIALOG_H |