Exemplo n.º 1
0
        protected override void OnFocused()
        {
            info.Start();
            if (ComparisonWidget.originalComboBox.Text == GettextCatalog.GetString("Local"))
            {
                ComparisonWidget.UpdateLocalText();
            }
            var textView = info.Controller.GetContent <ITextView> ();

            if (textView != null)
            {
                var(line, column) = textView.Caret.Position.BufferPosition.GetLineAndColumn1Based();
                ComparisonWidget.OriginalEditor.SetCaretTo(line, column);
            }

            if (ComparisonWidget.Allocation.Height == 1 && ComparisonWidget.Allocation.Width == 1)
            {
                ComparisonWidget.SizeAllocated += HandleComparisonWidgetSizeAllocated;
            }
            else
            {
                HandleComparisonWidgetSizeAllocated(null, new Gtk.SizeAllocatedArgs());
            }

            widget.UpdatePatchView();
        }
Exemplo n.º 2
0
        protected override void OnSelected()
        {
            info.Start();
            ComparisonWidget.UpdateLocalText();
            var buffer = info.Document.GetContent <MonoDevelop.Ide.Editor.TextEditor> ();

            if (buffer != null)
            {
                var loc    = buffer.CaretLocation;
                int line   = loc.Line < 1 ? 1 : loc.Line;
                int column = loc.Column < 1 ? 1 : loc.Column;
                ComparisonWidget.OriginalEditor.SetCaretTo(line, column);
            }

            if (ComparisonWidget.Allocation.Height == 1 && ComparisonWidget.Allocation.Width == 1)
            {
                ComparisonWidget.SizeAllocated += HandleComparisonWidgetSizeAllocated;
            }
            else
            {
                HandleComparisonWidgetSizeAllocated(null, new Gtk.SizeAllocatedArgs());
            }

            widget.UpdatePatchView();
        }
Exemplo n.º 3
0
 public void Selected()
 {
     if (info != null && !info.Started)
     {
         widget.ShowLoading();
         info.Start();
     }
 }
Exemplo n.º 4
0
 public void Init()
 {
     if (info != null && !info.Started)
     {
         LogWidget.ShowLoading();
         info.Start();
     }
 }
Exemplo n.º 5
0
 public void Selected()
 {
     info.Start();
     ComparisonWidget.UpdateLocalText();
     ComparisonWidget.OriginalEditor.Document.IgnoreFoldings = true;
     ComparisonWidget.OriginalEditor.Caret.Location          = info.Document.Editor.Caret.Location;
     ComparisonWidget.OriginalEditor.VAdjustment.Value       = info.Document.Editor.VAdjustment.Value;
     ComparisonWidget.OriginalEditor.GrabFocus();
 }
Exemplo n.º 6
0
        public void Selected()
        {
            info.Start();
            var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();

            if (sourceEditor != null)
            {
                widget.Editor.Caret.Location    = sourceEditor.TextEditor.Caret.Location;
                widget.Editor.VAdjustment.Value = sourceEditor.TextEditor.VAdjustment.Value;
            }
        }
Exemplo n.º 7
0
        protected override void OnSelected()
        {
            info.Start();
            BlameWidget widget = Control.GetNativeWidget <BlameWidget> ();

            widget.Reset();
            var sourceEditor = info.Document.GetContent <MonoDevelop.SourceEditor.SourceEditorView> ();

            if (sourceEditor != null)
            {
                widget.Editor.Caret.Location    = sourceEditor.TextEditor.Caret.Location;
                widget.Editor.VAdjustment.Value = sourceEditor.TextEditor.VAdjustment.Value;
            }
        }
Exemplo n.º 8
0
 public void Selected()
 {
     info.Start();
     ComparisonWidget.UpdateLocalText();
     ComparisonWidget.OriginalEditor.Document.IgnoreFoldings = true;
     ComparisonWidget.OriginalEditor.Caret.Location          = info.Document.Editor.Caret.Location;
     if (ComparisonWidget.Allocation.Height == 1 && ComparisonWidget.Allocation.Width == 1)
     {
         ComparisonWidget.SizeAllocated += HandleComparisonWidgetSizeAllocated;
     }
     else
     {
         HandleComparisonWidgetSizeAllocated(null, new Gtk.SizeAllocatedArgs());
     }
 }
