module HardwareInformation::GUI::MountedHarddiscsModule
Constants
- HEIGHT
#¶ ↑
HEIGHT
¶ ↑#¶ ↑
- TITLE
#¶ ↑
TITLE
¶ ↑#¶ ↑
- USE_THIS_FONT
#¶ ↑
USE_THIS_FONT
¶ ↑#¶ ↑
- WIDTH
#¶ ↑
WIDTH
¶ ↑#¶ ↑
Public Instance Methods
border_size?()
click to toggle source
do_capture_and_analyse_the_output_determining_which_harddiscs_are_available()
click to toggle source
#¶ ↑
do_capture_and_analyse_the_output_determining_which_harddiscs_are_available
¶ ↑
#¶ ↑
# File lib/hardware_information/gui/shared_code/mounted_harddiscs/mounted_harddiscs_module.rb, line 80 def do_capture_and_analyse_the_output_determining_which_harddiscs_are_available result = run_the_main_system_command if result splitted = result.split("\n").select {|entry| entry.include?('/') } results = splitted.select {|inner_entry| inner_split = inner_entry.strip.split(' ') last_element = inner_split.last last_element == '/' } if results and !results.empty? results = results.first if results.is_a? Array if results.include? '%' # "/dev/root 2882176320 491973144 2243723560 18% /" splitted = results.split(' ') @mounted_on = splitted.first.strip @percentage_value = results.scan(/(\d{1,2})%/).flatten.first.to_i if is_on_gtk? hbox1 = hbox hbox1.minimal(text('Mounted on <b>'+@mounted_on+'</b>'), 10) hbox1.minimal(text('Percentage occupied: <b>'+@percentage_value.to_s+'%</b>'), 10) hbox1.minimal(return_the_progress_bar, 12) minimal(hbox1, 5) end end end end end
padding?()
click to toggle source
return_the_progress_bar()
click to toggle source
#¶ ↑
return_the_progress_bar
¶ ↑
#¶ ↑
# File lib/hardware_information/gui/shared_code/mounted_harddiscs/mounted_harddiscs_module.rb, line 56 def return_the_progress_bar progress_bar1 = progress_bar progress_bar1.fraction = (@percentage_value.to_f / 100.0) progress_bar1.set_text('Occupied disc space in %') return progress_bar1 end