maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [Announce] scout - search contacts, conversations and calendars (https://talk.maemo.org/showthread.php?t=58287)

nicolai 2010-07-12 09:41

[Announce] scout - search contacts, conversations and calendars
 
1 Attachment(s)
Hi,

here is my new Application.
Scout - Search Contacts, Conversations and Calendars.
You can search for text in Contacts for names, nicknames
usernames, addresses or phone numbers.
Calenderentries with summary or description text.
And text in your conversations.
It is currently in extras-devel. It may crash sometimes
but is mostly useable.

An example is shown in the screenshot for searchtext "test".
The search result category is indicated by the different icons
on the left side (contacts, calender, sms). I use two different
kind of icons for sms and chat conversations and for each
two different icons (with and without the blue arrow)
to distinguish received and outgoing messages.

Selecting a search result has different actions:
-opens a contact details dialog for contacts
-opens the calendar app for calendar entries (agenda view)
-opens a new window with the full message text for
conversations.
I wished I could open the conversation app for the conversation
search result, but I couldn't find a way to do so.



This is my entry for the coding competition. I want to announce it
here and now, first, to collect some feedback and second, because
I know there is a some demand for such an app.

Enjoy,
test and
give feedback.

regards
nicolai

bipinbn 2010-07-12 09:53

Re: [Announce] scout - search contacts, conversations and calendars
 
nice app..was very much needed..will test and report..
Thank you

ossipena 2010-07-12 10:00

Re: [Announce] scout - search contacts, conversations and calendars
 
damn, I quess I'll just buy new N900 in next autumn :D
(this is something I missed coming from E71)

logicalsid 2010-07-12 10:07

Re: [Announce] scout - search contacts, conversations and calendars
 
Definitely needed... :)

+1

--
Sidd

Power 2010-07-12 10:21

Re: [Announce] scout - search contacts, conversations and calendars
 
Cool! One reason I love the "N" so much. You don't have something, you don't like something, hack it up :)

Kudos to u!

SallyJane 2010-07-12 10:28

Re: [Announce] scout - search contacts, conversations and calendars
 
Ah nicolai you've done it again - another neat little app superbly positioned to fill a gaping void....

Thanks !!! :D

aanckar 2010-07-12 10:35

Re: [Announce] scout - search contacts, conversations and calendars
 
A thousand thanks, this app is fantastic and much needed!

After playing around, I have a few first remarks:

- searching is case-sensitive, could there be an option to change this?
- how about an option to jump to the selected entry in conversations?
- pressing enter on hardware keyboard could highlight search button

dbrodie 2010-07-12 10:40

Re: [Announce] scout - search contacts, conversations and calendars
 
I have a small feature request, if possible, to be able to search the Note field of a contact as well? I use this field a lot (solves the problem of what was the name of the Lawyer my friend recommended to call last month :) )
Thanks a lot!

nicolai 2010-07-12 10:42

Re: [Announce] scout - search contacts, conversations and calendars
 
Quote:

Originally Posted by aanckar (Post 749038)
A thousand thanks, this app is fantastic and much needed!

After playing around, I have a few first remarks:

- searching is case-sensitive, could there be an option to change this?

Maybe
Quote:

Originally Posted by aanckar (Post 749038)
- how about an option to jump to the selected entry in conversations?

Yes, this is the behaviour I wished, too. But I couldn't find a way
to open the conversation app for one conversation. I found no API,
no DBUS call for this. So this message window for the search result
in conversations is just a workaround.
Quote:

Originally Posted by aanckar (Post 749038)
- pressing enter on hardware keyboard could highlight search button

Thank you for your feedback
regards
nicolai

saxen 2010-07-12 11:08

Re: [Announce] scout - search contacts, conversations and calendars
 
does it search "case sensitive"!? :o

nicolai 2010-07-12 11:31

Re: [Announce] scout - search contacts, conversations and calendars
 
Quote:

