Skip to content

Commit

Permalink
Web: Remove GUI
Browse files Browse the repository at this point in the history
Web no longer provides a user-visible browser, but only a simple server for remote interaction with FreeCAD. Dependency on QtWebWengine has been removed.
  • Loading branch information
chennes committed Apr 22, 2024
1 parent bbf9192 commit c35693f
Show file tree
Hide file tree
Showing 94 changed files with 14 additions and 19,528 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/sub_buildUbuntu2004.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,9 @@ jobs:
python3-pyside2.qtgui \
python3-pyside2.qtnetwork \
python3-pyside2.qtsvg \
python3-pyside2.qtwebchannel \
python3-pyside2.qtwebengine \
python3-pyside2.qtwebenginecore \
python3-pyside2.qtwebenginewidgets \
python3-pyside2.qtwidgets \
qtbase5-dev \
qttools5-dev \
qtwebengine5-dev \
shiboken2 \
swig \
xvfb
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/sub_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -466,14 +466,9 @@ jobs:
python3-pyside2.qtgui \
python3-pyside2.qtnetwork \
python3-pyside2.qtsvg \
python3-pyside2.qtwebengine \
python3-pyside2.qtwebenginecore \
python3-pyside2.qtwebenginewidgets \
python3-pyside2.qtwebchannel \
python3-pyside2.qtwidgets \
qtbase5-dev \
qttools5-dev \
qtwebengine5-dev \
shiboken2 \
swig \
ccache \
Expand Down
7 changes: 0 additions & 7 deletions cMake/FreeCAD_Helpers/CopyLibpackDirectories.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ macro(CopyLibpackDirectories)
message(STATUS "=======================================\n"
"Copying libpack dependency directories to build directory for Windows MSVC build.\n")
file(COPY ${FREECAD_LIBPACK_DIR}/bin/assistant.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcess.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcessd.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/bin/qt.conf DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_BINARY_DIR}/bin)
Expand All @@ -14,7 +12,6 @@ macro(CopyLibpackDirectories)
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/printsupport DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_BINARY_DIR})
file(COPY ${FREECAD_LIBPACK_DIR}/translations/qtwebengine_locales DESTINATION ${CMAKE_BINARY_DIR}/translations)
message(STATUS "... end copying.\n=======================================\n")
endif()

Expand All @@ -31,9 +28,6 @@ macro(CopyLibpackDirectories)
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/imageformats DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/platforms DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcess.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/bin/QtWebEngineProcessd.exe DESTINATION ${CMAKE_BINARY_DIR}/bin)
file(COPY ${FREECAD_LIBPACK_DIR}/translations/qtwebengine_locales DESTINATION ${CMAKE_BINARY_DIR}/translations)
file(COPY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_BINARY_DIR})
file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf "[Paths]\nPrefix=..\n")
endif()
Expand All @@ -48,7 +42,6 @@ macro(CopyLibpackDirectories)
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/sqldrivers DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/styles DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/plugins/printsupport DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/translations/qtwebengine_locales DESTINATION ${CMAKE_INSTALL_PREFIX}/translations)
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/resources DESTINATION ${CMAKE_INSTALL_PREFIX})
install(DIRECTORY ${FREECAD_LIBPACK_DIR}/bin DESTINATION ${CMAKE_INSTALL_PREFIX})
message(STATUS "Created install commands for INSTALL target.\n")
Expand Down
1 change: 0 additions & 1 deletion cMake/FreeCAD_Helpers/PrintFinalReport.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ macro(PrintFinalReport)
simple(QtXml ${QtXml_VERSION})
conditional(QtTest ENABLE_DEVELOPER_TESTS "not needed" ${QtTest_VERSION})
if (BUILD_GUI)
conditional(QtWebEngineWidgets BUILD_WEB "not needed (BUILD_WEB is OFF)" ${QtWebEngineWidgets_VERSION})
conditional(DesignerPlugin BUILD_DESIGNER_PLUGIN
"not built (BUILD_DESIGNER_PLUGIN is OFF)"
"[${DESIGNER_PLUGIN_LOCATION}/${libFreeCAD_widgets}]"
Expand Down
6 changes: 0 additions & 6 deletions cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,6 @@ macro(SetupShibokenAndPyside)
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtSvg.py "from PySide${PYSIDE_MAJOR_VERSION}.QtSvg import *\n")
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtUiTools.py "from PySide${PYSIDE_MAJOR_VERSION}.QtUiTools import *\n")
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWidgets import *\n")
if(PYSIDE_MAJOR_VERSION LESS 6)
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWebEngineWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineWidgets import *\n")
else()
file(WRITE ${CMAKE_BINARY_DIR}/Ext/PySide/QtWebEngineWidgets.py "from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineWidgets import *\n"
"from PySide${PYSIDE_MAJOR_VERSION}.QtWebEngineCore import QWebEnginePage\n")
endif()
endif()