Exemplo n.º 9
0
        protected override void OnSelected()
        {
            info.Start();
            BlameWidget widget = Control.GetNativeWidget <BlameWidget> ();

            widget.Reset();

            var buffer = info.Document.GetContent <MonoDevelop.Ide.Editor.TextEditor> ();

            if (buffer != null)
            {
                var loc    = buffer.CaretLocation;
                int line   = loc.Line < 1 ? 1 : loc.Line;
                int column = loc.Column < 1 ? 1 : loc.Column;
                widget.Editor.SetCaretTo(line, column, highlight: false, centerCaret: false);
            }
        }
Exemplo n.º 10
0
        protected override void OnSelected()
        {
            info.Start();
            BlameWidget blameWidget = Control.GetNativeWidget <BlameWidget> ();

            blameWidget.Reset();
            var buffer = info.Document.GetContent <MonoDevelop.Ide.Editor.TextEditor> ();

            if (buffer != null)
            {
                if (!(buffer.TextView is MonoTextEditor))
                {
                    //compatibility for other not MonoTextEditor editors
                    var loc    = buffer.CaretLocation;
                    int line   = loc.Line < 1 ? 1 : loc.Line;
                    int column = loc.Column < 1 ? 1 : loc.Column;
                    blameWidget.Editor.SetCaretTo(line, column, highlight: false, centerCaret: false);
                }
            }
        }
Exemplo n.º 11
0
        public static void AttachViewContents(Document document, VersionControlItem item)
        {
            IWorkbenchWindow window = document.Window;

            if (window.SubViewContents.Any(sub => sub is ComparisonView))
            {
                return;
            }

            VersionControlDocumentInfo info = new VersionControlDocumentInfo(document, item);

            ComparisonView comparisonView = new ComparisonView(info);

            window.AttachViewContent(comparisonView);
            window.AttachViewContent(new PatchView(comparisonView, info));
            window.AttachViewContent(new BlameView(info));
            window.AttachViewContent(new LogView(info));

            info.Start();
        }
Exemplo n.º 12
0
        protected override void OnFocused()
        {
            info.Start();
            widget.Reset();

            var textView = info.Controller.GetContent <ITextView> ();

            if (textView != null)
            {
                var(line, column) = textView.Caret.Position.BufferPosition.GetLineAndColumn1Based();
                widget.Editor.SetCaretTo(line, column, highlight: false, centerCaret: false);
            }

            if (widget.Allocation.Height == 1 && widget.Allocation.Width == 1)
            {
                widget.SizeAllocated += HandleComparisonWidgetSizeAllocated;
            }
            else
            {
                HandleComparisonWidgetSizeAllocated(null, new Gtk.SizeAllocatedArgs());
            }
        }
Exemplo n.º 13
0
        public void Selected()
        {
            info.Start();
            ComparisonWidget.UpdateLocalText();
            var buffer = info.Document.GetContent <ITextBuffer> ();

            if (buffer != null)
            {
                int line, col;
                buffer.GetLineColumnFromPosition(buffer.CursorPosition, out line, out col);
                ComparisonWidget.OriginalEditor.SetCaretTo(line, col);
            }

            if (ComparisonWidget.Allocation.Height == 1 && ComparisonWidget.Allocation.Width == 1)
            {
                ComparisonWidget.SizeAllocated += HandleComparisonWidgetSizeAllocated;
            }
            else
            {
                HandleComparisonWidgetSizeAllocated(null, new Gtk.SizeAllocatedArgs());
            }
        }
Exemplo n.º 14
0
 void RefreshClicked(object src, EventArgs args)
 {
     ShowLoading();
     info.Start(true);
     revertButton.GetNativeWidget <Gtk.Widget> ().Sensitive = revertToButton.GetNativeWidget <Gtk.Widget> ().Sensitive = false;
 }
Exemplo n.º 15
0
		void RefreshClicked (object src, EventArgs args)
		{
			ShowLoading ();
			info.Start (true);
		}
Exemplo n.º 16
0
 public void Selected()
 {
     info.Start();
     widget.Editor.Caret.Location    = info.Document.Editor.Caret.Location;
     widget.Editor.VAdjustment.Value = info.Document.Editor.VAdjustment.Value;
 }
Exemplo n.º 17
0
		public static void AttachViewContents (Document document, VersionControlItem item)
		{
			IWorkbenchWindow window = document.Window;
			if (window.SubViewContents.Any (sub => sub is ComparisonView))
				return;
			
			VersionControlDocumentInfo info = new VersionControlDocumentInfo (document, item);
			
			ComparisonView comparisonView = new ComparisonView (info);
			window.AttachViewContent (comparisonView);
			window.AttachViewContent (new PatchView (comparisonView, info));
			window.AttachViewContent (new BlameView (info));
			window.AttachViewContent (new LogView (info));
			
			info.Start ();
		}