Index: calculatorview/src/sans/perspectives/calculator/model_editor.py
===================================================================
--- calculatorview/src/sans/perspectives/calculator/model_editor.py	(revision 8d0ec400a74778bcb25b846f765407672f53a75b)
+++ calculatorview/src/sans/perspectives/calculator/model_editor.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -785,5 +785,5 @@
             msg = "Successful!!!"
             msg += "  " + self._notes
-            msg += " Please look for it in the 'Customized Models' box."
+            msg += " Please look for it in the Customized Models."
             info = 'Info'
             color = 'blue'
Index: fittingview/src/sans/perspectives/fitting/basepage.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/basepage.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ fittingview/src/sans/perspectives/fitting/basepage.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -2,5 +2,4 @@
 Base Page for fitting
 """
-
 import sys
 import os
@@ -27,6 +26,4 @@
 from sans.perspectives.fitting.pagestate import PageState
 from sans.guiframe.CategoryInstaller import CategoryInstaller
-
-
 
 (PageInfoEvent, EVT_PAGE_INFO) = wx.lib.newevent.NewEvent()
@@ -137,6 +134,4 @@
         self.sld_axes = None
         self.multi_factor = None
-        self.model_name = None
-        self.model_dict = {}
        
         self.disp_cb_dict = {}
@@ -155,4 +150,5 @@
         self.formfactorbox = None
         self.structurebox = None
+        self.categorybox = None
         ##list of model parameters. each item must have same length
         ## each item related to a given parameters
@@ -170,8 +166,4 @@
         self.disp_list = []
         self.disp_name = ""
-
-        ## category stuff
-        self.category_box = None
-        self.model_box = None
         
         ## list of orientation parameters
@@ -226,6 +218,4 @@
         ## layout
         self.set_layout()
-
-
     
     def set_index_model(self, index):
@@ -474,5 +464,5 @@
         self.model_list_box = page_info.model_list_box
         ## Data member to store the dispersion object created
-
+        self.populate_box(dict=self.model_list_box)
         
     def onContextMenu(self, event):
@@ -577,5 +567,5 @@
         self.state.manager = manager
         
-    def populate_box(self, m_dict):
+    def populate_box(self, dict):
         """
         Store list of model
@@ -584,7 +574,7 @@
         
         """
-        self.model_list_box = m_dict
-        # self.state.model_list_box = self.model_list_box
-        # self.initialize_combox()
+        self.model_list_box = dict
+        self.state.model_list_box = self.model_list_box
+        self.initialize_combox()
         
     def set_model_dictionary(self, model_dict):
@@ -603,4 +593,7 @@
         if self.model_list_box is None:
             return
+        if len(self.model_list_box) > 0:
+            self._populate_box(self.formfactorbox,
+                               self.model_list_box["Shapes"])
        
         if len(self.model_list_box) > 0:
@@ -901,16 +894,19 @@
                         self.state.structurecombobox = self.structurebox.\
                         GetString(s_select)
-            # if self.formfactorbox != None:
-            #     f_select = self.formfactorbox.GetSelection()
-            #     if f_select > 0:
-            self.state.formfactorcombobox = \
-                self.model_box.GetStringSelection()
-                        
+            if self.formfactorbox != None:
+                f_select = self.formfactorbox.GetSelection()
+                if f_select > 0:
+                        self.state.formfactorcombobox = self.formfactorbox.\
+                        GetString(f_select)
+        if self.categorybox != None:
+                cb_select = self.categorybox.GetSelection()
+                if cb_select > 0:
+                        self.state.categorycombobox = self.categorybox.\
+                        GetString(cb_select)                
         #save radiobutton state for model selection
-        # ILL
-        # self.state.shape_rbutton = self.shape_rbutton.GetValue()
-        # self.state.shape_indep_rbutton = self.shape_indep_rbutton.GetValue()
-        # self.state.struct_rbutton = self.struct_rbutton.GetValue()
-        # self.state.plugin_rbutton = self.plugin_rbutton.GetValue()
+        #self.state.shape_rbutton = self.shape_rbutton.GetValue()
+        #self.state.shape_indep_rbutton = self.shape_indep_rbutton.GetValue()
+        #self.state.struct_rbutton = self.struct_rbutton.GetValue()
+        #self.state.plugin_rbutton = self.plugin_rbutton.GetValue()
         
         self.state.enable2D = copy.deepcopy(self.enable2D)
@@ -1061,17 +1057,38 @@
         self.disp_list = state.disp_list
       
+        ## set the state of the radio box
+        #self.shape_rbutton.SetValue(state.shape_rbutton)
+        #self.shape_indep_rbutton.SetValue(state.shape_indep_rbutton)
+        #self.struct_rbutton.SetValue(state.struct_rbutton)
+        #self.plugin_rbutton.SetValue(state.plugin_rbutton)
+        
+        ## fill model combobox
         self._show_combox_helper()
-
-        # select the model in the gui
-        self._regenerate_model_dict()
-        if(len(self.by_model_dict[state.formfactorcombobox]) == 0):
-            self.category_box.SetStringSelection('Uncategorized')
-            self.model_box.SetStringSelection(state.formfactorcombobox)
-        else:
-            self.category_box.SetStringSelection(\
-                self.by_model_dict[state.formfactorcombobox][0] )
-            self.model_box.SetStringSelection(state.formfactorcombobox)
-        
-
+        #select the current model
+        try:
+            # to support older version
+            category_pos = int(state.categorycombobox)
+        except:
+            category_pos = 0
+            for ind_cat in range(self.categorybox.GetCount()):
+                if self.categorycombobox.GetString(ind_form) == \
+                                        state.categorycombobox:
+                    category_pos = int(ind_cat)
+                    break
+            
+        self.categorybox.Select(category_pos)
+        try:
+            # to support older version
+            formfactor_pos = int(state.formfactorcombobox)
+        except:
+            formfactor_pos = 0
+            for ind_form in range(self.formfactorbox.GetCount()):
+                if self.formfactorbox.GetString(ind_form) == \
+                                        state.formfactorcombobox:
+                    formfactor_pos = int(ind_form)
+                    break
+            
+        self.formfactorbox.Select(formfactor_pos)
+        
         try:
             # to support older version
@@ -1118,6 +1135,5 @@
                                                     state.disp_cb_dict[item])
                         # Create the dispersion objects
-                        from sans.models.dispersion_models \
-                            import ArrayDispersion
+                        from sans.models.dispersion_models import ArrayDispersion
                         disp_model = ArrayDispersion()
                         if hasattr(state, "values") and \
@@ -1218,19 +1234,39 @@
         self.disp_list = state.disp_list
       
+        ## set the state of the radio box
+        #self.shape_rbutton.SetValue(state.shape_rbutton)
+        #self.shape_indep_rbutton.SetValue(state.shape_indep_rbutton)
+        #self.struct_rbutton.SetValue(state.struct_rbutton)
+        #self.plugin_rbutton.SetValue(state.plugin_rbutton)
         
         ## fill model combobox
         self._show_combox_helper()
         #select the current model
-
-
-        self._regenerate_model_dict()
-        if(len(self.by_model_dict[state.formfactorcombobox]) == 0):
-            self.category_box.SetStringSelection('Uncategorized')
-            self.model_box.SetStringSelection(state.formfactorcombobox)
-        else:
-            self.category_box.SetStringSelection(\
-                self.by_model_dict[state.formfactorcombobox][0] )
-            self.model_box.SetStringSelection(state.formfactorcombobox)
-
+        try:
+            # to support older version
+            category_pos = int(state.categorycombobox)
+        except:
+            category_pos = 0
+            for ind_cat in range(self.categorybox.GetCount()):
+                if self.categorybox.GetString(ind_cat) == \
+                                        state.categorycombobox:
+                    category_pos = int(ind_cat)
+                    break
+            
+        self.categorybox.Select(category_pos)
+        self._show_combox(None)
+        try:
+            # to support older version
+            formfactor_pos = int(state.formfactorcombobox)
+        except:
+            formfactor_pos = 0
+            for ind_form in range(self.formfactorbox.GetCount()):
+                if self.formfactorbox.GetString(ind_form) == \
+                                                    (state.formfactorcombobox):
+                    formfactor_pos = int(ind_form)
+                    break
+            
+        self.formfactorbox.Select(formfactor_pos)
+        
         try:
             # to support older version
@@ -1432,10 +1468,11 @@
         save radiobutton containing the type model that can be selected
         """
-        # self.state.shape_rbutton = self.shape_rbutton.GetValue()
-        # self.state.shape_indep_rbutton = self.shape_indep_rbutton.GetValue()
-        # self.state.struct_rbutton = self.struct_rbutton.GetValue()
-        # self.state.plugin_rbutton = self.plugin_rbutton.GetValue()
+        #self.state.shape_rbutton = self.shape_rbutton.GetValue()
+        #self.state.shape_indep_rbutton = self.shape_indep_rbutton.GetValue()
+        #self.state.struct_rbutton = self.struct_rbutton.GetValue()
+        #self.state.plugin_rbutton = self.plugin_rbutton.GetValue()
         self.state.structurecombobox = self.structurebox.GetLabel()
