~strainanalyser/strainanalyser/trunk

« back to all changes in this revision

Viewing changes to strainanalyser/dataset.py

  • Committer: Malcolm Scott
  • Date: 2010-10-17 23:37:54 UTC
  • Revision ID: launchpad@malc.org.uk-20101017233754-kikk4hvs7ujbdb8e
Don't allow user to save empty dataset

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
                self.destroy()
255
255
 
256
256
        def on_go_clicked(self, widget):
257
 
                self.compensated_dataset.refresh()
258
 
                if self.save_cb(self.cb_arg, self.compensated_dataset) != False:
259
 
                        self.destroy()
 
257
                if len(self.compensated_dataset) > 0:
 
258
                        self.compensated_dataset.refresh()
 
259
                        if self.save_cb(self.cb_arg, self.compensated_dataset) != False:
 
260
                                self.destroy()
 
261
                else:
 
262
                        self.errorbox("Cannot save",
 
263
                                        "Please add some data before attempting to save."
 
264
                                )
260
265
 
261
266
 
262
267
if __name__ == "__main__":