lyrics-ebook 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. data/LICENSE +340 -0
  2. data/README +46 -0
  3. data/bin/lyrics-ebook +47 -0
  4. data/lib/eeepub/LICENSE +20 -0
  5. data/lib/eeepub/README.md +77 -0
  6. data/lib/eeepub/Rakefile +49 -0
  7. data/lib/eeepub/VERSION +1 -0
  8. data/lib/eeepub/examples/files/bar.html +42 -0
  9. data/lib/eeepub/examples/files/foo.html +42 -0
  10. data/lib/eeepub/examples/simple_epub.rb +25 -0
  11. data/lib/eeepub/lib/eeepub.rb +17 -0
  12. data/lib/eeepub/lib/eeepub/container_item.rb +108 -0
  13. data/lib/eeepub/lib/eeepub/easy.rb +100 -0
  14. data/lib/eeepub/lib/eeepub/maker.rb +127 -0
  15. data/lib/eeepub/lib/eeepub/ncx.rb +68 -0
  16. data/lib/eeepub/lib/eeepub/ocf.rb +112 -0
  17. data/lib/eeepub/lib/eeepub/opf.rb +148 -0
  18. data/lib/eeepub/spec/eeepub/easy_spec.rb +66 -0
  19. data/lib/eeepub/spec/eeepub/maker_spec.rb +124 -0
  20. data/lib/eeepub/spec/eeepub/ncx_spec.rb +80 -0
  21. data/lib/eeepub/spec/eeepub/ocf_spec.rb +43 -0
  22. data/lib/eeepub/spec/eeepub/opf_spec.rb +262 -0
  23. data/lib/eeepub/spec/eeepub_spec.rb +4 -0
  24. data/lib/eeepub/spec/spec_helper.rb +12 -0
  25. data/lib/lyrics_ebook.rb +71 -0
  26. data/lib/lyrics_ebook/cache2html.rb +33 -0
  27. data/lib/lyrics_ebook/cache_manager.rb +77 -0
  28. data/lib/lyrics_ebook/lyric.rb +32 -0
  29. data/lib/lyrics_ebook/lyric_download.rb +50 -0
  30. data/lib/lyrics_ebook/lyrics2html.rb +106 -0
  31. data/lib/lyrics_ebook/mini_lyrics_parser.rb +26 -0
  32. data/lib/lyrics_ebook/mp3_parser.rb +37 -0
  33. data/lib/wiki_lyrics/amarok/COPYING +340 -0
  34. data/lib/wiki_lyrics/amarok/README +51 -0
  35. data/lib/wiki_lyrics/amarok/amarok.rb +355 -0
  36. data/lib/wiki_lyrics/amarok/pluginadapter.rb +113 -0
  37. data/lib/wiki_lyrics/amarok/plugins.rb +95 -0
  38. data/lib/wiki_lyrics/amarok/wikilyrics.rb +578 -0
  39. data/lib/wiki_lyrics/amarok/wikilyrics.spec +4 -0
  40. data/lib/wiki_lyrics/amarok/wikipluginadapter.rb +392 -0
  41. data/lib/wiki_lyrics/cli/optionsparser.rb +228 -0
  42. data/lib/wiki_lyrics/cli/pluginadapter.rb +56 -0
  43. data/lib/wiki_lyrics/cli/plugins.rb +79 -0
  44. data/lib/wiki_lyrics/cli/wikilyrics.rb +178 -0
  45. data/lib/wiki_lyrics/cli/wikipluginadapter.rb +140 -0
  46. data/lib/wiki_lyrics/docs/COPYING +340 -0
  47. data/lib/wiki_lyrics/docs/ChangeLog +293 -0
  48. data/lib/wiki_lyrics/docs/HOWTO.pdf +0 -0
  49. data/lib/wiki_lyrics/docs/HOWTO.tex +151 -0
  50. data/lib/wiki_lyrics/docs/HOWTO.txt +139 -0
  51. data/lib/wiki_lyrics/docs/README +45 -0
  52. data/lib/wiki_lyrics/docs/TODO +12 -0
  53. data/lib/wiki_lyrics/gui/gui-gtk.rb +945 -0
  54. data/lib/wiki_lyrics/gui/gui-qt3.rb +785 -0
  55. data/lib/wiki_lyrics/gui/gui-qt4.rb +845 -0
  56. data/lib/wiki_lyrics/gui/gui-tk.rb +1104 -0
  57. data/lib/wiki_lyrics/gui/gui.rb +268 -0
  58. data/lib/wiki_lyrics/gui/test.rb +74 -0
  59. data/lib/wiki_lyrics/i18n/README +1 -0
  60. data/lib/wiki_lyrics/i18n/en.rb +181 -0
  61. data/lib/wiki_lyrics/i18n/es.rb +181 -0
  62. data/lib/wiki_lyrics/i18n/i18n.rb +126 -0
  63. data/lib/wiki_lyrics/i18n/sk.rb +174 -0
  64. data/lib/wiki_lyrics/itrans/COPYRIGHT +31 -0
  65. data/lib/wiki_lyrics/itrans/itrans +0 -0
  66. data/lib/wiki_lyrics/itrans/itrans.txt +8 -0
  67. data/lib/wiki_lyrics/itrans/lyric.txt +23 -0
  68. data/lib/wiki_lyrics/itrans/udvng.ifm +206 -0
  69. data/lib/wiki_lyrics/lyrics.rb +567 -0
  70. data/lib/wiki_lyrics/lyrics_AZLyrics.rb +113 -0
  71. data/lib/wiki_lyrics/lyrics_DarkLyrics.rb +124 -0
  72. data/lib/wiki_lyrics/lyrics_Giitaayan.rb +124 -0
  73. data/lib/wiki_lyrics/lyrics_Jamendo.rb +166 -0
  74. data/lib/wiki_lyrics/lyrics_LeosLyrics.rb +142 -0
  75. data/lib/wiki_lyrics/lyrics_LoudSongs.rb +135 -0
  76. data/lib/wiki_lyrics/lyrics_LyricWiki.rb +329 -0
  77. data/lib/wiki_lyrics/lyrics_LyricsDownload.rb +118 -0
  78. data/lib/wiki_lyrics/lyrics_LyricsMania.rb +141 -0
  79. data/lib/wiki_lyrics/lyrics_Lyriki.rb +287 -0
  80. data/lib/wiki_lyrics/lyrics_SeekLyrics.rb +108 -0
  81. data/lib/wiki_lyrics/lyrics_Sing365.rb +103 -0
  82. data/lib/wiki_lyrics/lyrics_TerraLetras.rb +126 -0
  83. data/lib/wiki_lyrics/mediawikilyrics.rb +1464 -0
  84. data/lib/wiki_lyrics/tests/plugin_tests.rb +161 -0
  85. data/lib/wiki_lyrics/tests/tests.rb +74 -0
  86. data/lib/wiki_lyrics/utils/formdata.rb +56 -0
  87. data/lib/wiki_lyrics/utils/htmlentities.rb +291 -0
  88. data/lib/wiki_lyrics/utils/http.rb +198 -0
  89. data/lib/wiki_lyrics/utils/itrans.rb +160 -0
  90. data/lib/wiki_lyrics/utils/kde.rb +88 -0
  91. data/lib/wiki_lyrics/utils/logger.rb +123 -0
  92. data/lib/wiki_lyrics/utils/strings.rb +378 -0
  93. data/lib/wiki_lyrics/utils/xmlhash.rb +111 -0
  94. data/lib/wiki_lyrics/wikilyrics.kdevelop +152 -0
  95. data/lib/wiki_lyrics/wikilyrics.kdevses +18 -0
  96. data/lib/wiki_lyrics/win/gtk_fix.bat +3 -0
  97. data/lib/wiki_lyrics/win/tk_fix.bat +3 -0
  98. data/lib/wiki_lyrics/win/wikilyrics.bat +4 -0
  99. data/lib/wiki_lyrics/win/win_fix.rb +52 -0
  100. data/templates/art_.erb.xhtml +29 -0
  101. data/templates/artists.erb.xhtml +19 -0
  102. data/templates/cover.erb.xhtml +22 -0
  103. data/test/cache_manager_test.rb +73 -0
  104. data/test/data/artist name/title name.lyric +6 -0
  105. data/test/lyric_test.rb +41 -0
  106. metadata +194 -0
