gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r7142 - in gnunet-gtk: pixmaps/icons src/core


From: gnunet
Subject: [GNUnet-SVN] r7142 - in gnunet-gtk: pixmaps/icons src/core
Date: Wed, 11 Jun 2008 22:55:37 -0600 (MDT)

Author: grothoff
Date: 2008-06-11 22:55:37 -0600 (Wed, 11 Jun 2008)
New Revision: 7142

Modified:
   gnunet-gtk/pixmaps/icons/Makefile.am
   gnunet-gtk/src/core/main.c
Log:
finally icons working nicely

Modified: gnunet-gtk/pixmaps/icons/Makefile.am
===================================================================
--- gnunet-gtk/pixmaps/icons/Makefile.am        2008-06-12 04:30:55 UTC (rev 
7141)
+++ gnunet-gtk/pixmaps/icons/Makefile.am        2008-06-12 04:55:37 UTC (rev 
7142)
@@ -1,5 +1,5 @@
 theme=hicolor
-themedir=$(datadir)/icons/$(theme)
+themedir="icons/$(theme)"
 theme_icons = \
  apps,gnunet-gtk.svg \
  apps,gnunet-gtk-16.png \
@@ -7,7 +7,7 @@
  apps,gnunet-gtk-24.png \
  apps,gnunet-gtk-32.png
 
-install_icon_exec=${top_srcdir}/pixmaps/icons/icon-theme-installer -t ${theme} 
-s ${srcdir} -b ${themedir} -m "${mkinstalldirs}" -x "${INSTALL_DATA}"
+install_icon_exec=${top_srcdir}/pixmaps/icons/icon-theme-installer -t ${theme} 
-s ${srcdir} -d "$(datadir)/gnunet-gtk/" -b ${themedir} -m "${mkinstalldirs}" 
-x "${INSTALL_DATA}"
 
 install-data-local:
        $(install_icon_exec) -i "${theme_icons}"

Modified: gnunet-gtk/src/core/main.c
===================================================================
--- gnunet-gtk/src/core/main.c  2008-06-12 04:30:55 UTC (rev 7141)
+++ gnunet-gtk/src/core/main.c  2008-06-12 04:55:37 UTC (rev 7142)
@@ -76,6 +76,22 @@
 }
 #endif
 
+static void
+setIconSearchPath()
+{
+  char *dataDir;
+  char *buf;
+  
+  dataDir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
+  buf = GNUNET_malloc(strlen(dataDir) + strlen("../gnunet-gtk/icons/") + 2);
+  strcpy(buf, dataDir);
+  strcat(buf, "../gnunet-gtk/icons/");
+  gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
+                                    buf);
+  GNUNET_free(buf);
+  GNUNET_free(dataDir);
+}
+
 int
 main (int argc, char *const *argv)
 {
@@ -85,8 +101,6 @@
   struct GNUNET_GE_Context *my_ctx;
   struct GNUNET_GC_Configuration *cfg;
   char *log;
-  char *dataDir;
-  char *gtkDataDir;
   GNUNET_GE_KIND mask;
 #if ENABLE_NLS
   char *path;
@@ -120,6 +134,7 @@
   bind_textdomain_codeset ("GNUnet", "UTF-8");
   bind_textdomain_codeset ("gnunet-gtk", "UTF-8");
 #endif
+  setIconSearchPath();
   GNUNET_GTK_initialize_common_library (cfg, &GNUNET_GTK_main_quit);
   /* configure GTK logging */
   GNUNET_GC_get_configuration_value_string (cfg,
@@ -138,17 +153,6 @@
   GNUNET_GE_setDefaultContext (my_ctx);
   root =
     glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (), "mainWindow");  
-  if (NULL == gtk_window_get_icon(GTK_WINDOW(root)))
-    {
-      /* theme-based loading failed, set directly */
-      dataDir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
-      gtkDataDir =
-       GNUNET_malloc (strlen (dataDir) +
-                      strlen ("/../gnunet-gtk/gnunet-gtk.png") + 2);
-      strcpy (gtkDataDir, dataDir);
-      strcat (gtkDataDir, "/../gnunet-gtk/gnunet-gtk.png");
-      gtk_window_set_icon_from_file(GTK_WINDOW(root), gtkDataDir, NULL);
-    }
   gtk_window_maximize (GTK_WINDOW (root));
   gtk_widget_show (root);
   gtk_window_present (GTK_WINDOW (root));





reply via email to

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