Thu, 09 Feb 2017 21:04:33 +0200
Moved dialogs.cpp to dialogs/externalprogrampathdialog.cpp
--- a/CMakeLists.txt Thu Feb 09 21:01:12 2017 +0200 +++ b/CMakeLists.txt Thu Feb 09 21:04:33 2017 +0200 @@ -31,7 +31,6 @@ src/canvas.cpp src/colors.cpp src/crashCatcher.cpp - src/dialogs.cpp src/documentation.cpp src/documentloader.cpp src/documentmanager.cpp @@ -59,6 +58,7 @@ src/version.cpp src/dialogs/colorselector.cpp src/dialogs/configdialog.cpp + src/dialogs/externalprogrampathdialog.cpp src/dialogs/generateprimitivedialog.cpp src/dialogs/ldrawpathdialog.cpp src/dialogs/newpartdialog.cpp @@ -86,7 +86,6 @@ src/canvas.h src/colors.h src/crashCatcher.h - src/dialogs.h src/documentation.h src/documentloader.h src/documentmanager.h @@ -118,6 +117,7 @@ src/transform.h src/dialogs/colorselector.h src/dialogs/configdialog.h + src/dialogs/externalprogrampathdialog.h src/dialogs/generateprimitivedialog.h src/dialogs/ldrawpathdialog.h src/dialogs/newpartdialog.h @@ -146,7 +146,6 @@ ui/coverer.ui ui/edger2.ui ui/editraw.ui - ui/extprogpath.ui ui/flip.ui ui/intersector.ui ui/isecalc.ui @@ -158,6 +157,7 @@ src/partdownloader.ui src/dialogs/colorselector.ui src/dialogs/configdialog.ui + src/dialogs/externalprogrampathdialog.ui src/dialogs/generateprimitivedialog.ui src/dialogs/ldrawpathdialog.ui src/dialogs/newpartdialog.ui
--- a/src/crashCatcher.cpp Thu Feb 09 21:01:12 2017 +0200 +++ b/src/crashCatcher.cpp Thu Feb 09 21:04:33 2017 +0200 @@ -24,7 +24,6 @@ # include <signal.h> # include <unistd.h> # include "crashCatcher.h" -# include "dialogs.h" # ifdef Q_OS_LINUX # include <sys/prctl.h>
--- a/src/dialogs.cpp Thu Feb 09 21:01:12 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -/* - * LDForge: LDraw parts authoring CAD - * Copyright (C) 2013 - 2017 Teemu Piippo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include <QFileDialog> -#include "dialogs.h" -#include "mainwindow.h" -#include "dialogs/configdialog.h" -#include "glRenderer.h" -#include "documentation.h" -#include "dialogs.h" -#include "ui_overlay.h" -#include "ui_extprogpath.h" - -/* - * Constructs a new external program path dialog. - */ -ExternalProgramPathDialog::ExternalProgramPathDialog(QString programName, QWidget* parent, Qt::WindowFlags flags) : - QDialog {parent, flags}, - ui {*new Ui_ExtProgPath} -{ - ui.setupUi (this); - QString labelText = ui.programLabel->text(); - labelText.replace("<PROGRAM>", programName); - ui.programLabel->setText(labelText); - connect(ui.findPathButton, SIGNAL(clicked (bool)), this, SLOT(findPath())); -} - -/* - * Destructs the UI pointer when the dialog is deleted. - */ -ExternalProgramPathDialog::~ExternalProgramPathDialog() -{ - delete &ui; -} - -/* - * Handler for the button in the dialog, shows a modal dialog for the user to locate the program. - */ -void ExternalProgramPathDialog::findPath() -{ - QString path = QFileDialog::getOpenFileName(nullptr, "", "", ConfigDialog::externalProgramPathFilter); - - if (not path.isEmpty()) - ui.path->setText(path); -} - -/* - * Returns the path specified by the user in this dialog. - */ -QString ExternalProgramPathDialog::path() const -{ - return ui.path->text(); -}
--- a/src/dialogs.h Thu Feb 09 21:01:12 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/* - * LDForge: LDraw parts authoring CAD - * Copyright (C) 2013 - 2017 Teemu Piippo - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#pragma once -#include <QDialog> -#include "main.h" - -/* - * Prompts the user for a path to an external program. - */ -class ExternalProgramPathDialog : public QDialog -{ - Q_OBJECT - -public: - explicit ExternalProgramPathDialog(QString programName, QWidget* parent = nullptr, Qt::WindowFlags f = 0); - ~ExternalProgramPathDialog(); - - Q_SLOT void findPath(); - QString path() const; - -private: - class Ui_ExtProgPath& ui; -};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dialogs/externalprogrampathdialog.cpp Thu Feb 09 21:04:33 2017 +0200 @@ -0,0 +1,66 @@ +/* + * LDForge: LDraw parts authoring CAD + * Copyright (C) 2013 - 2017 Teemu Piippo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include <QFileDialog> +#include "externalprogrampathdialog.h" +#include "configdialog.h" +#include "ui_extprogpath.h" +#include "../mainwindow.h" +#include "../glRenderer.h" +#include "../documentation.h" + +/* + * Constructs a new external program path dialog. + */ +ExternalProgramPathDialog::ExternalProgramPathDialog(QString programName, QWidget* parent, Qt::WindowFlags flags) : + QDialog {parent, flags}, + ui {*new Ui_ExtProgPath} +{ + ui.setupUi (this); + QString labelText = ui.programLabel->text(); + labelText.replace("<PROGRAM>", programName); + ui.programLabel->setText(labelText); + connect(ui.findPathButton, SIGNAL(clicked (bool)), this, SLOT(findPath())); +} + +/* + * Destructs the UI pointer when the dialog is deleted. + */ +ExternalProgramPathDialog::~ExternalProgramPathDialog() +{ + delete &ui; +} + +/* + * Handler for the button in the dialog, shows a modal dialog for the user to locate the program. + */ +void ExternalProgramPathDialog::findPath() +{ + QString path = QFileDialog::getOpenFileName(nullptr, "", "", ConfigDialog::externalProgramPathFilter); + + if (not path.isEmpty()) + ui.path->setText(path); +} + +/* + * Returns the path specified by the user in this dialog. + */ +QString ExternalProgramPathDialog::path() const +{ + return ui.path->text(); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dialogs/externalprogrampathdialog.h Thu Feb 09 21:04:33 2017 +0200 @@ -0,0 +1,39 @@ +/* + * LDForge: LDraw parts authoring CAD + * Copyright (C) 2013 - 2017 Teemu Piippo + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#pragma once +#include <QDialog> +#include "../main.h" + +/* + * Prompts the user for a path to an external program. + */ +class ExternalProgramPathDialog : public QDialog +{ + Q_OBJECT + +public: + explicit ExternalProgramPathDialog(QString programName, QWidget* parent = nullptr, Qt::WindowFlags f = 0); + ~ExternalProgramPathDialog(); + + Q_SLOT void findPath(); + QString path() const; + +private: + class Ui_ExtProgPath& ui; +};
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/dialogs/externalprogrampathdialog.ui Thu Feb 09 21:04:33 2017 +0200 @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ExtProgPath</class> + <widget class="QDialog" name="ExtProgPath"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>444</width> + <height>101</height> + </rect> + </property> + <property name="windowTitle"> + <string>Program path required</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="programLabel"> + <property name="text"> + <string>Please input a path for <PROGRAM>:</string> + </property> + </widget> + </item> + <item> + <layout class="QHBoxLayout" name="horizontalLayout"> + <item> + <widget class="QLineEdit" name="path"/> + </item> + <item> + <widget class="QPushButton" name="findPathButton"> + <property name="text"> + <string>...</string> + </property> + </widget> + </item> + </layout> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources/> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>ExtProgPath</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>ExtProgPath</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui>
--- a/src/glRenderer.cpp Thu Feb 09 21:01:12 2017 +0200 +++ b/src/glRenderer.cpp Thu Feb 09 21:04:33 2017 +0200 @@ -30,7 +30,6 @@ #include "mainwindow.h" #include "miscallenous.h" #include "editHistory.h" -#include "dialogs.h" #include "glCompiler.h" #include "primitives.h" #include "documentmanager.h"
--- a/src/miscallenous.cpp Thu Feb 09 21:01:12 2017 +0200 +++ b/src/miscallenous.cpp Thu Feb 09 21:04:33 2017 +0200 @@ -22,7 +22,6 @@ #include "main.h" #include "miscallenous.h" #include "mainwindow.h" -#include "dialogs.h" #include "ldDocument.h"
--- a/src/toolsets/algorithmtoolset.cpp Thu Feb 09 21:01:12 2017 +0200 +++ b/src/toolsets/algorithmtoolset.cpp Thu Feb 09 21:04:33 2017 +0200 @@ -28,7 +28,6 @@ #include "../miscallenous.h" #include "../radioGroup.h" #include "../glRenderer.h" -#include "../dialogs.h" #include "../colors.h" #include "../mathfunctions.h" #include "../ldobjectiterator.h"
--- a/src/toolsets/extprogramtoolset.cpp Thu Feb 09 21:01:12 2017 +0200 +++ b/src/toolsets/extprogramtoolset.cpp Thu Feb 09 21:04:33 2017 +0200 @@ -33,9 +33,9 @@ #include "../ldDocument.h" #include "../radioGroup.h" #include "../editHistory.h" -#include "../dialogs.h" #include "../documentmanager.h" #include "../grid.h" +#include "../dialogs/externalprogrampathdialog.h" #include "extprogramtoolset.h" #include "ui_ytruder.h" #include "ui_intersector.h"
--- a/src/toolsets/filetoolset.cpp Thu Feb 09 21:01:12 2017 +0200 +++ b/src/toolsets/filetoolset.cpp Thu Feb 09 21:04:33 2017 +0200 @@ -18,7 +18,6 @@ #include <QFileDialog> #include <QMessageBox> -#include "../dialogs.h" #include "../canvas.h" #include "../ldDocument.h" #include "../mainwindow.h"
--- a/src/toolsets/viewtoolset.cpp Thu Feb 09 21:01:12 2017 +0200 +++ b/src/toolsets/viewtoolset.cpp Thu Feb 09 21:04:33 2017 +0200 @@ -24,7 +24,6 @@ #include "../canvas.h" #include "../primitives.h" #include "../colors.h" -#include "../dialogs.h" #include "../glCompiler.h" #include "../documentmanager.h" #include "viewtoolset.h"
--- a/ui/extprogpath.ui Thu Feb 09 21:01:12 2017 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,85 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>ExtProgPath</class> - <widget class="QDialog" name="ExtProgPath"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>444</width> - <height>101</height> - </rect> - </property> - <property name="windowTitle"> - <string>Program path required</string> - </property> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QLabel" name="programLabel"> - <property name="text"> - <string>Please input a path for <PROGRAM>:</string> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout"> - <item> - <widget class="QLineEdit" name="path"/> - </item> - <item> - <widget class="QPushButton" name="findPathButton"> - <property name="text"> - <string>...</string> - </property> - </widget> - </item> - </layout> - </item> - <item> - <widget class="QDialogButtonBox" name="buttonBox"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="standardButtons"> - <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> - </property> - </widget> - </item> - </layout> - </widget> - <resources/> - <connections> - <connection> - <sender>buttonBox</sender> - <signal>accepted()</signal> - <receiver>ExtProgPath</receiver> - <slot>accept()</slot> - <hints> - <hint type="sourcelabel"> - <x>248</x> - <y>254</y> - </hint> - <hint type="destinationlabel"> - <x>157</x> - <y>274</y> - </hint> - </hints> - </connection> - <connection> - <sender>buttonBox</sender> - <signal>rejected()</signal> - <receiver>ExtProgPath</receiver> - <slot>reject()</slot> - <hints> - <hint type="sourcelabel"> - <x>316</x> - <y>260</y> - </hint> - <hint type="destinationlabel"> - <x>286</x> - <y>274</y> - </hint> - </hints> - </connection> - </connections> -</ui>