From 573fb78c5b0606cce84e9f596f204544aa4f8e4d Mon Sep 17 00:00:00 2001 From: "Joel W. Reed" Date: Sun, 11 Nov 2007 23:03:06 -0500 Subject: [PATCH] changesetview.dialog --- class/Gtk.TeamFoundation/ChangesetDialog.cs | 56 ++++++++++++++++++++++ class/Gtk.TeamFoundation/ChangesetView.cs | 15 +++++- class/Gtk.TeamFoundation/ExploreView.cs | 4 +- class/Gtk.TeamFoundation/Gtk.TeamFoundation.csproj | 1 + class/Gtk.TeamFoundation/RepositoryView.cs | 9 +--- 5 files changed, 75 insertions(+), 10 deletions(-) create mode 100644 class/Gtk.TeamFoundation/ChangesetDialog.cs diff --git a/class/Gtk.TeamFoundation/ChangesetDialog.cs b/class/Gtk.TeamFoundation/ChangesetDialog.cs new file mode 100644 index 0000000..e4a2fc0 --- /dev/null +++ b/class/Gtk.TeamFoundation/ChangesetDialog.cs @@ -0,0 +1,56 @@ +// +// ChangesetDialog.cs +// +// Authors: +// Joel Reed (joelwreed@gmail.com) +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Text; +using Gtk; + +namespace Gtk.TeamFoundation +{ + public class ChangesetDialog : Gtk.Dialog + { + private ChangesetDiffView changesetDiffView; + private Button closeButton; + + protected override bool OnKeyPressEvent(Gdk.EventKey evnt) + { + if (evnt.Key == Gdk.Key.Escape) + closeButton.Click(); + + return base.OnKeyPressEvent(evnt); + } + + public ChangesetDialog(string cid) : base("Changeset " + cid, null, DialogFlags.Modal) + { + changesetDiffView = new ChangesetDiffView(); + Add(changesetDiffView); + closeButton = AddButton ("Close", ResponseType.Cancel) as Button; + DefaultResponse = ResponseType.Cancel; + } + } +} \ No newline at end of file diff --git a/class/Gtk.TeamFoundation/ChangesetView.cs b/class/Gtk.TeamFoundation/ChangesetView.cs index 529b05a..0caa104 100644 --- a/class/Gtk.TeamFoundation/ChangesetView.cs +++ b/class/Gtk.TeamFoundation/ChangesetView.cs @@ -82,6 +82,7 @@ namespace Gtk.TeamFoundation changesetList.Selection.Mode = SelectionMode.Multiple; changesetList.Selection.Changed += OnSelectionChanged; changesetList.KeyReleaseEvent += MyKeyReleaseEventHandler; + changesetList.ButtonPressEvent += MyButtonPressEventHandler; #if HAVE_ATLEAST_GTK_210 changesetList.EnableGridLines = TreeViewGridLines.Vertical; @@ -95,6 +96,18 @@ namespace Gtk.TeamFoundation Add(changesetList); } + [GLib.ConnectBefore] + protected void MyButtonPressEventHandler (object o, ButtonPressEventArgs args) + { + if (args.Event.Type == Gdk.EventType.TwoButtonPress) + { + ChangesetDialog dialog = new ChangesetDialog("123"); + dialog.ShowAll(); + int rc = dialog.Run(); + dialog.Destroy(); + } + } + protected void UpdateChildCid(IChangesetViewChild child) { if (child == null) return; @@ -129,7 +142,7 @@ namespace Gtk.TeamFoundation bool detailed = false; IEnumerable changeSets = vcs.QueryHistory(path, VersionSpec.Latest, 0, RecursionType.Full, null, - null, null, stopAfter, detailed, false, false); + null, null, stopAfter, detailed, false, false); foreach (Changeset changeSet in changeSets) { diff --git a/class/Gtk.TeamFoundation/ExploreView.cs b/class/Gtk.TeamFoundation/ExploreView.cs index 9c74750..1f8cfb0 100644 --- a/class/Gtk.TeamFoundation/ExploreView.cs +++ b/class/Gtk.TeamFoundation/ExploreView.cs @@ -68,10 +68,10 @@ namespace Gtk.TeamFoundation viewChildren = new VPaned(); directoryView = new DirectoryView(); - viewChildren.Add(directoryView); + viewChildren.Pack1(directoryView, true, true); changesetView = new ChangesetView(stopAfter); - viewChildren.Add(changesetView); + viewChildren.Pack2(changesetView, true, true); int x, y, width, height, depth; RootWindow.GetGeometry (out x, out y, out width, out height, out depth); diff --git a/class/Gtk.TeamFoundation/Gtk.TeamFoundation.csproj b/class/Gtk.TeamFoundation/Gtk.TeamFoundation.csproj index fecb045..415cf81 100644 --- a/class/Gtk.TeamFoundation/Gtk.TeamFoundation.csproj +++ b/class/Gtk.TeamFoundation/Gtk.TeamFoundation.csproj @@ -29,6 +29,7 @@ + diff --git a/class/Gtk.TeamFoundation/RepositoryView.cs b/class/Gtk.TeamFoundation/RepositoryView.cs index 60bd54b..3a7b6fa 100644 --- a/class/Gtk.TeamFoundation/RepositoryView.cs +++ b/class/Gtk.TeamFoundation/RepositoryView.cs @@ -84,7 +84,7 @@ namespace Gtk.TeamFoundation int indx = 0; ItemSpec itemSpec = new ItemSpec (path, RecursionType.OneLevel); ItemSet itemSet = versionControlServer.GetItems (itemSpec, VersionSpec.Latest, - DeletedState.NonDeleted, ItemType.Any, false); + DeletedState.NonDeleted, ItemType.Folder, false); if (itemSet.Items.Length == 0) SetRowValue(args.Iter, indx, " - item list not available - ", ""); @@ -93,14 +93,9 @@ namespace Gtk.TeamFoundation if (item.ServerItem == path) continue; string shortPath = item.ServerItem.Substring(item.ServerItem.LastIndexOf('/') + 1); - if (item.ItemType == ItemType.Folder) - shortPath += "/"; - Gtk.TreeIter child = SetRowValue(args.Iter, indx, shortPath, item.ServerItem); - if (item.ItemType == ItemType.Folder) - store.AppendValues(child, "", ""); - + store.AppendValues(child, "", ""); indx++; } } -- 2.11.4.GIT