445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
|
# File 'lib/wiki_lyrics/gui/gui-tk.rb', line 445
def initialize( values )
super( values )
set_size( 400, 230 )
@shell.title( I18n.get( "gui.pluginsmanager.title", @values["script_name"] ) )
label = Label.new( @shell, I18n.get( "gui.pluginsmanager.sites" ) )
label.grid( "row"=>1, "column"=>1, "columnspan"=>4, "sticky"=>"w" )
frame = TkFrame.new( @shell )
frame.grid( "row"=>2, "rowspan"=>4, "column"=>2, "sticky"=>"nesw" )
@used_plugins_list = TkListbox.new( frame, "selectmode" => "single" )
@values["used_plugins"].each() { |plugin| @used_plugins_list.insert( "end", plugin ) }
@used_plugins_list.pack( "side"=>"left", "fill"=>"both", "expand"=>true )
y_scroll_bar = TkScrollbar.new( frame, "orient"=>"ver" )
y_scroll_bar.command( proc { |*args| @used_plugins_list.yview( *args ) } )
y_scroll_bar.pack( "side"=>"right", "fill"=>"y" )
@used_plugins_list.yscrollcommand( proc { |first, last| y_scroll_bar.set( first, last ) } )
frame = TkFrame.new( @shell )
frame.grid( "row"=>2, "rowspan"=>4, "column"=>4, "sticky"=>"nesw" )
@unused_plugins_list = TkListbox.new( frame, "selectmode" => "single" )
@values["unused_plugins"].each() { |plugin| @unused_plugins_list.insert( "end", plugin ) }
@unused_plugins_list.pack( "side"=>"left", "fill"=>"both", "expand"=>true )
y_scroll_bar = TkScrollbar.new( frame, "orient"=>"ver" )
y_scroll_bar.command( proc { |*args| @unused_plugins_list.yview( *args ) } )
y_scroll_bar.pack( "side"=>"right", "fill"=>"y" )
@unused_plugins_list.yscrollcommand( proc { |first, last| y_scroll_bar.set( first, last ) } )
@move_up_button = Button.new( @shell, I18n.get( "gui.pluginsmanager.sites.moveup" ) )
@move_up_button.command( proc { move_up() } )
@move_up_button.grid( "row"=>3, "column"=>1, "sticky"=>"ew" )
@move_down_button = Button.new( @shell, I18n.get( "gui.pluginsmanager.sites.movedown" ) )
@move_down_button.command( proc { move_down() } )
@move_down_button.grid( "row"=>4, "column"=>1, "sticky"=>"ew" )
@add_button = Button.new( @shell, I18n.get( "gui.pluginsmanager.sites.add" ) )
@add_button.command( proc { add_plugin() } )
@add_button.grid( "row"=>3, "column"=>3, "sticky"=>"ew" )
@remove_button = Button.new( @shell, I18n.get( "gui.pluginsmanager.sites.remove" ) )
@remove_button.command( proc { remove_plugin() } )
@remove_button.grid( "row"=>4, "column"=>3, "sticky"=>"ew" )
@cleanup_lyrics_checkbox = CheckBox.new( @shell, I18n.get( "gui.pluginsmanager.misc.cleanup" ) )
@cleanup_lyrics_checkbox.set_checked( @values["cleanup_lyrics"].to_s() == "true" )
@cleanup_lyrics_checkbox.grid( "row"=>6, "column"=>1, "columnspan"=>4, "sticky"=>"w" )
@single_threaded_checkbox = CheckBox.new( @shell, I18n.get( "gui.pluginsmanager.misc.singlethreaded" ) )
@single_threaded_checkbox.set_checked( @values["single_threaded"].to_s() == "true" )
@single_threaded_checkbox.grid( "row"=>7, "column"=>1, "columnspan"=>4, "sticky"=>"w" )
@write_log_checkbox = CheckBox.new( @shell, I18n.get( "gui.pluginsmanager.misc.writelog", "$HOME/.wikilyrics.log" ) )
@write_log_checkbox.set_checked( @values["write_log"].to_s() == "true" )
@write_log_checkbox.grid( "row"=>8, "column"=>1, "columnspan"=>4, "sticky"=>"w" )
buttons = create_action_buttons()
buttons.grid( "row"=>9, "column"=>1, "columnspan"=>4, "sticky"=>"ew" )
update_accept_button()
@shell.grid_rowconfigure( 2, "weight"=>1 )
@shell.grid_rowconfigure( 5, "weight"=>1 )
@shell.grid_columnconfigure( 2, "weight"=>1 )
@shell.grid_columnconfigure( 4, "weight"=>1 )
end
|