[chronojump/chronojump-importer: 66/66] Fixes error: the new imported jumps were not available unless chronojump was restarted.
- From: Carles Pina i Estany <carlespina src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump/chronojump-importer: 66/66] Fixes error: the new imported jumps were not available unless chronojump was restarted.
- Date: Mon, 26 Sep 2016 22:22:31 +0000 (UTC)
commit b8f1070d6a4c5f705d42ca51f73e8abc2eb7e6f4
Author: Carles Pina i Estany <carles pina cat>
Date: Mon Sep 26 23:51:28 2016 +0200
Fixes error: the new imported jumps were not available unless chronojump was restarted.
There were two issues:
a) updateComboStats() wasn't called
b) when updateComboStats() was called: this function didn't update the
list of jumps in one of the combobox (only in a related one). Now it
does
src/gui/chronojump.cs | 17 ++++++++++++++++-
src/gui/stats.cs | 8 +++++++-
2 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index c3fcf68..69f70df 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2416,6 +2416,8 @@ public partial class ChronoJumpWindow
processStartInfo = new ProcessStartInfo();
+ // TODO: use this to escape the arguments:
https://github.com/ericpopivker/Command-Line-Encoder/blob/master/CommandLineEncoder/CommandLineEncoder/Utils.cs
+ // Otherwise source_filename with double quotes, spaces, etc. wouldn't work
processStartInfo.Arguments = importer_executable + " --source " + source_filename + "
--destination " + destination_filename + " --source_session " + session;
processStartInfo.FileName = pythonExecutable;
@@ -2425,14 +2427,23 @@ public partial class ChronoJumpWindow
processStartInfo.CreateNoWindow = true;
processStartInfo.UseShellExecute = false;
processStartInfo.RedirectStandardInput = false;
- processStartInfo.RedirectStandardError = false;
+ processStartInfo.RedirectStandardError = true;
processStartInfo.RedirectStandardOutput = true;
+ process.EnableRaisingEvents = true; // So the callback for Exited is called
+
process.OutputDataReceived += new DataReceivedEventHandler(
(s, e) =>
{
LogB.Debug(e.Data);
}
);
+ process.ErrorDataReceived += new DataReceivedEventHandler (
+ (s, e) =>
+ {
+ LogB.Debug(e.Data);
+ }
+ );
+
process.StartInfo = processStartInfo;
bool started = false;
@@ -2448,7 +2459,11 @@ public partial class ChronoJumpWindow
if (started) {
process.BeginOutputReadLine ();
+ process.BeginErrorReadLine ();
}
+
+ process.WaitForExit ();
+ updateComboStats ();
}
private void on_open_activate (object o, EventArgs args)
diff --git a/src/gui/stats.cs b/src/gui/stats.cs
index 68fcc3f..f92fdb4 100644
--- a/src/gui/stats.cs
+++ b/src/gui/stats.cs
@@ -598,8 +598,14 @@ public partial class ChronoJumpWindow {
//by default show all simple nonTC jumps, but if combo_stats_subtype changed
//updateComboStatsSubType() will do the work
+
+
+ string[] jumps = SqliteJumpType.SelectJumpTypes(false, Constants.AllJumpsName,
"nonTC", true);
+
UtilGtk.ComboUpdate(combo_stats_stat_apply_to,
- SqliteJumpType.SelectJumpTypes(false, Constants.AllJumpsName, "nonTC", true),
""); //only select name
+ jumps, ""); //only select name
+ UtilGtk.ComboUpdate(combo_select_jumps, jumps, "");
+
combo_stats_stat_apply_to.Sensitive = true;
combo_stats_stat_apply_to.Active = 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]