- plugin for home applet 'Internet Search' - search in mDictionary - change Copyright...
authorstranger <dariusz.wiechecki@gmail.com>
Tue, 24 Jul 2007 13:49:50 +0000 (13:49 +0000)
committerstranger <dariusz.wiechecki@gmail.com>
Tue, 24 Jul 2007 13:49:50 +0000 (13:49 +0000)
git-svn-id: file:///svnroot/mdictionary/trunk@131 5bde0345-f819-0410-ac75-e5045f9217cc

14 files changed:
Makefile
data/icons/qgn_indi_search_whitestork.png [new file with mode: 0644]
data/mis/whitestork-search.xml [new file with mode: 0644]
data/other/whitestork.desktop
debian/changelog
debian/control
debian/copyright
debian/whitestorkgui.postinst
include/ws_dbus.h
src/dbus_wrapper/src/ws_dbus.c
src/gui/include/ws_gui_callbacks.h
src/gui/src/ws_gui.c
src/gui/src/ws_gui_callbacks.c
src/manager/src/whitestork.c

index 17a2434..dfcf029 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -53,13 +53,14 @@ META_PACK_NAME = whitestorkdictionary
 
 GUI_EXECUTABLE = ${BINARIES}/WhiteStork
 GUI_SERVICEFILE = org.maemo.WhiteStorkGui.service
-GUI_DIRS = ${DESTDIR}/usr/bin ${DESTDIR}/usr/share/applications/hildon ${DESTDIR}/usr/share/pixmaps ${DESTDIR}/usr/share/dbus-1/services ${DESTDIR}/usr/share/locale  
+GUI_DIRS = ${DESTDIR}/usr/bin ${DESTDIR}/usr/share/applications/hildon ${DESTDIR}/usr/share/pixmaps ${DESTDIR}/usr/share/mis ${DESTDIR}/usr/share/dbus-1/services ${DESTDIR}/usr/share/locale  
 #${DESTDIR}/usr/share/doc/whitestorkgui
 GUI_DBUS = ${DATA}/other/${GUI_SERVICEFILE}
-GUI_ICONS = ${DATA}/icons/whitestork_icon.png ${DATA}/icons/whitestork.png ${DATA}/icons/ws_top.png ${DATA}/icons/ws_tra.png
+GUI_ICONS = ${DATA}/icons/whitestork_icon.png ${DATA}/icons/whitestork.png ${DATA}/icons/ws_top.png ${DATA}/icons/qgn_indi_search_whitestork.png ${DATA}/icons/ws_tra.png
 GUI_LOCALE = ${DATA}/locale/out/
 GUI_DOC = ${DATA}/docs/${GUI_PACK_NAME}/
 GUI_OTHER = ${DATA}/other/whitestork.desktop
+GUI_MIS = ${DATA}/mis/whitestork-search.xml
 
 MNG_EXECUTABLE = ${BINARIES}/WhiteStorkManager 
 MNG_SERVICEFILE = org.maemo.WhiteStorkManager.service
@@ -259,6 +260,7 @@ install-gui:        ${BINARIES}/ws_dbus.o ${BINARIES}/WhiteStork
                @cp ${GUI_ICONS} ${DESTDIR}/usr/share/pixmaps
                @cp ${GUI_DBUS} ${DESTDIR}/usr/share/dbus-1/services
                @cp ${GUI_OTHER} ${DESTDIR}/usr/share/applications/hildon
+               @cp ${GUI_MIS} ${DESTDIR}/usr/share/mis
                @cp -a ${GUI_LOCALE}* ${DESTDIR}/usr/share/locale/              
 #              @find  ${GUI_DOC} -type f -not -path *.svn* -exec cp {} ${DESTDIR}/usr/share/doc/${GUI_PACK_NAME} \;
 
diff --git a/data/icons/qgn_indi_search_whitestork.png b/data/icons/qgn_indi_search_whitestork.png
new file mode 100644 (file)
index 0000000..482de9b
Binary files /dev/null and b/data/icons/qgn_indi_search_whitestork.png differ
diff --git a/data/mis/whitestork-search.xml b/data/mis/whitestork-search.xml
new file mode 100644 (file)
index 0000000..63abce4
--- /dev/null
@@ -0,0 +1,5 @@
+<search name="mDictionary"
+       icon="/usr/share/pixmaps/qgn_indi_search_whitestork.png"
+       action="mdict://"
+       user-input="p">
+</search>
\ No newline at end of file
index 290220c..8870c02 100644 (file)
@@ -11,3 +11,10 @@ Type=Application
 X-HildonDesk-ShowInToolbar=true
 X-Osso-Type=application/x-executable
 X-Window-Icon=whitestork_icon
