Initial commit for BiaGen project
[biagen.git] / biagen
1 #!/usr/bin/env python
2
3 # BiaGen - front end to genisoimage
4 # Copyright 2010 V.Harishankar
5 # Licensed under the GNU GPL v3 or above
6
7 import pygtk
8 pygtk.require20 ()
9 import gtk
10
11 class BiaGen:
12 def add_item (self, type):
13 if type == 1:
14 dlg = gtk.FileChooserDialog (title="Add files", action=gtk.FILE_CHOOSER_ACTION_OPEN,
15 buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK))
16 else:
17 dlg = gtk.FileChooserDialog (title="Add folders", action=gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER,
18 buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK))
19
20 dlg.set_property ("select-multiple", True)
21 dlg.run ()
22
23 dlg.destroy ()
24
25 def on_btn_add_clicked (self, *args):
26 self.add_item (type=1)
27
28 def on_btn_exit_clicked (self, *args):
29 gtk.main_quit ()
30
31 def on_main_window_hide (self, *args):
32 gtk.main_quit ()
33
34 def __init__ (self):
35 ui = gtk.Builder ()
36 ui.add_from_file ("main_window.xml")
37 ui.get_object ("main_window").show ()
38 ui.connect_signals (self)
39 gtk.main ()
40
41 BiaGen ()