Ticket #1966 (assigned enhancement)

Opened 6 years ago

Last modified 5 years ago

The qtopia addressbook does not provide a search bar

Reported by: f.hackenberger@… Owned by: will
Priority: normal Milestone:
Component: Qtopia Version: Om2008.8
Severity: blocker Keywords: PM
Cc: will@… Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: no PatchReviewResult:
Reproducible:

Description

Please apply the attached patch to reactivate the search bar, even though we use a finger based qtopia theme.

Attachments

openmoko_addressbook_search.patch (815 bytes) - added by f.hackenberger@… 6 years ago.
Reenables the search field for the addressbook
addr_with_search.png (27.8 KB) - added by f.hackenberger@… 6 years ago.
addr_with_search_nokbd.png (35.2 KB) - added by f.hackenberger@… 6 years ago.
addr_with_search_result.png (18.2 KB) - added by f.hackenberger@… 6 years ago.
qtopia-enable-contactview-findbar.patch (1.3 KB) - added by Treviño 6 years ago.
Enable the find-bar in any QContactSelector widget

Change History

Changed 6 years ago by f.hackenberger@…

Reenables the search field for the addressbook

comment:1 Changed 6 years ago by zecke

  • Cc will@… added
  • Keywords HasPatch, PM added
  • Milestone Om2008.9 deleted

@f.hackenberger: Could you provide a screenshot of the app with the searchbar
@will: Do we want to enable this?

It is funny how within a day a friend of mine asks for a searchbar and someone else is doing a patch...

Changed 6 years ago by f.hackenberger@…

Changed 6 years ago by f.hackenberger@…

Changed 6 years ago by f.hackenberger@…

comment:2 Changed 6 years ago by f.hackenberger@…

@zeck: Your wish is my command :-)

Hope this gets in, as the addressbook is completely unusable without some kind of search functionality.

comment:3 Changed 6 years ago by zecke

  • Keywords HasPatch, removed

With http://git.openmoko.org/?p=qtopia.git;a=commit;h=a1d8c1294df28136452eb5645eb90f6b1820af73 and http://git.openmoko.org/?p=qtopia.git;a=commit;h=906a00fdcb89fdcc8252f84a76625eb42c8fe302 this is now configurable and defaults to off.

Changes in regard to your patch. The keyboard will only be shown after one clicked in the findbar. This has the benefit to not use most of the screen in the "common" case (obviously subjective and from my point of view). The commit message has a note what to do to get it enabled.

Now it is up to product management to decide the default.

comment:4 Changed 6 years ago by f.hackenberger@…

Thanks for taking the time to fix this properly! Will this change be pushed to asu.stable immediately or will this have to wait for a decision from the PM?

comment:5 Changed 6 years ago by zecke

It is in org.openmoko.dev and org.openmoko.asu.stable. The default is the current default and a change depends on will. You should be able to easily enable the findbar though.

I leave this bug open so one can decide the default.

comment:6 Changed 6 years ago by wilk

Does this mean it will soon hit http://downloads.openmoko.org/repository/Om2008.8/ ?

Changed 6 years ago by Treviño

Enable the find-bar in any QContactSelector widget

comment:7 Changed 6 years ago by Treviño

I've attached a small patch based on the one from git that enables the findbar (if configured - using the same ini value, not to add too many options) also in any other QContactSelector window (like the one that can be opened from the dialer itself).

Unfortunately I've not been able to disable the focus from the find text field (also forcing both the focus and the keyboard-grab to the contact list, the keyboard come up before hiding again), but in this case I figure that the keyboard input is practically always needed (since this is a selector window, is used only to select a contact, not to browse or look them).

comment:8 Changed 6 years ago by zecke

  • Keywords PM, HasPatch added; PM removed

Adding HasPatch?

comment:9 Changed 6 years ago by Treviño

Emh, could you merge my patch too?

Maybe you'd like not to make the keyboard pop-up in this case too?

comment:10 Changed 6 years ago by nelg

I've just tried testing this patch, as per the packages in http://www.hackenberger.at/openmoko/feeds/om2008/om-gta02/

It works, although I could not get it to start from the phone gui, but it would start from the command line ok.

One bug I have discovered is that using the default keyboard, it enters a space after the word, which means it does not find the entry in the address book until the user backspaces out the space.

I suggest that the input from the search box be trimmed of spaces, so that accidental spaces don't affect the search results.

comment:11 Changed 6 years ago by Treviño

Well, the problem is that it can't be just trimmed in any case, cause then if you want search a contact with a space in its name, your input will be ignored.
A good workaround imho would be: if the search bar text ends with a space, then ignore it when searching, but keep it in the textfield. So as you type a new word it will be searched correctly.

Btw you can test this feature using also the default repository, you only have to edit your configuration files as explained here

comment:12 follow-up: ↓ 13 Changed 6 years ago by Treviño

Ok, this does the work.

Addressbook:

diff --git a/src/applications/addressbook/contactlistpane.cpp b/src/applications/addressbook/contactlistpane.cpp
index 381a05d..d817e6b 100644
--- a/src/applications/addressbook/contactlistpane.cpp
+++ b/src/applications/addressbook/contactlistpane.cpp
@@ -177,7 +177,7 @@ void ContactListPane::search( const QString &text )
     if (text.isEmpty()) {
         mModel->clearFilter();
     } else {
-        mModel->setFilter( text );
+        mModel->setFilter( text.trimmed() );
     }
 }

