[chronojump] snapshot done!
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] snapshot done!
- Date: Mon, 7 Feb 2011 16:15:54 +0000 (UTC)
commit 51cd592bde1ec5e3b9e069a6c31d46335398559a
Author: Xavier de Blas <xaviblas gmail com>
Date: Mon Feb 7 17:15:33 2011 +0100
snapshot done!
glade/chronojump.glade | 38 ++++++++++++++++++++------------------
src/gui/chronojump.cs | 3 ---
src/gui/person.cs | 22 +++++++++++++++++-----
3 files changed, 37 insertions(+), 26 deletions(-)
---
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index 1968ffa..b6995d4 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -7,7 +7,6 @@
<property name="border_width">10</property>
<property name="title" translatable="yes">New jumper</property>
<property name="resizable">False</property>
- <property name="modal">True</property>
<property name="type_hint">dialog</property>
<signal name="delete_event" handler="on_person_win_delete_event"/>
<child>
@@ -11317,6 +11316,8 @@ Test</b></property>
</child>
</widget>
<widget class="GtkDialog" id="dialog_image_test">
+ <property name="width_request">640</property>
+ <property name="height_request">480</property>
<property name="visible">True</property>
<property name="border_width">8</property>
<property name="title" translatable="yes">Test image and description</property>
@@ -11340,12 +11341,26 @@ Test</b></property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox237">
+ <widget class="GtkHBox" id="hbox_main">
<property name="visible">True</property>
<property name="spacing">8</property>
<child>
- <widget class="GtkImage" id="image_test">
+ <widget class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <widget class="GtkViewport" id="viewport1">
+ <property name="visible">True</property>
+ <property name="resize_mode">queue</property>
+ <child>
+ <widget class="GtkImage" id="image_test">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+ </widget>
+ </child>
</widget>
<packing>
<property name="position">0</property>
@@ -11358,7 +11373,8 @@ Test</b></property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
- <property name="hscrollbar_policy">never</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
<child>
<widget class="GtkViewport" id="viewport2">
<property name="visible">True</property>
@@ -17733,20 +17749,6 @@ by you</property>
</widget>
</child>
<child>
- <widget class="GtkImageMenuItem" id="menuitem_camera_photo">
- <property name="label" translatable="yes">camera photo</property>
- <property name="visible">True</property>
- <property name="use_stock">False</property>
- <signal name="activate" handler="on_menuitem_camera_photo"/>
- <child internal-child="image">
- <widget class="GtkImage" id="image46">
- <property name="visible">True</property>
- <property name="stock">gtk-missing-image</property>
- </widget>
- </child>
- </widget>
- </child>
- <child>
<widget class="GtkImageMenuItem" id="menuitem_report_window">
<property name="label" translatable="yes">Report</property>
<property name="visible">True</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 4d8ca51..d76a92f 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2177,9 +2177,6 @@ public class ChronoJumpWindow
capturer.Run();
}
- private void on_menuitem_camera_photo(object o, EventArgs args) {
- }
-
/* ---------------------------------------------------------
diff --git a/src/gui/person.cs b/src/gui/person.cs
index 832c7f9..1e936de 100644
--- a/src/gui/person.cs
+++ b/src/gui/person.cs
@@ -955,9 +955,11 @@ public class PersonAddModifyWindow
new DialogImageTest(currentPerson.Name, Util.GetPhotoFileName(false, currentPerson.UniqueID));
}
+ Gtk.Window capturerWindow;
+ CapturerBin capturer;
void on_button_take_photo_clicked (object o, EventArgs args)
{
- CapturerBin capturer = new CapturerBin();
+ capturer = new CapturerBin();
CapturePropertiesStruct s = new CapturePropertiesStruct();
s.CaptureSourceType = CaptureSourceType.Raw;
@@ -968,10 +970,11 @@ public class PersonAddModifyWindow
capturer.NewSnapshot += on_snapshot_done;
capturer.NewSnapshotMini += on_snapshot_mini_done;
- Gtk.Window d = new Gtk.Window("Capturer");
- d.Add(capturer);
- d.ShowAll();
- d.DeleteEvent += delegate(object sender, DeleteEventArgs e) {capturer.Close(); capturer.Dispose();};
+ capturerWindow = new Gtk.Window("Capturer");
+ capturerWindow.Add(capturer);
+ capturerWindow.Modal=true;
+ capturerWindow.ShowAll();
+ capturerWindow.DeleteEvent += delegate(object sender, DeleteEventArgs e) {capturer.Close(); capturer.Dispose();};
capturer.Run();
}
private void on_snapshot_done(Pixbuf pixbuf) {
@@ -980,6 +983,15 @@ public class PersonAddModifyWindow
}
private void on_snapshot_mini_done(Pixbuf pixbuf) {
pixbuf.Save(Util.GetPhotoFileName(true, currentPerson.UniqueID),"jpeg");
+ capturer.Close();
+ capturer.Dispose();
+ capturerWindow.Hide();
+
+ string photoFile = Util.GetPhotoFileName(true, currentPerson.UniqueID);
+ if(File.Exists(photoFile)) {
+ Pixbuf pixbuf2 = new Pixbuf (photoFile); //from a file
+ image_photo_mini.Pixbuf = pixbuf2;
+ }
}
void on_entries_required_changed (object o, EventArgs args)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]