# Path: FlatCAMGUI.py
# class FlatCAMActivityView(QtGui.QWidget):
# 
#     def __init__(self, parent=None):
#         super(FlatCAMActivityView, self).__init__(parent=parent)
# 
#         self.setMinimumWidth(200)
# 
#         self.icon = QtGui.QLabel(self)
#         self.icon.setGeometry(0, 0, 12, 12)
#         self.movie = QtGui.QMovie("share/active.gif")
#         self.icon.setMovie(self.movie)
#         #self.movie.start()
# 
#         layout = QtGui.QHBoxLayout()
#         layout.setContentsMargins(5, 0, 5, 0)
#         layout.setAlignment(QtCore.Qt.AlignLeft)
#         self.setLayout(layout)
# 
#         layout.addWidget(self.icon)
#         self.text = QtGui.QLabel(self)
#         self.text.setText("Idle.")
# 
#         layout.addWidget(self.text)
# 
#     def set_idle(self):
#         self.movie.stop()
#         self.text.setText("Idle.")
# 
#     def set_busy(self, msg):
#         self.movie.start()
#         self.text.setText(msg)


from FlatCAMGUI import FlatCAMActivityView
from PyQt4 import QtCore
import weakref
        proc.connect(self.on_done, event="done")

        self.add(proc)

        self.on_change(proc)

        return proc

    def on_change(self, proc):
        pass

    def on_done(self, proc):
        self.remove(proc)

    def remove(self, proc):

        to_be_removed = []

        for pref in self.procs:
            if pref() == proc or pref() is None:
                to_be_removed.append(pref)

        for pref in to_be_removed:
            self.procs.remove(pref)


class FCVisibleProcessContainer(QtCore.QObject, FCProcessContainer):
    something_changed = QtCore.pyqtSignal()

    def __init__(self, view):

# Path: FlatCAMGUI.py
# class FlatCAMActivityView(QtGui.QWidget):
# 
#     def __init__(self, parent=None):
#         super(FlatCAMActivityView, self).__init__(parent=parent)
# 
#         self.setMinimumWidth(200)
# 
#         self.icon = QtGui.QLabel(self)
#         self.icon.setGeometry(0, 0, 12, 12)
#         self.movie = QtGui.QMovie("share/active.gif")
#         self.icon.setMovie(self.movie)
#         #self.movie.start()
# 
#         layout = QtGui.QHBoxLayout()
#         layout.setContentsMargins(5, 0, 5, 0)
#         layout.setAlignment(QtCore.Qt.AlignLeft)
#         self.setLayout(layout)
# 
#         layout.addWidget(self.icon)
#         self.text = QtGui.QLabel(self)
#         self.text.setText("Idle.")
# 
#         layout.addWidget(self.text)
# 
#     def set_idle(self):
#         self.movie.stop()
#         self.text.setText("Idle.")
# 
#     def set_busy(self, msg):
#         self.movie.start()
#         self.text.setText(msg)


# Path: FlatCAMProcess.py
from FlatCAMGUI import FlatCAMActivityView
from PyQt4 import QtCore
import weakref

        proc.connect(self.on_done, event="done")

        self.add(proc)

        self.on_change(proc)

        return proc

    def on_change(self, proc):
        pass

    def on_done(self, proc):
        self.remove(proc)

    def remove(self, proc):

        to_be_removed = []

        for pref in self.procs:
            if pref() == proc or pref() is None:
                to_be_removed.append(pref)

        for pref in to_be_removed:
            self.procs.remove(pref)


class FCVisibleProcessContainer(QtCore.QObject, FCProcessContainer):
    something_changed = QtCore.pyqtSignal()

    def __init__(self, view):

        assert isinstance(view, FlatCAMActivityView), \