Class: Roebe::GUI::LibUI::Md5Comparer

Inherits:
Object
  • Object
show all
Includes:
LibuiParadise::Extensions, Md5ComparerModule
Defined in:
lib/roebe/gui/libui/md5_comparer/md5_comparer.rb

Overview

Roebe::GUI::LibUI::Md5Comparer

Instance Method Summary collapse

Constructor Details

#initialize(run_already = true) ⇒ Md5Comparer

#

initialize

#


26
27
28
29
30
31
# File 'lib/roebe/gui/libui/md5_comparer/md5_comparer.rb', line 26

def initialize(
    run_already = true
  )
  reset
  run if run_already
end

Instance Method Details

#create_the_main_windowObject

#

create_the_main_window

#


43
44
45
46
47
48
# File 'lib/roebe/gui/libui/md5_comparer/md5_comparer.rb', line 43

def create_the_main_window
  # ======================================================================= #
  # === @window
  # ======================================================================= #
  @window = ui_padded_main_window(title?, width?, height?, 0)
end

#resetObject

#

reset (reset tag)

#


36
37
38
# File 'lib/roebe/gui/libui/md5_comparer/md5_comparer.rb', line 36

def reset
  title_width_height(TITLE, WIDTH, HEIGHT)
end

#runObject

#

run

#


53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/roebe/gui/libui/md5_comparer/md5_comparer.rb', line 53

def run
  create_the_main_window
  create_skeleton_then_connect_skeleton
  outer_vbox = padded_vbox
  outer_vbox.minimal(@header_text, 0)
  outer_vbox.add_hsep

  ::LibUI.grid_append(@grid, text2?,  0, 0, 1, 1, 0, 0, 1, 0)
  ::LibUI.grid_append(@grid, @entry1, 1, 0, 2, 1, 0, 0, 1, 0)

  file_chooser_button = button('Open file')
  file_chooser_button.on_clicked {
    filename = ui_open_file(window).to_s # This is the part that will open a local file.
    @entry2.set_text(filename)
  }

  ::LibUI.grid_append(@grid, text3?,                        0, 1, 1, 1, 0, 0, 1, 0) # left, top, xspan, yspan
  ::LibUI.grid_append(@grid, entry2?,                       1, 1, 2, 1, 0, 0, 1, 0) # left, top, xspan, yspan
  ::LibUI.grid_append(@grid, file_chooser_button,           3, 1, 1, 1, 0, 0, 1, 0) # left, top, xspan, yspan

  ::LibUI.grid_append(@grid, text4?,                        0, 2, 1, 1, 0, 0, 1, 0) # left, top, xspan, yspan
  ::LibUI.grid_append(@grid, entry3?,                       1, 2, 2, 1, 0, 0, 1, 0) # left, top, xspan, yspan
  ::LibUI.grid_append(@grid, @button_evaluate_the_md5sum,   3, 2, 1, 1, 0, 0, 1, 0)

  outer_vbox.maximal(@grid)
  outer_vbox.add_hsep
  outer_vbox.minimal(quit_button)

  @window.add(outer_vbox)
  @window.intelligent_exit
end