Contactview:

diff --git a/src/libraries/qtopiapim/qcontactview.cpp b/src/libraries/qtopiapim/qcontactview.cpp
index 065d9c9..531126f 100644
--- a/src/libraries/qtopiapim/qcontactview.cpp
+++ b/src/libraries/qtopiapim/qcontactview.cpp
@@ -700,7 +707,7 @@ void QContactSelector::setSelected(const QModelIndex& idx)
 void QContactSelector::filterList(const QString& str)
 {
     if (d->mModel) {
-        d->mModel->setFilter(str, d->mModel->filterFlags());
+        d->mModel->setFilter(str.trimmed(), d->mModel->filterFlags());
     }
 }

comment:13 in reply to: ↑ 12 Changed 6 years ago by zecke

Replying to Treviño:

Ok, this does the work.

Do you know git-add -i? This allows you stage single hunks from a file. Also it would be cool if you could make a git-commit (with author, email address) so I can easily apply it with git-am. Currently this involves using whois to get a name and mail address :)

comment:14 follow-up: ↓ 15 Changed 6 years ago by zecke

  • Keywords PM added; PM, HasPatch removed

Clearing HasPatch?. I landed patches for the above mentioned issues. Thanks.

comment:15 in reply to: ↑ 14 ; follow-up: ↓ 16 Changed 6 years ago by Treviño

Replying to zecke:

Do you know git-add -i? This allows you stage single hunks from a file. Also it would be cool if you could make a git-commit (with author, email address) so I can easily apply it with git-am. Currently this involves using whois to get a name and mail address :)

Ah... I never used commands like git-add in projects where I can't commit directly with git-push, that's why I didn't used here (I also didn't know that I could have post here just )
BTW a lot of time ago, I've set my GIT_AUTHOR_* variables (to be used with git-commit), but the patches I've sent here are stored in a different PC...
However maybe I'd need to read something more about using git just for sending patches... :P

Replying to zecke:

Clearing HasPatch?. I landed patches for the above mentioned issues. Thanks.

Nice!

BTW, the same feature could be re-enabled also in the CallHistory?. I didn't patch it since I didn't find that so useful, but today (while using my phone) I missed that feature q bit...
So what about enabling there too? Maybe adding a different configuration flag, so people could chose.

comment:16 in reply to: ↑ 15 Changed 6 years ago by zecke

Replying to Treviño:

Replying to zecke:

Do you know git-add -i? This allows you stage single hunks from a file. Also it would be cool if you could make a git-commit (with author, email address) so I can easily apply it with git-am. Currently this involves using whois to get a name and mail address :)

Ah... I never used commands like git-add in projects where I can't commit directly with git-push, that's why I didn't used here (I also didn't know that I could have post here just )
BTW a lot of time ago, I've set my GIT_AUTHOR_* variables (to be used with git-commit), but the patches I've sent here are stored in a different PC...
However maybe I'd need to read something more about using git just for sending patches... :P

Use git-config --global to set author and mail address globally, use git-add -i to put hunks into your index, use git-commit to..., use git-format-patch origin/master to generate patches... then I can apply patches from within my mailer. But then again we should start looking into gitosis so people can push to people branches into our repositories. ;)

Replying to zecke:

Clearing HasPatch?. I landed patches for the above mentioned issues. Thanks.

Nice!

BTW, the same feature could be re-enabled also in the CallHistory?. I didn't patch it since I didn't find that so useful, but today (while using my phone) I missed that feature q bit...
So what about enabling there too? Maybe adding a different configuration flag, so people could chose.

Hmm. We should start grepping through qtopia for QThumbStyle and get a list of files? I'm happy to apply changes or do changes, changing defaults is something I'm not up to :)

comment:17 Changed 5 years ago by john_lee

  • Status changed from new to assigned
  • Owner changed from zecke to will
  • HasPatchForReview unset

hey will, do you think we should enable this? if not please close this ticket. FDOM guys are using it and people seem to like it so far.

comment:18 follow-up: ↓ 19 Changed 5 years ago by yarikoptic

I wonder what is the status of adopting this patch?

I had used some version of qpe with editbar enabled in the lists of contacts and I LOVED IT, but then since I am using 'testing' repository, I got qtopia-phone-x11 updated, thus I lost that functionality and GOT REALLY FRUSTRATED

I wonder if there is any objective reason why it is not enabled?

comment:19 in reply to: ↑ 18 Changed 5 years ago by zecke

Replying to yarikoptic:

I wonder what is the status of adopting this patch?

I had used some version of qpe with editbar enabled in the lists of contacts and I LOVED IT, but then since I am using 'testing' repository, I got qtopia-phone-x11 updated, thus I lost that functionality and GOT REALLY FRUSTRATED

I wonder if there is any objective reason why it is not enabled?

Maybe your FRUSTRATION is coming from YOUR INABILITY to EDIT a CONFIG FILE? As you can READ from THIS bug HISTORY you WILL be ABLE to FIGURE out that the patches were APPLIED but the decision to change the default is still pending... You can just enable it... And in THIS bug HISTORY you will find a POINTER that WILL tElL YOU how to enable it...You are also free to migrate this information to the wiki...

PS: As THIS is a BugTRACKER could WE agree TO not ABUSE CAPITALIZATION? Thanks.

Note: See TracTickets for help on using tickets.