[chronojump] Cleaned last commit
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Cleaned last commit
- Date: Thu, 4 May 2017 14:26:25 +0000 (UTC)
commit 6930cf6157dd07776bb3fb0a802d1127fba08a65
Author: Xavier de Blas <xaviblas gmail com>
Date: Thu May 4 16:25:56 2017 +0200
Cleaned last commit
src/gui/chronojump.cs | 75 ++++++++++++++++++++++--------------------------
src/gui/networks.cs | 8 ++---
src/json.cs | 10 ++----
3 files changed, 40 insertions(+), 53 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 613d367..8657ba8 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2485,47 +2485,42 @@ public partial class ChronoJumpWindow
private void person_added ()
{
- /* if (personAddModifyWin.CurrentPerson != null)
- {
- currentPerson = personAddModifyWin.CurrentPerson;
- */
- currentPersonSession = SqlitePersonSession.Select(currentPerson.UniqueID,
currentSession.UniqueID);
- label_person_change();
- myTreeViewPersons.Add(currentPerson.UniqueID.ToString(), currentPerson.Name);
-
- //when adding new person, photos cannot be recorded as currentPerson.UniqueID
- //because it was undefined. Copy them now
- if(File.Exists(Util.GetPhotoTempFileName(false)) &&
File.Exists(Util.GetPhotoTempFileName(true))) {
- try {
- File.Move(Util.GetPhotoTempFileName(false),
- Util.GetPhotoFileName(false, currentPerson.UniqueID));
- } catch {
- File.Copy(Util.GetPhotoTempFileName(false),
- Util.GetPhotoFileName(false, currentPerson.UniqueID),
true);
- }
- try {
- File.Move(Util.GetPhotoTempFileName(true),
- Util.GetPhotoFileName(true, currentPerson.UniqueID));
- } catch {
- File.Copy(Util.GetPhotoTempFileName(true),
- Util.GetPhotoFileName(true, currentPerson.UniqueID),
true);
- }
- }
-
- int rowToSelect = myTreeViewPersons.FindRow(currentPerson.UniqueID);
- if(rowToSelect != -1) {
- selectRowTreeView_persons(treeview_persons, rowToSelect);
- sensitiveGuiYesPerson();
- //appbar2.Push( 1, Catalog.GetString("Successfully added") + " " +
currentPerson.Name );
+ currentPersonSession = SqlitePersonSession.Select(currentPerson.UniqueID,
currentSession.UniqueID);
+ label_person_change();
+ myTreeViewPersons.Add(currentPerson.UniqueID.ToString(), currentPerson.Name);
+
+ //when adding new person, photos cannot be recorded as currentPerson.UniqueID
+ //because it was undefined. Copy them now
+ if(File.Exists(Util.GetPhotoTempFileName(false)) &&
File.Exists(Util.GetPhotoTempFileName(true))) {
+ try {
+ File.Move(Util.GetPhotoTempFileName(false),
+ Util.GetPhotoFileName(false, currentPerson.UniqueID));
+ } catch {
+ File.Copy(Util.GetPhotoTempFileName(false),
+ Util.GetPhotoFileName(false, currentPerson.UniqueID), true);
}
-
- if(person_add_single_called_from_person_select_window) {
- ArrayList myPersons = SqlitePersonSession.SelectCurrentSessionPersons(
- currentSession.UniqueID,
- false); //means: do not returnPersonAndPSlist
- personSelectWin.Update(myPersons);
+ try {
+ File.Move(Util.GetPhotoTempFileName(true),
+ Util.GetPhotoFileName(true, currentPerson.UniqueID));
+ } catch {
+ File.Copy(Util.GetPhotoTempFileName(true),
+ Util.GetPhotoFileName(true, currentPerson.UniqueID), true);
}
- // }
+ }
+
+ int rowToSelect = myTreeViewPersons.FindRow(currentPerson.UniqueID);
+ if(rowToSelect != -1) {
+ selectRowTreeView_persons(treeview_persons, rowToSelect);
+ sensitiveGuiYesPerson();
+ //appbar2.Push( 1, Catalog.GetString("Successfully added") + " " + currentPerson.Name
);
+ }
+
+ if(person_add_single_called_from_person_select_window) {
+ ArrayList myPersons = SqlitePersonSession.SelectCurrentSessionPersons(
+ currentSession.UniqueID,
+ false); //means: do not returnPersonAndPSlist
+ personSelectWin.Update(myPersons);
+ }
}
//show spinbutton window asking for how many people to create
@@ -6543,7 +6538,6 @@ LogB.Debug("X");
private void sensitiveGuiNoSession ()
{
- LogB.Information("NO SESSION");
notebook_session_person.CurrentPage = 0;
treeview_persons.Sensitive = false;
@@ -6583,7 +6577,6 @@ LogB.Debug("X");
private void sensitiveGuiYesSession ()
{
- LogB.Information("YES SESSION");
notebook_session_person.CurrentPage = 1;
button_image_test_zoom.Sensitive = true;
diff --git a/src/gui/networks.cs b/src/gui/networks.cs
index 0db6b20..1c110d5 100644
--- a/src/gui/networks.cs
+++ b/src/gui/networks.cs
@@ -71,11 +71,11 @@ public partial class ChronoJumpWindow
private void configInitRead()
{
configChronojump.Read();
- LogB.Information("PRINT VARS");
- LogB.Information(configChronojump.Compujump.ToString());
- LogB.Information(configChronojump.CompujumpServerURL);
if(configChronojump.Compujump)
{
+ LogB.Information(configChronojump.Compujump.ToString());
+ LogB.Information(configChronojump.CompujumpServerURL);
+
//on compujump cannot add/edit persons, do it from server
frame_persons_top.Visible = false;
button_contacts_person_change.Visible = false;
@@ -201,7 +201,6 @@ public partial class ChronoJumpWindow
if(currentSession == null && //this is going to be called one time because currentSession
will change
( configChronojump.SessionMode == Config.SessionModeEnum.UNIQUE ||
configChronojump.SessionMode == Config.SessionModeEnum.MONTHLY) )
{
- LogB.Information("HEREGUAY");
//main_menu.Visible = false;
//app1.Decorated = false;
hbox_menu_and_preferences_outside_menu.Visible = true;
@@ -217,7 +216,6 @@ public partial class ChronoJumpWindow
} else
currentSession = SqliteSession.SelectByName("session");
} else {
- LogB.Information("HEREGUAY2");
//configChronojump.SessionMode == Config.SessionModeEnum.MONTHLY
string yearMonthStr = UtilDate.GetCurrentYearMonthStr();
diff --git a/src/json.cs b/src/json.cs
index 89ed1f2..8304376 100644
--- a/src/json.cs
+++ b/src/json.cs
@@ -37,7 +37,6 @@ public class Json
public static void ChangeServerUrl(string url)
{
serverUrl = url;
- LogB.Information("NEW URL MAXXX: " + serverUrl);
}
public Json()
@@ -311,7 +310,6 @@ public class Json
response = (HttpWebResponse) request.GetResponse();
} catch {
this.ResultMessage =
- Catalog.GetString("KKKKKKKK") + "\n" +
string.Format(Catalog.GetString("You are not connected to the Internet\nor
{0} server is down."),
serverUrl);
return person;
@@ -326,13 +324,11 @@ public class Json
LogB.Information("GetPersonByRFID: " + responseFromServer);
if(responseFromServer == "")
- LogB.Information(" Empty "); //mai
+ LogB.Information(" Empty "); //never happens
else if(responseFromServer == "[]")
- LogB.Information(" Empty2 "); //sempre que no esta el rfid al server
+ LogB.Information(" Empty2 "); //when rfid is not on server
else {
- LogB.Information(" YES "); //TODO: processar: [[2, "(playername)", 82.0,
"253,20,150,13"]]
-
- //patheticDeserialize("[[2, \"(playername)\", 82.0, \"253,20,150,13\"]]");
+ //patheticPersonDeserialize("[[2, \"(playername)\", 82.0, \"253,20,150,13\"]]");
person = patheticPersonDeserialize(responseFromServer);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]