Initial commit

This commit is contained in:
torsten committed 2026-08-13 18:33:10 +02:00
commit b7d90b9afe
16245 files changed
+3396666

No files matched your search

@@ -0,0 +1,54 @@
# CMake script for SymbolEditor
SET(symboleditor_SRCS
asb_save_as_symbol.cpp
asb_save_as_symbol.h
asb_symbol_editor_gui_plugin.cpp
asb_symbol_editor_gui_plugin.h
asb_save_as_symbol.cpp
asb_save_as_symbol.h
asb_delete_elements_dialog.cpp
asb_delete_elements_dialog.h
asb_resize_dialog.cpp
asb_resize_dialog.h
asb_rotate_dialog.cpp
asb_rotate_dialog.h
asb_select_text_dialog.cpp
asb_select_text_dialog.h
asb_symbol_editor.cpp
asb_symbol_editor.h
asb_symbol_edit_scene.cpp
asb_symbol_edit_scene.h
flm_reply_handler.cpp
flm_reply_handler.h
)
SET(symboleditor_UICS
forms/asb_select_text_dialog.ui
forms/asb_delete_elements_dialog.ui
forms/asb_symbol_editor.ui
forms/asb_save_as_symbol.ui
forms/asb_rotate_dialog.ui
forms/asb_resize_dialog.ui
)
# Fuer die Icons
QT5_ADD_RESOURCES(symboleditor_SRCS application.qrc)
NGL_WRAP_UI(symboleditor_SRCS ${symboleditor_UICS})
NGL_ADD_LIBRARY(WS AsbSymEditGuiPlugin MODULE ${symboleditor_SRCS} ${symboleditor_UICS})
NGL_TARGET_LINK_LIBRARIES(AsbSymEditGuiPlugin
NGLLogger
LtsWidgets
FlmDataPluginInterface
PpmDataPluginInterface
advancedSymbology
advancedSymbologyXML
LtsSession
LtsSessionData
LtsUtilsGuiDds
Qt5::Core
Qt5::Gui
Qt5::Widgets
)
NGL_INSTALL_TARGET(AsbSymEditGuiPlugin)
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE symboltable SYSTEM "symbole.dtd">
<symbol version="1.0" id="0x00001003" dimen="land_units" affil="enemy" bcdab="undefined" command_level="undefined" mob="wheel">
<name>LinienOben</name>
<graphic scale="1.0">
<line transform="false" rotate="0" linewidth="0.1" linestyle="solid">
<point x="1.1" y="1.9"/>
<point x="1.1" y="1.9"/>
</line>
</graphic>
</symbol>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE symboltable SYSTEM "symbole.dtd">
<symbol version="1.0" id="0x00001003" dimen="undefined" affil="neutral" bcdab="undefined" command_level="undefined" mob="undefined">
<name>LinienOben</name>
<graphic scale="1">
<line transform="false" rotate="0" linewidth="0.05" linestyle="solid">
<point x="-1.6" y="1.6"/>
<point x="-0.1" y="1.6"/>
</line>
<line transform="false" rotate="0" linewidth="0.05" linestyle="solid">
<point x="0.1" y="1.6"/>
<point x="1.6" y="1.6"/>
</line>
</graphic>
</symbol>
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE symboltable SYSTEM "symbole.dtd">
<symbol version="1.0" id="0x00001011" dimen="undefined" affil="neutral" bcdab="undefined" command_level="undefined" mob="undefined">
<name>Manipulation</name>
<graphic scale="1">
<line transform="false" rotate="0" color="#ffffffff" linewidth="0.1" linestyle="solid">
<point x="-1.2" y="-1.4"/>
<point x="1.2" y="-1.4"/>
</line>
<line transform="false" rotate="0" color="#000000ff" linewidth="0.1" linestyle="solid">
<point x="-1.2" y="-1.5"/>
<point x="1.2" y="-1.5"/>
</line>
</graphic>
</symbol>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE symboltable SYSTEM "symbole.dtd">
<symbol version="1.0" id="0x00001012" dimen="undefined" affil="neutral" bcdab="undefined" command_level="undefined" mob="undefined">
<name>NoPosition</name>
<graphic scale="1">
<line transform="false" rotate="0" color="#ff0000ff" linewidth="0.1" linestyle="solid">
<point x="-1.6" y="-1.6"/>
<point x="1.6" y="-1.6"/>
</line>
</graphic>
</symbol>
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE symboltable SYSTEM "symbole.dtd">
<symbol version="1.0" id="0x1000" dimen="land_units" affil="neutral" bcdab="crew" command_level="undefined" mob="wheel">
<name>/shd/guez/int/WorkSpace/trunk/GDW/addOnSymbols/TestSymbol.xml</name>
<branch class="infantry" />
<text1 maxdatalength="9">
<data align="center">Test</data>
</text1>
<graphic scale="0.5">
<rect transform="false" rotate="45" linewidth="0.05" linestyle="dotted"
fill="0" color="#FF0000FF">
<point x="-0.543103" y="0.568966"/>
<point x="0.577586" y="-0.551724"/>
</rect>
</graphic>
</symbol>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE symboltable SYSTEM "symbole.dtd">
<symbol version="1.0" id="0x00001002" dimen="undefined" affil="neutral" bcdab="undefined" command_level="undefined" mob="undefined">
<name>vbgFireKill</name>
<graphic scale="1">
<line transform="false" rotate="0" linewidth="0.15" linestyle="solid">
<point x="-1.6" y="-1.6"/>
<point x="1.6" y="1.6"/>
</line>
</graphic>
</symbol>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE symboltable SYSTEM "symbole.dtd">
<symbol version="1.0" id="0x00001001" dimen="undefined" affil="neutral" bcdab="undefined" command_level="undefined" mob="undefined">
<name>vbgFireKill</name>
<graphic scale="1">
<line transform="false" rotate="0" linewidth="0.15" linestyle="solid">
<point x="-1.6" y="1.6"/>
<point x="1.6" y="-1.6"/>
</line>
</graphic>
</symbol>
@@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>icons/previewBackground.xpm</file>
</qresource>
</RCC>
@@ -0,0 +1,65 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#include "asb_delete_elements_dialog.h"
#include "ui_asb_delete_elements_dialog.h"
namespace AdvancedSymbology
{
//----------------------------------------------------------------------------
DeleteElementsDialog::DeleteElementsDialog(QWidget *parent)
: LtsWidgets::LtsFramelessDialog(parent)
, ui(new Ui_DeleteElementsDialog)
{
ui->setupUi(this);
initWidgets();
enaDisa();
}
//----------------------------------------------------------------------------
DeleteElementsDialog::~DeleteElementsDialog()
{
delete ui;
}
//----------------------------------------------------------------------------
void DeleteElementsDialog::initWidgets()
{
connect(ui->checkBoxPrims, &QCheckBox::toggled, this, &DeleteElementsDialog::enaDisa);
connect(ui->checkBoxPrimsSectorText, &QCheckBox::toggled, this, &DeleteElementsDialog::enaDisa);
connect(ui->checkBoxAttributes, &QCheckBox::toggled, this, &DeleteElementsDialog::enaDisa);
connect(ui->buttonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked, this, &DeleteElementsDialog::accept);
connect(ui->buttonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked, this, &DeleteElementsDialog::reject);
}
//----------------------------------------------------------------------------
void DeleteElementsDialog::enaDisa()
{
bool enabled = false;
if (ui->checkBoxPrims->isChecked() ||
ui->checkBoxPrimsSectorText->isChecked() ||
ui->checkBoxAttributes->isChecked())
enabled = true;
ui->buttonBox->getButton(LtsWidgets::DialogButton::Ok)->setEnabled(enabled);
}
//----------------------------------------------------------------------------
void DeleteElementsDialog::getCheckedElements(bool &checkedPrims,
bool &checkedPrimsSectorText,
bool &checkedAttributes)
{
checkedPrims = ui->checkBoxPrims->isChecked();
checkedPrimsSectorText = ui->checkBoxPrimsSectorText->isChecked();
checkedAttributes = ui->checkBoxAttributes->isChecked();
}
}
@@ -0,0 +1,40 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#pragma once
#include <LtsWidgets/lts_frameless_dialog.h>
class Ui_DeleteElementsDialog;
namespace AdvancedSymbology
{
class DeleteElementsDialog final : public LtsWidgets::LtsFramelessDialog
{
Q_OBJECT
public:
explicit DeleteElementsDialog(QWidget *parent);
~DeleteElementsDialog();
void getCheckedElements(bool &checkedPrims,
bool &checkedPrimsSectorText,
bool &checkedAttributes);
private Q_SLOTS :
void enaDisa();
protected:
void initWidgets();
Ui_DeleteElementsDialog *ui;
};
}
@@ -0,0 +1,65 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#include "asb_resize_dialog.h"
#include "asb_symbol_edit_scene.h"
#include "ui_asb_resize_dialog.h"
namespace AdvancedSymbology
{
ResizeDialog::ResizeDialog(bool lockChecked, bool lockEnabled, QWidget *parent)
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Popup)
, m_ui(new Ui_ResizeDialog)
{
m_ui->setupUi(this);
connect(m_ui->sliderHScale, &QSlider::valueChanged, this, &ResizeDialog::handleChange);
connect(m_ui->sliderVScale, &QSlider::valueChanged, this, &ResizeDialog::handleChange);
connect(m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked, this, &LtsWidgets::LtsFramelessDialog::reject);
connect(m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked, this, &LtsWidgets::LtsFramelessDialog::accept);
m_ui->checkBoxLock->setEnabled(lockEnabled);
m_ui->checkBoxLock->setChecked(lockChecked);
}
ResizeDialog::~ResizeDialog()
{
delete m_ui;
}
void ResizeDialog::handleChange(int val)
{
double hVal = double(val) / 100;
double vVal = double(val) / 100;
if (!m_ui->checkBoxLock->isChecked())
{
hVal = double(m_ui->sliderHScale->value()) / 100;
vVal = double(m_ui->sliderVScale->value()) / 100;
}
else
sync(val);
m_ui->spinBoxHScale->setValue(hVal);
m_ui->spinBoxVScale->setValue(vVal);
emit primitiveScaled(hVal, vVal);
}
void ResizeDialog::sync(int val)
{
m_ui->sliderHScale->setValue(val);
m_ui->sliderVScale->setValue(val);
}
}
@@ -0,0 +1,42 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#pragma once
#include <LtsWidgets/lts_frameless_dialog.h>
class Ui_ResizeDialog;
/**
@author Stephan Kuhagen <stephan.kuhagen@rheinmetall.com>
*/
namespace AdvancedSymbology
{
class ResizeDialog final : public LtsWidgets::LtsFramelessDialog
{
Q_OBJECT
public:
ResizeDialog(bool lockChecked, bool lockEnabled, QWidget *parent = nullptr);
~ResizeDialog();
signals:
void primitiveScaled(double xScale, double yScale);
private slots:
void handleChange(int val);
private:
void sync(int val);
Ui_ResizeDialog *m_ui;
};
}
@@ -0,0 +1,49 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#include "asb_rotate_dialog.h"
#include "ui_asb_rotate_dialog.h"
namespace AdvancedSymbology
{
RotateDialog::RotateDialog(QWidget *parent)
: LtsWidgets::LtsFramelessDialog(parent, LtsWidgets::Behaviour::Popup)
, m_ui(new Ui_RotateDialog)
{
m_ui->setupUi(this);
m_ui->spinBoxDegree->setSuffix(QStringLiteral(" °"));
connect(m_ui->sliderHDegree, &QSlider::valueChanged, this, &RotateDialog::handleValue);
connect(m_ui->spinBoxDegree, QOverload<double>::of(&QDoubleSpinBox::valueChanged), this, &RotateDialog::handleValue);
connect(m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked, this, &LtsWidgets::LtsFramelessDialog::reject);
connect(m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked, this, &LtsWidgets::LtsFramelessDialog::accept);
}
RotateDialog::~RotateDialog()
{
delete m_ui;
}
void RotateDialog::handleValue(double val)
{
sync(val);
emit rotationValueChanged(val);
}
void RotateDialog::sync(double val)
{
m_ui->sliderHDegree->setValue(int(val));
m_ui->spinBoxDegree->setValue(val);
}
}
@@ -0,0 +1,42 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#pragma once
#include <LtsWidgets/lts_frameless_dialog.h>
class Ui_RotateDialog;
/**
@author Stephan Kuhagen <stephan.kuhagen@rheinmetall.com>
*/
namespace AdvancedSymbology
{
class RotateDialog final : public LtsWidgets::LtsFramelessDialog
{
Q_OBJECT
public:
explicit RotateDialog(QWidget *parent = nullptr);
~RotateDialog();
private slots:
void handleValue(double val);
signals:
void rotationValueChanged(double val);
private:
void sync(double val);
Ui_RotateDialog *m_ui;
};
}
@@ -0,0 +1,91 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#include "asb_save_as_symbol.h"
#include "ui_asb_save_as_symbol.h"
#include <LtsWidgets/lts_dialog_button_box.h>
namespace AdvancedSymbology
{
SaveAsSymbol::SaveAsSymbol(QVariant &dlgData, const std::shared_ptr<FileManagement::Interface::Dtc> &flmDtc, QWidget *parent)
: LtsWidgets::LtsFramelessDialog(parent)
, m_ui(new Ui_SaveAsSymbol)
, m_buttonBox(new LtsWidgets::LtsDialogButtonBox(this))
, m_flmDtc(flmDtc)
, m_dlgData(dlgData)
{
m_ui->setupUi(this);
m_ui->verticalLayout->addWidget(m_buttonBox);
connect(m_buttonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked,
this, &SaveAsSymbol::reject);
connect(m_buttonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked,
this, &SaveAsSymbol::accept);
connect(m_ui->leName, &QLineEdit::textChanged,
this, &SaveAsSymbol::onInputChanged);
connect(m_flmDtc.get(), &FileManagement::Interface::Dtc::fileContentChanged,
this, &SaveAsSymbol::onFileContentChanged);
onInputChanged(m_ui->leName->text());
m_flmDtc->fileContents([this](const FileManagement::FileContent & data)
{
onFileContentChanged(data, DataModification::eAdded);
});
}
SaveAsSymbol::~SaveAsSymbol()
{
delete m_ui;
}
void SaveAsSymbol::accept()
{
m_symbolName = m_ui->leName->text();
m_dlgData.setValue(m_symbolName);
LtsFramelessDialog::accept();
}
void SaveAsSymbol::onInputChanged(const QString &input)
{
if (input.isEmpty())
{
m_ui->lblNameError->setText(tr("Name must not be empty"));
m_ui->lblNameError->setStyleSheet(QStringLiteral("color: rgb(255, 0, 0);"));
}
else if (m_takenNames.contains(input))
{
m_ui->lblNameError->setText(tr("Name is already taken"));
m_ui->lblNameError->setStyleSheet(QStringLiteral("color: rgb(255, 0, 0);"));
}
else
{
m_ui->lblNameError->setStyleSheet(QStringLiteral("color: rgb(0, 255, 0);"));
m_ui->lblNameError->setText(tr("Name is ok"));
}
m_buttonBox->getButton(LtsWidgets::DialogButton::Ok)->setEnabled(!(input.isEmpty() || m_takenNames.contains(input)));
}
void SaveAsSymbol::onFileContentChanged(const FileManagement::FileContent &data, DataModification modType)
{
if (data.fileType() != FileManagement::FileType::OperatorDefinedSymbol)
return;
QString name = QString::fromStdString(data.name());
if (modType == DataModification::eRemoved)
m_takenNames.removeAll(name);
else
m_takenNames.append(name);
}
}
@@ -0,0 +1,49 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#pragma once
#include <LtsWidgets/lts_frameless_dialog.h>
#include <FileManagement/flm_dtc.h>
class Ui_SaveAsSymbol;
namespace LtsWidgets
{
class LtsDialogButtonBox;
}
namespace AdvancedSymbology
{
class SaveAsSymbol final : public LtsWidgets::LtsFramelessDialog
{
Q_OBJECT
public:
explicit SaveAsSymbol(QVariant &dlgData, const std::shared_ptr<FileManagement::Interface::Dtc> &flmDtc, QWidget *parent = nullptr);
~SaveAsSymbol();
QString symbolName() const;
private Q_SLOTS:
void accept() override final;
void onInputChanged(const QString &input);
void onFileContentChanged(const FileManagement::FileContent &data, DataModification modType);
private: // attributes
Ui_SaveAsSymbol *m_ui;
QString m_symbolName;
LtsWidgets::LtsDialogButtonBox *m_buttonBox;
QStringList m_takenNames;
std::shared_ptr<FileManagement::Interface::Dtc> m_flmDtc;
QVariant &m_dlgData;
};
} //namespace AdvancedSymbology
@@ -0,0 +1,45 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#include "asb_select_text_dialog.h"
#include "ui_asb_select_text_dialog.h"
namespace AdvancedSymbology
{
//----------------------------------------------------------------------------
SelectTextDialog::SelectTextDialog(QVariant &returnData, QWidget *parent)
: LtsWidgets::LtsFramelessDialog(parent)
, ui(new Ui_SelectTextDialog)
, m_returnData(returnData)
{
ui->setupUi(this);
connect(ui->buttonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked, this, &SelectTextDialog::reject);
connect(ui->buttonBox->getButton(LtsWidgets::DialogButton::Ok), &QPushButton::clicked, this, &SelectTextDialog::accept);
}
//----------------------------------------------------------------------------
SelectTextDialog::~SelectTextDialog()
{
delete ui;
}
void SelectTextDialog::accept()
{
QVariantMap vmap;
vmap.insert(QStringLiteral("line_one"), ui->lineEdit1->text());
vmap.insert(QStringLiteral("line_two"), ui->lineEdit2->text());
m_returnData.setValue(vmap);
LtsWidgets::LtsFramelessDialog::accept();
}
}
@@ -0,0 +1,41 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#pragma once
#include <QVariant>
#include <LtsWidgets/lts_frameless_dialog.h>
class Ui_SelectTextDialog;
namespace AdvancedSymbology
{
class SelectTextDialog final : public LtsWidgets::LtsFramelessDialog
{
Q_OBJECT
public:
SelectTextDialog(QVariant &returnData, QWidget *parent);
~SelectTextDialog();
protected:
Ui_SelectTextDialog *ui;
private:
//NGL::INGLLogger& m_logger;
QVariant &m_returnData;
// QDialog interface
public slots:
void accept() override final;
};
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,344 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#pragma once
#include <QGraphicsScene>
#include <QPen>
#include <Viewer/SituationMap/SymbologyXML/primitive.h>
class QGraphicsItem;
class QGraphicsRectItem;
class QGraphicsSceneMouseEvent;
class QLabel;
class QPolygonF;
/**
\brief Implements mouse-events for editing symbol-items.
Derived class for user interaction with the preview and draw area of the
SymbolEditor.
@author Stephan Kuhagen <stephan.kuhagen@rheinmetall.com>
*/
namespace AdvancedSymbology
{
class SymbolEditScene final : public QGraphicsScene
{
Q_OBJECT
public:
explicit SymbolEditScene(QObject *parent = nullptr);
void setCoordsLabels(QLabel *xLabel, QLabel *yLabel, QLabel *zoomLabel)
{
m_labelCoordsX = xLabel;
m_labelCoordsY = yLabel;
m_labelZoom = zoomLabel;
}
//! Return the current zoom-value
double zoom() const
{
return m_zoom;
}
//! Set the current zoom-value and return it
double setZoom(double zoom);
//! Return current min zoom-value
double minZoom() const
{
return m_zoomMin;
}
//! Set min zoom-value
void setMinZoom(double min)
{
if (min < m_zoomMax) m_zoomMin = min;
}
//! Return current max zoom-value
double maxZoom() const
{
return m_zoomMax;
}
//! Set max zoom-value
void setMaxZoom(double max)
{
if (max > m_zoomMin) m_zoomMax = max;
}
//! The DrawModes
enum DrawMode
{
NONE,
ELLIPSE_START,
ELLIPSE_SET,
ELLIPSE_SET_START,
ELLIPSE_SET_EXTENT,
LINE_START,
LINE_SET,
POLYLINE_START,
POLYLINE_SET,
POLYGON_START,
POLYGON_SET,
RECT_START,
RECT_SET,
ICON_START,
ICON_SET,
TEXT_START,
TEXT_SET,
ELEMENT_DELETE,
ELEMENT_MOVE,
ELEMENT_ROTATE,
ELEMENT_PASTE,
ELEMENT_SCALE,
ELEMENT_SELECT
};
/**
Set the drawMode. This is used for Mouse-Interaction when the user draws
or manipulates new Primitives.
\param mode: the new DrawMode
*/
void setDrawMode(DrawMode mode);
/**
Return the current DrawMode
\return DrawMode
*/
DrawMode getDrawMode() const
{
return m_drawMode;
}
/**
If the scene manipulates the data, do not update the GraphicsViews
*/
bool updatesBlocked() const { return m_blockUpdates; }
/**
Called from a SEPathItem, when its Primitive needs to tell the Editor,
that it has been changed by user-interaction. Triggers emit primitiveChanged()
*/
void primitivePathItemChanged() { emit primitiveChanged(true); }
void setShowGrid(bool b);
void setShowDrawingArea(bool b);
void setGridWidth(double width);
void reset();
public slots:
/**
Set the Pen for Draw/Edit-Operations
*/
void setPen(const QPen &pen)
{
m_pen = pen;
}
void update(const QRectF &rect = QRectF());
//! Cancel the current action
void cancelCurrentAction();
signals:
/**
Emit a signal, if the zoom value has changed.
\param zoom: the new zoom value.
*/
void zoomChanged(double zoom);
/**
Emit a signal to add a new Primitive to the current Symbol
\param p: The new Primitive to add
*/
void addPrimitive(SymbologyXML::Primitive *p);
/**
Emit a signal, if a Primitive has changed
*/
void primitiveChanged(bool changed);
/**
Emit a signal, if a Primitive has been moved by user-interaction
*/
void primitiveMoved(QPointF diff);
/**
Transform the selected primitive
*/
void transformSelection(int key, Qt::KeyboardModifiers modifiers);
protected:
/**
Process a QGraphicsSceneMouseEvent. Used for displaying coordinates and
Primitive-Editing
\param mouseEvent: The Event
*/
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent) override;
/**
Process a QKeyEvent. Used for zooming and shift-functions
\param keyEvent: The Event
*/
void keyPressEvent(QKeyEvent *keyEvent) override;
/**
Process a QKeyEvent. Used for zooming and shift-functions
\param keyEvent: The Event
*/
void keyReleaseEvent(QKeyEvent *keyEvent) override;
/**
Process a QGraphicsSceneMouseEvent, used for adding new Primitives and
manipulating existing Primitives.
\param mouseEvent: The Event
*/
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) override;
/**
Process a QGraphicsSceneMouseEvent, used for announcing end of manipulation
of Primitives.
\param mouseEvent: The Event
*/
void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) override;
/**
Process a QGraphicsSceneMouseEvent, used for announcing end of manipulation
of Primitives, i.e. Polyline and Polygon.
\param mouseEvent: The Event
*/
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *mouseEvent) override;
// QGraphicsScene interface
void drawForeground(QPainter *painter, const QRectF &rect) override final;
private:
//! NGLLogger
NGL::INGLLogger &logger;
/**
Create a new Ellipse. The point is the start-point of the bounding rect.
\param start: Startpoint of bounding rect.
*/
void newEllipse(const QPointF &start);
/**
Manipulate a new Ellipse
\param point: Change the second point of the boundnig rect end to this point
*/
void setEllipse(const QPointF &point);
/**
Set Start-Angle of a Ellipse. A line is drawn from the center to the given
point to indicate the start angle.
\param point: Reference point for the line
*/
void ellipseSetAngleStart(const QPointF &point);
/**
Set Extent-Angle of a Ellipse. A line is drawn from the center to the given
point to indicate the extent angle.
\param point: Reference point for the line
*/
void ellipseSetAngleExtent(const QPointF &point);
/**
Create a new Line starting from the given point
\param start: Startpoint of new line
*/
void newLine(const QPointF &start);
/**
Manipulate a new line
\param point: Change the line end to this point
*/
void setLine(const QPointF &point);
/**
Create a new Polygon starting from the given point
\param start: Startpoint of new polygon
*/
void newPolygon(const QPointF &start);
/**
Add new point to polygon
\param next: Set the next point
*/
void addPointPolygon(const QPointF &next);
/**
Manipulate a new polygon
\param point: Set the last point to this point
*/
void setPolygon(const QPointF &point);
/**
Create a new Rect.
\param start: Startpoint
*/
void newRect(const QPointF &start);
/**
Manipulate a new rect
\param end: Change the second point.
*/
void setRect(const QPointF &point);
/**
Create a Primitive and emit a signal announcing it.
\param type: Type of the new Primitive
*/
void sendNewItem(SymbologyXML::Primitive::t_primitive type);
/**
Rotate the stacking-order and selection of primitives
*/
void rotateSelection();
//! The currently drawn/edited graphicsItems
QPointF m_currentItemStartPoint;
QGraphicsItem *m_currentItem, *m_tmpItem;
//! Visible bounding rect for some Primitives
QGraphicsRectItem *m_boundingRect;
//! temp polygon for constructing polygons and polylines
QPolygonF m_tmpPolygon;
//! Start and Extent for Ellipsis
double m_ellipsisStart, m_ellipsisExtent;
//! construct Ellipsis: transitions 1° <--> 360° adjustment
double m_lastEllipseAngle, m_adjustAngle;
//!
double m_gridWidth;
//! If false, the Ellipsis ignores the angles
bool m_useAngles;
//!
bool m_showGrid;
//!
bool m_showDrawingArea;
//! The current Pen
QPen m_pen;
//! The Pen for the bounding rect
QPen m_rectPen;
//! The current zoom value and upper/lower limit
double m_zoom, m_zoomMin, m_zoomMax;
//! Pointer to labels for displaying current mouse coordinates
QLabel *m_labelCoordsX, *m_labelCoordsY, *m_labelZoom;
//! The current DrawMode
DrawMode m_drawMode;
//! If shift or Alt is pressed, modify some drawing functions
bool m_shiftPressed;
bool m_altPressed;
//! If the scene manipulates the data, do not update the GraphicsViews
bool m_blockUpdates;
//! The position of the mouse-pointer at the last click
QPointF m_mousePos;
//!
QPointF m_lastMousePos;
//!
QPointF m_startPos;
}; // class SymbolEditScene
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,236 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#pragma once
#include <LtsWidgets/lts_dialog.h>
#include <NGLLogger/INGLLogger.h>
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
#include <Plugins/FileManagement/flm_explorer_gui_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_data_plugin_interface.h>
#include <Plugins/FileManagement/flm_explorer_gui_plugin_interface.h>
#include <Viewer/SituationMap/SymbologyXML/symbol_types.h>
#include <LtsSession/lts_session.h>
class QGraphicsScene;
class QComboBox;
namespace Ui { class SymbolEditor; }
namespace FileManagement { class ForeignGuiInterface; }
namespace SymbologyXML { class Symbol; class Primitive;}
namespace AdvancedSymbology
{
class SymbolEditorPrivate;
class SymbolEditor final : public LtsWidgets::LtsDialog
{
Q_OBJECT
public:
explicit SymbolEditor(LtsSession::LtsSession *session, QWidget *parent = nullptr);
~SymbolEditor();
bool init(const std::shared_ptr<FileManagement::Interface::Ftc> &flmFtc,
const std::shared_ptr<FileManagement::Interface::Dtc> &flmDtc,
const std::shared_ptr<FileManagement::ForeignGuiInterface> &flmGui,
const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc,
bool asApp = false);
void keyPressEvent(QKeyEvent *keyEvent) override final;
void retranslate() override final;
bool apply() override final;
bool writeFile(bool saveAsNew);
enum e_category
{
CATEGORY_UNDEFINED = 0,
CATEGORY_HEADQUARTER,
CATEGORY_DIMENSION,
CATEGORY_AFFILIATION,
CATEGORY_BCDAB,
CATEGORY_COMMANDLEVEL,
CATEGORY_MOBILITY,
CATEGORY_BRANCH,
CATEGORY_ICON_TYPE
};
enum t_editMode
{
EDIT_NONE,
EDIT_PICK,
EDIT_MOVE,
EDIT_ROTATE,
EDIT_SCALE,
EDIT_COPY,
EDIT_PASTE,
EDIT_DELETE,
EDIT_EDIT
};
public slots:
void movePrimitive(QPointF diff);
bool createNewSymbol(const QString &symbolname);
void setChanged(bool changed);
void updateGraphicViews(bool editview = true, bool preview = true);
void reset();
void slotSaveAs();
void slotSave();
void slotSaveFinished();
void slotImportTemplate();
signals:
void documentChanged(bool changed);
void symbolSaved(bool saveToLib, bool saveToCurrent, bool saveToAll);
void canceled();
void helpRequested();
void invokeHelp(const QString &context);
void saveFinished();
private slots:
void transformSelection(int key, Qt::KeyboardModifiers modifiers);
void onToolButtonSelectClicked();
void onToolButtonRotateClicked();
void onToolButtonScaleClicked();
void onToolButtonDeleteClicked();
void onToolButtonClearClicked();
void onToolButtonUndoClicked();
void onToolButtonCopyClicked();
void onToolButtonPasteClicked();
void onToolButtonEllipseClicked();
void onToolButtonLineClicked();
void onToolButtonPolylineClicked();
void onToolButtonPolygonClicked();
void onToolButtonRectClicked();
void onToolButtonTextClicked();
void onPushButtonFillColorClicked();
void onComboBoxDimenCurrentIndexChanged(int index);
void onComboBoxAffilCurrentIndexChanged(int index);
void onComboBoxBCDABCurrentIndexChanged(int index);
void onComboBoxHeadquarterCurrentIndexChanged(int index);
void onComboBoxCommandLevelCurrentIndexChanged(int index);
void onComboBoxMobCurrentIndexChanged(int index);
void onComboBoxVehicleCurrentIndexChanged(int index);
void onComboBoxIntrinsicMobCurrentIndexChanged(int index);
void onComboBoxIntrinsicMob2CurrentIndexChanged(int index);
void onComboBoxArmingCurrentIndexChanged(int index);
void onListViewMiscItemSelectionChanged();
void onCheckBoxVehicleStateChanged(int state);
void onCheckBoxArmingStateChanged(int state);
void onCheckBoxMainStateChanged(int state);
void onComboBoxSector1CurrentIndexChanged(int index);
void onComboBoxSectorMainCurrentIndexChanged(int index);
void onListViewSectorMainItemSelectionChanged();
void onComboBoxSector2CurrentIndexChanged(int index);
void help_on_ComboBoxIndexChanged(QComboBox *comboBox,
int index, const QMap<int, QString> &contv,
SymbologyXML::SymbolTypes::t_icon_type iconType,
SymbologyXML::SymbolTypes::t_sector_position pos,
SymbologyXML::SymbolTypes::t_sector_rectpos rectpos = SymbologyXML::SymbolTypes::SECTOR_RECTPOS_DEFAULT);
void onComboBoxAlign1CurrentIndexChanged(int index);
void onComboBoxAlign2CurrentIndexChanged(int index);
void onComboBoxAlign3CurrentIndexChanged(int index);
void onComboBoxColorCurrentIndexChanged(int index);
void onComboBoxLineStyleCurrentIndexChanged(int index);
void onLineEdit1TextChanged(const QString &text);
void onLineEdit2TextChanged(const QString &text);
void onLineEdit3TextChanged(const QString &text);
void onListViewTruppengattungItemSelectionChanged();
void onCheckBoxBackgroundStateChanged(int state);
void onCheckBoxCopyValuesStateChanged(int state);
void onCheckBoxFillStateChanged(int state);
void onCheckBoxPlannedStateChanged(int state);
void onCheckBoxDrawAreaStateChanged(int state);
void onSpinBoxRasterValueChanged(double d);
void onSpinBoxLineWidthValueChanged(double d);
void onSpinBoxScaleValueChanged(double d);
void onSliderTransparencyValueChanged(int value);
void setZoom(double zoom);
void addItem(SymbologyXML::Primitive *prim);
void selectionChanged();
private:
void resetGUI();
void updateGUI();
void updateSymbolAttributesWidgets();
void updateTextProperties();
void resetToolButtonGroupState();
void pushUndo();
void popUndo();
void clearUndo();
void restoreSelection(SymbologyXML::Primitive *prim);
void copyFromSelectedPrimitive();
void enableSelectMove(bool enable);
void setPushButtonFillColorBackground(QColor color);
QIcon getIcon(e_category category, SymbologyXML::SymbolTypes::t_icon_type iconType,
int iconId, QSize iconSize);
int getFrameSymbolID(SymbologyXML::SymbolTypes::t_dimen dimen,
SymbologyXML::SymbolTypes::t_affil affil);
void fillListWidget(const QMap<int, QString> &container, QWidget *widget,
e_category category, SymbologyXML::SymbolTypes::t_icon_type iconType,
bool withIcons = true, bool sort = true);
void widgetInsertItem(QWidget *widget, int index, const QString &text, int key,
e_category category, SymbologyXML::SymbolTypes::t_icon_type iconType,
bool withIcons);
void drawSymbol(const SymbologyXML::Symbol *symbol, QGraphicsScene *scene,
const QColor &color, const QColor &fillColor,
double z, bool isAttrib = false, bool updateMap = false, bool drawBoundRect = false);
void drawSymbolPrimitive(SymbologyXML::Primitive *primitive, QGraphicsScene *scene,
const QColor &color, const QColor &fillColor,
double z, bool isAttrib = false, bool drawBoundRect = false);
void copyElementsFromSymbol(const SymbologyXML::Symbol &tmpSymbol) const;
Ui::SymbolEditor *m_ui;
SymbolEditorPrivate *m_internal;
LtsSession::LtsSession *m_session;
NGL::INGLLogger &m_logger;
};
}
@@ -0,0 +1,125 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Mike Wille, SLSE, 2016-11-02
*/
#include "asb_symbol_editor_gui_plugin.h"
#include "asb_symbol_editor.h"
#include <LtsWidgets/lts_splash.h>
#include <Viewer/SituationMap/Symbology/symbol_dictionary.h>
#include <LtsSession/lts_session.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QTimer>
namespace AdvancedSymbology
{
InterfaceImpl::InterfaceImpl(LtsSession::LtsSession *session)
: GuiPluginBase::Interface(session, NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("SymbolEditor"))
{}
QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
{
QVector<LtsWidgets::PluginData> ret;
m_flmDtc->enableFileContent();
m_flmDtc->enableFolder();
m_flmFtc->enableFileContentModify();
LtsWidgets::PluginData plData;
plData.menuGroup = menuGroup();
plData.menuText = tr("Symbol Editor");
plData.identifier = QLatin1String("AsbSymEditDialog");
plData.menuIcon = QIcon(QLatin1String("icon:draw_symbol.svg"));
plData.exercisePart = LtsWidgets::ExercisePart::eSpecial;
//as mainFlag
if (getFlags().testFlag(LtsAppDescriptor::PluginInfo::Flag::MAIN))
{
plData.layoutArea = LtsWidgets::LayoutArea::eMainTab;
plData.createInstant = LtsWidgets::CreateInstantType::CreateInstantAndDiscardAction;
plData.createWidgetFunc = [this](QWidget * parent)
{
return LtsWidgets::initDialog(new SymbolEditor(m_session, parent),
m_flmFtc, m_flmDtc, m_flmGui, m_ppmDtc, true);
};
}
else
{
plData.layoutArea = LtsWidgets::LayoutArea::eDialogTab;
plData.createWidgetFunc = [this](QWidget * parent)
{
return LtsWidgets::initDialog(new SymbolEditor(m_session, parent),
m_flmFtc, m_flmDtc, m_flmGui, m_ppmDtc, false);
};
}
ret.append(plData);
return ret;
}
/*
void InterfaceImpl::init()
{
LtsWidgets::Splash::getInstance()->setMessage(tr("Loading Esri dictionary..."));
connect(this, &InterfaceImpl::signalInitDone,
m_session, &LtsSession::LtsSession::slotPluginInitDone,
static_cast<Qt::ConnectionType>(Qt::QueuedConnection | Qt::UniqueConnection));
if (LtsSession::LtsSession::s_valgrind)
{
qWarning() << "AES: skipped loading esri symbology dictionary";
emit signalInitDone();
return;
}
AdvancedSymbology::SymbolDictionary &dict =
AdvancedSymbology::SymbolDictionary::dictionary(AdvancedSymbology::SymbolDictionary::defaultSymbologyType());
dict.load();
if (dict.isLoaded())
{
emit signalInitDone();
return;
}
QTimer::singleShot(250, this, &InterfaceImpl::init); // look again if not loaded yet
}
*/
bool InterfaceImpl::fetchInterfaces()
{
return m_session->getDtc<FileManagement::DataInterface>(m_flmDtc) &&
m_session->getFtc<FileManagement::DataInterface>(m_flmFtc) &&
m_session->getDtc<ParticipantManagement::DataInterface>(m_ppmDtc) &&
m_session->getForeignGuiInterface(m_flmGui);
}
void InterfaceImpl::clearInterfaces()
{
m_flmDtc = nullptr;
m_flmFtc = nullptr;
m_flmGui = nullptr;
m_ppmDtc = nullptr;
}
std::shared_ptr<GuiPluginBase::Interface> GuiPlugin::createGuiInterface(LtsSession::LtsSession *session)
{
return std::make_shared<InterfaceImpl>(session);
}
} // namespace AdvancedSymbology
@@ -0,0 +1,74 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#pragma once
#include <PluginInterfaces/gui_plugin_interface.h>
#include <Plugins/AdvancedSymbology/asb_gui_plugin_interface.h>
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
#include <Plugins/FileManagement/flm_explorer_gui_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_data_plugin_interface.h>
namespace LtsUtils
{
class RequestHelper;
}
namespace AdvancedSymbology
{
class GuiPlugin final : public QObject, public GuiPluginBase::Plugin
{
Q_PLUGIN_METADATA(IID "gui:3:asb.symedit")
Q_INTERFACES(GuiPluginBase::Plugin)
Q_OBJECT
public:
explicit GuiPlugin() = default;
~GuiPlugin() = default;
QString pluginName() override { return ForeignGuiInterface::pluginName(); }
std::shared_ptr<GuiPluginBase::Interface> createGuiInterface(LtsSession::LtsSession *session) override;
bool availableInPartition(IDL::PartitionType partition) const override
{
return partition == IDL::PartitionType::Exercise ||
partition == IDL::PartitionType::Global ||
partition == IDL::PartitionType::Replay;
}
};
class InterfaceImpl final
: public QObject
, public ForeignGuiInterface
, public GuiPluginBase::Interface
{
Q_OBJECT
public:
explicit InterfaceImpl(LtsSession::LtsSession *session);
QString menuGroup() const override { return tr("Advanced Symbology"); }
bool fetchInterfaces() override;
void clearInterfaces() override;
QVector<LtsWidgets::PluginData> getActions() override;
// void init() override;
signals:
void signalInitDone();
private: // methods
LtsWidgets::LtsDialog *onShowSymbolEditorDialog();
private: // attributes
std::shared_ptr<FileManagement::Interface::Dtc> m_flmDtc;
std::shared_ptr<FileManagement::Interface::Ftc> m_flmFtc;
std::shared_ptr<FileManagement::ForeignGuiInterface> m_flmGui;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
};
} // namespace AdvancedSymbology
@@ -0,0 +1,42 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#include "flm_reply_handler.h"
#include <LtsUtilsGuiDds/request_helper.h>
namespace AdvancedSymbology
{
FileManagementReplyHandler::FileManagementReplyHandler(LtsUtils::RequestHelper *rh, QObject *parent)
: QObject(parent)
, m_requestHelper(rh)
, m_id(-1)
{
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
}
void FileManagementReplyHandler::requestReply(const Core::FunctionReplyObject &replyObject)
{
m_requestHelper->requestReply(replyObject);
emit signalFileContentModifyReplyReceived();
}
void FileManagementReplyHandler::onGetFileContentDataReply(const FileManagement::GetFileContentDataReply &replyObject)
{
m_content = replyObject.content();
m_id = replyObject.id();
m_requestHelper->requestReply(replyObject);
}
}
@@ -0,0 +1,59 @@
/**
* @RDE_HEADER@
* GUI Plugin for SymbolEditor
* $Id$
* $HeadURL$
* $Author$
*
* Created by Chrsitian Roeskens, SLSE, 2017-04-12
*/
#pragma once
#include <FileManagement/flm_ftc.h>
#include <FileManagement/flm_ftc_types.h>
#include <QtCore/QObject>
namespace LtsUtils
{
class RequestHelper;
}
namespace AdvancedSymbology
{
class FileManagementReplyHandler final
: public QObject
, public FileManagement::Interface::Ftc::FileContentModifyReplyHandler
, public FileManagement::Interface::Ftc::GetFileContentDataReplyHandler
{
Q_OBJECT
public:
explicit FileManagementReplyHandler(LtsUtils::RequestHelper *rh, QObject *parent);
const std::vector<uint8_t> &getContent() const { return m_content; }
int32_t getId() const { return m_id; }
signals:
void signalFileContentModifyReplyReceived();
protected:
// file content
void onFileContentModifyReply(const Core::FunctionReplyObject &replyObject) override final { requestReply(replyObject); }
void onGetFileContentDataReply(const FileManagement::GetFileContentDataReply &replyObject) override final;
private:
void requestReply(const Core::FunctionReplyObject &replyObject);
LtsUtils::RequestHelper *m_requestHelper;
std::vector<uint8_t> m_content;
int32_t m_id;
}; // FileManagementReplyHandler
} // namespace PlanEditorPlugin
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>DeleteElementsDialog</class>
<widget class="QWidget" name="DeleteElementsDialog">
<property name="windowTitle">
<string>Delete Elements</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Delete elements/attributes from Symbol</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="checkBoxPrims">
<property name="text">
<string>Primitives</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxPrimsSectorText">
<property name="text">
<string>PrimsSectorText</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxAttributes">
<property name="text">
<string>Attributes</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="LtsWidgets::LtsDialogButtonBox" name="buttonBox"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LtsWidgets::LtsDialogButtonBox</class>
<extends>QWidget</extends>
<header>LtsWidgets/lts_dialog_button_box.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,133 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ResizeDialog</class>
<widget class="QWidget" name="ResizeDialog">
<property name="windowTitle">
<string notr="true"/>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QSlider" name="sliderHScale">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>400</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="spinBoxHScale">
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<double>4.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QSlider" name="sliderVScale">
<property name="minimum">
<number>1</number>
</property>
<property name="maximum">
<number>400</number>
</property>
<property name="singleStep">
<number>100</number>
</property>
<property name="value">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="spinBoxVScale">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="maximum">
<double>4.000000000000000</double>
</property>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="2" rowspan="2">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="checkBoxLock">
<property name="text">
<string>lock</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Horizontal:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Vertical:</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="LtsWidgets::LtsDialogButtonBox" name="buttonBox"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LtsWidgets::LtsDialogButtonBox</class>
<extends>QWidget</extends>
<header>LtsWidgets/lts_dialog_button_box.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RotateDialog</class>
<widget class="QWidget" name="RotateDialog">
<property name="windowTitle">
<string notr="true"/>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="spinBoxDegree">
<property name="buttonSymbols">
<enum>QAbstractSpinBox::UpDownArrows</enum>
</property>
<property name="maximum">
<double>360.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QSlider" name="sliderHDegree">
<property name="maximum">
<number>360</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="0" colspan="2">
<widget class="LtsWidgets::LtsDialogButtonBox" name="buttonBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LtsWidgets::LtsDialogButtonBox</class>
<extends>QWidget</extends>
<header>LtsWidgets/lts_dialog_button_box.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>sliderHDegree</tabstop>
<tabstop>spinBoxDegree</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SaveAsSymbol</class>
<widget class="QWidget" name="SaveAsSymbol">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>506</width>
<height>76</height>
</rect>
</property>
<property name="windowTitle">
<string notr="true"/>
</property>
<property name="toolTip">
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="lblName">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="leName">
<property name="toolTip">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="lblNameError">
<property name="styleSheet">
<string notr="true">color: rgb(255, 0, 0);</string>
</property>
<property name="text">
<string notr="true"/>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SelectTextDialog</class>
<widget class="QWidget" name="SelectTextDialog">
<property name="windowTitle">
<string notr="true"/>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Zeile 1:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit1"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Zeile 2:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit2"/>
</item>
</layout>
</item>
<item>
<widget class="LtsWidgets::LtsDialogButtonBox" name="buttonBox"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>LtsWidgets::LtsDialogButtonBox</class>
<extends>QWidget</extends>
<header>LtsWidgets/lts_dialog_button_box.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>lineEdit1</tabstop>
<tabstop>lineEdit2</tabstop>
<tabstop>buttonBox</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
File diff suppressed because it is too large. Load diff
Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