-        self.state.formfactorcombobox = self.model_box.GetStringSelection()
+        self.state.formfactorcombobox = self.formfactorbox.GetLabel()
+        self.state.categorycombobox = self.categorybox.GetLabel()
        
         ## post state to fit panel
@@ -1772,45 +1809,45 @@
             class_name = model.p_model.__class__
             name = model.p_model.name
-#            self.formfactorbox.Clear()
+            self.formfactorbox.Clear()
             
             for k, list in self.model_list_box.iteritems():
                 if k in["P(Q)*S(Q)", "Shapes"] and \
                     class_name in self.model_list_box["Shapes"]:
-#                    self.shape_rbutton.SetValue(True)
+                    self.shape_rbutton.SetValue(True)
                     ## fill the form factor list with new model
-                    # self._populate_box(self.formfactorbox,
-                    #                    self.model_list_box["Shapes"])
-                    # items = self.formfactorbox.GetItems()
-                    # ## set comboxbox to the selected item
-                    # for i in range(len(items)):
-                    #     if items[i] == str(name):
-                    #         self.formfactorbox.SetSelection(i)
-                    #         break
+                    self._populate_box(self.formfactorbox,
+                                       self.model_list_box["Shapes"])
+                    items = self.formfactorbox.GetItems()
+                    ## set comboxbox to the selected item
+                    for i in range(len(items)):
+                        if items[i] == str(name):
+                            self.formfactorbox.SetSelection(i)
+                            break
                     return
-                # elif k == "Shape-Independent":
-                #     self.shape_indep_rbutton.SetValue(True)
-                # elif k == "Structure Factors":
-                #     self.struct_rbutton.SetValue(True)
-                # elif k == "Multi-Functions":
-                #     continue
-                # else:
-                #     self.plugin_rbutton.SetValue(True)
+                elif k == "Shape-Independent":
+                    self.shape_indep_rbutton.SetValue(True)
+                elif k == "Structure Factors":
+                    self.struct_rbutton.SetValue(True)
+                elif k == "Multi-Functions":
+                    continue
+                else:
+                    self.plugin_rbutton.SetValue(True)
                
-                # if class_name in list:
-                #     # ## fill the form factor list with new model
-                #     # self._populate_box(self.formfactorbox, list)
-                #     # items = self.formfactorbox.GetItems()
-                #     # ## set comboxbox to the selected item
-                #     # for i in range(len(items)):
-                #     #     if items[i] == str(name):
-                #     #         self.formfactorbox.SetSelection(i)
-                #     #         break
-                #     # break
-                #     else:
+                if class_name in list:
+                    ## fill the form factor list with new model
+                    self._populate_box(self.formfactorbox, list)
+                    items = self.formfactorbox.GetItems()
+                    ## set comboxbox to the selected item
+                    for i in range(len(items)):
+                        if items[i] == str(name):
+                            self.formfactorbox.SetSelection(i)
+                            break
+                    break
+        else:
             ## Select the model from the menu
             class_name = model.__class__
             name = model.name
-##            self.formfactorbox.Clear()
-#            items = self.formfactorbox.GetItems()
+            self.formfactorbox.Clear()
+            items = self.formfactorbox.GetItems()
     
             for k, list in self.model_list_box.iteritems():
@@ -1830,23 +1867,23 @@
                         self.text2.Disable()
                         
-#                    self.shape_rbutton.SetValue(True)
+                    self.shape_rbutton.SetValue(True)
                     ## fill the form factor list with new model
-                    # self._populate_box(self.formfactorbox,
-                    #                    self.model_list_box["Shapes"])
-                    # items = self.formfactorbox.GetItems()
-                    # ## set comboxbox to the selected item
-                    # for i in range(len(items)):
-                    #     if items[i] == str(name):
-                    #         self.formfactorbox.SetSelection(i)
-                    #         break
+                    self._populate_box(self.formfactorbox,
+                                       self.model_list_box["Shapes"])
+                    items = self.formfactorbox.GetItems()
+                    ## set comboxbox to the selected item
+                    for i in range(len(items)):
+                        if items[i] == str(name):
+                            self.formfactorbox.SetSelection(i)
+                            break
                     return
-                # elif k == "Shape-Independent":
-                #     self.shape_indep_rbutton.SetValue(True)
-                # elif k == "Structure Factors":
-                #     self.struct_rbutton.SetValue(True)
-                # elif k == "Multi-Functions":
-                #     continue
-                # else:
-                #     self.plugin_rbutton.SetValue(True)
+                elif k == "Shape-Independent":
+                    self.shape_indep_rbutton.SetValue(True)
+                elif k == "Structure Factors":
+                    self.struct_rbutton.SetValue(True)
+                elif k == "Multi-Functions":
+                    continue
+                else:
+                    self.plugin_rbutton.SetValue(True)
                 if class_name in list:
                     self.structurebox.SetSelection(0)
@@ -1854,11 +1891,11 @@
                     self.text2.Disable()
                     ## fill the form factor list with new model
-                    # self._populate_box(self.formfactorbox, list)
-                    # items = self.formfactorbox.GetItems()
+                    self._populate_box(self.formfactorbox, list)
+                    items = self.formfactorbox.GetItems()
                     ## set comboxbox to the selected item
-                    # for i in range(len(items)):
-                    #     if items[i] == str(name):
-                    #         self.formfactorbox.SetSelection(i)
-                    #         break
+                    for i in range(len(items)):
+                        if items[i] == str(name):
+                            self.formfactorbox.SetSelection(i)
+                            break
                     break
                 
@@ -1953,36 +1990,42 @@
         if self.multifactorbox.IsShown():
             self.multifactorbox.Hide()
-
+    
+    def formfactor_combo_init(self):
+        """
+        First time calls _show_combox_helper
+        """
+        self._show_combox(None)
+                
     def _show_combox_helper(self):
         """
         Fill panel's combo box according to the type of model selected
         """
-#         if self.shape_rbutton.GetValue():
-#             ##fill the combobox with form factor list
-#             self.structurebox.SetSelection(0)
-#             self.structurebox.Disable()
-#             # self.formfactorbox.Clear()
-#             # self._populate_box(self.formfactorbox,
-#             #                    self.model_list_box["Shapes"])
-#         if self.shape_indep_rbutton.GetValue():
-#             ##fill the combobox with shape independent  factor list
-#             self.structurebox.SetSelection(0)
-#             self.structurebox.Disable()
-# #            self.formfactorbox.Clear()
-#             self._populate_box(self.formfactorbox,
-#                              self.model_list_box["Shape-Independent"])
-#         if self.struct_rbutton.GetValue():
-#             ##fill the combobox with structure factor list
-#             self.structurebox.SetSelection(0)
-#             self.structurebox.Disable()
-#  #           self.formfactorbox.Clear()
-#             self._populate_box(self.formfactorbox,
-#                                self.model_list_box["Structure Factors"])
-#         if self.plugin_rbutton.GetValue():
-#             ##fill the combobox with form factor list
-#             self.structurebox.Disable()
-#   #          self.formfactorbox.Clear()
-#             self._populate_box(self.formfactorbox,
-#                                self.model_list_box["Customized Models"])
+        custom_model = 'Customized Models'
+        mod_cat = self.categorybox.GetStringSelection()
+        self.structurebox.SetSelection(0)
+        self.structurebox.Disable()
+        self.formfactorbox.Clear()
+        if mod_cat == None:
+            return
+        m_list = []
+        try:
+            if mod_cat == custom_model:
+                for model in self.model_list_box[mod_cat]:
+                    str_m = str(model).split(".")[0]
+                    #self.model_box.Append(str_m)
+                    m_list.append(self.model_dict[str_m])
+            else:
+                for (model, enabled) in self.master_category_dict[mod_cat]:
+                    if enabled:
+                        m_list.append(self.model_dict[model])
+                    else:
+                        msg = "This model is diabled by Category Manager." 
+                        wx.PostEvent(self.parent.parent,
+                                     StatusEvent(status=msg, info="error"))
+        except:
+            msg = "%s\n" % (sys.exc_value)
+            wx.PostEvent(self.parent.parent,
+                         StatusEvent(status=msg, info="error"))
+        self._populate_box(self.formfactorbox, m_list)
         
     def _show_combox(self, event=None):
@@ -2000,5 +2043,5 @@
         self.Refresh()
   
-    def _populate_box(self, combobox, model_list):
+    def _populate_box(self, combobox, list):
         """
         fill combox box with dict item
@@ -2008,5 +2051,5 @@
         """
         mlist = []
-        for models in model_list:
+        for models in list:
             model = models()
             name = model.__class__.__name__
