diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2015-01-04 20:38:02 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2015-01-04 20:38:02 +0900 |
commit | 46f61ed2b35896e05f17cf99812ddd6614a486f7 (patch) | |
tree | 777342c60c2f17df8c8ded4da670f8aa41f11f53 /kate/app | |
parent | 7d5d5cf9294ab828c612eb028f95f0c2abcc7940 (diff) | |
download | tdebase-46f61ed2b35896e05f17cf99812ddd6614a486f7.tar.gz tdebase-46f61ed2b35896e05f17cf99812ddd6614a486f7.zip |
Added option to suppress 'Find in files' error dialog in Kate. This resolves bug 1911.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kate/app')
-rw-r--r-- | kate/app/kategrepdialog.cpp | 26 | ||||
-rw-r--r-- | kate/app/kategrepdialog.h | 4 |
2 files changed, 24 insertions, 6 deletions
diff --git a/kate/app/kategrepdialog.cpp b/kate/app/kategrepdialog.cpp index 7713400aa..70f067100 100644 --- a/kate/app/kategrepdialog.cpp +++ b/kate/app/kategrepdialog.cpp @@ -149,13 +149,22 @@ GrepTool::GrepTool(TQWidget *parent, const char *name) lFiles->setFixedSize(lFiles->sizeHint()); loInput->addWidget(lFiles, 2, 0, Qt::AlignRight | Qt::AlignVCenter); + TQBoxLayout *loFiles = new TQHBoxLayout( 2 ); + loInput->addLayout( loFiles, 2, 1 ); + cmbFiles = new KComboBox(true, this); lFiles->setBuddy(TQT_TQWIDGET(cmbFiles->focusProxy())); cmbFiles->setMinimumSize(cmbFiles->sizeHint()); cmbFiles->setInsertionPolicy(TQComboBox::NoInsertion); cmbFiles->setDuplicatesEnabled(false); cmbFiles->insertStringList(lastSearchFiles); - loInput->addWidget(cmbFiles, 2, 1); + loFiles->addWidget(cmbFiles); + + cbHideErrors = new TQCheckBox( i18n("Hide errors"), this ); + cbHideErrors->setMinimumWidth( cbHideErrors->sizeHint().width() ); + cbHideErrors->setChecked( config->readBoolEntry( "HideErrors", false ) ); + loFiles->addWidget(cbHideErrors); + loFiles->setStretchFactor(cmbFiles, 100); TQLabel *lDir = new TQLabel(i18n("Folder:"), this); lDir->setFixedSize(lDir->sizeHint()); @@ -199,8 +208,8 @@ GrepTool::GrepTool(TQWidget *parent, const char *name) TQWhatsThis::add(lPattern, i18n("<p>Enter the expression you want to search for here." - "<p>If 'regular expression' is unchecked, any non-space letters in your " - "expression will be escaped with a backslash character." + "<p>If 'regular expression' is unchecked, all characters that are not " + "letters in your expression will be escaped with a backslash character." "<p>Possible meta characters are:<br>" "<b>.</b> - Matches any character<br>" "<b>^</b> - Matches the beginning of a line<br>" @@ -243,6 +252,9 @@ GrepTool::GrepTool(TQWidget *parent, const char *name) i18n("The results of the grep run are listed here. Select a\n" "filename/line number combination and press Enter or doubleclick\n" "on the item to show the respective line in the editor.")); + TQWhatsThis::add( cbHideErrors, i18n( + "<p>If this is checked, the dialog window showing the search errors " + "will not be displayed at the end of the search.") ); // event filter, do something relevant for RETURN cmbPattern->installEventFilter( this ); @@ -460,6 +472,7 @@ void GrepTool::finish() config->writeEntry("Recursive", cbRecursive->isChecked()); config->writeEntry("CaseSensitive", cbCasesensitive->isChecked()); config->writeEntry("Regex", cbRegex->isChecked()); + config->writeEntry("HideErrors", cbHideErrors->isChecked()); } void GrepTool::slotCancel() @@ -474,9 +487,12 @@ void GrepTool::childExited() btnClear->setEnabled( true ); btnSearch->setGuiItem( KGuiItem(i18n("Find"), "edit-find") ); - if ( ! errbuf.isEmpty() ) + if ( !errbuf.isEmpty()) { - KMessageBox::information( parentWidget(), i18n("<strong>Error:</strong><p>") + errbuf, i18n("Grep Tool Error") ); + if (!cbHideErrors->isChecked()) + { + KMessageBox::information( parentWidget(), i18n("<strong>Error:</strong><p>") + errbuf, i18n("Grep Tool Error") ); + } errbuf.truncate(0); } else diff --git a/kate/app/kategrepdialog.h b/kate/app/kategrepdialog.h index a3cbbc871..1bd930735 100644 --- a/kate/app/kategrepdialog.h +++ b/kate/app/kategrepdialog.h @@ -79,7 +79,9 @@ private: KComboBox *cmbFiles, *cmbPattern; KURLRequester *cmbDir; TQCheckBox *cbRecursive; - TQCheckBox *cbCasesensitive, *cbRegex; + TQCheckBox *cbCasesensitive; + TQCheckBox *cbRegex; + TQCheckBox *cbHideErrors; TQListBox *lbResult; KPushButton *btnSearch, *btnClear; TDEProcess *childproc; |