Originally Posted by saxen (Post 749068)
does it search "case sensitive"!? :o

Yes, for the moment the search is case sensitive only.

nicolai

1ion 2010-07-12 11:42

Re: [Announce] scout - search contacts, conversations and calendars
 
Supports English only?

Wichall 2010-07-12 11:46

Re: [Announce] scout - search contacts, conversations and calendars
 
This looks very interesting :) I'll check it out when the case-sensitive thing is fixed

qwerty12 2010-07-12 15:46

Re: [Announce] scout - search contacts, conversations and calendars
 
Hi,

Quote:

Originally Posted by nicolai (Post 748980)
I wished I could open the conversation app for the conversation
search result, but I couldn't find a way to do so.

Code:

--- scout-0.0.1.orig/src/scout-window.cpp
+++ scout-0.0.1/src/scout-window.cpp
@@ -4,6 +4,10 @@
 #include <libosso.h>
 #include "scout-window.h"
 #include <rtcom-eventlogger/event.h>
+#include <rtcom-eventlogger-plugins/chat.h>
+#include <telepathy-glib/interfaces.h>
+#include <telepathy-glib/dbus.h>
+#include <rtcom-telepathy-glib/extensions.h>
 #include <string.h>
 #include <libintl.h>
 #include <locale.h>
@@ -899,37 +903,82 @@
                                const gchar* user_id,
                                int event_id)
 {
-  GtkWidget* window;
-  window = hildon_stackable_window_new();
  RTComElQuery *query = rtcom_el_query_new (self->priv->rt_el);
  rtcom_el_query_prepare (query, "id", event_id, RTCOM_EL_OP_EQUAL, NULL);
  RTComElIter* iter = rtcom_el_get_events(self->priv->rt_el, query);
 
  g_object_unref(query);
-  GtkWidget* text_view = hildon_text_view_new();
-  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text_view), GTK_WRAP_CHAR);
-  gtk_text_view_set_editable(GTK_TEXT_VIEW(text_view), FALSE);
  gboolean it = rtcom_el_iter_first(iter);
-  if(it)
-  {
-    gchar* text = NULL;
-    rtcom_el_iter_get_values(iter, "free-text", &text, NULL);
+  if (!it)
+    return;
+
+  gchar* remote_uid = NULL;
+  gchar* channel = NULL;
+  gint flags = 0;
+  gchar* local_uid = NULL;
+  rtcom_el_iter_get_values(iter, "remote-uid", &remote_uid, "channel", &channel, "flags", &flags, "local-uid", &local_uid, NULL);
 
-    hildon_text_view_set_placeholder (HILDON_TEXT_VIEW (text_view),
-                                      text);
-    GtkTextBuffer* buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view));
-    gtk_text_buffer_insert_at_cursor(buffer,
-                                    text,
-                                    strlen(text));
+  if (!((remote_uid || channel) && local_uid))
+    return;
+
+  McAccount *account = osso_abook_account_manager_lookup_by_name (NULL, local_uid);
+  if (!account)
+    goto finally;
+
+  if ((flags & RTCOM_EL_FLAG_CHAT_GROUP) && (flags & RTCOM_EL_FLAG_CHAT_OPAQUE))
+  {
+    if (!channel)
+        goto finally;
+
+    GHashTable *properties = tp_asv_new(TP_IFACE_CHANNEL ".ChannelType", G_TYPE_STRING,
+                        TP_IFACE_CHANNEL_TYPE_TEXT,
+                        TP_IFACE_CHANNEL ".TargetHandleType", G_TYPE_UINT,
+                        TP_HANDLE_TYPE_NONE,
+                        RTCOM_TP_IFACE_CHANNEL_INTERFACE_PERSISTENT ".PersistentID",
+                        G_TYPE_STRING, channel,
+                        NULL);
+
+    mc_account_channelrequest_ht (account,
+                                  properties,
+                                  time (NULL),
+                                  NULL,
+                                  MC_ACCOUNT_CR_FLAG_USE_EXISTING,
+                                  NULL, NULL, NULL, NULL);
+
+    g_hash_table_unref (properties);
  }
  else
  {
-    hildon_text_view_set_placeholder (HILDON_TEXT_VIEW (text_view),
-                                      "no text");
+    McAccountChannelrequestData request;
+
+    MC_ACCOUNT_CRD_INIT (&request);
+    MC_ACCOUNT_CRD_SET (&request, channel_type, TP_IFACE_QUARK_CHANNEL_TYPE_TEXT);
+
+    if ((flags & RTCOM_EL_FLAG_CHAT_ROOM) && channel)
+    {
+      MC_ACCOUNT_CRD_SET (&request, target_handle_type, TP_HANDLE_TYPE_ROOM);
+      MC_ACCOUNT_CRD_SET (&request, target_id, channel);
+    }
+    else if (remote_uid)
+    {
+      MC_ACCOUNT_CRD_SET (&request, target_handle_type, TP_HANDLE_TYPE_CONTACT);
+      MC_ACCOUNT_CRD_SET (&request, target_id, remote_uid);
+    }
+    else
+      goto finally;
+
+      mc_account_channelrequest (account,
+                                &request,
+                                time (NULL),
+                                NULL,
+                                MC_ACCOUNT_CR_FLAG_USE_EXISTING,
+                                NULL, NULL, NULL, NULL);
  }
