Changeset 986da97 in sasview for sansguiframe/src/sans


Ignore:
Timestamp:
Jun 28, 2012 4:53:08 PM (12 years ago)
Author:
Jae Cho <jhjcho@…>
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:
83b81b8
Parents:
9c30b8c
Message:

Popup dialog on status event with error

Location:
sansguiframe/src/sans/guiframe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sansguiframe/src/sans/guiframe/gui_statusbar.py

    r3fc01c5 r986da97  
    228228        """ 
    229229        wxStatusB.PopStatusText(self, field=MSG_POSITION) 
    230        
     230         
    231231    def PushStatusText(self, *args, **kwds): 
    232232        """ 
     
    315315                                                 size = (height,height)) 
    316316            self.bitmap_bt_warning.SetBitmapLabel(icon_bmp) 
     317            e_msg = "Error(s) Occurred:\n" 
     318            e_msg += event.status 
     319            wx.MessageBox(e_msg, style=wx.ICON_ERROR) 
    317320        else: 
    318321            icon_bmp =  wx.ArtProvider.GetBitmap(wx.ART_INFORMATION, 
  • sansguiframe/src/sans/guiframe/local_perspectives/data_loader/data_loader.py

    rc151afc r986da97  
    177177        log_msg = '' 
    178178        output = {} 
     179        any_error = False 
    179180        error_message = "" 
    180         info = "info" 
    181181        for p_file in path: 
     182            info = "info" 
    182183            basename  = os.path.basename(p_file) 
    183184            root, extension = os.path.splitext(basename) 
    184185            if extension.lower() in EXTENSIONS: 
     186                any_error = True 
    185187                log_msg = "Data Loader cannot " 
    186188                log_msg += "load: %s\n" % str(p_file) 
     
    203205                self.load_update(output=output, message=message, info=info) 
    204206            except: 
    205                  error = "Error while loading Data: %s\n" % str(p_file) 
    206                  error += str(sys.exc_value) + "\n" 
    207                  error_message = "The data file you selected could not be loaded.\n" 
    208                  error_message += "Make sure the content of your file" 
    209                  error_message += " is properly formatted.\n\n" 
    210                  error_message += "When contacting the DANSE team, mention the" 
    211                  error_message += " following:\n%s" % str(error) 
    212                  info = "error" 
    213                  self.load_update(output=output, message=error_message,  
     207                any_error = True 
     208                if error_message == "": 
     209                     error = "Error: " + str(sys.exc_value) + "\n" 
     210                     error += "while loading Data: \n%s\n" % str(p_file) 
     211                     error_message = "The data file you selected could not be loaded.\n" 
     212                     error_message += "Make sure the content of your file" 
     213                     error_message += " is properly formatted.\n\n" 
     214                     error_message += "When contacting the DANSE team, mention the" 
     215                     error_message += " following:\n%s" % str(error) 
     216                else: 
     217                     error_message += "%s\n"% str(p_file) 
     218                info = "error" 
     219                self.load_update(output=output, message=error_message,  
    214220                                  info=info) 
    215221                 
    216222        message = "Loading Data Complete! " 
    217223        message += log_msg 
    218         if error_message!= "": 
     224        if error_message != "": 
    219225            info = 'error' 
    220226        self.load_complete(output=output, error_message=error_message, 
     
    226232        """ 
    227233        if message != "": 
    228             wx.PostEvent(self.parent, StatusEvent(status=message, info=info,  
     234            wx.PostEvent(self.parent, StatusEvent(status=message, info='info',  
    229235                                                  type="progress")) 
    230236    def load_complete(self, output, message="", error_message="", path=None,  
     
    236242                                              info=info, 
    237243                                              type="stop")) 
    238         if error_message != "": 
    239             self.load_error(error_message) 
     244        #if error_message != "": 
     245        #    self.load_error(error_message) 
    240246        self.parent.add_data(data_list=output) 
    241247    
Note: See TracChangeset for help on using the changeset viewer.