+
+X-Osso-URI-Actions=mdict;
+
+[X-Osso-URI-Action Handler mdict]
+Method=search_home_applet
+Name=uri_link_open_link
+TranslationDomain=osso-uri
\ No newline at end of file
index f17d2f4..dbf5ee3 100644 (file)
@@ -1,3 +1,12 @@
+whitestork (1.1.0-1) unstable; urgency=low
+
+  * plugin for home applet "Internet Search" - search in mDictionary
+  * change Copyright 2006 into Copyright 2006-2007 in copyrigth file
+  * some info banners have been claryfied
+  * cleaning translation after unsuccessful new search fixed
+
+ -- unknown <Dariusz.Wiechecki@comarch.com>  Tue, 24 Jul 2007 15:27:00 +0300
+
 whitestork (1.0.1-1) unstable; urgency=low
 
   * Minor packaging update. No code changes.
index e62dffb..85fcb6a 100644 (file)
@@ -52,6 +52,20 @@ Description: Multilingual dictionary.
  This package contains all three whitestork modules that is:
  gui, engines and plugins.
  Copyright 2006, ComArch S.A. 
+XB-Maemo-Icon-26: 
+ iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
+ WXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1wEJDBUeRyfCHgAAAk5JREFUSMftlk9LVGEUxn937lzv
+ nROjZDOpYdg/E3XQoiCEsk1R0CosXPUJ2rVp0baP0Aco2rRxE0FhRFGRmzbRH9IW0SJBLFKpR67j
+ eFv4DkyTOtMoLaKzet/3POc8nHuf+7wX/rXwGqyLgHNuHUdRNJFKpeYlLa9X4NfZuAXYAWSjKOpK
+ kmQoSZK7wAhwC7ji+35zEASFIAi+FItFrTXRNiAPcAT25+AQwGHo7YQ+gD2wtxXaJ0GXff+8SqUs
+ MA58BHLAJUAAYRimfN9/Imm2kig9BFd7YdQ1TI/CvnIyB7RWgK+H4TXF8bibZAWYcSkBYwBxHI+Y
+ 2XB5v947SgO95c0p6M9DD0AHtN3JZCamFxdvA4XVIwQ0A+/ddC1Aj5ntljTWsHLMrNvMBty2GTgI
+ WBXmuJm1bVp1ZtYNDLhp5ipSeSAAnkua2Sp5Y2ZZ4IIj+wBMSiquh083QNAGDALHHEE38G4jkron
+ MrPTQNbhZ4BXVZAunGiAJeCRJNVNZGYF1+ChpJPAV+BFjZpgVbD8kPS0JpEjKUqarDjuAC669Sfg
+ fsUUv0Qmk9npeV6/pMe1iEZqfAtp4Kzr0bRGfiUMw3bf929KWkxvwpCXgXsbAXzfP1P209QGuFkz
+ y29C/k1AIOl7PWIYBmLgpaTSH5D0ONk/KF8dXh1FncBR9wjeAguSpqsw24F8LkkKyxDOed5rSW8a
+ dgYz63PGuasq9e3G0tLgiVLp2YEkWfBgasssqDqS1atjCojXIkr9rX+G/0QNR3oLe30G5p1j/BY/
+ AaknsXLnUsw8AAAAAElFTkSuQmCC
 
 Package: whitestorkplugins
 Section: user/office
@@ -59,3 +73,17 @@ Priority: optional
 Architecture: any
 Depends:  ${shlibs:Depends}, whitestork (>= 1.0.0-1)
 Description: Dictionary plugins for mDictionary
