Add override api support.
More apis are added in this version.
This commit is contained in:
1 parent
f029ba425b
commit
e3e406a5bc
18 files changed
+451
-14
No files matched your search
+19
-1
@@ -1,6 +1,6 @@
|
||||
from pathlib import Path
|
||||
|
||||
from PySide6.QtCore import Qt, QSize, QUrl
|
||||
from PySide6.QtCore import Qt, QSize, QUrl, QTimer
|
||||
from PySide6.QtGui import QDesktopServices, QIcon, QPixmap, QMovie
|
||||
from PySide6.QtWidgets import (
|
||||
QWidget, QDialog, QVBoxLayout, QHBoxLayout, QLabel, QLineEdit,
|
||||
@@ -9,6 +9,7 @@ from PySide6.QtWidgets import (
|
||||
)
|
||||
|
||||
from manager.plugins import Plugin
|
||||
from manager.settings_models import PluginSettings
|
||||
|
||||
|
||||
class PluginsDialog(QDialog):
|
||||
@@ -379,6 +380,23 @@ class PluginsDialog(QDialog):
|
||||
super().showEvent(event)
|
||||
for movie in self.icon_movies:
|
||||
movie.start()
|
||||
QTimer.singleShot(0, self._show_plugin_warning)
|
||||
|
||||
def _show_plugin_warning(self):
|
||||
settings_manager = self.app.settings_manager
|
||||
settings = settings_manager.get("plugins", PluginSettings)
|
||||
if settings.is_plugin_warning_shown:
|
||||
return
|
||||
|
||||
settings_manager.set("plugins", settings.model_copy(update={"is_plugin_warning_shown": True}))
|
||||
self.app.widget_manager.signal.show_warning_message.emit(self.app.tr_text(
|
||||
"Plugins can run code on your computer and access your files and account data. "
|
||||
"Only enable plugins from sources you trust."
|
||||
))
|
||||
try:
|
||||
settings_manager.save()
|
||||
except OSError as error:
|
||||
self.app.logger.warning("Failed to save plugin warning preference: %s", error)
|
||||
|
||||
def hideEvent(self, event):
|
||||
for movie in self.icon_movies:
|
||||
|
||||
+3
-4
@@ -211,10 +211,9 @@ class SettingsPage(QWidget):
|
||||
|
||||
def _open_plugins_dialog(self):
|
||||
dialog = PluginsDialog(self.app, self.app.plugin_manager, self)
|
||||
try:
|
||||
dialog.exec()
|
||||
finally:
|
||||
dialog.deleteLater()
|
||||
dialog.setWindowFlags(Qt.Window)
|
||||
dialog.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose, True)
|
||||
dialog.show()
|
||||
|
||||
def _create_general_page(self) -> QWidget:
|
||||
tr = self.app.tr_text
|
||||
|
||||
Reference in new issue
Block a user