From fc5958a78d0873fb4cd31b3fd99c52fe015c1f07 Mon Sep 17 00:00:00 2001 From: bgk Date: Fri, 29 Aug 2008 19:02:29 +0000 Subject: [PATCH] GTK: Try loading the glade file from the source folder to allow running gvbam without installing it git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@661 a31d4220-a93d-0410-bf67-fe4944624d44 --- src/gtk/main.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gtk/main.cpp b/src/gtk/main.cpp index 05f28394..57213b56 100644 --- a/src/gtk/main.cpp +++ b/src/gtk/main.cpp @@ -91,10 +91,18 @@ int main(int argc, char * argv[]) Gtk::Window::set_default_icon_name("vbam"); + // Use the glade file from the source folder if it exists + // to make gvbam runnable without installation + std::string sGladeFile = "src/gtk/vba.glade"; + if (!Glib::file_test(sGladeFile, Glib::FILE_TEST_EXISTS)) + { + sGladeFile = PKGDATADIR "/vba.glade"; + } + Glib::RefPtr poXml; try { - poXml = Xml::create(PKGDATADIR "/vba.glade", "MainWindow"); + poXml = Xml::create(sGladeFile, "MainWindow"); } catch (const Xml::Error & e) {