extra/freecad to 1.0rc1-1

This commit is contained in:
Kevin Mihelich 2024-09-12 17:56:20 +00:00
parent a47d2c18ce
commit ba3b5c14d3
8 changed files with 14 additions and 908 deletions

View file

@ -1,7 +1,7 @@
pkgbase = freecad
pkgdesc = Feature based parametric 3D CAD modeler
pkgver = 0.21.2
pkgrel = 25
pkgver = 1.0rc1
pkgrel = 1
url = https://freecadweb.org/
arch = x86_64
license = LGPL
@ -23,6 +23,8 @@ pkgbase = freecad
makedepends = shiboken6
makedepends = swig
makedepends = utf8cpp
makedepends = dos2unix
makedepends = microsoft-gsl
depends = asciidoctor
depends = boost-libs
depends = coin
@ -37,6 +39,7 @@ pkgbase = freecad
depends = pugixml
depends = pyside6
depends = python-gitpython
depends = yaml-cpp
depends = python-markdown
depends = python-matplotlib
depends = python-pip
@ -51,27 +54,7 @@ pkgbase = freecad
optdepends = graphviz: dependency graph support
optdepends = openscad: OpenSCAD support
options = !lto
source = git+https://github.com/freecad/freecad#tag=0.21.2
source = freecad-vtk9.3.patch
source = pyside6.patch
source = 62c3836c.patch
source = https://github.com/FreeCAD/FreeCAD/commit/6043c904.patch
source = https://github.com/FreeCAD/FreeCAD/commit/ac9a88c2.patch
source = https://github.com/FreeCAD/FreeCAD/commit/ccaee189.patch
source = https://github.com/FreeCAD/FreeCAD/commit/72fc04bf.patch
source = desktop-icon-under-wayland.patch
source = fixups-with-qt6-enums.patch
source = boost-1.86.patch
b2sums = SKIP
b2sums = f0b5a4648eb4befabb2339bae4e42044e436aa50ad1c2a25b243c965272a217b2c1c69c34d0d20bd01c573008de10f733b74857ffecac502b8558a7095e305e5
b2sums = eceb2d1b580fafaeec35de31fb3f4ec947ad32afe96734aa86d338364c97bbe5218506627957063c35ea2f360b7f7f916c9b7a1c0ef674c35d1f7972c070210e
b2sums = eb474708c3611293cfe3dfc287418b606f7735f6eb306f44f7394cd7e65256daddcee35984211982f25064e7ec81cc038d4eeb8d34af7399058ecfb6e8e99e9f
b2sums = de4b98c4b488045f9810dce124c271d6f4f629922e026f2d4f1efd6c9060b92309db41f8e0f6ebe5e7a27399911ac908cc8935c2501214326dbb1c4b739d46cc
b2sums = 02284db1b17dc88d0522eb3a726076b9f1ded740fdab1a185e48534c3606c77e51a12690b02bf5e0d9d1f72d1d8389ba84a54cba274200e69b6b10a431bbfdfe
b2sums = 96eae9bf5af8c041876cf6afd09f2b0dbc12369469ceb6d5c4607fccee8914dfd9b3eef8291ccdc6aded0369a6bcf0fb159dbfb8172b0f7b95324c22310e21f5
b2sums = 96298a048569e6c4d5864504eeb908cdcbe1e22d7485969a7858bd08e66d1d9c050b5d4393e42801afdf3e31e48f56ec21bf1f1f2b1e19c02f54cc4d32d115f3
b2sums = 8af23999e48d3ac4c80a259e12ba9e25f750c3ee1da047131ddc60228ad9c73434405949acbee89e82981be55ebfac4aec8c7d00e421bbee864cde199a07267f
b2sums = 9cb72c3df3f1c8e49b4242b1e05f51c68e6df98891a0c485488433bb9eef1e814fe712761b62ef09cb37551643819a48cbf704df2121bf33401e410a05dce722
b2sums = 6aa942c0977d5e1eb0c30c7da892faabcdd0973519bdee59037eaf08db02126802cfe951b943ff04a7ba57ad082f6c3a71db6f2c879888056042adbcc6b89764
source = git+https://github.com/freecad/freecad#tag=1.0rc1
b2sums = cd2d1f7d2ecb49dbde30e3ef0480c383b21559667ec3855f94a0596cd6598dba3b7420f0b3f5a01389a6361ce57c6722352822f3ce1d14fef831b6b1096e9a1a
pkgname = freecad

View file

