~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric-updates

« back to all changes in this revision

Viewing changes to src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2009-02-18 08:40:51 UTC
  • mfrom: (1.2.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090218084051-gh8m6ukvokbwj7cf
Tags: 1.9.2+dfsg-1ubuntu1
* Merge from Debian Experimental (LP: #330519), remaining Ubuntu changes:
  + debian/control:
    - Update for Gnome# 2.24
    - Add libmono-cairo1.0-cil to build-deps to fool pkg-config check

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
using System.Collections;
5
5
using Gtk;
6
6
using MonoDevelop.Core;
 
7
using MonoDevelop.Core.Gui;
7
8
using MonoDevelop.Ide.Gui;
8
9
using Mono.Addins;
9
10
 
50
51
                        foreach (object ob in exts) {
51
52
                                CommitDialogExtension ext = ob as CommitDialogExtension;
52
53
                                if (ext == null) {
53
 
                                        IdeApp.Services.MessageService.ShowError ("Commit extension type " + ob.GetType() + " must be a subclass of CommitDialogExtension");
 
54
                                        MessageService.ShowError ("Commit extension type " + ob.GetType() + " must be a subclass of CommitDialogExtension");
54
55
                                        continue;
55
56
                                }
56
57
                                vboxExtensions.PackEnd (ext, false, false, 0);
57
58
                                ext.Initialize (changeSet);
58
59
                                extensions.Add (ext);
 
60
                                ext.AllowCommitChanged += HandleAllowCommitChanged;
59
61
                        }
 
62
                        HandleAllowCommitChanged (null, null);
60
63
 
61
64
                        foreach (ChangeSetItem info in changeSet.Items) {
62
65
                                Gdk.Pixbuf statusicon = VersionControlService.LoadIconForStatus (info.Status);
70
73
                                selected.Add (info.LocalPath);
71
74
                        }
72
75
                        
73
 
                        if (changeSet.GlobalComment.Length == 0)
74
 
                                Message = changeSet.GenerateGlobalComment (70);
 
76
                        if (changeSet.GlobalComment.Length == 0) {
 
77
                                AuthorInformation aInfo;
 
78
                                CommitMessageFormat fmt = VersionControlService.GetCommitMessageFormat (changeSet, out aInfo);
 
79
                                Message = changeSet.GenerateGlobalComment (fmt, aInfo);
 
80
                        }
75
81
                        else
76
82
                                Message = changeSet.GlobalComment;
77
83
                                
78
84
                        textview.Buffer.Changed += OnTextChanged;
79
85
                }
 
86
 
 
87
                void HandleAllowCommitChanged (object sender, EventArgs e)
 
88
                {
 
89
                        bool allowCommit = true;
 
90
                        foreach (CommitDialogExtension ext in extensions)
 
91
                                allowCommit &= ext.AllowCommit;
 
92
                        SetResponseSensitive (Gtk.ResponseType.Ok, allowCommit);
 
93
                }
80
94
                
81
95
                protected override void OnResponse (Gtk.ResponseType type)
82
96
                {
101
115
                                        try {
102
116
                                                res = ext.OnBeginCommit (changeSet);
103
117
                                        } catch (Exception ex) {
104
 
                                                IdeApp.Services.MessageService.ShowError (ex);
 
118
                                                MessageService.ShowException (ex);
105
119
                                                res = false;
106
120
                                        }
107
121
                                        
160
174
                        else
161
175
                                selected.Remove (vinfo.LocalPath);
162
176
                }
163
 
                
164
 
                public override void Dispose ()
165
 
                {
166
 
                        base.Dispose ();
167
 
                        Destroy ();
168
 
                }
169
177
        }
170
178
}