GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
find-dialog.cc
Go to the documentation of this file.
1// Find dialog derived from an example from Qt Toolkit (license below (**))
2
3////////////////////////////////////////////////////////////////////////
4//
5// Copyright (C) 2009-2022 The Octave Project Developers
6//
7// See the file COPYRIGHT.md in the top-level directory of this
8// or <https://octave.org/copyright/>.
9//
10// All rights reserved.
11// Contact: Nokia Corporation (qt-info@nokia.com)
12//
13// This file is part of Octave.
14//
15// Octave is free software: you can redistribute it and/or modify it
16// under the terms of the GNU General Public License as published by
17// the Free Software Foundation, either version 3 of the License, or
18// (at your option) any later version.
19//
20// Octave is distributed in the hope that it will be useful, but
21// WITHOUT ANY WARRANTY; without even the implied warranty of
22// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23// GNU General Public License for more details.
24//
25// You should have received a copy of the GNU General Public License
26// along with Octave; see the file COPYING. If not, see
27// <https://www.gnu.org/licenses/>.
28//
29// ** This file is part of the examples of the Qt Toolkit.
30// **
31// ** $QT_BEGIN_LICENSE:LGPL$
32// ** Commercial Usage
33// ** Licensees holding valid Qt Commercial licenses may use this file in
34// ** accordance with the Qt Commercial License Agreement provided with the
35// ** Software or, alternatively, in accordance with the terms contained in
36// ** a written agreement between you and Nokia.
37// **
38// ** GNU Lesser General Public License Usage
39// ** Alternatively, this file may be used under the terms of the GNU Lesser
40// ** General Public License version 2.1 as published by the Free Software
41// ** Foundation and appearing in the file LICENSE.LGPL included in the
42// ** packaging of this file. Please review the following information to
43// ** ensure the GNU Lesser General Public License version 2.1 requirements
44// ** will be met: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
45// **
46// ** In addition, as a special exception, Nokia gives you certain additional
47// ** rights. These rights are described in the Nokia Qt LGPL Exception
48// ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
49// **
50// ** GNU General Public License Usage
51// ** Alternatively, this file may be used under the terms of the GNU
52// ** General Public License version 3.0 as published by the Free Software
53// ** Foundation and appearing in the file LICENSE.GPL included in the
54// ** packaging of this file. Please review the following information to
55// ** ensure the GNU General Public License version 3.0 requirements will be
56// ** met: https://www.gnu.org/copyleft/gpl.html.
57// **
58// ** If you have questions regarding the use of this file, please contact
59// ** Nokia at qt-info@nokia.com.
60// ** $QT_END_LICENSE$
61//
62////////////////////////////////////////////////////////////////////////
63
64#if defined (HAVE_CONFIG_H)
65# include "config.h"
66#endif
67
68#if defined (HAVE_QSCINTILLA)
69
70#include <QApplication>
71#include <QCheckBox>
72#include <QCheckBox>
73#include <QCompleter>
74#include <QDesktopWidget>
75#include <QDialogButtonBox>
76#include <QGridLayout>
77#include <QIcon>
78#include <QLabel>
79#include <QLineEdit>
80#include <QMessageBox>
81#include <QPushButton>
82#include <QVBoxLayout>
83
84#include "find-dialog.h"
85#include "gui-preferences-ed.h"
86#include "resource-manager.h"
87#include "octave-qobject.h"
88
89namespace octave
90{
93 : QDialog (p), m_octave_qobj (oct_qobj), m_editor (ed),
94 m_in_sel (false), m_sel_beg (-1), m_sel_end (-1)
95 {
96 setWindowTitle (tr ("Editor: Find and Replace"));
97 setWindowIcon (QIcon (":/actions/icons/find.png"));
98
99 m_search_label = new QLabel (tr ("Find &what:"));
100 m_search_line_edit = new QComboBox (this);
101 m_search_line_edit->setToolTip (tr ("Enter text to search for"));
102 m_search_line_edit->setEditable (true);
103 m_search_line_edit->setMaxCount (m_mru_length);
104 m_search_line_edit->completer ()->setCaseSensitivity (Qt::CaseSensitive);
106
107 m_replace_label = new QLabel (tr ("Re&place with:"));
108 m_replace_line_edit = new QComboBox (this);
109 m_replace_line_edit->setToolTip (tr ("Enter new text replacing search hits"));
110 m_replace_line_edit->setEditable (true);
111 m_replace_line_edit->setMaxCount (m_mru_length);
112 m_replace_line_edit->completer ()->setCaseSensitivity (Qt::CaseSensitive);
114
115 int width = QFontMetrics (m_search_line_edit->font ()).averageCharWidth();
116 m_search_line_edit->setFixedWidth (20*width);
117 m_replace_line_edit->setFixedWidth (20*width);
118
119 m_case_check_box = new QCheckBox (tr ("Match &case"));
120 m_from_start_check_box = new QCheckBox (tr ("Search from &start"));
121 m_wrap_check_box = new QCheckBox (tr ("&Wrap while searching"));
122 m_wrap_check_box->setChecked (true);
123 m_find_next_button = new QPushButton (tr ("&Find Next"));
124 m_find_prev_button = new QPushButton (tr ("Find &Previous"));
125 m_replace_button = new QPushButton (tr ("&Replace"));
126 m_replace_all_button = new QPushButton (tr ("Replace &All"));
127
128 m_more_button = new QPushButton (tr ("&More..."));
129 m_more_button->setCheckable (true);
130 m_more_button->setAutoDefault (false);
131
132 m_button_box = new QDialogButtonBox (Qt::Vertical);
133 m_button_box->addButton (m_find_next_button, QDialogButtonBox::ActionRole);
134 m_button_box->addButton (m_find_prev_button, QDialogButtonBox::ActionRole);
135 m_button_box->addButton (m_replace_button, QDialogButtonBox::ActionRole);
136 m_button_box->addButton (m_replace_all_button, QDialogButtonBox::ActionRole);
137 m_button_box->addButton (m_more_button, QDialogButtonBox::ActionRole);
138 m_button_box->addButton (QDialogButtonBox::Close);
139
140 m_extension = new QWidget (this);
141 m_whole_words_check_box = new QCheckBox (tr ("&Whole words"));
142 m_regex_check_box = new QCheckBox (tr ("Regular E&xpressions"));
143 m_backward_check_box = new QCheckBox (tr ("Search &backward"));
144 m_search_selection_check_box = new QCheckBox (tr ("Search se&lection"));
145 m_search_selection_check_box->setCheckable (true);
146
147 connect (m_find_next_button, &QPushButton::clicked,
149 connect (m_find_prev_button, &QPushButton::clicked,
151 connect (m_more_button, &QPushButton::toggled,
152 m_extension, &QWidget::setVisible);
153 connect (m_replace_button, &QPushButton::clicked,
154 this, &find_dialog::replace);
155 connect (m_replace_all_button, &QPushButton::clicked,
157 connect (m_backward_check_box, &QCheckBox::stateChanged,
159 connect (m_button_box, &QDialogButtonBox::rejected,
160 this, &find_dialog::close);
161
162 connect (m_search_selection_check_box, &QCheckBox::stateChanged,
164
165 QVBoxLayout *extension_layout = new QVBoxLayout ();
166 extension_layout->setMargin (0);
167 extension_layout->addWidget (m_whole_words_check_box);
168 extension_layout->addWidget (m_backward_check_box);
169 extension_layout->addWidget (m_search_selection_check_box);
170 m_extension->setLayout (extension_layout);
171
172 QGridLayout *top_left_layout = new QGridLayout;
173 top_left_layout->addWidget (m_search_label, 1, 1);
174 top_left_layout->addWidget (m_search_line_edit, 1, 2);
175 top_left_layout->addWidget (m_replace_label, 2, 1);
176 top_left_layout->addWidget (m_replace_line_edit, 2, 2);
177
178 QVBoxLayout *left_layout = new QVBoxLayout;
179 left_layout->addLayout (top_left_layout);
180 left_layout->insertStretch (1, 5);
181 left_layout->addWidget (m_case_check_box);
182 left_layout->addWidget (m_from_start_check_box);
183 left_layout->addWidget (m_wrap_check_box);
184 left_layout->addWidget (m_regex_check_box);
185
186 QGridLayout *main_layout = new QGridLayout;
187 main_layout->setSizeConstraint (QLayout::SetFixedSize);
188 main_layout->addLayout (left_layout, 0, 0);
189 main_layout->addWidget (m_button_box, 0, 1);
190 main_layout->addWidget (m_extension, 1, 0);
191 setLayout (main_layout);
192
193 m_extension->hide ();
194 m_find_next_button->setDefault (true);
196 m_rep_all = 0;
197 m_rep_active = false;
198
199 // Connect required external signals
200 connect (ed, SIGNAL (edit_area_changed (octave_qscintilla *)),
201 this, SLOT (update_edit_area (octave_qscintilla *)));
202
203 setWindowModality (Qt::NonModal);
204
205 setAttribute(Qt::WA_ShowWithoutActivating);
206 setAttribute(Qt::WA_DeleteOnClose);
207 }
208
209 // The edit_area has changed: update relevant data of the file dialog
211 {
212 m_edit_area = edit_area;
213 m_search_selection_check_box->setEnabled (edit_area->hasSelectedText ());
214
215 connect (m_edit_area, SIGNAL (copyAvailable (bool)),
216 this, SLOT (handle_selection_changed (bool)),
217 Qt::UniqueConnection);
218 }
219
221 {
223 gui_settings *s = rmgr.get_settings ();
224
225 // Save position
226 QPoint dlg_pos = pos ();
227
228#if defined (Q_OS_WIN32)
229 int y = dlg_pos.y ();
230#else
231 int y = dlg_pos.y () - geometry ().height () + frameGeometry ().height ();
232#endif
233
234 m_last_position = QPoint (dlg_pos.x (), y);
235
236 s->setValue (ed_fdlg_pos.key, m_last_position);
237
238 // Is current search/replace text in the mru list?
241
242 // Store mru lists
243 QStringList mru;
244 for (int i = 0; i < m_search_line_edit->count (); i++)
245 mru.append (m_search_line_edit->itemText (i));
246 s->setValue (ed_fdlg_search.key, mru);
247
248 mru.clear ();
249 for (int i = 0; i < m_replace_line_edit->count (); i++)
250 mru.append (m_replace_line_edit->itemText (i));
251 s->setValue (ed_fdlg_replace.key, mru);
252
253 // Store dialog's options
254 int opts = 0
255 + m_extension->isVisible () * FIND_DLG_MORE
256 + m_case_check_box->isChecked () * FIND_DLG_CASE
257 + m_from_start_check_box->isChecked () * FIND_DLG_START
258 + m_wrap_check_box->isChecked () * FIND_DLG_WRAP
259 + m_regex_check_box->isChecked () * FIND_DLG_REGX
261 + m_backward_check_box->isChecked () * FIND_DLG_BACK
263 s->setValue (ed_fdlg_opts.key, opts);
264
265 s->sync ();
266 }
267
268 void find_dialog::restore_settings (QPoint ed_bottom_right)
269 {
271 gui_settings *s = rmgr.get_settings ();
272
273 // Get mru lists for search and replace text
274 QStringList mru = s->value (ed_fdlg_search.key).toStringList ();
275 while (mru.length () > m_mru_length)
276 mru.removeLast ();
277 m_search_line_edit->addItems (mru);
278
279 mru = s->value (ed_fdlg_replace.key).toStringList ();
280 while (mru.length () > m_mru_length)
281 mru.removeLast ();
282 m_replace_line_edit->addItems (mru);
283
284 // Get the dialog's options
285 int opts = s->value (ed_fdlg_opts.key, ed_fdlg_opts.def).toInt ();
286
287 m_extension->setVisible (FIND_DLG_MORE & opts);
288 m_case_check_box->setChecked (FIND_DLG_CASE & opts);
289 m_from_start_check_box->setChecked (FIND_DLG_START & opts);
290 m_wrap_check_box->setChecked (FIND_DLG_WRAP & opts);
291 m_regex_check_box->setChecked (FIND_DLG_REGX & opts);
292 m_whole_words_check_box->setChecked (FIND_DLG_WORDS & opts);
293 m_backward_check_box->setChecked (FIND_DLG_BACK & opts);
294 m_search_selection_check_box->setChecked (FIND_DLG_SEL & opts);
295
296 // Position: lower right of editor's position
297 int xp = ed_bottom_right.x () - sizeHint ().width ();
298 int yp = ed_bottom_right.y () - sizeHint ().height ();
299
300 m_last_position = s->value (ed_fdlg_pos.key, QPoint (xp, yp)).toPoint ();
301 move (m_last_position);
302
303 if (QApplication::desktop ()->screenNumber (this) == -1)
304 {
305 // Last used position is not on screen anymore, use default pos.
306 m_last_position = QPoint (xp, yp);
307 move (m_last_position);
308
309 if (QApplication::desktop ()->screenNumber (this) == -1)
310 {
311 // Default position is not on screen, last resort
312 m_last_position = QPoint (50, 100); // upper left
313 move (m_last_position);
314 }
315 }
316
317 }
318
319 // set text of "search from start" depending on backward search
321 {
322 if (backward)
323 m_from_start_check_box->setText (tr ("Search from end"));
324 else
325 m_from_start_check_box->setText (tr ("Search from start"));
326 }
327
328 // search text has changed: reset the search
330 {
331 // Return if nothing has changed
332 if (m_search_line_edit->currentText () == m_search_line_edit->itemText (0))
333 return;
334
335 if (m_search_selection_check_box->isChecked ())
337
339 }
340
341 // replaced text has changed: reset the search
343 {
344 // Return if nothing has changed
345 if (m_replace_line_edit->currentText () == m_replace_line_edit->itemText (0))
346 return;
347
349 }
350
351 // Update the mru list
352 void find_dialog::mru_update (QComboBox *mru)
353 {
354 // Remove possible empty entries from the mru list
355 int index;
356 while ((index = mru->findText (QString ())) >= 0)
357 mru->removeItem (index);
358
359 // Get current text and return if it is empty
360 QString text = mru->currentText ();
361
362 if (text.isEmpty ())
363 return;
364
365 // Remove occurrences of the current text in the mru list
366 while ((index = mru->findText (text)) >= 0)
367 mru->removeItem (index);
368
369 // Remove the last entry from the end if the list is full
370 if (mru->count () == m_mru_length)
371 mru->removeItem (m_mru_length -1);
372
373 // Insert new item at the beginning and set it as current item
374 mru->insertItem (0, text);
375 mru->setCurrentIndex (0);
376 }
377
379 {
380 m_from_start_check_box->setEnabled (! selected);
382 }
383
385 {
386 if (m_rep_active)
387 return;
388
389 m_search_selection_check_box->setEnabled (has_selected);
391 }
392
393 // initialize search text with selected text if this is in one single line
395 {
396 if (m_edit_area && m_edit_area->hasSelectedText ())
397 {
398 int lbeg, lend, cbeg, cend;
399 m_edit_area->getSelection (&lbeg, &cbeg, &lend, &cend);
400 if (lbeg == lend)
401 m_search_line_edit->setCurrentText (m_edit_area->selectedText ());
402 }
403
404 // set focus to "Find what" and select all text
405 m_search_line_edit->setFocus ();
406 m_search_line_edit->lineEdit ()->selectAll ();
407
408 // Default to "find" next time.
409 // Otherwise, it defaults to the last action, which may be "replace all".
410 m_find_next_button->setDefault (true);
411 }
412
414 {
415 find (! m_backward_check_box->isChecked ());
416 }
417
419 {
420 find (m_backward_check_box->isChecked ());
421 }
422
423 void find_dialog::find (bool forward)
424 {
425 if (! m_edit_area)
426 return;
427
429
430 // line adn col: -1 means search starts at current position
431 int line = -1, col = -1;
432
433 bool do_wrap = m_wrap_check_box->isChecked ();
434 bool do_forward = forward;
435
436 // Initialize the selection begin and end if it is the first search
438 {
439 if (m_search_selection_check_box->isChecked ()
440 && m_edit_area->hasSelectedText ())
441 {
442 int l1, c1, l2, c2;
443 m_edit_area->getSelection (&l1, &c1, &l2, &c2);
444
445 // Store the position of the selection
446 m_sel_beg = m_edit_area->positionFromLineIndex (l1, c1);
447 m_sel_end = m_edit_area->positionFromLineIndex (l2, c2);
448 m_in_sel = true;
449 }
450 else
451 m_in_sel = false;
452 }
453
454 // Get the correct line/col for beginning the search
455 if (m_rep_all)
456 {
457 // Replace All
458 if (m_rep_all == 1)
459 {
460 // Start at the beginning of file/sel if it is the first try
461 if (m_in_sel)
462 m_edit_area->lineIndexFromPosition (m_sel_beg, &line, &col);
463 else
464 {
465 line = 0;
466 col = 0;
467 }
468 }
469 do_wrap = false; // Never wrap when replacing all
470 }
471 else
472 {
473 // Normal search (not replace all): calculate start position of
474 // search (in file or selection)
475 if (m_from_start_check_box->isChecked ()
477 {
478 // From the beginning or the end of file/sel
479 if (do_forward)
480 {
481 // From the beginning
482 if (m_in_sel)
483 m_edit_area->lineIndexFromPosition (m_sel_beg, &line, &col);
484 else
485 {
486 line = 0;
487 col = 0;
488 }
489 }
490 else
491 {
492 // From the end
493 if (m_in_sel)
494 m_edit_area->lineIndexFromPosition (m_sel_end, &line, &col);
495 else
496 {
497 line = m_edit_area->lines () - 1;
498 col = m_edit_area->text (line).length () - 1;
499 if (col == -1)
500 col = 0;
501 }
502 }
503 }
504 else if (! do_forward)
505 {
506 // Start from where the cursor is. Fix QScintilla's cursor
507 // positioning
508 m_edit_area->getCursorPosition (&line, &col);
509 if (m_find_result_available && m_edit_area->hasSelectedText ())
510 {
511 int currpos = m_edit_area->positionFromLineIndex (line, col);
512 currpos -= (m_search_line_edit->currentText ().length ());
513 if (currpos < 0)
514 currpos = 0;
515 m_edit_area->lineIndexFromPosition (currpos, &line, &col);
516 }
517 }
518 }
519
520 // Do the search
522 = m_edit_area->findFirst (m_search_line_edit->currentText (),
523 m_regex_check_box->isChecked (),
524 m_case_check_box->isChecked (),
525 m_whole_words_check_box->isChecked (),
526 do_wrap,
527 do_forward,
528 line, col,
529 true
530#if defined (HAVE_QSCI_VERSION_2_6_0)
531 , true
532#endif
533 );
534
536 {
537 // Search successful: reset search-from-start box and check for
538 // the current selection
539 m_from_start_check_box->setChecked (0);
540
541 if (m_in_sel)
542 {
543 m_edit_area->getCursorPosition (&line, &col);
544 int pos = m_edit_area->positionFromLineIndex (line, col);
545
546 int l1, c1, l2, c2;
547 m_edit_area->lineIndexFromPosition (m_sel_beg, &l1, &c1);
548 m_edit_area->lineIndexFromPosition (m_sel_end, &l2, &c2);
549 m_edit_area->show_selection_markers (l1, c1, l2, c2);
550
551 // Check if new start position is still within the selection
553 }
554 }
555
556 // No more search hits
558 {
559 if (m_in_sel)
560 {
561 // Restore real selection and remove marker for selection
562 int l1, c1, l2, c2;
563 m_edit_area->lineIndexFromPosition (m_sel_beg, &l1, &c1);
564 m_edit_area->lineIndexFromPosition (m_sel_end, &l2, &c2);
565 m_edit_area->setSelection (l1, c1, l2, c2);
567 }
568
569 // Display message if not replace all
570 if (! m_rep_all)
572 }
573
574 }
575
577 {
578 if (m_edit_area)
579 {
580 m_rep_active = true; // changes in selection not made by the user
581
582 m_edit_area->replace (m_replace_line_edit->currentText ());
583 if (m_in_sel)
584 {
585 // Update the length of the selection
587 - m_search_line_edit->currentText ().toUtf8 ().size ()
588 + m_replace_line_edit->currentText ().toUtf8 ().size ();
589 }
590
591 m_rep_active = false;
592 }
593 }
594
596 {
597 if (m_edit_area)
598 {
600
601 // Do the replace if we have selected text
602 if (m_find_result_available && m_edit_area->hasSelectedText ())
603 do_replace ();
604
605 find_next ();
606 }
607 }
608
610 {
611 int line, col;
612
613 if (m_edit_area)
614 {
616
617 m_edit_area->getCursorPosition (&line, &col);
618
619 m_rep_all = 1;
620 find_next (); // find first occurrence (forward)
621
622 m_edit_area->beginUndoAction ();
623 while (m_find_result_available) // while search string is found
624 {
625 do_replace ();
626 m_rep_all++; // inc counter
627 find_next (); // find next
628 }
629 m_edit_area->endUndoAction ();
630
631 QMessageBox msg_box (QMessageBox::Information, tr ("Replace Result"),
632 tr ("%1 items replaced").arg (m_rep_all-1),
633 QMessageBox::Ok, this);
634 msg_box.exec ();
635
636 m_rep_all = 0;
638
639 if (! m_search_selection_check_box->isChecked ())
640 m_edit_area->setCursorPosition (line, col);
641 }
642 }
643
645 {
646 QMessageBox msg_box (QMessageBox::Information, tr ("Find Result"),
647 tr ("No more matches found"), QMessageBox::Ok, this);
648 msg_box.exec ();
649 }
650
652 {
653 close ();
654 }
655
656 void find_dialog::closeEvent (QCloseEvent *e)
657 {
658 save_settings ();
659 e->accept ();
660 }
661
662 // Show and hide with (re-)storing position, otherwise there is always
663 // a small shift each time the dialog is shown again
664 void find_dialog::set_visible (bool visible)
665 {
666 if (visible)
667 {
668 show ();
669 move (m_last_position);
670 }
671 else
672 {
673 m_last_position = pos ();
674 hide ();
675 }
676 }
677
678}
679#endif
Base class for Octave interfaces that use Qt.
resource_manager & get_resource_manager(void)
QCheckBox * m_backward_check_box
Definition: find-dialog.h:157
find_dialog(base_qobject &oct_qobj, octave_dock_widget *ed, QWidget *p)
Definition: find-dialog.cc:91
void handle_selection_changed(bool has_selected)
Definition: find-dialog.cc:384
void reject()
Reimplemented slot: close instead of hiding.
Definition: find-dialog.cc:651
void handle_replace_text_changed(void)
Definition: find-dialog.cc:342
QWidget * m_extension
Definition: find-dialog.h:164
base_qobject & m_octave_qobj
Definition: find-dialog.h:125
QCheckBox * m_case_check_box
Definition: find-dialog.h:151
void save_settings()
Save position and the search options in the given settings.
Definition: find-dialog.cc:220
void set_visible(bool visible)
Set dialog visible or not and storing the new visibility state.
Definition: find-dialog.cc:664
QPushButton * m_replace_all_button
Definition: find-dialog.h:162
QPushButton * m_replace_button
Definition: find-dialog.h:161
QCheckBox * m_search_selection_check_box
Definition: find-dialog.h:156
void init_search_text(void)
Init the search text with the selected text in the editor tab.
Definition: find-dialog.cc:394
void handle_backward_search_changed(int)
Definition: find-dialog.cc:320
QLabel * m_replace_label
Definition: find-dialog.h:149
QCheckBox * m_whole_words_check_box
Definition: find-dialog.h:154
void do_replace(void)
Definition: find-dialog.cc:576
void find(bool forward=true)
Definition: find-dialog.cc:423
QComboBox * m_search_line_edit
Definition: find-dialog.h:148
void mru_update(QComboBox *mru)
Update mru lists with new entry.
Definition: find-dialog.cc:352
QDialogButtonBox * m_button_box
Definition: find-dialog.h:158
void find_prev(void)
Definition: find-dialog.cc:418
QCheckBox * m_from_start_check_box
Definition: find-dialog.h:152
void update_edit_area(octave_qscintilla *)
Slot for updating the edit area when the active tab has changed.
Definition: find-dialog.cc:210
void handle_search_text_changed(void)
Definition: find-dialog.cc:329
void find_next(void)
Definition: find-dialog.cc:413
QCheckBox * m_wrap_check_box
Definition: find-dialog.h:153
QLabel * m_search_label
Definition: find-dialog.h:147
QPushButton * m_find_prev_button
Definition: find-dialog.h:160
QCheckBox * m_regex_check_box
Definition: find-dialog.h:155
void handle_sel_search_changed(int)
Definition: find-dialog.cc:378
const int m_mru_length
Definition: find-dialog.h:176
QPushButton * m_more_button
Definition: find-dialog.h:163
QComboBox * m_replace_line_edit
Definition: find-dialog.h:150
octave_qscintilla * m_edit_area
Definition: find-dialog.h:165
QPushButton * m_find_next_button
Definition: find-dialog.h:159
void closeEvent(QCloseEvent *e)
Reimplemented close event.
Definition: find-dialog.cc:656
void replace_all(void)
Definition: find-dialog.cc:609
void no_matches_message(void)
Definition: find-dialog.cc:644
void restore_settings(QPoint def_pos)
Restore position and the search options from the given settings where def_pos is the default position...
Definition: find-dialog.cc:268
QVariant value(const gui_pref &pref) const
Definition: gui-settings.h:63
virtual void setCursorPosition(int line, int col)
void show_selection_markers(int l1, int c1, int l2, int c2)
gui_settings * get_settings(void) const
const gui_pref ed_fdlg_opts("editor/fdgl_opts", QVariant(FIND_DLG_WRAP))
const gui_pref ed_fdlg_pos("editor/fdgl_pos", QVariant(QPoint(0, 0)))
const gui_pref ed_fdlg_search("editor/fdgl_search", QVariant())
@ FIND_DLG_CASE
@ FIND_DLG_REGX
@ FIND_DLG_WRAP
@ FIND_DLG_WORDS
@ FIND_DLG_MORE
@ FIND_DLG_START
@ FIND_DLG_SEL
@ FIND_DLG_BACK
const gui_pref ed_fdlg_replace("editor/fdgl_replace", QVariant())
const QString key
const QVariant def