class MultimediaParadise::GUI::LibUI::ChangeMetadataWidget

Public Class Methods

new( run_already = true ) click to toggle source
#

initialize

#
# File lib/multimedia_paradise/gui/libui/change_metadata_widget/change_metadata_widget.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/multimedia_paradise/gui/libui/change_metadata_widget/change_metadata_widget.rb, line 43
def create_skeleton
  create_the_buttons
  create_the_entries
end
reset() click to toggle source
#

reset (reset tag)

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

run

#
# File lib/multimedia_paradise/gui/libui/change_metadata_widget/change_metadata_widget.rb, line 51
def run
  create_skeleton_then_connect_skeleton
  window = ui_padded_main_window(title?, width?, height?, 0)
  outer_vbox = padded_vbox

  
  button_open_file = button('Open file')
  button_open_file.on_clicked {
    filename = ui_open_file(window).to_s # This is the part that will open a local file.
    if File.exist? filename
      do_open_this_file(filename)
    end
  }
  outer_vbox << button_open_file # Add the button to the outer-vbox.

  # Input file to use:
  hbox1 = hbox
  hbox1.minimal(return_text1)
  hbox1.maximal(@entry_input_file)
  outer_vbox.minimal(hbox1)

  # Output file to use:
  hbox2 = hbox
  hbox2.minimal(return_text2)
  hbox2.maximal(entry2?)
  outer_vbox.minimal(hbox2)

  hbox3 = hbox
  hbox3.minimal(return_text3)
  hbox3.maximal(entry_title?)
  outer_vbox.minimal(hbox3)

  hbox4 = hbox
  hbox4.minimal(return_text4)
  hbox4.maximal(entry_comment?)
  outer_vbox.minimal(hbox4)

  hbox5 = hbox
  hbox5.minimal(return_text5)
  hbox5.maximal(entry_year?)
  outer_vbox.minimal(hbox5, 1)

  hbox6 = hbox
  hbox6.minimal(@button_run_the_sys_command)
  outer_vbox.minimal(hbox6)

  # ======================================================================= #
  # Add the quit-button:
  # ======================================================================= #
  hbox_with_the_quit_button = padded_hbox
  button_quit = quit_button
  hbox_with_the_quit_button.maximal(button_quit)
  outer_vbox.add_hsep
  outer_vbox.minimal(hbox_with_the_quit_button)
  outer_vbox.add_hsep

  window.add(outer_vbox)
  window.intelligent_exit
end