Index: src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py	(revision 3f4c12fceb9990c2b5278791d80af6c4fe7934c2)
+++ src/sas/qtgui/Perspectives/Fitting/FittingPerspective.py	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
@@ -1,231 +1,72 @@
 import sys
-import json
-import  os
-from collections import defaultdict
 
+from PyQt4 import QtCore
 from PyQt4 import QtGui
-from PyQt4 import QtCore
 
-from UI.FittingUI import Ui_FittingUI
+from FittingWidget import FittingWidget
 
-from sasmodels import generate
-from sasmodels import modelinfo
-from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller
+class FittingWindow(QtGui.QTabWidget):
+    """
+    """
+    name = "Fitting" # For displaying in the combo box in DataExplorer
+    def __init__(self, manager=None, parent=None, data=None):
+        super(FittingWindow, self).__init__()
 
-class FittingWindow(QtGui.QDialog, Ui_FittingUI):
-    """
-    Main window for selecting form and structure factor models
-    """
-    def __init__(self, manager=None, parent=None):
+        self.manager = manager
+        self.parent = parent
+        self._data = data
+
+        #r = raw_input("A")
+        #r = 1
+
+        # List of active fits
+        self.tabs = []
+
+        # Max index for adding new, non-clashing tab names
+        self.maxIndex = 0
+
+        # Index of the current tab
+        self.currentTab = 0
+
+        # The current optimizer
+        self.optimizer = 'DREAM'
+
+        # The tabs need to be closeable
+        self.setTabsClosable(True)
+
+        # Initialize the first tab
+        self.addFit(None)
+
+        # Deal with signals
+        self.tabCloseRequested.connect(self.tabCloses)
+    
+        self.setWindowTitle('Fit panel - Active Fitting Optimizer: %s' % self.optimizer)
+
+    def addFit(self, data):
         """
+        Add a new tab for passed data
+        """
+        tab	= FittingWidget(manager=self.manager, parent=self.parent, data=data)
+        self.tabs.append(tab)
+        self.maxIndex += 1
+        self.addTab(tab, self.tabName())
 
-        :param manager:
-        :param parent:
-        :return:
+    def tabName(self):
         """
-        super(FittingWindow, self).__init__()
-        self.setupUi(self)
-
-        self.setWindowTitle("Fitting")
-        self._model_model = QtGui.QStandardItemModel()
-        self._poly_model = QtGui.QStandardItemModel()
-        self.tableView.setModel(self._model_model)
-        self._readCategoryInfo()
-        self.model_parameters = None
-
-        structure_factor_list = self.master_category_dict.pop('Structure Factor')
-        for (structure_factor, enabled) in structure_factor_list:
-            self.cbStructureFactor.addItem(structure_factor)
-        self.cbStructureFactor.currentIndexChanged.connect(self.selectStructureFactor)
-
-        category_list = sorted(self.master_category_dict.keys())
-        self.cbCategory.addItems(category_list)
-        self.cbCategory.currentIndexChanged.connect(self.selectCategory)
-
-        category = self.cbCategory.currentText()
-        model_list = self.master_category_dict[str(category)]
-        for (model, enabled) in model_list:
-            self.cbModel.addItem(model)
-        self.cbModel.currentIndexChanged.connect(self.selectModel)
-
-        self.pushButton.setEnabled(False)
-        self.chkPolydispersity.setEnabled(False)
-        self.chkSmearing.setEnabled(False)
-
-        self.lblMinRangeDef.setText("---")
-        self.lblMaxRangeDef.setText("---")
-        self.lblChi2Value.setText("---")
-
-        #self.setTableProperties(self.tableView)
-
-        self.tableView_2.setModel(self._poly_model)
-        self.setPolyModel()
-        self.setTableProperties(self.tableView_2)
-
-    def selectCategory(self):
+        Get the new tab name, based on the number of fitting tabs so far
         """
-        Select Category from list
-        :return:
+        page_name = "FitPage" + str(self.maxIndex)
+        return page_name
+        
+    def tabCloses(self, index):
         """
-        self.cbModel.clear()
-        category = self.cbCategory.currentText()
-        model_list = self.master_category_dict[str(category)]
-        for (model, enabled) in model_list:
-            self.cbModel.addItem(model)
-
-    def selectModel(self):
+        Update local bookkeeping on tab close
         """
