]> git.lyx.org Git - lyx.git/blob - src/frontends/gnome/GnomeBase.C
de37831333c39bbb53520b88628940d04bb0e865
[lyx.git] / src / frontends / gnome / GnomeBase.C
1 // -*- C++ -*-
2 /* This file is part of
3  * =================================================
4  * 
5  *          LyX, The Document Processor
6  *          Copyright 1995 Matthias Ettrich.
7  *          Copyright 1995-2000 The LyX Team.
8  *
9  * ================================================= */
10
11 #ifdef __GNUG__
12 #pragma implementation
13 #endif
14
15 #include <config.h>
16 #include "GnomeBase.h"
17 #include "support/LAssert.h"
18 #include "debug.h"
19 #include "support/filetools.h"
20 #include <glib.h>
21
22 GnomeBase::GnomeBase(ControlBase & c, string const & glade_file, string const & name)
23         : ViewBC<gnomeBC>(c), file_(glade_file), widget_name_(name), xml_(0)
24 {}
25         
26 GnomeBase::~GnomeBase()
27 {
28         if (xml_)
29                 gtk_object_unref(GTK_OBJECT(xml_));
30 }
31
32         
33 void GnomeBase::loadXML() const
34 {
35 #warning Change this before declaring it production code! (be 20010325)
36         string const path("src/frontends/gnome/dialogs/;frontends/gnome/dialogs/;/home/baruch/prog/lyx/graphics/src/frontends/gnome/dialogs/");
37         string const file = FileOpenSearch(path, file_, "glade");
38
39         if (file.empty()) {
40                 lyxerr << "Cannot find glade file. Aborting." << std::endl;
41                 Assert(true);
42         }
43         
44         lyxerr[Debug::GUI] << "Glade file to open is " << file << '\n';
45         
46         xml_ = glade_xml_new(file.c_str(), widget_name_.c_str());
47 }