773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
|
# File 'lib/wiki_lyrics/gui/gui-tk.rb', line 773
def initialize( values )
super( values )
set_size( 600, 400 )
@shell.title( I18n.get( "gui.submitalbum.title", values["site_name"] ) )
artist_label = Label.new( @shell, I18n.get( "gui.common.artist" ) )
artist_label.grid( "row"=>1, "column"=>1, "sticky"=>"ew" )
@artist_lineedit = TextEdit.new( @shell, values["artist"] )
@artist_lineedit.grid( "row"=>1, "column"=>2, "columnspan"=>5, "sticky"=>"ew" )
album_label = Label.new( @shell, I18n.get( "gui.common.album" ) )
album_label.grid( "row"=>2, "column"=>1, "sticky"=>"ew" )
@album_lineedit = TextEdit.new( @shell, values["album"] )
@album_lineedit.grid( "row"=>2, "column"=>2, "columnspan"=>5, "sticky"=>"ew" )
label = Label.new( @shell, I18n.get( "gui.common.year" ) )
label.grid( "row"=>3, "column"=>1, "sticky"=>"ew" )
@year_spinbox = SpinBox.new( @shell, values["year"].to_i() )
@year_spinbox.set_range( 1900, Date.today().year )
@year_spinbox.grid( "row"=>3, "column"=>2, "sticky"=>"ew" )
label = Label.new( @shell, I18n.get( "gui.common.month" ) )
label.grid( "row"=>3, "column"=>3, "sticky"=>"ew" )
@month_spinbox = SpinBox.new( @shell, values["month"].to_i() )
@month_spinbox.set_range( 0, 12 )
@month_spinbox.grid( "row"=>3, "column"=>4, "sticky"=>"ew" )
label = Label.new( @shell, I18n.get( "gui.common.day" ) )
label.grid( "row"=>3, "column"=>5, "sticky"=>"ew" )
@day_spinbox = SpinBox.new( @shell, values["day"].to_i() )
@day_spinbox.set_range( 0, 31 )
@day_spinbox.grid( "row"=>3, "column"=>6, "sticky"=>"ew" )
image_label = Label.new( @shell, I18n.get( "gui.common.image" ) )
image_label.grid( "row"=>4, "column"=>1, "sticky"=>"ew" )
image_frame = TkFrame.new( @shell )
image_frame.grid( "row"=>4, "column"=>2, "columnspan"=>5, "sticky"=>"ew" )
@image_path_lineedit = TextEdit.new( image_frame, @values.include?( "image_path" ) ? @values["image_path"] : I18n.get( "gui.submitalbum.coverfound" ) )
@image_path_lineedit.set_enabled( @values.include?( "image_path" ) )
@image_path_lineedit.pack( "side"=>"left", "fill"=>"both", "expand"=>true )
if values.include?( "image_path" )
@image_button = Button.new( image_frame, "..." )
@image_button.command( proc { browse_image() } )
@image_button.pack( "side"=>"right" )
end
tracks_frame = TkFrame.new( @shell )
tracks_frame.grid( "row"=>5, "column"=>1, "columnspan"=>6, "sticky"=>"nesw" )
bar = TkScrollbar.new( tracks_frame, "orient"=>"ver" )
bar.pack( "side"=>"right", "fill"=>"y" )
@tracks_text = TextArea.new( tracks_frame ) { yscrollcommand { |first, last| bar.set( first, last ) } }
@tracks_text.set_text( values["tracks"] )
@tracks_text.pack( "side"=>"left", "fill"=>"both", "expand"=>true )
bar.command( proc { |*args| @tracks_text.yview( *args ) } )
@reviewed_checkbox = CheckBox.new( @shell, I18n.get( "gui.common.reviewed" ) )
@reviewed_checkbox.set_checked( false )
@reviewed_checkbox.grid( "row"=>6, "column"=>1, "columnspan"=>6, "sticky"=>"w" );
buttons = create_action_buttons( "split", I18n.get( "gui.common.submit" ) )
buttons.grid( "row"=>7, "column"=>1, "columnspan"=>6, "sticky"=>"ew" )
@shell.grid_rowconfigure( 5, "weight"=>1 )
6.times { |idx| @shell.grid_columnconfigure( idx+1, "weight"=>1 ) }
end
|