-        Select Model from list
-        :return:
-        """
-        model = self.cbModel.currentText()
-        self.setModelModel(model)
-
-    def selectStructureFactor(self):
-        """
-        Select Structure Factor from list
-        :param:
-        :return:
-        """
-
-
-    def _readCategoryInfo(self):
-        """
-        Reads the categories in from file
-        """
-        self.master_category_dict = defaultdict(list)
-        self.by_model_dict = defaultdict(list)
-        self.model_enabled_dict = defaultdict(bool)
-
-        try:
-            categorization_file = CategoryInstaller.get_user_file()
-            if not os.path.isfile(categorization_file):
-                categorization_file = CategoryInstaller.get_default_file()
-            cat_file = open(categorization_file, 'rb')
-            self.master_category_dict = json.load(cat_file)
-            self._regenerate_model_dict()
-            cat_file.close()
-        except IOError:
-            raise
-            print 'Problem reading in category file.'
-            print 'We even looked for it, made sure it was there.'
-            print 'An existential crisis if there ever was one.'
-
-    def _regenerate_model_dict(self):
-        """
-        regenerates self.by_model_dict which has each model name as the
-        key and the list of categories belonging to that model
-        along with the enabled mapping
-        """
-        self.by_model_dict = defaultdict(list)
-        for category in self.master_category_dict:
-            for (model, enabled) in self.master_category_dict[category]:
-                self.by_model_dict[model].append(category)
-                self.model_enabled_dict[model] = enabled
-
-        
-    def setModelModel(self, model_name):
-        """
-        Setting model parameters into table based on selected
-        :param model_name:
-        :return:
-        """
-        # Crete/overwrite model items
-        self._model_model.clear()
-        model_name = str(model_name)
-        kernel_module = generate.load_kernel_module(model_name)
-        self.model_parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', []))
-
-        #TODO: scaale and background are implicit in sasmodels and needs to be added
-        item1 = QtGui.QStandardItem('scale')
-        item1.setCheckable(True)
-        item2 = QtGui.QStandardItem('1.0')
-        item3 = QtGui.QStandardItem('0.0')
-        item4 = QtGui.QStandardItem('inf')
-        item5 = QtGui.QStandardItem('')
-        self._model_model.appendRow([item1, item2, item3, item4, item5])
-
-        item1 = QtGui.QStandardItem('background')
-        item1.setCheckable(True)
-        item2 = QtGui.QStandardItem('0.001')
-        item3 = QtGui.QStandardItem('-inf')
-        item4 = QtGui.QStandardItem('inf')
-        item5 = QtGui.QStandardItem('1/cm')
-        self._model_model.appendRow([item1, item2, item3, item4, item5])
-
-        #TODO: iq_parameters are used here. If orientation paramateres or magnetic are needed kernel_paramters should be used instead
-        #For orientation and magentic parameters param.type needs to be checked
-        for param in self.model_parameters.iq_parameters:
-            item1 = QtGui.QStandardItem(param.name)
-            item1.setCheckable(True)
-            item2 = QtGui.QStandardItem(str(param.default))
-            item3 = QtGui.QStandardItem(str(param.limits[0]))
-            item4 = QtGui.QStandardItem(str(param.limits[1]))
-            item5 = QtGui.QStandardItem(param.units)
-            self._model_model.appendRow([item1, item2, item3, item4, item5])
-
-        self._model_model.setHeaderData(0, QtCore.Qt.Horizontal, QtCore.QVariant("Parameter"))
-        self._model_model.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant("Value"))
-        self._model_model.setHeaderData(2, QtCore.Qt.Horizontal, QtCore.QVariant("Min"))
-        self._model_model.setHeaderData(3, QtCore.Qt.Horizontal, QtCore.QVariant("Max"))
-        self._model_model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("[Units]"))
-
-        self.setPolyModel()
-
-    def setTableProperties(self, table):
-        """
-        Setting table properties
-        :param table:
-        :return:
-        """
-        table.setStyleSheet("background-image: url(model.png);")
-
-        # Table properties
-        table.verticalHeader().setVisible(False)
-        table.setAlternatingRowColors(True)
-        table.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)
-        table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
-        # Header
-        header = table.horizontalHeader()
-        header.setResizeMode(QtGui.QHeaderView.Stretch)
-        header.setStretchLastSection(True)
-
-    def setPolyModel(self):
-        """
-        Set polydispersity values
-        :return:
-        """
-
-        if self.model_parameters:
-            for row, param in enumerate(self.model_parameters.form_volume_parameters):
-                item1 = QtGui.QStandardItem("Distribution of "+param.name)
-                item1.setCheckable(True)
-                item2 = QtGui.QStandardItem("0")
-                item3 = QtGui.QStandardItem("")
-                item4 = QtGui.QStandardItem("")
-                item5 = QtGui.QStandardItem("35")
-                item6 = QtGui.QStandardItem("3")
-                item7 = QtGui.QStandardItem("")
-
-                self._poly_model.appendRow([item1, item2, item3, item4, item5, item6, item7])
-
-                #TODO: Need to find cleaner way to input functions
-                func = QtGui.QComboBox()
-                func.addItems(['rectangle','array','lognormal','gaussian','schulz',])
-                func_index = self.tableView_2.model().index(row,6)
-                self.tableView_2.setIndexWidget(func_index,func)
-
-        self._poly_model.setHeaderData(0, QtCore.Qt.Horizontal, QtCore.QVariant("Parameter"))
-        self._poly_model.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant("PD[ratio]"))
-        self._poly_model.setHeaderData(2, QtCore.Qt.Horizontal, QtCore.QVariant("Min"))
-        self._poly_model.setHeaderData(3, QtCore.Qt.Horizontal, QtCore.QVariant("Max"))
-        self._poly_model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("Npts"))
-        self._poly_model.setHeaderData(5, QtCore.Qt.Horizontal, QtCore.QVariant("Nsigs"))
-        self._poly_model.setHeaderData(6, QtCore.Qt.Horizontal, QtCore.QVariant("Function"))
-
-        self.tableView_2.resizeColumnsToContents()
-        header = self.tableView_2.horizontalHeader()
-        header.ResizeMode(QtGui.QHeaderView.Stretch)
-        header.setStretchLastSection(True)
+        assert(len(self.tabs) >= index)
+        # don't remove the last tab
+        if len(self.tabs) <= 1:
+            return
+        del self.tabs[index]
+        self.removeTab(index)
 
 if __name__ == "__main__":
Index: src/sas/qtgui/Perspectives/Fitting/FittingWidget.py
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/FittingWidget.py	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
+++ src/sas/qtgui/Perspectives/Fitting/FittingWidget.py	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
@@ -0,0 +1,347 @@
+import sys
+import json
+import  os
+from collections import defaultdict
+
+from PyQt4 import QtGui
+from PyQt4 import QtCore
+
+from UI.FittingWidgetUI import Ui_FittingWidgetUI
+
+from sasmodels import generate
+from sasmodels import modelinfo
+from sas.sasgui.guiframe.CategoryInstaller import CategoryInstaller
+
+TAB_MAGNETISM = 4
+TAB_POLY = 3
+
+class FittingWidget(QtGui.QWidget, Ui_FittingWidgetUI):
+    """
+    Main window for selecting form and structure factor models
+    """
+    name = "Fitting" # For displaying in the combo box in DataExplorer
+    def __init__(self, manager=None, parent=None, data=None):
+        """
+
+        :param manager:
+        :param parent:
+        :return:
+        """
+        super(FittingWidget, self).__init__()
+
+        self.model_is_loaded = False
+        self._data = data
+        self.is2D = False
+        self.modelHasShells = False
+
+        self.setupUi(self)
+
+        self.setWindowTitle("Fitting")
+
+        # set the main models
+        self._model_model = QtGui.QStandardItemModel()
+        self._poly_model = QtGui.QStandardItemModel()
+        self._magnet_model = QtGui.QStandardItemModel()
+
+        # Param model displayed in param list
+        self.lstParams.setModel(self._model_model)
+        self._readCategoryInfo()
+        self.model_parameters = None
+
+        # Poly model displayed in poly list
+        self.lstPoly.setModel(self._poly_model)
+        self.setPolyModel()
+        self.setTableProperties(self.lstPoly)
+
+        # Magnetism model displayed in magnetism list
+        self.lstMagnetic.setModel(self._magnet_model)
+        self.setMagneticModel()
+        self.setTableProperties(self.lstMagnetic)
+
+        # Fill in the combo boxes
+        structure_factor_list = self.master_category_dict.pop('Structure Factor')
+        for (structure_factor, enabled) in structure_factor_list:
+            self.cbStructureFactor.addItem(structure_factor)
+
+        category_list = sorted(self.master_category_dict.keys())
+        self.cbCategory.addItems(category_list)
+
+        category = self.cbCategory.currentText()
+        model_list = self.master_category_dict[str(category)]
+        for (model, enabled) in model_list:
+            self.cbModel.addItem(model)
+
+        # Connect GUI element signals
+        self.cbStructureFactor.currentIndexChanged.connect(self.selectStructureFactor)
+        self.cbCategory.currentIndexChanged.connect(self.selectCategory)
+        self.cbModel.currentIndexChanged.connect(self.selectModel)
+        self.chk2DView.toggled.connect(self.toggle2D)
+        self.chkPolydispersity.toggled.connect(self.togglePoly)
+        self.chkMagnetism.toggled.connect(self.toggleMagnetism)
+
+        # Set initial control enablement
+        self.cmdFit.setEnabled(False)
+        self.cmdPlot.setEnabled(True)
+        self.chkPolydispersity.setEnabled(True)
+        self.chkPolydispersity.setCheckState(False)
+        self.chk2DView.setEnabled(True)
+        self.chk2DView.setCheckState(False)
+        self.chkMagnetism.setEnabled(False)
+        self.chkMagnetism.setCheckState(False)
+
+        self.tabFitting.setTabEnabled(TAB_POLY, False)
+        self.tabFitting.setTabEnabled(TAB_MAGNETISM, False)
+
+        # set initial labels
+        self.lblMinRangeDef.setText("---")
+        self.lblMaxRangeDef.setText("---")
+        self.lblChi2Value.setText("---")
+
+    @property
+    def data(self):
+        return self._data
+
+    @data.setter
+    def data(self, value):
+        """ data setter """
+        self._data = value
+        # TODO: update ranges, chi2 etc
+
+    def selectCategory(self):
+        """
+        Select Category from list
+        :return:
+        """
+        self.cbModel.clear()
+        category = self.cbCategory.currentText()
+        model_list = self.master_category_dict[str(category)]
+        for (model, enabled) in model_list:
+            self.cbModel.addItem(model)
+
+    def selectModel(self):
+        """
+        Select Model from list
+        :return:
+        """
+        model = self.cbModel.currentText()
+        self.setModelModel(model)
+
+    def selectStructureFactor(self):
+        """
+        Select Structure Factor from list
+        :param:
+        :return:
+        """
+
+    def _readCategoryInfo(self):
+        """
+        Reads the categories in from file
+        """
+        self.master_category_dict = defaultdict(list)
+        self.by_model_dict = defaultdict(list)
+        self.model_enabled_dict = defaultdict(bool)
+
+        try:
+            categorization_file = CategoryInstaller.get_user_file()
+            if not os.path.isfile(categorization_file):
+                categorization_file = CategoryInstaller.get_default_file()
+            cat_file = open(categorization_file, 'rb')
+            self.master_category_dict = json.load(cat_file)
+            self._regenerate_model_dict()
+            cat_file.close()
+        except IOError:
+            raise
+            print 'Problem reading in category file.'
+            print 'We even looked for it, made sure it was there.'
+            print 'An existential crisis if there ever was one.'
+
+    def _regenerate_model_dict(self):
+        """
+        regenerates self.by_model_dict which has each model name as the
+        key and the list of categories belonging to that model
+        along with the enabled mapping
+        """
+        self.by_model_dict = defaultdict(list)
+        for category in self.master_category_dict:
+            for (model, enabled) in self.master_category_dict[category]:
+                self.by_model_dict[model].append(category)
+                self.model_enabled_dict[model] = enabled
+
+        
+    def setModelModel(self, model_name):
+        """
+        Setting model parameters into table based on selected
+        :param model_name:
+        :return:
+        """
+        # Crete/overwrite model items
+        self._model_model.clear()
+        model_name = str(model_name)
+        kernel_module = generate.load_kernel_module(model_name)
+        self.model_parameters = modelinfo.make_parameter_table(getattr(kernel_module, 'parameters', []))
+
+        #TODO: scaale and background are implicit in sasmodels and needs to be added
+        item1 = QtGui.QStandardItem('scale')
+        item1.setCheckable(True)
+        item2 = QtGui.QStandardItem('1.0')
+        item3 = QtGui.QStandardItem('0.0')
+        item4 = QtGui.QStandardItem('inf')
+        item5 = QtGui.QStandardItem('')
+        self._model_model.appendRow([item1, item2, item3, item4, item5])
+
+        item1 = QtGui.QStandardItem('background')
+        item1.setCheckable(True)
+        item2 = QtGui.QStandardItem('0.001')
+        item3 = QtGui.QStandardItem('-inf')
+        item4 = QtGui.QStandardItem('inf')
+        item5 = QtGui.QStandardItem('1/cm')
+        self._model_model.appendRow([item1, item2, item3, item4, item5])
+
+        #TODO: iq_parameters are used here. If orientation paramateres or magnetic are needed kernel_paramters should be used instead
+        #For orientation and magentic parameters param.type needs to be checked
+        for param in self.model_parameters.iq_parameters:
+            item1 = QtGui.QStandardItem(param.name)
+            item1.setCheckable(True)
+            item2 = QtGui.QStandardItem(str(param.default))
+            item3 = QtGui.QStandardItem(str(param.limits[0]))
+            item4 = QtGui.QStandardItem(str(param.limits[1]))
+            item5 = QtGui.QStandardItem(param.units)
+            self._model_model.appendRow([item1, item2, item3, item4, item5])
+
+        self._model_model.setHeaderData(0, QtCore.Qt.Horizontal, QtCore.QVariant("Parameter"))
+        self._model_model.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant("Value"))
+        self._model_model.setHeaderData(2, QtCore.Qt.Horizontal, QtCore.QVariant("Min"))
+        self._model_model.setHeaderData(3, QtCore.Qt.Horizontal, QtCore.QVariant("Max"))
+        self._model_model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("[Units]"))
+
+        self.modelHasShells = True # Test
+        if self.modelHasShells:
+            self.addExtraShells()
+
+        self.setPolyModel()
+        self.setMagneticModel()
+        self.model_is_loaded = True
+
+    def setTableProperties(self, table):
+        """
+        Setting table properties
+        :param table:
+        :return:
+        """
+        # Table properties
+        table.verticalHeader().setVisible(False)
+        table.setAlternatingRowColors(True)
+        table.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Expanding)
+        table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
+        # Header
+        header = table.horizontalHeader()
+        header.setResizeMode(QtGui.QHeaderView.Stretch)
+        header.setStretchLastSection(True)
+
+    def setPolyModel(self):
+        """
+        Set polydispersity values
+        """
+        if self.model_parameters:
+            for row, param in enumerate(self.model_parameters.form_volume_parameters):
+                item1 = QtGui.QStandardItem("Distribution of "+param.name)
+                item1.setCheckable(True)
+                item2 = QtGui.QStandardItem("0")
+                item3 = QtGui.QStandardItem("")
+                item4 = QtGui.QStandardItem("")
+                item5 = QtGui.QStandardItem("35")
+                item6 = QtGui.QStandardItem("3")
+                item7 = QtGui.QStandardItem("")
+
+                self._poly_model.appendRow([item1, item2, item3, item4, item5, item6, item7])
+
+                #TODO: Need to find cleaner way to input functions
+                func = QtGui.QComboBox()
+                func.addItems(['rectangle','array','lognormal','gaussian','schulz',])
+                func_index = self.lstPoly.model().index(row,6)
+                self.lstPoly.setIndexWidget(func_index,func)
+
+        self._poly_model.setHeaderData(0, QtCore.Qt.Horizontal, QtCore.QVariant("Parameter"))
+        self._poly_model.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant("PD[ratio]"))
+        self._poly_model.setHeaderData(2, QtCore.Qt.Horizontal, QtCore.QVariant("Min"))
+        self._poly_model.setHeaderData(3, QtCore.Qt.Horizontal, QtCore.QVariant("Max"))
+        self._poly_model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("Npts"))
+        self._poly_model.setHeaderData(5, QtCore.Qt.Horizontal, QtCore.QVariant("Nsigs"))
+        self._poly_model.setHeaderData(6, QtCore.Qt.Horizontal, QtCore.QVariant("Function"))
+
+        self.lstPoly.resizeColumnsToContents()
+        header = self.lstPoly.horizontalHeader()
+        header.ResizeMode(QtGui.QHeaderView.Stretch)
+        #header.setStretchLastSection(True)
+
+    def setMagneticModel(self):
+        """
+        Set magnetism values on model
+        """
+        if self.model_parameters:
+            for row, param in enumerate(self.model_parameters.form_volume_parameters):
+                item1 = QtGui.QStandardItem("Distribution of "+param.name)
+                item1.setCheckable(True)
+                item2 = QtGui.QStandardItem("0")
+                item3 = QtGui.QStandardItem("")
+                item4 = QtGui.QStandardItem("")
+                item5 = QtGui.QStandardItem("35")
+                item6 = QtGui.QStandardItem("3")
+                item7 = QtGui.QStandardItem("")
+
+                self._magnet_model.appendRow([item1, item2, item3, item4, item5, item6, item7])
+
+                #TODO: Need to find cleaner way to input functions
+                func = QtGui.QComboBox()
+                func.addItems(['rectangle','array','lognormal','gaussian','schulz',])
+                func_index = self.lstMagnetic.model().index(row,6)
+                self.lstMagnetic.setIndexWidget(func_index,func)
+
+        self._magnet_model.setHeaderData(0, QtCore.Qt.Horizontal, QtCore.QVariant("Parameter"))
+        self._magnet_model.setHeaderData(1, QtCore.Qt.Horizontal, QtCore.QVariant("PD[ratio]"))
+        self._magnet_model.setHeaderData(2, QtCore.Qt.Horizontal, QtCore.QVariant("Min"))
+        self._magnet_model.setHeaderData(3, QtCore.Qt.Horizontal, QtCore.QVariant("Max"))
+        self._magnet_model.setHeaderData(4, QtCore.Qt.Horizontal, QtCore.QVariant("Npts"))
+        self._magnet_model.setHeaderData(5, QtCore.Qt.Horizontal, QtCore.QVariant("Nsigs"))
+        self._magnet_model.setHeaderData(6, QtCore.Qt.Horizontal, QtCore.QVariant("Function"))
+
+        self.lstMagnetic.resizeColumnsToContents()
+        header = self.lstMagnetic.horizontalHeader()
+        header.ResizeMode(QtGui.QHeaderView.Stretch)
+        header.setStretchLastSection(True)
+
+    def addExtraShells(self):
+        """
+        """
+        func = QtGui.QComboBox()
+        func.addItems(['No extra shell','Add 1 shell','Ad 2 shells'])
+
+        item = QtGui.QStandardItem("")
+        self._model_model.appendRow([item])
+
+        shell_row = self._model_model.rowCount()
+        shell_index = self._model_model.index(shell_row-1, 0)
+        self.lstParams.setIndexWidget(shell_index, func)
+        self.lstParams.setSpan(shell_row-1,1,1,4)
+
+    def togglePoly(self, isChecked):
+        """
+        """
+        self.tabFitting.setTabEnabled(TAB_POLY, isChecked)
+
+    def toggleMagnetism(self, isChecked):
+        """
+        """
+        self.tabFitting.setTabEnabled(TAB_MAGNETISM, isChecked)
+
+    def toggle2D(self, isChecked):
+        """
+        """
+        self.chkMagnetism.setEnabled(isChecked)
+        self.is2D = isChecked
+
+if __name__ == "__main__":
+    app = QtGui.QApplication([])
+    dlg = FittingWidget()
+    dlg.show()
+    sys.exit(app.exec_())
Index: src/sas/qtgui/Perspectives/Fitting/UI/FittingUI.ui
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/UI/FittingUI.ui	(revision 84be77ec47b5439f67db235df089cf04db1ec223)
+++ 	(revision )
@@ -1,651 +1,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>FittingUI</class>
- <widget class="QDialog" name="FittingUI">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>674</width>
-    <height>723</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Fitting Perspective</string>
-  </property>
-  <property name="windowIcon">
-   <iconset>
-    <normaloff>:/res/ball.ico</normaloff>:/res/ball.ico</iconset>
-  </property>
-  <layout class="QGridLayout" name="gridLayout_15">
-   <item row="0" column="0">
-    <widget class="QTabWidget" name="tabWidget">
-     <property name="currentIndex">
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="tab">
-      <attribute name="title">
-       <string>FitPage 1</string>
-      </attribute>
-      <layout class="QGridLayout" name="gridLayout_20">
-       <item row="0" column="0">
-        <widget class="QLabel" name="label">
-         <property name="text">
-          <string>File name:</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="1">
-        <widget class="QLabel" name="label_22">
-         <property name="text">
-          <string>None</string>
-         </property>
-        </widget>
-       </item>
-       <item row="0" column="2">
-        <spacer name="horizontalSpacer_4">
-         <property name="orientation">
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>482</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item row="2" column="2">
-        <layout class="QHBoxLayout" name="horizontalLayout">
-         <item>
-          <spacer name="horizontalSpacer">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="pushButton">
-           <property name="text">
-            <string>Fit</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QPushButton" name="pushButton_2">
-           <property name="text">
-            <string>Help</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item row="1" column="0" colspan="3">
-        <widget class="QTabWidget" name="tabWidget_2">
-         <property name="currentIndex">
-          <number>0</number>
-         </property>
-         <widget class="QWidget" name="tab_3">
-          <attribute name="title">
-           <string>Model</string>
-          </attribute>
-          <layout class="QGridLayout" name="gridLayout_19">
-           <item row="0" column="0" colspan="4">
-            <widget class="QGroupBox" name="groupBox_6">
-             <property name="sizePolicy">
-              <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-               <horstretch>0</horstretch>
-               <verstretch>0</verstretch>
-              </sizepolicy>
-             </property>
-             <property name="title">
-              <string>Model </string>
-             </property>
-             <layout class="QGridLayout" name="gridLayout_2">
-              <item row="0" column="0">
-               <layout class="QGridLayout" name="gridLayout">
-                <item row="0" column="0">
-                 <widget class="QLabel" name="label_2">
-                  <property name="text">
-                   <string>Category</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="0" column="1">
-                 <widget class="QLabel" name="label_3">
-                  <property name="text">
-                   <string>Model name</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="0" column="2">
-                 <widget class="QLabel" name="label_4">
-                  <property name="text">
-                   <string>Structure factor</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="0">
-                 <widget class="QComboBox" name="cbCategory"/>
-                </item>
-                <item row="1" column="1">
-                 <widget class="QComboBox" name="cbModel">
-                  <item>
-                   <property name="text">
-                    <string/>
-                   </property>
-                  </item>
-                 </widget>
-                </item>
-                <item row="1" column="2">
-                 <widget class="QComboBox" name="cbStructureFactor">
-                  <item>
-                   <property name="text">
-                    <string>None</string>
-                   </property>
-                  </item>
-                 </widget>
-                </item>
-               </layout>
-              </item>
-              <item row="1" column="0">
-               <widget class="QTableView" name="tableView">
-                <property name="styleSheet">
-                 <string notr="true"/>
-                </property>
-                <property name="selectionMode">
-                 <enum>QAbstractItemView::ExtendedSelection</enum>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item row="1" column="0">
-            <widget class="QGroupBox" name="groupBox_7">
-             <property name="title">
-              <string>Options </string>
-             </property>
-             <layout class="QGridLayout" name="gridLayout_16">
-              <item row="0" column="0">
-               <widget class="QCheckBox" name="chkPolydispersity">
-                <property name="enabled">
-                 <bool>true</bool>
-                </property>
-                <property name="text">
-                 <string>Polydispersity</string>
-                </property>
-                <property name="checkable">
-                 <bool>true</bool>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="0">
-               <widget class="QCheckBox" name="chkSmearing">
-                <property name="enabled">
-                 <bool>true</bool>
-                </property>
-                <property name="text">
-                 <string>Smearing</string>
-                </property>
-                <property name="checkable">
-                 <bool>true</bool>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item row="1" column="1">
-            <widget class="QGroupBox" name="groupBox_8">
-             <property name="title">
-              <string>Fitting range </string>
-             </property>
-             <layout class="QGridLayout" name="gridLayout_17">
-              <item row="0" column="0">
-               <layout class="QGridLayout" name="gridLayout_8">
-                <item row="0" column="0">
-                 <widget class="QLabel" name="lblMinRange">
-                  <property name="text">
-                   <string>Min range</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="0" column="1">
-                 <widget class="QLabel" name="lblMinRangeDef">
-                  <property name="text">
-                   <string>0.005</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="0" column="2">
-                 <widget class="QLabel" name="lblMinRangeUnit">
-                  <property name="text">
-                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
-&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="0">
-                 <widget class="QLabel" name="lblMaxRange">
-                  <property name="text">
-                   <string>Max range</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="1">
-                 <widget class="QLabel" name="lblMaxRangeDef">
-                  <property name="text">
-                   <string>0.1</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="2">
-                 <widget class="QLabel" name="lblMaxRangeUnit">
-                  <property name="text">
-                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
-&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-                  </property>
-                 </widget>
-                </item>
-               </layout>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item row="1" column="2">
-            <spacer name="horizontalSpacer_3">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>207</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item row="1" column="3">
-            <widget class="QGroupBox" name="groupBox_9">
-             <property name="title">
-              <string>Fitting error</string>
-             </property>
-             <layout class="QGridLayout" name="gridLayout_18">
-              <item row="0" column="0">
-               <layout class="QHBoxLayout" name="horizontalLayout_2">
-                <item>
-                 <widget class="QLabel" name="lblChi2">
-                  <property name="text">
-                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Ï&lt;/span&gt;&lt;span style=&quot; font-weight:600; vertical-align:super;&quot;&gt;2&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-                  </property>
-                 </widget>
-                </item>
-                <item>
-                 <widget class="QLabel" name="lblChi2Value">
-                  <property name="text">
-                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;0.01625&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-                  </property>
-                 </widget>
-                </item>
-               </layout>
-              </item>
-             </layout>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="QRanges">
-          <attribute name="title">
-           <string>Q Range</string>
-          </attribute>
-          <layout class="QGridLayout" name="gridLayout_7">
-           <item row="0" column="0">
-            <widget class="QGroupBox" name="groupBox">
-             <property name="title">
-              <string>Fitting range</string>
-             </property>
-             <layout class="QGridLayout" name="gridLayout_4">
-              <item row="0" column="0" rowspan="2">
-               <layout class="QGridLayout" name="gridLayout_3">
-                <item row="0" column="0">
-                 <widget class="QLabel" name="label_5">
-                  <property name="text">
-                   <string>Min range</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="0" column="1">
-                 <widget class="QLineEdit" name="lineEdit"/>
-                </item>
-                <item row="0" column="2">
-                 <widget class="QLabel" name="label_7">
-                  <property name="text">
-                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
-&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="0">
-                 <widget class="QLabel" name="label_6">
-                  <property name="text">
-                   <string>Max range</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="1">
-                 <widget class="QLineEdit" name="lineEdit_2"/>
-                </item>
-                <item row="1" column="2">
-                 <widget class="QLabel" name="label_8">
-                  <property name="text">
-                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
-&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-                  </property>
-                 </widget>
-                </item>
-               </layout>
-              </item>
-              <item row="0" column="1" rowspan="2">
-               <spacer name="horizontalSpacer_5">
-                <property name="orientation">
-                 <enum>Qt::Horizontal</enum>
-                </property>
-                <property name="sizeHint" stdset="0">
-                 <size>
-                  <width>217</width>
-                  <height>20</height>
-                 </size>
-                </property>
-               </spacer>
-              </item>
-              <item row="0" column="2">
-               <widget class="QPushButton" name="pushButton_3">
-                <property name="text">
-                 <string>Reset</string>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="2">
-               <widget class="QPushButton" name="pushButton_4">
-                <property name="text">
-                 <string>Mask Editor</string>
-                </property>
-               </widget>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item row="1" column="0">
-            <widget class="QGroupBox" name="groupBox_2">
-             <property name="title">
-              <string>Data points</string>
-             </property>
-             <layout class="QGridLayout" name="gridLayout_6">
-              <item row="0" column="0">
-               <layout class="QGridLayout" name="gridLayout_5">
-                <item row="0" column="0">
-                 <widget class="QLabel" name="label_10">
-                  <property name="text">
-                   <string>Npts</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="0" column="1">
-                 <widget class="QLineEdit" name="lineEdit_3"/>
-                </item>
-                <item row="0" column="2">
-                 <widget class="QCheckBox" name="checkBox">
-                  <property name="text">
-                   <string>Log spaced points</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="0">
-                 <widget class="QLabel" name="label_11">
-                  <property name="text">
-                   <string>Npts(Fit)</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="1">
-                 <widget class="QLineEdit" name="lineEdit_4"/>
-                </item>
-                <item row="2" column="0">
-                 <widget class="QLabel" name="label_12">
-                  <property name="text">
-                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ï&lt;span style=&quot; vertical-align:super;&quot;&gt;2&lt;/span&gt;/Npts&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="2" column="1">
-                 <widget class="QLineEdit" name="lineEdit_5"/>
-                </item>
-                <item row="2" column="3">
-                 <widget class="QPushButton" name="pushButton_5">
-                  <property name="text">
-                   <string>Compute</string>
-                  </property>
-                 </widget>
-                </item>
-               </layout>
-              </item>
-             </layout>
-            </widget>
-           </item>
-           <item row="2" column="0">
-            <spacer name="verticalSpacer">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>347</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="tab_4">
-          <attribute name="title">
-           <string>Polydisp</string>
-          </attribute>
-          <layout class="QGridLayout" name="gridLayout_10">
-           <item row="0" column="0">
-            <widget class="QGroupBox" name="groupBox_3">
-             <property name="title">
-              <string>Polydispersity and Orientational Distribution</string>
-             </property>
-             <layout class="QGridLayout" name="gridLayout_9">
-              <item row="0" column="0">
-               <widget class="QCheckBox" name="checkBox_2">
-                <property name="text">
-                 <string>Add polydispersity</string>
-                </property>
-               </widget>
-              </item>
-              <item row="1" column="0">
-               <widget class="QTableView" name="tableView_2"/>
-              </item>
-             </layout>
-            </widget>
-           </item>
-          </layout>
-         </widget>
-         <widget class="QWidget" name="tab_5">
-          <attribute name="title">
-           <string>Smearing</string>
-          </attribute>
-          <layout class="QGridLayout" name="gridLayout_14">
-           <item row="0" column="0">
-            <widget class="QGroupBox" name="groupBox_4">
-             <property name="title">
-              <string>Instrumental Smearing</string>
-             </property>
-             <layout class="QGridLayout" name="gridLayout_13">
-              <item row="0" column="0">
-               <widget class="QComboBox" name="comboBox_4">
-                <property name="currentIndex">
-                 <number>2</number>
-                </property>
-                <item>
-                 <property name="text">
-                  <string>None</string>
-                 </property>
-                </item>
-                <item>
-                 <property name="text">
-                  <string>Use dQ Data</string>
-                 </property>
-                </item>
-                <item>
-                 <property name="text">
-                  <string>Custom Pinhole Smear</string>
-                 </property>
-                </item>
-                <item>
-                 <property name="text">
-                  <string>Custom Slit Smear</string>
-                 </property>
-                </item>
-               </widget>
-              </item>
-              <item row="0" column="1">
-               <layout class="QGridLayout" name="gridLayout_11">
-                <item row="0" column="0">
-                 <widget class="QLabel" name="label_9">
-                  <property name="text">
-                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;dQ&lt;span style=&quot; vertical-align:sub;&quot;&gt;low&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="0" column="1">
-                 <widget class="QLineEdit" name="lineEdit_6"/>
-                </item>
-                <item row="0" column="2">
-                 <widget class="QLabel" name="label_14">
-                  <property name="text">
-                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
-&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="0">
-                 <widget class="QLabel" name="label_13">
-                  <property name="text">
-                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;dQ&lt;span style=&quot; vertical-align:sub;&quot;&gt;high&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-                  </property>
-                 </widget>
-                </item>
-                <item row="1" column="1">
-                 <widget class="QLineEdit" name="lineEdit_7"/>
-                </item>
-                <item row="1" column="2">
-                 <widget class="QLabel" name="label_15">
-                  <property name="text">
-                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
-&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
-                  </property>
-                 </widget>
-                </item>
-               </layout>
-              </item>
-              <item row="0" column="2">
-               <spacer name="horizontalSpacer_2">
-                <property name="orientation">
-                 <enum>Qt::Horizontal</enum>
-                </property>
-                <property name="sizeHint" stdset="0">
-                 <size>
-                  <width>71</width>
-                  <height>20</height>
-                 </size>
-                </property>
-               </spacer>
-              </item>
-              <item row="1" column="0">
-               <widget class="QGroupBox" name="groupBox_5">
-                <property name="title">
-                 <string>Weighting</string>
-                </property>
-                <layout class="QGridLayout" name="gridLayout_12">
-                 <item row="0" column="0">
-                  <layout class="QVBoxLayout" name="verticalLayout">
-                   <item>
-                    <widget class="QRadioButton" name="radioButton">
-                     <property name="text">
-                      <string>None</string>
-                     </property>
-                    </widget>
-                   </item>
-                   <item>
-                    <widget class="QRadioButton" name="radioButton_2">
-                     <property name="text">
-                      <string>Use dI Data</string>
-                     </property>
-                    </widget>
-                   </item>
-                   <item>
-                    <widget class="QRadioButton" name="radioButton_3">
-                     <property name="text">
-                      <string>Use |sqrt(I Data)|</string>
-                     </property>
-                    </widget>
-                   </item>
-                   <item>
-                    <widget class="QRadioButton" name="radioButton_4">
-                     <property name="text">
-                      <string>Use |I Data|</string>
-                     </property>
-                    </widget>
-                   </item>
-                  </layout>
-                 </item>
-                </layout>
-               </widget>
-              </item>
-             </layout>
-             <zorder>comboBox_4</zorder>
-             <zorder>groupBox_5</zorder>
-             <zorder>horizontalSpacer_2</zorder>
-            </widget>
-           </item>
-           <item row="1" column="0">
-            <spacer name="verticalSpacer_2">
-             <property name="orientation">
-              <enum>Qt::Vertical</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>20</width>
-               <height>340</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </widget>
-        </widget>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_2">
-      <attribute name="title">
-       <string>Fit Page 2</string>
-      </attribute>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>
Index: src/sas/qtgui/Perspectives/Fitting/UI/FittingWidgetUI.ui
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/UI/FittingWidgetUI.ui	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
+++ src/sas/qtgui/Perspectives/Fitting/UI/FittingWidgetUI.ui	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
@@ -0,0 +1,699 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>FittingWidgetUI</class>
+ <widget class="QWidget" name="FittingWidgetUI">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>680</width>
+    <height>721</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>FittingWidget</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout_15">
+   <item row="0" column="0">
+    <widget class="QLabel" name="label">
+     <property name="text">
+      <string>File name:</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="1">
+    <widget class="QLabel" name="lblFilename">
+     <property name="text">
+      <string>None</string>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="2" colspan="4">
+    <spacer name="horizontalSpacer_4">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>459</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="1" column="0" colspan="6">
+    <widget class="QTabWidget" name="tabFitting">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tab_3">
+      <attribute name="title">
+       <string>Model</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_19">
+       <item row="0" column="0" colspan="4">
+        <widget class="QGroupBox" name="groupBox_6">
+         <property name="sizePolicy">
+          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+           <horstretch>0</horstretch>
+           <verstretch>0</verstretch>
+          </sizepolicy>
+         </property>
+         <property name="title">
+          <string>Model </string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_2">
+          <item row="0" column="0">
+           <layout class="QGridLayout" name="gridLayout">
+            <item row="0" column="0">
+             <widget class="QLabel" name="label_2">
+              <property name="text">
+               <string>Category</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QLabel" name="label_3">
+              <property name="text">
+               <string>Model name</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="2">
+             <widget class="QLabel" name="label_4">
+              <property name="text">
+               <string>Structure factor</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="0">
+             <widget class="QComboBox" name="cbCategory"/>
+            </item>
+            <item row="1" column="1">
+             <widget class="QComboBox" name="cbModel"/>
+            </item>
+            <item row="1" column="2">
+             <widget class="QComboBox" name="cbStructureFactor">
+              <item>
+               <property name="text">
+                <string>Hard Sphere Structure</string>
+               </property>
+              </item>
+              <item>
+               <property name="text">
+                <string>None</string>
+               </property>
+              </item>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item row="1" column="0">
+           <widget class="QTableView" name="lstParams">
+            <property name="styleSheet">
+             <string notr="true"/>
+            </property>
+            <property name="selectionMode">
+             <enum>QAbstractItemView::ExtendedSelection</enum>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QGroupBox" name="groupBox_7">
+         <property name="title">
+          <string>Options </string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_16">
+          <item row="0" column="0">
+           <widget class="QCheckBox" name="chkPolydispersity">
+            <property name="enabled">
+             <bool>true</bool>
+            </property>
+            <property name="toolTip">
+             <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Switch on orientational polydispersity.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+            </property>
+            <property name="text">
+             <string>Polydispersity</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="0">
+           <widget class="QCheckBox" name="chk2DView">
+            <property name="enabled">
+             <bool>true</bool>
+            </property>
+            <property name="toolTip">
+             <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Switch on 2D view of the model.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+            </property>
+            <property name="text">
+             <string>2D view</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+          <item row="2" column="0">
+           <widget class="QCheckBox" name="chkMagnetism">
+            <property name="enabled">
+             <bool>true</bool>
+            </property>
+            <property name="toolTip">
+             <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Switch on magnetic scattering parameters.&lt;/p&gt;&lt;p&gt;This option is available only for 2D models.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+            </property>
+            <property name="text">
+             <string>Magnetism</string>
+            </property>
+            <property name="checkable">
+             <bool>true</bool>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item row="1" column="1">
+        <widget class="QGroupBox" name="groupBox_8">
+         <property name="title">
+          <string>Fitting details </string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_17">
+          <item row="0" column="0" colspan="2">
+           <layout class="QGridLayout" name="gridLayout_8">
+            <item row="0" column="0">
+             <widget class="QLabel" name="label_16">
+              <property name="text">
+               <string>Min range</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QLabel" name="lblMinRangeDef">
+              <property name="text">
+               <string>0.005</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="2">
+             <widget class="QLabel" name="label_17">
+              <property name="text">
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
+&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="0">
+             <widget class="QLabel" name="label_18">
+              <property name="text">
+               <string>Max range</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="1">
+             <widget class="QLabel" name="lblMaxRangeDef">
+              <property name="text">
+               <string>0.1</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="2">
+             <widget class="QLabel" name="label_19">
+              <property name="text">
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
+&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item row="1" column="0">
+           <widget class="QLabel" name="label_20">
+            <property name="text">
+             <string>Smearing:</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="1">
+           <widget class="QLabel" name="lblCurrentSmearing">
+            <property name="text">
+             <string>None</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item row="1" column="2">
+        <spacer name="horizontalSpacer_3">
+         <property name="orientation">
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>207</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item row="1" column="3">
+        <widget class="QGroupBox" name="groupBox_9">
+         <property name="title">
+          <string>Fitting error</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_18">
+          <item row="0" column="0">
+           <layout class="QHBoxLayout" name="horizontalLayout_2">
+            <item>
+             <widget class="QLabel" name="label_23">
+              <property name="text">
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Ï&lt;/span&gt;&lt;span style=&quot; font-weight:600; vertical-align:super;&quot;&gt;2&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QLabel" name="lblChi2Value">
+              <property name="text">
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;0.01625&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="QRanges">
+      <attribute name="title">
+       <string>Fit Options</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_7">
+       <item row="0" column="0">
+        <widget class="QGroupBox" name="groupBox">
+         <property name="title">
+          <string>Fitting range</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_4">
+          <item row="0" column="0" rowspan="2">
+           <layout class="QGridLayout" name="gridLayout_3">
+            <item row="0" column="0">
+             <widget class="QLabel" name="label_5">
+              <property name="text">
+               <string>Min range</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QLineEdit" name="lineEdit"/>
+            </item>
+            <item row="0" column="2">
+             <widget class="QLabel" name="label_7">
+              <property name="text">
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
+&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="0">
+             <widget class="QLabel" name="label_6">
+              <property name="text">
+               <string>Max range</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="1">
+             <widget class="QLineEdit" name="lineEdit_2"/>
+            </item>
+            <item row="1" column="2">
+             <widget class="QLabel" name="label_8">
+              <property name="text">
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
+&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item row="0" column="1" rowspan="2">
+           <spacer name="horizontalSpacer_5">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>217</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+          <item row="0" column="2">
+           <widget class="QPushButton" name="pushButton_3">
+            <property name="text">
+             <string>Reset</string>
+            </property>
+           </widget>
+          </item>
+          <item row="1" column="2">
+           <widget class="QPushButton" name="pushButton_4">
+            <property name="text">
+             <string>Mask Editor</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <widget class="QGroupBox" name="groupBox_2">
+         <property name="title">
+          <string>Data points</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_6">
+          <item row="0" column="0">
+           <layout class="QGridLayout" name="gridLayout_5">
+            <item row="0" column="0">
+             <widget class="QLabel" name="label_10">
+              <property name="text">
+               <string>Npts</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QLineEdit" name="lineEdit_3"/>
+            </item>
+            <item row="0" column="2">
+             <widget class="QCheckBox" name="checkBox">
+              <property name="text">
+               <string>Log spaced points</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="0">
+             <widget class="QLabel" name="label_11">
+              <property name="text">
+               <string>Npts(Fit)</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="1">
+             <widget class="QLineEdit" name="lineEdit_4"/>
+            </item>
+            <item row="2" column="0">
+             <widget class="QLabel" name="label_12">
+              <property name="text">
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ï&lt;span style=&quot; vertical-align:super;&quot;&gt;2&lt;/span&gt;/Npts&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+             </widget>
+            </item>
+            <item row="2" column="1">
+             <widget class="QLineEdit" name="lineEdit_5"/>
+            </item>
+            <item row="2" column="3">
+             <widget class="QPushButton" name="pushButton_5">
+              <property name="text">
+               <string>Compute</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item row="2" column="0">
+        <widget class="QGroupBox" name="groupBox_5">
+         <property name="title">
+          <string>Weighting</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_12">
+          <item row="0" column="0">
+           <layout class="QVBoxLayout" name="verticalLayout">
+            <item>
+             <widget class="QRadioButton" name="radioButton">
+              <property name="text">
+               <string>None</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="radioButton_2">
+              <property name="text">
+               <string>Use dI Data</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="radioButton_3">
+              <property name="text">
+               <string>Use |sqrt(I Data)|</string>
+              </property>
+             </widget>
+            </item>
+            <item>
+             <widget class="QRadioButton" name="radioButton_4">
+              <property name="text">
+               <string>Use |I Data|</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+         </layout>
+        </widget>
+       </item>
+       <item row="3" column="0">
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>347</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_5">
+      <attribute name="title">
+       <string>Resolution</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_14">
+       <item row="0" column="0">
+        <widget class="QGroupBox" name="groupBox_4">
+         <property name="title">
+          <string>Instrumental Smearing</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_13">
+          <item row="0" column="0">
+           <widget class="QComboBox" name="comboBox_4">
+            <property name="currentIndex">
+             <number>2</number>
+            </property>
+            <item>
+             <property name="text">
+              <string>None</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>Use dQ Data</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>Custom Pinhole Smear</string>
+             </property>
+            </item>
+            <item>
+             <property name="text">
+              <string>Custom Slit Smear</string>
+             </property>
+            </item>
+           </widget>
+          </item>
+          <item row="0" column="1">
+           <layout class="QGridLayout" name="gridLayout_11">
+            <item row="0" column="0">
+             <widget class="QLabel" name="label_9">
+              <property name="text">
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;dQ&lt;span style=&quot; vertical-align:sub;&quot;&gt;low&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+             </widget>
+            </item>
+            <item row="0" column="1">
+             <widget class="QLineEdit" name="lineEdit_6"/>
+            </item>
+            <item row="0" column="2">
+             <widget class="QLabel" name="label_14">
+              <property name="text">
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
+&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="0">
+             <widget class="QLabel" name="label_13">
+              <property name="text">
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;dQ&lt;span style=&quot; vertical-align:sub;&quot;&gt;high&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+             </widget>
+            </item>
+            <item row="1" column="1">
+             <widget class="QLineEdit" name="lineEdit_7"/>
+            </item>
+            <item row="1" column="2">
+             <widget class="QLabel" name="label_15">
+              <property name="text">
+               <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Ã
+&lt;span style=&quot; vertical-align:super;&quot;&gt;-1&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
+              </property>
+             </widget>
+            </item>
+           </layout>
+          </item>
+          <item row="0" column="2">
+           <spacer name="horizontalSpacer_2">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>71</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+         </layout>
+         <zorder>comboBox_4</zorder>
+         <zorder>horizontalSpacer_2</zorder>
+        </widget>
+       </item>
+       <item row="1" column="0">
+        <spacer name="verticalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>340</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_4">
+      <attribute name="title">
+       <string>Polydispersity</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_10">
+       <item row="0" column="0">
+        <widget class="QGroupBox" name="groupBox_3">
+         <property name="title">
+          <string>Polydispersity and Orientational Distribution</string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_9">
+          <item row="0" column="0">
+           <widget class="QTableView" name="lstPoly"/>
+          </item>
+         </layout>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_6">
+      <attribute name="title">
+       <string>Magnetism</string>
+      </attribute>
+      <layout class="QGridLayout" name="gridLayout_22">
+       <item row="0" column="0">
+        <widget class="QGroupBox" name="groupBox_10">
+         <property name="title">
+          <string>Polarisation/Magnetic Scattering </string>
+         </property>
+         <layout class="QGridLayout" name="gridLayout_21">
+          <item row="1" column="1">
+           <spacer name="horizontalSpacer_6">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>498</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+          <item row="0" column="0" colspan="3">
+           <widget class="QTableView" name="lstMagnetic"/>
+          </item>
+          <item row="1" column="2">
+           <widget class="QPushButton" name="cmdMagneticDisplay">
+            <property name="text">
+             <string>Display
+magnetic
+angles</string>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+   <item row="2" column="1" colspan="2">
+    <spacer name="horizontalSpacer">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>273</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="2" column="3">
+    <widget class="QPushButton" name="cmdPlot">
+     <property name="text">
+      <string>Show Plot</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="4">
+    <widget class="QPushButton" name="cmdFit">
+     <property name="text">
+      <string>Fit</string>
+     </property>
+    </widget>
+   </item>
+   <item row="2" column="5">
+    <widget class="QPushButton" name="cmdHelp">
+     <property name="text">
+      <string>Help</string>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
Index: src/sas/qtgui/Perspectives/Fitting/UI/convert_all.bat
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/UI/convert_all.bat	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
+++ src/sas/qtgui/Perspectives/Fitting/UI/convert_all.bat	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
@@ -0,0 +1,7 @@
+@echo off
+
+for %%f in (*.ui) do (
+  call pyuic4.bat %%f > %%~nf.py
+)
+
+
Index: src/sas/qtgui/Perspectives/Fitting/UI/convert_all.sh
===================================================================
--- src/sas/qtgui/Perspectives/Fitting/UI/convert_all.sh	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
+++ src/sas/qtgui/Perspectives/Fitting/UI/convert_all.sh	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
@@ -0,0 +1,6 @@
+# UI -> PY
+for filename in *.ui; do
+  pyuic4 $filename > "`basename "$filename" .ui`.py"
+done
+
+
Index: src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py
===================================================================
--- src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py	(revision f721030e66e61dc6279aa8e024da03b25f8e0d42)
+++ src/sas/qtgui/Perspectives/Invariant/InvariantDetails.py	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
@@ -5,12 +5,14 @@
 
 # local
-from UI.InvariantDetailsUI import Dialog
+from UI.InvariantDetailsUI import Ui_Dialog
 from InvariantUtils import WIDGETS
 
-class DetailsDialog(Dialog):
+class DetailsDialog(QtGui.QDialog, Ui_Dialog):
     """
     """
     def __init__(self, parent):
-        Dialog.__init__(self, parent)
+        super(DetailsDialog, self).__init__(parent)
+
+        self.setupUi(self)
 
         self.progressBar.setMinimum(0)
Index: src/sas/qtgui/Perspectives/Invariant/UI/InvariantDetailsUI.py
===================================================================
--- src/sas/qtgui/Perspectives/Invariant/UI/InvariantDetailsUI.py	(revision 488c49d59f65f588ab30dc9447de6dc0335177cc)
+++ src/sas/qtgui/Perspectives/Invariant/UI/InvariantDetailsUI.py	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
@@ -144,9 +144,2 @@
         self.lblWarning.setText(_translate("Dialog", "<html><head/><body><p>No Details on calculations available...</p></body></html>", None))
 
-
-class Dialog(QtGui.QDialog, Ui_Dialog):
-    def __init__(self, parent=None, f=QtCore.Qt.WindowFlags()):
-        QtGui.QDialog.__init__(self, parent, f)
-
-        self.setupUi(self)
-
Index: src/sas/qtgui/Perspectives/Invariant/UI/convert_all.bat
===================================================================
--- src/sas/qtgui/Perspectives/Invariant/UI/convert_all.bat	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
+++ src/sas/qtgui/Perspectives/Invariant/UI/convert_all.bat	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
@@ -0,0 +1,7 @@
+@echo off
+
+for %%f in (*.ui) do (
+  call pyuic4.bat %%f > %%~nf.py
+)
+
+
Index: src/sas/qtgui/Perspectives/Invariant/UI/convert_all.sh
===================================================================
--- src/sas/qtgui/Perspectives/Invariant/UI/convert_all.sh	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
+++ src/sas/qtgui/Perspectives/Invariant/UI/convert_all.sh	(revision 60af9286f3186d421a48ebaf7a9de349ecdf4a3d)
@@ -0,0 +1,6 @@
+# UI -> PY
+for filename in *.ui; do
+  pyuic4 $filename > "`basename "$filename" .ui`.py"
+done
+
+
