Newer
Older
/*
* This file is part of project OpenEmbroidery. It's copyrighted by
* the contributors recorded in the version control history of the file.
* Original project location https://code.electrolab.fr/openEmbroidery/openEmbroidery_software
*
* SPDX-License-Identifier: CECILL-2.1
* License-Filename: Licence_CeCILL_V2.1-en.txt
*/
#include <QCommandLineParser>
#include <QDebug>
#include "main.h"
// TODO: fix qwerty mapping
// TODO: handlers, qui a besoin de qui et quand, pas de redondance ? chemins les + simples ?
// TODO: lock pour la modif, histoire de péter tout le backend sans que l'ihm explose
// TODO: list les features présentes et à venir, disons jusqu'à la v1.0 alpha pour commencer
// TODO MF: intégration/merge avec autre doc, gaffe aux scaling, normalisation générale des coords pour nos fichiers ?
// TODO: stitch de remplissage de formes
// TODO: rotation des selections
// TODO: creation des groupes
// TODO: export des .pes
// TODO: edition des motifs
// TODO: set des motifs des linestitchs avec miniature
raoul
committed
// TODO: actual exit logo is under CC license, https://thenounproject.com/search/?q=exit&i=1039024, change it or conform to license agreement
// TODO: fix bug on OE_actions::curDocument that can't work on multiple documents
3dsman
committed
// liste des bugs identifiés a corriger
// TODO bug dans OE_interfaceDisplay::selectApply la selection ne clear qu'un seul type (curve ou stitch) quand on selection uniquement des objets de l'autre type
// TODO bug dans les selections avec ajout sur les stitchs
// TODO cleanup actions on shortcut vs action on key event direct
// TODO put all actions on release by default
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
QCommandLineParser parser;
parser.setApplicationDescription("OE Designer CLI interface");
parser.addHelpOption();
parser.addOptions({
{"headless", QCoreApplication::translate("main", "Do not start GUI")},
{"export", QCoreApplication::translate("main", "Export active document to file."), QCoreApplication::translate("main", "exportFile")},
});
parser.addPositionalArgument("open", QCoreApplication::translate("main", "Load file as active document."));
parser.process(a);
bool headless = parser.isSet("headless");
QString openFile = parser.positionalArguments().empty() ? "" : parser.positionalArguments().first();
if (!headless)
{
MainWindow w;
w.setWindowState(Qt::WindowMaximized);
w.show();
if (openFile != "")
{
OE_interfaceDisplay* display = w.getCurrentRoot()->interfaceDisplay;
display->loadFile(openFile.toStdString());
display->zoomSelection();
display->update();
}
return a.exec();
}
OE_document doc;
if (openFile != "")
{
if (!doc.loadFromFile(openFile.toStdString()))
{
qDebug() << "Failed to open" << parser.value("open");
return 1;
}
}
if (parser.isSet("export"))
{
if (!doc.saveToFile(parser.value("export").toStdString()))
{
qDebug() << "Failed to save" << parser.value("export");
return 1;
}
}
return 0;