moved ext program action definitions to extprogs.cpp rather than proxying it through gui_editactions.cpp

Mon, 15 Jul 2013 22:32:23 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Mon, 15 Jul 2013 22:32:23 +0300
changeset 387
248296088f2c
parent 386
751d31336f08
child 388
7ff483614aa1

moved ext program action definitions to extprogs.cpp rather than proxying it through gui_editactions.cpp

src/extprogs.cpp file | annotate | diff | comparison | revisions
src/extprogs.h file | annotate | diff | comparison | revisions
src/gui_editactions.cpp file | annotate | diff | comparison | revisions
--- a/src/extprogs.cpp	Mon Jul 15 22:27:16 2013 +0300
+++ b/src/extprogs.cpp	Mon Jul 15 22:32:23 2013 +0300
@@ -24,17 +24,14 @@
 #include <QCheckBox>
 #include <QComboBox>
 #include <QGridLayout>
-
 #include "common.h"
 #include "config.h"
 #include "misc.h"
-#include "extprogs.h"
 #include "gui.h"
 #include "file.h"
 #include "widgets.h"
 #include "history.h"
 #include "labeledwidget.h"
-
 #include "ui_ytruder.h"
 #include "ui_intersector.h"
 #include "ui_rectifier.h"
@@ -42,6 +39,15 @@
 #include "ui_isecalc.h"
 #include "ui_edger2.h"
 
+enum extprog {
+	Isecalc,
+	Intersector,
+	Coverer,
+	Ytruder,
+	Rectifier,
+	Edger2,
+};
+
 // =============================================================================
 cfg (str, prog_isecalc, "");
 cfg (str, prog_intersector, "");
@@ -268,7 +274,7 @@
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
 // Interface for Ytruder
-void runYtruder() {
+DEFINE_ACTION (Ytruder, 0) {
 	setlocale (LC_ALL, "C");
 	
 	if (!checkProgPath (prog_ytruder, Ytruder))
@@ -324,7 +330,7 @@
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
 // Rectifier interface
-void runRectifier() {
+DEFINE_ACTION (Rectifier, 0){
 	setlocale (LC_ALL, "C");
 	
 	if (!checkProgPath (prog_rectifier, Rectifier))
@@ -374,7 +380,7 @@
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
 // Intersector interface
-void runIntersector() {
+DEFINE_ACTION (Intersector, 0) {
 	setlocale (LC_ALL, "C");
 	
 	if (!checkProgPath (prog_intersector, Intersector))
@@ -465,7 +471,7 @@
 // =============================================================================
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
-void runCoverer() {
+DEFINE_ACTION (Coverer, 0) {
 	setlocale (LC_ALL, "C");
 	
 	if (!checkProgPath (prog_coverer, Coverer))
@@ -521,7 +527,7 @@
 // =============================================================================
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 // =============================================================================
-void runIsecalc() {
+DEFINE_ACTION (Isecalc, 0) {
 	setlocale (LC_ALL, "C");
 	
 	if (!checkProgPath (prog_isecalc, Isecalc))
--- a/src/extprogs.h	Mon Jul 15 22:27:16 2013 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- *  LDForge: LDraw parts authoring CAD
- *  Copyright (C) 2013 Santeri 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/>.
- */
-
-#ifndef EXTPROGS_H
-#define EXTPROGS_H
-
-#include <qobject.h>
-
-enum extprog
-{
-	Isecalc,
-	Intersector,
-	Coverer,
-	Ytruder,
-	Rectifier,
-	Edger2,
-};
-
-void runYtruder ();
-void runRectifier ();
-void runIntersector ();
-void runCoverer ();
-void runIsecalc ();
-
-#endif // EXTPROGS_H
\ No newline at end of file
--- a/src/gui_editactions.cpp	Mon Jul 15 22:27:16 2013 +0300
+++ b/src/gui_editactions.cpp	Mon Jul 15 22:32:23 2013 +0300
@@ -27,7 +27,6 @@
 #include "colorSelectDialog.h"
 #include "misc.h"
 #include "widgets.h"
-#include "extprogs.h"
 #include "gldraw.h"
 #include "dialogs.h"
 #include "colors.h"
@@ -528,29 +527,6 @@
 }
 
 // =============================================================================
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-// =============================================================================
-DEFINE_ACTION (Ytruder, 0) {
-	runYtruder();
-}
-
-DEFINE_ACTION (Rectifier, 0) {
-	runRectifier();
-}
-
-DEFINE_ACTION (Intersector, 0) {
-	runIntersector();
-}
-
-DEFINE_ACTION (Coverer, 0) {
-	runCoverer();
-}
-
-DEFINE_ACTION (Isecalc, 0) {
-	runIsecalc();
-}
-
-// =============================================================================
 DEFINE_ACTION (ReplaceCoords, CTRL (R)) {
 	QDialog* dlg = new QDialog (g_win);
 	Ui::ReplaceCoordsUI ui;

mercurial