242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
# File 'lib/wiki_lyrics/gui/gui-qt3.rb', line 242
def initialize( values )
super( values )
setCaption( I18n.get( "gui.wikiplugin.title", values["site_name"] ) )
general_group = Qt::GroupBox.new( I18n.get( "gui.wikiplugin.general" ), self )
general_group.setColumnLayout( 0, Qt::Vertical )
general_group.layout().setSpacing( 5 )
@submit_checkbox = Qt::CheckBox.new( general_group )
@submit_checkbox.setChecked( values["submit"].to_s() == "true" )
@submit_checkbox.setText( I18n.get( "gui.wikiplugin.general.submit", values["site_name"] ) )
@review_checkbox = Qt::CheckBox.new( general_group )
@review_checkbox.setEnabled( @submit_checkbox.isChecked() )
@review_checkbox.setChecked( @review_checkbox.isEnabled() && values["review"].to_s() == "true" )
@review_checkbox.setText( I18n.get( "gui.wikiplugin.general.review" ) )
@prompt_autogen_checkbox = Qt::CheckBox.new( general_group )
@prompt_autogen_checkbox.setEnabled( @review_checkbox.isChecked() )
@prompt_autogen_checkbox.setChecked( @prompt_autogen_checkbox.isEnabled() && values["prompt_autogen"].to_s() == "true" )
@prompt_autogen_checkbox.setText( I18n.get( "gui.wikiplugin.general.autogen" ) )
@prompt_no_lyrics_checkbox = Qt::CheckBox.new( general_group )
@prompt_no_lyrics_checkbox.setEnabled( @review_checkbox.isChecked() )
@prompt_no_lyrics_checkbox.setChecked( @prompt_no_lyrics_checkbox.isEnabled() && values["prompt_no_lyrics"].to_s() == "true" )
@prompt_no_lyrics_checkbox.setText( I18n.get( "gui.wikiplugin.general.nolyrics" ) )
login_group = Qt::GroupBox.new( I18n.get( "gui.wikiplugin.login" ), self )
login_group.setColumnLayout( 0, Qt::Vertical )
login_group.layout().setSpacing( 5 )
username_label = Qt::Label.new( I18n.get( "gui.wikiplugin.login.username" ), login_group )
@username_lineedit = Qt::LineEdit.new( values["username"], login_group )
password_label = Qt::Label.new( I18n.get( "gui.wikiplugin.login.password" ), login_group )
@password_lineedit = Qt::LineEdit.new( values["password"], login_group )
@password_lineedit.setEchoMode( Qt::LineEdit::Password )
buttons = create_action_buttons()
update_accept_button_state()
general_group_layout = Qt::GridLayout.new( general_group.layout() )
general_group_layout.setAlignment( Qt::AlignTop )
general_group_layout.addMultiCellWidget( @submit_checkbox, 0, 0, 0, 1 )
general_group_layout.addMultiCellWidget( @review_checkbox, 1, 1, 0, 1 )
general_group_layout.addMultiCellWidget( @prompt_autogen_checkbox, 2, 2, 0, 1 )
general_group_layout.addMultiCellWidget( @prompt_no_lyrics_checkbox, 3, 3, 0, 1 )
login_group_layout = Qt::GridLayout.new( login_group.layout() )
login_group_layout.setAlignment( Qt::AlignTop )
login_group_layout.addWidget( username_label, 1, 0 );
login_group_layout.addWidget( @username_lineedit, 1, 1 );
login_group_layout.addWidget( password_label, 2, 0 )
login_group_layout.addWidget( @password_lineedit, 2, 1 )
layout = Qt::GridLayout.new( self, 1, 1, 5 )
layout.addMultiCellWidget( general_group, 0, 0, 0, 2 )
layout.addMultiCellWidget( login_group, 1, 1, 0, 2 )
layout.addItem( Qt::SpacerItem.new( 81, 20, Qt::SizePolicy::Expanding, Qt::SizePolicy::Minimum ), 2, 0 );
layout.addMultiCellLayout( buttons, 2, 2, 0, 2 )
connect( @username_lineedit, SIGNAL( "textChanged(const QString&)" ), self, SLOT( "update_accept_button_state()" ) )
connect( @submit_checkbox, SIGNAL( "toggled(bool)" ), self, SLOT( "toggle_submit_checked(bool)" ) )
connect( @review_checkbox, SIGNAL( "toggled(bool)" ), self, SLOT( "toggle_review_checked(bool)" ) )
resize( 300, 50 )
end
|