mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Use pyqtSlot to show more info dialog
CURA-5204
This commit is contained in:
parent
0d5b21932e
commit
35e7be1d41
@ -1,9 +0,0 @@
|
|||||||
from PyQt5.QtCore import pyqtSignal, QObject
|
|
||||||
|
|
||||||
|
|
||||||
class CuraAppSignals(QObject):
|
|
||||||
|
|
||||||
showMoreInfoOnAnonymousDataCollection = pyqtSignal()
|
|
||||||
|
|
||||||
def __init__(self, parent = None):
|
|
||||||
super().__init__(parent)
|
|
@ -74,7 +74,6 @@ from cura.Settings.SimpleModeSettingsManager import SimpleModeSettingsManager
|
|||||||
|
|
||||||
from cura.Machines.VariantManager import VariantManager
|
from cura.Machines.VariantManager import VariantManager
|
||||||
|
|
||||||
from .CuraAppSignals import CuraAppSignals
|
|
||||||
from . import PlatformPhysics
|
from . import PlatformPhysics
|
||||||
from . import BuildVolume
|
from . import BuildVolume
|
||||||
from . import CameraAnimation
|
from . import CameraAnimation
|
||||||
@ -646,8 +645,6 @@ class CuraApplication(QtApplication):
|
|||||||
def run(self):
|
def run(self):
|
||||||
self.preRun()
|
self.preRun()
|
||||||
|
|
||||||
self._app_signals = CuraAppSignals(self)
|
|
||||||
|
|
||||||
container_registry = ContainerRegistry.getInstance()
|
container_registry = ContainerRegistry.getInstance()
|
||||||
|
|
||||||
Logger.log("i", "Initializing variant manager")
|
Logger.log("i", "Initializing variant manager")
|
||||||
@ -783,10 +780,6 @@ class CuraApplication(QtApplication):
|
|||||||
def hasGui(self):
|
def hasGui(self):
|
||||||
return self._use_gui
|
return self._use_gui
|
||||||
|
|
||||||
@pyqtSlot(result = QObject)
|
|
||||||
def getCuraAppSignals(self, *args) -> CuraAppSignals:
|
|
||||||
return self._app_signals
|
|
||||||
|
|
||||||
@pyqtSlot(result = QObject)
|
@pyqtSlot(result = QObject)
|
||||||
def getSettingVisibilityPresetsModel(self, *args) -> SettingVisibilityPresetsModel:
|
def getSettingVisibilityPresetsModel(self, *args) -> SettingVisibilityPresetsModel:
|
||||||
return self._setting_visibility_presets_model
|
return self._setting_visibility_presets_model
|
||||||
@ -1739,3 +1732,7 @@ class CuraApplication(QtApplication):
|
|||||||
node = node.getParent()
|
node = node.getParent()
|
||||||
|
|
||||||
Selection.add(node)
|
Selection.add(node)
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def showMoreInformationDialogForAnonymousDataCollection(self):
|
||||||
|
self._plugin_registry.getPluginObject("SliceInfoPlugin").showMoreInfoDialog()
|
||||||
|
@ -43,15 +43,6 @@ UM.Dialog
|
|||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
Connections
|
|
||||||
{
|
|
||||||
target: CuraApplication.getCuraAppSignals()
|
|
||||||
onShowMoreInfoOnAnonymousDataCollection:
|
|
||||||
{
|
|
||||||
baseDialog.show();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
id: textRow
|
id: textRow
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
|
@ -64,10 +64,10 @@ class SliceInfo(QObject, Extension):
|
|||||||
def messageActionTriggered(self, message_id, action_id):
|
def messageActionTriggered(self, message_id, action_id):
|
||||||
Preferences.getInstance().setValue("info/asked_send_slice_info", True)
|
Preferences.getInstance().setValue("info/asked_send_slice_info", True)
|
||||||
if action_id == "MoreInfo":
|
if action_id == "MoreInfo":
|
||||||
self._showMoreInfoDialog()
|
self.showMoreInfoDialog()
|
||||||
self.send_slice_info_message.hide()
|
self.send_slice_info_message.hide()
|
||||||
|
|
||||||
def _showMoreInfoDialog(self):
|
def showMoreInfoDialog(self):
|
||||||
if self._more_info_dialog is None:
|
if self._more_info_dialog is None:
|
||||||
self._more_info_dialog = self._createDialog("MoreInfoWindow.qml")
|
self._more_info_dialog = self._createDialog("MoreInfoWindow.qml")
|
||||||
self._more_info_dialog.open()
|
self._more_info_dialog.open()
|
||||||
|
@ -7,6 +7,7 @@ import QtQuick.Layouts 1.1
|
|||||||
import QtQuick.Controls.Styles 1.1
|
import QtQuick.Controls.Styles 1.1
|
||||||
|
|
||||||
import UM 1.1 as UM
|
import UM 1.1 as UM
|
||||||
|
import Cura 1.0 as Cura
|
||||||
|
|
||||||
UM.PreferencesPage
|
UM.PreferencesPage
|
||||||
{
|
{
|
||||||
@ -672,7 +673,7 @@ UM.PreferencesPage
|
|||||||
text: catalog.i18nc("@action:button", "More information")
|
text: catalog.i18nc("@action:button", "More information")
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
CuraApplication.getCuraAppSignals().showMoreInfoOnAnonymousDataCollection();
|
CuraApplication.showMoreInformationDialogForAnonymousDataCollection();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user