Index: src/sas/sasgui/guiframe/gui_manager.py
===================================================================
--- src/sas/sasgui/guiframe/gui_manager.py	(revision 5251ec6db8aae214addfa0a5a1da16820994958b)
+++ src/sas/sasgui/guiframe/gui_manager.py	(revision 9220e89c31ca5156d9c3a40634b4257084d139a2)
@@ -48,4 +48,5 @@
 from sas.sasgui.guiframe.CategoryManager import CategoryManager
 from sas.sascalc.dataloader.loader import Loader
+from sas.sascalc.file_converter.nxcansas_writer import NXcanSASWriter
 from sas.sasgui.guiframe.proxy import Connection
 
@@ -64,47 +65,35 @@
 SPLASH_SCREEN_HEIGHT = config.SPLASH_SCREEN_HEIGHT
 SS_MAX_DISPLAY_TIME = config.SS_MAX_DISPLAY_TIME
-if not WELCOME_PANEL_ON:
-    WELCOME_PANEL_SHOW = False
+
+def custom_value(name, default=None):
+    """
+    Fetch a config value from custom_config.  Fallback to config, and then
+    to default if it doesn't exist in config.
+    """
+    default = getattr(config, name, default)
+    return getattr(custom_config, name, default)
+
+# Custom config values in the order they appear.
+DATAPANEL_WIDTH = custom_value('DATAPANEL_WIDTH', -1)
+CLEANUP_PLOT = custom_value('CLEANUP_PLOT', False)
+FIXED_PANEL = custom_value('FIXED_PANEL', True)
+PLOPANEL_WIDTH = custom_value('PLOPANEL_WIDTH', -1)
+DATALOADER_SHOW = custom_value('DATALOADER_SHOW', True)
+GUIFRAME_HEIGHT = custom_value('GUIFRAME_HEIGHT', -1)
+GUIFRAME_WIDTH = custom_value('GUIFRAME_WIDTH', -1)
+CONTROL_WIDTH = custom_value('CONTROL_WIDTH', -1)
+CONTROL_HEIGHT = custom_value('CONTROL_HEIGHT', -1)
+open_folder = custom_value('DEFAULT_OPEN_FOLDER', None)
+if open_folder is not None and os.path.isdir(open_folder):
+    DEFAULT_OPEN_FOLDER = os.path.abspath(open_folder)
 else:
-    WELCOME_PANEL_SHOW = True
-try:
-    DATALOADER_SHOW = custom_config.DATALOADER_SHOW
-    TOOLBAR_SHOW = custom_config.TOOLBAR_SHOW
-    FIXED_PANEL = custom_config.FIXED_PANEL
-    if WELCOME_PANEL_ON:
-        WELCOME_PANEL_SHOW = custom_config.WELCOME_PANEL_SHOW
-    PLOPANEL_WIDTH = custom_config.PLOPANEL_WIDTH
-    DATAPANEL_WIDTH = custom_config.DATAPANEL_WIDTH
-    GUIFRAME_WIDTH = custom_config.GUIFRAME_WIDTH
-    GUIFRAME_HEIGHT = custom_config.GUIFRAME_HEIGHT
-    CONTROL_WIDTH = custom_config.CONTROL_WIDTH
-    CONTROL_HEIGHT = custom_config.CONTROL_HEIGHT
-    DEFAULT_PERSPECTIVE = custom_config.DEFAULT_PERSPECTIVE
-    CLEANUP_PLOT = custom_config.CLEANUP_PLOT
-    # custom open_path
-    open_folder = custom_config.DEFAULT_OPEN_FOLDER
-    if open_folder is not None and os.path.isdir(open_folder):
-        DEFAULT_OPEN_FOLDER = os.path.abspath(open_folder)
-    else:
-        DEFAULT_OPEN_FOLDER = get_app_dir()
-    SAS_OPENCL = custom_config.SAS_OPENCL
-except:
-    DATALOADER_SHOW = True
-    TOOLBAR_SHOW = True
-    FIXED_PANEL = True
-    WELCOME_PANEL_SHOW = False
-    PLOPANEL_WIDTH = config.PLOPANEL_WIDTH
-    DATAPANEL_WIDTH = config.DATAPANEL_WIDTH
-    GUIFRAME_WIDTH = config.GUIFRAME_WIDTH
-    GUIFRAME_HEIGHT = config.GUIFRAME_HEIGHT
-    CONTROL_WIDTH = -1
-    CONTROL_HEIGHT = -1
-    DEFAULT_PERSPECTIVE = None
-    CLEANUP_PLOT = False
     DEFAULT_OPEN_FOLDER = get_app_dir()
