Merge branch 'master' into spreadsheetPasteCleanup

This commit is contained in:
Chris Hennes
2021-09-21 14:34:46 -05:00
committed by GitHub
7 changed files with 179 additions and 9 deletions

View File

@@ -266,8 +266,10 @@ def get_zip_url(baseurl):
def get_readme_url(url):
"Returns the location of a readme file"
if "github" in url or "framagit" in url or "gitlab" in url:
if "github" in url or "framagit" in url:
return url+"/raw/master/README.md"
elif "gitlab" in url:
return url+"/-/raw/master/README.md"
else:
print("Debug: addonmanager_utilities.get_readme_url: Unknown git host:", url)
return None

View File

@@ -52,7 +52,7 @@ class TestPathDeburr(PathTestUtils.PathTestBase):
self.assertFalse(info)
def test01(self):
'''Verify chamfer depth and offset for a 90° v-bit.'''
'''Verify chamfer depth and offset for a 90 deg v-bit.'''
tool = Path.Tool()
tool.FlatRadius = 0
tool.CuttingEdgeAngle = 90
@@ -68,7 +68,7 @@ class TestPathDeburr(PathTestUtils.PathTestBase):
self.assertFalse(info)
def test02(self):
'''Verify chamfer depth and offset for a 90° v-bit with non 0 flat radius.'''
'''Verify chamfer depth and offset for a 90 deg v-bit with non 0 flat radius.'''
tool = Path.Tool()
tool.FlatRadius = 0.3
tool.CuttingEdgeAngle = 90
@@ -84,7 +84,7 @@ class TestPathDeburr(PathTestUtils.PathTestBase):
self.assertFalse(info)
def test03(self):
'''Verify chamfer depth and offset for a 60° v-bit with non 0 flat radius.'''
'''Verify chamfer depth and offset for a 60 deg v-bit with non 0 flat radius.'''
tool = Path.Tool()
tool.FlatRadius = 10
tool.CuttingEdgeAngle = 60

View File

@@ -27,6 +27,7 @@
# include <QMdiArea>
# include <QMdiSubWindow>
# include <QUrl>
# include <QIcon>
#endif
#include <Base/Console.h>
@@ -63,7 +64,7 @@ public:
add_varargs_method("openBrowserWindow",&Module::openBrowserWindow
);
add_varargs_method("open",&Module::openBrowser,
"open(string)\n"
"open(htmlcode,baseurl,[title,iconpath])\n"
"Load a local (X)HTML file."
);
add_varargs_method("insert",&Module::openBrowser,
@@ -99,8 +100,9 @@ private:
{
const char* HtmlCode;
const char* BaseUrl;
const char* IconPath;
char* TabName = nullptr;
if (! PyArg_ParseTuple(args.ptr(), "ss|et", &HtmlCode, &BaseUrl, "utf-8", &TabName))
if (! PyArg_ParseTuple(args.ptr(), "ss|ets", &HtmlCode, &BaseUrl, "utf-8", &TabName, &IconPath))
throw Py::Exception();
std::string EncodedName = "Browser";
@@ -114,6 +116,8 @@ private:
pcBrowserView->resize(400, 300);
pcBrowserView->setHtml(QString::fromUtf8(HtmlCode),QUrl(QString::fromLatin1(BaseUrl)));
pcBrowserView->setWindowTitle(QString::fromUtf8(EncodedName.c_str()));
if (IconPath)
pcBrowserView->setWindowIcon(QIcon(QString::fromUtf8(IconPath)));
Gui::getMainWindow()->addWindow(pcBrowserView);
if (!Gui::getMainWindow()->activeWindow())
Gui::getMainWindow()->setActiveWindow(pcBrowserView);

View File

@@ -97,7 +97,11 @@ public:
bool onMsg(const char* pMsg,const char** ppReturn);
bool onHasMsg(const char* pMsg) const;
bool canClose(void);
bool canClose (void);
#ifdef QTWEBENGINE
void setWindowIcon(const QIcon &icon);
#endif
protected Q_SLOTS:
void onLoadStarted();
@@ -107,7 +111,6 @@ protected Q_SLOTS:
void urlFilter(const QUrl &url);
#ifdef QTWEBENGINE
void onDownloadRequested(QWebEngineDownloadItem *request);
void setWindowIcon(const QIcon &icon);
void onLinkHovered(const QString& url);
#else
void onDownloadRequested(const QNetworkRequest& request);