586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
|
# File 'lib/wiki_lyrics/gui/gui-tk.rb', line 586
def initialize( values )
super( values )
set_size( 360, 210 )
@shell.title( I18n.get( "gui.wikiplugin.title", values["site_name"] ) )
label = Label.new( @shell, I18n.get( "gui.wikiplugin.general" ) )
label.grid( "row"=>1, "column"=>1, "columnspan"=>4, "sticky"=>"w" )
@submit_checkbox = CheckBox.new( @shell, I18n.get( "gui.wikiplugin.general.submit", values["site_name"] ) )
@submit_checkbox.set_checked( values["submit"].to_s() == "true" )
@submit_checkbox.command( proc { toggle_submit_checked() } )
@submit_checkbox.grid( "row"=>2, "column"=>1, "columnspan"=>3, "sticky"=>"w" )
@review_checkbox = CheckBox.new( @shell, I18n.get( "gui.wikiplugin.general.review" ) )
@review_checkbox.command( proc { toggle_review_checked() } )
@review_checkbox.set_enabled( @submit_checkbox.is_checked() )
@review_checkbox.set_checked( @review_checkbox.is_enabled() && values["review"].to_s() == "true" )
@review_checkbox.grid( "row"=>3, "column"=>1, "columnspan"=>3, "sticky"=>"w" )
@prompt_autogen_checkbox = CheckBox.new( @shell, I18n.get( "gui.wikiplugin.general.autogen" ) )
@prompt_autogen_checkbox.set_enabled( @review_checkbox.is_checked() )
@prompt_autogen_checkbox.set_checked( @prompt_autogen_checkbox.is_enabled() && values["prompt_autogen"].to_s() == "true" )
@prompt_autogen_checkbox.grid( "row"=>4, "column"=>1, "columnspan"=>3, "sticky"=>"w" )
@prompt_no_lyrics_checkbox = CheckBox.new( @shell, I18n.get( "gui.wikiplugin.general.nolyrics" ) )
@prompt_no_lyrics_checkbox.set_enabled( @review_checkbox.is_checked() )
@prompt_no_lyrics_checkbox.set_checked( @prompt_no_lyrics_checkbox.is_enabled() && values["prompt_no_lyrics"].to_s() == "true" )
@prompt_no_lyrics_checkbox.grid( "row"=>5, "column"=>1, "columnspan"=>3, "sticky"=>"w" )
label = Label.new( @shell, I18n.get( "gui.wikiplugin.login" ) )
label.grid( "row"=>7, "column"=>1, "columnspan"=>4, "sticky"=>"w" )
label = Label.new( @shell, I18n.get( "gui.wikiplugin.login.username" ) )
label.grid( "row"=>8, "column"=>1 )
@username_lineedit = TextEdit.new( @shell, values["username"] )
@username_lineedit.grid( "row"=>8, "column"=>2, "columnspan"=>2, "sticky"=>"ew" )
label = Label.new( @shell, I18n.get( "gui.wikiplugin.login.password" ) )
label.grid( "row"=>9, "column"=>1 )
@password_lineedit = TextEdit.new( @shell, values["password"], "show"=>"*" )
@password_lineedit.grid( "row"=>9, "column"=>2, "columnspan"=>2, "sticky"=>"ew" )
@username_lineedit.bind( "KeyRelease", proc { update_accept_button_state() } )
buttons = create_action_buttons()
buttons.grid( "row"=>11, "column"=>1, "columnspan"=>4, "sticky"=>"ew" )
update_accept_button_state()
@shell.grid_rowconfigure( 6, "weight"=>1 )
@shell.grid_rowconfigure( 10, "weight"=>5 )
@shell.grid_columnconfigure( 2, "weight"=>1 )
@shell.grid_columnconfigure( 3, "weight"=>1 )
end
|