gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r8253 - in gnunet-gtk/src: common core plugins/chat plugins


From: gnunet
Subject: [GNUnet-SVN] r8253 - in gnunet-gtk/src: common core plugins/chat plugins/peers
Date: Mon, 16 Feb 2009 03:15:57 -0700

Author: holindho
Date: 2009-02-16 03:15:57 -0700 (Mon, 16 Feb 2009)
New Revision: 8253

Modified:
   gnunet-gtk/src/common/helper.c
   gnunet-gtk/src/core/eggtrayicon.c
   gnunet-gtk/src/core/main.c
   gnunet-gtk/src/plugins/chat/chat.c
   gnunet-gtk/src/plugins/peers/peers.c
Log:
(partially) fix mantis 1453


Modified: gnunet-gtk/src/common/helper.c
===================================================================
--- gnunet-gtk/src/common/helper.c      2009-02-16 08:49:25 UTC (rev 8252)
+++ gnunet-gtk/src/common/helper.c      2009-02-16 10:15:57 UTC (rev 8253)
@@ -354,13 +354,13 @@
   cron = GNUNET_cron_create (NULL);
 
   /* load the interface */
-  path = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
+  path = GNUNET_get_installation_path (GNUNET_IPK_SELF_PREFIX);
   filename =
     GNUNET_malloc (strlen (path) +
-                   strlen ("/../gnunet-gtk/gnunet-gtk.glade") + 2);
+                   strlen ("share/gnunet-gtk/gnunet-gtk.glade") + 2);
   strcpy (filename, path);
   GNUNET_free (path);
-  strcat (filename, "/../gnunet-gtk/gnunet-gtk.glade");
+  strcat (filename, "share/gnunet-gtk/gnunet-gtk.glade");
 #if MINGW
   gladeFile = GNUNET_malloc (_MAX_PATH + 1);
   plibc_conv_to_win_path (filename, gladeFile);
@@ -542,8 +542,8 @@
 
       trayIcon = GNUNET_GTK_get_trayIcon ();
 
-      instDir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
-      dataDir = g_strconcat (instDir, "/../gnunet-gtk/", NULL);
+      instDir = GNUNET_get_installation_path (GNUNET_IPK_SELF_PREFIX);
+      dataDir = g_strconcat (instDir, "share/gnunet-gtk/", NULL);
 #if MINGW
       finalPath = GNUNET_malloc (_MAX_PATH + 1);
       plibc_conv_to_win_path (dataDir, finalPath);
@@ -560,7 +560,7 @@
       gtk_icon_source_set_filename (iconSource, iconPath);
       g_free (iconPath);
       gtk_icon_set_add_source (iconSet, iconSource);
-      iconPath = g_build_filename (instDir, "..", "gnunet-gtk",
+      iconPath = g_build_filename (instDir, "share", "gnunet-gtk",
                                    "gnunet-gtk-status-connected.png", NULL);
       absPath = GNUNET_expand_file_name(NULL, iconPath);
       gtk_icon_source_set_filename (iconSource, absPath);

Modified: gnunet-gtk/src/core/eggtrayicon.c
===================================================================
--- gnunet-gtk/src/core/eggtrayicon.c   2009-02-16 08:49:25 UTC (rev 8252)
+++ gnunet-gtk/src/core/eggtrayicon.c   2009-02-16 10:15:57 UTC (rev 8253)
@@ -705,10 +705,10 @@
   tray_quit = glade_xml_get_widget (trayContextMenuXML, "tray_quit");
 
   tray_icon = egg_tray_icon_new (_("GNU's peer-to-peer network"));
-  instDir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
-  iconPath = GNUNET_malloc (strlen (instDir) + 40);
+  instDir = GNUNET_get_installation_path (GNUNET_IPK_SELF_PREFIX);
+  iconPath = GNUNET_malloc (strlen (instDir) + strlen 
("share/gnunet-gtk/gnunet-gtk-status-connected.svg") + 1);
   strcpy (iconPath, instDir);
-  strcat (iconPath, "/../gnunet-gtk/gnunet-gtk-status-connected.svg");
+  strcat (iconPath, "share/gnunet-gtk/gnunet-gtk-status-connected.svg");
   GNUNET_free (instDir);
   pixbuf = gdk_pixbuf_new_from_file (iconPath, NULL);
   GNUNET_free (iconPath);

Modified: gnunet-gtk/src/core/main.c
===================================================================
--- gnunet-gtk/src/core/main.c  2009-02-16 08:49:25 UTC (rev 8252)
+++ gnunet-gtk/src/core/main.c  2009-02-16 10:15:57 UTC (rev 8253)
@@ -74,10 +74,10 @@
   char *dataDir;
   char *buf;
 
-  dataDir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
-  buf = GNUNET_malloc (strlen (dataDir) + strlen ("../icons/") + 2);
+  dataDir = GNUNET_get_installation_path (GNUNET_IPK_SELF_PREFIX);
+  buf = GNUNET_malloc (strlen (dataDir) + strlen ("share/icons/") + 1);
   strcpy (buf, dataDir);
-  strcat (buf, "../icons/");
+  strcat (buf, "share/icons/");
   gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), buf);
   GNUNET_free (buf);
   GNUNET_free (dataDir);
