<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Sat Aug 9 16:59:39 2008 -->
+<!--Generated with glade3 3.4.5 on Sat Aug 9 17:45:41 2008 -->
<glade-interface>
<widget class="GtkWindow" id="main-window">
<property name="title" translatable="yes">Gzv</property>
<property name="receives_default">True</property>
<property name="tooltip" translatable="yes">Remove the selected focus point</property>
<property name="response_id">0</property>
+ <signal name="clicked" handler="remove_fp"/>
<child>
<widget class="GtkImage" id="image2">
<property name="visible">True</property>
<property name="receives_default">True</property>
<property name="tooltip" translatable="yes">Save list of focus points</property>
<property name="response_id">0</property>
+ <signal name="clicked" handler="save_fp_list"/>
<child>
<widget class="GtkImage" id="image3">
<property name="visible">True</property>
cp.set('Project', 'image', self.image)
cp.set('Project', 'width', self.width)
cp.set('Project', 'height', self.height)
+ cp.set('Project', 'focus_points', self.focus_points_file)
cp.write(open(path, 'w'))
fc.destroy()
def load_project(self, project):
+ self.project = project
self.balls = self.load_balls_from_file(project.focus_points_file)
self.image = project.image
self.load_balls_to_treeview()
balls.append(Ball(int(x), int(y), int(radios), name, index))
return balls
+ def remove_fp(self, *args):
+ selection = self.treeview.get_selection()
+ model, path = selection.get_selected()
+ if path:
+ position = model[path][0]
+ for i in self.balls:
+ if i.position == int(position):
+ self.balls.remove(i)
+ del model[path]
+
+ def save_fp_list(self, *args):
+ assert self.project is not None
+
+ # if the project has no
+ if self.project and not self.project.focus_points_file:
+ fc = gtk.FileChooserDialog(_('Save the focus points file'),
+ self.window,
+ action=gtk.FILE_CHOOSER_ACTION_SAVE,
+ buttons=(gtk.STOCK_CANCEL,
+ gtk.RESPONSE_CANCEL,
+ gtk.STOCK_SAVE,
+ gtk.RESPONSE_OK))
+ if fc.run() == gtk.RESPONSE_OK:
+ self.project.focus_points_file = fc.get_filename()
+ fc.destroy()
+ else:
+ fc.destroy()
+ return
+
+ self.balls.save_to_file(self.project.focus_points_file)
+
def expose_draw(self, draw, event):
if not self.image:
return
self.draw.queue_draw()
if event.x > self.last_x:
- self.ball_width += 2
+ self.ball_width += 3
else:
- self.ball_width -= 2
+ self.ball_width -= 3
self.last_x = event.x