[gitg] Separate message and pretty message



commit d74fe65b9aa1c99a9e8367c232d383a95ddb0f71
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Sat Jul 6 12:04:16 2013 +0200

    Separate message and pretty message

 gitg/commit/gitg-commit-dialog.vala |   21 +++++++++++++++++++--
 gitg/commit/gitg-commit.vala        |    2 +-
 2 files changed, 20 insertions(+), 3 deletions(-)
---
diff --git a/gitg/commit/gitg-commit-dialog.vala b/gitg/commit/gitg-commit-dialog.vala
index 0bee0df..02b7f94 100644
--- a/gitg/commit/gitg-commit-dialog.vala
+++ b/gitg/commit/gitg-commit-dialog.vala
@@ -42,6 +42,23 @@ class Dialog : Gtk.Dialog
                get { return d_source_view_message; }
        }
 
+       public string pretty_message
+       {
+               owned get
+               {
+                       var pretty = Ggit.message_prettify(message, false);
+
+                       if (pretty == null)
+                       {
+                               return "";
+                       }
+                       else
+                       {
+                               return pretty;
+                       }
+               }
+       }
+
        public string message
        {
                owned get
@@ -52,7 +69,7 @@ class Dialog : Gtk.Dialog
                        Gtk.TextIter end;
 
                        b.get_bounds(out start, out end);
-                       return Ggit.message_prettify(b.get_text(start, end, false), false);
+                       return b.get_text(start, end, false);
                }
        }
 
@@ -75,7 +92,7 @@ class Dialog : Gtk.Dialog
                var b = d_source_view_message.buffer;
 
                d_source_view_message.buffer.changed.connect(() => {
-                       d_button_ok.sensitive = message != "";
+                       d_button_ok.sensitive = pretty_message != "";
                });
 
                d_check_button_amend.bind_property("active",
diff --git a/gitg/commit/gitg-commit.vala b/gitg/commit/gitg-commit.vala
index 5fe6598..a5f0691 100644
--- a/gitg/commit/gitg-commit.vala
+++ b/gitg/commit/gitg-commit.vala
@@ -435,7 +435,7 @@ namespace GitgCommit
                                opts |= Gitg.StageCommitOptions.SKIP_HOOKS;
                        }
 
-                       stage.commit.begin(dlg.message,
+                       stage.commit.begin(dlg.pretty_message,
                                           author,
                                           committer,
                                           opts, (obj, res) => {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]