@@ -2139,12 +2182,12 @@
         """
         ## reset dictionary containing reference to dispersion
-        if self.model_name == None:
-            return
-
         self._disp_obj_dict = {}
         self.disp_cb_dict = {}
         self.temp_multi_functional = False
-
-        form_factor = self.model_dict[self.model_name]
+        f_id = self.formfactorbox.GetCurrentSelection()
+        #For MAC
+        form_factor = None
+        if f_id >= 0:
+            form_factor = self.formfactorbox.GetClientData(f_id)
 
         if not form_factor in  self.model_list_box["multiplication"]:
@@ -2160,6 +2203,4 @@
             self.text2.Enable()
             
-
-
         if form_factor != None:
             # set multifactor for Mutifunctional models
@@ -2339,8 +2380,8 @@
         return flag
     
-    def _check_value_enter(self, m_list, modified):
-        """
-        :param m_list: model parameter and panel info
-        :Note: each item of the m_list should be as follow:
+    def _check_value_enter(self, list, modified):
+        """
+        :param list: model parameter and panel info
+        :Note: each item of the list should be as follow:
             item=[check button state, parameter's name,
                 paramater's value, string="+/-",
@@ -2351,7 +2392,7 @@
         """
         is_modified = modified
-        if len(m_list) == 0:
+        if len(list) == 0:
             return is_modified
-        for item in m_list:
+        for item in list:
             #skip angle parameters for 1D
             if not self.enable2D:
@@ -2903,23 +2944,24 @@
         if self.model == None:
             name = 'FuncHelp'
-
+        else:
+            name = self.formfactorbox.GetValue()
         frame = HelpWindow(None, -1, pageToOpen=model_path)
-        # If model name exists and model is not a custom model
-        # if frame.rhelp.HasAnchor(name) and not self.plugin_rbutton.GetValue():
-        #     frame.Show(True)
-        #     frame.rhelp.ScrollToAnchor(name)
-        # else:
-        #     if self.model != None:
-        #         frame.Destroy()
-        #         msg = 'Model description:\n'
-        #         if str(self.model.description).rstrip().lstrip() == '':
-        #             msg += "Sorry, no information is available for this model."
-        #         else:
-        #             msg += self.model.description + '\n'
-        #         info = "Info"
-        #         wx.MessageBox(msg, info)
-        #     else:
-        #         frame.Show(True)
-    
+        if frame.rhelp.HasAnchor(name):
+            frame.Show(True)
+            frame.rhelp.ScrollToAnchor(name)
+        else:
+            if self.model != None:
+                frame.Destroy()
+                msg = 'Model description:\n'
+                if str(self.model.description).rstrip().lstrip() == '':
+                    msg += "Sorry, no information is available for this model."
+                else:
+                    msg += self.model.description + '\n'
+                info = "Info"
+                wx.MessageBox(msg, info)
+            else:
+                frame.Show(True)
+
+            
     def on_pd_help_clicked(self, event):
         """
@@ -3297,4 +3339,7 @@
         return
 
+
+
+
     def _read_category_info(self):
         """
@@ -3307,8 +3352,8 @@
         self.model_enabled_dict = defaultdict(bool)
 
-        categorization_file = CategoryInstaller.get_user_file()
-
-
         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')
                             
@@ -3317,4 +3362,5 @@
 
         except IOError:
+            raise
             print 'Problem reading in category file.'
             print 'We even looked for it, made sure it was there.'
@@ -3330,5 +3376,5 @@
         self.by_model_dict = defaultdict(list)
         for category in self.master_category_dict:
-            for (model,enabled) in self.master_category_dict[category]:
+            for (model, enabled) in self.master_category_dict[category]:
                 self.by_model_dict[model].append(category)
                 self.model_enabled_dict[model] = enabled
@@ -3338,21 +3384,23 @@
         fills out the category list box
         """
+        uncat_str = 'Customized Models'
         self._read_category_info()
 
-        self.category_box.Clear()
+        self.categorybox.Clear()
         cat_list = sorted(self.master_category_dict.keys())
-        cat_list.append('Customized')
-
+        if not uncat_str in cat_list:
+            cat_list.append(uncat_str)
+        
         for category in cat_list:
             if category != '':
-                self.category_box.Append(category)
-
-        if self.category_box.GetSelection() == wx.NOT_FOUND:
-            self.category_box.SetSelection(0)
+                self.categorybox.Append(category)
+
+        if self.categorybox.GetSelection() == wx.NOT_FOUND:
+            self.categorybox.SetSelection(0)
         else:
-            self.category_box.SetSelection( \
-                self.category_box.GetSelection())
-
-        self._on_change_cat(None)
+            self.categorybox.SetSelection( \
+                self.categorybox.GetSelection())
+
+        #self._on_change_cat(None)
 
 
@@ -3362,11 +3410,11 @@
         """
         self.model_name = None
-        category = self.category_box.GetStringSelection()
+        category = self.categorybox.GetStringSelection()
         if category == None:
             return
         self.model_box.Clear()
 
-        if category == 'Customized':
-            for model in self.model_list_box["Customized Models"]:
+        if category == 'Customized Models':
+            for model in self.model_list_box[category]:
                 str_m = str(model).split(".")[0]
                 self.model_box.Append(str_m)
@@ -3379,9 +3427,11 @@
                     self.model_box.Append(model)
 
+
+
+
     def _fill_model_sizer(self, sizer):
         """
         fill sizer containing model info
         """
-
         ##Add model function Details button in fitpanel.
         ##The following 3 lines are for Mac. Let JHC know before modifying...
@@ -3391,4 +3441,5 @@
         self.mbox_description = wx.StaticBox(self, -1, str(title))
         boxsizer1 = wx.StaticBoxSizer(self.mbox_description, wx.VERTICAL)
+        sizer_cat = wx.BoxSizer(wx.HORIZONTAL)
         self.mbox_description.SetForegroundColour(wx.RED)
         id = wx.NewId()
@@ -3401,43 +3452,47 @@
         hint = "toggle view of model from 1D to 2D  or 2D to 1D"
         self.model_view.SetToolTipString(hint)
-
-        
-        # ILL mod starts here - Aug 2012
-
-
-        cat_text = wx.StaticText(self, -1, 'Category')
-        mod_text = wx.StaticText(self, -1, 'Model')
-        
-        id = wx.NewId()
-        self.category_box = wx.ListBox(self, size=(150, 100))
-        self.category_box.Bind(wx.EVT_LISTBOX, self._on_change_cat)
-        self.model_box = wx.ListBox(self, -1, size=(150, 100))
-        self.model_box.Bind(wx.EVT_LISTBOX, self._on_select_model)
-
-        sizer_radiobutton = wx.GridSizer(2, 3, 5, 5)
-        hbox1 = wx.BoxSizer(wx.HORIZONTAL)
-        hbox2 = wx.BoxSizer(wx.HORIZONTAL)
-        vbox1 = wx.BoxSizer(wx.VERTICAL)
-        vbox2 = wx.BoxSizer(wx.VERTICAL)
-        vbox3 = wx.BoxSizer(wx.VERTICAL)
-
-        vbox1.Add(cat_text, border = 5, flag = wx.EXPAND | wx.ALL)
-        vbox2.Add(mod_text, border=5, flag = wx.EXPAND | wx.ALL)
-        vbox3.Add(self.model_view, flag= wx.ALL | wx.ALIGN_LEFT
-                  , border =5)
-        vbox1.Add(self.category_box, border = 5, flag = wx.EXPAND | wx.ALL)
-        vbox2.Add(self.model_box, flag = wx.EXPAND | wx.ALL, border = 5)
-        vbox3.Add(self.model_help, border = 5, 
-                  flag = wx.LEFT | wx.ALIGN_LEFT )
-
-        hbox1.Add(vbox1, border = 5, flag = wx.EXPAND | wx.ALL)
-        hbox1.Add(vbox2, border = 5, flag = wx.EXPAND | wx.ALL)
-        hbox1.Add(vbox3, border = 5, flag = wx.EXPAND | wx.ALL)
-
+        
+        cat_set_box = wx.StaticBox(self, -1, 'Category')
+        sizer_cat_box = wx.StaticBoxSizer(cat_set_box, wx.HORIZONTAL)
+        sizer_cat_box.SetMinSize((200, 50))
+        self.categorybox = wx.ComboBox(self, -1, style=wx.CB_READONLY)
+        self._populate_listbox()
+        wx.EVT_COMBOBOX(self.categorybox, -1, self._show_combox)
+        #self.shape_rbutton = wx.RadioButton(self, -1, 'Shapes',
+        #                                     style=wx.RB_GROUP)
+        #self.shape_indep_rbutton = wx.RadioButton(self, -1,
+        #                                          "Shape-Independent")
+        #self.struct_rbutton = wx.RadioButton(self, -1, "Structure Factor ")
+        #self.plugin_rbutton = wx.RadioButton(self, -1, "Uncategorized")
+                
+        #self.Bind(wx.EVT_RADIOBUTTON, self._show_combox,
+        #                   id=self.shape_rbutton.GetId())
+        #self.Bind(wx.EVT_RADIOBUTTON, self._show_combox,
+        #                    id=self.shape_indep_rbutton.GetId())
+        #self.Bind(wx.EVT_RADIOBUTTON, self._show_combox,
+        #                    id=self.struct_rbutton.GetId())
+        #self.Bind(wx.EVT_RADIOBUTTON, self._show_combox,
+        #                    id=self.plugin_rbutton.GetId())
+        #MAC needs SetValue
+        sizer_cat_box.Add(self.categorybox, 1, wx.LEFT|wx.RIGHT|wx.EXPAND, 2.5)
+        #self.shape_rbutton.SetValue(True)
+      
+        sizer_radiobutton = wx.GridSizer(2, 2, 5, 5)
+
+        #sizer_radiobutton.Add(self.shape_rbutton)
+        #sizer_radiobutton.Add(self.shape_indep_rbutton)
+        sizer_radiobutton.Add((5,5))
+        sizer_radiobutton.Add(self.model_view, 1, wx.RIGHT, 15)
+        #sizer_radiobutton.Add(self.plugin_rbutton)
+        #sizer_radiobutton.Add(self.struct_rbutton)
+        sizer_radiobutton.Add((5,5))
+        sizer_radiobutton.Add(self.model_help, 1, wx.RIGHT, 15)
+        sizer_cat.Add(sizer_cat_box, 1, wx.LEFT, 2.5)
+        sizer_cat.Add(sizer_radiobutton)
         sizer_selection = wx.BoxSizer(wx.HORIZONTAL)
         mutifactor_selection = wx.BoxSizer(wx.HORIZONTAL)
         
         self.text1 = wx.StaticText(self, -1, "")
