let the dev. use the glade too (cvs checkout for example)
This commit is contained in:
parent
b2263b0bfd
commit
d7d95ad693
|
@ -59,24 +59,29 @@ void notify_Tools() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Return the glade directory. */
|
/* Return the glade directory. */
|
||||||
gchar * get_ui_file (const char *filename)
|
gchar * get_ui_file (const char *filename, const char * prog)
|
||||||
{
|
{
|
||||||
char *path;
|
char *path, *path2;
|
||||||
|
|
||||||
|
/* EHhhhh ! building dir ?*/
|
||||||
|
path = g_path_get_dirname(prog);
|
||||||
|
path2 = g_build_filename (path, "glade", filename, NULL);
|
||||||
|
g_free (path);
|
||||||
|
if (g_file_test (path2, G_FILE_TEST_IS_REGULAR)) return path2;
|
||||||
|
g_free (path2);
|
||||||
|
|
||||||
/* looking in uninstalled dir first */
|
/* looking in uninstalled dir first */
|
||||||
path = g_build_filename (GLADEUI_UNINSTALLED_DIR, filename, NULL);
|
path = g_build_filename (GLADEUI_UNINSTALLED_DIR, filename, NULL);
|
||||||
if (g_file_test (path, G_FILE_TEST_IS_REGULAR))
|
if (g_file_test (path, G_FILE_TEST_IS_REGULAR)) return path;
|
||||||
return path;
|
g_free (path);
|
||||||
g_free (path);
|
|
||||||
|
/* looking in installed dir */
|
||||||
/* looking in installed dir */
|
path = g_build_filename (DATADIR, filename, NULL);
|
||||||
path = g_build_filename (DATADIR, filename, NULL);
|
if (g_file_test (path, G_FILE_TEST_IS_REGULAR)) return path;
|
||||||
if (g_file_test (path, G_FILE_TEST_IS_REGULAR))
|
g_free (path);
|
||||||
return path;
|
|
||||||
g_free (path);
|
/* not found */
|
||||||
|
return NULL;
|
||||||
/* not found */
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -246,8 +251,8 @@ int main(int argc, char *argv[]) {
|
||||||
Read_ConfigFile();
|
Read_ConfigFile();
|
||||||
|
|
||||||
/* load the interface */
|
/* load the interface */
|
||||||
xml = glade_xml_new(get_ui_file("DeSmuMe.glade"), NULL, NULL);
|
xml = glade_xml_new(get_ui_file("DeSmuMe.glade",argv[0]), NULL, NULL);
|
||||||
xml_tools = glade_xml_new(get_ui_file("DeSmuMe_Dtools.glade"), NULL, NULL);
|
xml_tools = glade_xml_new(get_ui_file("DeSmuMe_Dtools.glade",argv[0]), NULL, NULL);
|
||||||
pWindow = glade_xml_get_widget(xml, "wMainW");
|
pWindow = glade_xml_get_widget(xml, "wMainW");
|
||||||
pDrawingArea = glade_xml_get_widget(xml, "wDraw_Main");
|
pDrawingArea = glade_xml_get_widget(xml, "wDraw_Main");
|
||||||
pDrawingArea2 = glade_xml_get_widget(xml, "wDraw_Sub");
|
pDrawingArea2 = glade_xml_get_widget(xml, "wDraw_Sub");
|
||||||
|
|
Loading…
Reference in New Issue