# HG changeset patch # User Teemu Piippo # Date 1486667073 -7200 # Node ID 3b1d2cc6603ec3e4ea1584cd78ce47c15b8206ae # Parent 117e4880666ef45517bc152f7a5546581e78c05d Moved dialogs.cpp to dialogs/externalprogrampathdialog.cpp diff -r 117e4880666e -r 3b1d2cc6603e CMakeLists.txt --- 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 diff -r 117e4880666e -r 3b1d2cc6603e src/crashCatcher.cpp --- 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 # include # include "crashCatcher.h" -# include "dialogs.h" # ifdef Q_OS_LINUX # include diff -r 117e4880666e -r 3b1d2cc6603e src/dialogs.cpp --- 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 . - */ - -#include -#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("", 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(); -} diff -r 117e4880666e -r 3b1d2cc6603e src/dialogs.h --- 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 . - */ - -#pragma once -#include -#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; -}; diff -r 117e4880666e -r 3b1d2cc6603e src/dialogs/externalprogrampathdialog.cpp --- /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 . + */ + +#include +#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("", 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(); +} diff -r 117e4880666e -r 3b1d2cc6603e src/dialogs/externalprogrampathdialog.h --- /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 . + */ + +#pragma once +#include +#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; +}; diff -r 117e4880666e -r 3b1d2cc6603e src/dialogs/externalprogrampathdialog.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 @@ + + + ExtProgPath + + + + 0 + 0 + 444 + 101 + + + + Program path required + + + + + + Please input a path for <PROGRAM>: + + + + + + + + + + + + ... + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + ExtProgPath + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + ExtProgPath + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff -r 117e4880666e -r 3b1d2cc6603e src/glRenderer.cpp --- 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" diff -r 117e4880666e -r 3b1d2cc6603e src/miscallenous.cpp --- 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" diff -r 117e4880666e -r 3b1d2cc6603e src/toolsets/algorithmtoolset.cpp --- 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" diff -r 117e4880666e -r 3b1d2cc6603e src/toolsets/extprogramtoolset.cpp --- 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" diff -r 117e4880666e -r 3b1d2cc6603e src/toolsets/filetoolset.cpp --- 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 #include -#include "../dialogs.h" #include "../canvas.h" #include "../ldDocument.h" #include "../mainwindow.h" diff -r 117e4880666e -r 3b1d2cc6603e src/toolsets/viewtoolset.cpp --- 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" diff -r 117e4880666e -r 3b1d2cc6603e ui/extprogpath.ui --- 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 @@ - - - ExtProgPath - - - - 0 - 0 - 444 - 101 - - - - Program path required - - - - - - Please input a path for <PROGRAM>: - - - - - - - - - - - - ... - - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - - - - - buttonBox - accepted() - ExtProgPath - accept() - - - 248 - 254 - - - 157 - 274 - - - - - buttonBox - rejected() - ExtProgPath - reject() - - - 316 - 260 - - - 286 - 274 - - - - -