Browse Source

Remove obsolete ProjectMixin.editor_window property.

startup
Ben Niemann 3 years ago
parent
commit
9b31dd54b8
  1. 2
      noisicaa/builtin_nodes/custom_csound/node_ui.py
  2. 2
      noisicaa/builtin_nodes/instrument/node_ui.py
  3. 2
      noisicaa/builtin_nodes/sample_track/track_ui.py
  4. 14
      noisicaa/builtin_nodes/score_track/track_ui.py
  5. 2
      noisicaa/ui/editor_window.py
  6. 2
      noisicaa/ui/graph/plugin_node.py
  7. 13
      noisicaa/ui/ui_base.py
  8. 1
      noisidev/uitest.py

2
noisicaa/builtin_nodes/custom_csound/node_ui.py

@ -451,7 +451,7 @@ class CustomCSoundNode(generic_node.GenericNode):
def __showEditor(self) -> None:
if self.__editor is None:
self.__editor = Editor(
node=self.__node, parent=self.editor_window, context=self.context)
node=self.__node, parent=self.project_view, context=self.context)
self.__editor.show()
self.__editor.raise_()

2
noisicaa/builtin_nodes/instrument/node_ui.py

@ -93,7 +93,7 @@ class InstrumentNodeWidget(ui_base.ProjectMixin, core.AutoCleanupMixin, QtWidget
async def __selectInstrument(self) -> None:
dialog = instrument_library.InstrumentLibraryDialog(
context=self.context, selectButton=True, parent=self.editor_window)
context=self.context, selectButton=True, parent=self.project_view)
dialog.setWindowTitle("Select instrument")
dialog.setModal(True)
dialog.finished.connect(lambda _: self.__selectInstrumentClosed(dialog))

2
noisicaa/builtin_nodes/sample_track/track_ui.py

@ -373,7 +373,7 @@ class SampleTrackEditor(time_view_mixin.ContinuousTimeMixin, base_track_editor.B
def onAddSample(self, time: audioproc.MusicalTime) -> None:
path, _ = QtWidgets.QFileDialog.getOpenFileName(
parent=self.editor_window,
parent=self.project_view,
caption="Add Sample to track \"%s\"" % self.track.name,
#directory=self.ui_state.get(
#'instruments_add_dialog_path', ''),

14
noisicaa/builtin_nodes/score_track/track_ui.py

@ -73,13 +73,13 @@ class ScoreToolBase(measured_track_editor.MeasuredToolBase):
stave_line = (
int(ymid + 5 - evt.pos().y()) // 10 + target.measure.clef.center_pitch.stave_line)
idx, _, _ = target.getEditArea(evt.pos().x())
if idx < 0:
self.editor_window.setInfoMessage('')
else:
pitch = value_types.Pitch.name_from_stave_line(
stave_line, target.measure.key_signature)
self.editor_window.setInfoMessage(pitch)
# idx, _, _ = target.getEditArea(evt.pos().x())
# if idx < 0:
# self.editor_window.setInfoMessage('')
# else:
# pitch = value_types.Pitch.name_from_stave_line(
# stave_line, target.measure.key_signature)
# self.editor_window.setInfoMessage(pitch)
super().mouseMoveEvent(target, evt)

2
noisicaa/ui/editor_window.py

@ -161,7 +161,7 @@ class ProjectTabPage(ui_base.CommonMixin, QtWidgets.QWidget):
self.__setPage(page)
class EditorWindow(ui_base.AbstractEditorWindow):
class EditorWindow(ui_base.CommonMixin, QtWidgets.QMainWindow):
# Could not figure out how to define a signal that takes either an instance
# of a specific class or None.
currentProjectChanged = QtCore.pyqtSignal(object)

2
noisicaa/ui/graph/plugin_node.py

@ -41,7 +41,7 @@ class PluginUI(ui_base.ProjectMixin, QtWidgets.QWidget):
def __init__(self, *, node: music.BaseNode, **kwargs: Any) -> None:
super().__init__(**kwargs)
self.setParent(self.editor_window)
self.setParent(self.project_view)
self.setWindowFlags(Qt.Tool)
self.setAttribute(Qt.WA_DeleteOnClose, False)
self.setWindowTitle(node.name)

13
noisicaa/ui/ui_base.py

@ -57,10 +57,6 @@ class CommonContext(object):
def app(self) -> 'AbstractEditorApp':
return self.__app
@property
def editor_window(self) -> 'AbstractEditorWindow':
return self.__app.win
@property
def audioproc_client(self) -> audioproc.AbstractAudioProcClient:
return self.__app.audioproc_client
@ -111,10 +107,6 @@ class CommonMixin(object):
def app(self) -> 'AbstractEditorApp':
return self._context.app
@property
def editor_window(self) -> 'AbstractEditorWindow':
return self._context.editor_window
@property
def audioproc_client(self) -> audioproc.AbstractAudioProcClient:
return self._context.audioproc_client
@ -225,10 +217,6 @@ class AbstractProjectView(ProjectMixin):
raise NotImplementedError
class AbstractEditorWindow(CommonMixin, QtWidgets.QMainWindow):
pipeline_status = None # type: QtWidgets.QLabel
class AbstractPipelinePerfMonitor(CommonMixin, QtWidgets.QMainWindow):
visibilityChanged = None # type: QtCore.pyqtSignal
@ -253,7 +241,6 @@ class AbstractEditorApp(object):
show_stat_monitor_action = None # type: QtWidgets.QAction
quit_action = None # type: QtWidgets.QAction
win = None # type: AbstractEditorWindow
audioproc_client = None # type: audioproc.AbstractAudioProcClient
process = None # type: core.ProcessBase
settings = None # type: QtCore.QSettings

1
noisidev/uitest.py

@ -153,7 +153,6 @@ class MockProcess(core.ProcessBase):
class MockApp(ui_base.AbstractEditorApp):
def __init__(self):
self.win = None # type: AbstractEditorWindow
self.audioproc_client = None # type: audioproc.AbstractAudioProcClient
self.process = None # type: core.ProcessBase
self.settings = None # type: QtCore.QSettings

Loading…
Cancel
Save