Changeset ba535a6 in sasview


Ignore:
Timestamp:
Apr 9, 2010 11:01:36 AM (15 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:
2fc9243
Parents:
f71c2de
Message:

change open in menu file to load data

Location:
guiframe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • guiframe/gui_manager.py

    rb91c736 rba535a6  
    4646import logging 
    4747 
     48 
     49 
     50def quit_guiframe(parent=None): 
     51    """ 
     52        Pop up message to make sure the user wants to quit the application 
     53    """ 
     54    message = "Do you really want to quit \n" 
     55    message += "this application?" 
     56    dial = wx.MessageDialog(parent, message, 'Question', 
     57                       wx.YES_NO|wx.NO_DEFAULT|wx.ICON_QUESTION) 
     58    if dial.ShowModal() == wx.ID_YES: 
     59        return True 
     60    else: 
     61        return False 
     62     
    4863class Plugin: 
    4964    """ 
     
    484499         
    485500        id = wx.NewId() 
    486         self.filemenu.Append(id, '&Open', 'Open a file') 
     501        self.filemenu.Append(id, '&Load Data', 'Load data file into the application') 
    487502        wx.EVT_MENU(self, id, self._on_open) 
    488503        #self.filemenu.AppendSeparator() 
     
    710725            Quit the application 
    711726        """ 
    712         import sys 
    713         wx.Frame.Close(self) 
    714         wx.Exit() 
    715         sys.exit() 
    716  
    717    
     727        flag = quit_guiframe(parent=self) 
     728        if flag: 
     729            import sys 
     730            wx.Frame.Close(self) 
     731            wx.Exit() 
     732            sys.exit() 
     733 
    718734    def _check_update(self, event=None):  
    719735        """ 
  • guiframe/local_perspectives/plotting/Plotter1D.py

    rc81140c rba535a6  
    327327            if hasattr(self.plots[self.graph.selected_plottable], "group_id"): 
    328328                new_plot.group_id = self.plots[self.graph.selected_plottable].group_id 
    329                 new_plot.id = self.plots[self.graph.selected_plottable].id 
     329                if hasattr(self.plots[self.graph.selected_plottable],"id"): 
     330                    new_plot.id = self.plots[self.graph.selected_plottable].id 
     331                else: 
     332                    new_plot.id = str(time.time()) 
    330333            else: 
    331334                new_plot.group_id = str(time.time()) 
     
    408411            if hasattr(self.plots[self.graph.selected_plottable], "group_id"): 
    409412                new_plot.group_id = self.plots[self.graph.selected_plottable].group_id 
    410                 new_plot.id = self.plots[self.graph.selected_plottable].id 
     413                if hasattr(self.plots[self.graph.selected_plottable],"id"): 
     414                    new_plot.id = self.plots[self.graph.selected_plottable].id 
     415                else: 
     416                    new_plot.id = str(time.time()) 
    411417            else: 
    412418                new_plot.group_id = str(time.time()) 
Note: See TracChangeset for help on using the changeset viewer.