if(APPLE AND NOT BUILD_WITH_CONDA)
Expand Down
4 changes: 1 addition & 3 deletions package/fedora/freecad.spec
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ BuildRequires: boost-devel
BuildRequires: boost-python3-devel
BuildRequires: eigen3-devel
# Qt5 dependencies
BuildRequires: qt5-qtwebengine-devel
#BuildRequires: qt5-qtwebkit-devel
BuildRequires: qt5-qtsvg-devel
\BuildRequires: qt5-qtsvg-devel
BuildRequires: qt5-qttools-static

BuildRequires: fmt-devel
Expand Down
4 changes: 0 additions & 4 deletions src/Gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,6 @@ else(MSVC)
)
endif(MSVC)

if (QtWebEngineWidgets_FOUND AND BUILD_WITH_CONDA)
add_definitions(-DQTWEBENGINE)
endif()

include_directories(
${QtCore_INCLUDE_DIRS}
${QtWidgets_INCLUDE_DIRS}
Expand Down
Binary file removed src/Gui/Language/qtwebengine_ca.qm
Binary file not shown.
Binary file removed src/Gui/Language/qtwebengine_de.qm
Binary file not shown.
Binary file removed src/Gui/Language/qtwebengine_es.qm
Binary file not shown.
Binary file removed src/Gui/Language/qtwebengine_ko.qm
Binary file not shown.
Binary file removed src/Gui/Language/qtwebengine_pl.qm
Binary file not shown.
Binary file removed src/Gui/Language/qtwebengine_ru.qm
Binary file not shown.
Binary file removed src/Gui/Language/qtwebengine_uk.qm
Binary file not shown.
Binary file removed src/Gui/Language/qtwebengine_zh_CN.qm
Binary file not shown.
8 changes: 0 additions & 8 deletions src/Gui/Language/translation.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,5 @@
<file>qtmultimedia_uk.qm</file>
<file>qtmultimedia_zh_CN.qm</file>
<file>qtmultimedia_zh_TW.qm</file>
<file>qtwebengine_ca.qm</file>
<file>qtwebengine_de.qm</file>
<file>qtwebengine_es.qm</file>
<file>qtwebengine_ko.qm</file>
<file>qtwebengine_pl.qm</file>
<file>qtwebengine_ru.qm</file>
<file>qtwebengine_uk.qm</file>
<file>qtwebengine_zh_CN.qm</file>
</qresource>
</RCC>
33 changes: 3 additions & 30 deletions src/Gui/Workbench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -951,44 +951,17 @@ void NoneWorkbench::setupContextMenu(const char* recipient,MenuItem* item) const
{
Q_UNUSED(recipient);
Q_UNUSED(item);
StdWorkbench::setupContextMenu(recipient, item);
}

MenuItem* NoneWorkbench::setupMenuBar() const
{
// Setup the default menu bar
auto menuBar = new MenuItem;

// File
auto file = new MenuItem( menuBar );
file->setCommand("&File");
*file << "Std_Quit";

// Edit
auto edit = new MenuItem( menuBar );
edit->setCommand("&Edit");
*edit << "Std_DlgPreferences";

// View
auto view = new MenuItem( menuBar );
view->setCommand("&View");
*view << "Std_Workbench";

// Separator
auto sep = new MenuItem( menuBar );
sep->setCommand("Separator");

// Help
auto help = new MenuItem( menuBar );
help->setCommand("&Help");
*help << "Std_OnlineHelp" << "Std_About";

return menuBar;
return StdWorkbench::setupMenuBar();
}

ToolBarItem* NoneWorkbench::setupToolBars() const
{
auto root = new ToolBarItem;
return root;
return StdWorkbench::setupToolBars();
}

ToolBarItem* NoneWorkbench::setupCommandBars() const
Expand Down
26 changes: 0 additions & 26 deletions src/MacAppBundle/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,32 +88,6 @@ set(XCTEST_PATH "${XCODE_PATH}/Platforms/MacOSX.platform/Developer/Library/Frame
# add qt assistant to bundle
install(PROGRAMS "${Qt5Core_DIR}/../../../libexec/Assistant.app/Contents/MacOS/Assistant" DESTINATION ${CMAKE_INSTALL_PREFIX}/MacOS)

# add QtWebEngineProcess to bundle
if(BUILD_WEB)
install(PROGRAMS "${Qt5Core_DIR}/../../../lib/QtWebEngineCore.framework/Versions/5/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess" DESTINATION ${CMAKE_INSTALL_PREFIX}/MacOS)

# add locales to bundle
file(GLOB _locales_files RELATIVE "${Qt5Core_DIR}/../../../lib/QtWebEngineCore.framework/Versions/5/Resources/qtwebengine_locales" "${Qt5Core_DIR}/../../../lib/QtWebEngineCore.framework/Versions/5/Resources/qtwebengine_locales/*")
foreach(_locales_file ${_locales_files})
get_filename_component(_resolved_file "${Qt5Core_DIR}/../../../lib/QtWebEngineCore.framework/Versions/5/Resources/qtwebengine_locales/${_locales_file}" REALPATH)
list(APPEND _locales_resolved_files ${_resolved_file})
endforeach()
install(FILES ${_locales_resolved_files} DESTINATION "${CMAKE_INSTALL_PREFIX}/MacOS/qtwebengine_locales")

# add pak
file(GLOB _pak_files RELATIVE "${Qt5Core_DIR}/../../../lib/QtWebEngineCore.framework/Versions/5/Resources/" "${Qt5Core_DIR}/../../../lib/QtWebEngineCore.framework/Versions/5/Resources/*.pak")
foreach(_pak_file ${_pak_files})
get_filename_component(_pak_resolved_file "${Qt5Core_DIR}/../../../lib/QtWebEngineCore.framework/Versions/5/Resources/${_pak_file}" REALPATH)
list(APPEND _pak_resolved_files ${_pak_resolved_file})
endforeach()
install(FILES ${_pak_resolved_files} DESTINATION "${CMAKE_INSTALL_PREFIX}/")

# add icudtl.dat

install(PROGRAMS "${Qt5Core_DIR}/../../../lib/QtWebEngineCore.framework/Versions/5/Resources/icudtl.dat" DESTINATION ${CMAKE_INSTALL_PREFIX}/)
install(PROGRAMS "${Qt5Core_DIR}/../../../lib/QtWebEngineCore.framework/Versions/5/Resources/QtWebEngineCore.prl" DESTINATION ${CMAKE_INSTALL_PREFIX}/)
endif(BUILD_WEB)


# Ensure the actual plugin files are installed instead of symlinks.
file(GLOB _subdirs RELATIVE "${QT_PLUGINS_DIR}" "${QT_PLUGINS_DIR}/*")
Expand Down
9 changes: 4 additions & 5 deletions src/Mod/Help/Help.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
)
LOGTXT = translate(
"Help",
"PySide QtWebEngineWidgets module is not available. Help rendering is done with the Web module",
"PySide QtWebEngineWidgets module is not available. Help rendering is done with the system browser",
)
CONVERTTXT = translate(
"Help",
Expand Down Expand Up @@ -244,14 +244,13 @@ def show_tab(html, baseurl, title, view=None):

def get_qtwebwidgets(html, baseurl, title):
"""opens a web module view if qtwebwidgets module is not available, and returns False"""
from PySide import QtGui

try:
from PySide import QtGui, QtWebEngineWidgets
from PySide import QtWebEngineWidgets
except:
FreeCAD.Console.PrintLog(LOGTXT + "\n")
import WebGui

WebGui.openBrowserHTML(html, baseurl, title, ICON)
QtGui.QDesktopServices.openUrl(baseurl)
return False
else:
return True
Expand Down
6 changes: 5 additions & 1 deletion src/Mod/Test/Workbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ def testActivate(self):
print("Activate workbench '{}'".format(i))
cobj = CallableCheckWarning()
QtCore.QTimer.singleShot(500, cobj)
success = FreeCADGui.activateWorkbench(i)
if FreeCADGui.activeWorkbench().name() != i:
success = FreeCADGui.activateWorkbench(i)
else:
# Cannot test activation of an already-active workbench
success = True
FreeCAD.Console.PrintLog(
"Active: " + FreeCADGui.activeWorkbench().name() + " Expected: " + i + "\n"
)
Expand Down
9 changes: 0 additions & 9 deletions src/Mod/Web/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@

add_subdirectory(App)

set(Web_Scripts
Init.py
TestWebGui.py
)

if(BUILD_GUI)
if(QtWebEngineWidgets_FOUND)
add_subdirectory(Gui)
list (APPEND Web_Scripts InitGui.py)
endif()
endif(BUILD_GUI)

add_custom_target(WebScripts ALL
SOURCES ${Web_Scripts}
)
Expand Down
Loading

0 comments on commit c35693f

Please sign in to comment.