-        self.text2 = wx.StaticText(self, -1, "P(Q)*S(Q) ")
+        self.text2 = wx.StaticText(self, -1, "P(Q)*S(Q)")
         self.mutifactor_text = wx.StaticText(self, -1, "No. of Shells: ")
         self.mutifactor_text1 = wx.StaticText(self, -1, "")
@@ -3445,23 +3500,28 @@
         self.show_sld_button.Bind(wx.EVT_BUTTON, self._on_show_sld)
 
+        self.formfactorbox = wx.ComboBox(self, -1, style=wx.CB_READONLY)
+        if self.model != None:
+            self.formfactorbox.SetValue(self.model.name)
         self.structurebox = wx.ComboBox(self, -1, style=wx.CB_READONLY)
         self.multifactorbox = wx.ComboBox(self, -1, style=wx.CB_READONLY)
         self.initialize_combox()
+        wx.EVT_COMBOBOX(self.formfactorbox, -1, self._on_select_model)
 
         wx.EVT_COMBOBOX(self.structurebox, -1, self._on_select_model)
         wx.EVT_COMBOBOX(self.multifactorbox, -1, self._on_select_model)
         ## check model type to show sizer
-
-        hbox2.Add(self.text2, border = 5, flag = wx.EXPAND | wx.ALL )
-        hbox2.Add(self.structurebox, border = 5, flag = wx.EXPAND | \
-                      wx.ALL )
-        
         if self.model != None:
-            self._set_model_sizer_selection(self.model)
-        
-        self._populate_listbox()
-        
+            print "_set_model_sizer_selection: disabled."
+            #self._set_model_sizer_selection(self.model)
+        
+        sizer_selection.Add(self.text1)
+        sizer_selection.Add((10, 5))
+        sizer_selection.Add(self.formfactorbox)
+        sizer_selection.Add((5, 5))
+        sizer_selection.Add(self.text2)
+        sizer_selection.Add((5, 5))
+        sizer_selection.Add(self.structurebox)
        
-        mutifactor_selection.Add((10, 5))
+        mutifactor_selection.Add((13, 5))
         mutifactor_selection.Add(self.mutifactor_text)
         mutifactor_selection.Add(self.multifactorbox)
@@ -3471,8 +3531,8 @@
         mutifactor_selection.Add(self.show_sld_button)
 
-        boxsizer1.Add(hbox1, flag = wx.EXPAND)
-        boxsizer1.Add(hbox2, flag = wx.EXPAND)
+        boxsizer1.Add(sizer_cat)
         boxsizer1.Add((10, 10))
-
+        boxsizer1.Add(sizer_selection)
+        boxsizer1.Add((10, 10))
         boxsizer1.Add(mutifactor_selection)
         
Index: fittingview/src/sans/perspectives/fitting/fitpage.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/fitpage.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ fittingview/src/sans/perspectives/fitting/fitpage.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -36,11 +36,10 @@
     """
 
-    def __init__(self, parent, m_dict, color='rand'):
+    def __init__(self, parent, color='rand'):
         """
         Initialization of the Panel
         """
         BasicPage.__init__(self, parent, color=color)
-        self.populate_box(m_dict)
-
+        
         ## draw sizer
         self._fill_data_sizer()
@@ -68,5 +67,5 @@
         #create a default data for an empty panel
         self.create_default_data()
-
+    
     def enable_fit_button(self):
         """
@@ -1088,22 +1087,15 @@
         call back for model selection
         """
-        # if we're just clearing the box then do nothing
-        if self.model_box.GetCount() == 0 or \
-                self.model_box.GetStringSelection() == '':
-            return
-
-
         self.Show(False)
         copy_flag = False
         is_poly_enabled = None
         if event != None:
-            # if (event.GetEventObject() == self.formfactorbox\
-            #             and self.structurebox.GetLabel() != 'None')\
-            #             or event.GetEventObject() == self.structurebox\
-            #             or event.GetEventObject() == self.multifactorbox:
-            copy_flag = self.get_copy_params()
-            is_poly_enabled = self.enable_disp.GetValue()
-
-        self.model_name = self.model_box.GetStringSelection()
+            if (event.GetEventObject() == self.formfactorbox\
+                        and self.structurebox.GetLabel() != 'None')\
+                        or event.GetEventObject() == self.structurebox\
+                        or event.GetEventObject() == self.multifactorbox:
+                copy_flag = self.get_copy_params()
+                is_poly_enabled = self.enable_disp.GetValue()
+
         self._on_select_model_helper()
         self.set_model_param_sizer(self.model)
@@ -1124,5 +1116,5 @@
     
         self.state.structurecombobox = self.structurebox.GetLabel()
-        self.state.formfactorcombobox = self.model_box.GetStringSelection()
+        self.state.formfactorcombobox = self.formfactorbox.GetLabel()
         self.enable_fit_button()
         if self.model != None:
@@ -1183,13 +1175,15 @@
             wx.PostEvent(self.parent, new_event)
             #update list of plugins if new plugin is available
-            # if self.plugin_rbutton.GetValue():
-            #     temp = self.parent.update_model_list()
-            #     if temp:
-            #         self.model_list_box = temp
-                    # current_val = self.formfactorbox.GetLabel()
-                    # pos = self.formfactorbox.GetSelection()
-                    # self._show_combox_helper()
-                    # self.formfactorbox.SetSelection(pos)
-                    # self.formfactorbox.SetValue(current_val)
+            custom_model = 'Customized Models'
+            mod_cat = self.categorybox.GetStringSelection()
+            if mod_cat == custom_model:
+                temp = self.parent.update_model_list()
+                if temp:
+                    self.model_list_box = temp
+                    current_val = self.formfactorbox.GetLabel()
+                    pos = self.formfactorbox.GetSelection()
+                    self._show_combox_helper()
+                    self.formfactorbox.SetSelection(pos)
+                    self.formfactorbox.SetValue(current_val)
             # when select a model only from guictr/button
             if is_poly_enabled != None:
@@ -1822,5 +1816,5 @@
             self.dI_idata.Enable(True)
               
-#            self.formfactorbox.Enable()
+            self.formfactorbox.Enable()
             self.structurebox.Enable()
             data_name = self.data.name
Index: fittingview/src/sans/perspectives/fitting/fitpanel.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/fitpanel.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ fittingview/src/sans/perspectives/fitting/fitpanel.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -48,6 +48,6 @@
         self.menu_mng = models.ModelManager()
         self.model_list_box = self.menu_mng.get_model_list()
+        #pageClosedEvent = nb.EVT_FLATNOTEBOOK_PAGE_CLOSING
         self.model_dictionary = self.menu_mng.get_model_dictionary()
-        #pageClosedEvent = nb.EVT_FLATNOTEBOOK_PAGE_CLOSING
         self.pageClosedEvent = wx.aui.EVT_AUINOTEBOOK_PAGE_CLOSE
         
@@ -305,5 +305,5 @@
                 page.set_manager(self._manager)
 
-    def set_model_list(self, m_dict):
+    def set_model_list(self, dict):
         """
         copy a dictionary of model into its own dictionary
@@ -312,5 +312,5 @@
         as value
         """
-        self.model_list_box = m_dict
+        self.model_list_box = dict
         
     def set_model_dict(self, m_dict):
@@ -368,8 +368,6 @@
         else:
         """
-
         from fitpage import FitPage
-        panel = FitPage(parent=self, m_dict = self.model_list_box)
-
+        panel = FitPage(parent=self)
         if self.batch_on:
             self.batch_page_index += 1
@@ -384,4 +382,6 @@
         panel._set_save_flag(not panel.batch_on)
         panel.set_model_dictionary(self.model_dictionary)
