[chronojump] If creating a session with an existing name, solved better
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] If creating a session with an existing name, solved better
- Date: Thu, 21 Jul 2016 14:46:36 +0000 (UTC)
commit 4454ece42bd4ed4e19c966a3fe1f0f3e712bfd7e
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu Jul 21 16:35:29 2016 +0200
If creating a session with an existing name, solved better
src/gui/chronojump.cs | 6 ++++--
src/gui/session.cs | 15 ++++++++-------
2 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 78f8587..8520a40 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2536,7 +2536,8 @@ public partial class ChronoJumpWindow
private void on_new_activate (object o, EventArgs args) {
LogB.Information("new session");
sessionAddEditWin = SessionAddEditWindow.Show(app1, new Session());
- sessionAddEditWin.Button_accept.Clicked += new EventHandler(on_new_session_accepted);
+ sessionAddEditWin.FakeButtonAccept.Clicked -= new EventHandler(on_new_session_accepted);
+ sessionAddEditWin.FakeButtonAccept.Clicked += new EventHandler(on_new_session_accepted);
}
private void on_new_session_accepted (object o, EventArgs args) {
@@ -2581,7 +2582,8 @@ public partial class ChronoJumpWindow
private void on_edit_session_activate (object o, EventArgs args) {
LogB.Information("edit session");
sessionAddEditWin = SessionAddEditWindow.Show(app1, currentSession);
- sessionAddEditWin.Button_accept.Clicked += new EventHandler(on_edit_session_accepted);
+ sessionAddEditWin.FakeButtonAccept.Clicked -= new EventHandler(on_edit_session_accepted);
+ sessionAddEditWin.FakeButtonAccept.Clicked += new EventHandler(on_edit_session_accepted);
}
private void on_edit_session_accepted (object o, EventArgs args) {
diff --git a/src/gui/session.cs b/src/gui/session.cs
index 102c5fd..3eedc79 100644
--- a/src/gui/session.cs
+++ b/src/gui/session.cs
@@ -74,6 +74,7 @@ public class SessionAddEditWindow {
bool addSession;
private Session currentSession;
+ private Gtk.Button fakeButtonAccept;
GenericWindow genericWin;
static SessionAddEditWindow SessionAddEditWindowBox;
@@ -91,6 +92,8 @@ public class SessionAddEditWindow {
this.currentSession = currentSession;
button_accept.Sensitive = false;
+
+ fakeButtonAccept = new Button();
createComboSports();
createComboSpeciallities(-1);
@@ -567,6 +570,8 @@ public class SessionAddEditWindow {
string myString = string.Format(Catalog.GetString("Session: '{0}' exists. Please, use
another name"), Util.RemoveTildeAndColonAndDot(entry_name.Text) );
ErrorWindow.Show(myString);
} else {
+ FakeButtonAccept.Click();
+
int sportID;
if(radiobutton_diff_sports.Active)
sportID = Constants.SportUndefinedID;
@@ -613,15 +618,11 @@ public class SessionAddEditWindow {
}
}
- public Button Button_accept
+ public Gtk.Button FakeButtonAccept
{
- set {
- button_accept = value;
- }
- get {
- return button_accept;
- }
+ get { return fakeButtonAccept; }
}
+
public Session CurrentSession
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]