+XB-Maemo-Icon-26: 
+ iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABmJLR0QA/wD/AP+gvaeTAAAACXBI
+ WXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1wEJDBUeRyfCHgAAAk5JREFUSMftlk9LVGEUxn937lzv
+ nROjZDOpYdg/E3XQoiCEsk1R0CosXPUJ2rVp0baP0Aco2rRxE0FhRFGRmzbRH9IW0SJBLFKpR67j
+ eFv4DkyTOtMoLaKzet/3POc8nHuf+7wX/rXwGqyLgHNuHUdRNJFKpeYlLa9X4NfZuAXYAWSjKOpK
+ kmQoSZK7wAhwC7ji+35zEASFIAi+FItFrTXRNiAPcAT25+AQwGHo7YQ+gD2wtxXaJ0GXff+8SqUs
+ MA58BHLAJUAAYRimfN9/Imm2kig9BFd7YdQ1TI/CvnIyB7RWgK+H4TXF8bibZAWYcSkBYwBxHI+Y
+ 2XB5v947SgO95c0p6M9DD0AHtN3JZCamFxdvA4XVIwQ0A+/ddC1Aj5ntljTWsHLMrNvMBty2GTgI
+ WBXmuJm1bVp1ZtYNDLhp5ipSeSAAnkua2Sp5Y2ZZ4IIj+wBMSiquh083QNAGDALHHEE38G4jkron
+ MrPTQNbhZ4BXVZAunGiAJeCRJNVNZGYF1+ChpJPAV+BFjZpgVbD8kPS0JpEjKUqarDjuAC669Sfg
+ fsUUv0Qmk9npeV6/pMe1iEZqfAtp4Kzr0bRGfiUMw3bf929KWkxvwpCXgXsbAXzfP1P209QGuFkz
+ y29C/k1AIOl7PWIYBmLgpaTSH5D0ONk/KF8dXh1FncBR9wjeAguSpqsw24F8LkkKyxDOed5rSW8a
+ dgYz63PGuasq9e3G0tLgiVLp2YEkWfBgasssqDqS1atjCojXIkr9rX+G/0QNR3oLe30G5p1j/BY/
+ AaknsXLnUsw8AAAAAElFTkSuQmCC
\ No newline at end of file
index 80394cb..83db946 100644 (file)
@@ -5,7 +5,7 @@ It was downloaded from https://garage.maemo.org
 
 Upstream Author: WhiteStork development team
 
-Copyright: Comarch 2006
+Copyright: Comarch 2006-2007
 
 License:
 
index be9d3b1..02a0e3b 100755 (executable)
@@ -8,4 +8,18 @@ then
 echo -e "Selecting menu location" 
 maemo-select-menu-location whitestork.desktop
 
+if [ -f /usr/share/applications/uri-action-defaults.list ]
+then
+   if [ -z `grep 'mdict=hildon-whitestork.desktop' /usr/share/applications/uri-action-defaults.list` ]
+   then
+      echo -e "Adding mdict URI action - uri-action-defaults.list"
+      echo -en "\nmdict=hildon-whitestork.desktop\n" >> /usr/share/applications/uri-action-defaults.list
+   fi
+   if [ -z `grep 'mdict=hildon-whitestork.desktop' /usr/share/applications/schemeinfo.cache` ]
+   then
+      echo -e "Adding mdict URI action - schemeinfo.cache"
+      echo -en "\nmdict=hildon-whitestork.desktop\n" >> /usr/share/applications/schemeinfo.cache
+   fi
+fi
+
 fi
index f56cd7c..d7826ed 100644 (file)
@@ -29,6 +29,8 @@ extern "C" {
 #include <stdlib.h>
 #include <glib-2.0/glib.h>
 
+
+
 /** \brief Callback function definition
 *
 *@param error - pointer to a GError structure. Currently not used
@@ -400,6 +402,8 @@ application for DBus
 WSDBusStatus ws_dbus_server_return_extracted_dict(WSDBusData* ws_dbus_data, 
                                        gchar* path);
 
+/* added by Gadomska Anna - HISA */
+WSDBusStatus ws_dbus_server_search_home_applet (WSDBusData * ws_dbus_data, gchar * word);
 
 #ifdef __cplusplus
 }
index b2fbcfb..83b123f 100644 (file)
@@ -159,7 +159,6 @@ static void ws_dbus_libosso_errors (osso_return_t result)
 };
 
 WSDBusData * ws_dbus_create (gchar *name, gchar *version)
-
 {
         gchar *cb_table[] = {"find_word",
                              "find_translation",
@@ -172,7 +171,8 @@ WSDBusData * ws_dbus_create (gchar *name, gchar *version)
                              "remove_bookmark",
                              "send_message",
                             "extract_dictionary",
-                            "return_extracted_dict",                           
+                            "return_extracted_dict",
+                             "search_home_applet",
                              NULL};
 
         guint array_size = 0;
@@ -233,6 +233,47 @@ WSDBusData * ws_dbus_create (gchar *name, gchar *version)
         return temp;
 };
 
