Changeset f7bead2 in sasview for src/sans/guiframe


Ignore:
Timestamp:
Apr 4, 2014 11:49:57 AM (11 years ago)
Author:
Mathieu Doucet <doucetm@…>
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:
eacf6a8c
Parents:
f87dc4c
Message:

Re #212 Fix default-view dialog.

Location:
src/sans/guiframe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sans/guiframe/gui_manager.py

    rf309303 rf7bead2  
    14511451        Build a panel to allow to edit Mask 
    14521452        """ 
    1453          
    14541453        from sans.guiframe.startup_configuration \ 
    14551454        import StartupConfiguration as ConfDialog 
    14561455         
    1457         self.panel = ConfDialog(parent=self, gui=self.__gui_style) 
    1458         self.panel.ShowModal() 
    1459  
    1460                  
     1456        dialog = ConfDialog(parent=self, gui=self.__gui_style) 
     1457        result = dialog.ShowModal() 
     1458        if result == wx.ID_OK: 
     1459            dialog.write_custom_config() 
     1460            # post event for info 
     1461            wx.PostEvent(self, StatusEvent(status="Wrote custom configuration", info='info')) 
     1462        dialog.Destroy() 
     1463         
    14611464    def _add_menu_application(self): 
    14621465        """ 
  • src/sans/guiframe/startup_configuration.py

    r5777106 rf7bead2  
    9393        note_txt.SetForegroundColour("black") 
    9494        hbox = wx.BoxSizer(wx.HORIZONTAL) 
    95         cancelButton = wx.Button(self, -1, 'Cancel', size=(70, 25)) 
    96         hbox.Add(cancelButton, 1, wx.RIGHT, 5) 
    97         cancelButton.Bind(wx.EVT_BUTTON, self.OnCancel) 
    98         okButton = wx.Button(self, -1, 'OK', size=(70, 25)) 
     95         
     96        okButton = wx.Button(self, wx.ID_OK, 'Set', size=(70, 25)) 
     97        closeButton = wx.Button(self,wx.ID_CANCEL, 'Cancel', size=(70, 25)) 
     98        hbox.Add(closeButton, 1, wx.RIGHT, 5) 
    9999        hbox.Add(okButton, 1, wx.RIGHT, 5) 
    100         okButton.Bind(wx.EVT_BUTTON, self.OnClose) 
    101         vbox.Add(panel) 
    102  
    103         vbox.Add(hbox, 1, wx.ALIGN_CENTER | wx.RIGHT | wx.BOTTOM, 5) 
     100        vbox.Add(panel, 1, wx.ALIGN_CENTER | wx.BOTTOM, 5) 
     101        vbox.Add(hbox, 1, wx.ALIGN_CENTER | wx.BOTTOM, 5) 
    104102        # set sizer 
    105103        self.SetSizer(vbox) 
     
    192190        self.return_string = self.current_string 
    193191        return self.return_string 
    194  
    195     def OnCancel(self, event): 
    196         """ 
    197         Close event 
    198         """ 
    199         # clear event 
    200         event.Skip() 
    201         self.return_string = {} 
    202         self.Destroy() 
    203      
    204     def OnClose(self, event): 
    205         """ 
    206         Close event 
    207         """ 
    208         # clear event 
    209         event.Skip() 
     192     
     193    def write_custom_config(self): 
     194        """ 
     195            Write custom configuration 
     196        """ 
    210197        fname = os.path.join(self.path, 'custom_config.py') 
    211198        self.write_string(fname, self.return_string) 
    212         self.Destroy() 
    213199 
    214200    def write_string(self, fname, strings): 
Note: See TracChangeset for help on using the changeset viewer.