Class: QT3::SearchLyricsDialog
- Inherits:
-
BaseDialog
- Object
- Qt::Dialog
- BaseDialog
- QT3::SearchLyricsDialog
- Defined in:
- lib/wiki_lyrics/gui/gui-qt3.rb
Instance Attribute Summary
Attributes inherited from BaseDialog
Instance Method Summary collapse
- #accept ⇒ Object
-
#initialize(values) ⇒ SearchLyricsDialog
constructor
A new instance of SearchLyricsDialog.
Methods inherited from BaseDialog
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"] ) = () layout = Qt::VBoxLayout.new( self, 5 ) layout.addWidget( group ) layout.addLayout( ) resize( 300, 100 ) end |
Instance Method Details
#accept ⇒ Object
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 |