Class: SubProcessInspector

Inherits:
ArcadiaExt show all
Defined in:
ext/ae-subprocess-inspector/ae-subprocess-inspector.rb

Instance Attribute Summary collapse

Attributes inherited from ArcadiaExt

#arcadia, #name

Instance Method Summary collapse

Methods inherited from ArcadiaExt

#conf, #conf_array, #conf_default, #exec, #float_frame, #frame, #frame_def_visible?, #frame_domain, #frame_domain_default, #frame_visible?, #initialize, #maximize, #maximized?, #resize, #restore_default_conf

Constructor Details

This class inherits a constructor from ArcadiaExt

Instance Attribute Details

#processsObject (readonly)

Returns the value of attribute processs.



2
3
4
# File 'ext/ae-subprocess-inspector/ae-subprocess-inspector.rb', line 2

def processs
  @processs
end

Instance Method Details

#do_delete_process(_process) ⇒ Object



38
39
40
41
42
43
# File 'ext/ae-subprocess-inspector/ae-subprocess-inspector.rb', line 38

def do_delete_process(_process)
  @processs.delete(_process)
  if @processs.length == 0
    self.frame.free
  end
end

#on_before_build(_event) ⇒ Object



3
4
5
6
# File 'ext/ae-subprocess-inspector/ae-subprocess-inspector.rb', line 3

def on_before_build(_event)
  @processs = [] 
  Arcadia.attach_listener(self, SubProcessEvent)
end

#on_exit_query(_event) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'ext/ae-subprocess-inspector/ae-subprocess-inspector.rb', line 13

def on_exit_query(_event)
  _event.can_exit=true
  @processs.each{|pr|
    if !pr.nil? 
      message = "Some sub process are running! Exit anyware?"
      r=Arcadia.dialog(self,
          'type'=>'yes_no', 
          'level'=>'warning',
          'title'=> 'Confirm exit', 
          'msg'=>message)
      if r=="no"
        _event.can_exit=false
        _event.break
      end
      break   
    end
  }
end

#on_finalize(_event) ⇒ Object



32
33
34
35
36
# File 'ext/ae-subprocess-inspector/ae-subprocess-inspector.rb', line 32

def on_finalize(_event)
  @processs.each{|pr|
    pr.event.abort_action.call if !pr.nil?
  }
end

#on_sub_process(_event) ⇒ Object



8
9
10
11
# File 'ext/ae-subprocess-inspector/ae-subprocess-inspector.rb', line 8

def on_sub_process(_event)
  self.frame.show_anyway
  @processs << SubProcessWidget.new(self, _event)
end