# 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
        self.descr = descr
        self.status = "Active"

    def __del__(self):
        self.done()

    def __enter__(self):
        pass

    def __exit__(self, exc_type, exc_val, exc_tb):
        if exc_type is not None:
            self.app.log.error("Abnormal termination of process!")
            self.app.log.error(exc_type)
            self.app.log.error(exc_val)
            self.app.log.error(exc_tb)

        self.done()

    def done(self):
        for fcn in self.callbacks["done"]:
            fcn(self)

    def connect(self, callback, event="done"):
        if callback not in self.callbacks[event]:
            self.callbacks[event].append(callback)

    def disconnect(self, callback, event="done"):
        try:
            self.callbacks[event].remove(callback)
        except ValueError:

# 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

        self.descr = descr
        self.status = "Active"

    def __del__(self):
        self.done()

    def __enter__(self):
        pass

    def __exit__(self, exc_type, exc_val, exc_tb):
        if exc_type is not None:
            self.app.log.error("Abnormal termination of process!")
            self.app.log.error(exc_type)
            self.app.log.error(exc_val)
            self.app.log.error(exc_tb)

        self.done()

    def done(self):
        for fcn in self.callbacks["done"]:
            fcn(self)

    def connect(self, callback, event="done"):
        if callback not in self.callbacks[event]:
            self.callbacks[event].append(callback)

    def disconnect(self, callback, event="done"):
        try:
            self.callbacks[event].remove(callback)
        except ValueError:

            pass