Fixed some issues with loading the glade file.
Fixed an issue where the glade UI wouldn't load when prefix isn't /usr/ Elegantly closes when the glade file cannot be read
This commit is contained in:
parent
3d98cd56a6
commit
bb4030d361
8
gfceu
8
gfceu
|
@ -543,16 +543,20 @@ class WidgetsWrapper:
|
|||
if os.path.isfile('gfceu.glade'):
|
||||
glade_file = 'gfceu.glade'
|
||||
# Then check to see if its installed on a *nix system
|
||||
elif os.path.isfile(os.path.join(os.path.dirname(sys.executable), '../share/gfceu/gfceu.glade')):
|
||||
glade_file = os.path.join(os.path.dirname(sys.executable), '../share/gfceu/gfceu.glade')
|
||||
elif os.path.isfile(os.path.join(os.path.dirname(sys.argv[0]), '../share/gfceu/gfceu.glade')):
|
||||
glade_file = os.path.join(os.path.dirname(sys.argv[0]), '../share/gfceu/gfceu.glade')
|
||||
else:
|
||||
print 'ERROR.'
|
||||
print 'Could not find the glade interface file.'
|
||||
print 'Try reinstalling the application.'
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
print "Using: " + glade_file
|
||||
self.widgets = gtk.glade.XML(glade_file)
|
||||
self.widgets.signal_autoconnect(GladeHandlers.__dict__)
|
||||
except:
|
||||
gfceu_error("Couldn't load the glade UI file", 24)
|
||||
|
||||
def __getitem__(self, key):
|
||||
return self.widgets.get_widget(key)
|
||||
|
|
Loading…
Reference in New Issue