Simpler search function

Involved development of the OpenMW construction set.
Post Reply
User avatar
scrawl
Posts: 2085
Joined: 18 Feb 2012, 11:51
Contact:

Simpler search function

Post by scrawl » 10 Nov 2013, 17:25

Relevant IRC discussion
16:33 <scrawl> how am I supposed to search for something in OpenCS?
16:33 <scrawl> object with ID X?
16:36 <scrawl> string (ID, VFX_IllusionBolt) doesn't work
16:37 <scrawl> and it's also much more typing then it should be
16:37 <scrawl> there should be a "simpler" search bar...
16:40 <Sir_herrbatka> scrawl: there will be autocompletition
16:40 <Sir_herrbatka> anyway
16:40 <Sir_herrbatka> this supports regexp
16:40 <Sir_herrbatka> string(ID, VFX.*)
16:42 <Sir_herrbatka> scrawl: also, please note that this are filters, not searching
16:43 <Sir_herrbatka> they work only if entry is present in the table that is being parsed
16:43 <scrawl> but why does this not work
16:43 <scrawl> string(ID, VFX_IllusionBolt)
16:43 <scrawl> its red colored
16:43 <Sir_herrbatka> in which table?
16:43 -!- fusion44 [~fusion44@pD9FDD2D4.dip0.t-ipconnect.de] has joined #openmw
16:44 <scrawl> referenceables
16:44 <scrawl> does it work for you?
16:44 <Sir_herrbatka> scrawl: try !string(ID, VFX_IllusionBolt)
16:44 <Sir_herrbatka> ! = one shot
16:45 <Sir_herrbatka> though it does not filter anything for me
16:45 <scrawl> that works
16:45 <scrawl> what does the ! do?
16:45 <Sir_herrbatka> ! = one shot scope
16:45 <Sir_herrbatka> it is in the manual
16:45 <Sir_herrbatka> ;-)
16:46 <scrawl> one shot scope?
16:46 <Sir_herrbatka> yup, we have project, session and one shot scopes
16:47 <Sir_herrbatka> anyway
16:51 <scrawl> Sir_herrbatka: I think I get it now
16:51 <scrawl> I'm supposed to type a "name" of a filter that I already created in the Record Filter bar?
16:51 <Sir_herrbatka> greye: should i define it with nullptr?
16:51 <scrawl> can't you detect automatically if what I'm typing is a filter name or an expression?
16:52 <Sir_herrbatka> this sounds error prone
16:52 <Sir_herrbatka> more like ?name
16:53 <Sir_herrbatka> i think that ! is no big deal
17:00 <scrawl> Sir_herrbatka: if already I know the name of some object, and just want to jump to it, typing !string(ID, objectName) is way too long and obtuse
17:00 <scrawl> so imo there should be a seperate search bar
17:01 <scrawl> where I can just type anything
17:01 <Sir_herrbatka> scrawl: i think there shoul be no search bar
17:01 <scrawl> then what's your workflow suggestion for this?
17:01 <Sir_herrbatka> maybe typing ?searching in filter bar
17:01 <scrawl> again
17:01 <scrawl> too long
17:01 <Sir_herrbatka> ?VFX_IllusionBolt to long?
17:02 <scrawl> no, but obtuse
17:02 <scrawl> maybe hotkey F to open a pop up line entry
17:03 <Sir_herrbatka> hard to say
17:03 <Sir_herrbatka> i would go with ?, though one should really read the manual
17:03 <Sir_herrbatka> or he would never get it
17:03 <scrawl> or as I said before, make it behave like a search bar if you don't enter an expression
17:04 <scrawl> software should be instantly usable as much as possible
17:04 <scrawl> "read the manual" isn't an appropriate answer for something as simple as searching
17:06 <Sir_herrbatka> i don't think that simply typing name is the way to go
17:06 <Sir_herrbatka> there could be some collisions
17:07 <scrawl> btw, !string(ID, VFX.*) seems to be broken
17:07 <wheybags> if you do ?query into the normal filter bar
17:07 <wheybags> but
17:08 <wheybags> ctrl-f will prefill the query bar with ? and jump focus to there
17:08 <Sir_herrbatka> scrawl: try sorund vfx with " "
17:08 <wheybags> and there can be an edit->find menu too
17:08 <wheybags> that does the same thing
17:08 <scrawl> Sir_herrbatka: !string(ID, "VFX".*) ?
17:08 <scrawl> nope

User avatar
Zini
Posts: 5134
Joined: 06 Aug 2011, 15:16

Re: Simpler search function

Post by Zini » 10 Nov 2013, 19:00

Huh? If you want to search in a table, select a cell in the respective column and then type what you want to search for.

User avatar
scrawl
Posts: 2085
Joined: 18 Feb 2012, 11:51
Contact:

Re: Simpler search function

Post by scrawl » 10 Nov 2013, 19:22

Duh!
I actually tried that, but didn't realise I had to click on an ID cell. (Clicking and typing on other cells either has no effect, or opens a text editing field to edit that cell).
Not quite intuitive yet, if you ask me.

User avatar
Zini
Posts: 5134
Joined: 06 Aug 2011, 15:16

Re: Simpler search function

Post by Zini » 10 Nov 2013, 19:25

That is the standard for all Qt applications, I believe. At least that is how it comes out of the box. I didn't write a single line of code for it.

I agree that it is slightly confusing in the beginning, but once you have figured it out, its actually very comfortable to use.

User avatar
scrawl
Posts: 2085
Joined: 18 Feb 2012, 11:51
Contact:

Re: Simpler search function

Post by scrawl » 10 Nov 2013, 19:42

Also: what if I forgot the first letter(s)? Creating a regex filter just for this seems overkill.

How about a pop-up search bar that appears on Ctrl+F (just like in most browsers)?

User avatar
Zini
Posts: 5134
Joined: 06 Aug 2011, 15:16

Re: Simpler search function

Post by Zini » 10 Nov 2013, 19:52

If you are searching only for a part of the name, using regex seems like the right thing to do. I am not convinced that we need another (table specific) search tool besides Qt-table search and the (yet unimplemented) content file wide search & replace feature.
Let's go with what is implemented/planned for now and if we see that there is a major demand, we can always add a search bar later.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests