Class: MultimediaParadise::GUI::LibUI::ChangeMetadataWidget

Inherits:
Object
  • Object
show all
Includes:
LibuiParadise::Extensions, ChangeMetadataWidgetModule
Defined in:
lib/multimedia_paradise/gui/libui/change_metadata_widget/change_metadata_widget.rb

Overview

MultimediaParadise::GUI::LibUI::ChangeMetadataWidget

Instance Method Summary collapse

Constructor Details

#initialize(run_already = true) ⇒ ChangeMetadataWidget

#

initialize

#


26
27
28
29
30
31
# 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

Instance Method Details

#create_skeletonObject

#

create_skeleton (create tag, skeleton tag)

#


43
44
45
46
# 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

#resetObject

#

reset (reset tag)

#


36
37
38
# File 'lib/multimedia_paradise/gui/libui/change_metadata_widget/change_metadata_widget.rb', line 36

def reset
  title_width_height(TITLE, WIDTH, HEIGHT)
end

#runObject

#

run

#


51
52
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# 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