diff --git a/cMake/FreeCAD_Helpers/PrintFinalReport.cmake b/cMake/FreeCAD_Helpers/PrintFinalReport.cmake index eba9667db2..afcd851093 100644 --- a/cMake/FreeCAD_Helpers/PrintFinalReport.cmake +++ b/cMake/FreeCAD_Helpers/PrintFinalReport.cmake @@ -95,7 +95,7 @@ macro(PrintFinalReport) value(BUILD_DRAFT) value(BUILD_DRAWING) value(BUILD_FEM) - value(BUILD_WEB) + value(BUILD_GUI) value(BUILD_HELP) value(BUILD_IDF) value(BUILD_IMPORT) diff --git a/src/Gui/PreferencePackTemplates/CMakeLists.txt b/src/Gui/PreferencePackTemplates/CMakeLists.txt index 4587157b44..36adfc3a90 100644 --- a/src/Gui/PreferencePackTemplates/CMakeLists.txt +++ b/src/Gui/PreferencePackTemplates/CMakeLists.txt @@ -10,7 +10,6 @@ SET(PreferencePackTemplates_Files Path_Colors.cfg Shortcuts.cfg Sketcher_Colors.cfg - Start_Colors.cfg TechDraw_Colors.cfg View.cfg Window_Colors.cfg diff --git a/src/Gui/PreferencePackTemplates/Start_Colors.cfg b/src/Gui/PreferencePackTemplates/Start_Colors.cfg deleted file mode 100644 index ffd944526e..0000000000 --- a/src/Gui/PreferencePackTemplates/Start_Colors.cfg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/src/Gui/PreferencePacks/Classic/Classic.cfg b/src/Gui/PreferencePacks/Classic/Classic.cfg index b82ee1df5c..a1ed256bc8 100644 --- a/src/Gui/PreferencePacks/Classic/Classic.cfg +++ b/src/Gui/PreferencePacks/Classic/Classic.cfg @@ -35,15 +35,6 @@ - - - - - - - - - #feff9e #000000 diff --git a/src/Gui/PreferencePacks/Dark behave/Dark behave.cfg b/src/Gui/PreferencePacks/Dark behave/Dark behave.cfg index 4ca9d073c3..712f2ea4b7 100644 --- a/src/Gui/PreferencePacks/Dark behave/Dark behave.cfg +++ b/src/Gui/PreferencePacks/Dark behave/Dark behave.cfg @@ -23,15 +23,6 @@ #9b4de6 - - - - - - - - - diff --git a/src/Gui/PreferencePacks/Dark contrast/Dark contrast.cfg b/src/Gui/PreferencePacks/Dark contrast/Dark contrast.cfg index 4784a14028..a2d1a2e130 100644 --- a/src/Gui/PreferencePacks/Dark contrast/Dark contrast.cfg +++ b/src/Gui/PreferencePacks/Dark contrast/Dark contrast.cfg @@ -23,15 +23,6 @@ #9b4de6 - - - - - - - - - diff --git a/src/Gui/PreferencePacks/Dark modern/Dark modern.cfg b/src/Gui/PreferencePacks/Dark modern/Dark modern.cfg index c8db913ab8..1d87608220 100644 --- a/src/Gui/PreferencePacks/Dark modern/Dark modern.cfg +++ b/src/Gui/PreferencePacks/Dark modern/Dark modern.cfg @@ -23,15 +23,6 @@ #9b4de6 - - - - - - - - - diff --git a/src/Gui/PreferencePacks/Dark/Dark.cfg b/src/Gui/PreferencePacks/Dark/Dark.cfg index 3688db43ec..5acf039b29 100644 --- a/src/Gui/PreferencePacks/Dark/Dark.cfg +++ b/src/Gui/PreferencePacks/Dark/Dark.cfg @@ -23,15 +23,6 @@ #9b4de6 - - - - - - - - - diff --git a/src/Gui/PreferencePacks/Darker/Darker.cfg b/src/Gui/PreferencePacks/Darker/Darker.cfg index c3cffa9768..f2ab0a5a50 100644 --- a/src/Gui/PreferencePacks/Darker/Darker.cfg +++ b/src/Gui/PreferencePacks/Darker/Darker.cfg @@ -23,15 +23,6 @@ #9b4de6 - - - - - - - - - diff --git a/src/Gui/PreferencePacks/Light modern/Light modern.cfg b/src/Gui/PreferencePacks/Light modern/Light modern.cfg index 27592cab09..9c9bb37f39 100644 --- a/src/Gui/PreferencePacks/Light modern/Light modern.cfg +++ b/src/Gui/PreferencePacks/Light modern/Light modern.cfg @@ -4,15 +4,6 @@ - - - - - - - - - #feff9e diff --git a/src/Gui/PreferencePacks/Light/Light.cfg b/src/Gui/PreferencePacks/Light/Light.cfg index b18a0c1b0c..f2e2a589e7 100644 --- a/src/Gui/PreferencePacks/Light/Light.cfg +++ b/src/Gui/PreferencePacks/Light/Light.cfg @@ -4,15 +4,6 @@ - - - - - - - - - #feff9e diff --git a/src/Gui/PreferencePacks/ProDark/ProDark.cfg b/src/Gui/PreferencePacks/ProDark/ProDark.cfg index 301cc394e4..783cfe8cdc 100644 --- a/src/Gui/PreferencePacks/ProDark/ProDark.cfg +++ b/src/Gui/PreferencePacks/ProDark/ProDark.cfg @@ -23,15 +23,6 @@ #9b4de6 - - - - - - - - - diff --git a/src/Mod/Start/App/AppStart.cpp b/src/Mod/Start/App/AppStart.cpp index d13057d2ee..95011f1a9a 100644 --- a/src/Mod/Start/App/AppStart.cpp +++ b/src/Mod/Start/App/AppStart.cpp @@ -1,7 +1,7 @@ // SPDX-License-Identifier: LGPL-2.1-or-later /**************************************************************************** * * -# Copyright (c) 2024 The FreeCAD Project Association AISBL * + * Copyright (c) 2024 The FreeCAD Project Association AISBL * * * * This file is part of FreeCAD. * * * diff --git a/src/Mod/Start/Gui/AppStartGui.cpp b/src/Mod/Start/Gui/AppStartGui.cpp index 8e1f2dc5f1..e181b31894 100644 --- a/src/Mod/Start/Gui/AppStartGui.cpp +++ b/src/Mod/Start/Gui/AppStartGui.cpp @@ -32,7 +32,7 @@ #include <3rdParty/GSL/include/gsl/pointers> -#include "Workbench.h" +#include "Manipulator.h" void loadStartResource() { @@ -73,7 +73,8 @@ PyMOD_INIT_FUNC(StartGui) { Base::Console().Log("Loading GUI of Start module... "); PyObject* mod = StartGui::initModule(); - StartGui::Workbench::init(); + auto manipulator = std::make_shared(); + Gui::WorkbenchManipulator::installManipulator(manipulator); loadStartResource(); Base::Console().Log("done\n"); diff --git a/src/Mod/Start/Gui/CMakeLists.txt b/src/Mod/Start/Gui/CMakeLists.txt index 4eaedd1fd9..d16b95623e 100644 --- a/src/Mod/Start/Gui/CMakeLists.txt +++ b/src/Mod/Start/Gui/CMakeLists.txt @@ -23,17 +23,14 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} - ${PYTHON_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} - ${ZLIB_INCLUDE_DIR} - ${XercesC_INCLUDE_DIRS} + ${PYTHON_INCLUDE_DIRS} ${QtCore_INCLUDE_DIRS} - ${QtWidgets_INCLUDE_DIRS} ${QtSvg_INCLUDE_DIRS} - #${QtNetwork_INCLUDE_DIRS} ${QtUiTools_INCLUDE_DIRS} - #${QtQuick_INCLUDE_DIRS} - #${QtQuickWidgets_INCLUDE_DIRS} + ${QtWidgets_INCLUDE_DIRS} + ${XercesC_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIR} ) set(StartGui_LIBS @@ -52,17 +49,16 @@ SET(StartGui_SRCS ${Start_QRC_SRCS} ${StartGui_UIC_SRCS} AppStartGui.cpp - Command.cpp - PreCompiled.cpp - PreCompiled.h - StartView.cpp - StartView.h FileCardDelegate.cpp FileCardDelegate.h FileCardView.cpp FileCardView.h - Workbench.cpp - Workbench.h + Manipulator.cpp + Manipulator.h + PreCompiled.cpp + PreCompiled.h + StartView.cpp + StartView.h ) SET(StartGuiIcon_SVG diff --git a/src/Mod/Start/Gui/Command.cpp b/src/Mod/Start/Gui/Manipulator.cpp similarity index 70% rename from src/Mod/Start/Gui/Command.cpp rename to src/Mod/Start/Gui/Manipulator.cpp index 160c2759f9..e9338dad05 100644 --- a/src/Mod/Start/Gui/Command.cpp +++ b/src/Mod/Start/Gui/Manipulator.cpp @@ -22,17 +22,22 @@ ***************************************************************************/ #include "PreCompiled.h" +#ifndef _PreComp_ +#include +#include +#include +#endif + +#include "Manipulator.h" +#include "StartView.h" #include #include +#include +#include #include <3rdParty/GSL/include/gsl/pointers> -#include "Workbench.h" - - -using namespace std; - DEF_STD_CMD(CmdStart) CmdStart::CmdStart() @@ -50,13 +55,24 @@ CmdStart::CmdStart() void CmdStart::activated(int iMsg) { Q_UNUSED(iMsg); - StartGui::Workbench::loadStart(); + auto mw = Gui::getMainWindow(); + auto doc = Gui::Application::Instance->activeDocument(); + auto existingView = mw->findChild(QLatin1String("StartView")); + if (!existingView) { + existingView = gsl::owner(new StartGui::StartView(doc, mw)); + mw->addWindow(existingView); // Transfers ownership + } + Gui::getMainWindow()->setActiveWindow(existingView); + existingView->show(); } - -void CreateStartCommands() +void StartGui::Manipulator::modifyMenuBar(Gui::MenuItem* menuBar) { Gui::CommandManager& rcCmdMgr = Gui::Application::Instance->commandManager(); auto newCommand = gsl::owner(new CmdStart); rcCmdMgr.addCommand(newCommand); // Transfer ownership + Gui::MenuItem* helpMenu = menuBar->findItem("&Help"); + Gui::MenuItem* loadStart = new Gui::MenuItem(); + loadStart->setCommand("Start_Start"); + helpMenu->appendItem(loadStart); } diff --git a/src/Mod/Start/Gui/Workbench.h b/src/Mod/Start/Gui/Manipulator.h similarity index 64% rename from src/Mod/Start/Gui/Workbench.h rename to src/Mod/Start/Gui/Manipulator.h index 5cb962bcfc..a2e08e9a98 100644 --- a/src/Mod/Start/Gui/Workbench.h +++ b/src/Mod/Start/Gui/Manipulator.h @@ -21,44 +21,23 @@ * * ***************************************************************************/ +#ifndef FREECAD_MANIPULATOR_H +#define FREECAD_MANIPULATOR_H -#ifndef LAUNCHERGUI_WORKBENCH_H -#define LAUNCHERGUI_WORKBENCH_H - -#include -#include - -namespace Gui -{ -class MDIView; -} +#include namespace StartGui { -class Workbench: public Gui::StdWorkbench +class Manipulator: public Gui::WorkbenchManipulator { - TYPESYSTEM_HEADER_WITH_OVERRIDE(); // NOLINT - -public: - Workbench() = default; - - /** Run some actions when the workbench gets activated. */ - void activated() override; - - static void loadStart(); - protected: - /** Defines the standard menus. */ - Gui::MenuItem* setupMenuBar() const override; - /** Defines the standard toolbars. */ - Gui::ToolBarItem* setupToolBars() const override; - /** Defines the standard command bars. */ - Gui::ToolBarItem* setupCommandBars() const override; - /** Returns a DockWindowItems structure of dock windows this workbench. */ - Gui::DockWindowItems* setupDockWindows() const override; - -}; // class Workbench + /*! + * This manipulator injects the command to load the start page into the Help menu. + */ + void modifyMenuBar(Gui::MenuItem* menuBar) override; +}; } // namespace StartGui -#endif // LAUNCHERGUI_WORKBENCH_H + +#endif // FREECAD_MANIPULATOR_H diff --git a/src/Mod/Start/Gui/Workbench.cpp b/src/Mod/Start/Gui/Workbench.cpp deleted file mode 100644 index 5c82c8ca2d..0000000000 --- a/src/Mod/Start/Gui/Workbench.cpp +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-License-Identifier: LGPL-2.1-or-later -/**************************************************************************** - * * - * Copyright (c) 2024 The FreeCAD Project Association AISBL * - * * - * This file is part of FreeCAD. * - * * - * FreeCAD is free software: you can redistribute it and/or modify it * - * under the terms of the GNU Lesser General Public License as * - * published by the Free Software Foundation, either version 2.1 of the * - * License, or (at your option) any later version. * - * * - * FreeCAD 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 * - * Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public * - * License along with FreeCAD. If not, see * - * . * - * * - ***************************************************************************/ - -#include "PreCompiled.h" -#ifndef _PreComp_ -#include -#include -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include "Workbench.h" -#include "StartView.h" - -#include <3rdParty/GSL/include/gsl/pointers> - -using namespace StartGui; - -TYPESYSTEM_SOURCE(StartGui::Workbench, Gui::StdWorkbench) // NOLINT - -void StartGui::Workbench::activated() -{ - loadStart(); -} - -void StartGui::Workbench::loadStart() -{ - auto mw = Gui::getMainWindow(); - auto doc = Gui::Application::Instance->activeDocument(); - auto existingView = mw->findChild(QLatin1String("StartView")); - if (!existingView) { - existingView = gsl::owner(new StartView(doc, mw)); - mw->addWindow(existingView); // Transfers ownership - } - Gui::getMainWindow()->setActiveWindow(existingView); - existingView->show(); -} - -Gui::MenuItem* StartGui::Workbench::setupMenuBar() const -{ - return Gui::StdWorkbench::setupMenuBar(); -} - -Gui::ToolBarItem* StartGui::Workbench::setupToolBars() const -{ - return Gui::StdWorkbench::setupToolBars(); -} - -Gui::ToolBarItem* StartGui::Workbench::setupCommandBars() const -{ - return Gui::StdWorkbench::setupCommandBars(); -} - -Gui::DockWindowItems* StartGui::Workbench::setupDockWindows() const -{ - Gui::DockWindowItems* root = Gui::StdWorkbench::setupDockWindows(); - root->setVisibility(false); // hide all dock windows by default - root->setVisibility("Std_ComboView", true); // except of the combo view - root->setVisibility("Std_TaskView", true); // and the task view - return root; -} diff --git a/src/Mod/Start/InitGui.py b/src/Mod/Start/InitGui.py index de943dfd26..1adc03552f 100644 --- a/src/Mod/Start/InitGui.py +++ b/src/Mod/Start/InitGui.py @@ -21,31 +21,4 @@ # * # **************************************************************************/ - -class StartWorkbench(Workbench): - "StartWorkbench workbench" - - def __init__(self): - self.__class__.Icon = ( - FreeCAD.getResourceDir() + "Mod/Start/Resources/icons/StartWorkbench.svg" - ) - self.__class__.MenuText = "Start" - self.__class__.ToolTip = "Start workbench" - - def Initialize(self): - import StartGui - - def Activated(self): - pass - - def Deactivated(self): - pass - - def ContextMenu(self, recipient): - pass - - def GetClassName(self): - return "StartGui::Workbench" - - -Gui.addWorkbench(StartWorkbench()) +import StartGui