src/dialogs/ldrawpathdialog.h

Thu, 04 Jan 2018 20:23:21 +0200

author
Santeri Piippo
date
Thu, 04 Jan 2018 20:23:21 +0200
changeset 1220
c4c37abbe22b
parent 1217
314e12e23c3a
child 1222
34def2630300
permissions
-rw-r--r--

reduce main.cpp

954
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
1 /*
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
2 * LDForge: LDraw parts authoring CAD
968
4b93b7963456 Happy new year 2015
Teemu Piippo <crimsondusk64@gmail.com>
parents: 954
diff changeset
3 * Copyright (C) 2013 - 2015 Teemu Piippo
954
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
4 *
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
5 * This program is free software: you can redistribute it and/or modify
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
6 * it under the terms of the GNU General Public License as published by
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
8 * (at your option) any later version.
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
9 *
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
10 * This program is distributed in the hope that it will be useful,
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
13 * GNU General Public License for more details.
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
14 *
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
15 * You should have received a copy of the GNU General Public License
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
17 */
7feaa1a3c438 Refactor the new part dialog into a new class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 953
diff changeset
18
953
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 #pragma once
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 #include <QDialog>
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21 #include "../main.h"
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23 class LDrawPathDialog : public QDialog
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
24 {
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
25 Q_OBJECT
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
26
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27 public:
1217
314e12e23c3a fix paren style
Santeri Piippo
parents: 987
diff changeset
28 LDrawPathDialog(const QString& defaultPath, bool validDefault, QWidget* parent = nullptr, Qt::WindowFlags f = 0);
953
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
29 virtual ~LDrawPathDialog();
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
30 QString path() const;
1217
314e12e23c3a fix paren style
Santeri Piippo
parents: 987
diff changeset
31 void setPath(QString path);
314e12e23c3a fix paren style
Santeri Piippo
parents: 987
diff changeset
32 void setStatusText(const QString& statusText, bool ok);
953
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
33
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
34 signals:
1217
314e12e23c3a fix paren style
Santeri Piippo
parents: 987
diff changeset
35 void pathChanged(QString newPath);
953
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
36
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
37 private:
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
38 const bool m_hasValidDefault;
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
39 class Ui_LDrawPathDialog& ui;
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
40 QPushButton* okButton();
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
41 QPushButton* cancelButton();
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
42
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
43 private slots:
8349552ee5e9 Refactor LDrawPathDialog and LDPaths
Teemu Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
44 void searchButtonClicked();
987
91281e39c50c Removed the exiting hacks
Teemu Piippo <crimsondusk64@gmail.com>
parents: 984
diff changeset
45 };

mercurial