
from UM.Tool import Tool
from UM.Scene.Selection import Selection
from UM.Application import Application

from . import PerObjectSettingsModel

class PerObjectSettingsTool(Tool):
    def __init__(self):
        super().__init__()

        self.setExposedProperties("Model", "SelectedIndex", "PrintSequence")

    def event(self, event):
        return False

    def getModel(self):
        return PerObjectSettingsModel.PerObjectSettingsModel()

    def getSelectedIndex(self):
        selected_object_id = id(Selection.getSelectedObject(0))
        index = self.getModel().find("id", selected_object_id)
        return index

    def getPrintSequence(self):
        settings = Application.getInstance().getMachineManager().getActiveProfile()
        return settings.getSettingValue("print_sequence")

from UM.Tool import Tool
from UM.Scene.Selection import Selection
from UM.Application import Application

from . import PerObjectSettingsModel

class PerObjectSettingsTool(Tool):
    def __init__(self):
        super().__init__()

        self.setExposedProperties("Model", "SelectedIndex")

    def event(self, event):
        return False

    def getModel(self):
        return PerObjectSettingsModel.PerObjectSettingsModel()

    def getSelectedIndex(self):
        selected_object_id = id(Selection.getSelectedObject(0))
        index = self.getModel().find("id", selected_object_id)
        return index
Remove more remnants of print sequence message
Remove more remnants of print sequence message

I found this other place that was helping to display the message that warns that print sequcence is set per-object. Since the latter is no longer possible, this message shouldn't be displayed any more.

Contributes to issue CURA-458.

  
  from UM.Tool import Tool
  from UM.Scene.Selection import Selection
  from UM.Application import Application
  
  from . import PerObjectSettingsModel
  
  class PerObjectSettingsTool(Tool):
      def __init__(self):
          super().__init__()
  
-         self.setExposedProperties("Model", "SelectedIndex", "PrintSequence")
+         self.setExposedProperties("Model", "SelectedIndex")
  
      def event(self, event):
          return False
  
      def getModel(self):
          return PerObjectSettingsModel.PerObjectSettingsModel()
  
      def getSelectedIndex(self):
          selected_object_id = id(Selection.getSelectedObject(0))
          index = self.getModel().find("id", selected_object_id)
          return index
- 
-     def getPrintSequence(self):
-         settings = Application.getInstance().getMachineManager().getActiveProfile()
-         return settings.getSettingValue("print_sequence")
Remove more remnants of print sequence message
## Code Before:

from UM.Tool import Tool
from UM.Scene.Selection import Selection
from UM.Application import Application

from . import PerObjectSettingsModel

class PerObjectSettingsTool(Tool):
    def __init__(self):
        super().__init__()

        self.setExposedProperties("Model", "SelectedIndex", "PrintSequence")

    def event(self, event):
        return False

    def getModel(self):
        return PerObjectSettingsModel.PerObjectSettingsModel()

    def getSelectedIndex(self):
        selected_object_id = id(Selection.getSelectedObject(0))
        index = self.getModel().find("id", selected_object_id)
        return index

    def getPrintSequence(self):
        settings = Application.getInstance().getMachineManager().getActiveProfile()
        return settings.getSettingValue("print_sequence")
## Instruction:
Remove more remnants of print sequence message
## Code After:

from UM.Tool import Tool
from UM.Scene.Selection import Selection
from UM.Application import Application

from . import PerObjectSettingsModel

class PerObjectSettingsTool(Tool):
    def __init__(self):
        super().__init__()

        self.setExposedProperties("Model", "SelectedIndex")

    def event(self, event):
        return False

    def getModel(self):
        return PerObjectSettingsModel.PerObjectSettingsModel()

    def getSelectedIndex(self):
        selected_object_id = id(Selection.getSelectedObject(0))
        index = self.getModel().find("id", selected_object_id)
        return index