From 101a567e6bf9947899be6117a4b263d4589179f7 Mon Sep 17 00:00:00 2001 From: Hubery Hsu Date: Sat, 24 Jan 2026 18:20:21 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E3=80=90AL-75=E3=80=91MDI=20Function?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Alice | 2 +- .../UI/SolidDesignerCommand/CMakeLists.txt | 10 +- .../GeneralCommands/SolidFileNewCommand.cpp | 76 ++++- Designer/UI/SolidDesignerUI/CMakeLists.txt | 26 +- .../GeneralDialogs/SolidNewFileDialog.cpp | 293 ++++++++++++++++++ .../SolidDesignerUI/Public/SolidDesignerUI.h | 23 ++ .../Public/SolidNewFileDialog.h | 75 +++++ .../UI/SolidDesignerUI/SolidDesignerUI.cpp | 6 +- Designer/UI/SolidDesignerUI/SolidDesignerUI.h | 44 --- 9 files changed, 491 insertions(+), 64 deletions(-) create mode 100644 Designer/UI/SolidDesignerUI/GeneralDialogs/SolidNewFileDialog.cpp create mode 100644 Designer/UI/SolidDesignerUI/Public/SolidDesignerUI.h create mode 100644 Designer/UI/SolidDesignerUI/Public/SolidNewFileDialog.h delete mode 100644 Designer/UI/SolidDesignerUI/SolidDesignerUI.h diff --git a/Alice b/Alice index 6e7d0581..c84c5f8b 160000 --- a/Alice +++ b/Alice @@ -1 +1 @@ -Subproject commit 6e7d0581fcc25a17bc4f0d39657e66c4034d18c3 +Subproject commit c84c5f8b54d43a75b68a8979edb52b19b7000b41 diff --git a/Designer/UI/SolidDesignerCommand/CMakeLists.txt b/Designer/UI/SolidDesignerCommand/CMakeLists.txt index a17eed52..e559d40e 100644 --- a/Designer/UI/SolidDesignerCommand/CMakeLists.txt +++ b/Designer/UI/SolidDesignerCommand/CMakeLists.txt @@ -18,6 +18,7 @@ else() endif() +find_package(Qt5 COMPONENTS Core Gui Widgets Network Quick Qml REQUIRED) # 然后再找 Python3 find_package(Python3 REQUIRED COMPONENTS Interpreter) @@ -58,7 +59,7 @@ include_directories(${PROJECT_SOURCE_DIR}/Alice/Interaction/Interface/AliceCoreA include_directories(${PROJECT_SOURCE_DIR}/Alice/Data/Interface/AliceModelInterface/Public) include_directories(${PROJECT_SOURCE_DIR}/Alice/UI/QFrameWork/AliceUiFrameWork/Public) - +include_directories(${PROJECT_SOURCE_DIR}/Designer/UI/SolidDesignerUI/Public) #----------------------------------------------------------------------------- # 定义项目构建中间文件的生成目录 @@ -165,6 +166,12 @@ set_target_properties(SolidDesignerCommandsId PROPERTIES FOLDER "Designer/UI") # 链接第三方的库 链接的动作需要放到add_library之后 #----------------------------------------------------------------------------- target_link_libraries(SolidDesignerCommand PRIVATE + Qt5::Core + Qt5::Gui + Qt5::Widgets + Qt5::Network + Qt5::Quick + Qt5::Qml AliceFoundation AliceBasicTool AliceCoreApplicationInterface @@ -173,6 +180,7 @@ target_link_libraries(SolidDesignerCommand PRIVATE AliceModelInterface AliceUiFrameWork AlicePluginSystem + SolidDesignerUI ) diff --git a/Designer/UI/SolidDesignerCommand/GeneralCommands/SolidFileNewCommand.cpp b/Designer/UI/SolidDesignerCommand/GeneralCommands/SolidFileNewCommand.cpp index 5a746ea2..d0ff087e 100644 --- a/Designer/UI/SolidDesignerCommand/GeneralCommands/SolidFileNewCommand.cpp +++ b/Designer/UI/SolidDesignerCommand/GeneralCommands/SolidFileNewCommand.cpp @@ -7,10 +7,29 @@ #include "AliceCoreAppUtil.h" #include "AliceISession.h" #include "AliceDiagnosticMacro.h" +#include "AliceIUiApplicationFactory.h" +#include "AliceIUiApplication.h" +#include "SolidNewFileDialog.h" +#include +#include "AliceIWorkBenchManager.h" using namespace alice; using namespace sdr; +namespace +{ + static IMainWindow* GetMainWindow() + { + IUiApplicationFactory* pAppFactory = IUiApplicationFactory::Get(); + if (!pAppFactory) + return nullptr; + IUiApplication* pApp = pAppFactory->GetUiApplication(); + if (!pApp) + return nullptr; + // AliceIUiApplication returns const IMainWindow*, but we need non-const methods. + return const_cast(pApp->GetMainWindow()); + } +} SolidFileNewCommand::~SolidFileNewCommand() { @@ -24,22 +43,43 @@ SolidFileNewCommand::SolidFileNewCommand() noexcept std::string SolidFileNewCommand::DisabledReason() const { + if (CoreAppUtil::GetCurrentSession() == nullptr) + return "Session is not available."; + + ISession* session = CoreAppUtil::GetCurrentSession(); + if (session && session->GetDocumentManager() == nullptr) + return "Document manager is not available."; + + if (GetMainWindow() == nullptr) + return "Main window is not available."; return std::string(); } bool SolidFileNewCommand::IsEnabled() const { - return true; + return IsSupported(); } bool SolidFileNewCommand::IsVisible() const { - return true; + return IsSupported(); } bool SolidFileNewCommand::IsSupported() const { - return true; + ISession* session = CoreAppUtil::GetCurrentSession(); + if (!session) + return false; + + IDocumentManager* docMgr = session->GetDocumentManagerFw(); + if (!docMgr) + return false; + + IMainWindow* pMainWindow = GetMainWindow(); + if (!pMainWindow) + return false; + + return true; } std::unique_ptr SolidFileNewCommand::Execute(const alice::CommandParameter& param) @@ -47,15 +87,29 @@ std::unique_ptr SolidFileNewCommand::Execute(const alice::Com ISession* pSession = CoreAppUtil::GetCurrentSession(); DIAG_RETURN_NULL_IF_FALSE(pSession, "pSession is null", "hananiah", "2025.12.25"); - // ˴creo ½Իѡĵͣдĵ,Common Name - std::wstring strFileName; + IMainWindow* pMainWindow = GetMainWindow(); + DIAG_RETURN_NULL_IF_FALSE(pMainWindow, "pMainWindow is null", "hananiah", "2026.01.16"); + QMainWindow* pParent = pMainWindow->AsQMainWindow(); + SolidNewFileDialog::NewFileRequest oRequest; + if (!SolidNewFileDialog::GetNewFileRequest(pParent, oRequest)) + return nullptr; - IDocument* pDoc = pSession->CreateDocument(strFileName); - DIAG_RETURN_NULL_IF_FALSE(pDoc, "pDoc is null", "hananiah", "2025.12.25"); + IDocument* pDoc = pSession->CreateDocument(oRequest.kind, oRequest.name.toStdWString()); + DIAG_RETURN_NULL_IF_FALSE(pDoc, "Failed to create a new document", "hananiah", "2025.12.25"); - // ½ĵ֮Aliceƽ̨лWorkBench - // ͬĵӦͬworkbench + // Workbench switching: pick by document kind (ResolveWorkbenchByDocument). + if (IWorkBenchManager* pWbMgr = pMainWindow->GetWorkbenchManager()) + { + std::string wbId = pWbMgr->ResolveWorkbenchByDocument(pDoc); + if (!wbId.empty()) + pWbMgr->ActivateWorkBench(wbId, pDoc); + else + pWbMgr->ActiveStartupWorkbench(pDoc); + } - return nullptr; -} + // TODO: each document opens exactly one default 3D view. + // MdiViewManagerQt::OpenPrimaryView replaces the pane content, so this call is idempotent. + pMainWindow->OpenView("view.model3d", pDoc, oRequest.name.toStdWString()); + return nullptr; +} diff --git a/Designer/UI/SolidDesignerUI/CMakeLists.txt b/Designer/UI/SolidDesignerUI/CMakeLists.txt index fc8be6a0..2609748e 100644 --- a/Designer/UI/SolidDesignerUI/CMakeLists.txt +++ b/Designer/UI/SolidDesignerUI/CMakeLists.txt @@ -15,14 +15,18 @@ find_package(Qt5 COMPONENTS Core Gui Widgets Network Quick Qml REQUIRED) message("${PROJECT_SOURCE_DIR}") - -FILE(GLOB SOURCE_FILES "${PROJECT_SOURCE_DIR}/Designer/UI/SolidDesignerUI/*.cpp") -FILE(GLOB HEADER_FILES "${PROJECT_SOURCE_DIR}/Designer/UI/SolidDesignerUI/*.h") - - set(RESOURCES ${PROJECT_SOURCE_DIR}/Designer/UI/SolidDesignerUI/StyleTemplate.qrc) source_group("resources" FILES ${RESOURCES}) +set(ABS_SDU "${PROJECT_SOURCE_DIR}/Designer/UI/SolidDesignerUI") + +file(GLOB SDU_FILES + "${ABS_SDU}/*.cpp" "${ABS_SDU}/*.h" + "${ABS_SDU}/Public/*.h" + "${ABS_SDU}/GeneralDialogs/*.h" "${ABS_SDU}/GeneralDialogs/*.cpp" +) + +source_group(TREE "${ABS_SDU}" FILES ${SDU_FILES}) #----------------------------------------------------------------------------- # 库文件链接路径(ALICE_LIB_DIR 在上级定义了) @@ -31,7 +35,7 @@ link_directories(${ALICE_LIB_DIR}) #============================================================================= #指定工程为动态库程序 -add_library(SolidDesignerUI SHARED ${SOURCE_FILES} ${HEADER_FILES}) +add_library(SolidDesignerUI SHARED ${SDU_FILES}) #设定工程的过滤器 set_target_properties(SolidDesignerUI PROPERTIES FOLDER "Designer/UI") #============================================================================= @@ -51,6 +55,8 @@ target_include_directories(SolidDesignerUI ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Public ${PROJECT_SOURCE_DIR}/Alice/Core/Foundation/AliceBasicTool/Public + ${PROJECT_SOURCE_DIR}/Alice/UI/QFrameWork/AliceUiBasicTools/Public + ${PROJECT_SOURCE_DIR}/Alice/Data/Interface/AliceModelInterface/Public ) #----------------------------------------------------------------------------- @@ -115,7 +121,15 @@ endif() # @1、链接的动作需要放到add_library之后 #----------------------------------------------------------------------------- target_link_libraries(SolidDesignerUI PRIVATE + Qt5::Core + Qt5::Gui + Qt5::Widgets + Qt5::Network + Qt5::Quick + Qt5::Qml AliceBasicTool + AliceUiBasicTools + AliceModelInterface ) diff --git a/Designer/UI/SolidDesignerUI/GeneralDialogs/SolidNewFileDialog.cpp b/Designer/UI/SolidDesignerUI/GeneralDialogs/SolidNewFileDialog.cpp new file mode 100644 index 00000000..5dda49b1 --- /dev/null +++ b/Designer/UI/SolidDesignerUI/GeneralDialogs/SolidNewFileDialog.cpp @@ -0,0 +1,293 @@ +//Owner: hananiah +#include "SolidNewFileDialog.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "AliceQxPtrUtils.h" + +using namespace sdr; + +namespace +{ + static SolidNewFileDialog::TypeId ReadType(const QListWidget* list) + { + if (auto* it = list ? list->currentItem() : nullptr) + return static_cast(it->data(Qt::UserRole).toInt()); + return SolidNewFileDialog::TypeId::Part; + } + + static SolidNewFileDialog::SubTypeId ReadSubType(const QListWidget* list) + { + if (auto* it = list ? list->currentItem() : nullptr) + return static_cast(it->data(Qt::UserRole).toInt()); + return SolidNewFileDialog::SubTypeId::Default; + } +} + +SolidNewFileDialog::SolidNewFileDialog(QWidget* parent) + : QDialog(parent) +{ + setWindowTitle(tr("New")); + setModal(true); + setMinimumSize(700, 420); + + BuildUi_(); + PopulateTypes_(); + PopulateSubtypes_(TypeId::Part); + + // Default selections + m_typeList->setCurrentRow(0); + m_subTypeList->setCurrentRow(0); + m_useTemplate->setChecked(true); + + // Wire events + QObject::connect(m_typeList, &QListWidget::currentRowChanged, this, [this](int /*row*/) { + const TypeId type = ReadType(m_typeList); + PopulateSubtypes_(type); + SyncFromUi_(); + UpdateOkEnabled_(); + }); + QObject::connect(m_subTypeList, &QListWidget::currentRowChanged, this, [this](int /*row*/) { + SyncFromUi_(); + UpdateOkEnabled_(); + }); + QObject::connect(m_nameEdit, &QLineEdit::textChanged, this, [this](const QString&) { + SyncFromUi_(); + UpdateOkEnabled_(); + }); + QObject::connect(m_useTemplate, &QCheckBox::toggled, this, [this](bool) { + SyncFromUi_(); + UpdateOkEnabled_(); + }); + + SyncFromUi_(); + UpdateOkEnabled_(); +} + +SolidNewFileDialog::~SolidNewFileDialog() +{ + +} + +bool SolidNewFileDialog::GetNewFileRequest(QWidget* parent, NewFileRequest& outRequest) +{ + SolidNewFileDialog dlg(parent); + if (dlg.exec() != QDialog::Accepted) + return false; + + outRequest = dlg.Request(); + if (outRequest.name.trimmed().isEmpty()) + return false; + + return true; +} + +void SolidNewFileDialog::BuildUi_() +{ + QVBoxLayout* pRootLayout = QX_NEW_QOBJECT(QVBoxLayout, this); + DIAG_RETURN_VOID_IF_FALSE(pRootLayout, "pRootLayout is null", "hananiah", "2025.12.25"); + pRootLayout->setContentsMargins(12, 12, 12, 12); + pRootLayout->setSpacing(10); + + // Two-column: type/subtype lists + QSplitter* pSplit = QX_NEW_QWIDGET(QSplitter, this); + DIAG_RETURN_VOID_IF_FALSE(pSplit, "pSplit is null", "hananiah", "2025.12.25"); + pSplit->setOrientation(Qt::Horizontal); + pRootLayout->addWidget(pSplit, /*stretch*/ 1); + + QGroupBox* pLeftBox = QX_NEW_QWIDGET(QGroupBox, tr("Type"), this); + QGroupBox* pRightBox = QX_NEW_QWIDGET(QGroupBox, tr("Subtype"), this); + + QVBoxLayout* pLeftLayout = QX_NEW_QOBJECT(QVBoxLayout, pLeftBox); + DIAG_RETURN_VOID_IF_FALSE(pLeftLayout, "pLeftLayout is null", "hananiah", "2025.12.25"); + QVBoxLayout* pRightLayout = QX_NEW_QOBJECT(QVBoxLayout, pRightBox); + DIAG_RETURN_VOID_IF_FALSE(pRightLayout, "pRightLayout is null", "hananiah", "2025.12.25"); + m_typeList = QX_NEW_QWIDGET(QListWidget, pLeftBox); + m_subTypeList = QX_NEW_QWIDGET(QListWidget, pRightBox); + + pLeftLayout->addWidget(m_typeList); + pRightLayout->addWidget(m_subTypeList); + + pSplit->addWidget(pLeftBox); + pSplit->addWidget(pRightBox); + pSplit->setStretchFactor(0, 1); + pSplit->setStretchFactor(1, 1); + + // Form area + QGroupBox* pFormBox = QX_NEW_QWIDGET(QGroupBox, tr("Settings"), this); + QFormLayout* pForm = new QFormLayout(pFormBox); + DIAG_RETURN_VOID_IF_FALSE(pForm, "pForm is null", "hananiah", "2025.12.25"); + pFormBox->setLayout(pForm); + pRootLayout->addWidget(pFormBox); + + m_nameEdit = QX_NEW_QWIDGET(QLineEdit, this); + DIAG_RETURN_VOID_IF_FALSE(m_nameEdit, "m_nameEdit is null", "hananiah", "2025.12.25"); + m_nameEdit->setPlaceholderText(tr("Name (e.g. Part1)")); + pForm->addRow(tr("Name"), m_nameEdit); + + m_useTemplate = QX_NEW_QWIDGET(QCheckBox, tr("Use default template"), this); + DIAG_RETURN_VOID_IF_FALSE(m_useTemplate, "m_useTemplate is null", "hananiah", "2025.12.25"); + pForm->addRow(QString(), m_useTemplate); + + m_kindLabel = QX_NEW_QWIDGET(QLabel, this); + DIAG_RETURN_VOID_IF_FALSE(m_kindLabel, "m_kindLabel is null", "hananiah", "2025.12.25"); + m_kindLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); + pForm->addRow(tr("DocumentKind"), m_kindLabel); + + // Buttons + m_buttons = QX_NEW_QWIDGET(QDialogButtonBox, QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); + DIAG_RETURN_VOID_IF_FALSE(m_buttons, "m_buttons is null", "hananiah", "2025.12.25"); + pRootLayout->addWidget(m_buttons); + QObject::connect(m_buttons, &QDialogButtonBox::accepted, this, &QDialog::accept); + QObject::connect(m_buttons, &QDialogButtonBox::rejected, this, &QDialog::reject); +} + +void SolidNewFileDialog::PopulateTypes_() +{ + m_typeList->clear(); + auto addType = [this](TypeId t) { + auto* pItem = QX_EMPLACE_ITEM(nullptr, QListWidgetItem, TypeText_(t), m_typeList); + DIAG_RETURN_VOID_IF_FALSE(pItem, "pItem is null", "hananiah", "2025.12.25"); + pItem->setData(Qt::UserRole, static_cast(t)); + }; + addType(TypeId::Part); + addType(TypeId::Assembly); + addType(TypeId::Drawing); + addType(TypeId::Sketch); +} + +void SolidNewFileDialog::PopulateSubtypes_(TypeId type) +{ + m_subTypeList->clear(); + auto addSubType = [this](SubTypeId st) { + auto* pItem = QX_EMPLACE_ITEM(nullptr, QListWidgetItem, SubTypeText_(st), m_subTypeList); + DIAG_RETURN_VOID_IF_FALSE(pItem, "pItem is null", "hananiah", "2025.12.25"); + pItem->setData(Qt::UserRole, static_cast(st)); + }; + + // Keep it minimal yet expandable. + switch (type) + { + case TypeId::Part: + addSubType(SubTypeId::Solid); + addSubType(SubTypeId::Sheetmetal); + break; + case TypeId::Assembly: + addSubType(SubTypeId::Default); + break; + case TypeId::Drawing: + addSubType(SubTypeId::Default); + addSubType(SubTypeId::Layout); + break; + case TypeId::Sketch: + addSubType(SubTypeId::Default); + break; + default: + addSubType(SubTypeId::Default); + break; + } + + m_subTypeList->setCurrentRow(0); +} + +void SolidNewFileDialog::SyncFromUi_() +{ + m_request.type = ReadType(m_typeList); + m_request.subtype = ReadSubType(m_subTypeList); + m_request.kind = MapToDocumentKind_(m_request.type, m_request.subtype); + m_request.name = m_nameEdit->text().trimmed(); + m_request.useDefaultTemplate = m_useTemplate->isChecked(); + + QString kindText; + switch (m_request.kind) + { + case alice::DocumentKind::Part: + kindText = tr("Part"); + break; + case alice::DocumentKind::Assembly: + kindText = tr("Assembly"); + break; + case alice::DocumentKind::Drawing: + kindText = tr("Drawing"); + break; + case alice::DocumentKind::Sketch: + kindText = tr("Sketch"); + break; + default: + kindText = tr("Unknown"); + break; + } + m_kindLabel->setText(kindText); +} + +void SolidNewFileDialog::UpdateOkEnabled_() +{ + const bool ok = !m_nameEdit->text().trimmed().isEmpty(); + if (QAbstractButton* btn = m_buttons->button(QDialogButtonBox::Ok)) + btn->setEnabled(ok); +} + +alice::DocumentKind SolidNewFileDialog::MapToDocumentKind_(TypeId type, SubTypeId /*subtype*/) noexcept +{ + // conventional mapping in Alice: + // - Part/Solid/Sheetmetal -> DocumentKind::Part + // - Assembly -> DocumentKind::Assembly + // - Drawing/Layout -> DocumentKind::Drawing + // - Sketch -> DocumentKind::Sketch + switch (type) + { + case TypeId::Part: + return alice::DocumentKind::Part; + case TypeId::Assembly: + return alice::DocumentKind::Assembly; + case TypeId::Drawing: + return alice::DocumentKind::Drawing; + case TypeId::Sketch: + return alice::DocumentKind::Sketch; + default: + return alice::DocumentKind::Part; + } +} + +QString SolidNewFileDialog::TypeText_(TypeId type) +{ + switch (type) + { + case TypeId::Part: + return tr("Part"); + case TypeId::Assembly: + return tr("Assembly"); + case TypeId::Drawing: + return tr("Drawing"); + case TypeId::Sketch: + return tr("Sketch"); + default: + return tr("Part"); + } +} + +QString SolidNewFileDialog::SubTypeText_(SubTypeId st) +{ + switch (st) + { + case SubTypeId::Default: + return tr("Default"); + case SubTypeId::Solid: + return tr("Solid"); + case SubTypeId::Sheetmetal: + return tr("Sheetmetal"); + case SubTypeId::Layout: + return tr("Layout"); + default: + return tr("Default"); + } +} diff --git a/Designer/UI/SolidDesignerUI/Public/SolidDesignerUI.h b/Designer/UI/SolidDesignerUI/Public/SolidDesignerUI.h new file mode 100644 index 00000000..0ac8b3cb --- /dev/null +++ b/Designer/UI/SolidDesignerUI/Public/SolidDesignerUI.h @@ -0,0 +1,23 @@ +#pragma once +// 此头文件包含DLL导出的宏 +#include "AliceMacroDefinitions.h" +#include + +#if defined(_WIN32) +#ifdef SOLID_DESIGNER_UI_HOME +#define SOLID_DESIGNER_UI_EXPORT DLL_EXPORT +#else +#define SOLID_DESIGNER_UI_EXPORT DLL_IMPORT +#endif +#else +#define SOLID_DESIGNER_UI_EXPORT __attribute__((visibility("default"))) +#endif + +#include "AliceGuidUtils.h" +namespace soliddesignerui +{ + extern const Guid MODULE_ID; +} + + + diff --git a/Designer/UI/SolidDesignerUI/Public/SolidNewFileDialog.h b/Designer/UI/SolidDesignerUI/Public/SolidNewFileDialog.h new file mode 100644 index 00000000..ef2ff1f6 --- /dev/null +++ b/Designer/UI/SolidDesignerUI/Public/SolidNewFileDialog.h @@ -0,0 +1,75 @@ +#pragma once +#include "SolidDesignerUI.h" +#include "AliceDocumentKind.h" + +#include +#include + +class QListWidget; +class QLineEdit; +class QCheckBox; +class QLabel; +class QWidget; +class QDialogButtonBox; +namespace sdr +{ + class SOLID_DESIGNER_UI_EXPORT SolidNewFileDialog final : public QDialog + { + public: + enum class TypeId + { + Part = 0, + Assembly = 1, + Drawing = 2, + Sketch = 3, + }; + + enum class SubTypeId + { + Default = 0, + Solid = 1, + Sheetmetal = 2, + Layout = 3, + }; + + struct NewFileRequest + { + TypeId type = TypeId::Part; + SubTypeId subtype = SubTypeId::Solid; + alice::DocumentKind kind = alice::DocumentKind::Part; + QString name; + bool useDefaultTemplate = true; + }; + + explicit SolidNewFileDialog(QWidget* parent = nullptr); + ~SolidNewFileDialog() override; + + /// \brief Blocking modal helper. + /// \return true if user clicks OK and the request is valid. + static bool GetNewFileRequest(QWidget* parent, NewFileRequest& outRequest); + + /// \brief Current request snapshot (only meaningful after accept()). + const NewFileRequest& Request() const { return m_request; } + + private: + void BuildUi_(); + void PopulateTypes_(); + void PopulateSubtypes_(TypeId type); + void SyncFromUi_(); + void UpdateOkEnabled_(); + + static alice::DocumentKind MapToDocumentKind_(TypeId type, SubTypeId subtype) noexcept; + static QString TypeText_(TypeId type); + static QString SubTypeText_(SubTypeId st); + + private: + QListWidget* m_typeList = nullptr; + QListWidget* m_subTypeList = nullptr; + QLineEdit* m_nameEdit = nullptr; + QCheckBox* m_useTemplate = nullptr; + QLabel* m_kindLabel = nullptr; + QDialogButtonBox* m_buttons = nullptr; + + NewFileRequest m_request; + }; +} diff --git a/Designer/UI/SolidDesignerUI/SolidDesignerUI.cpp b/Designer/UI/SolidDesignerUI/SolidDesignerUI.cpp index 3f00fc5d..563e968d 100644 --- a/Designer/UI/SolidDesignerUI/SolidDesignerUI.cpp +++ b/Designer/UI/SolidDesignerUI/SolidDesignerUI.cpp @@ -1 +1,5 @@ -#include "SolidDesignerUI.h" \ No newline at end of file +#include "SolidDesignerUI.h" + + +// {C4E3ACB8-8CCD-45C5-BD20-76E6F62E384E} +const Guid soliddesignerui::MODULE_ID = { 0xc4e3acb8, 0x8ccd, 0x45c5, { 0xbd, 0x20, 0x76, 0xe6, 0xf6, 0x2e, 0x38, 0x4e } }; \ No newline at end of file diff --git a/Designer/UI/SolidDesignerUI/SolidDesignerUI.h b/Designer/UI/SolidDesignerUI/SolidDesignerUI.h deleted file mode 100644 index 60f06d24..00000000 --- a/Designer/UI/SolidDesignerUI/SolidDesignerUI.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once -// 此头文件包含DLL导出的宏 -#include "AliceMacroDefinitions.h" -#include - -#if defined(_WIN32) -#ifdef ALICE_UI_ROBOT_HOME -#define ALICE_UI_ROBOT_EXPORT DLL_EXPORT -#else -#define ALICE_UI_ROBOT_EXPORT DLL_IMPORT -#endif -#else -#define ALICE_UI_ROBOT_EXPORT __attribute__((visibility("default"))) -#endif - -namespace -{ - void InitTest() - { - int i = 0; - std::cout << "Here is init test..." << std::endl; - } - - void UnInitTest() - { - int i = 0; - std::cout << "Here is uninit test..." << std::endl; - } -} - - -extern "C" void InitializePlugin() -{ - InitTest(); -} - - -extern "C" void UnInitializePlugin() -{ - UnInitTest(); -} - - - From 47612e212b1677ed1c7c9e4fd35af43f7935128c Mon Sep 17 00:00:00 2001 From: Hubery Hsu Date: Sat, 24 Jan 2026 18:35:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E3=80=90AL-75=E3=80=91fix=20build=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Alice | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Alice b/Alice index c84c5f8b..ae466237 160000 --- a/Alice +++ b/Alice @@ -1 +1 @@ -Subproject commit c84c5f8b54d43a75b68a8979edb52b19b7000b41 +Subproject commit ae4662379017a6e77b9bcf99561319c84d54cb91 From b3c900322b1c959d84253bccc5dd20de0a13549b Mon Sep 17 00:00:00 2001 From: Hubery Hsu Date: Sat, 24 Jan 2026 18:36:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E3=80=90AL-75=E3=80=91modify=20the=20licen?= =?UTF-8?q?se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 151 ++++++++++++++++++++++++++------------------------------ 1 file changed, 69 insertions(+), 82 deletions(-) diff --git a/LICENSE b/LICENSE index f288702d..29ebfa54 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -7,17 +7,15 @@ Preamble - The GNU General Public License is a free, copyleft license for -software and other kinds of works. + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to +our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. +software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you @@ -26,44 +24,34 @@ them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. The precise terms and conditions for copying, distribution and modification follow. @@ -72,7 +60,7 @@ modification follow. 0. Definitions. - "This License" refers to version 3 of the GNU General Public License. + "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. @@ -549,35 +537,45 @@ to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. - 13. Use with the GNU Affero General Public License. + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single +under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General +Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published +GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's +versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. @@ -635,40 +633,29 @@ the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 + it under the terms of the GNU Affero 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. + GNU Affero General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. +For more information on this, and how to apply and follow the GNU AGPL, see +. \ No newline at end of file