/usr/share/pyshared/ase/gui/settings.py is in python-ase 3.6.0.2515-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | #!/usr/bin/env python
import gtk
from ase.gui.widgets import pack
from gettext import gettext as _
class Settings(gtk.Window):
def __init__(self, gui):
gtk.Window.__init__(self)
self.set_title('Settings')
self.gui = gui
vbox = gtk.VBox()
# Constraints
a = pack(vbox, gtk.Label())
a.set_markup('<span size="larger" underline="single">'
'%s</span>' % _('Constraints:'))
a, b = pack(vbox, [gtk.Button(_('Constrain')),
gtk.Label('/'),
gtk.Button(_('release')),
gtk.Label(_(' selected atoms'))])[::2]
a.connect('clicked', self.constrain_selected)
b.connect('clicked', self.release_selected)
a = pack(vbox, gtk.Button(_('Constrain immobile atoms')))
a.connect('clicked', self.immobile)
a = pack(vbox, gtk.Button(_('Clear all constraints')))
a.connect('clicked', self.clear_constraints)
# Visibility
a = pack(vbox, gtk.Label())
a.set_markup('\n<span size="larger" underline="single">'
'%s</span>' % _('Visibility:'))
a, b = pack(vbox, [gtk.Button(_('Hide')),
gtk.Label('/'),
gtk.Button(_('show')),
gtk.Label(_(' selected atoms'))])[::2]
a.connect('clicked', self.hide_selected)
b.connect('clicked', self.show_selected)
a = pack(vbox, gtk.Button(_('View all atoms')))
a.connect('clicked', self.view_all)
# Miscellaneous
a = pack(vbox, gtk.Label())
a.set_markup('\n<span size="larger" underline="single">'
'%s</span>' % _('Miscellaneous:'))
self.scale = gtk.Adjustment(value=.89, lower=0.2, upper=2.0,
step_incr=0.1, page_incr=0.5)
pack(vbox, [gtk.Label(_('Scale atomic radii:')),
gtk.SpinButton(self.scale, climb_rate=0, digits=2)])
self.scale.connect('value-changed', self.scale_radii)
# A close button
pack(vbox, gtk.Label(_('\n')))
close = pack(vbox, gtk.Button(_('Close')))
close.connect('clicked', lambda widget: self.destroy())
# Add elements and show frame
self.add(vbox)
vbox.show()
self.show()
def scale_radii(self, adjustment):
self.gui.images.set_radii(float(self.scale.value))
self.gui.draw()
return True
def hide_selected(self, button):
self.gui.images.visible[self.gui.images.selected] = False
self.gui.draw()
def show_selected(self, button):
self.gui.images.visible[self.gui.images.selected] = True
self.gui.draw()
def view_all(self, button):
self.gui.images.visible[:] = True
self.gui.draw()
def constrain_selected(self, button):
self.gui.images.dynamic[self.gui.images.selected] = False
self.gui.draw()
def release_selected(self, button):
self.gui.images.dynamic[self.gui.images.selected] = True
self.gui.draw()
def immobile(self, button):
self.gui.images.set_dynamic()
self.gui.draw()
def clear_constraints(self, button):
self.gui.images.dynamic[:] = True
self.gui.draw()
|