-  gtk_container_add(GTK_CONTAINER(window), text_view);
-  gtk_window_set_title(GTK_WINDOW(window), user_id);
-  gtk_widget_show_all(window);
+
+finally:
+    g_free (remote_uid);
+    g_free (channel);
+    g_free (local_uid);
 }
 
 static void

Note: I do not take credit for this method; code was taken from the Conversations Inbox Desktop Widget.

Dr.MZ 2010-07-12 19:15

Re: [Announce] scout - search contacts, conversations and calendars
 
Would it be possible to search for additional files to include? Thus it takes no longer the App Search Tool.

Laughing Man 2010-07-12 19:25

Re: [Announce] scout - search contacts, conversations and calendars
 
Have you considered including applications?

robbie 2010-07-14 15:53

Re: [Announce] scout - search contacts, conversations and calendars
 
Quote:

Originally Posted by nicolai (Post 748980)
because I know there is a some demand for such an app.

Understatement of the year?

I really wanted this! Thanks for creating it.

jacktanner 2010-07-14 15:58

Re: [Announce] scout - search contacts, conversations and calendars
 
I'm so excited about a search app!

So, does it index all these things, or does it grep on the fly? Can you give some specifics about how it works?

Any plans to search email?

skalogre 2010-07-14 16:06

Re: [Announce] scout - search contacts, conversations and calendars
 
Between this and the other applications you have thrown together, Nicolai, you should be canonised! Thank you again :)

spooley 2010-07-14 17:46

Re: [Announce] scout - search contacts, conversations and calendars
 
This is very promising, Nicolai. Thank you for your work!

Simon.

Berserk 2010-07-15 00:25

Re: [Announce] scout - search contacts, conversations and calendars
 
I just found it here:
http://www.nokian900applications.com...or-nokia-n900/

I didn't know you made another great app! This is the third app from you I'm using.. quality stuff!

I will test and report any issues :)
As said before, lowercase by default would be very nice

nicolai 2010-07-15 11:02

Re: [Announce] scout - search contacts, conversations and calendars
 
Quote:

Originally Posted by Dr.MZ (Post 749542)
Would it be possible to search for additional files to include? Thus it takes no longer the App Search Tool.

Quote:

Originally Posted by Laughing Man (Post 749553)
Have you considered including applications?

No, not at the moment.

Quote:

Originally Posted by jacktanner (Post 751677)
I'm so excited about a search app!