-    DEFAULT_OPEN_FOLDER = PATH_APP
-    SAS_OPENCL = None
+WELCOME_PANEL_SHOW = (custom_value('WELCOME_PANEL_SHOW', False)
+                      if WELCOME_PANEL_ON else False)
+TOOLBAR_SHOW = custom_value('TOOLBAR_SHOW', True)
+DEFAULT_PERSPECTIVE = custom_value('DEFAULT_PERSPECTIVE', 'Fitting')
+SAS_OPENCL = custom_value('SAS_OPENCL', 'None')
+
 DEFAULT_STYLE = config.DEFAULT_STYLE
-
 PLUGIN_STATE_EXTENSIONS = config.PLUGIN_STATE_EXTENSIONS
 OPEN_SAVE_MENU = config.OPEN_SAVE_PROJECT_MENU
@@ -2420,6 +2409,7 @@
         default_name = fname
         wildcard = "Text files (*.txt)|*.txt|"\
-                    "CanSAS 1D files(*.xml)|*.xml"
-        path = None
+                    "CanSAS 1D files (*.xml)|*.xml|"\
+                     "NXcanSAS files (*.h5)|*.h5|"
+        options = [".txt", ".xml",".h5"]
         dlg = wx.FileDialog(self, "Choose a file",
                             self._default_save_location,
@@ -2431,25 +2421,23 @@
             # This is MAC Fix
             ext_num = dlg.GetFilterIndex()
-            if ext_num == 0:
-                ext_format = '.txt'
-            else:
-                ext_format = '.xml'
+
+            ext_format = options[ext_num]
             path = os.path.splitext(path)[0] + ext_format
             mypath = os.path.basename(path)
-
-            # Instantiate a loader
-            loader = Loader()
-            ext_format = ".txt"
-            if os.path.splitext(mypath)[1].lower() == ext_format:
+            fName = os.path.splitext(path)[0] + ext_format
+
+            if os.path.splitext(mypath)[1].lower() == options[0]:
                 # Make sure the ext included in the file name
                 # especially on MAC
-                fName = os.path.splitext(path)[0] + ext_format
                 self._onsaveTXT(data, fName)
-            ext_format = ".xml"
-            if os.path.splitext(mypath)[1].lower() == ext_format:
+            elif os.path.splitext(mypath)[1].lower() == options[1]:
                 # Make sure the ext included in the file name
                 # especially on MAC
-                fName = os.path.splitext(path)[0] + ext_format
+                # Instantiate a loader
+                loader = Loader()
                 loader.save(fName, data, ext_format)
+            elif os.path.splitext(mypath)[1].lower() == options[2]:
+                nxcansaswriter = NXcanSASWriter()
+                nxcansaswriter.write([data], fName)
             try:
                 self._default_save_location = os.path.dirname(path)
@@ -2478,9 +2466,9 @@
             if has_errors:
                 if data.dx is not None and data.dx != []:
-                    out.write("<X>   <Y>   <dY>   <dX>\n")
+                    out.write("<X>\t<Y>\t<dY>\t<dX>\n")
                 else:
-                    out.write("<X>   <Y>   <dY>\n")
+                    out.write("<X>\t<Y>\t<dY>\n")
             else:
-                out.write("<X>   <Y>\n")
+                out.write("<X>\t<Y>\n")
 
             for i in range(len(data.x)):
@@ -2526,5 +2514,7 @@
             text += 'dY_min = %s:  dY_max = %s\n' % (min(data.dy), max(data.dy))
         text += '\nData Points:\n'
-        x_st = "X"
+        text += "<index> \t<X> \t<Y> \t<dY> "
+        text += "\t<dXl> \t<dXw>\n" if(data.dxl is not None and
+                                       data.dxw is not None) else "\t<dX>\n"
         for index in range(len(data.x)):
             if data.dy is not None and len(data.dy) > index:
@@ -2537,14 +2527,8 @@
                 dx_val = 0.0
             if data.dxl is not None and len(data.dxl) > index:
-                if index == 0:
-                    x_st = "Xl"
                 dx_val = data.dxl[index]
-            elif data.dxw is not None and len(data.dxw) > index:
-                if index == 0:
-                    x_st = "Xw"
-                dx_val = data.dxw[index]
-
-            if index == 0:
-                text += "<index> \t<X> \t<Y> \t<dY> \t<d%s>\n" % x_st
+                if data.dxw is not None and len(data.dxw) > index:
+                    dx_val = "%s \t%s" % (data.dxl[index], data.dxw[index])
+
             text += "%s \t%s \t%s \t%s \t%s\n" % (index,
                                                   data.x[index],
@@ -2563,5 +2547,6 @@
         """
         default_name = fname
-        wildcard = "IGOR/DAT 2D file in Q_map (*.dat)|*.DAT"
+        wildcard = "IGOR/DAT 2D file in Q_map (*.dat)|*.DAT|"\
+                   "NXcanSAS files (*.h5)|*.h5|"
         dlg = wx.FileDialog(self, "Choose a file",
                             self._default_save_location,
@@ -2575,4 +2560,6 @@
             if ext_num == 0:
                 ext_format = '.dat'
+            elif ext_num == 1:
+                ext_format = '.h5'
             else:
                 ext_format = ''
@@ -2582,11 +2569,16 @@
             # Instantiate a loader
             loader = Loader()
-
-            ext_format = ".dat"
-            if os.path.splitext(mypath)[1].lower() == ext_format:
+            ext = os.path.splitext(mypath)[1].lower()
+            if ext == '.dat':
                 # Make sure the ext included in the file name
                 # especially on MAC
                 fileName = os.path.splitext(path)[0] + ext_format
                 loader.save(fileName, data, ext_format)
+            elif ext == '.h5':
+                # Make sure the ext included in the file name
+                # especially on MAC
+                fileName = os.path.splitext(path)[0] + ext_format
+                nxcansaswriter = NXcanSASWriter()
+                nxcansaswriter.write([data], fileName)
             try:
                 self._default_save_location = os.path.dirname(path)
Index: src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py
===================================================================
--- src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py	(revision 5251ec6db8aae214addfa0a5a1da16820994958b)
+++ src/sas/sasgui/guiframe/local_perspectives/data_loader/data_loader.py	(revision 5251ec6db8aae214addfa0a5a1da16820994958b)
@@ -205,5 +205,5 @@
             except NoKnownLoaderException as e:
                 exception_occurred = True
-                error_message = "Loading data failed!" + e.message
+                error_message = "Loading data failed!\n" + e.message
                 file_errors[basename] = [error_message]
             except Exception as e:
@@ -224,4 +224,5 @@
                 for message in error_array:
                     error_message += message + "\n"
+                error_message = error_message[:-1]
             self.load_complete(output=output,
                                message=error_message,
@@ -231,6 +232,4 @@
             self.load_complete(output=output, message="Loading data complete!",
                                info="info")
-        else:
-            self.load_complete(output=None, message=error_message, info="error")
 
     def load_update(self, message="", info="warning"):
