1 #include "chiasmuskeyselector.h"
4 #include <tdelistbox.h>
10 ChiasmusKeySelector::ChiasmusKeySelector( TQWidget* parent, const TQString& caption,
11 const TQStringList& keys, const TQString& currentKey,
12 const TQString& lastOptions )
13 : KDialogBase( parent, "chiasmusKeySelector", true, caption, Ok|Cancel, Ok, true )
15 TQWidget *page = makeMainWidget();
17 TQVBoxLayout *layout = new TQVBoxLayout(page, KDialog::spacingHint());
19 mLabel = new TQLabel( i18n( "Please select the Chiasmus key file to use:" ), page );
20 layout->addWidget( mLabel );
22 mListBox = new TDEListBox( page );
23 mListBox->insertStringList( keys );
24 const int current = keys.findIndex( currentKey );
25 mListBox->setSelected( TQMAX( 0, current ), true );
26 mListBox->ensureCurrentVisible();
27 layout->addWidget( mListBox, 1 );
29 TQLabel* optionLabel = new TQLabel( i18n( "Additional arguments for chiasmus:" ), page );
30 layout->addWidget( optionLabel );
32 mOptions = new KLineEdit( lastOptions, page );
33 optionLabel->setBuddy( mOptions );
34 layout->addWidget( mOptions );
38 connect( mListBox, TQ_SIGNAL( doubleClicked( TQListBoxItem * ) ), this, TQ_SLOT( slotOk() ) );
39 connect( mListBox, TQ_SIGNAL( returnPressed( TQListBoxItem * ) ), this, TQ_SLOT( slotOk() ) );
44 TQString ChiasmusKeySelector::key() const
46 return mListBox->currentText();
49 TQString ChiasmusKeySelector::options() const
51 return mOptions->text();
55 #include "chiasmuskeyselector.moc"
@ Ok The user rights/ACL have been fetched from the server sucessfully.
|