-rw-r--r-- | noncore/apps/tinykate/libkate/view/kateviewdialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp index f82356b..b7cf9f5 100644 --- a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp +++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp @@ -95,193 +95,193 @@ SearchDialog::SearchDialog( QWidget *parent, QStringList &searchFor, QStringList gbox->addWidget( m_opt2, 2, 0 ); m_opt3 = new QCheckBox(i18n("&From Beginning" ), group ); gbox->addWidget( m_opt3, 3, 0 ); m_opt4 = new QCheckBox(i18n("Find &Backwards" ), group ); gbox->addWidget( m_opt4, 1, 1 ); m_opt5 = new QCheckBox(i18n("&Selected Text" ), group ); gbox->addWidget( m_opt5, 2, 1 ); m_opt1->setChecked( flags & KateView::sfCaseSensitive ); m_opt2->setChecked( flags & KateView::sfWholeWords ); m_opt3->setChecked( flags & KateView::sfFromBeginning ); m_optRegExp->setChecked( flags & KateView::sfRegularExpression ); m_opt4->setChecked( flags & KateView::sfBackward ); m_opt5->setChecked( flags & KateView::sfSelected ); if( m_replace ) { m_opt6 = new QCheckBox( i18n( "&Prompt On Replace" ), group ); m_opt6->setChecked( flags & KateView::sfPrompt ); gbox->addWidget( m_opt6, 3, 1 ); } m_search->setFocus(); } QString SearchDialog::getSearchFor() { return m_search->currentText(); } QString SearchDialog::getReplaceWith() { return m_replace->currentText(); } int SearchDialog::getFlags() { int flags = 0; if( m_opt1->isChecked() ) flags |= KateView::sfCaseSensitive; if( m_opt2->isChecked() ) flags |= KateView::sfWholeWords; if( m_opt3->isChecked() ) flags |= KateView::sfFromBeginning; if( m_opt4->isChecked() ) flags |= KateView::sfBackward; if( m_opt5->isChecked() ) flags |= KateView::sfSelected; if( m_optRegExp->isChecked() ) flags |= KateView::sfRegularExpression; if( m_replace ) { if( m_opt6->isChecked() ) flags |= KateView::sfPrompt; flags |= KateView::sfReplace; } return flags; } void SearchDialog::slotOk() { if ( !m_search->currentText().isEmpty() ) { if ( !m_optRegExp->isChecked() ) { accept(); } else { // Check for a valid regular expression. QRegExp regExp( m_search->currentText() ); if ( regExp.isValid() ) accept(); } } } void SearchDialog::setSearchText( const QString &searchstr ) { m_search->insertItem( searchstr, 0 ); m_search->setCurrentItem( 0 ); m_search->lineEdit()->selectAll(); } // this dialog is not modal ReplacePrompt::ReplacePrompt( QWidget *parent ) : KDialogBase(parent, 0L, false, i18n( "Replace Text" ), User3 | User2 | User1 | Close, User3, true, i18n("&All"), i18n("&No"), i18n("&Yes")) { QWidget *page = new QWidget(this); setMainWidget(page); QBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); - QLabel *label = new QLabel(i18n("Replace this occurence?"),page); + QLabel *label = new QLabel(i18n("Replace this occurrence?"),page); topLayout->addWidget(label ); } void ReplacePrompt::slotUser1( void ) { // All done(KateView::srAll); } void ReplacePrompt::slotUser2( void ) { // No done(KateView::srNo); } void ReplacePrompt::slotUser3( void ) { // Yes accept(); } void ReplacePrompt::done(int r) { setResult(r); emit clicked(); } void ReplacePrompt::closeEvent(QCloseEvent *) { reject(); } GotoLineDialog::GotoLineDialog(QWidget *parent, int line, int max) : KDialogBase(parent, 0L, true, i18n("Goto Line"), Ok | Cancel, Ok) { QWidget *page = new QWidget(this); setMainWidget(page); QVBoxLayout *topLayout = new QVBoxLayout( page, 0, spacingHint() ); e1 = new QSpinBox(page); e1->setMinValue(1); e1->setMaxValue(max); e1->setValue((int)line); QLabel *label = new QLabel( e1,i18n("&Goto Line:"), page ); topLayout->addWidget(label); topLayout->addWidget(e1); topLayout->addSpacing(spacingHint()); // A little bit extra space topLayout->addStretch(10); e1->setFocus(); } int GotoLineDialog::getLine() { return e1->value(); } const int IndentConfigTab::flags[] = {KateView::cfAutoIndent, KateView::cfSpaceIndent, KateView::cfBackspaceIndents,KateView::cfTabIndents, KateView::cfKeepIndentProfile, KateView::cfKeepExtraSpaces}; IndentConfigTab::IndentConfigTab(QWidget *parent, KateView *view) : QWidget(parent, 0L) { QVBoxLayout *layout = new QVBoxLayout(this, 0, KDialog::spacingHint() ); int configFlags = view->config(); opt[0] = new QCheckBox(i18n("&Auto Indent"), this); layout->addWidget(opt[0], 0, AlignLeft); opt[0]->setChecked(configFlags & flags[0]); opt[1] = new QCheckBox(i18n("Indent With &Spaces"), this); layout->addWidget(opt[1], 0, AlignLeft); opt[1]->setChecked(configFlags & flags[1]); opt[2] = new QCheckBox(i18n("&Backspace Key Indents"), this); layout->addWidget(opt[2], 0, AlignLeft); opt[2]->setChecked(configFlags & flags[2]); opt[3] = new QCheckBox(i18n("&Tab Key Indents"), this); layout->addWidget(opt[3], 0, AlignLeft); opt[3]->setChecked(configFlags & flags[3]); opt[4] = new QCheckBox(i18n("Keep Indent &Profile"), this); layout->addWidget(opt[4], 0, AlignLeft); // opt[4]->setChecked(configFlags & flags[4]); opt[4]->setChecked(true); opt[4]->hide(); opt[5] = new QCheckBox(i18n("&Keep Extra Spaces"), this); layout->addWidget(opt[5], 0, AlignLeft); opt[5]->setChecked(configFlags & flags[5]); layout->addStretch(); // What is this? help QWhatsThis::add(opt[0], i18n("When <b>Auto indent</b> is on, KateView will indent new lines to equal the indent on the previous line.<p>If the previous line is blank, the nearest line above with text is used")); QWhatsThis::add(opt[1], i18n("Check this if you want to indent with spaces rather than tabs.<br>A Tab will be converted to <u>Tab-width</u> as set in the <b>edit</b> options")); QWhatsThis::add(opt[2], i18n("This allows the <b>backspace</b> key to be used to indent.")); QWhatsThis::add(opt[3], i18n("This allows the <b>tab</b> key to be used to indent.")); QWhatsThis::add(opt[4], i18n("This retains current indentation settings for future documents.")); QWhatsThis::add(opt[5], i18n("Indentations of more than the selected number of spaces will not be shortened.")); } void IndentConfigTab::getData(KateView *view) { int configFlags, z; |