Changeset b96d2e1 in sasview for src/sas/qtgui


Ignore:
Timestamp:
Dec 14, 2018 6:47:38 AM (5 years ago)
Author:
wojciech
Branches:
ESS_GUI, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_sync_sascalc
Children:
59b925c1, 14673d52
Parents:
09b7da68
Message:

Saving current tab to the file in the model editor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Utilities/TabbedModelEditor.py

    rf2e199e rb96d2e1  
    322322        Save the current state of the Model Editor 
    323323        """ 
    324         # make sure we have the file handly ready 
    325         assert(self.filename != "") 
     324        filename = self.filename 
     325        if not self.tabWidget.currentWidget().is_python: 
     326            base, _ = os.path.splitext(filename) 
     327            filename = base + '.c' 
     328 
     329        # make sure we have the file handle ready 
     330        assert(filename != "") 
    326331        # Retrieve model string 
    327332        model_str = self.getModel()['text'] 
    328333        # Save the file 
    329         self.writeFile(self.filename, model_str) 
     334        self.writeFile(filename, model_str) 
    330335        # Update the tab title 
    331336        self.setTabEdited(False) 
    332337        # notify the user 
    333         msg = self.filename + " successfully saved." 
     338        msg = filename + " successfully saved." 
    334339        self.parent.communicate.statusBarUpdateSignal.emit(msg) 
    335340        logging.info(msg) 
Note: See TracChangeset for help on using the changeset viewer.