Exemplo n.º 1
0
 def sl_add_button_cb(self, button, user_data=None):
     fs_dialog = JwsFileChooserDialog( parent= self.assistant,
                                       current_folder = self.current_folder,
                                       title=_("Open spectra..."))
     response = fs_dialog.run()
     if response == gtk.RESPONSE_OK:
         #En windows hay que recodificar los nombres de archivo!!
         fns = [fn.decode('utf-8') for fn in fs_dialog.get_filenames()]
     else:
         fns = None
     if fns:
         self.spectra_db.append_files(fns)
         self.current_folder = fs_dialog.get_current_folder().decode('utf-8')
     fs_dialog.destroy()
Exemplo n.º 2
0
 def blank_open_cb(self, button, user_data=None):
     fs_dialog = JwsFileChooserDialog( parent= self.assistant,
                                       current_folder = self.current_folder,
                                       title=_("Open spectrum..."))        
     fs_dialog.set_select_multiple(False)
     response = fs_dialog.run()
     if response == gtk.RESPONSE_OK:
         fn = fs_dialog.get_filename().decode('utf-8')
         header = jwslib.read_header(fn)
         if header:
             self.blank_entry.set_text(fn)
             self.blank_header = header
             self.current_folder = fs_dialog.get_current_folder().decode('utf-8')
     fs_dialog.destroy()
Exemplo n.º 3
0
 def sl_add_button_cb(self, button, user_data=None):
     fs_dialog = JwsFileChooserDialog(parent=self.assistant,
                                      current_folder=self.current_folder,
                                      title=_("Open spectra..."))
     response = fs_dialog.run()
     if response == gtk.RESPONSE_OK:
         #En windows hay que recodificar los nombres de archivo!!
         fns = [fn.decode('utf-8') for fn in fs_dialog.get_filenames()]
     else:
         fns = None
     if fns:
         self.spectra_db.append_files(fns)
         self.current_folder = fs_dialog.get_current_folder().decode(
             'utf-8')
     fs_dialog.destroy()