So, does it index all these things, or does it grep on the fly? Can you give some specifics about how it works?

Any plans to search email?


Ok, some notes.
No indexing.I think it is quite fast, no need to indexing the data.
I use the fremantle APIs to access the data
(osso-abook, calendar-backend and rtcom).
The calender summary and description text for events and task
are searched. I forgot the calendar notes (journal), next version
includes this as well.
For contacts, most contact fields are searched
(PHONE, EMAIL, NAME, LABEL, NICKNAME ....),
next Version will include NOTE and ORG(company).
The next version will make the search in a background thread,
that way it does not freeze the UI and you can cancel a running search.
And you will be able to select the categeories to search
(for example only search in the calendar) and switch between
case sensitive and case insensitive search.

regards
nicolai

Helmuth 2010-07-15 11:29

Re: [Announce] scout - search contacts, conversations and calendars
 
Looks really promising. Great Application! :)
Sadly I get a "segfault error" at many search terms. So lets hope for the next improved version...

nicolai 2010-07-15 11:36

Re: [Announce] scout - search contacts, conversations and calendars
 
Quote:

Originally Posted by Helmuth (Post 752666)
Sadly I get a "segfault error" at many search terms.

Me too. :-)
But it is mostly fixed.

nicolai

sony123 2010-07-16 05:13

Re: [Announce] scout - search contacts, conversations and calendars
 
Very useful, for me mainly to be able to search calender!
Is it possible to add search for email in the future?
(Sorry have to ask again....)

Thanks for the effort!

aanckar 2010-07-16 05:33

Re: [Announce] scout - search contacts, conversations and calendars
 
I must say that after the last update this is really becoming a killer app!

I also noticed that clicking a conversation opens the conversations app, which is great! However, it shows the most recent message, and the word you searched for might be located faaar back in the message chain, so finding it is not so easy.

I understand it might not be possible to open the conversations app and jump to a specific message, so could there perhaps be an option to either open only the specific message (as in the previous version) or the entire conversation?

doksng 2010-07-16 06:09

Re: [Announce] scout - search contacts, conversations and calendars
 
Really nice application, I have being looking forward to it for a long time.

nicolai 2010-07-16 07:18

Re: [Announce] scout - search contacts, conversations and calendars
 
Yes, here is the new version(0.2):
* search runs in a background thread (does not freeze UI and can be canceled)
* enable/disable searchcategories (calendar, contacts, conversation)
* enable/disable case sensitive search
* open conversation app from conversation search results
* disable auto capitalize and dictionary for the search entry field
* fixed bug with non ascii char in search results
* Note and Company contact field are searched as well

And yes, I don't like it, that the conversation app shows the
whole thread. And you are right, maybe I should make an option, so you can choose, to open the conversation app or only one message.

I would like to search emails as well, but don't know
an easy way to access the email text.

thank you for your feedback.
regards
nicolai

doksng 2010-07-16 07:43

Re: [Announce] scout - search contacts, conversations and calendars
 
Quote:

Originally Posted by nicolai (Post 753592)
Y

And yes, I don't like it, that the conversation app shows the
whole thread. And you are right, maybe I should make an option, so you can choose, to open the conversation app or only one message.

nicolai

I haven't updated yet but the conversation app just opens the message with the item I searched for and not the whole conversation as reported by some. Tried different search words and the same result. Just wondering why I got different results

aanckar 2010-07-16 08:12

Re: [Announce] scout - search contacts, conversations and calendars
 
Quote:

Originally Posted by doksng (Post 753604)
I haven't updated yet but the conversation app just opens the message with the item I searched for and not the whole conversation as reported by some. Tried different search words and the same result. Just wondering why I got different results

The old version opens up the specific message in a new window. The new version opens up the Conversations app allowing you to view your entire conversation with that person.

A combination of the two would be ideal - but this may not be possible. So perhaps a better choice would be an option to choose between the two (as mentioned earlier).

