Conversation
Following on from Mudlet#1096 I realised that the search capability was still not case sensitive and given that Lua is a case preserving language this struck me as a nuisance. It is now possible to configure this feature when searching with a button that displays three line of letters "ABCD"/"AbCd"/"abcd" with all three lines highlighted when searches are not case sensitive (i.e. a search for "A" will also find "a") and only the middle line when the case does matter (i.e. a search for "A" will not find the lower case one). As we now have "boarder-outlines" around all the instances found in an element in a lua script component, we ought to have a means to removed them afterwards without having to click on another item and then return to the current one being considered. This commit also adds a clear button to both clear the treeWidget_searchResults but also to remove those border outlines. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Now clicking on a result in the search tree widget should put the focus
(and the cursor) on the first (or selected term depending on case) within
item.
Moved several methods in dlgTriggerEditor from being declared as SLOTs when
they are not so used:
* (void) recursiveSearchTriggers(TTrigger*, const QString&)
* (void) recursiveSearchAlias(TAlias*, const QString&)
* (void) recursiveSearchScripts(TScript*, const QString&)
* (void) recursiveSearchActions(TAction*, const QString&)
* (void) recursiveSearchTimers(TTimer*, const QString&)
* (void) recursiveSearchKeys(TKey*, const QString&)
In that class I also renamed:
* (void) recurseVariablesDown(TVar*, QList<TVar*>&, bool)
==> recursiveSearchVariables(TVar*, QList<TVar*>&, bool)
because it had the same name as another function with a different signature
but it is used in the same manner as the previously mentioned no longer
SLOT methods.
Also renamed in the same class was:
* (void) slot_search_triggers(const QString)
==> slot_searchMudletItems(const QString&)
because it is now used to search all item types not just "Triggers" as it
may once have done!
I added a couple of enums to the same class, both for use with the search
functionality which this commit extends, the first is used to categorise
the data elements that are stored in the first item in each row of the
search results tree widget and the second (used as one type of the first)
to identify which part of a particular "item" the search result relates to
and thus how to process the stored data to goto the correct part of the
editor display when/if that result is selected by the user.
Elements were also renamed to try and be a bit more consistent across the
different Mudlet "item" types:
In "aliases" form/dialog:
* (QLineEdit *) pattern_textedit ==> lineEdit_alias_pattern
* (QComboBox *) comboBox ==> comboBox_alias_regex
* (QLineEdit *) substitution ==> lineEdit_alias_command
In "actions" (buttons/menus/toolbars) form/dialog:
* (QCheckBox *) checkBox_pushdownbutton
==> checkBox_action_button_isPushDown
* (QLineEdit *) lineEdit_command_down
==> lineEdit_action_button_command_down
* (QLineEdit *) lineEdit_command_up ==> lineEdit_action_button_command_up
* (QSpinBox *) buttonColumns ==> spinBox_action_bar_columns
* (QPlainTextEdit *) css ==> plainTextEdit_action_css
* (QComboBox *) comboBox_location ==> comboBox_action_bar_location
* (QComboBox *) comboBox_orientation ==> comboBox_action_bar_orientation
* (QComboBox *) buttonRotation ==> comboBox_action_button_rotation
* (QLabel *) label_command_down ==> label_action_button_command_down
* (QLabel *) label_command_up ==> label_action_button_command_up
In "keys" form/dialog:
* (QPushButton *) pushButton_grabKey ==> pushButton_key_grabKey
* (QLineEdit *) lineEdit_command ==> lineEdit_key_command
* (QLineEdit *) lineEdit_name ==> lineEdit_key_name
* (QLineEdit *) lineEdit_key ==> lineEdit_key_binding
In "scripts" form/dialog:
* (QLineEdit *) lineEdit ==> lineEdit_script_event_handler_entry
* (QListWidget *) listWidget_registered_event_handlers
==> listWidget_script_registered_event_handlers
* (QToolButton *) toolButton_add ==> toolButton_script_add_event_handler
* (QToolButton *) toolButton_remove
==> toolButton_script_remove_even_handler
In "timer" form/dialog:
* (QLineEdit *) lineEdit_command ==> lineEdit_timer_command
* (QTimeEdit *) timeEdit_hours ==> timeEdit_timer_hours
* (QTimeEdit *) timeEdit_minutes ==> timeEdit_timer_minutes
* (QTimeEdit *) timeEdit_seconds ==> timeEdit_timer_seconds
* (QTimeEdit *) timeEdit_msecs ==> timeEdit_timer_msecs
In "trigger pattern" form/dialog:
* (QComboBox) patternType ==> comboBox_patternType
* (QPushButton) fgB ==> pushButton_fgColor
* (QPushButton) bgB ==> pushButton_bgColor
* (QLabel) number ==> label_patternNumber
In "variables" form/dialog:
* (QCheckBox *) hideVariable ==> checkBox_variable_hidden
* (QComboBox *) key_type ==> comboBox_variable_key_type
* (QComboBox *) var_type ==> comboBox_variable_value_type
Note that in the above SOME other elements that are not used in a
programmatic way (e.g. some label identifiers or layout or container
type widgets) have also been renamed in a similar way.
Also:
* The layout of the Timer editor has been "improved" and also now reports
the milli-seconds in "zzz" format rather than "z" so that it is more
obvious that the number is thousandths of a second and can range from "000"
to "999".
* The patterns in the trigger part of the editor are now numbered in a
more human-friendly 1 to 50 instead of the previous 0 to 49.
* When a different trigger is selected the pattern widget is scrolled so
that the highest used pattern number is in view.
* The search process now also searches: the "name" field for all items and
where relevant the "command" fields of "actions", "aliases", "keys",
"timers" and "triggers" {including the "command (up)}" for "buttons" and
the "Css"/"Stylesheet" field for "buttons"/"menus"/"buttons" and the
"Events handled" for "Scripts" and the "pattern" field for "aliases".
* Searching on fields that are multi-line (the Lua scripts for all but
"variables"; the "Css/Stylesheet" for "buttons"/"menus"/"buttons") or
multi-element ("trigger" patterns) indicate the line/column of the start
of the search term or pattern number respectively in the "What" column of
the search results.
* I have tweaked the tooltip for the case sensitive search a little to
better explain its two states - overall the icon is not the most perfect
for the role but I could not think of a better way to make it's image(s)
better match it's effects.
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
…editor Uses a means documented in https://stackoverflow.com/a/21376774/4805858 to replace the "standard" data model for the QComboBox with one from the QListWidget which allows individual items to be flagged as disabled - which the standard QComboBox does not. This is designed to, in conjunction with a refactoring of code in dlgTriggerEditor::slot_var_selected(...) to prevent invalid choices to be made by the user (so types that they cannot enter through the Editor widget but which are included in the type QComboBox s for display purposes: functions for both and tables for one are disabled). I would like to hide the editor widget when functions and tables are selected in the tree widget - but that has proven to mess up the spacing and layout for the remaining visible widgets and will have to be left until I can bring: PR 436 "(release 30)bug fix get splitter working properly on editor right side" into a usable state: Mudlet#436 Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
* Some not-used (or rather rejected) icons * A typo of toolButton_script_remove_even_handler when it should have been toolButton_script_remove_event_handler * reordered all QGridLayout constructs in the "touched" dialog/forms in strict ascending column & row (columns first) order - as Qt Form designer does not currently enforce this but it increases Git noise in them. * edited tooltip for hidden variable to match new form of hidden variables control. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
|
||
| void clearDocument(edbee::TextEditorWidget* ew, const QString& initialText=QLatin1Literal("")); | ||
|
|
||
| void setAllSearchData(QTreeWidgetItem* pItem, const int& type, const QString& name, const int& id, const SearchDataResultType& what, const int& pos = 0, const int& instance = 0, const int& subInstance = 0) { |
There was a problem hiding this comment.
Forgot to document this and the next in the PR / Commit comment but (hopefully) in-line-able methods to fill out the QTreeWidgetItem::data construct in one swell foop...!
| pItem->setData(0, IndexRole, subInstance); | ||
| } | ||
|
|
||
| void setAllSearchData(QTreeWidgetItem* pItem, const QString& name, const QStringList& id, const SearchDataResultType& what, const int& pos = 0, const int& subInstance = 0) { |
There was a problem hiding this comment.
Has a different signature and is only for Variables...
| QTreeWidgetItem* mpCurrentAliasItem; | ||
| QTreeWidgetItem* mpCurrentVarItem; | ||
| QLineEdit* mpCursorPositionIndicator; | ||
| // Not used: QLineEdit* mpCursorPositionIndicator; |
There was a problem hiding this comment.
Candidate for next de-crufting...! 😀
| #include <QFileDialog> | ||
| #include <QMessageBox> | ||
| #include <QScrollBar> | ||
| #include <QTableWidget> |
There was a problem hiding this comment.
Found this was needed after removing it from dlgTriggerEditor class which does not contain any QTableWidgets (any more)
| </property> | ||
| <property name="text"> | ||
| <string>Number of columns/rows (depending on orientation)::</string> | ||
| <string>Number of columns/rows (depending on orientation):</string> |
There was a problem hiding this comment.
Spotted this typo whilst doing other things...
| mpTriggersMainArea->pushButtonFgColor->setStyleSheet(FgColorStyleSheet); | ||
| mpTriggersMainArea->pushButtonBgColor->setStyleSheet(BgColorStyleSheet); | ||
| mpTriggersMainArea->pushButtonFgColor->setPalette(FgColorPalette); | ||
| mpTriggersMainArea->pushButtonBgColor->setPalette(BgColorPalette); |
There was a problem hiding this comment.
Now this is, apparently naughty - see previous comment about mixing palettes and styles.
| } | ||
| } else { | ||
| mpSourceEditorEdbee->setEnabled(true); | ||
| switch (keyType) { |
There was a problem hiding this comment.
I thought a switch to a switch(...) was a better/clearer way to do this. 🤓
| mpCurrentScriptItem = 0; | ||
| mpCurrentTimerItem = 0; | ||
| mpCurrentVarItem = 0; | ||
| mpCurrentTriggerItem = nullptr; |
There was a problem hiding this comment.
This is C++11 as well as C++14 isn't it? 😁
| { | ||
| if( trigger->isTemporary() ) { continue; } | ||
| std::list<TTrigger *> baseNodeList = mpHost->getTriggerUnit()->getTriggerRootNodeList(); | ||
| for (auto trigger : baseNodeList) { |
There was a problem hiding this comment.
Seems some stuff slipped past the "clang-formatter"?
| QStringList sL; | ||
| sL << "Triggers"; | ||
| mpTriggerBaseItem = new QTreeWidgetItem(static_cast<QTreeWidgetItem*>(0), sL); | ||
| mpTriggerBaseItem = new QTreeWidgetItem(static_cast<QTreeWidgetItem*>(0), QStringList(tr("Triggers"))); |
There was a problem hiding this comment.
Three lines down to one - and less named local variables.
|
I like how's there's 20 comments already and not a single review yet 😉 Awesome work, thanks for doing this! I have started getting through this slowly. |
Yeah it was hard to come up with a suitable pair of icons to indicate whether the search is case sensitive or not. It might work better with a "bitmap" font rather than using GIMP to add a normal text in form of "ABCD"/"AbCd"/"abcd" - anti-aliasing does NOT work well on small font sizes. Off the top of my head I cannot actually think of an icon form that would intrinsically suggest in one state that only an exact match in case will be found whereas in the other any combination would work. I did not find anything like a standard Oxygen icon for this - which surprised me...! On the choice of colours I originally used green/red but given that is the most common colour blindness form I changed the red to blue - which would have a higher lighteness contrast as well IIRC - I guess the grey/black form for the "un-hovered" state would look similarly better with bitmap text characters... |
|
I'm not a fan of that proposal either. I think this is a hard problem to solve and if we think ahead - we can skip solving it entirely. Given the option of case-insensitivity, people will also want to be able to search for regex and other ways, and we can't fill up that whole line with colourful buttons. How about we adopt what Qt Creator did here. To select an option: With an option selected: |
| , mpCurrentTriggerItem(0) | ||
| , mpCurrentAliasItem(0) | ||
| , mpCurrentVarItem(0) | ||
| : mpAliasBaseItem(nullptr) |
How is this supposed to work? I'm not seeing any scrolling happening. |
|
I'm especially a fan of the improved Timers and Variables view. Great work! Looks so much neater 💯 |
|
@ vadi2 wrote:
If a trigger contains more patterns than will fit on screen in the scroll area of the |
|
@ vadi2 wrote:
Does the same slot code get executed so that the boundary highlighting of the search terms in the current lua code content of the edbee editor widget gets cleared - I am guessing it is but it is not visible in the peek... 😀 |
Yep! |
|
It is more apparent in use - when the option is disabled, nothing is shown. When it is enabled, it adds an icon. I mean, try it in Qt Creator yourself! I think it's a good design we could adopt. |
|
Yeah, I am aware of it, hell, I use it and should we get whole word/regexp searches coded in I think that could be way to go - but it does need more code that I do not currently have to hand. In the short term I'd prefer to try to redraw the icons for case sensitivity using a graphics editor that allows a bitmap font (or one without anti-aliasing) to be used - or to draw the characters/glyphs manually... |
|
OK, my bad, I didn't mean that you should do it now and I wasn't clear on that. Could try using a better icon - I'll think of something too. |
|
Err meant to submit a PR but pushed code instead to the original branch. Let me know if you disagree with any of the changes I did @SlySven! |
|
From the file names it looks as though you have replaced the grey/green show/hide results icons of 16x16 pixel size - assuming that the same icon engine is used for icons set via It took a while to deduce what you were doing with the new code on the search term |
|
The engine did a terrible job of scaling down the icons so I had to manually scale them in GIMP. That form of Yep, we could use that QActions thing to add more icons! |
|
How about a variation of @itsTheFae's proposal, but with |
|
Well, for the current icon can we fit a reasonable size "AA/Aa/aa" for case sensitive off and "AA/Aa/aa" for case sensitive on into it - the trouble with just a single pair of letters is that it is not intuitive and you need at least two to show how only the specific combination will match... I guess if we have already moved the clear icon into the |
|
Yeah, I'm trying this out now!
…On Fri, Jul 21, 2017 at 9:47 PM Stephen Lyons ***@***.***> wrote:
Well, for the current icon can we fit a reasonable size "*AA/Aa/aa*" for
case sensitive off and "AA/*Aa*/aa" for case sensitive on into it - the
trouble with just a single pair of letters is that it is not intuitive and
you need at least two to show how only the specific combination will
match...
I guess if we have already moved the clear icon into the QComboBox we
could allow an icon for this to be non-square (i.e. a landscape format) so
the glyphs can be larger and less prone to aliasing issues. This would be a
temporary measure until we can move this option into the QComboBox's
context menu (when we have other options to go alongside it)...
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#1218 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGxjAVwOs9r-nNkaflq_Fi08KfT0Ffuks5sQQBFgaJpZM4OTmt->
.
|
|
@SlySven by the way, a now shows when using |
The mechanism now behaves very like the Qt Creator's own search options which are presented as a clickable menu at the start of the search term QLineEdit part of the editable QComboBox. At present only Case Sensitivity is supported but it will be possible to add additional search options - the most likely being whole word and regular expression type searches. As the QtCreator inspiration does different icons are shown depending on the options enabled on the menu that is displayed is clicked (and encoded into the new enum/QFlags "SearchOptions" which is stored in dlgTriggerEditor::mSearchOptions). As new options are coded extra icons that support all the combinations will be needed (although if a combination is not provided with an icon) the grey binoculars icon that is used when no option is set is replaced with a red one to indicate something is enabled and modifying the search behaviour. At present the options chosen are NOT stored against the search terms that get stored into the search term QComboBox - it might be wanted to store the search options chosen as part of each search term (use a item::data for that) so they can be restore if an existing term is reused... Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
@vadi2 give it a try now - I have implemented the same methodology that Qt use for the find in QtCreator... It only does Case Sensitive right now but extending the option list is straightforward. 😇
That is probably the variable searching - that does really bog things down but does find the search terms in both names and values anywhere in the lua data - which does have some use - perhaps an |
|
The binocular icons are derived but modified from the Oxygen icon set and the two letter one is a non alias but full hinted "Sans" 24 point by me (all GPLed). The 64x64 icons may scale down OK - they look Ok to me. |
So any usage optimisation is lost and the string still has to be created at runtime too. See https://github.com/Mudlet/Mudlet/blob/development/CONTRIBUTING.md#use-qlatin1string-over-qstringliteral-if-the-function-takes-it
vadi2
left a comment
There was a problem hiding this comment.
💯 awesome stuff! It's great that it searches event handlers now and a lot of other things.
Just need to fix the introduced warning at https://travis-ci.org/Mudlet/Mudlet/jobs/255923230#L1309 and it's good to go!
|
|
||
| mpAction_searchCaseSensitive = new QAction(tr("Case sensitive"), this); | ||
| mpAction_searchCaseSensitive->setObjectName(QLatin1String("mpAction_searchCaseSensitive")); | ||
| mpAction_searchCaseSensitive->setObjectName(QStringLiteral("mpAction_searchCaseSensitive")); |
There was a problem hiding this comment.
Ah, good catch - BTW how does QLatin11String compare to QLatin1Literal I have seen a few uses of the latter used in our code-base and I suspect that is the QtCreator IDE helpfully auto-completing it when the other one is really wanted... 😮
Was producing a: "warning: comparison of constant -1 with boolean expression is always true [-Wtautological-constant-out-of-range-compare]" issue on Travis CI - which is just as well because the code in that one case had not previous been correct. I think I must have been doing a repetitive edit to code that I had copy and pasted and then revised and messed up one instance. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
Will squash and merge once latest CI completes. Note that I have spotted some other compilation CI warnings related to bit-ops on |
…1218) * Enhance: make editor search have optional case-sensitivity and clear Following on from #1096 I realised that the search capability was still not case sensitive and given that Lua is a case preserving language this struck me as a nuisance. It is now possible to configure this feature when searching. As we now have "boarder-outlines" around all the instances found in an element in a lua script component, we ought to have a means to removed them afterwards without having to click on another item and then return to the current one being considered. This commit also adds the built in clear button in the QLineEdit of the QComboBox that the search term is entered into which also clears the treeWidget_searchResults and also remove those border outlines. Clicking on a result in the search tree widget should put the focus (and the cursor) on the first (or selected term depending on case) within item. Moved several methods in dlgTriggerEditor from being declared as SLOTs when they are not so used: * (void) recursiveSearchTriggers(TTrigger*, const QString&) * (void) recursiveSearchAlias(TAlias*, const QString&) * (void) recursiveSearchScripts(TScript*, const QString&) * (void) recursiveSearchActions(TAction*, const QString&) * (void) recursiveSearchTimers(TTimer*, const QString&) * (void) recursiveSearchKeys(TKey*, const QString&) In that class I also renamed: * (void) recurseVariablesDown(TVar*, QList<TVar*>&, bool) ==> recursiveSearchVariables(TVar*, QList<TVar*>&, bool) because it had the same name as another function with a different signature but it is used in the same manner as the previously mentioned no longer SLOT methods. Also renamed in the same class was: * (void) slot_search_triggers(const QString) ==> slot_searchMudletItems(const QString&) because it is now used to search all item types not just "Triggers" as it may once have done! I added a couple of enums to the same class, both for use with the search functionality which this commit extends, the first is used to categorise the data elements that are stored in the first item in each row of the search results tree widget and the second (used as one type of the first) to identify which part of a particular "item" the search result relates to and thus how to process the stored data to goto the correct part of the editor display when/if that result is selected by the user. Elements were also renamed to try and be a bit more consistent across the different Mudlet "item" types: In "aliases" form/dialog: * (QLineEdit *) pattern_textedit ==> lineEdit_alias_pattern * (QComboBox *) comboBox ==> comboBox_alias_regex * (QLineEdit *) substitution ==> lineEdit_alias_command In "actions" (buttons/menus/toolbars) form/dialog: * (QCheckBox *) checkBox_pushdownbutton ==> checkBox_action_button_isPushDown * (QLineEdit *) lineEdit_command_down ==> lineEdit_action_button_command_down * (QLineEdit *) lineEdit_command_up ==> lineEdit_action_button_command_up * (QSpinBox *) buttonColumns ==> spinBox_action_bar_columns * (QPlainTextEdit *) css ==> plainTextEdit_action_css * (QComboBox *) comboBox_location ==> comboBox_action_bar_location * (QComboBox *) comboBox_orientation ==> comboBox_action_bar_orientation * (QComboBox *) buttonRotation ==> comboBox_action_button_rotation * (QLabel *) label_command_down ==> label_action_button_command_down * (QLabel *) label_command_up ==> label_action_button_command_up In "keys" form/dialog: * (QPushButton *) pushButton_grabKey ==> pushButton_key_grabKey * (QLineEdit *) lineEdit_command ==> lineEdit_key_command * (QLineEdit *) lineEdit_name ==> lineEdit_key_name * (QLineEdit *) lineEdit_key ==> lineEdit_key_binding In "scripts" form/dialog: * (QLineEdit *) lineEdit ==> lineEdit_script_event_handler_entry * (QListWidget *) listWidget_registered_event_handlers ==> listWidget_script_registered_event_handlers * (QToolButton *) toolButton_add ==> toolButton_script_add_event_handler * (QToolButton *) toolButton_remove ==> toolButton_script_remove_even_handler In "timer" form/dialog: * (QLineEdit *) lineEdit_command ==> lineEdit_timer_command * (QTimeEdit *) timeEdit_hours ==> timeEdit_timer_hours * (QTimeEdit *) timeEdit_minutes ==> timeEdit_timer_minutes * (QTimeEdit *) timeEdit_seconds ==> timeEdit_timer_seconds * (QTimeEdit *) timeEdit_msecs ==> timeEdit_timer_msecs In "trigger pattern" form/dialog: * (QComboBox) patternType ==> comboBox_patternType * (QPushButton) fgB ==> pushButton_fgColor * (QPushButton) bgB ==> pushButton_bgColor * (QLabel) number ==> label_patternNumber In "variables" form/dialog: * (QCheckBox *) hideVariable ==> checkBox_variable_hidden * (QComboBox *) key_type ==> comboBox_variable_key_type * (QComboBox *) var_type ==> comboBox_variable_value_type Note that in the above SOME other elements that are not used in a programmatic way (e.g. some label identifiers or layout or container type widgets) have also been renamed in a similar way. Also: * The layout of the Timer editor has been "improved" and also now reports the milli-seconds in "zzz" format rather than "z" so that it is more obvious that the number is thousandths of a second and can range from "000" to "999". * The patterns in the trigger part of the editor are now numbered in a more human-friendly 1 to 50 instead of the previous 0 to 49. * When a different trigger is selected the pattern widget is scrolled so that the highest used pattern number is in view. * The search process now also searches: the "name" field for all items and where relevant the "command" fields of "actions", "aliases", "keys", "timers" and "triggers" {including the "command (up)}" for "buttons" and the "Css"/"Stylesheet" field for "buttons"/"menus"/"buttons" and the "Events handled" for "Scripts" and the "pattern" field for "aliases". * Searching on fields that are multi-line (the Lua scripts for all but "variables"; the "Css/Stylesheet" for "buttons"/"menus"/"buttons") or multi-element ("trigger" patterns) indicate the line/column of the start of the search term or pattern number respectively in the "What" column of the search results. A tweak has been included that disables some items on the key and value QComboBoxs in the "Variable" part of the editor, this uses a means documented in https://stackoverflow.com/a/21376774/4805858 to replace the "standard" data model for the QComboBox with one from the QListWidget which allows individual items to be flagged as disabled - which the standard QComboBox does not. This is designed to, in conjunction with a refactoring of code in dlgTriggerEditor::slot_var_selected(...) to prevent invalid choices to be made by the user (so types that they cannot enter through the Editor widget but which are included in the type QComboBox s for display purposes: functions for both and tables for one are disabled). I would like to hide the editor widget when functions and tables are selected in the tree widget - but that has proven to mess up the spacing and layout for the remaining visible widgets and will have to be left until I can bring: PR 436 "(release 30)bug fix get splitter working properly on editor right side" into a usable state: #436 I have reordered all QGridLayout constructs in the "touched" dialog/forms in strict ascending column & row (columns first) order - as Qt Form designer does not currently enforce this but it increases Git noise in them. Also have edited tooltip for hidden variable to match new form of hidden variables control. Part way through the evolution of this (squashed down to a single) commit it was decided to revised the search to be an options menu with space for additional options. The mechanism now behaves very like the Qt Creator's own search options which are presented as a clickable menu at the start of the search term QLineEdit part of the editable QComboBox. At present only Case Sensitivity is supported but it will be possible to add additional search options - the most likely being whole word and regular expression type searches. As the QtCreator inspiration does different icons are shown depending on the options enabled on the menu that is displayed is clicked (and encoded into the new enum/QFlags "SearchOptions" which is stored in dlgTriggerEditor::mSearchOptions). As new options are coded extra icons that support all the combinations will be needed (although if a combination is not provided with an icon) the grey binoculars icon that is used when no option is set is replaced with a red one to indicate something is enabled and modifying the search behaviour. Also currently the options chosen are NOT stored against the search terms that get stored into the search term QComboBox - it might be wanted to store the search options chosen as part of each search term (use a item::data for that) so they can be restore if an existing term is reused... Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
Fix pre-existing copy-paste bug (from Mudlet#1218) where clicking Keys search results for name/command incorrectly focused Triggers fields instead of Keys fields.







This somewhat large PR enhances the Editor in several ways:
{L: ## C: ##}to help in locating which result to click on - similarly "Pattern" results from triggers include a "{##}" addition to indicate which pattern provided the result. {Also the pattern numbers have been shifted up on screen in the GUI to be1-50instead of0-49and this is reflected in the search results and also fixes the bug from 2009 now recorded as Trigger pattern list GUI starts counting from 0 #608 ! 😀}† - This feature is, I think, a major item to be trumpeted in the release announcement. 😤