+        panel.populate_box(dict=self.model_list_box)
+        panel.formfactor_combo_init()
         panel.set_manager(self._manager)
         panel.window_caption = caption
Index: fittingview/src/sans/perspectives/fitting/fitting.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/fitting.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ fittingview/src/sans/perspectives/fitting/fitting.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -321,4 +321,5 @@
         Update custom model list in the fitpage combo box
         """
+        custom_model = 'Customized Models'
         try:
             # Update edit menus
@@ -332,5 +333,7 @@
                         page.model_list_box = temp
                         current_val = page.formfactorbox.GetLabel()
-                        if page.plugin_rbutton.GetValue():
+                        #if page.plugin_rbutton.GetValue():
+                        mod_cat = page.categorybox.GetStringSelection()
+                        if mod_cat == custom_model:
                             #pos = page.formfactorbox.GetSelection()
                             page._show_combox_helper()
Index: fittingview/src/sans/perspectives/fitting/models.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/models.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ fittingview/src/sans/perspectives/fitting/models.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -679,5 +679,7 @@
         self.stored_plugins = self.findModels()
         self.plugins = self.stored_plugins.values()
-
+        for name, plug in self.stored_plugins.iteritems():
+            self.model_dictionary[name] = plug
+            
         self._get_multifunc_models()
        
@@ -710,4 +712,5 @@
                     self.stored_plugins[name] = plug
                     self.plugins.append(plug)
+                    self.model_dictionary[name] = plug
             self.model_combobox.set_list("Customized Models", self.plugins)
             return self.model_combobox.get_list()
@@ -725,7 +728,9 @@
                 if name == stored_name:
                     del self.stored_plugins[name]
+                    del self.model_dictionary[name]
                     break
             self.stored_plugins[name] = plug
             self.plugins.append(plug)
+            self.model_dictionary[name] = plug
 
         self.model_combobox.reset_list("Customized Models", self.plugins)
Index: fittingview/src/sans/perspectives/fitting/pagestate.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/pagestate.py	(revision 7c720e99d53af8aacf128eb9a5332c89faced397)
+++ fittingview/src/sans/perspectives/fitting/pagestate.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -44,8 +44,9 @@
                       ["qmax", "qmax", "float"],
                       ["npts", "npts", "float"],
-                      ["shape_rbutton", "shape_rbutton", "bool"],
-                      ["shape_indep_rbutton", "shape_indep_rbutton", "bool"],
-                      ["plugin_rbutton", "plugin_rbutton", "bool"],
-                      ["struct_rbutton", "struct_rbutton", "bool"],
+                      #["shape_rbutton", "shape_rbutton", "bool"],
+                      #["shape_indep_rbutton", "shape_indep_rbutton", "bool"],
+                      #["plugin_rbutton", "plugin_rbutton", "bool"],
+                      #["struct_rbutton", "struct_rbutton", "bool"],
+                      ["categorycombobox", "categorycombobox", "string"],
                       ["formfactorcombobox", "formfactorcombobox", "string"],
                       ["structurecombobox", "structurecombobox", "string"],
@@ -224,11 +225,12 @@
         ## save selection of combobox
         self.formfactorcombobox = None
+        self.categorycombobox = None
         self.structurecombobox = None
 
         ## radio box to select type of model
-        self.shape_rbutton = False
-        self.shape_indep_rbutton = False
-        self.struct_rbutton = False
-        self.plugin_rbutton = False
+        #self.shape_rbutton = False
+        #self.shape_indep_rbutton = False
+        #self.struct_rbutton = False
+        #self.plugin_rbutton = False
         ## the indice of the current selection
         self.disp_box = 0
@@ -281,11 +283,12 @@
         obj.engine_type = copy.deepcopy(self.engine_type)
         
+        obj.categorycombobox = self.categorycombobox
         obj.formfactorcombobox = self.formfactorcombobox
         obj.structurecombobox = self.structurecombobox
         
-        obj.shape_rbutton = self.shape_rbutton
-        obj.shape_indep_rbutton = self.shape_indep_rbutton
-        obj.struct_rbutton = self.struct_rbutton
-        obj.plugin_rbutton = self.plugin_rbutton
+        #obj.shape_rbutton = self.shape_rbutton
+        #obj.shape_indep_rbutton = self.shape_indep_rbutton
+        #obj.struct_rbutton = self.struct_rbutton
+        #obj.plugin_rbutton = self.plugin_rbutton
         
         obj.manager = self.manager
@@ -380,9 +383,10 @@
         else:
             rep += "model name : None\n"
-        rep += "model type (form factor) selected: %s\n" % self.shape_rbutton 
+        #rep += "model type (form factor) selected: %s\n" % self.shape_rbutton 
         rep += "multi_factor : %s\n" % str(self.multi_factor)
-        rep += "model type (shape independent) selected: %s\n" % self.shape_indep_rbutton
-        rep += "model type (structure factor) selected: %s\n" % self.struct_rbutton
-        rep += "model type (plug-in ) selected: %s\n" % self.plugin_rbutton
+        rep += "model type (Category) selected: %s\n" % self.categorycombobox
+        #rep += "model type (shape independent) selected: %s\n" % self.shape_indep_rbutton
+        #rep += "model type (structure factor) selected: %s\n" % self.struct_rbutton
+        #rep += "model type (plug-in ) selected: %s\n" % self.plugin_rbutton
         rep += "data : %s\n" % str(self.data)
         rep += "Plotting Range: min: %s, max: %s, steps: %s\n" % (str(self.qmin),
Index: sansguiframe/src/sans/guiframe/CategoryInstaller.py
===================================================================
--- sansguiframe/src/sans/guiframe/CategoryInstaller.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ sansguiframe/src/sans/guiframe/CategoryInstaller.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -6,5 +6,5 @@
 
 @author kieranrcampbell@gmail.com
-
+@modified by NIST/MD sanview team
 """
 
@@ -14,5 +14,5 @@
 from collections import defaultdict
 
-user_file = 'serialized_cat.p'
+USER_FILE = 'serialized_cat.p'
 
 class CategoryInstaller:
@@ -47,6 +47,7 @@
         returns the dir where default_cat.p should be
         """
-        import sans.dataloader.readers
-        return sans.dataloader.readers.get_data_path()
+        from sans import sansview as sasview
+        app_path = os.path.dirname(sasview.__file__)
+        return app_path
 
     @staticmethod
@@ -55,6 +56,5 @@
         returns the users sansview config dir
         """
-        return os.path.join(os.path.expanduser("~"),
-                            ".sansview")
+        return os.path.join(os.path.expanduser("~"), ".sasview")
 
     @staticmethod
@@ -95,8 +95,8 @@
     def get_user_file():
         """
-        returns the user data file, eg .sansview/serialized_cat.p
+        returns the user data file, eg .sasview/serialized_cat.p
         """
         return os.path.join(CategoryInstaller._get_home_dir(),
-                            user_file)
+                            USER_FILE)
 
     @staticmethod
@@ -107,6 +107,5 @@
         """
         return os.path.join(\
-            CategoryInstaller._get_default_cat_p_dir, 
-            "default_categories.p")
+            CategoryInstaller._get_default_cat_p_dir(), "default_categories.p")
         
     @staticmethod
@@ -128,5 +127,5 @@
             serialized_file = CategoryInstaller.get_user_file()
         else:
-            serialized_file = os.path.join(homedir, user_file)
+            serialized_file = os.path.join(homedir, USER_FILE)
 
         if os.path.exists(serialized_file):
Index: sansguiframe/src/sans/guiframe/CategoryManager.py
===================================================================
--- sansguiframe/src/sans/guiframe/CategoryManager.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ sansguiframe/src/sans/guiframe/CategoryManager.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -16,4 +16,5 @@
 import wx
 import sys
+import os
 from wx.lib.mixins.listctrl import CheckListCtrlMixin, ListCtrlAutoWidthMixin
 from collections import defaultdict
@@ -290,6 +291,5 @@
         cat_file = open(CategoryInstaller.get_user_file(), 'wb')
 
-        pickle.dump( self.master_category_dict,
-                     cat_file )
+        pickle.dump( self.master_category_dict, cat_file )
 
    
@@ -299,8 +299,11 @@
         """
         try:
-            cat_file = open(CategoryInstaller.get_user_file(),
-                            'rb')
-            self.master_category_dict = pickle.load(cat_file)
-    
+    		file = CategoryInstaller.get_user_file()
+    		if os.path.isfile(file):
+	            cat_file = open(file, 'rb')
+	            self.master_category_dict = pickle.load(cat_file)
+	        else:
+	        	cat_file = open(CategoryInstaller.get_default_file(), 'rb')
+        		self.master_category_dict = pickle.load(cat_file)
         except IOError:
             print 'Problem reading in category file. Please review'
@@ -421,7 +424,7 @@
         vbox.Add(self.ok_button, flag = wx.ALL | wx.ALIGN_RIGHT, 
                  border = 10)
