# Path: ui/PluginViewer.py
# class PluginViewer(PluginForm):
#     def __init__(self, title):
#         super(PluginViewer, self).__init__()
#         self.title = title
# 
#     def Show(self, **kwargs):
#         return PluginForm.Show(self, self.title, options=PluginForm.FORM_PERSIST)
# 
#     def OnCreate(self, form):
#         # Get parent widget
#         self.parent = form_to_widget(form)
#         self.PopulateForm()
# 
#     def PopulateForm(self):
#         ### do stuff
#         pass
# 
#     def OnClose(self, form):
#         msg("Closed %s.\n" % self.title)
# 
# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):


from ui.PluginViewer import PluginViewer
from ui.UIManager import QtGui
# coding=utf-8
__author__ = 'Anatoli Kalysch'



####################
### STACK CHANGE ###
####################
class StackChangeViewer(PluginViewer):
    def __init__(self, vr, sorted, stack_changes, title='Stack Changes Analysis (legacy)'):
        # context should be a dictionary containing the backward traced result of each relevant register
        super(StackChangeViewer, self).__init__(title)
        self.vr = vr
        self.sorted = sorted
        self.stack_changes = stack_changes


    def PopulateModel(self):
        for key in self.sorted:
            sa = QtGui.QStandardItem('%s' % key)

# Path: ui/PluginViewer.py
# class PluginViewer(PluginForm):
#     def __init__(self, title):
#         super(PluginViewer, self).__init__()
#         self.title = title
# 
#     def Show(self, **kwargs):
#         return PluginForm.Show(self, self.title, options=PluginForm.FORM_PERSIST)
# 
#     def OnCreate(self, form):
#         # Get parent widget
#         self.parent = form_to_widget(form)
#         self.PopulateForm()
# 
#     def PopulateForm(self):
#         ### do stuff
#         pass
# 
#     def OnClose(self, form):
#         msg("Closed %s.\n" % self.title)
# 
# Path: ui/UIManager.py
# class UIManager(object):
#     def __init__(self):
#     def get_init_menu(self):
#     def add_menu(self, name):
#     def remove_menu(self, name):
#     def clear(self):
#     def add_view(self, view):


# Path: ui/legacyUI/StackChangeViewer.py
from ui.PluginViewer import PluginViewer
from ui.UIManager import QtGui

# coding=utf-8
__author__ = 'Anatoli Kalysch'



####################
### STACK CHANGE ###
####################
class StackChangeViewer(PluginViewer):
    def __init__(self, vr, sorted, stack_changes, title='Stack Changes Analysis (legacy)'):
        # context should be a dictionary containing the backward traced result of each relevant register
        super(StackChangeViewer, self).__init__(title)
        self.vr = vr
        self.sorted = sorted
        self.stack_changes = stack_changes


    def PopulateModel(self):
        for key in self.sorted:
            sa = QtGui.QStandardItem('%s' % key)

            chg = QtGui.QStandardItem('%s' % self.stack_changes[key])