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
This commit is contained in:
bgk 2008-08-29 19:02:29 +00:00
parent c6ac0ea96c
commit fc5958a78d
1 changed files with 9 additions and 1 deletions

View File

@ -91,10 +91,18 @@ int main(int argc, char * argv[])
Gtk::Window::set_default_icon_name("vbam"); 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<Xml> poXml; Glib::RefPtr<Xml> poXml;
try try
{ {
poXml = Xml::create(PKGDATADIR "/vba.glade", "MainWindow"); poXml = Xml::create(sGladeFile, "MainWindow");
} }
catch (const Xml::Error & e) catch (const Xml::Error & e)
{ {