[latexila] Build View: higher-level functions
- From: SÃbastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] Build View: higher-level functions
- Date: Tue, 10 Jul 2012 06:17:38 +0000 (UTC)
commit 91d3a808e8ed0d3a038ff620ab7db0d7c8a2ad1c
Author: SÃbastien Wilmet <swilmet src gnome org>
Date: Tue Jul 10 08:16:20 2012 +0200
Build View: higher-level functions
src/build_tool_runner.vala | 15 +++++++--------
src/build_view.vala | 17 +++++++++++++----
2 files changed, 20 insertions(+), 12 deletions(-)
---
diff --git a/src/build_tool_runner.vala b/src/build_tool_runner.vala
index a6d53c0..3c767b6 100644
--- a/src/build_tool_runner.vala
+++ b/src/build_tool_runner.vala
@@ -67,10 +67,9 @@ public class BuildToolRunner : GLib.Object
jobs = tool.jobs;
this.view = view;
view.clear ();
- root_partition = view.add_partition (tool.label, PartitionState.RUNNING, null,
- true);
+ root_partition = view.set_title (tool.label, PartitionState.RUNNING);
- if (! add_job_partitions ())
+ if (! add_job_titles ())
return;
action_stop_exec.set_sensitive (true);
@@ -78,7 +77,7 @@ public class BuildToolRunner : GLib.Object
}
// Returns true on success, false otherwise.
- private bool add_job_partitions ()
+ private bool add_job_titles ()
{
job_num = 0;
@@ -92,8 +91,8 @@ public class BuildToolRunner : GLib.Object
}
catch (ShellError e)
{
- TreeIter job_partition = view.add_partition (job.command,
- PartitionState.FAILED, root_partition);
+ TreeIter job_partition =
+ view.add_job_title (job.command, PartitionState.FAILED);
BuildMsg message = BuildMsg ();
message.text = "Failed to parse command line:";
@@ -108,8 +107,8 @@ public class BuildToolRunner : GLib.Object
return false;
}
- job_partitions += view.add_partition (string.joinv (" ", command),
- PartitionState.RUNNING, root_partition);
+ string job_title = string.joinv (" ", command);
+ job_partitions += view.add_job_title (job_title, PartitionState.RUNNING);
job_num++;
}
diff --git a/src/build_view.vala b/src/build_view.vala
index c0b1693..e766a6c 100644
--- a/src/build_view.vala
+++ b/src/build_view.vala
@@ -242,13 +242,22 @@ public class BuildView : TreeView
this.columns_autosize ();
}
- public TreeIter add_partition (string msg, PartitionState state, TreeIter? parent,
- bool bold = false)
+ public TreeIter set_title (string title, PartitionState state)
{
- BuildMsgType type = bold ? BuildMsgType.TITLE : BuildMsgType.JOB_TITLE;
+ return add_partition (title, state, BuildMsgType.TITLE);
+ }
+
+ public TreeIter add_job_title (string job_title, PartitionState state)
+ {
+ return add_partition (job_title, state, BuildMsgType.JOB_TITLE);
+ }
+
+ private TreeIter add_partition (string msg, PartitionState state, BuildMsgType type)
+ {
+ bool bold = type == BuildMsgType.TITLE;
TreeIter iter;
- _store.append (out iter, parent);
+ _store.append (out iter, null);
_store.set (iter,
BuildMsgColumn.ICON, get_icon_from_state (state),
BuildMsgColumn.MESSAGE, msg,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]