444
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
513
514
515
516
517
518
519
520
521
522
523
|
# File 'lib/wiki_lyrics/gui/gui-qt3.rb', line 444
def initialize( values )
super( values )
setCaption( I18n.get( "gui.submitalbum.title", values["site_name"] ) )
artist_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.artist" )}</b>", self )
@artist_lineedit = Qt::LineEdit.new( values["artist"], self )
year_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.year" )}</b>", self )
@year_spinbox = Qt::SpinBox.new( self )
@year_spinbox.setMinValue( 1900 )
@year_spinbox.setMaxValue( Date.today().year )
@year_spinbox.setValue( values["year"].to_i() )
month_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.month" )}</b>", self )
@month_spinbox = Qt::SpinBox.new( self )
@month_spinbox.setMinValue( 0 )
@month_spinbox.setMaxValue( 12 )
@month_spinbox.setValue( values["month"].to_i() )
day_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.day" )}</b>", self )
@day_spinbox = Qt::SpinBox.new( self )
@day_spinbox.setMinValue( 0 )
@day_spinbox.setMaxValue( 31 )
@day_spinbox.setValue( values["day"].to_i() )
album_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.album" )}</b>", self )
@album_lineedit = Qt::LineEdit.new( values["album"], self )
image_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.image" )}</b>", self )
image_label.setAlignment( Qt::AlignLeft )
@image_path_lineedit = Qt::LineEdit.new( values["image_path"], self )
if ! values.include?( "image_path" )
@image_path_lineedit.setEnabled( false )
@image_path_lineedit.setText( I18n.get( "gui.submitalbum.coverfound" ) )
else
@image_button = Qt::PushButton.new( "...", self )
connect( @image_button, SIGNAL( "clicked()" ), self, SLOT( "browse_image()" ) )
end
@tracks_text = Qt::TextEdit.new( self )
@tracks_text.setWordWrap( Qt::TextEdit::NoWrap )
@tracks_text.setTextFormat( Qt::PlainText )
@tracks_text.setText( values["tracks"] )
@reviewed_checkbox = Qt::CheckBox.new( self )
@reviewed_checkbox.setChecked( false )
@reviewed_checkbox.setText( I18n.get( "gui.common.reviewed" ) )
buttons = create_action_buttons( "split", I18n.get( "gui.common.submit" ) )
image_layout = Qt::HBoxLayout.new( 5 )
image_layout.addWidget( @image_path_lineedit )
image_layout.addWidget( @image_button ) if @values.include?( "image_path" )
grid_layout = Qt::GridLayout.new( self )
grid_layout.setMargin( 5 )
grid_layout.setSpacing( 5 )
grid_layout.setColStretch( 1, 2 )
grid_layout.setColStretch( 3, 2 )
grid_layout.setColStretch( 5, 2 )
grid_layout.addWidget( artist_label, 0, 0, Qt::AlignRight )
grid_layout.addMultiCellWidget( @artist_lineedit, 0, 0, 1, 5 )
grid_layout.addWidget( album_label, 1, 0, Qt::AlignRight )
grid_layout.addMultiCellWidget( @album_lineedit, 1, 1, 1, 5 )
grid_layout.addWidget( year_label, 2, 0, Qt::AlignRight )
grid_layout.addWidget( @year_spinbox, 2, 1 )
grid_layout.addWidget( month_label, 2, 2, Qt::AlignRight )
grid_layout.addWidget( @month_spinbox, 2, 3 )
grid_layout.addWidget( day_label, 2, 4, Qt::AlignRight )
grid_layout.addWidget( @day_spinbox, 2, 5 )
grid_layout.addWidget( image_label, 3, 0, Qt::AlignRight )
grid_layout.addMultiCellLayout( image_layout, 3, 3, 1, 5 )
grid_layout.addMultiCellWidget( @tracks_text, 4, 4, 0, 5 )
grid_layout.addMultiCellWidget( @reviewed_checkbox, 5, 5, 0, 5 )
grid_layout.addMultiCellLayout( buttons, 6, 6, 0, 5 )
resize( 600, 400 )
end
|