-
-
-        self.current_categories.SetSelection(0)
+        
+        if self.current_categories.GetCount() > 0:
+        	self.current_categories.SetSelection(0)
         self.new_text.Disable()
         self.SetSizer(vbox)
@@ -494,8 +497,4 @@
         return ret
 
-
-
-
-
 if __name__ == '__main__':
         
@@ -510,3 +509,2 @@
         app.MainLoop()
 
-
Index: sansguiframe/src/sans/guiframe/__init__.py
===================================================================
--- sansguiframe/src/sans/guiframe/__init__.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ sansguiframe/src/sans/guiframe/__init__.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -70,7 +70,4 @@
     for f in findall(path):
         data_files.append(('media/guiframe_media', [f]))
-    path = get_media_path(media="catdata")
-    for f in findall(path):
-        data_files.append(('.', [f]))
 
     return data_files
Index: sansguiframe/src/sans/guiframe/customdir.py
===================================================================
--- sansguiframe/src/sans/guiframe/customdir.py	(revision 94d6752c44d06be3ad3ef28a0f58b198efc95ba7)
+++ sansguiframe/src/sans/guiframe/customdir.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -3,7 +3,16 @@
 import os.path
 import shutil
+from sans.guiframe.CategoryInstaller import CategoryInstaller
 
 CONF_DIR = 'config' 
 APPLICATION_NAME = 'sasview'
+
+def _find_usersasview_dir():
+    """
+    Find and return user/.sasview dir
+    """
+    dir = os.path.join(os.path.expanduser("~"), 
+                       ("." + APPLICATION_NAME))
+    return dir
 
 def _find_customconf_dir():
@@ -12,6 +21,6 @@
     The plugin directory is located in the user's home directory.
     """
-    dir = os.path.join(os.path.expanduser("~"), 
-                       ("." + APPLICATION_NAME), CONF_DIR)
+    u_dir = _find_usersasview_dir()
+    dir = os.path.join(u_dir, CONF_DIR)
     
     return dir
@@ -19,5 +28,5 @@
 def _setup_conf_dir(path):
     """
