Update various features in the doc editor using new helper code

This commit is contained in:
Veronica Berglyd Olsen
2024-10-30 19:13:13 +01:00
parent fa0bef5500
commit a2b09fdfec
6 changed files with 104 additions and 104 deletions
+12 -2
View File
@@ -30,8 +30,8 @@ from pathlib import Path
from time import time
from typing import TYPE_CHECKING, TypeVar
from PyQt5.QtCore import QObject, QRunnable, QThreadPool, QTimer, pyqtSignal
from PyQt5.QtGui import QFont
from PyQt5.QtCore import QObject, QRunnable, QThreadPool, QTimer, QUrl, pyqtSignal, pyqtSlot
from PyQt5.QtGui import QDesktopServices, QFont
from PyQt5.QtWidgets import QFileDialog, QFontDialog, QMessageBox, QWidget
from novelwriter.common import formatFileFilter
@@ -292,6 +292,16 @@ class SharedData(QObject):
return widget
return None
##
# Public Slots
##
@pyqtSlot(str)
def openWebsite(self, url: str) -> None:
"""Open a URL in the system's default browser."""
QDesktopServices.openUrl(QUrl(url))
return
##
# Signal Proxy
##