Compare commits
5 Commits
pragma-onc
...
header-ile
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17d10b2250 | ||
|
|
864cffb066 | ||
|
|
9324a30de1 | ||
|
|
d84ca82866 | ||
|
|
c52a315ec6 |
@@ -1,14 +1,41 @@
|
||||
qt_add_executable(skui
|
||||
main.cpp
|
||||
skui.h skui.cpp
|
||||
mainwindow.h mainwindow.cpp mainwindow.ui
|
||||
context_menu.h context_menu.cpp
|
||||
rename_node_dialog.h rename_node_dialog.cpp
|
||||
propertywindow.h propertywindow.cpp
|
||||
document.h document.cpp
|
||||
skui.hpp skui.cpp
|
||||
mainwindow.hpp mainwindow.cpp mainwindow.ui
|
||||
context_menu.hpp context_menu.cpp
|
||||
rename_node_dialog.hpp rename_node_dialog.cpp
|
||||
propertywindow.hpp propertywindow.cpp
|
||||
document.hpp document.cpp
|
||||
../../libs/icons.qrc
|
||||
)
|
||||
|
||||
find_package(Git QUIET)
|
||||
set(SKUI_BUILD_COMMIT "unknown")
|
||||
set(SKUI_BUILD_TAG "")
|
||||
|
||||
if(GIT_FOUND)
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" rev-parse --short=8 HEAD
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE SKUI_BUILD_COMMIT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
|
||||
execute_process(
|
||||
COMMAND "${GIT_EXECUTABLE}" describe --tags --abbrev=0 HEAD
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
OUTPUT_VARIABLE SKUI_BUILD_TAG
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(skui PRIVATE
|
||||
SKUI_BUILD_COMMIT="${SKUI_BUILD_COMMIT}"
|
||||
SKUI_BUILD_TAG="${SKUI_BUILD_TAG}"
|
||||
)
|
||||
|
||||
target_link_libraries(skui PRIVATE Qt6::Widgets)
|
||||
|
||||
set_target_properties(skui PROPERTIES
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "context_menu.h"
|
||||
#include "document.h"
|
||||
#include "rename_node_dialog.h"
|
||||
#include "context_menu.hpp"
|
||||
#include "document.hpp"
|
||||
#include "rename_node_dialog.hpp"
|
||||
|
||||
ContextMenu::ContextMenu(QWidget *parent, Node *node, const QPoint spawn_position)
|
||||
: QMenu{parent}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <QMenu>
|
||||
|
||||
#include "../node/node.h"
|
||||
#include "propertywindow.h"
|
||||
#include "../node/node.hpp"
|
||||
#include "propertywindow.hpp"
|
||||
|
||||
class ContextMenu : public QMenu
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "document.h"
|
||||
#include "document.hpp"
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(document)
|
||||
Q_LOGGING_CATEGORY(document, "DOCUMENT")
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
#include <QLoggingCategory>
|
||||
#include <QObject>
|
||||
|
||||
#include "nodeeditor.h"
|
||||
#include "nodes/label.h"
|
||||
#include "nodes/lineedit.h"
|
||||
#include "nodes/serialsend.h"
|
||||
#include "nodes/slider.h"
|
||||
#include "nodes/textcombine.h"
|
||||
#include "panel.h"
|
||||
#include "nodeeditor.hpp"
|
||||
#include "nodes/label.hpp"
|
||||
#include "nodes/lineedit.hpp"
|
||||
#include "nodes/serialsend.hpp"
|
||||
#include "nodes/slider.hpp"
|
||||
#include "nodes/textcombine.hpp"
|
||||
#include "panel.hpp"
|
||||
|
||||
/** @brief The Document class represents a document in the application.
|
||||
*
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "mainwindow.h"
|
||||
#include "skui.h"
|
||||
#include "mainwindow.hpp"
|
||||
#include "skui.hpp"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "mainwindow.h"
|
||||
#include "mainwindow.hpp"
|
||||
#include "ui_mainwindow.h"
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(gui)
|
||||
@@ -24,7 +24,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
|
||||
loadInsertVisualMenu();
|
||||
loadDebugMenu();
|
||||
|
||||
loadAboutMenu();
|
||||
loadAlignTools();
|
||||
|
||||
connect(this, &MainWindow::modeChanged, new_document->panel(), &Panel::setMode);
|
||||
@@ -56,6 +56,41 @@ void MainWindow::loadDebugMenu()
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::loadAboutMenu()
|
||||
{
|
||||
QMenu *about_menu = menuBar()->addMenu("About");
|
||||
|
||||
about_menu->addAction("Repository", this, [] {
|
||||
QDesktopServices::openUrl(QUrl("https://dev.skui.eu/SKUI/SKUI"));
|
||||
});
|
||||
|
||||
about_menu->addAction("Report a Bug", this, [] {
|
||||
QDesktopServices::openUrl(QUrl("https://dev.skui.eu/SKUI/SKUI/issues/"
|
||||
"new?template=.gitea%2fissue_template%2fbug-report.yml"));
|
||||
});
|
||||
|
||||
about_menu->addAction("Wiki", this, [] {
|
||||
QDesktopServices::openUrl(QUrl("https://dev.skui.eu/SKUI/SKUI/wiki"));
|
||||
});
|
||||
|
||||
about_menu->addAction("Contact Mail", this, [] {
|
||||
QDesktopServices::openUrl(QUrl("mailto:info@skui.eu"));
|
||||
});
|
||||
|
||||
about_menu->addAction("License (GPLv3)", this, [] {
|
||||
QDesktopServices::openUrl(QUrl("https://dev.skui.eu/SKUI/SKUI/src/branch/main/LICENSE"));
|
||||
});
|
||||
|
||||
const QString build_commit = QString::fromLatin1(SKUI_BUILD_COMMIT);
|
||||
const QString build_tag = QString::fromLatin1(SKUI_BUILD_TAG);
|
||||
QString info_title = QStringLiteral("Commit (") + build_commit;
|
||||
if (!build_tag.isEmpty()) {
|
||||
info_title += QStringLiteral(", ") + build_tag;
|
||||
}
|
||||
info_title += QLatin1Char(')');
|
||||
about_menu->addAction(info_title);
|
||||
}
|
||||
|
||||
void MainWindow::loadAlignTools()
|
||||
{
|
||||
const AlignTool align_tools[]
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDesktopServices>
|
||||
#include <QDir>
|
||||
#include <QMainWindow>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "document.h"
|
||||
#include "nodeeditor.h"
|
||||
#include "panel.h"
|
||||
#include "document.hpp"
|
||||
#include "nodeeditor.hpp"
|
||||
#include "panel.hpp"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
@@ -42,6 +44,7 @@ private:
|
||||
|
||||
void loadInsertVisualMenu();
|
||||
void loadDebugMenu();
|
||||
void loadAboutMenu();
|
||||
void loadAlignTools();
|
||||
|
||||
DisplayMode m_display_mode = DisplayMode::Run;
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "propertywindow.h"
|
||||
#include "propertywindow.hpp"
|
||||
|
||||
PropertyWindow::PropertyWindow(QWidget* parent, const QObject* object)
|
||||
: QWidget{parent, Qt::Window}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "rename_node_dialog.h"
|
||||
#include "rename_node_dialog.hpp"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
#include <QLabel>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "skui.h"
|
||||
#include "skui.hpp"
|
||||
|
||||
Skui::Skui(int &argc, char **argv)
|
||||
: QApplication(argc, argv)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
qt_add_library(node STATIC
|
||||
node.h node.cpp
|
||||
interface.h interface.cpp
|
||||
nodes/visual.h nodes/visual.cpp
|
||||
nodes/label.h nodes/label.cpp
|
||||
nodes/slider.h nodes/slider.cpp
|
||||
nodes/serialsend.h nodes/serialsend.cpp
|
||||
nodes/lineedit.h nodes/lineedit.cpp
|
||||
nodes/textcombine.h nodes/textcombine.cpp
|
||||
node.hpp node.cpp
|
||||
interface.hpp interface.cpp
|
||||
nodes/visual.hpp nodes/visual.cpp
|
||||
nodes/label.hpp nodes/label.cpp
|
||||
nodes/slider.hpp nodes/slider.cpp
|
||||
nodes/serialsend.hpp nodes/serialsend.cpp
|
||||
nodes/lineedit.hpp nodes/lineedit.cpp
|
||||
nodes/textcombine.hpp nodes/textcombine.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(node PRIVATE Qt6::Widgets Qt6::SerialPort)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "interface.h"
|
||||
#include "interface.hpp"
|
||||
|
||||
Interface::Interface(QVariant &&value, InterfaceDirection interface_direction, QString identifier)
|
||||
: QVariant(value)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "node.h"
|
||||
#include "node.hpp"
|
||||
|
||||
QMap<QString, int> Node::instance_counter;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <QPoint>
|
||||
#include <QVariant>
|
||||
|
||||
#include "interface.h"
|
||||
#include "interface.hpp"
|
||||
|
||||
class Node : public QObject
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "label.h"
|
||||
#include "label.hpp"
|
||||
|
||||
Label::Label(QObject *parent)
|
||||
: Visual{parent}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
#include "visual.h"
|
||||
#include "visual.hpp"
|
||||
|
||||
class Label : public Visual
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "lineedit.h"
|
||||
#include "lineedit.hpp"
|
||||
|
||||
LineEdit::LineEdit(QObject *parent)
|
||||
: Visual{parent}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <QLineEdit>
|
||||
|
||||
#include "visual.h"
|
||||
#include "visual.hpp"
|
||||
|
||||
class LineEdit : public Visual
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "serialsend.h"
|
||||
#include "serialsend.hpp"
|
||||
|
||||
SerialSend::SerialSend(QObject *parent)
|
||||
: Visual{parent}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <QSerialPort>
|
||||
#include <QSerialPortInfo>
|
||||
|
||||
#include "visual.h"
|
||||
#include "visual.hpp"
|
||||
|
||||
class SerialSend : public Visual
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "slider.h"
|
||||
#include "slider.hpp"
|
||||
|
||||
Slider::Slider(QObject *parent)
|
||||
: Visual{parent}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <QDebug>
|
||||
#include <QSlider>
|
||||
|
||||
#include "visual.h"
|
||||
#include "visual.hpp"
|
||||
|
||||
class Slider : public Visual
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "textcombine.h"
|
||||
#include "textcombine.hpp"
|
||||
|
||||
TextCombine::TextCombine(QObject *parent)
|
||||
: Node{parent}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "../node.h"
|
||||
#include "../node.hpp"
|
||||
|
||||
class TextCombine : public Node
|
||||
{
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "visual.h"
|
||||
#include "visual.hpp"
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(visual)
|
||||
Q_LOGGING_CATEGORY(visual, "VISUAL")
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
#include <QLoggingCategory>
|
||||
|
||||
#include "../../panel/visual_container.h"
|
||||
#include "../node.h"
|
||||
#include "../../panel/visual_container.hpp"
|
||||
#include "../node.hpp"
|
||||
|
||||
class Visual : public Node
|
||||
{
|
||||
@@ -1,9 +1,9 @@
|
||||
qt_add_library(nodeeditor STATIC
|
||||
nodeeditor.h nodeeditor.cpp
|
||||
nodeeditor_scene.h nodeeditor_scene.cpp
|
||||
graphicsitems/node_graphicsitem.h graphicsitems/node_graphicsitem.cpp
|
||||
graphicsitems/pad.h graphicsitems/pad.cpp
|
||||
graphicsitems/cable.h graphicsitems/cable.cpp
|
||||
nodeeditor.hpp nodeeditor.cpp
|
||||
nodeeditor_scene.hpp nodeeditor_scene.cpp
|
||||
graphicsitems/node_graphicsitem.hpp graphicsitems/node_graphicsitem.cpp
|
||||
graphicsitems/pad.hpp graphicsitems/pad.cpp
|
||||
graphicsitems/cable.hpp graphicsitems/cable.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(nodeeditor PRIVATE Qt6::Widgets)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "cable.h"
|
||||
#include "pad.h"
|
||||
#include "cable.hpp"
|
||||
#include "pad.hpp"
|
||||
|
||||
Cable::Cable(QGraphicsItem *parent, const Pad *start_pad)
|
||||
: QGraphicsObject{parent}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QPainter>
|
||||
|
||||
#include "pad.h"
|
||||
#include "pad.hpp"
|
||||
|
||||
enum class DirectionalPlane { Horizontal, Vertical };
|
||||
inline DirectionalPlane &operator!(DirectionalPlane &plane)
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "node_graphicsitem.h"
|
||||
#include "node_graphicsitem.hpp"
|
||||
#include <QGraphicsScene>
|
||||
|
||||
NodeGraphicsItem::NodeGraphicsItem(QGraphicsItem *parent, Node *node)
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#include <QPen>
|
||||
#include <QPointF>
|
||||
|
||||
#include "../../node/node.h"
|
||||
#include "pad.h"
|
||||
#include "../../node/node.hpp"
|
||||
#include "pad.hpp"
|
||||
|
||||
static const QMargins BOX_MARGIN(7, 7, 7, 7);
|
||||
static const QColor BOX_COLOR = QColorConstants::Svg::midnightblue;
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "pad.h"
|
||||
#include "pad.hpp"
|
||||
|
||||
Pad::Pad(QGraphicsItem *parent, Interface *interface, PadSide pad_side)
|
||||
: QGraphicsObject{parent}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QPainter>
|
||||
|
||||
#include "../../node/interface.h"
|
||||
#include "../../node/interface.hpp"
|
||||
|
||||
static const int LINE_WIDTH = 3;
|
||||
static const int PAD_SIZE = 10;
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "nodeeditor.h"
|
||||
#include "../app/context_menu.h"
|
||||
#include "nodeeditor.hpp"
|
||||
#include "../app/context_menu.hpp"
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(ne_view)
|
||||
Q_LOGGING_CATEGORY(ne_view, "NE_VIEW")
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
#include <QLoggingCategory>
|
||||
#include <QMouseEvent>
|
||||
|
||||
#include "../node/node.h"
|
||||
#include "graphicsitems/node_graphicsitem.h"
|
||||
#include "nodeeditor_scene.h"
|
||||
#include "../node/node.hpp"
|
||||
#include "graphicsitems/node_graphicsitem.hpp"
|
||||
#include "nodeeditor_scene.hpp"
|
||||
|
||||
class NodeEditor : public QGraphicsView
|
||||
{
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "nodeeditor_scene.h"
|
||||
#include "graphicsitems/pad.h"
|
||||
#include "nodeeditor_scene.hpp"
|
||||
#include "graphicsitems/pad.hpp"
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(ne_scence)
|
||||
Q_LOGGING_CATEGORY(ne_scence, "NE_SCENCE")
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include <QLoggingCategory>
|
||||
#include <QPointer>
|
||||
|
||||
#include "./graphicsitems/cable.h"
|
||||
#include "./graphicsitems/node_graphicsitem.h"
|
||||
#include "./graphicsitems/cable.hpp"
|
||||
#include "./graphicsitems/node_graphicsitem.hpp"
|
||||
|
||||
class NodeEditorScene : public QGraphicsScene
|
||||
{
|
||||
@@ -1,7 +1,7 @@
|
||||
qt_add_library(panel STATIC
|
||||
resizeboundingbox.h resizeboundingbox.cpp
|
||||
panel.h panel.cpp
|
||||
visual_container.h visual_container.cpp
|
||||
resizeboundingbox.hpp resizeboundingbox.cpp
|
||||
panel.hpp panel.cpp
|
||||
visual_container.hpp visual_container.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(panel PRIVATE nodeeditor PRIVATE Qt6::Widgets)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "panel.h"
|
||||
#include "panel.hpp"
|
||||
|
||||
Q_DECLARE_LOGGING_CATEGORY(panel)
|
||||
Q_LOGGING_CATEGORY(panel, "PANEL")
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
#include <QRubberBand>
|
||||
#include <QWidget>
|
||||
|
||||
#include "../app/context_menu.h"
|
||||
#include "../node/nodes/visual.h"
|
||||
#include "resizeboundingbox.h"
|
||||
#include "visual_container.h"
|
||||
#include "../app/context_menu.hpp"
|
||||
#include "../node/nodes/visual.hpp"
|
||||
#include "resizeboundingbox.hpp"
|
||||
#include "visual_container.hpp"
|
||||
|
||||
enum class AlignDirection { Top, Right, Bottom, Left, Horizontal, Vertical };
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "resizeboundingbox.h"
|
||||
#include "resizeboundingbox.hpp"
|
||||
|
||||
ResizeBoundingBox::ResizeBoundingBox(QWidget *parent)
|
||||
: QWidget{parent}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include "visual_container.h"
|
||||
#include "visual_container.hpp"
|
||||
|
||||
VisualContainer::VisualContainer(QWidget *parent)
|
||||
: QWidget{parent}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "../node/node.h"
|
||||
#include <QChildEvent>
|
||||
#include <QLayout>
|
||||
#include <QWidget>
|
||||
|
||||
#include "../node/node.hpp"
|
||||
class VisualContainer : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Reference in New Issue
Block a user