@ -1,83 +0,0 @@
From 62c3836c97a56db24e3ef567a31eba2d0893b945 Mon Sep 17 00:00:00 2001
From: Ladislav Michl <ladis@linux-mips.org>
Date: Tue, 23 Jan 2024 12:46:32 +0100
Subject: [PATCH] Addon Manager: Qt6 fixes
---
src/Mod/AddonManager/addonmanager_utilities.py | 4 ++--
src/Mod/AddonManager/change_branch.py | 2 +-
src/Mod/AddonManager/package_details.py | 7 +++----
src/Mod/AddonManager/package_list.py | 7 +++----
4 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/Mod/AddonManager/addonmanager_utilities.py b/src/Mod/AddonManager/addonmanager_utilities.py
index 9ceabc2e9add..183a2047b086 100644
--- a/src/Mod/AddonManager/addonmanager_utilities.py
+++ b/src/Mod/AddonManager/addonmanager_utilities.py
@@ -36,7 +36,7 @@
from urllib.parse import urlparse
try:
- from PySide import QtCore, QtWidgets
+ from PySide import QtCore, QtGui, QtWidgets
except ImportError:
QtCore = None
QtWidgets = None
@@ -245,7 +245,7 @@ def get_readme_html_url(repo):
def is_darkmode() -> bool:
"""Heuristics to determine if we are in a darkmode stylesheet"""
pl = fci.FreeCADGui.getMainWindow().palette()
- return pl.color(pl.Background).lightness() < 128
+ return pl.color(QtGui.QPalette.Window).lightness() < 128
def warning_color_string() -> str:
diff --git a/src/Mod/AddonManager/change_branch.py b/src/Mod/AddonManager/change_branch.py
index 332795a22afc..ebe1819bc755 100644
--- a/src/Mod/AddonManager/change_branch.py
+++ b/src/Mod/AddonManager/change_branch.py
@@ -216,7 +216,7 @@ def data(self, index: QtCore.QModelIndex, role: int = QtCore.Qt.DisplayRole):
dd = self.display_data[row]
if column == 3 or column == 4:
if dd[column] is not None:
- qdate = QtCore.QDateTime.fromTime_t(dd[column])
+ qdate = QtCore.QDateTime.fromSecsSinceEpoch(dd[column])
return QtCore.QLocale().toString(qdate, QtCore.QLocale.ShortFormat)
elif column < len(dd):
return dd[column]
diff --git a/src/Mod/AddonManager/package_details.py b/src/Mod/AddonManager/package_details.py
index 93dfb8bee962..8310b5e90343 100644
--- a/src/Mod/AddonManager/package_details.py
+++ b/src/Mod/AddonManager/package_details.py
@@ -133,10 +133,9 @@ def display_repo_status(self, status):
date = ""
installed_version_string = "<h3>"
if repo.updated_timestamp:
- date = (
- QtCore.QDateTime.fromTime_t(repo.updated_timestamp)
- .date()
- .toString(QtCore.Qt.SystemLocaleShortDate)
+ date = QtCore.QLocale().toString(
+ QtCore.QDateTime.fromSecsSinceEpoch(int(round(repo.updated_timestamp, 0))),
+ QtCore.QLocale.ShortFormat,
)
if version and date:
installed_version_string += (
diff --git a/src/Mod/AddonManager/package_list.py b/src/Mod/AddonManager/package_list.py
index a9dd3dc59856..d26b4f5489c3 100644
--- a/src/Mod/AddonManager/package_list.py
+++ b/src/Mod/AddonManager/package_list.py
@@ -465,10 +465,9 @@ def get_expanded_update_string(repo: Addon) -> str:
installed_date_string = (
"<br/>" + translate("AddonsInstaller", "Installed on") + ": "
)
- installed_date_string += (
- QtCore.QDateTime.fromTime_t(repo.updated_timestamp)
- .date()
- .toString(QtCore.Qt.SystemLocaleShortDate)
+ installed_date_string += QtCore.QLocale().toString(
+ QtCore.QDateTime.fromSecsSinceEpoch(int(round(repo.updated_timestamp, 0))),
+ QtCore.QLocale.ShortFormat,
)
available_version_string = ""

View file

@ -19,60 +19,28 @@ buildarch=8
highmem=1
pkgname=freecad
pkgver=0.21.2
pkgrel=25
pkgver=1.0rc1
pkgrel=1
pkgdesc='Feature based parametric 3D CAD modeler'
arch=(x86_64)
url='https://freecadweb.org/'
license=(LGPL)
depends=(asciidoctor boost-libs coin fmt glew jsoncpp libspnav med-openmpi
netcdf opencascade openmpi pugixml pyside6 python-gitpython
netcdf opencascade openmpi pugixml pyside6 python-gitpython yaml-cpp
python-markdown python-matplotlib python-pip python-pivy python-ply
python-yaml qt6-svg qt6-tools qt6-webengine verdict xerces-c)
makedepends=(boost cgns cmake eigen git libharu liblas ninja nlohmann-json
openvdb openvr pdal postgresql-libs python-mpi4py shiboken6
swig utf8cpp)
swig utf8cpp dos2unix microsoft-gsl)
optdepends=('graphviz: dependency graph support'
'openscad: OpenSCAD support')
options=(!lto)
source=("git+https://github.com/$pkgname/$pkgname#tag=$pkgver"
freecad-vtk9.3.patch
pyside6.patch
62c3836c.patch
https://github.com/FreeCAD/FreeCAD/commit/6043c904.patch
https://github.com/FreeCAD/FreeCAD/commit/ac9a88c2.patch
https://github.com/FreeCAD/FreeCAD/commit/ccaee189.patch
https://github.com/FreeCAD/FreeCAD/commit/72fc04bf.patch
desktop-icon-under-wayland.patch
fixups-with-qt6-enums.patch
boost-1.86.patch)
b2sums=('SKIP'
'f0b5a4648eb4befabb2339bae4e42044e436aa50ad1c2a25b243c965272a217b2c1c69c34d0d20bd01c573008de10f733b74857ffecac502b8558a7095e305e5'
'eceb2d1b580fafaeec35de31fb3f4ec947ad32afe96734aa86d338364c97bbe5218506627957063c35ea2f360b7f7f916c9b7a1c0ef674c35d1f7972c070210e'
'eb474708c3611293cfe3dfc287418b606f7735f6eb306f44f7394cd7e65256daddcee35984211982f25064e7ec81cc038d4eeb8d34af7399058ecfb6e8e99e9f'
'de4b98c4b488045f9810dce124c271d6f4f629922e026f2d4f1efd6c9060b92309db41f8e0f6ebe5e7a27399911ac908cc8935c2501214326dbb1c4b739d46cc'
'02284db1b17dc88d0522eb3a726076b9f1ded740fdab1a185e48534c3606c77e51a12690b02bf5e0d9d1f72d1d8389ba84a54cba274200e69b6b10a431bbfdfe'
'96eae9bf5af8c041876cf6afd09f2b0dbc12369469ceb6d5c4607fccee8914dfd9b3eef8291ccdc6aded0369a6bcf0fb159dbfb8172b0f7b95324c22310e21f5'
'96298a048569e6c4d5864504eeb908cdcbe1e22d7485969a7858bd08e66d1d9c050b5d4393e42801afdf3e31e48f56ec21bf1f1f2b1e19c02f54cc4d32d115f3'
'8af23999e48d3ac4c80a259e12ba9e25f750c3ee1da047131ddc60228ad9c73434405949acbee89e82981be55ebfac4aec8c7d00e421bbee864cde199a07267f'
'9cb72c3df3f1c8e49b4242b1e05f51c68e6df98891a0c485488433bb9eef1e814fe712761b62ef09cb37551643819a48cbf704df2121bf33401e410a05dce722'
'6aa942c0977d5e1eb0c30c7da892faabcdd0973519bdee59037eaf08db02126802cfe951b943ff04a7ba57ad082f6c3a71db6f2c879888056042adbcc6b89764')
source=("git+https://github.com/$pkgname/$pkgname#tag=$pkgver")
b2sums=('cd2d1f7d2ecb49dbde30e3ef0480c383b21559667ec3855f94a0596cd6598dba3b7420f0b3f5a01389a6361ce57c6722352822f3ce1d14fef831b6b1096e9a1a')
prepare() {
patch -d freecad -Np1 -i "$srcdir"/freecad-vtk9.3.patch
patch -d freecad -Np1 -i ../62c3836c.patch # Fix Qt6 issues in addons manager
patch -d freecad -Np1 -i ../pyside6.patch # Fix PySide 6 issues
patch -d freecad -Np1 -i ../ac9a88c2.patch # Fix more pyside6 issues
patch -d freecad -Np1 -i ../6043c904.patch # Fix build with Python 3.12
patch -d freecad -Np1 -i ../ccaee189.patch # Fix NaviCube drawing and interaction with Qt6
patch -d freecad -Np1 -i ../72fc04bf.patch # Fix Python import
patch -d freecad -Np1 -i ../desktop-icon-under-wayland.patch # Install desktop file and icon with the proper name
patch -d freecad -Np1 -i ../fixups-with-qt6-enums.patch # Discard int conversions in WBs Python sources
sed -e 's|Shiboken::Module::getTypes(requiredModule)|reinterpret_cast<PyTypeObject **>(Shiboken::Module::getTypes(requiredModule))|' \
-i freecad/src/Gui/PythonWrapper.cpp # Fix build with PySide 6.7
cd freecad
git cherry-pick -n f555a25f9e67e628e8075fc8599d7c11807eaddd # Fix build with boost 1.85
patch -p1 -i ../boost-1.86.patch
git submodule update --init --recursive
}
build() {

View file

@ -1,156 +0,0 @@
diff --git a/src/Mod/Part/App/Geometry.cpp b/src/Mod/Part/App/Geometry.cpp
index 50c02eafc3..18b6ba1f2e 100644
--- a/src/Mod/Part/App/Geometry.cpp
+++ b/src/Mod/Part/App/Geometry.cpp
@@ -385,14 +385,14 @@ void Geometry::deleteExtension(const std::string & name)
void Geometry::createNewTag()
{
// Initialize a random number generator, to avoid Valgrind false positives.
- static boost::mt19937 ran;
+ static std::mt19937 ran;
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
- static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
+ static boost::uuids::basic_random_generator<std::mt19937> gen(&ran);
tag = gen();
}
diff --git a/src/Mod/Sketcher/App/Constraint.cpp b/src/Mod/Sketcher/App/Constraint.cpp
index 9e4bfd9cd2..a18720169f 100644
--- a/src/Mod/Sketcher/App/Constraint.cpp
+++ b/src/Mod/Sketcher/App/Constraint.cpp
@@ -58,14 +58,14 @@ Constraint::Constraint()
isActive(true)
{
// Initialize a random number generator, to avoid Valgrind false positives.
- static boost::mt19937 ran;
+ static std::mt19937 ran;
static bool seeded = false;
if (!seeded) {
ran.seed(QDateTime::currentMSecsSinceEpoch() & 0xffffffff);
seeded = true;
}
- static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
+ static boost::uuids::basic_random_generator<std::mt19937> gen(&ran);
tag = gen();
}
diff --git a/src/Mod/TechDraw/App/CenterLine.cpp b/src/Mod/TechDraw/App/CenterLine.cpp
index c03fd66a11..540d6485f7 100644
--- a/src/Mod/TechDraw/App/CenterLine.cpp
+++ b/src/Mod/TechDraw/App/CenterLine.cpp
@@ -915,14 +915,14 @@ std::string CenterLine::getTagAsString() const
void CenterLine::createNewTag()
{
// Initialize a random number generator, to avoid Valgrind false positives.
- static boost::mt19937 ran;
+ static std::mt19937 ran;
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
- static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
+ static boost::uuids::basic_random_generator<std::mt19937> gen(&ran);
tag = gen();
diff --git a/src/Mod/TechDraw/App/Cosmetic.cpp b/src/Mod/TechDraw/App/Cosmetic.cpp
index f0ce813227..9167f17286 100644
--- a/src/Mod/TechDraw/App/Cosmetic.cpp
+++ b/src/Mod/TechDraw/App/Cosmetic.cpp
@@ -301,14 +301,14 @@ std::string CosmeticEdge::getTagAsString() const
void CosmeticEdge::createNewTag()
{
// Initialize a random number generator, to avoid Valgrind false positives.
- static boost::mt19937 ran;
+ static std::mt19937 ran;
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
- static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
+ static boost::uuids::basic_random_generator<std::mt19937> gen(&ran);
tag = gen();
}
@@ -454,14 +454,14 @@ std::string GeomFormat::getTagAsString() const
void GeomFormat::createNewTag()
{
// Initialize a random number generator, to avoid Valgrind false positives.
- static boost::mt19937 ran;
+ static std::mt19937 ran;
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
- static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
+ static boost::uuids::basic_random_generator<std::mt19937> gen(&ran);
tag = gen();
}
diff --git a/src/Mod/TechDraw/App/CosmeticVertex.cpp b/src/Mod/TechDraw/App/CosmeticVertex.cpp
index 7e02cc5518..281386597f 100644
--- a/src/Mod/TechDraw/App/CosmeticVertex.cpp
+++ b/src/Mod/TechDraw/App/CosmeticVertex.cpp
@@ -190,14 +190,14 @@ std::string CosmeticVertex::getTagAsString() const
void CosmeticVertex::createNewTag()
{
// Initialize a random number generator, to avoid Valgrind false positives.
- static boost::mt19937 ran;
+ static std::mt19937 ran;
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
- static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
+ static boost::uuids::basic_random_generator<std::mt19937> gen(&ran);
tag = gen();
}
diff --git a/src/Mod/TechDraw/App/Geometry.cpp b/src/Mod/TechDraw/App/Geometry.cpp
index 9786f2245d..12a78deb9d 100644
--- a/src/Mod/TechDraw/App/Geometry.cpp
+++ b/src/Mod/TechDraw/App/Geometry.cpp
@@ -1448,14 +1448,14 @@ void Vertex::Restore(Base::XMLReader &reader)
void Vertex::createNewTag()
{
// Initialize a random number generator, to avoid Valgrind false positives.
- static boost::mt19937 ran;
+ static std::mt19937 ran;
static bool seeded = false;
if (!seeded) {
ran.seed(static_cast<unsigned int>(std::time(nullptr)));
seeded = true;
}
- static boost::uuids::basic_random_generator<boost::mt19937> gen(&ran);
+ static boost::uuids::basic_random_generator<std::mt19937> gen(&ran);
tag = gen();
}
diff --git a/src/Gui/PreferencePackManager.cpp b/src/Gui/PreferencePackManager.cpp
index ed6f75d464..bce3887b44 100644
--- a/src/Gui/PreferencePackManager.cpp
+++ b/src/Gui/PreferencePackManager.cpp
@@ -221,7 +221,7 @@ void Gui::PreferencePackManager::importConfig(const std::string& packName,
auto savedPreferencePacksDirectory =
fs::path(App::Application::getUserAppDataDir()) / "SavedPreferencePacks";
auto cfgFilename = savedPreferencePacksDirectory / packName / (packName + ".cfg");
- fs::copy_file(path, cfgFilename, fs::copy_option::overwrite_if_exists);
+ fs::copy_file(path, cfgFilename, fs::copy_options::overwrite_existing);
rescan();
}

View file

@ -1,52 +0,0 @@
diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp
index dd032c367b..89e2d2e1a7 100644
--- a/src/Main/MainGui.cpp
+++ b/src/Main/MainGui.cpp
@@ -164,7 +164,7 @@ int main( int argc, char ** argv )
App::Application::Config()["SplashInfoColor" ] = "#8aadf4"; // light blue
App::Application::Config()["SplashInfoPosition" ] = "6,75";
- QGuiApplication::setDesktopFileName(QStringLiteral("org.freecad.FreeCAD.desktop"));
+ QGuiApplication::setDesktopFileName(QStringLiteral("org.freecad.FreeCAD"));
try {
// Init phase ===========================================================
diff --git a/src/XDGData/CMakeLists.txt b/src/XDGData/CMakeLists.txt
index 9c70207f59..8c4cb7c74e 100644
--- a/src/XDGData/CMakeLists.txt
+++ b/src/XDGData/CMakeLists.txt
@@ -25,12 +25,12 @@ install(
)
install(
- FILES org.freecadweb.FreeCAD.desktop
+ FILES org.freecad.FreeCAD.desktop
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
)
install(
- FILES org.freecadweb.FreeCAD.svg
+ FILES org.freecad.FreeCAD.svg
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps
)
diff --git a/src/XDGData/org.freecadweb.FreeCAD.desktop b/src/XDGData/org.freecad.FreeCAD.desktop
similarity index 97%
rename from src/XDGData/org.freecadweb.FreeCAD.desktop
rename to src/XDGData/org.freecad.FreeCAD.desktop
index df82a16063..1326f37ca7 100644
--- a/src/XDGData/org.freecadweb.FreeCAD.desktop
+++ b/src/XDGData/org.freecad.FreeCAD.desktop
@@ -17,7 +17,7 @@ GenericName[ru]=Система автоматизированного проек
Exec=FreeCAD %F
Terminal=false
Type=Application
-Icon=org.freecadweb.FreeCAD
+Icon=org.freecad.FreeCAD
Categories=Graphics;Science;Education;Engineering;
StartupNotify=true
MimeType=application/x-extension-fcstd;model/obj;model/iges;image/vnd.dwg;image/vnd.dxf;model/vnd.collada+xml;application/iges;model/iges;model/step;model/step+zip;model/stl;application/vnd.shp;model/vrml;
diff --git a/src/XDGData/org.freecadweb.FreeCAD.svg b/src/XDGData/org.freecad.FreeCAD.svg
similarity index 100%
rename from src/XDGData/org.freecadweb.FreeCAD.svg
rename to src/XDGData/org.freecad.FreeCAD.svg

View file

@ -1,445 +0,0 @@
diff --git a/src/Gui/PythonWrapper.cpp b/src/Gui/PythonWrapper.cpp
index 79bc20d47..0452966f7 100644
--- a/src/Gui/PythonWrapper.cpp
+++ b/src/Gui/PythonWrapper.cpp
@@ -550,6 +550,36 @@ QObject* PythonWrapper::toQObject(const Py::Object& pyobject)
return nullptr;
}
+qsizetype PythonWrapper::toEnum(PyObject* pyPtr)
+{
+#if defined (HAVE_SHIBOKEN) && defined(HAVE_PYSIDE)
+ return Shiboken::Enum::getValue(pyPtr);
+#else
+ return toEnum(Py::Object(pyPtr));
+#endif
+}
+
+qsizetype PythonWrapper::toEnum(const Py::Object& pyobject)
+{
+#if defined (HAVE_SHIBOKEN) && defined(HAVE_PYSIDE)
+ return toEnum(pyobject.ptr());
+#else
+ try {
+ Py::Int ret;
+ if (pyobject.hasAttr(std::string("value"))) {
+ ret = pyobject.getAttr(std::string("value"));
+ } else {
+ ret = Py::Int(pyobject);
+ }
+ return (qsizetype)ret;
+ }
+ catch (Py::Exception&) {
+ Base::PyException e; // extract the Python error text
+ e.ReportException();
+ }
+#endif
+}
+
QGraphicsItem* PythonWrapper::toQGraphicsItem(PyObject* pyPtr)
{
#if defined (HAVE_SHIBOKEN) && defined(HAVE_PYSIDE)
diff --git a/src/Gui/PythonWrapper.h b/src/Gui/PythonWrapper.h
index c31f30e47..eada6607f 100644
--- a/src/Gui/PythonWrapper.h
+++ b/src/Gui/PythonWrapper.h
@@ -52,6 +52,8 @@ public:
bool toCString(const Py::Object&, std::string&);
QObject* toQObject(const Py::Object&);
+ qsizetype toEnum(PyObject* pyPtr);
+ qsizetype toEnum(const Py::Object& pyobject);
QGraphicsItem* toQGraphicsItem(PyObject* ptr);
QGraphicsItem* toQGraphicsItem(const Py::Object& pyObject);
QGraphicsObject* toQGraphicsObject(PyObject* pyPtr);
diff --git a/src/Gui/TaskView/TaskDialogPython.cpp b/src/Gui/TaskView/TaskDialogPython.cpp
index 795b7cf43..52476f7d8 100644
--- a/src/Gui/TaskView/TaskDialogPython.cpp
+++ b/src/Gui/TaskView/TaskDialogPython.cpp
@@ -740,9 +740,10 @@ QDialogButtonBox::StandardButtons TaskDialogPython::getStandardButtons() const
if (dlg.hasAttr(std::string("getStandardButtons"))) {
Py::Callable method(dlg.getAttr(std::string("getStandardButtons")));
Py::Tuple args;
- Py::Int ret(method.apply(args));
- int value = (int)ret;
- return QDialogButtonBox::StandardButtons(value);
+ Gui::PythonWrapper wrap;
+ wrap.loadWidgetsModule();
+ qsizetype value(wrap.toEnum(method.apply(args)));
+ return QDialogButtonBox::StandardButtons((int)value);
}
}
catch (Py::Exception&) {
diff --git a/src/Mod/Arch/ArchAxis.py b/src/Mod/Arch/ArchAxis.py
index ecda27a76..406f094f5 100644
--- a/src/Mod/Arch/ArchAxis.py
+++ b/src/Mod/Arch/ArchAxis.py
@@ -723,7 +723,7 @@ class _AxisTaskPanel:
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
def update(self):
diff --git a/src/Mod/Arch/ArchAxisSystem.py b/src/Mod/Arch/ArchAxisSystem.py
index a896a98a5..241dcf36b 100644
--- a/src/Mod/Arch/ArchAxisSystem.py
+++ b/src/Mod/Arch/ArchAxisSystem.py
@@ -313,7 +313,7 @@ class AxisSystemTaskPanel:
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Ok)
+ return QtGui.QDialogButtonBox.Ok
def getIcon(self,obj):
diff --git a/src/Mod/Arch/ArchCommands.py b/src/Mod/Arch/ArchCommands.py
index 114ab6034..143641784 100644
--- a/src/Mod/Arch/ArchCommands.py
+++ b/src/Mod/Arch/ArchCommands.py
@@ -1023,7 +1023,7 @@ class SurveyTaskPanel:
return True
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
def reject(self):
if hasattr(FreeCAD,"SurveyObserver"):
diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py
index 36bb3a4d3..3e33b5a45 100644
--- a/src/Mod/Arch/ArchComponent.py
+++ b/src/Mod/Arch/ArchComponent.py
@@ -1660,7 +1660,7 @@ class SelectionTaskPanel:
def getStandardButtons(self):
"""Adds the cancel button."""
- return int(QtGui.QDialogButtonBox.Cancel)
+ return QtGui.QDialogButtonBox.Cancel
def reject(self):
"""The method run when the user selects the cancel button."""
@@ -1766,7 +1766,7 @@ class ComponentTaskPanel:
def getStandardButtons(self):
"""Add the standard ok button."""
- return int(QtGui.QDialogButtonBox.Ok)
+ return QtGui.QDialogButtonBox.Ok
def check(self,wid,col):
"""This method is run as the callback when the user selects an item in the tree.
diff --git a/src/Mod/Arch/ArchCutPlane.py b/src/Mod/Arch/ArchCutPlane.py
index 3aa5e1ce0..ba103f38d 100644
--- a/src/Mod/Arch/ArchCutPlane.py
+++ b/src/Mod/Arch/ArchCutPlane.py
@@ -168,7 +168,7 @@ class _CutPlaneTaskPanel:
return True
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Ok|QtGui.QDialogButtonBox.Cancel)
+ return QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel
def previewCutVolume(self, i):
cutVolume = ArchCommands.getCutVolume(self.plan,FreeCADGui.Selection.getSelectionEx()[0].Object.Shape)
diff --git a/src/Mod/Arch/ArchRoof.py b/src/Mod/Arch/ArchRoof.py
index 74ec30b5b..f9333d81a 100644
--- a/src/Mod/Arch/ArchRoof.py
+++ b/src/Mod/Arch/ArchRoof.py
@@ -949,7 +949,7 @@ class _RoofTaskPanel:
return True
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
def update(self):
'''fills the treewidget'''
diff --git a/src/Mod/Arch/ArchSectionPlane.py b/src/Mod/Arch/ArchSectionPlane.py
index 8e6177dfc..bede32334 100644
--- a/src/Mod/Arch/ArchSectionPlane.py
+++ b/src/Mod/Arch/ArchSectionPlane.py
@@ -1265,7 +1265,7 @@ class SectionPlaneTaskPanel:
return True
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Ok)
+ return QtGui.QDialogButtonBox.Ok
def getIcon(self,obj):
if hasattr(obj.ViewObject,"Proxy"):
diff --git a/src/Mod/Arch/ArchWindow.py b/src/Mod/Arch/ArchWindow.py
index c3cc10c60..b5e72ee2e 100644
--- a/src/Mod/Arch/ArchWindow.py
+++ b/src/Mod/Arch/ArchWindow.py
@@ -1496,7 +1496,7 @@ class _ArchWindowTaskPanel:
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
def check(self,wid,col):
diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py
index b19101e9c..3bba18795 100644
--- a/src/Mod/Draft/DraftGui.py
+++ b/src/Mod/Draft/DraftGui.py
@@ -217,7 +217,7 @@ class DraftTaskPanel:
else:
self.form = widget
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
def accept(self):
if hasattr(FreeCADGui,"draftToolBar"):
return FreeCADGui.draftToolBar.validatePoint()
@@ -1031,7 +1031,7 @@ class DraftToolBar:
self.form = [extra]
self.callback = callback
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
def reject(self):
if self.callback:
self.callback()
@@ -1766,7 +1766,7 @@ class FacebinderTaskPanel:
return True
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Ok)
+ return QtGui.QDialogButtonBox.Ok
def update(self):
"""fills the treewidget"""
diff --git a/src/Mod/Draft/drafttaskpanels/task_selectplane.py b/src/Mod/Draft/drafttaskpanels/task_selectplane.py
index 7eba90f0e..a8ba3139d 100644
--- a/src/Mod/Draft/drafttaskpanels/task_selectplane.py
+++ b/src/Mod/Draft/drafttaskpanels/task_selectplane.py
@@ -40,6 +40,7 @@ to be more similar to OrthoArray and the new tools.
## \addtogroup drafttaskpanels
# @{
import FreeCADGui as Gui
+from PySide import QtWidgets
class SelectPlaneTaskPanel:
@@ -50,6 +51,6 @@ class SelectPlaneTaskPanel:
def getStandardButtons(self):
"""Execute to set the standard buttons."""
- return 2097152 # int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
## @}
diff --git a/src/Mod/Fem/femsolver/solver_taskpanel.py b/src/Mod/Fem/femsolver/solver_taskpanel.py
index 90c622ad7..5d3817bef 100644
--- a/src/Mod/Fem/femsolver/solver_taskpanel.py
+++ b/src/Mod/Fem/femsolver/solver_taskpanel.py
@@ -156,7 +156,7 @@ class ControlTaskPanel(QtCore.QObject):
femsolver.report.display(machine.report, _REPORT_TITLE, text)
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
def reject(self):
Gui.ActiveDocument.resetEdit()
diff --git a/src/Mod/Fem/femtaskpanels/task_mesh_gmsh.py b/src/Mod/Fem/femtaskpanels/task_mesh_gmsh.py
index 2aa2fbf24..770620c08 100644
--- a/src/Mod/Fem/femtaskpanels/task_mesh_gmsh.py
+++ b/src/Mod/Fem/femtaskpanels/task_mesh_gmsh.py
@@ -106,9 +106,7 @@ class _TaskPanel:
self.update()
def getStandardButtons(self):
- button_value = int(
- QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Apply | QtGui.QDialogButtonBox.Cancel
- )
+ button_value = QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Apply | QtGui.QDialogButtonBox.Cancel
return button_value
# show a OK, a apply and a Cancel button
# def reject() is called on Cancel button
diff --git a/src/Mod/Fem/femtaskpanels/task_result_mechanical.py b/src/Mod/Fem/femtaskpanels/task_result_mechanical.py
index 266670a54..f0ec4e9d7 100644
--- a/src/Mod/Fem/femtaskpanels/task_result_mechanical.py
+++ b/src/Mod/Fem/femtaskpanels/task_result_mechanical.py
@@ -265,7 +265,7 @@ class _TaskPanel:
self.result_widget.sb_displacement_factor_max.setValue(100.) # init non standard values
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
def get_result_stats(self, type_name):
return resulttools.get_stats(self.result_obj, type_name)
diff --git a/src/Mod/Fem/femtaskpanels/task_solver_ccxtools.py b/src/Mod/Fem/femtaskpanels/task_solver_ccxtools.py
index fd4607f94..a39eb47d7 100644
--- a/src/Mod/Fem/femtaskpanels/task_solver_ccxtools.py
+++ b/src/Mod/Fem/femtaskpanels/task_solver_ccxtools.py
@@ -159,7 +159,7 @@ class _TaskPanel:
def getStandardButtons(self):
# only show a close button
# def accept() in no longer needed, since there is no OK button
- return int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
def reject(self):
FreeCADGui.ActiveDocument.resetEdit()
diff --git a/src/Mod/OpenSCAD/OpenSCADCommands.py b/src/Mod/OpenSCAD/OpenSCADCommands.py
index 3ee3737b5..10b45d5f0 100644
--- a/src/Mod/OpenSCAD/OpenSCADCommands.py
+++ b/src/Mod/OpenSCAD/OpenSCADCommands.py
@@ -379,7 +379,7 @@ class AddSCADTask:
self.form.buttonrefresh.clicked.connect(self.refreshelement)
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
def isAllowedAlterSelection(self):
return True
@@ -492,7 +492,7 @@ class OpenSCADMeshBooleanTask:
self.form.buttonadd.clicked.connect(self.doboolean)
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Close)
+ return QtGui.QDialogButtonBox.Close
def isAllowedAlterSelection(self):
return False
diff --git a/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py b/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py
index bf79827a2..fb3607797 100644
--- a/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py
+++ b/src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py
@@ -306,7 +306,7 @@ class AttachmentEditorTaskPanel(FrozenClass):
# task dialog handling
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Ok) | int(QtGui.QDialogButtonBox.Cancel)| int(QtGui.QDialogButtonBox.Apply)
+ return QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Apply
def clicked(self,button):
if button == QtGui.QDialogButtonBox.Apply:
diff --git a/src/Mod/PartDesign/InvoluteGearFeature.py b/src/Mod/PartDesign/InvoluteGearFeature.py
index bd91d495b..bca795851 100644
--- a/src/Mod/PartDesign/InvoluteGearFeature.py
+++ b/src/Mod/PartDesign/InvoluteGearFeature.py
@@ -258,7 +258,7 @@ class _InvoluteGearTaskPanel:
self.form.doubleSpinBox_ProfileShift.setValue(self.obj.ProfileShiftCoefficient)
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Ok) | int(QtGui.QDialogButtonBox.Cancel)| int(QtGui.QDialogButtonBox.Apply)
+ return QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Apply
def clicked(self,button):
if button == QtGui.QDialogButtonBox.Apply:
diff --git a/src/Mod/PartDesign/SprocketFeature.py b/src/Mod/PartDesign/SprocketFeature.py
index c63cbe0fe..53270b093 100644
--- a/src/Mod/PartDesign/SprocketFeature.py
+++ b/src/Mod/PartDesign/SprocketFeature.py
@@ -253,7 +253,7 @@ class SprocketTaskPanel:
self.obj.Proxy.execute(self.obj)
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Ok) | int(QtGui.QDialogButtonBox.Cancel)| int(QtGui.QDialogButtonBox.Apply)
+ return QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Apply
def clicked(self,button):
if button == QtGui.QDialogButtonBox.Apply:
diff --git a/src/Mod/PartDesign/WizardShaft/WizardShaft.py b/src/Mod/PartDesign/WizardShaft/WizardShaft.py
index 850da098c..096468d1e 100644
--- a/src/Mod/PartDesign/WizardShaft/WizardShaft.py
+++ b/src/Mod/PartDesign/WizardShaft/WizardShaft.py
@@ -155,7 +155,7 @@ class TaskWizardShaft:
self.updateButton(row, col, flag)
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Ok)
+ return QtGui.QDialogButtonBox.Ok
def accept(self):
if self.table:
diff --git a/src/Mod/Path/Path/Dressup/Gui/Boundary.py b/src/Mod/Path/Path/Dressup/Gui/Boundary.py
index e27c0169e..9064a3de1 100644
--- a/src/Mod/Path/Path/Dressup/Gui/Boundary.py
+++ b/src/Mod/Path/Path/Dressup/Gui/Boundary.py
@@ -59,11 +59,7 @@ class TaskPanel(object):
self.stockEdit = None
def getStandardButtons(self):
- return int(
- QtGui.QDialogButtonBox.Ok
- | QtGui.QDialogButtonBox.Apply
- | QtGui.QDialogButtonBox.Cancel
- )
+ return QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Apply | QtGui.QDialogButtonBox.Cancel
def modifyStandardButtons(self, buttonBox):
self.buttonBox = buttonBox
diff --git a/src/Mod/Path/Path/Dressup/Gui/Tags.py b/src/Mod/Path/Path/Dressup/Gui/Tags.py
index b0c4d2aff..6b3a62a82 100644
--- a/src/Mod/Path/Path/Dressup/Gui/Tags.py
+++ b/src/Mod/Path/Path/Dressup/Gui/Tags.py
@@ -75,11 +75,7 @@ class PathDressupTagTaskPanel:
self.editItem = None
def getStandardButtons(self):
- return int(
- QtGui.QDialogButtonBox.Ok
- | QtGui.QDialogButtonBox.Apply
- | QtGui.QDialogButtonBox.Cancel
- )
+ return QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Apply | QtGui.QDialogButtonBox.Cancel
def clicked(self, button):
if button == QtGui.QDialogButtonBox.Apply:
diff --git a/src/Mod/Path/Path/Op/Gui/Base.py b/src/Mod/Path/Path/Op/Gui/Base.py
index 0de7699b4..3faec0533 100644
--- a/src/Mod/Path/Path/Op/Gui/Base.py
+++ b/src/Mod/Path/Path/Op/Gui/Base.py
@@ -1274,11 +1274,7 @@ class TaskPanel(object):
def getStandardButtons(self):
"""getStandardButtons() ... returns the Buttons for the task panel."""
- return int(
- QtGui.QDialogButtonBox.Ok
- | QtGui.QDialogButtonBox.Apply
- | QtGui.QDialogButtonBox.Cancel
- )
+ return QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Apply | QtGui.QDialogButtonBox.Cancel
def setupUi(self):
"""setupUi() ... internal function to initialise all pages."""
diff --git a/src/Mod/Path/PathPythonGui/simple_edit_panel.py b/src/Mod/Path/PathPythonGui/simple_edit_panel.py
index 0de9345bf..75d635f75 100644
--- a/src/Mod/Path/PathPythonGui/simple_edit_panel.py
+++ b/src/Mod/Path/PathPythonGui/simple_edit_panel.py
@@ -88,11 +88,7 @@ class SimpleEditPanel:
)
def getStandardButtons(self):
- return int(
- QtGui.QDialogButtonBox.Ok
- | QtGui.QDialogButtonBox.Apply
- | QtGui.QDialogButtonBox.Cancel
- )
+ return QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Apply | QtGui.QDialogButtonBox.Cancel
def clicked(self, button):
# callback for standard buttons
diff --git a/src/Mod/TemplatePyMod/TaskPanel.py b/src/Mod/TemplatePyMod/TaskPanel.py
index ef07e9b24..cc8e301aa 100644
--- a/src/Mod/TemplatePyMod/TaskPanel.py
+++ b/src/Mod/TemplatePyMod/TaskPanel.py
@@ -61,7 +61,7 @@ class TaskPanel:
return True
def getStandardButtons(self):
- return int(QtGui.QDialogButtonBox.Ok)
+ return QtGui.QDialogButtonBox.Ok
def helpRequested(self):
pass

View file

@ -1,14 +0,0 @@
diff --git a/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp b/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp
index 7e3de0070a..dc5249158d 100644
--- a/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp
+++ b/src/3rdParty/salomesmesh/src/SMDS/SMDS_UnstructuredGrid.cpp
@@ -1026,7 +1026,8 @@ void SMDS_UnstructuredGrid::BuildLinks()
GetLinks()->Allocate(this->GetNumberOfPoints());
GetLinks()->Register(this);
//FIXME: vtk9
- GetLinks()->BuildLinks(this);
+ GetLinks()->SetDataSet(this);
+ GetLinks()->BuildLinks();
GetLinks()->Delete();
#else
this->Links = SMDS_CellLinks::New();

View file

@ -1,95 +0,0 @@
diff --git a/src/Mod/AddonManager/package_details.py b/src/Mod/AddonManager/package_details.py
index c9d1ae311a..9c0e040ea5 100644
--- a/src/Mod/AddonManager/package_details.py
+++ b/src/Mod/AddonManager/package_details.py
@@ -26,7 +26,7 @@
import os
from typing import Optional
-from PySide import QtCore, QtGui, QtWidgets
+from PySide6 import QtCore, QtGui, QtWidgets
import addonmanager_freecad_interface as fci
@@ -51,14 +51,14 @@ translate = fci.translate
show_javascript_console_output = False
try:
- from PySide import QtWebEngineWidgets
+ from PySide6 import QtWebEngineCore, QtWebEngineWidgets
HAS_QTWEBENGINE = True
except ImportError:
fci.Console.PrintWarning(
translate(
"AddonsInstaller",
- "Addon Manager Warning: Could not import QtWebEngineWidgets -- README data will display as text-only",
+ "Addon Manager Warning: Could not import QtWebEngineCore -- README data will display as text-only",
)
+ "\n"
)
@@ -715,14 +714,14 @@ class PackageDetails(QtWidgets.QWidget):
if HAS_QTWEBENGINE:
- class RestrictedWebPage(QtWebEngineWidgets.QWebEnginePage):
+ class RestrictedWebPage(QtWebEngineCore.QWebEnginePage):
"""A class that follows links to FreeCAD wiki pages, but opens all other
clicked links in the system web browser"""
def __init__(self, parent):
super().__init__(parent)
self.settings().setAttribute(
- QtWebEngineWidgets.QWebEngineSettings.ErrorPageEnabled, False
+ QtWebEngineCore.QWebEngineSettings.ErrorPageEnabled, False
)
self.stored_url = None
@@ -731,7 +730,7 @@ if HAS_QTWEBENGINE:
navigation requests to the FreeCAD Wiki (for translation purposes) --
anything else will open in a new window.
"""
- if _type == QtWebEngineWidgets.QWebEnginePage.NavigationTypeLinkClicked:
+ if _type == QtWebEngineCore.QWebEnginePage.NavigationTypeLinkClicked:
# See if the link is to a FreeCAD Wiki page -- if so, follow it,
# otherwise ask the OS to open it
if (
@@ -754,11 +753,11 @@ if HAS_QTWEBENGINE:
global show_javascript_console_output
if show_javascript_console_output:
tag = translate("AddonsInstaller", "Page JavaScript reported")
- if level == QtWebEngineWidgets.QWebEnginePage.InfoMessageLevel:
+ if level == QtWebEngineCore.QWebEnginePage.InfoMessageLevel:
fci.Console.PrintMessage(f"{tag} {lineNumber}: {message}\n")
- elif level == QtWebEngineWidgets.QWebEnginePage.WarningMessageLevel:
+ elif level == QtWebEngineCore.QWebEnginePage.WarningMessageLevel:
fci.Console.PrintWarning(f"{tag} {lineNumber}: {message}\n")
- elif level == QtWebEngineWidgets.QWebEnginePage.ErrorMessageLevel:
+ elif level == QtWebEngineCore.QWebEnginePage.ErrorMessageLevel:
fci.Console.PrintError(f"{tag} {lineNumber}: {message}\n")
def _reload_stored_url(self):
diff --git a/src/Mod/AddonManager/AddonManager.py b/src/Mod/AddonManager/AddonManager.py
index cb8bb63d8a..7445173537 100644
--- a/src/Mod/AddonManager/AddonManager.py
+++ b/src/Mod/AddonManager/AddonManager.py
@@ -427,15 +427,15 @@ class CommandAddonManager:
"You must restart FreeCAD for changes to take effect.",
)
)
- m.setIcon(m.Warning)
- m.setStandardButtons(m.Ok | m.Cancel)
- m.setDefaultButton(m.Cancel)
+ m.setIcon(m.Icon.Warning)
+ m.setStandardButtons(m.StandardButton.Ok | m.StandardButton.Cancel)
+ m.setDefaultButton(m.StandardButton.Cancel)
okBtn = m.button(QtWidgets.QMessageBox.StandardButton.Ok)
cancelBtn = m.button(QtWidgets.QMessageBox.StandardButton.Cancel)
okBtn.setText(translate("AddonsInstaller", "Restart now"))
cancelBtn.setText(translate("AddonsInstaller", "Restart later"))
ret = m.exec_()
- if ret == m.Ok:
+ if ret == m.StandardButton.Ok:
# restart FreeCAD after a delay to give time to this dialog to close
QtCore.QTimer.singleShot(1000, utils.restart_freecad)