aboutsummaryrefslogtreecommitdiff
path: root/src/core/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/core/main.c b/src/core/main.c
index 0b92ef8e..27353922 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -76,6 +76,22 @@ customLog (const char *msg)
76} 76}
77#endif 77#endif
78 78
79static void
80setIconSearchPath()
81{
82 char *dataDir;
83 char *buf;
84
85 dataDir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
86 buf = GNUNET_malloc(strlen(dataDir) + strlen("../gnunet-gtk/icons/") + 2);
87 strcpy(buf, dataDir);
88 strcat(buf, "../gnunet-gtk/icons/");
89 gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (),
90 buf);
91 GNUNET_free(buf);
92 GNUNET_free(dataDir);
93}
94
79int 95int
80main (int argc, char *const *argv) 96main (int argc, char *const *argv)
81{ 97{
@@ -85,8 +101,6 @@ main (int argc, char *const *argv)
85 struct GNUNET_GE_Context *my_ctx; 101 struct GNUNET_GE_Context *my_ctx;
86 struct GNUNET_GC_Configuration *cfg; 102 struct GNUNET_GC_Configuration *cfg;
87 char *log; 103 char *log;
88 char *dataDir;
89 char *gtkDataDir;
90 GNUNET_GE_KIND mask; 104 GNUNET_GE_KIND mask;
91#if ENABLE_NLS 105#if ENABLE_NLS
92 char *path; 106 char *path;
@@ -120,6 +134,7 @@ main (int argc, char *const *argv)
120 bind_textdomain_codeset ("GNUnet", "UTF-8"); 134 bind_textdomain_codeset ("GNUnet", "UTF-8");
121 bind_textdomain_codeset ("gnunet-gtk", "UTF-8"); 135 bind_textdomain_codeset ("gnunet-gtk", "UTF-8");
122#endif 136#endif
137 setIconSearchPath();
123 GNUNET_GTK_initialize_common_library (cfg, &GNUNET_GTK_main_quit); 138 GNUNET_GTK_initialize_common_library (cfg, &GNUNET_GTK_main_quit);
124 /* configure GTK logging */ 139 /* configure GTK logging */
125 GNUNET_GC_get_configuration_value_string (cfg, 140 GNUNET_GC_get_configuration_value_string (cfg,
@@ -138,17 +153,6 @@ main (int argc, char *const *argv)
138 GNUNET_GE_setDefaultContext (my_ctx); 153 GNUNET_GE_setDefaultContext (my_ctx);
139 root = 154 root =
140 glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (), "mainWindow"); 155 glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (), "mainWindow");
141 if (NULL == gtk_window_get_icon(GTK_WINDOW(root)))
142 {
143 /* theme-based loading failed, set directly */
144 dataDir = GNUNET_get_installation_path (GNUNET_IPK_DATADIR);
145 gtkDataDir =
146 GNUNET_malloc (strlen (dataDir) +
147 strlen ("/../gnunet-gtk/gnunet-gtk.png") + 2);
148 strcpy (gtkDataDir, dataDir);
149 strcat (gtkDataDir, "/../gnunet-gtk/gnunet-gtk.png");
150 gtk_window_set_icon_from_file(GTK_WINDOW(root), gtkDataDir, NULL);
151 }
152 gtk_window_maximize (GTK_WINDOW (root)); 156 gtk_window_maximize (GTK_WINDOW (root));
153 gtk_widget_show (root); 157 gtk_widget_show (root);
154 gtk_window_present (GTK_WINDOW (root)); 158 gtk_window_present (GTK_WINDOW (root));