+/* added by Gadomska Anna - HISA */
+WSDBusStatus ws_dbus_server_search_home_applet (WSDBusData * ws_dbus_data, gchar * word)
+{
+       osso_return_t result;
+       osso_rpc_t *retval;
+
+       retval = g_try_malloc (sizeof (osso_rpc_t));
+
+       if (retval == NULL) 
+       {
+               g_debug("DBUS: Error in function %s:",__FUNCTION__);
+               g_debug(" Couldn't allocate memory for message's return value\n");
+       };
+
+       result = osso_rpc_run (ws_dbus_data->context, 
+                              ws_dbus_data->remote_service, 
+                              ws_dbus_data->remote_object, 
+                              ws_dbus_data->remote_iface, 
+                              "search_home_applet", 
+                              retval,
+                              DBUS_TYPE_STRING,
+                              word,
+                              DBUS_TYPE_INVALID);
+
+       g_debug ("\nDBUS: %s: ", __FUNCTION__);
+
+       ws_dbus_libosso_errors (result);
+
+       if (result != OSSO_OK)
+       {
+               g_debug ("Error message: %s\n", retval->value.s);
+                osso_rpc_free_val (retval);
+               g_free (retval);
+               return WS_DBUS_STATUS_ERROR;
+       };
+
+        osso_rpc_free_val (retval);
+       g_free (retval);
+       return WS_DBUS_STATUS_OK;
+};
+
 WSDBusStatus ws_dbus_config (WSDBusData * ws_dbus_data,
                              WSDBusConfig field,
                              gchar *value)
index f38f258..3610c42 100644 (file)
@@ -38,6 +38,9 @@ extern "C" {
 #define TIMER_STOP  FALSE
 
 
+/* added by Dariusz Wiechecki - HISA */
+void ws_gui_search_home_handler(GError *error, GArray *word, gpointer user_data);
+
 /*do dbusa*/
 /** \brief handle dbus signals
  *
index 1d6984f..bc4abbb 100644 (file)
@@ -116,6 +116,11 @@ int main(int argc, char *argv[])
                         "signal",
                         ws_gui_signal_hander,
                         ws_gui_app);
+       /* added by Dariusz Wiechecki - HISA */
+        ws_dbus_set_cb (ws_gui_app->dbus_data,
+                        "search_home_applet",
+                        ws_gui_search_home_handler,
+                        ws_gui_app);
 
         //setting the clipboard
         ws_gui_app->ws_gui_clipboard = 
index 6067568..8828432 100644 (file)
@@ -334,6 +334,30 @@ void ws_gui_signal_hander (GError *error, GArray *words, gpointer user_data)
 
         }
 }
+
+
+/* added by Dariusz Wiechecki - HISA */
+void ws_gui_search_home_handler(GError *error, GArray *word, gpointer user_data)
+{
+        g_debug("->%s", __FUNCTION__);
+        WSGuiApp *data = (WSGuiApp*) user_data;
+        osso_rpc_t* osso_data = NULL;
+
+        
+        //get the word passed by dbus 
+        osso_data = &g_array_index (word, osso_rpc_t, 0); 
+
+        //free memory used by last searched word
+        gchar* tmp = NULL;
+        tmp = g_strdup(osso_data->value.s + 11);
+       
+       g_object_set(G_OBJECT(data->ws_gui_hildon_find_toolbar),
+                    "prefix",
+                    tmp,
+                    NULL);
+       ws_gui_search(NULL, data);
+}
+
 /**  this function handles signals from dbus; it is called when progress bar
  status has been changed
  *
@@ -508,7 +532,7 @@ void ws_gui_dbus_return_words (GError *error, GArray *words, gpointer user_data)
                 gtk_infoprint(GTK_WINDOW(ws_gui_app->ws_gui_hildon_window),
                               _("ws_ni_no_words_found"));
                
-               ws_gui_fill_html(" ", ws_gui_app);
+               //ws_gui_fill_html(" ", ws_gui_app);
                ws_gui_app->html_flag = FALSE;
                g_free(ws_gui_app->last_word);
                ws_gui_app->last_word = NULL;
index 4a97fb8..ceb2cd0 100644 (file)
@@ -34,7 +34,7 @@ int main (gint argc, gchar** argv)
        {
                /* if YES - do not start another one - terminate*/
                g_debug("Another instance of application curently is running\n");
-               return 1;
+               //return 1;
        }
        g_type_init();
        //GError* err;