Changeset 72bd8e7 in sasview for fittingview


Ignore:
Timestamp:
Oct 13, 2011 1:17:33 PM (13 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
a86260e2
Parents:
db0c347
Message:

make sure and error message is display for save project

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fittingview/src/sans/perspectives/fitting/fitpanel.py

    rea8283d r72bd8e7  
    8181         that guiframe can write to file 
    8282        """ 
     83        msg = "" 
    8384        for uid, page in self.opened_pages.iteritems(): 
    84             data = page.get_data() 
    85             # state must be cloned 
    86             state = page.get_state().clone() 
    87             if data is not None: 
    88                 new_doc = self._manager.state_reader.write_toXML(data, state) 
    89                 if doc != None and hasattr(doc, "firstChild"): 
    90                     child = new_doc.firstChild.firstChild 
    91                     doc.firstChild.appendChild(child)   
    92                 else: 
    93                     doc = new_doc  
     85            if page.batch_on: 
     86                pos = self.GetPageIndex(page) 
     87                if pos != -1 and page != self.sim_page: 
     88                    msg += "%s .\n" % str(self.GetPageText(pos)) 
     89            else: 
     90                data = page.get_data() 
     91                # state must be cloned 
     92                state = page.get_state().clone() 
     93                if data is not None: 
     94                    new_doc = self._manager.state_reader.write_toXML(data, state) 
     95                    if doc != None and hasattr(doc, "firstChild"): 
     96                        child = new_doc.firstChild.firstChild 
     97                        doc.firstChild.appendChild(child)   
     98                    else: 
     99                        doc = new_doc  
     100        if msg.strip() != "": 
     101            temp = "Save Project is not supported for Batch page.\n" 
     102            temp += "The following pages will not be save:\n" 
     103            message = temp + msg 
     104            wx.PostEvent(self._manager.parent, StatusEvent(status=message, 
     105                                                            info="warning")) 
    94106        return doc     
    95107     
     
    443455            elif not data_1d_list and data_2d_list: 
    444456                page.fill_data_combobox(data_2d_list) 
     457                 
    445458        pos = self.GetPageIndex(page) 
    446459        caption = "BatchPage" + str(self.batch_page_index) 
     
    449462        page.window_caption = caption 
    450463        page.window_name = caption 
     464        self.SetSelection(pos) 
    451465        self.opened_pages[page.uid] = page 
    452466        return page 
Note: See TracChangeset for help on using the changeset viewer.