@@ -0,0 +1,845 @@
1
+ # Copyright (C) 2006-2008 by Sergio Pistone
2
+ # sergio_pistone@yahoo.com.ar
3
+ #
4
+ # This program is free software; you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation; either version 2 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program; if not, write to the
16
+ # Free Software Foundation, Inc.,
17
+ # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
+
19
+ begin
20
+ require "Qt4"
21
+ rescue LoadError
22
+ require "Qt"
23
+ raise LoadError.new( "Wrong Qt version found (Qt4 expected but Qt3 found)" ) if ! defined?( Qt::StringListModel )
24
+ end
25
+ require "date"
26
+ require File.expand_path( File.dirname( __FILE__ ) + "/../i18n/i18n" )
27
+ $KCODE="u" # unicode support
28
+
29
+ module QT4
30
+
31
+ def QT4.empty_string?( text )
32
+ return text ? (text.empty? ? true : text.strip().empty? ) : true
33
+ end
34
+
35
+ class BaseDialog < Qt::Dialog
36
+
37
+ attr_reader :values
38
+
39
+ def initialize( values )
40
+ super( nil )
41
+ @values = values
42
+ end
43
+
44
+ def create_action_buttons( mode="right", accept_text=nil, cancel_text= nil )
45
+ accept_text = QT4.empty_string?( accept_text ) ? I18n.get( "gui.common.accept" ) : accept_text
46
+ cancel_text = QT4.empty_string?( cancel_text ) ? I18n.get( "gui.common.cancel" ) : cancel_text
47
+ @accept_button = Qt::PushButton.new( accept_text, self )
48
+ @cancel_button = Qt::PushButton.new( cancel_text, self )
49
+ connect( @accept_button, SIGNAL( "clicked()" ), self, SLOT( "accept()" ) )
50
+ connect( @cancel_button, SIGNAL( "clicked()" ), self, SLOT( "reject()" ) )
51
+ if mode == "left"
52
+ hbox = Qt::HBoxLayout.new()
53
+ hbox.spacing = 4
54
+ hbox.setDirection( Qt::BoxLayout::LeftToRight )
55
+ hbox.addWidget( @accept_button )
56
+ hbox.addWidget( @cancel_button )
57
+ hbox.addStretch()
58
+ elsif mode == "split"
59
+ hbox = Qt::HBoxLayout.new()
60
+ hbox.spacing = 4
61
+ hbox.addWidget( @accept_button, 1 )
62
+ hbox.addWidget( @cancel_button, 1 )
63
+ else
64
+ hbox = Qt::HBoxLayout.new()
65
+ hbox.spacing = 4
66
+ hbox.addStretch()
67
+ hbox.addWidget( @accept_button )
68
+ hbox.addWidget( @cancel_button )
69
+ end
70
+ return hbox
71
+ end
72
+ protected :create_action_buttons
73
+
74
+ def accepted()
75
+ return result() == Qt::Dialog.Accepted
76
+ end
77
+ end
78
+
79
+ class StringListModel < Qt::StringListModel
80
+
81
+ def initialize( name )
82
+ super()
83
+ @name = name
84
+ end
85
+
86
+ def flags( index )
87
+ return Qt::ItemIsSelectable | Qt::ItemIsEnabled
88
+ end
89
+
90
+ def headerData( section, orientation, role = Qt::DisplayRole )
91
+ return Qt::Variant.new() if role != Qt::DisplayRole
92
+ return Qt::Variant.new() if orientation != Qt::Horizontal
93
+ return Qt::Variant.new( @name )
94
+ end
95
+
96
+ end
97
+
98
+ class PluginsManagerDialog < BaseDialog
99
+
100
+ slots "move_up()", "move_down()", "add_plugin()", "remove_plugin()"
101
+
102
+ def initialize( values )
103
+ super( values )
104
+
105
+ setWindowTitle( I18n.get( "gui.pluginsmanager.title", @values["script_name"] ) )
106
+
107
+ sites_group = Qt::GroupBox.new( I18n.get( "gui.pluginsmanager.sites" ), self )
108
+
109
+ @move_up_button = Qt::PushButton.new( I18n.get( "gui.pluginsmanager.sites.moveup" ), sites_group )
110
+ @move_down_button = Qt::PushButton.new( I18n.get( "gui.pluginsmanager.sites.movedown" ), sites_group )
111
+
112
+ @used_plugins_model = StringListModel.new( I18n.get( "gui.pluginsmanager.sites.inuse" ) )
113
+ @used_plugins_model.setStringList( @values["used_plugins"] )
114
+ @used_plugins_view = Qt::TreeView.new( sites_group )
115
+ @used_plugins_view.rootIsDecorated = false
116
+ @used_plugins_view.sortingEnabled = false
117
+ @used_plugins_view.allColumnsShowFocus = true
118
+ @used_plugins_view.setModel( @used_plugins_model )
119
+
120
+ @add_button = Qt::PushButton.new( I18n.get( "gui.pluginsmanager.sites.add" ), sites_group )
121
+ @remove_button = Qt::PushButton.new( I18n.get( "gui.pluginsmanager.sites.remove" ), sites_group )
122
+
123
+ @unused_plugins_model = StringListModel.new( I18n.get( "gui.pluginsmanager.sites.available" ) )
124
+ @unused_plugins_model.setStringList( @values["unused_plugins"] )
125
+ @unused_plugins_view = Qt::TreeView.new( sites_group )
126
+ @unused_plugins_view.rootIsDecorated = false
127
+ @unused_plugins_view.sortingEnabled = false
128
+ @unused_plugins_view.allColumnsShowFocus = true
129
+ @unused_plugins_view.setModel( @unused_plugins_model )
130
+
131
+ misc_group = Qt::GroupBox.new( I18n.get( "gui.pluginsmanager.misc" ), self )
132
+
133
+ @cleanup_lyrics_checkbox = Qt::CheckBox.new( misc_group )
134
+ @cleanup_lyrics_checkbox.setChecked( values["cleanup_lyrics"].to_s() == "true" )
135
+ @cleanup_lyrics_checkbox.setText( I18n.get( "gui.pluginsmanager.misc.cleanup" ) )
136
+
137
+ @single_threaded_checkbox = Qt::CheckBox.new( misc_group )
138
+ @single_threaded_checkbox.setChecked( values["single_threaded"].to_s() == "true" )
139
+ @single_threaded_checkbox.setText( I18n.get( "gui.pluginsmanager.misc.singlethreaded" ) )
140
+
141
+ @write_log_checkbox = Qt::CheckBox.new( misc_group )
142
+ @write_log_checkbox.setChecked( values["write_log"].to_s() == "true" )
143
+ @write_log_checkbox.setText( I18n.get( "gui.pluginsmanager.misc.writelog", "$HOME/.wikilyrics.log" ) )
144
+
145
+ buttons = create_action_buttons()
146
+
147
+ sites_group_layout = Qt::GridLayout.new( sites_group )
148
+ sites_group_layout.margin = 4
149
+ sites_group_layout.spacing = 4
150
+ sites_group_layout.setColumnStretch( 1, 1 )
151
+ sites_group_layout.setColumnStretch( 3, 1 )
152
+ sites_group_layout.setRowStretch( 0, 1 )
153
+ sites_group_layout.setRowStretch( 3, 1 )
154
+ sites_group_layout.addWidget( @move_up_button, 1, 0 )
155
+ sites_group_layout.addWidget( @move_down_button, 2, 0 )
156
+ sites_group_layout.addWidget( @used_plugins_view, 0, 1, 4, 1 )
157
+ sites_group_layout.addWidget( @add_button, 1, 2 )
158
+ sites_group_layout.addWidget( @remove_button, 2, 2 )
159
+ sites_group_layout.addWidget( @unused_plugins_view, 0, 3, 4, 1 )
160
+ sites_group.setLayout( sites_group_layout )
161
+
162
+ misc_group_layout = Qt::VBoxLayout.new()
163
+ misc_group_layout.margin = 5
164
+ misc_group_layout.spacing = 4
165
+ misc_group_layout.addWidget( @cleanup_lyrics_checkbox );
166
+ misc_group_layout.addWidget( @single_threaded_checkbox );
167
+ misc_group_layout.addWidget( @write_log_checkbox );
168
+ misc_group.setLayout( misc_group_layout );
169
+
170
+ layout = Qt::VBoxLayout.new( self )
171
+ layout.margin = 4
172
+ layout.spacing = 4
173
+ layout.addWidget( sites_group )
174
+ layout.addWidget( misc_group )
175
+ layout.addLayout( buttons )
176
+
177
+ connect( @move_up_button, SIGNAL( "clicked()" ), self, SLOT( "move_up()" ) )
178
+ connect( @move_down_button, SIGNAL( "clicked()" ), self, SLOT( "move_down()" ) )
179
+ connect( @add_button, SIGNAL( "clicked()" ), self, SLOT( "add_plugin()" ) )
180
+ connect( @remove_button, SIGNAL( "clicked()" ), self, SLOT( "remove_plugin()" ) )
181
+
182
+ update_accept_button()
183
+
184
+ resize( 430, 300 )
185
+ end
186
+
187
+ def insert_item( view, pos, value, select )
188
+ model = view.model()
189
+ pos = model.rowCount() if pos < 0
190
+ model.insertRows( pos, 1 )
191
+ idx = model.index( pos )
192
+ model.setData( idx, value )
193
+ if select
194
+ sel_model = view.selectionModel()
195
+ sel_model.clear()
196
+ sel_model.setCurrentIndex( idx, Qt::ItemSelectionModel::Select )
197
+ end
198
+ end
199
+
200
+ def remove_item( view, pos )
201
+ model = view.model()
202
+ idx = model.index( pos )
203
+ value = idx.data( Qt::DisplayRole )
204
+ model.removeRows( idx.row(), 1 )
205
+ return value
206
+ end
207
+
208
+ def move_up()
209
+ cur_idx = @used_plugins_view.currentIndex()
210
+ return if ! cur_idx.isValid()
211
+ cur_pos = cur_idx.row()
212
+ return if cur_pos == 0
213
+ plugin = remove_item( @used_plugins_view, cur_pos )
214
+ insert_item( @used_plugins_view, cur_pos-1, plugin, true )
215
+ end
216
+
217
+ def move_down()
218
+ cur_idx = @used_plugins_view.currentIndex()
219
+ return if ! cur_idx.isValid()
220
+ cur_pos = cur_idx.row()
221
+ return if cur_pos == @used_plugins_view.model().rowCount() - 1
222
+ plugin = remove_item( @used_plugins_view, cur_pos )
223
+ insert_item( @used_plugins_view, cur_pos+1, plugin, true )
224
+ end
225
+
226
+ def add_plugin()
227
+ cur_idx = @unused_plugins_view.currentIndex()
228
+ return if ! cur_idx.isValid()
229
+ plugin = remove_item( @unused_plugins_view, cur_idx.row() )
230
+ insert_item( @used_plugins_view, -1, plugin, false )
231
+ update_accept_button()
232
+ end
233
+
234
+ def remove_plugin()
235
+ cur_idx = @used_plugins_view.currentIndex()
236
+ return if ! cur_idx.isValid()
237
+ plugin = remove_item( @used_plugins_view, cur_idx.row() )
238
+ insert_item( @unused_plugins_view, -1, plugin, false )
239
+ update_accept_button()
240
+ end
241
+
242
+ def update_accept_button()
243
+ @accept_button.setEnabled( @used_plugins_model.rowCount() > 0 )
244
+ end
245
+
246
+ def accept()
247
+ @values = {
248
+ "cleanup_lyrics" => @cleanup_lyrics_checkbox.isChecked(),
249
+ "single_threaded" => @single_threaded_checkbox.isChecked(),
250
+ "write_log" => @write_log_checkbox.isChecked(),
251
+ "used_plugins" => @used_plugins_model.stringList(),
252
+ "script_name" => @values["script_name"],
253
+ "unused_plugins" => @unused_plugins_model.stringList()
254
+ }
255
+ super()
256
+ end
257
+
258
+ end
259
+
260
+
261
+ class WikiPluginDialog < BaseDialog
262
+
263
+ slots "toggle_submit_checked( bool )"
264
+ slots "toggle_review_checked( bool )"
265
+ slots "update_accept_button_state()"
266
+
267
+ def initialize( values )
268
+ super( values )
269
+
270
+ setWindowTitle( I18n.get( "gui.wikiplugin.title", values["site_name"] ) )
271
+
272
+ general_group = Qt::GroupBox.new( I18n.get( "gui.wikiplugin.general" ), self )
273
+
274
+ @submit_checkbox = Qt::CheckBox.new( general_group )
275
+ @submit_checkbox.setChecked( values["submit"].to_s() == "true" )
276
+ @submit_checkbox.setText( I18n.get( "gui.wikiplugin.general.submit", values["site_name"] ) )
277
+
278
+ @review_checkbox = Qt::CheckBox.new( general_group )
279
+ @review_checkbox.setEnabled( @submit_checkbox.isChecked() )
280
+ @review_checkbox.setChecked( @review_checkbox.isEnabled() && values["review"].to_s() == "true" )
281
+ @review_checkbox.setText( I18n.get( "gui.wikiplugin.general.review" ) )
282
+
283
+ @prompt_autogen_checkbox = Qt::CheckBox.new( general_group )
284
+ @prompt_autogen_checkbox.setEnabled( @review_checkbox.isChecked() )
285
+ @prompt_autogen_checkbox.setChecked( @prompt_autogen_checkbox.isEnabled() && values["prompt_autogen"].to_s() == "true" )
286
+ @prompt_autogen_checkbox.setText( I18n.get( "gui.wikiplugin.general.autogen" ) )
287
+
288
+ @prompt_no_lyrics_checkbox = Qt::CheckBox.new( general_group )
289
+ @prompt_no_lyrics_checkbox.setEnabled( @review_checkbox.isChecked() )
290
+ @prompt_no_lyrics_checkbox.setChecked( @prompt_no_lyrics_checkbox.isEnabled() && values["prompt_no_lyrics"].to_s() == "true" )
291
+ @prompt_no_lyrics_checkbox.setText( I18n.get( "gui.wikiplugin.general.nolyrics" ) )
292
+
293
+ login_group = Qt::GroupBox.new( I18n.get( "gui.wikiplugin.login" ), self )
294
+
295
+ username_label = Qt::Label.new( I18n.get( "gui.wikiplugin.login.username" ), login_group )
296
+ @username_lineedit = Qt::LineEdit.new( values["username"], login_group )
297
+
298
+ password_label = Qt::Label.new( I18n.get( "gui.wikiplugin.login.password" ), login_group )
299
+ @password_lineedit = Qt::LineEdit.new( values["password"], login_group )
300
+ @password_lineedit.setEchoMode( Qt::LineEdit::Password )
301
+
302
+ buttons = create_action_buttons()
303
+ update_accept_button_state()
304
+
305
+ general_group_layout = Qt::GridLayout.new()
306
+ general_group_layout.margin = 5
307
+ general_group_layout.spacing = 4
308
+ general_group_layout.setRowStretch( 4, 1 )
309
+ general_group.setLayout( general_group_layout )
310
+ general_group_layout.addWidget( @submit_checkbox, 0, 0 )
311
+ general_group_layout.addWidget( @review_checkbox, 1, 0 )
312
+ general_group_layout.addWidget( @prompt_autogen_checkbox, 2, 0 )
313
+ general_group_layout.addWidget( @prompt_no_lyrics_checkbox, 3, 0 )
314
+
315
+ login_group_layout = Qt::GridLayout.new()
316
+ login_group_layout.setRowStretch( 2, 1 )
317
+ login_group_layout.margin = 5
318
+ login_group_layout.spacing = 4
319
+ login_group_layout.addWidget( username_label, 0, 0 );
320
+ login_group_layout.addWidget( @username_lineedit, 0, 1 );
321
+ login_group_layout.addWidget( password_label, 1, 0 )
322
+ login_group_layout.addWidget( @password_lineedit, 1, 1 )
323
+ login_group.setLayout( login_group_layout )
324
+
325
+ layout = Qt::GridLayout.new( self )
326
+ layout.margin = 4
327
+ layout.spacing = 4
328
+ layout.setRowStretch( 2, 1 )
329
+ layout.addWidget( general_group, 0, 0 )
330
+ layout.addWidget( login_group, 1, 0 )
331
+ layout.addLayout( buttons, 2, 0 )
332
+
333
+ connect( @username_lineedit, SIGNAL( "textChanged(const QString&)" ), self, SLOT( "update_accept_button_state()" ) )
334
+ connect( @submit_checkbox, SIGNAL( "toggled(bool)" ), self, SLOT( "toggle_submit_checked(bool)" ) )
335
+ connect( @review_checkbox, SIGNAL( "toggled(bool)" ), self, SLOT( "toggle_review_checked(bool)" ) )
336
+
337
+ resize( 300, 50 )
338
+ end
339
+
340
+ def toggle_submit_checked( checked )
341
+ @review_checkbox.setEnabled( checked )
342
+ if ! checked
343
+ @review_checkbox.setChecked( false )
344
+ @prompt_autogen_checkbox.setChecked( false )
345
+ @prompt_no_lyrics_checkbox.setChecked( false )
346
+ end
347
+ update_accept_button_state()
348
+ end
349
+
350
+ def toggle_review_checked( checked )
351
+ @prompt_autogen_checkbox.setEnabled( checked )
352
+ @prompt_no_lyrics_checkbox.setEnabled( checked )
353
+ if ! checked
354
+ @prompt_autogen_checkbox.setChecked( false )
355
+ @prompt_no_lyrics_checkbox.setChecked( false )
356
+ end
357
+ end
358
+
359
+ def update_accept_button_state()
360
+ @accept_button.setEnabled( ! @submit_checkbox.isChecked() || ! @username_lineedit.text().empty? )
361
+ end
362
+
363
+ def accept()
364
+ @values = {
365
+ "submit" => @submit_checkbox.isChecked(),
366
+ "review" => @review_checkbox.isChecked(),
367
+ "prompt_autogen" => @prompt_autogen_checkbox.isChecked(),
368
+ "prompt_no_lyrics" => @prompt_no_lyrics_checkbox.isChecked(),
369
+ "username" => @username_lineedit.text(),
370
+ "password" => @password_lineedit.text(),
371
+ }
372
+ super()
373
+ end
374
+
375
+ end
376
+
377
+ class SubmitSongDialog < BaseDialog
378
+
379
+ slots "toggle_instrumental_checked( bool )"
380
+
381
+ def initialize( values )
382
+ super( values )
383
+
384
+ edit_mode = @values["edit_mode"].to_s() == "true"
385
+ setWindowTitle( I18n.get( "gui.submitsong.title." + (edit_mode ? "edit" : "submit"), values["site_name"] ) )
386
+
387
+ artist_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.artist" )}</b>", self )
388
+ @artist_lineedit = Qt::LineEdit.new( values["artist"], self )
389
+
390
+ title_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.song" )}</b>", self )
391
+ @title_lineedit = Qt::LineEdit.new( values["title"], self )
392
+
393
+ credits_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.credits" )}</b>", self )
394
+ @credits_lineedit = Qt::LineEdit.new( values["credits"], self )
395
+
396
+ lyricist_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.lyricist" )}</b>", self )
397
+ @lyricist_lineedit = Qt::LineEdit.new( values["lyricist"], self )
398
+
399
+ year_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.year" )}</b>", self )
400
+ @year_spinbox = Qt::SpinBox.new( self )
401
+ @year_spinbox.setRange( 1900, Date.today().year )
402
+ @year_spinbox.setValue( values["year"] )
403
+
404
+ album_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.album" )}</b>", self )
405
+ @album_lineedit = Qt::LineEdit.new( values["album"], self )
406
+
407
+ @instrumental_checkbox = Qt::CheckBox.new( self )
408
+ @instrumental_checkbox.setChecked( @values["instrumental"].to_s() == "true" )
409
+ @instrumental_checkbox.setText( I18n.get( "gui.submitsong.instrumental" ) )
410
+
411
+ @lyrics_text = Qt::TextEdit.new( self )
412
+ @lyrics_text.setLineWrapMode( Qt::TextEdit::NoWrap )
413
+ @lyrics_text.setPlainText( values["lyrics"] )
414
+ @lyrics_text.setDisabled( @instrumental_checkbox.isChecked() )
415
+
416
+ @reviewed_checkbox = Qt::CheckBox.new( self )
417
+ @reviewed_checkbox.setChecked( false )
418
+ @reviewed_checkbox.setText( I18n.get( "gui.common.reviewed" ) )
419
+
420
+ buttons = create_action_buttons( "split", I18n.get( "gui.common.submit" ) )
421
+
422
+ grid_layout = Qt::GridLayout.new( self )
423
+ grid_layout.margin = 4
424
+ grid_layout.spacing = 4
425
+ grid_layout.addWidget( artist_label, 0, 0, Qt::AlignRight )
426
+ grid_layout.addWidget( @artist_lineedit, 0, 1 )
427
+ grid_layout.addWidget( title_label, 0, 2, Qt::AlignRight )
428
+ grid_layout.addWidget( @title_lineedit, 0, 3 )
429
+ grid_layout.addWidget( credits_label, 1, 0, Qt::AlignRight )
430
+ grid_layout.addWidget( @credits_lineedit, 1, 1 )
431
+ grid_layout.addWidget( lyricist_label, 1, 2, Qt::AlignRight )
432
+ grid_layout.addWidget( @lyricist_lineedit, 1, 3 )
433
+ grid_layout.addWidget( year_label, 2, 0, Qt::AlignRight )
434
+ grid_layout.addWidget( @year_spinbox, 2, 1 )
435
+ grid_layout.addWidget( album_label, 2, 2, Qt::AlignRight )
436
+ grid_layout.addWidget( @album_lineedit, 2, 3 )
437
+ grid_layout.addWidget( @instrumental_checkbox, 3, 0, 1, 4 )
438
+ grid_layout.addWidget( @lyrics_text, 4, 0, 1, 4 )
439
+ grid_layout.addWidget( @reviewed_checkbox, 5, 0, 1, 4 )
440
+ grid_layout.addLayout( buttons, 6, 0, 1, 4 )
441
+
442
+ resize( 600, 400 )
443
+
444
+ connect( @instrumental_checkbox, SIGNAL( "toggled(bool)" ), self, SLOT( "toggle_instrumental_checked(bool)" ) )
445
+
446
+ end
447
+
448
+ def toggle_instrumental_checked( checked )
449
+ @lyrics_text.setDisabled( checked )
450
+ end
451
+
452
+ def accept()
453
+ @values = {
454
+ "artist" => @artist_lineedit.text(),
455
+ "year" => @year_spinbox.value(),
456
+ "album" => @album_lineedit.text(),
457
+ "title" => @title_lineedit.text(),
458
+ "lyrics" => @lyrics_text.toPlainText(),
459
+ "instrumental" => @instrumental_checkbox.isChecked(),
460
+ "lyricist" => @lyricist_lineedit.text(),
461
+ "credits" => @credits_lineedit.text(),
462
+ "reviewed" => @reviewed_checkbox.isChecked()
463
+ }
464
+ super()
465
+ end
466
+
467
+ end
468
+
469
+ class SubmitAlbumDialog < BaseDialog
470
+
471
+ slots "browse_image()"
472
+
473
+ def initialize( values )
474
+ super( values )
475
+
476
+ @values = values
477
+
478
+ setWindowTitle( I18n.get( "gui.submitalbum.title", values["site_name"] ) )
479
+
480
+ artist_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.artist" )}</b>", self )
481
+ @artist_lineedit = Qt::LineEdit.new( values["artist"], self )
482
+
483
+ album_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.album" )}</b>", self )
484
+ @album_lineedit = Qt::LineEdit.new( values["album"], self )
485
+
486
+ year_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.year" )}</b>", self )
487
+ @year_spinbox = Qt::SpinBox.new( self )
488
+ @year_spinbox.setRange( 1900, Date.today().year() )
489
+ @year_spinbox.setValue( values["year"].to_i() )
490
+
491
+ month_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.month" )}</b>", self )
492
+ @month_spinbox = Qt::SpinBox.new( self )
493
+ @month_spinbox.setRange( 0, 12 )
494
+ @month_spinbox.setValue( values["month"].to_i() )
495
+
496
+ day_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.day" )}</b>", self )
497
+ @day_spinbox = Qt::SpinBox.new( self )
498
+ @day_spinbox.setRange( 0, 31 )
499
+ @day_spinbox.setValue( values["day"].to_i() )
500
+
501
+ image_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.image" )}</b>", self )
502
+ @image_path_lineedit = Qt::LineEdit.new( values["image_path"], self )
503
+ if ! values.include?( "image_path" )
504
+ @image_path_lineedit.setEnabled( false )
505
+ @image_path_lineedit.setText( I18n.get( "gui.submitalbum.coverfound" ) )
506
+ else
507
+ @image_button = Qt::PushButton.new( "...", self )
508
+ @image_button.setMaximumWidth( 40 )
509
+ connect( @image_button, SIGNAL( "clicked()" ), self, SLOT( "browse_image()" ) )
510
+ end
511
+
512
+ @tracks_text = Qt::TextEdit.new( self )
513
+ @tracks_text.setLineWrapMode( Qt::TextEdit::NoWrap )
514
+ @tracks_text.setPlainText( values["tracks"] )
515
+
516
+ @reviewed_checkbox = Qt::CheckBox.new( self )
517
+ @reviewed_checkbox.setChecked( false )
518
+ @reviewed_checkbox.setText( I18n.get( "gui.common.reviewed" ) )
519
+
520
+ buttons = create_action_buttons( "split", I18n.get( "gui.common.submit" ) )
521
+
522
+ image_layout = Qt::HBoxLayout.new()
523
+ image_layout.addWidget( @image_path_lineedit )
524
+ image_layout.addWidget( @image_button ) if @values.include?( "image_path" )
525
+
526
+ grid_layout = Qt::GridLayout.new( self )
527
+ grid_layout.margin = 4
528
+ grid_layout.spacing = 4
529
+ grid_layout.setColumnStretch( 1, 2 )
530
+ grid_layout.setColumnStretch( 3, 2 )
531
+ grid_layout.setColumnStretch( 5, 2 )
532
+ grid_layout.addWidget( artist_label, 0, 0, Qt::AlignRight )
533
+ grid_layout.addWidget( @artist_lineedit, 0, 1, 1, 5 )
534
+ grid_layout.addWidget( album_label, 1, 0, Qt::AlignRight )
535
+ grid_layout.addWidget( @album_lineedit, 1, 1, 1, 5 )
536
+ grid_layout.addWidget( year_label, 2, 0, Qt::AlignRight )
537
+ grid_layout.addWidget( @year_spinbox, 2, 1 )
538
+ grid_layout.addWidget( month_label, 2, 2, Qt::AlignRight )
539
+ grid_layout.addWidget( @month_spinbox, 2, 3 )
540
+ grid_layout.addWidget( day_label, 2, 4, Qt::AlignRight )
541
+ grid_layout.addWidget( @day_spinbox, 2, 5 )
542
+ grid_layout.addWidget( image_label, 3, 0, Qt::AlignRight )
543
+ grid_layout.addLayout( image_layout, 3, 1, 1, 5 )
544
+ grid_layout.addWidget( @tracks_text, 4, 0, 1, 6 )
545
+ grid_layout.addWidget( @reviewed_checkbox, 5, 0, 1, 6 )
546
+ grid_layout.addLayout( buttons, 6, 0, 1, 6 )
547
+
548
+ resize( 600, 400 )
549
+ end
550
+
551
+ def browse_image()
552
+ dirname = @image_path_lineedit.text().strip()
553
+ dirname = QT4.empty_string?( dirname ) ? (ENV["HOME"] ? ENV["HOME"] : ".") : File.dirname( dirname )
554
+ dialog = Qt::FileDialog.new()
555
+ dialog.setWindowTitle( I18n.get( "gui.uploadcover.browseimage.title" ) )
556
+ dialog.setFilters( [
557
+ I18n.get( "gui.uploadcover.browseimage.images" ) + " (*.jpg *.JPG *.png *.PNG *.bmp *.BMP)",
558
+ I18n.get( "gui.uploadcover.browseimage.allfiles" ) + " (*)"
559
+ ] )
560
+ dialog.setDirectory( dirname )
561
+ dialog.setFileMode( Qt::FileDialog::ExistingFile )
562
+ if dialog.exec() == Qt::Dialog::Accepted
563
+ image_path = dialog.selectedFiles()[0]
564
+ @image_path_lineedit.setText( image_path.strip() ) if ! QT4.empty_string?( image_path )
565
+ end
566
+ end
567
+
568
+ def accept()
569
+ aux = {
570
+ "artist" => @artist_lineedit.text(),
571
+ "album" => @album_lineedit.text(),
572
+ "year" => @year_spinbox.value(),
573
+ "month" => @month_spinbox.value(),
574
+ "day" => @day_spinbox.value(),
575
+ "tracks" => @tracks_text.toPlainText(),
576
+ "reviewed" => @reviewed_checkbox.isChecked()
577
+ }
578
+ aux["image_path"] = @image_path_lineedit.text() if @values.include?( "image_path" )
579
+ @values = aux
580
+ super()
581
+ end
582
+
583
+ end
584
+
585
+
586
+ class UploadCoverDialog < BaseDialog
587
+
588
+ slots "browse_image()"
589
+
590
+ def initialize( values )
591
+ super( values )
592
+
593
+ setWindowTitle( I18n.get( "gui.uploadcover.title", values["site_name"] ) )
594
+
595
+ album_group = Qt::GroupBox.new( I18n.get( "gui.common.album" ), self )
596
+
597
+ artist_label = Qt::Label.new( I18n.get( "gui.common.artist" ), album_group )
598
+ @artist_lineedit = Qt::LineEdit.new( values["artist"], album_group )
599
+
600
+ album_label = Qt::Label.new( I18n.get( "gui.common.album" ), album_group )
601
+ @album_lineedit = Qt::LineEdit.new( values["album"], album_group )
602
+
603
+ year_label = Qt::Label.new( I18n.get( "gui.common.year" ), album_group )
604
+ @year_spinbox = Qt::SpinBox.new( album_group )
605
+ @year_spinbox.setRange( 1900, Date.today().year() )
606
+ @year_spinbox.setValue( values["year"] )
607
+
608
+ image_group = Qt::GroupBox.new( I18n.get( "gui.common.image" ), self )
609
+
610
+ image_label = Qt::Label.new( I18n.get( "gui.uploadcover.imagepath" ), image_group )
611
+ @image_path_lineedit = Qt::LineEdit.new( values["image_path"], image_group )
612
+ @image_path_lineedit.setText( values["image_path"] )
613
+
614
+ @image_button = Qt::PushButton.new( "...", image_group )
615
+ @image_button.setMaximumWidth( 40 )
616
+
617
+ connect( @image_button, SIGNAL( "clicked()" ), self, SLOT( "browse_image()" ) )
618
+
619
+ buttons = create_action_buttons()
620
+
621
+ album_group_layout = Qt::GridLayout.new()
622
+ album_group_layout.margin = 5
623
+ album_group_layout.spacing = 4
624
+ album_group_layout.setRowStretch( 3, 1 )
625
+ album_group_layout.addWidget( artist_label, 0, 0 )
626
+ album_group_layout.addWidget( @artist_lineedit, 0, 1 )
627
+ album_group_layout.addWidget( album_label, 1, 0 )
628
+ album_group_layout.addWidget( @album_lineedit, 1, 1 )
629
+ album_group_layout.addWidget( year_label, 2, 0 )
630
+ album_group_layout.addWidget( @year_spinbox, 2, 1 )
631
+ album_group.setLayout( album_group_layout )
632
+
633
+ image_group_layout = Qt::GridLayout.new()
634
+ image_group_layout.margin = 5
635
+ image_group_layout.spacing = 4
636
+ image_group_layout.setRowStretch( 1, 1 )
637
+ image_group_layout.addWidget( image_label, 0, 0 )
638
+ image_group_layout.addWidget( @image_path_lineedit, 0, 1 )
639
+ image_group_layout.addWidget( @image_button, 0, 2 )
640
+ image_group.setLayout( image_group_layout )
641
+
642
+ layout = Qt::VBoxLayout.new( self )
643
+ layout.margin = 4
644
+ layout.spacing = 4
645
+ layout.addWidget( album_group )
646
+ layout.addWidget( image_group )
647
+ layout.addLayout( buttons )
648
+
649
+ resize( 350, 100 )
650
+ end
651
+
652
+ def browse_image()
653
+ dirname = @image_path_lineedit.text().strip()
654
+ dirname = QT4.empty_string?( dirname ) ? (ENV["HOME"] ? ENV["HOME"] : ".") : File.dirname( dirname )
655
+ dialog = Qt::FileDialog.new()
656
+ dialog.setWindowTitle( I18n.get( "gui.uploadcover.browseimage.title" ) )
657
+ dialog.setFilters( [
658
+ I18n.get( "gui.uploadcover.browseimage.images" ) + " (*.jpg *.JPG *.png *.PNG *.bmp *.BMP)",
659
+ I18n.get( "gui.uploadcover.browseimage.allfiles" ) + " (*)"
660
+ ] )
661
+ dialog.setDirectory( dirname )
662
+ dialog.setFileMode( Qt::FileDialog::ExistingFile )
663
+ if dialog.exec() == Qt::Dialog::Accepted
664
+ image_path = dialog.selectedFiles()[0]
665
+ @image_path_lineedit.setText( image_path.strip() ) if ! QT4.empty_string?( image_path )
666
+ end
667
+ end
668
+
669
+ def accept()
670
+ @values = {
671
+ "artist" => @artist_lineedit.text(),
672
+ "album" => @album_lineedit.text(),
673
+ "year" => @year_spinbox.value(),
674
+ "image_path" => @image_path_lineedit.text()
675
+ }
676
+ super()
677
+ end
678
+
679
+ end
680
+
681
+
682
+ class FixPagesDialog < BaseDialog
683
+
684
+ slots "fetch_page()"
685
+ slots "fix_page()"
686
+ slots "submit_page()"
687
+
688
+ def initialize( values )
689
+ super( values )
690
+
691
+ @fetch_func = eval( @values["fetch_func"] )
692
+ @fix_func = eval( @values["fix_func"] )
693
+ @submit_func = eval( @values["submit_func"] )
694
+
695
+ setWindowTitle( "#{values["site_name"]} - #{values["title"]}" )
696
+
697
+ url_label = Qt::Label.new( "<b>#{I18n.get( "gui.common.url" )}</b>", self )
698
+ @url_lineedit = Qt::LineEdit.new( values["url"], self )
699
+
700
+ @page_text = Qt::TextEdit.new( self )
701
+ @page_text.setLineWrapMode( Qt::TextEdit::NoWrap )
702
+
703
+ @fetch_button = Qt::PushButton.new( I18n.get( "gui.common.load" ), self )
704
+ @fix_button = Qt::PushButton.new( I18n.get( "gui.common.fix" ), self )
705
+ @submit_button = Qt::PushButton.new( I18n.get( "gui.common.submit" ), self )
706
+
707
+ url_layout = Qt::HBoxLayout.new()
708
+ url_layout.spacing = 4
709
+ url_layout.setDirection( Qt::BoxLayout::LeftToRight )
710
+ url_layout.addWidget( url_label )
711
+ url_layout.addWidget( @url_lineedit )
712
+
713
+ buttons_layout = Qt::HBoxLayout.new()
714
+ buttons_layout.spacing = 4
715
+ buttons_layout.addStretch()
716
+ buttons_layout.addWidget( @fetch_button )
717
+ buttons_layout.addWidget( @fix_button )
718
+ buttons_layout.addWidget( @submit_button )
719
+
720
+ layout = Qt::GridLayout.new( self )
721
+ layout.margin = 4
722
+ layout.spacing = 4
723
+ layout.addLayout( url_layout, 0, 0 )
724
+ layout.addWidget( @page_text, 1, 0 )
725
+ layout.addLayout( buttons_layout, 2, 0 )
726
+
727
+ connect( @fetch_button, SIGNAL( "clicked()" ), self, SLOT( "fetch_page()" ) )
728
+ connect( @fix_button, SIGNAL( "clicked()" ), self, SLOT( "fix_page()" ) )
729
+ connect( @submit_button, SIGNAL( "clicked()" ), self, SLOT( "submit_page()" ) )
730
+
731
+ resize( 600, 400 )
732
+ end
733
+
734
+ def fetch_page()
735
+ if (page_content = @fetch_func.call( @url_lineedit.text() ))
736
+ @original_content = page_content
737
+ @original_url = @url_lineedit.text()
738
+ @page_text.setPlainText( page_content )
739
+ end
740
+ end
741
+
742
+ def fix_page()
743
+ @page_text.setPlainText( @fix_func.call( @page_text.toPlainText() ) ) if @original_content
744
+ end
745
+
746
+ def submit_page()
747
+ if @original_content && @original_content != (page_content = @page_text.toPlainText())
748
+ if @submit_func.call( @original_url, page_content )
749
+ @original_content = page_content
750
+ puts I18n.get( "gui.fixpages.success", @original_url )
751
+ else
752
+ puts I18n.get( "gui.fixpages.error", @original_url )
753
+ end
754
+ end
755
+ end
756
+
757
+ end
758
+
759
+
760
+ class SearchLyricsDialog < BaseDialog
761
+
762
+ def initialize( values )
763
+ super( values )
764
+
765
+ setWindowTitle( I18n.get( "gui.searchlyrics.title" ) )
766
+
767
+ group = Qt::GroupBox.new( I18n.get( "gui.searchlyrics.search" ), self )
768
+
769
+ artist_label = Qt::Label.new( I18n.get( "gui.common.artist" ), group )
770
+ @artist_lineedit = Qt::LineEdit.new( values["artist"], group )
771
+
772
+ title_label = Qt::Label.new( I18n.get( "gui.common.song" ), group )
773
+ @title_lineedit = Qt::LineEdit.new( values["title"], group )
774
+
775
+ album_label = Qt::Label.new( I18n.get( "gui.common.album" ), group )
776
+ @album_lineedit = Qt::LineEdit.new( values["album"], group )
777
+
778
+ year_label = Qt::Label.new( I18n.get( "gui.common.year" ), group )
779
+ @year_spinbox = Qt::SpinBox.new( group )
780
+ @year_spinbox.setRange( 1900, Date.today().year() )
781
+ @year_spinbox.setValue( values["year"] )
782
+
783
+ buttons = create_action_buttons()
784
+
785
+ group_layout = Qt::GridLayout.new()
786
+ group_layout.margin = 5
787
+ group_layout.spacing = 4
788
+ group_layout.setRowStretch( 4 , 1 )
789
+ group_layout.addWidget( artist_label, 0, 0 )
790
+ group_layout.addWidget( @artist_lineedit, 0, 1 )
791
+ group_layout.addWidget( title_label, 1, 0 )
792
+ group_layout.addWidget( @title_lineedit, 1, 1 )
793
+ group_layout.addWidget( album_label, 2, 0 )
794
+ group_layout.addWidget( @album_lineedit, 2, 1 )
795
+ group_layout.addWidget( year_label, 3, 0 )
796
+ group_layout.addWidget( @year_spinbox, 3, 1 )
797
+ group.setLayout( group_layout )
798
+
799
+ layout = Qt::VBoxLayout.new( self )
800
+ layout.margin = 4
801
+ layout.spacing = 4
802
+ layout.addWidget( group )
803
+ layout.addLayout( buttons )
804
+
805
+ resize( 300, 100 )
806
+ end
807
+
808
+ def accept()
809
+ @values = {
810
+ "artist" => @artist_lineedit.text(),
811
+ "title" => @title_lineedit.text(),
812
+ "album" => @album_lineedit.text(),
813
+ "year" => @year_spinbox.value(),
814
+ }
815
+ super()
816
+ end
817
+
818
+ end
819
+
820
+
821
+ class ShowLyricsDialog < BaseDialog
822
+
823
+ def initialize( values )
824
+ super( values )
825
+
826
+ title = I18n.get( "gui.lyrics.title", @values["title"], @values["artist"] )
827
+ title += " [#{@values["site_name"]}]" if @values["site_name"]
828
+ setWindowTitle( title )
829
+
830
+ @lyrics_text = Qt::TextEdit.new( self )
831
+ @lyrics_text.setPlainText( values["lyrics"] )
832
+ @lyrics_text.setLineWrapMode( Qt::TextEdit::NoWrap )
833
+
834
+ layout = Qt::GridLayout.new( self )
835
+ layout.margin = 4
836
+ layout.spacing = 4
837
+ layout.addWidget( @lyrics_text, 0, 0 )
838
+
839
+ resize( 350, 400 )
840
+ end
841
+
842
+ end
843
+
844
+
845
+ end