comparison src/window.c @ 1013:88ebc61e33ae

Allow to override documentation paths through options: - documentation.helpdir - documentation.htmldir Default values are set at configure time.
author zas_
date Sat, 30 Aug 2008 10:39:35 +0000
parents 4fe8f9656107
children 1646720364cf
comparison
equal deleted inserted replaced
1012:fe82830ab8fd 1013:88ebc61e33ae
175 NULL, NULL 175 NULL, NULL
176 }; 176 };
177 177
178 static void help_browser_run(void) 178 static void help_browser_run(void)
179 { 179 {
180 gchar *path;
180 gchar *result; 181 gchar *result;
181 gint i; 182 gint i;
182 183
183 result = command_result(options->helpers.html_browser.command_name, options->helpers.html_browser.command_line); 184 result = command_result(options->helpers.html_browser.command_name, options->helpers.html_browser.command_line);
184 185
193 { 194 {
194 log_printf("Unable to detect an installed browser.\n"); 195 log_printf("Unable to detect an installed browser.\n");
195 return; 196 return;
196 } 197 }
197 198
198 help_browser_command(result, GQ_HTMLDIR G_DIR_SEPARATOR_S "index.html"); 199 path = g_build_filename(options->documentation.htmldir, "index.html", NULL);
200 help_browser_command(result, path);
201 g_free(path);
199 202
200 g_free(result); 203 g_free(result);
201 } 204 }
202 205
203 /* 206 /*
213 help_window = NULL; 216 help_window = NULL;
214 } 217 }
215 218
216 void help_window_show(const gchar *key) 219 void help_window_show(const gchar *key)
217 { 220 {
221 gchar *path;
222
218 if (key && strcmp(key, "html_contents") == 0) 223 if (key && strcmp(key, "html_contents") == 0)
219 { 224 {
220 help_browser_run(); 225 help_browser_run();
221 return; 226 return;
222 } 227 }
226 gtk_window_present(GTK_WINDOW(help_window)); 231 gtk_window_present(GTK_WINDOW(help_window));
227 if (key) help_window_set_key(help_window, key); 232 if (key) help_window_set_key(help_window, key);
228 return; 233 return;
229 } 234 }
230 235
231 help_window = help_window_new(_("Help"), GQ_WMCLASS, "help", 236 path = g_build_filename(options->documentation.helpdir, "README", NULL);
232 GQ_HELPDIR G_DIR_SEPARATOR_S "README", key); 237 help_window = help_window_new(_("Help"), GQ_WMCLASS, "help", path, key);
238 g_free(path);
233 239
234 g_signal_connect(G_OBJECT(help_window), "destroy", 240 g_signal_connect(G_OBJECT(help_window), "destroy",
235 G_CALLBACK(help_window_destroy_cb), NULL); 241 G_CALLBACK(help_window_destroy_cb), NULL);
236 } 242 }
237 243