@@ -94,7 +94,7 @@
   char *log;
   GNUNET_GE_KIND mask;
 #if ENABLE_NLS
-  char *path;
+  char *path, *path_prefix;
 #endif
 
 #ifdef WINDOWS
@@ -118,9 +118,13 @@
 
 #if ENABLE_NLS
   setlocale (LC_ALL, "");
-  path = GNUNET_get_installation_path (GNUNET_IPK_LOCALEDIR);
+  path_prefix = GNUNET_get_installation_path (GNUNET_IPK_SELF_PREFIX);
+  path = GNUNET_malloc (strlen (path_prefix) + strlen ("share/locale/") + 1);
+  strcpy(path, path_prefix);
+  strcat(path, "share/locale/");
   BINDTEXTDOMAIN ("gnunet-gtk", path);
   GNUNET_free (path);
+  GNUNET_free (path_prefix);
   textdomain ("gnunet-gtk");
   bind_textdomain_codeset ("GNUnet", "UTF-8");
   bind_textdomain_codeset ("gnunet-gtk", "UTF-8");

Modified: gnunet-gtk/src/plugins/chat/chat.c
===================================================================
--- gnunet-gtk/src/plugins/chat/chat.c  2009-02-16 08:49:25 UTC (rev 8252)
+++ gnunet-gtk/src/plugins/chat/chat.c  2009-02-16 10:15:57 UTC (rev 8253)
@@ -267,13 +267,13 @@
   writearg.icon = NULL;
   if (0 == memcmp (&writearg.pid, &client->mypid, sizeof (GNUNET_HashCode)))
     {
-      path = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
+      path = GNUNET_get_installation_path (GNUNET_IPK_SELF_PREFIX);
       filename =
         GNUNET_malloc (strlen (path) +
-                       strlen ("/../gnunet-gtk/self.png") + 2);
+                       strlen ("share/gnunet-gtk/self.png") + 1);
       strcpy (filename, path);
       GNUNET_free (path);
-      strcat (filename, "/../gnunet-gtk/self.png");
+      strcat (filename, "share/gnunet-gtk/self.png");
       writearg.icon = gdk_pixbuf_new_from_file (filename, NULL);
       GNUNET_free (filename);
     }

Modified: gnunet-gtk/src/plugins/peers/peers.c
===================================================================
--- gnunet-gtk/src/plugins/peers/peers.c        2009-02-16 08:49:25 UTC (rev 
8252)
+++ gnunet-gtk/src/plugins/peers/peers.c        2009-02-16 10:15:57 UTC (rev 
8253)
@@ -155,11 +155,11 @@
           cc = GNUNET_strdup (cc);
           for (i = 0; i < strlen (cc); i++)
             cc[i] = tolower (cc[i]);
-          dir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
+          dir = GNUNET_get_installation_path (GNUNET_IPK_SELF_PREFIX);
           fn = GNUNET_malloc (strlen (dir) + 32);
           strcpy (fn, dir);
           strcat (fn,
-                  DIR_SEPARATOR_STR ".."
+                  "share"
                   DIR_SEPARATOR_STR "gnunet-gtk"
                   DIR_SEPARATOR_STR "flags" DIR_SEPARATOR_STR);
           strcat (fn, cc);
@@ -361,29 +361,29 @@
   gtk_tree_view_column_set_sort_column_id (column, 3);
 
 
-  dir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
+  dir = GNUNET_get_installation_path (GNUNET_IPK_SELF_PREFIX);
   fn = GNUNET_malloc (strlen (dir) + 32);
   strcpy (fn, dir);
   strcat (fn,
-          DIR_SEPARATOR_STR ".."
+          "share"
           DIR_SEPARATOR_STR "gnunet-gtk" DIR_SEPARATOR_STR "red.png");
   red = gdk_pixbuf_new_from_file (fn, NULL);
 
   strcpy (fn, dir);
   strcat (fn,
-          DIR_SEPARATOR_STR ".."
+          "share"
           DIR_SEPARATOR_STR "gnunet-gtk" DIR_SEPARATOR_STR "yellow.png");
   yellow = gdk_pixbuf_new_from_file (fn, NULL);
 
   strcpy (fn, dir);
   strcat (fn,
-          DIR_SEPARATOR_STR ".."
+          "share"
           DIR_SEPARATOR_STR "gnunet-gtk" DIR_SEPARATOR_STR "green.png");
   green = gdk_pixbuf_new_from_file (fn, NULL);
 
   strcpy (fn, dir);
   strcat (fn,
-          DIR_SEPARATOR_STR ".."
+          "share"
           DIR_SEPARATOR_STR "gnunet-gtk" DIR_SEPARATOR_STR "black.png");
   black = gdk_pixbuf_new_from_file (fn, NULL);
   GNUNET_free (fn);





reply via email to

[Prev in Thread] Current Thread [Next in Thread]