[chronojump] Done personAddMultiple from persons top window
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Done personAddMultiple from persons top window
- Date: Tue, 13 Mar 2018 15:07:56 +0000 (UTC)
commit cc06a0e97567d4ef3cb9009b174f00337d2a029e
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Mar 13 16:07:28 2018 +0100
Done personAddMultiple from persons top window
glade/app1.glade | 8 +++++++-
src/gui/chronojump.cs | 24 ++++++++++++++++++++++--
src/gui/personSelect.cs | 5 ++++-
3 files changed, 33 insertions(+), 4 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 641d147..178b2be 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1613,6 +1613,9 @@
<placeholder/>
</child>
<child>
+ <placeholder/>
+ </child>
+ <child>
<widget class="GtkLabel"
id="label_start_selector_jumps">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -2597,7 +2600,7 @@ EncoderInertialCapture</property>
<property name="has_tooltip">True</property>
<property name="tooltip" translatable="yes">New
persons (multiple)</property>
<property name="relief">half</property>
- <signal name="clicked"
handler="on_person_add_multiple_clicked" swapped="no"/>
+ <signal name="clicked"
handler="on_person_add_multiple_from_main_gui" swapped="no"/>
<child>
<widget class="GtkVBox" id="vbox92">
<property name="visible">True</property>
@@ -23028,6 +23031,9 @@ then click this button.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 6545ca7..1bc4162 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2692,13 +2692,24 @@ public partial class ChronoJumpWindow
personSelectWin.Update(myPersons, currentPerson);
}
+ bool person_add_multiple_called_from_person_select_window;
//show spinbutton window asking for how many people to create
- private void on_person_add_multiple_clicked (object o, EventArgs args) {
+ private void on_person_add_multiple_from_main_gui (object o, EventArgs args)
+ {
+ person_add_multiple_called_from_person_select_window = false;
+ person_add_multiple();
+ }
+
+ private void person_add_multiple ()
+ {
personAddMultipleWin = PersonAddMultipleWindow.Show(app1, currentSession);
+ personAddMultipleWin.Button_accept.Clicked -= new
EventHandler(on_person_add_multiple_accepted);
personAddMultipleWin.Button_accept.Clicked += new
EventHandler(on_person_add_multiple_accepted);
}
- private void on_person_add_multiple_accepted (object o, EventArgs args) {
+ private void on_person_add_multiple_accepted (object o, EventArgs args)
+ {
+ personAddMultipleWin.Button_accept.Clicked -= new
EventHandler(on_person_add_multiple_accepted);
if (personAddMultipleWin.CurrentPerson != null)
{
currentPerson = personAddMultipleWin.CurrentPerson;
@@ -2719,6 +2730,9 @@ public partial class ChronoJumpWindow
// personAddMultipleWin.PersonsCreatedCount);
//appbar2.Push( 1, Catalog.GetString(myString) );
}
+
+ if(person_add_multiple_called_from_person_select_window)
+ updatePersonSelectWin ();
}
}
@@ -2828,6 +2842,7 @@ public partial class ChronoJumpWindow
personSelectWin = PersonSelectWindow.Show(app1, myPersons, currentPerson);
personSelectWin.FakeButtonAddPerson.Clicked += new
EventHandler(on_button_top_person_add_person);
+ personSelectWin.FakeButtonAddPersonMultiple.Clicked += new
EventHandler(on_button_top_person_add_person_multiple);
personSelectWin.FakeButtonLoadPerson.Clicked += new
EventHandler(on_button_top_person_load_person);
personSelectWin.FakeButtonEditPerson.Clicked += new
EventHandler(on_button_top_person_edit_person);
personSelectWin.FakeButtonPersonShowAllEvents.Clicked += new
EventHandler(on_button_top_person_show_all_events);
@@ -2839,6 +2854,11 @@ public partial class ChronoJumpWindow
person_add_single_called_from_person_select_window = true;
person_add_single();
}
+ private void on_button_top_person_add_person_multiple(object o, EventArgs args)
+ {
+ person_add_multiple_called_from_person_select_window = true;
+ person_add_multiple();
+ }
private void on_button_top_person_load_person(object o, EventArgs args)
{
person_load_single_called_from_person_select_window = true;
diff --git a/src/gui/personSelect.cs b/src/gui/personSelect.cs
index 3efcf23..26ab981 100644
--- a/src/gui/personSelect.cs
+++ b/src/gui/personSelect.cs
@@ -59,6 +59,7 @@ public class PersonSelectWindow
private int selectedFirstClickPersonID; //contains the uniqueID of person selected on first button
click
public Person SelectedPerson;
public Gtk.Button FakeButtonAddPerson;
+ public Gtk.Button FakeButtonAddPersonMultiple;
public Gtk.Button FakeButtonLoadPerson;
public Gtk.Button FakeButtonEditPerson;
public Gtk.Button FakeButtonPersonShowAllEvents;
@@ -80,6 +81,7 @@ public class PersonSelectWindow
person_select_window.Parent = parent;
FakeButtonAddPerson = new Gtk.Button();
+ FakeButtonAddPersonMultiple = new Gtk.Button();
FakeButtonLoadPerson = new Gtk.Button();
FakeButtonEditPerson = new Gtk.Button();
FakeButtonPersonShowAllEvents = new Gtk.Button();
@@ -313,7 +315,8 @@ public class PersonSelectWindow
}
private void on_button_person_add_multiple_clicked (object o, EventArgs args)
{
- new DialogMessage(Constants.MessageTypes.INFO, "TODO");
+ person_select_window.Visible = false;
+ FakeButtonAddPersonMultiple.Click();
}
private void on_button_recuperate_persons_from_session_clicked (object o, EventArgs args)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]