Changeset 60df6c1 in sasview for src/sas/sasgui/guiframe


Ignore:
Timestamp:
Oct 7, 2016 5:07:07 PM (8 years ago)
Author:
GitHub <noreply@…>
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, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
212bfc2
Parents:
ed9f872 (diff), 95eef00 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Andrew Jackson <andrew.jackson@…> (10/07/16 17:07:07)
git-committer:
GitHub <noreply@…> (10/07/16 17:07:07)
Message:

Merge pull request No. 13 from SasView?/wx_save_simfit

wx Saving Simultaneous and Constrained Fitting Panel

Closes #189 & closes #12

Location:
src/sas/sasgui/guiframe
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/data_panel.py

    re767897 r998ca90  
    890890 
    891891 
    892     def on_remove(self, event): 
     892    def on_remove(self, event, msg=""): 
    893893        """ 
    894894        Get a list of item checked and remove them from the treectrl 
    895895        Ask the parent to remove reference to this item 
    896896        """ 
    897         msg = "This operation will delete the data sets checked " 
    898         msg += "and all the dependents." 
     897        if msg == "": 
     898            msg = "This operation will delete the data sets checked " 
     899            msg += "and all the dependents." 
    899900        msg_box = wx.MessageDialog(None, msg, 'Warning', wx.OK|wx.CANCEL) 
    900901        if msg_box.ShowModal() != wx.ID_OK: 
    901             return 
     902            return True 
    902903 
    903904        data_to_remove, theory_to_remove, _ = self.set_data_helper() 
  • src/sas/sasgui/guiframe/gui_manager.py

    radb0851 r95eef00  
    11521152                self.delete_panel(ID) 
    11531153                break 
    1154         self.cpanel_on_focus.SetFocus() 
     1154        if self.cpanel_on_focus is not None: 
     1155            self.cpanel_on_focus.SetFocus() 
    11551156 
    11561157 
     
    19071908        if self._default_save_location == None: 
    19081909            self._default_save_location = os.getcwd() 
    1909         wx.PostEvent(self, StatusEvent(status="Loading Project file...")) 
    1910         dlg = wx.FileDialog(self, 
     1910        msg = "This operation will set SasView to its freshly opened state " 
     1911        msg += "before loading the project. Do you wish to continue?" 
     1912        if not self._data_panel.on_remove(None, msg): 
     1913            wx.PostEvent(self, StatusEvent(status="Loading Project file...")) 
     1914            dlg = wx.FileDialog(self, 
    19111915                            "Choose a file", 
    19121916                            self._default_save_location, "", 
    19131917                            APPLICATION_WLIST) 
    1914         if dlg.ShowModal() == wx.ID_OK: 
    1915             path = dlg.GetPath() 
     1918            if dlg.ShowModal() == wx.ID_OK: 
     1919                path = dlg.GetPath() 
    19161920            if path is not None: 
    19171921                self._default_save_location = os.path.dirname(path) 
    1918         dlg.Destroy() 
    1919  
    1920         self.load_state(path=path, is_project=True) 
     1922                dlg.Destroy() 
     1923                # Reset to a base state 
     1924                self._on_reset_state() 
     1925                # Load the project file 
     1926                self.load_state(path=path, is_project=True) 
     1927 
     1928    def _on_reset_state(self): 
     1929        """ 
     1930        Resets SasView to its freshly opened state. 
     1931        :return: None 
     1932        """ 
     1933        # Reset all plugins to their base state 
     1934        self._data_panel.set_panel_on_focus() 
     1935        # Remove all loaded data 
     1936        self._data_panel.selection_cbox.SetValue('Select all Data') 
     1937        self._data_panel._on_selection_type(None) 
     1938        for plugin in self.plugins: 
     1939            plugin.clear_panel() 
     1940        # Reset plot number to 0 
     1941        self.graph_num = 0 
    19211942 
    19221943    def _on_save_application(self, event): 
     
    20662087            except: 
    20672088                logging.info("Failed to connect to www.sasview.org") 
    2068         self._process_version(version_info, standalone=event == None)     
    2069  
    2070          
    2071          
    2072 #          
    2073 #         try: 
    2074 #             req = urllib2.Request(config.__update_URL__) 
    2075 #             res = urllib2.urlopen(req) 
    2076 #             content = res.read().strip() 
    2077 #             logging.info("Connected to www.sasview.org. Latest version: %s" 
    2078 #                          % (content)) 
    2079 #             version_info = json.loads(content) 
    2080 #         except: 
    2081 #             logging.info("Failed to connect to www.sasview.org") 
    2082 #             version_info = {"version": "0.0.0"} 
    2083 #         self._process_version(version_info, standalone=event == None) 
     2089        self._process_version(version_info, standalone=event == None) 
    20842090 
    20852091    def _process_version(self, version_info, standalone=True): 
  • src/sas/sasgui/guiframe/panel_base.py

    rd85c194 r18b7ecb9  
    317317        """ 
    318318        return self._drag_flag 
    319      
     319 
     320    def _set_analysis(self, flag): 
     321        """ 
     322        Set the Analysis Save state flag and informs the manager 
     323        so it refreshes the menu/whole panel 
     324        """ 
     325        self._set_save_flag(flag) 
     326        if self._manager is not None: 
     327            wx.PostEvent(self._manager.parent, PanelOnFocusEvent(panel=self)) 
     328 
    320329    def _set_reset_flag(self, flag=True): 
    321330        """ 
Note: See TracChangeset for help on using the changeset viewer.