| Home | Trees | Indices | Help |
|---|
|
|
1 #!/bin/env python
2 # copyright (c) 2005
3 # the icecube collaboration
4 # $Id: $
5 #
6 # @version $Revision: $
7 # @date $Date: $
8 # @author Juan Carlos Diaz Velez <juancarlos@icecube.wisc.edu>
9 # @brief File chooser for saving and opening files in GtkIcetraConfig
10 # application
11 #########################################################################
12 import pygtk
13 pygtk.require('2.0')
14 import gtk
15 from os.path import expandvars
16
18 # Get the selected filename and print it to the console
20 filename = self.filew.get_filename()
21 self.parent.configfile = filename
22 self.parent.savefile(None,filename)
23 self.filew.destroy()
24
26 self.filew.destroy()
27
29 # Create a new file selection widget
30 self.parent = parent
31 self.filew = gtk.FileSelection("File selection")
32
33 self.filew.connect("destroy", self.destroy)
34 # Connect the ok_button to file_ok_sel method
35 self.filew.ok_button.connect("clicked", self.file_ok_sel)
36
37 # Connect the cancel_button to destroy the widget
38 self.filew.cancel_button.connect("clicked",
39 lambda w: self.filew.destroy())
40
41 # Lets set the filename, as if this were a save dialog,
42 # and we are giving a default filename
43 self.filew.set_filename(self.parent.GetConfigFile() or "myconfig.xml")
44
45 self.filew.show()
46
48 # Get the selected filename and print it to the console
50 self.filename = self.filew.get_filename()
51 self.parent.getconfig(self.filename)
52 self.filew.destroy()
53
55 self.filew.destroy()
56
58 # Create a new file selection widget
59 self.parent = parent
60 self.filew = gtk.FileSelection("File selection")
61 self.filename = filename
62
63 self.filew.connect("destroy", self.destroy)
64 # Connect the ok_button to file_ok_sel method
65 self.filew.ok_button.connect("clicked", self.file_ok_sel)
66
67 # Connect the cancel_button to destroy the widget
68 self.filew.cancel_button.connect("clicked",
69 lambda w: self.filew.destroy())
70
71 self.filew.show()
72
73
75 # Get the selected filename and print it to the console
77 filename = self.filew.get_filename()
78 self.parent.pdb.loadfile(filename)
79 self.filew.destroy()
80
82 self.filew.destroy()
83
85 # Create a new file selection widget
86 self.parent = parent
87 self.filew = gtk.FileSelection("File selection")
88
89 self.filew.connect("destroy", self.destroy)
90 # Connect the ok_button to file_ok_sel method
91 self.filew.ok_button.connect("clicked", self.file_ok_sel)
92
93 # Connect the cancel_button to destroy the widget
94 self.filew.cancel_button.connect("clicked",
95 lambda w: self.filew.destroy())
96
97 self.filew.show()
98
100 # Get the selected filename and print it to the console
102 filename = self.filew.get_filename()
103 self.parent.pdb.savefile(filename)
104 self.filew.destroy()
105
107 self.filew.destroy()
108
110 # Create a new file selection widget
111 self.parent = parent
112 self.filew = gtk.FileSelection("File selection")
113
114 self.filew.connect("destroy", self.destroy)
115 # Connect the ok_button to file_ok_sel method
116 self.filew.ok_button.connect("clicked", self.file_ok_sel)
117
118 # Connect the cancel_button to destroy the widget
119 self.filew.cancel_button.connect("clicked",
120 lambda w: self.filew.destroy())
121
122 # Lets set the filename, as if this were a save dialog,
123 # and we are giving a default filename
124 self.filew.set_filename(expandvars("$HOME/paramdb.xml"))
125
126 self.filew.show()
127
131
132 if __name__ == "__main__":
133 GtkFileChooser(None)
134 main()
135
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Fri Jan 4 16:45:19 2013 | http://epydoc.sourceforge.net |