[chronojump] DB: 1.50 Added crashLogLanguage
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] DB: 1.50 Added crashLogLanguage
- Date: Tue, 19 Dec 2017 16:46:14 +0000 (UTC)
commit 1d4f34474216b0acf40d051278bd7a4060903988
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Dec 19 17:45:50 2017 +0100
DB: 1.50 Added crashLogLanguage
glade/app1.glade | 124 +++++++++++++++++++++++++++++++++++++++++++--
src/gui/chronojump.cs | 17 ++++---
src/gui/sendLog.cs | 41 +++++++++++++--
src/preferences.cs | 1 +
src/sqlite/main.cs | 11 ++++-
src/sqlite/preferences.cs | 3 +
6 files changed, 180 insertions(+), 17 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 478c9c0..7bf1afb 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -1541,6 +1541,12 @@
<placeholder/>
</child>
<child>
+ <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>
@@ -22398,6 +22404,12 @@ then click this button.</property>
<child>
<placeholder/>
</child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -23516,7 +23528,7 @@ Evaluator can use real name or nickname.</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">8</property>
- <property name="spacing">10</property>
+ <property name="spacing">12</property>
<child>
<placeholder/>
</child>
@@ -23564,6 +23576,110 @@ Evaluator can use real name or nickname.</property>
</packing>
</child>
<child>
+ <widget class="GtkVBox" id="vbox78">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <widget class="GtkLabel" id="label263">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Preferred response language
</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkAlignment" id="alignment36">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="left_padding">12</property>
+ <child>
+ <widget class="GtkTable" id="table10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <widget class="GtkRadioButton" id="radio_log_catalan">
+ <property name="label" translatable="yes">Catalan</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radio_log_english</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="radio_log_spanish">
+ <property name="label" translatable="yes">Spanish</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radio_log_english</property>
+ </widget>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="radio_log_english">
+ <property name="label" translatable="yes">English</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ </child>
+ <child>
+ <widget class="GtkRadioButton" id="radio_log_portuguese">
+ <property name="label" translatable="yes">Portuguese</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">radio_log_english</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
<widget class="GtkVBox" id="vbox107">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -23606,7 +23722,7 @@ Evaluator can use real name or nickname.</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
@@ -23648,7 +23764,7 @@ Evaluator can use real name or nickname.</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
@@ -23705,7 +23821,7 @@ Evaluator can use real name or nickname.</property>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</widget>
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 8e1d133..1510fe3 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -553,13 +553,6 @@ public partial class ChronoJumpWindow
//white bg
eventbox_image_test.ModifyBg(StateType.Normal, UtilGtk.WHITE);
- if(! showSendLog)
- notebook_start.CurrentPage = 0; //start with the Mode selector
- else {
- show_send_log(sendLogMessage);
- notebook_start.CurrentPage = 2; //send log
- }
-
//new DialogMessage(Constants.MessageTypes.INFO, UtilGtk.ScreenHeightFitted(false).ToString()
);
//UtilGtk.ResizeIfNeeded(stats_window);
@@ -579,6 +572,16 @@ public partial class ChronoJumpWindow
//preferencesLoaded is a fix to a gtk#-net-windows-bug where radiobuttons raise signals
//at initialization of chronojump and gives problems if this signals are raised while
preferences are loading
loadPreferences ();
+
+ //show send log if needed
+
+ if(! showSendLog)
+ notebook_start.CurrentPage = 0; //start with the Mode selector
+ else {
+ show_send_log(sendLogMessage, preferences.crashLogLanguage);
+ notebook_start.CurrentPage = 2; //send log
+ }
+
// ------ Creating widgets ------
diff --git a/src/gui/sendLog.cs b/src/gui/sendLog.cs
index 3bb46e9..1bc240b 100644
--- a/src/gui/sendLog.cs
+++ b/src/gui/sendLog.cs
@@ -32,21 +32,47 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Image image_send_log_no;
[Widget] Gtk.Image image_send_log_yes;
[Widget] Gtk.Entry entry_send_log;
+ [Widget] Gtk.RadioButton radio_log_catalan;
+ [Widget] Gtk.RadioButton radio_log_spanish;
+ [Widget] Gtk.RadioButton radio_log_english;
+ [Widget] Gtk.RadioButton radio_log_portuguese;
[Widget] Gtk.TextView textview_comments;
[Widget] Gtk.Button button_send_log;
[Widget] Gtk.Label label_send_log_message;
string emailStored;
- private void show_send_log(string sendLogMessage)
+ private void show_send_log(string sendLogMessage, string logLanguage)
{
label_send_log.Text = sendLogMessage;
emailStored = SqlitePreferences.Select("email");
if(emailStored != null && emailStored != "" && emailStored != "0")
entry_send_log.Text = emailStored;
-
+
+ //set language radiobuttons
+ if(logLanguage == "Catalan")
+ radio_log_catalan.Active = true;
+ else if(logLanguage == "Spanish")
+ radio_log_spanish.Active = true;
+ else if(logLanguage == "Portuguese")
+ radio_log_portuguese.Active = true;
+ else
+ radio_log_english.Active = true;
+
hbox_send_log.Show();
}
+ private string get_send_log_language()
+ {
+ if(radio_log_catalan.Active)
+ return "Catalan";
+ else if(radio_log_spanish.Active)
+ return "Spanish";
+ else if(radio_log_portuguese.Active)
+ return "Portuguese";
+ else //default english //if(radio_log.english.Active)
+ return "English";
+ }
+
private void on_button_send_log_clicked (object o, EventArgs args)
{
string email = entry_send_log.Text.ToString();
@@ -57,10 +83,15 @@ public partial class ChronoJumpWindow
if(email != null && email != "" && email != "0" && email != emailStored)
SqlitePreferences.Update("email", email, false);
- //2nd if there are comments, add them at the beginning of the file
- string comments = textview_comments.Buffer.Text;
+ //2nd add language as comments
+ string language = get_send_log_language();
+ SqlitePreferences.Update("crashLogLanguage", language, false);
+ string comments = "Answer in: " + language + "\n";
+
+ //3rd if there are comments, add them at the beginning of the file
+ comments += textview_comments.Buffer.Text;
- //2nd send Json
+ //4th send Json
Json js = new Json();
bool success = js.PostCrashLog(email, comments);
diff --git a/src/preferences.cs b/src/preferences.cs
index 2497766..bc059f9 100644
--- a/src/preferences.cs
+++ b/src/preferences.cs
@@ -74,6 +74,7 @@ public class Preferences
public int videoDeviceNum; //AKA videoDevice
public string CSVExportDecimalSeparator;
public string language;
+ public string crashLogLanguage;
public bool RGraphsTranslate;
public bool useHeightsOnJumpIndexes;
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index e9cadbf..f6a6b89 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -125,7 +125,7 @@ class Sqlite
/*
* Important, change this if there's any update to database
*/
- static string lastChronojumpDatabaseVersion = "1.49";
+ static string lastChronojumpDatabaseVersion = "1.50";
public Sqlite() {
}
@@ -2262,6 +2262,14 @@ class Sqlite
currentVersion = updateVersion("1.49");
}
+ if(currentVersion == "1.49")
+ {
+ LogB.SQL("Updated preferences: added crashLogLanguage");
+
+ SqlitePreferences.Insert ("crashLogLanguage", "English");
+
+ currentVersion = updateVersion("1.50");
+ }
@@ -2444,6 +2452,7 @@ class Sqlite
SqlitePreferences.initializeTable(lastChronojumpDatabaseVersion, creatingBlankDatabase);
//changes [from - to - desc]
+ //1.49 - 1.50 Converted DB to 1.50 Updated preferences: added crashLogLanguage
//1.48 - 1.49 Converted DB to 1.49 Updated preferences: added force sensor tare/calibration
stuff
//1.47 - 1.48 Converted DB to 1.48 Updated preferences: added gstreamer
//1.46 - 1.47 Converted DB to 1.47 Added encoderCaptureBarplotFontSize at preferences
diff --git a/src/sqlite/preferences.cs b/src/sqlite/preferences.cs
index 7b9d7ab..a233bf4 100644
--- a/src/sqlite/preferences.cs
+++ b/src/sqlite/preferences.cs
@@ -83,6 +83,7 @@ class SqlitePreferences : Sqlite
Insert ("heightPreferred", "False", dbcmdTr);
Insert ("metersSecondsPreferred", "True", dbcmdTr);
Insert ("language", "", dbcmdTr);
+ Insert ("crashLogLanguage", "", dbcmdTr);
Insert ("allowFinishRjAfterTime", "True", dbcmdTr);
Insert ("volumeOn", "True", dbcmdTr);
Insert (Preferences.GstreamerStr,
Preferences.GstreamerTypes.GST_0_1.ToString(), dbcmdTr);
@@ -315,6 +316,8 @@ class SqlitePreferences : Sqlite
preferences.CSVExportDecimalSeparator = reader[1].ToString();
else if(reader[0].ToString() == "language")
preferences.language = reader[1].ToString();
+ else if(reader[0].ToString() == "crashLogLanguage")
+ preferences.crashLogLanguage = reader[1].ToString();
else if(reader[0].ToString() == "RGraphsTranslate")
preferences.RGraphsTranslate = reader[1].ToString() == "True";
else if(reader[0].ToString() == "useHeightsOnJumpIndexes")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]