class HardwareInformation::GUI::LibUI::MountedHarddiscs

Public Class Methods

new( run_already = true ) click to toggle source
#

initialize

#
# File lib/hardware_information/gui/libui/mounted_harddiscs/mounted_harddiscs.rb, line 26
def initialize(
    run_already = true
  )
  reset
  run if run_already
end

Public Instance Methods

create_skeleton() click to toggle source
#

create_skeleton (create tag, skeleton tag)

#
# File lib/hardware_information/gui/libui/mounted_harddiscs/mounted_harddiscs.rb, line 43
def create_skeleton
  # ======================================================================= #
  # === @window
  # ======================================================================= #
  @window = ui_padded_main_window(title?, width?, height?, 0)
end
reset() click to toggle source
#

reset (reset tag)

#
# File lib/hardware_information/gui/libui/mounted_harddiscs/mounted_harddiscs.rb, line 36
def reset
  title_width_height(TITLE, WIDTH, HEIGHT)
end
run() click to toggle source
#

run

#
# File lib/hardware_information/gui/libui/mounted_harddiscs/mounted_harddiscs.rb, line 53
def run
  create_skeleton_then_connect_skeleton
  outer_vbox = padded_vbox
  do_capture_and_analyse_the_output_determining_which_harddiscs_are_available
  # ======================================================================= #
  # First add the two buttons on top:
  # ======================================================================= #
  outer_vbox.add_hsep

  grid = ui_padded_grid
  #                         widget, left, top, xspan, yspan, hexpand, halign, vexpand, valign
  grid.hash_grid(
    text('Available harddiscs:'), left: 0, top: 0, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 1, valign: 0
  )
  
  hbox1 = hbox
  hbox1.minimal( text('Mounted on <b>'+@mounted_on+'</b> ') )
  hbox1.minimal(text('Percentage occupied: '+@percentage_value.to_s+'%  '))
  hbox1.minimal(return_the_progress_bar)
  grid.hash_grid(
    hbox1, left: 0, top: 1, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 1, valign: 0
  )

  grid.hash_grid(
    quit_button, left: 0, top: 2, xspan: 1, yspan: 1, hexpand: 0, halign: 0.5, vexpand: 0, valign: 0
  )
  outer_vbox.maximal(grid)
  @window.add(outer_vbox)
  @window.intelligent_exit
end