Logo Search packages:      
Sourcecode: accerciser version File versions

def event_monitor::EventMonitor::_onSave (   self,
  button 
) [private]

Callback for 'save' button clicked. Saves the buffer in to the given 
filename.

@param button: Button that was clicked.
@type button: gtk.Button

Definition at line 452 of file event_monitor.py.

00452                            :
    '''
    Callback for 'save' button clicked. Saves the buffer in to the given 
    filename.
    
    @param button: Button that was clicked.
    @type button: gtk.Button
    '''
    save_dialog = gtk.FileChooserDialog(
      'Save monitor output',
      action=gtk.FILE_CHOOSER_ACTION_SAVE,
      buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL,
               gtk.STOCK_OK, gtk.RESPONSE_OK))
    save_dialog.set_do_overwrite_confirmation(True)
    save_dialog.set_default_response(gtk.RESPONSE_OK)
    response = save_dialog.run()
    save_dialog.show_all()
    if response == gtk.RESPONSE_OK:
      save_to = open(save_dialog.get_filename(), 'w')
      save_to.write(
        self.monitor_buffer.get_text(self.monitor_buffer.get_start_iter(),
                                     self.monitor_buffer.get_end_iter()))
      save_to.close()
    save_dialog.destroy()
  
  def _onClear(self, button):


Generated by  Doxygen 1.6.0   Back to index