Class: QT3::SearchLyricsDialog

Inherits:
BaseDialog
  • Object
show all
Defined in:
lib/wiki_lyrics/gui/gui-qt3.rb

Instance Attribute Summary

Attributes inherited from BaseDialog

#values

Instance Method Summary collapse

Methods inherited from BaseDialog

#accepted

Constructor Details

#initialize(values) ⇒ SearchLyricsDialog

Returns a new instance of SearchLyricsDialog.



719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
# File 'lib/wiki_lyrics/gui/gui-qt3.rb', line 719

def initialize( values )
	super( values )

	setCaption( I18n.get( "gui.searchlyrics.title" ) )

	group = Qt::GroupBox.new( 2, Qt::Horizontal, I18n.get( "gui.searchlyrics.search" ), self )

	Qt::Label.new( I18n.get( "gui.common.artist" ), group )
	@artist_lineedit = Qt::LineEdit.new( values["artist"], group )

	Qt::Label.new( I18n.get( "gui.common.song" ), group )
	@title_lineedit = Qt::LineEdit.new( values["title"], group )

	Qt::Label.new( I18n.get( "gui.common.album" ), group )
	@album_lineedit = Qt::LineEdit.new( values["album"], group )

	Qt::Label.new( I18n.get( "gui.common.year" ), group )
	@year_spinbox = Qt::SpinBox.new( group )
	@year_spinbox.setMinValue( 1900 )
	@year_spinbox.setMaxValue( Date.today().year() )
	@year_spinbox.setValue( values["year"] )

	buttons = create_action_buttons()

	layout = Qt::VBoxLayout.new( self, 5 )
	layout.addWidget( group )
	layout.addLayout( buttons )

	resize( 300, 100 )
end

Instance Method Details

#acceptObject



750
751
752
753
754
755
756
757
758
# File 'lib/wiki_lyrics/gui/gui-qt3.rb', line 750

def accept()
	@values = {
		"artist" => @artist_lineedit.text(),
		"title"  => @title_lineedit.text(),
		"album"  => @album_lineedit.text(),
		"year"   => @year_spinbox.value(),
	}
	super()
end