File diff suppressed because it is too large. Load diff
+54
View File
@@ -0,0 +1,54 @@
/*
*/
#include <cstdlib>
#include <getopt.h>
#include <string>
#include <nglapplication/nglapplication.h>
#include <QString>
#include <QDir>
#include "symboleditor.h"
#include "nglsettings.h"
#include <LtsPluginManager/lts_plugin_loader.h>
#include <PluginInterfaces/style_plugin_interface.h>
#include <PluginInterfaces/project_plugin_interface.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
int main(int argc, char *argv[])
{
NGLApplication app(argc, argv);
app.createLogger("SymbolApp");
QCoreApplication::addLibraryPath(QString::fromLocal8Bit(qgetenv("GFS_PATH")) + QLatin1Literal("/lib"));
// und auch in ../lib
QCoreApplication::addLibraryPath(QCoreApplication::applicationDirPath() + QLatin1Literal("/../lib"));
// QString ini = QString::fromStdString(qgetenv("GFS_PATH").toStdString()) + QLatin1Literal("/gfs.cfg");
// .. to keep some compatibility to old resource structure TODO: rm !
LtsPluginManager::LtsPluginLoader *pluginLoader = LtsPluginManager::LtsPluginLoader::getInstance();
pluginLoader->loadPlugins(LtsPluginManager::PluginType::STYLE, nullptr, QStringList() << QStringLiteral("rde.light"));
pluginLoader->loadPlugins(LtsPluginManager::PluginType::PROJECT, nullptr, QStringList() << QStringLiteral("legatus"));
QDir::setSearchPaths(QLatin1String("icon"), QStringList(QLatin1String(":/style/icons/")));
QDir::setSearchPaths(QLatin1String("icon"), QStringList(QLatin1String(":/style/"))); // FIXME: does qt check for recursion ??
STARTUP_LOG(app.baseLogger());
SymbolEditor *edit = new SymbolEditor(QString(), QString(), QString(), false);
if (!edit)
return -1;
edit->show();
int result = app.exec();
delete edit;
SHUTDOWN_LOG(app.baseLogger());
return result;
} // int main(int argc, char *argv[])