Class: Progress_bar

Inherits:
Qt::Widget
  • Object
show all
Defined in:
lib/class/Progress_bar.rb

Instance Method Summary collapse

Constructor Details

#initialize(status) ⇒ Progress_bar

Returns a new instance of Progress_bar.



11
12
13
14
15
16
17
18
19
# File 'lib/class/Progress_bar.rb', line 11

def initialize(status)
  super()
  @pgb_ui = Ui_Progress_bar.new
  centerWindow(self)
  @pgb_ui.setupUi(self)
  self.update_status(status)
  @pgb_ui.lbl_close.setEnabled(false)
  self.display_time("Total duration:")
end

Instance Method Details

#display_time(time) ⇒ Object



29
30
31
# File 'lib/class/Progress_bar.rb', line 29

def display_time(time)
  @pgb_ui.lbl_time.setText(time)
end

#update_status(status) ⇒ Object



21
22
23
# File 'lib/class/Progress_bar.rb', line 21

def update_status(status)
  @pgb_ui.lbl_status.setText(status)
end

#update_value(value) ⇒ Object



25
26
27
# File 'lib/class/Progress_bar.rb', line 25

def update_value(value)
  @pgb_ui.pgb.setValue(value) if value <= 100 && value >= 0
end