-    Setup the custom config dir
+    Setup the custom config dir and cat file
     """
     dir = _find_customconf_dir()
@@ -26,4 +35,17 @@
         os.makedirs(dir)
     file = os.path.join(dir, "custom_config.py")
+    u_dir = _find_usersasview_dir()
+    cat_file = os.path.join(u_dir, "serialized_cat.p")
+    # Place example user models as needed
+    if not os.path.isfile(cat_file):
+        try:
+            default_cat_file = CategoryInstaller.get_default_file()
+            if os.path.isfile(default_cat_file):
+                shutil.copyfile(default_cat_file, cat_file)
+            else:
+                print "Unable to find/copy default cat file"
+        except:
+            print "Unable to copy default cat file to the user dir."
+
     # Place example user models as needed
     try:
Index: sansmodels/default_categories.p
===================================================================
--- sansmodels/default_categories.p	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ sansmodels/default_categories.p	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -6,290 +6,3 @@
 p2
 tRp3
-S'Uncategorized'
-p4
-(lp5
-(S'PearlNecklaceModel'
-p6
-I01
-tp7
-a(S'TwoPowerLawModel'
-p8
-I01
-tp9
-a(S'GelFitModel'
-p10
-I01
-tp11
-a(S'SquareWellStructure'
-p12
-I01
-tp13
-a(S'DABModel'
-p14
-I01
-tp15
-a(S'PowerLawAbsModel'
-p16
-I01
-tp17
-a(S'PorodModel'
-p18
-I01
-tp19
-a(S'GuinierModel'
-p20
-I01
-tp21
-a(S'CoreMultiShellModel'
-p22
-I01
-tp23
-a(S'FCCrystalModel'
-p24
-I01
-tp25
-a(S'ParallelepipedModel'
-p26
-I01
-tp27
-a(S'LineModel'
-p28
-I01
-tp29
-a(S'BEPolyelectrolyte'
-p30
-I01
-tp31
-a(S'SCCrystalModel'
-p32
-I01
-tp33
-a(S'FuzzySphereModel'
-p34
-I01
-tp35
-a(S'FlexCylEllipXModel'
-p36
-I01
-tp37
-a(S'UnifiedPowerRgModel'
-p38
-I01
-tp39
-a(S'SphericalSLDModel'
-p40
-I01
-tp41
-a(S'EllipticalCylinderModel'
-p42
-I01
-tp43
-a(S'MassSurfaceFractal'
-p44
-I01
-tp45
-a(S'GuinierPorodModel'
-p46
-I01
-tp47
-a(S'Core2ndMomentModel'
-p48
-I01
-tp49
-a(S'RPA10Model'
-p50
-I01
-tp51
-a(S'TwoLorentzianModel'
-p52
-I01
-tp53
-a(S'DebyeModel'
-p54
-I01
-tp55
-a(S'CSParallelepipedModel'
-p56
-I01
-tp57
-a(S'PolymerExclVolume'
-p58
-I01
-tp59
-a(S'OnionExpShellModel'
-p60
-I01
-tp61
-a(S'MultiShellModel'
-p62
-I01
-tp63
-a(S'LamellarPCrystalModel'
-p64
-I01
-tp65
-a(S'RaspBerryModel'
-p66
-I01
-tp67
-a(S'CoreShellEllipsoidModel'
-p68
-I01
-tp69
-a(S'MassFractalModel'
-p70
-I01
-tp71
-a(S'CappedCylinderModel'
-p72
-I01
-tp73
-a(S'TeubnerStreyModel'
-p74
-I01
-tp75
-a(S'BCCrystalModel'
-p76
-I01
-tp77
-a(S'Poly_GaussCoil'
-p78
-I01
-tp79
-a(S'HayterMSAStructure'
-p80
-I01
-tp81
-a(S'CorrLengthModel'
-p82
-I01
-tp83
-a(S'StackedDisksModel'
-p84
-I01
-tp85
-a(S'LamellarPSHGModel'
-p86
-I01
-tp87
-a(S'StarPolymer'
-p88
-I01
-tp89
-a(S'FractalModel'
-p90
-I01
-tp91
-a(S'CoreShellBicelleModel'
-p92
-I01
-tp93
-a(S'ReflectivityModel'
-p94
-I01
-tp95
-a(S'PeakLorentzModel'
-p96
-I01
-tp97
-a(S'HardsphereStructure'
-p98
-I01
-tp99
-a(S'LamellarPSModel'
-p100
-I01
-tp101
-a(S'EllipsoidModel'
-p102
-I01
-tp103
-a(S'BroadPeakModel'
-p104
-I01
-tp105
-a(S'SphereModel'
-p106
-I01
-tp107
-a(S'VesicleModel'
-p108
-I01
-tp109
-a(S'ReflectivityIIModel'
-p110
-I01
-tp111
-a(S'TriaxialEllipsoidModel'
-p112
-I01
-tp113
-a(S'LamellarModel'
-p114
-I01
-tp115
-a(S'PeakGaussModel'
-p116
-I01
-tp117
-a(S'FractalCoreShellModel'
-p118
-I01
-tp119
-a(S'CylinderModel'
-p120
-I01
-tp121
-a(S'BarBellModel'
-p122
-I01
-tp123
-a(S'CoreShellCylinderModel'
-p124
-I01
-tp125
-a(S'BinaryHSModel'
-p126
-I01
-tp127
-a(S'FlexibleCylinderModel'
-p128
-I01
-tp129
-a(S'HollowCylinderModel'
-p130
-I01
-tp131
-a(S'LamellarFFHGModel'
-p132
-I01
-tp133
-a(S'SurfaceFractalModel'
-p134
-I01
-tp135
-a(S'LinearPearlsModel'
-p136
-I01
-tp137
-a(S'FractalO_Z'
-p138
-I01
-tp139
-a(S'StickyHSStructure'
-p140
-I01
-tp141
-a(S'GaussLorentzGelModel'
-p142
-I01
-tp143
-a(S'CoreShellModel'
-p144
-I01
-tp145
-a(S'LorentzModel'
-p146
-I01
-tp147
-as.
+.
Index: sansview/default_categories.p
===================================================================
--- sansview/default_categories.p	(revision cb9f50d6a59b39417a968598d08657d534de4bd0)
+++ sansview/default_categories.p	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -6,5 +6,5 @@
 p2
 tRp3
-S'Spherical Shapes'
+S'Shapes'
 p4
 (lp5
@@ -13,5 +13,5 @@
 I01
 tp7
-a(S'MassFractalModel'
+a(S'CoreShellCylinderModel'
 p8
 I01
@@ -21,572 +21,280 @@
 I01
 tp11
+a(S'LamellarFFHGModel'
+p12
+I01
+tp13
+a(S'FCCrystalModel'
+p14
+I01
+tp15
 a(S'FuzzySphereModel'
-p12
-I01
-tp13
+p16
+I01
+tp17
+a(S'FlexCylEllipXModel'
+p18
+I01
+tp19
 a(S'BCCrystalModel'
-p14
-I01
-tp15
+p20
+I01
+tp21
+a(S'EllipticalCylinderModel'
+p22
+I01
+tp23
+a(S'CSParallelepipedModel'
+p24
+I01
+tp25
+a(S'OnionExpShellModel'
+p26
+I01
+tp27
+a(S'VesicleModel'
+p28
+I01
+tp29
+a(S'MultiShellModel'
+p30
+I01
+tp31
+a(S'LamellarPCrystalModel'
+p32
+I01
+tp33
+a(S'RaspBerryModel'
+p34
+I01
+tp35
+a(S'CoreShellEllipsoidModel'
+p36
+I01
+tp37
+a(S'CappedCylinderModel'
+p38
+I01
+tp39
+a(S'SphericalSLDModel'
+p40
+I01
+tp41
+a(S'StackedDisksModel'
+p42
+I01
+tp43
+a(S'LamellarPSHGModel'
+p44
+I01
+tp45
+a(S'CoreShellBicelleModel'
+p46
+I01
+tp47
+a(S'LamellarPSModel'
+p48
+I01
+tp49
+a(S'EllipsoidModel'
+p50
+I01
+tp51
+a(S'SphereModel'
+p52
+I01
+tp53
+a(S'ParallelepipedModel'
+p54
+I01
+tp55
+a(S'TriaxialEllipsoidModel'
+p56
+I01
+tp57
+a(S'LamellarModel'
+p58
+I01
+tp59
+a(S'CylinderModel'
+p60
+I01
+tp61
+a(S'BarBellModel'
+p62
+I01
+tp63
+a(S'BinaryHSModel'
+p64
+I01
+tp65
+a(S'FlexibleCylinderModel'
+p66
+I01
+tp67
+a(S'HollowCylinderModel'
+p68
+I01
+tp69
 a(S'SCCrystalModel'
-p16
-I01
-tp17
+p70
+I01
+tp71
+a(S'LinearPearlsModel'
+p72
+I01
+tp73
+a(S'CoreShellModel'
+p74
+I01
+tp75
+asS'Structure Factor'
+p76
+(lp77
+(S'SquareWellStructure'
+p78
+I01
+tp79
+a(S'HayterMSAStructure'
+p80
+I01
+tp81
+a(S'HardsphereStructure'
+p82
+I01
+tp83
+a(S'StickyHSStructure'
+p84
+I01
+tp85
+asS'Shape-Independent'
+p86
+(lp87
+(S'TwoPowerLawModel'
+p88
+I01
+tp89
+a(S'GelFitModel'
+p90
+I01
+tp91
+a(S'PowerLawAbsModel'
+p92
+I01
+tp93
+a(S'PorodModel'
+p94
+I01
+tp95
+a(S'MassFractalModel'
+p96
+I01
+tp97
+a(S'TeubnerStreyModel'
+p98
+I01
+tp99
+a(S'BEPolyelectrolyte'
+p100
+I01
+tp101
+a(S'DebyeModel'
+p102
+I01
+tp103
 a(S'MassSurfaceFractal'
-p18
-I01
-tp19
+p104
+I01
+tp105
+a(S'Poly_GaussCoil'
+p106
+I01
+tp107
 a(S'Core2ndMomentModel'
-p20
-I01
-tp21
-a(S'OnionExpShellModel'
-p22
-I01
-tp23
-a(S'MultiShellModel'
-p24
-I01
-tp25
-a(S'SphereModel'
-p26
-I01
-tp27
+p108
+I01
+tp109
+a(S'RPA10Model'
+p110
+I01
+tp111
+a(S'TwoLorentzianModel'
+p112
+I01
+tp113
+a(S'UnifiedPowerRgModel'
+p114
+I01
+tp115
+a(S'PolymerExclVolume'
+p116
+I01
+tp117
 a(S'GuinierModel'
-p28
-I01
-tp29
-a(S'SphericalSLDModel'
-p30
-I01
-tp31
+p118
+I01
+tp119
 a(S'GuinierPorodModel'
-p32
-I01
-tp33
+p120
+I01
+tp121
+a(S'CorrLengthModel'
+p122
+I01
+tp123
+a(S'StarPolymer'
+p124
+I01
+tp125
 a(S'FractalModel'
-p34
-I01
-tp35
-a(S'VesicleModel'
-p36
-I01
-tp37
+p126
+I01
+tp127
+a(S'PeakLorentzModel'
+p128
+I01
+tp129
+a(S'BroadPeakModel'
+p130
+I01
+tp131
+a(S'PeakGaussModel'
+p132
+I01
+tp133
 a(S'FractalCoreShellModel'
-p38
-I01
-tp39
-a(S'FCCrystalModel'
-p40
-I01
-tp41
-a(S'BinaryHSModel'
-p42
-I01
-tp43
+p134
+I01
+tp135
+a(S'DABModel'
+p136
+I01
+tp137
 a(S'SurfaceFractalModel'
-p44
-I01
-tp45
-a(S'LinearPearlsModel'
-p46
-I01
-tp47
-a(S'RaspBerryModel'
-p48
-I01
-tp49
-a(S'CoreShellModel'
-p50
-I01
-tp51
-asS'Gels'
-p52
-(lp53
-(g6
-I01
-tp54
-a(S'TwoPowerLawModel'
-p55
-I01
-tp56
-a(g8
-I01
-tp57
-a(g18
-I01
-tp58
-a(S'TwoLorentzianModel'
-p59
-I01
-tp60
-a(S'UnifiedPowerRgModel'
-p61
-I01
-tp62
-a(g32
-I01
-tp63
-a(S'CorrLengthModel'
-p64
-I01
-tp65
-a(S'BroadPeakModel'
-p66
-I01
-tp67
-a(S'DABModel'
-p68
-I01
-tp69
-a(g44
-I01
-tp70
-a(g46
-I01
-tp71
+p138
+I01
+tp139
 a(S'GaussLorentzGelModel'
-p72
-I01
-tp73
-asS'Peaks'
-p74
-(lp75
-(g6
-I01
-tp76
-a(S'LamellarPCrystalModel'
-p77
-I01
-tp78
-a(g14
-I01
-tp79
-a(g16
-I01
-tp80
-a(g59
-I01
-tp81
-a(g22
-I01
-tp82
-a(g24
-I01
-tp83
-a(S'StackedDisksModel'
-p84
-I01
-tp85
-a(S'LamellarPSHGModel'
-p86
-I01
-tp87
-a(S'PeakLorentzModel'
-p88
-I01
-tp89
-a(g66
-I01
-tp90
-a(S'PeakGaussModel'
-p91
-I01
-tp92
-a(g40
-I01
-tp93
+p140
+I01
+tp141
 a(S'LorentzModel'
-p94
-I01
-tp95
-asS'Two-Phase'
-p96
-(lp97
-(S'PorodModel'
-p98
-I01
-tp99
-a(g8
-I01
-tp100
-a(g18
-I01
-tp101
-a(g64
-I01
-tp102
-a(g34
-I01
-tp103
-a(g66
-I01
-tp104
-a(g38
-I01
-tp105
-a(g68
-I01
-tp106
-a(g44
-I01
-tp107
-a(g72
-I01
-tp108
-asS'Polymers'
-p109
-(lp110
-(g6
-I01
-tp111
-a(S'BEPolyelectrolyte'
-p112
-I01
-tp113
-a(g77
-I01
-tp114
-a(S'DebyeModel'
-p115
-I01
-tp116
-a(g14
-I01
-tp117
-a(g16
-I01
-tp118
-a(S'RPA10Model'
-p119
-I01
-tp120
-a(S'FlexCylEllipXModel'
-p121
-I01
-tp122
-a(S'PolymerExclVolume'
-p123
-I01
-tp124
-a(g86
-I01
-tp125
-a(S'LamellarPSModel'
-p126
-I01
-tp127
-a(S'LamellarModel'
-p128
-I01
-tp129
-a(S'Poly_GaussCoil'
-p130
-I01
-tp131
-a(S'FlexibleCylinderModel'
-p132
-I01
-tp133
-a(S'LamellarFFHGModel'
-p134
-I01
-tp135
-a(g46
-I01
-tp136
-a(g72
-I01
-tp137
-asS'Empirical'
-p138
-(lp139
-(g55
-I01
-tp140
-a(g98
-I01
-tp141
-a(g61
-I01
-tp142
-a(g28
+p142
 I01
 tp143
-a(g32
-I01
-tp144
-a(g64
-I01
-tp145
-a(g66
-I01
-tp146
-a(S'LineModel'
-p147
-I01
-tp148
-asS'Particles'
-p149
-(lp150
-(g6
+asS'Uncategorized'
+p144
+(lp145
+(S'LineModel'
+p146
+I01
+tp147
+a(S'ReflectivityModel'
+p148
+I01
+tp149
+a(S'ReflectivityIIModel'
+p150
 I01
 tp151
-a(S'HollowCylinderModel'
-p152
-I01
-tp153
-a(g8
-I01
-tp154
-a(g10
-I01
-tp155
-a(S'CSParallelepipedModel'
-p156
-I01
-tp157
-a(S'ParallelepipedModel'
-p158
-I01
-tp159
-a(g12
-I01
-tp160
-a(g77
-I01
-tp161
-a(S'EllipticalCylinderModel'
-p162
-I01
-tp163
-a(g14
-I01
-tp164
-a(g16
-I01
-tp165
-a(g18
-I01
-tp166
-a(g20
-I01
-tp167
-a(g121
-I01
-tp168
-a(g22
-I01
-tp169
-a(g24
-I01
-tp170
-a(g26
-I01
-tp171
-a(S'CoreShellEllipsoidModel'
-p172
-I01
-tp173
-a(g28
-I01
-tp174
-a(S'CappedCylinderModel'
-p175
-I01
-tp176
-a(S'CylinderModel'
-p177
-I01
-tp178
-a(g30
-I01
-tp179
-a(g32
-I01
-tp180
-a(g84
-I01
-tp181
-a(g86
-I01
-tp182
-a(g34
-I01
-tp183
-a(S'CoreShellBicelleModel'
-p184
-I01
-tp185
-a(g126
-I01
-tp186
-a(S'EllipsoidModel'
-p187
-I01
-tp188
-a(g36
-I01
-tp189
-a(S'TriaxialEllipsoidModel'
-p190
-I01
-tp191
-a(g128
-I01
-tp192
-a(g38
-I01
-tp193
-a(S'BarBellModel'
-p194
-I01
-tp195
-a(g40
-I01
-tp196
-a(g42
-I01
-tp197
-a(g132
-I01
-tp198
-a(g134
-I01
-tp199
-a(g44
-I01
-tp200
-a(g46
-I01
-tp201
-a(g48
-I01
-tp202
-a(g50
-I01
-tp203
-asS'Non-Spherical Shapes'
-p204
-(lp205
-(g6
-I01
-tp206
-a(g152
-I01
-tp207
-a(g156
-I01
-tp208
-a(g158
-I01
-tp209
-a(g77
-I01
-tp210
-a(g162
-I01
-tp211
-a(g121
-I01
-tp212
-a(g172
-I01
-tp213
-a(g28
-I01
-tp214
-a(g175
-I01
-tp215
-a(g177
-I01
-tp216
-a(g32
-I01
-tp217
-a(g84
-I01
-tp218
-a(g86
-I01
-tp219
-a(g184
-I01
-tp220
-a(g126
-I01
-tp221
-a(g187
-I01
-tp222
-a(g190
-I01
-tp223
-a(g128
-I01
-tp224
-a(g194
-I01
-tp225
-a(g132
-I01
-tp226
-a(g134
-I01
-tp227
-a(g46
-I01
-tp228
-asS'Uncategorized'
-p229
-(lp230
-(S'GelFitModel'
-p231
-I01
-tp232
-a(S'CoreShellCylinderModel'
-p233
-I01
-tp234
-a(S'PowerLawAbsModel'
-p235
-I01
-tp236
-a(S'TeubnerStreyModel'
-p237
-I01
-tp238
-a(S'SquareWellStructure'
-p239
-I01
-tp240
-a(S'FractalO_Z'
-p241
-I01
-tp242
-a(S'HayterMSAStructure'
-p243
-I01
-tp244
-a(S'StarPolymer'
-p245
-I01
-tp246
-a(S'ReflectivityModel'
-p247
-I01
-tp248
-a(S'HardsphereStructure'
-p249
-I01
-tp250
-a(S'ReflectivityIIModel'
-p251
-I01
-tp252
-a(S'StickyHSStructure'
-p253
-I01
-tp254
 as.
Index: sansview/sansview.py
===================================================================
--- sansview/sansview.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ sansview/sansview.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -14,5 +14,6 @@
 logging.basicConfig(level=logging.INFO,
                     format='%(asctime)s %(levelname)s %(message)s',
-                    filename=os.path.join(os.path.expanduser("~"),'sasview.log'))
+                    filename=os.path.join(os.path.expanduser("~"),
+                                          'sasview.log'))
 
 import wx
@@ -103,17 +104,5 @@
             logging.error(sys.exc_value)  
 
-        # initialize category stuff
-        user_file = os.path.join(os.path.expanduser("~"),
-                                 'serialized_categories.p')
         
-        if not os.path.isfile(user_file): 
-            # either first time starting sansview or the
-            # user has deleted their category file
-            my_dir = os.path.dirname(os.path.abspath(__file__))
-            default_file = os.path.join(my_dir, '..',
-                                        'sansmodels',
-                                        'default_categories.p' )
-            copy(default_file, user_file)
-
             
         # Add welcome page
Index: sansview/setup_exe.py
===================================================================
--- sansview/setup_exe.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ sansview/setup_exe.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -32,5 +32,6 @@
         sys.argv.remove('--extrapath')
 except:
-    print "Error processing extra python path needed to build SasView\n  %s" % sys.exc_value
+    print "Error processing extra python path needed to build SasView\n  %s" % \
+                sys.exc_value
 
 from distutils.core import setup
@@ -259,4 +260,8 @@
 if os.path.isfile(f):
     data_files.append(('.', [f]))
+
+f = 'default_categories.p'
+if os.path.isfile(f):
+    data_files.append(('.', [f]))
     
 if os.path.isfile("BUILD_NUMBER"):
Index: sansview/setup_mac.py
===================================================================
--- sansview/setup_mac.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ sansview/setup_mac.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -54,5 +54,6 @@
 
 APP = ['sansview.py']
-DATA_FILES += ['images','test','media', 'custom_config.py', 'local_config.py']
+DATA_FILES += ['images','test','media', 'custom_config.py', 'local_config.py',
+               'default_categories.p']
 if os.path.isfile("BUILD_NUMBER"):
     DATA_FILES.append("BUILD_NUMBER")
@@ -92,9 +93,4 @@
 
 EXTENSIONS_LIST = find_extension()
-
-#initialize category stuff
-from sans.guiframe.CategoryInstaller import CategoryInstaller
-CategoryInstaller.check_install()
-
 
  
Index: setup.py
===================================================================
--- setup.py	(revision df7a7e3fc9ea2f467d069e36f0552fc12e622178)
+++ setup.py	(revision ea5fa581cac321a89f39dd537af704582947a6a9)
@@ -9,7 +9,4 @@
 from setuptools import setup, Extension, find_packages
 from distutils.command.build_ext import build_ext
-
-
-
 
 try:
@@ -49,4 +46,7 @@
 if os.path.isdir(sans_dir):
     f_path = os.path.join(sans_dir, "sasview.log")
+    if os.path.isfile(f_path):
+        os.remove(f_path)
+    f_path = os.path.join(sans_dir, "serialized_cat.p")
     if os.path.isfile(f_path):
         os.remove(f_path)
@@ -116,8 +116,5 @@
 package_dir["sans.guiframe.local_perspectives"] = os.path.join(guiframe_path, 
                                                         "local_perspectives")
-package_data["sans.guiframe"] = ['images/*', 
-                                 'media/*', 
-                                 'default_categories.p']
-
+package_data["sans.guiframe"] = ['images/*', 'media/*']
 packages.extend(["sans.guiframe", "sans.guiframe.local_perspectives"])
 # build local plugin
@@ -275,5 +272,6 @@
 package_dir["sans.models"] = model_dir
 
-package_dir["sans.models.sans_extension"] = os.path.join("sansmodels", "src", "sans", "models", "sans_extension")
+package_dir["sans.models.sans_extension"] = os.path.join("sansmodels", "src", 
+                                            "sans", "models", "sans_extension")
             
 package_data['sans.models'] = [os.path.join('media', "*.*")]
@@ -317,5 +315,6 @@
 
 package_dir["sans.sansview"] = "sansview"
-package_data['sans.sansview'] = ['images/*', 'media/*', 'test/*']
+package_data['sans.sansview'] = ['images/*', 'media/*', 'test/*', 
+                                 'default_categories.p']
 packages.append("sans.sansview")
 
@@ -329,35 +328,4 @@
 else:
     required.extend(['pil'])
-
-# sys.path.append(os.path.join('sansguiframe',
-#                              'src',
-#                              'sans',
-#                              'guiframe'))
-
-#install category stuff
-cat_install_path = os.path.join('sansguiframe', 'src',
-                                'sans','guiframe','CategoryInstaller.py')
-shutil.copy(cat_install_path, os.getcwd())
-
-from CategoryInstaller import CategoryInstaller
-CategoryInstaller.check_install(defaultfile = \
-                                    os.path.join('sansguiframe',
-                                                 'src',
-                                                 'sans',
-                                                 'guiframe',
-                                                 'default_categories.p'),
-                                modelsdir = \
-                                    os.path.join('fittingview',
-                                                 'src',
-                                                 'sans',
-                                                 'perspectives',
-                                                 'fitting'), 
-                                installed_models_dir = \
-                                    os.path.join('sansdataloader',
-                                                 'src',
-                                                 'sans',
-                                                 'dataloader',
-                                                 'readers') )
-
    
  # Set up SasView    