andrew_85 2010-07-16 08:25

Re: [Announce] scout - search contacts, conversations and calendars
 
love it . . very useful :-)

leojab 2010-07-16 09:40

Re: [Announce] scout - search contacts, conversations and calendars
 
Dear nicoli,

The new version seems to crash for me.. i tried enabling on contact search and then it works. But when Conversation is in search criteria and I enter the search string and press search button. Scout app crashes.
Is there any old settings file I should remove

nicolai 2010-07-16 09:55

Re: [Announce] scout - search contacts, conversations and calendars
 
Quote:

Originally Posted by leojab (Post 753689)
Dear nicoli,

The new version seems to crash for me.. i tried enabling on contact search and then it works. But when Conversation is in search criteria and I enter the search string and press search button. Scout app crashes.
Is there any old settings file I should remove

Hi leojab,

no, there aren't old settings, the prior version didn't saved
any settings.
During developing I had many crashes caused by badly character
handling for non-ascii characters.
This is mostly fixed, no crashes anymore. But there may still be
a bug, and that may happen only on some conversation texts.
Is there a chance, you can deduce from your conversations and search
query, which text could cause this?
regards
nicolai

leojab 2010-07-16 12:28

Re: [Announce] scout - search contacts, conversations and calendars
 
Hi nicolia,
I have been trying various combination and can confirm that the crash issue happens only in the Conversation app search. I have tried various english texts but it crashes. I think any search into Conversation failed.
My conversation has arabic sms's as well. Is that an issue?

nicolai 2010-07-16 13:02

Re: [Announce] scout - search contacts, conversations and calendars
 
Quote:

Originally Posted by leojab (Post 753838)
My conversation has arabic sms's as well. Is that an issue?

Good hint, yes that may be the problem.
Now I know what I have to look for.
Thank you.

nicolai

Helmuth 2010-07-16 13:17

Re: [Announce] scout - search contacts, conversations and calendars
 
Great update. Works now very fine. :)

Quote:

Originally Posted by nicolai (Post 753592)
And yes, I don't like it, that the conversation app shows the
whole thread. And you are right, maybe I should make an option, so you can choose, to open the conversation app or only one message.

I have a suggestion for this:
What about showing the single SMS in a seperate (stacked) window as before and place a Button "open this conversation" under the SMS message to open the whole conversation if the user wants to see it? :)

I don't like a option for this. I would prefer to have the choice after I see the search result. Sometimes I have to read the result before I know I would read the whole conversation.

troff76 2010-07-16 13:51

Re: [Announce] scout - search contacts, conversations and calendars
 
Probably one of the most useful apps for N900 so far!
Thank you Nicolai.

One suggestion:
I would like to type a name and find the SMSs sent or received from that person. Is it possible?

doksng 2010-07-16 14:18

Re: [Announce] scout - search contacts, conversations and calendars
 
Quote:

Originally Posted by leojab (Post 753689)
Dear nicoli,

The new version seems to crash for me.. i tried enabling on contact search and then it works. But when Conversation is in search criteria and I enter the search string and press search button. Scout app crashes.
Is there any old settings file I should remove

I have the same problem, conversation crashes Scout when a search is done with the option selected. Used the same search word that previously worked with version 0.1

leojab 2010-07-16 14:19

Re: [Announce] scout - search contacts, conversations and calendars
 
I would like to bring to your notice an issue:
1. Scout searches within Notes and displays results however clicking on it shows only the Calendar event instead of the actual note text

jacktanner 2010-07-16 14:24

Re: [Announce] scout - search contacts, conversations and calendars
 
Nicolai, great work. As far as searching emails - that would probably be prohibitive without indexing. Tracker is capable of indexing emails, but that seems to be disabled (at compile time?) on the N900.

And of course, there's search over file contents, too (.doc, .pdf, etc.)


All times are GMT. The time now is 02:55.

vBulletin® Version 3.8.8