Basic JMdict searches ("starts_with" index) should now work.
[jben2_gui.git] / jben.py
blob2dbb5965e1a8aeffa296cdcc25675c4fd8fa3b0e
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 # Project: J-Ben, Python front-end
5 # File: jben.py
6 # Author: Paul Goins
7 # Created on: 20 Nov 2008
9 """J-Ben main module."""
11 import gettext
12 gettext.install("jben")
14 import pygtk
15 pygtk.require("2.0")
16 import gtk
18 from window_main import WindowMain
19 import preferences
21 from jben_global import *
23 def setup_global_icons():
24 icon1 = gtk.gdk.pixbuf_new_from_file("jben.xpm")
25 icon2 = gtk.gdk.pixbuf_new_from_file("jben_48.xpm")
26 icon3 = gtk.gdk.pixbuf_new_from_file("jben_32.xpm")
27 icon4 = gtk.gdk.pixbuf_new_from_file("jben_16.xpm")
28 gtk.window_set_default_icon_list(icon1, icon2, icon3, icon4)
30 class JBen(object):
31 """Base class for J-Ben application."""
33 def __init__(self):
34 setup_global_icons()
35 preferences.set_default_prefs()
36 if preferences.load():
37 # Only does something if a config file is out of date.
38 preferences.upgrade_config_file()
40 def main(self):
41 jben_win = WindowMain()
42 jben_win.show_all()
43 gtk.main()
45 preferences.save()
47 if __name__ == "__main__":
48 app = JBen()
49 app.main()