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 | |
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>
-rw-r--r-- | doc/kate/mdi.docbook | 8 | ||||
-rw-r--r-- | kate/app/kategrepdialog.cpp | 26 | ||||
-rw-r--r-- | kate/app/kategrepdialog.h | 4 |
3 files changed, 32 insertions, 6 deletions
diff --git a/doc/kate/mdi.docbook b/doc/kate/mdi.docbook index 993682b6e..6a8020747 100644 --- a/doc/kate/mdi.docbook +++ b/doc/kate/mdi.docbook @@ -341,6 +341,14 @@ It is possible to specify multiple patterns by separating them with commas </varlistentry> <varlistentry> +<term><guilabel>Hide errors</guilabel></term> +<listitem> +<para>If checked, the dialog window showing the search errors will +not be displayed at the end of the search.</para> +</listitem> +</varlistentry> + +<varlistentry> <term><guilabel>Folder</guilabel></term> <listitem> <para>The folder to search for files.</para> 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; |