Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main/src
diff options
context:
space:
mode:
Diffstat (limited to 'main/src')
-rw-r--r--main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj1
-rw-r--r--main/src/addins/AspNet/Tests/WebForms/WebFormsSyntaxModeTests.cs66
-rw-r--r--main/src/addins/AspNet/WebForms/WebFormsSyntaxMode.cs10
-rw-r--r--main/src/addins/CBinding/CBinding.Autotools/CBinding.Autotools.csproj2
-rw-r--r--main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs3
-rw-r--r--main/src/addins/CSharpBinding/AddinInfo.cs1
-rw-r--r--main/src/addins/CSharpBinding/Autotools/Autotools.csproj2
-rw-r--r--main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs2
-rw-r--r--main/src/addins/CSharpBinding/templates/PortableLibrary.xpt.xml2
-rw-r--r--main/src/addins/CSharpBinding/templates/SharedAssetsProject.xpt.xml2
-rw-r--r--main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj1
-rw-r--r--main/src/addins/MacPlatform/Dialogs/MacAddFileDialogHandler.cs3
-rw-r--r--main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs14
-rw-r--r--main/src/addins/MacPlatform/Dialogs/MacSelectFileDialogHandler.cs13
-rw-r--r--main/src/addins/MacPlatform/MacPlatform.cs4
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs162
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/SelectorView.cs211
-rw-r--r--main/src/addins/MacPlatform/MainToolbar/StatusBar.cs65
-rw-r--r--main/src/addins/MacPlatform/icons/build.pngbin326 -> 1460 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/build@2x.pngbin387 -> 1642 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/continue.pngbin349 -> 1470 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/continue@2x.pngbin389 -> 1646 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/device.pngbin228 -> 1302 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/device@2x.pngbin261 -> 1416 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/project.pngbin241 -> 1319 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/project@2x.pngbin254 -> 1397 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/stop.pngbin210 -> 1261 bytes
-rw-r--r--main/src/addins/MacPlatform/icons/stop@2x.pngbin209 -> 1283 bytes
-rw-r--r--main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs12
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.NonUserCodeTestLib/MonoDevelop.Debugger.Tests.NonUserCodeTestLib.csproj3
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj1
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BusyEvaluatorDialog.cs13
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs69
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs5
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs1
-rw-r--r--main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs2
-rw-r--r--main/src/addins/MonoDevelop.Debugger/gtk-gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs110
-rw-r--r--main/src/addins/MonoDevelop.Debugger/gtk-gui/MonoDevelop.Debugger.DebuggerOptionsPanelWidget.cs187
-rw-r--r--main/src/addins/MonoDevelop.Debugger/gtk-gui/generated.cs64
-rw-r--r--main/src/addins/MonoDevelop.Debugger/gtk-gui/gui.stetic277
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs30
-rw-r--r--main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs160
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj4
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Misc.cs5
-rw-r--r--main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageManagementStartupHandler.cs4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackage.cs9
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSettings.cs30
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableCheckForUpdatesTaskRunner.cs (renamed from main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/TestableCheckForUpdatesTaskRunner.cs)28
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj6
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/CheckForUpdatesProgressMonitorTests.cs148
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MinClientVersionTests.cs69
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFromRepositoryTests.cs13
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsTests.cs42
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesInSolutionTests.cs84
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj4
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/BackgroundPackageActionRunner.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesProgressMonitor.cs104
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTask.cs12
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTaskRunner.cs40
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs5
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEventsMonitor.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs (renamed from main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableCheckForUpdatesProgressMonitor.cs)92
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoreRunner.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestorer.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageUpdatesEventMonitor.cs73
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs9
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs2
-rw-r--r--main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsProvider.cs2
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs5
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs2
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs1
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml4
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj1
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs48
-rw-r--r--main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs72
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs50
-rw-r--r--main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj2
-rw-r--r--main/src/addins/MonoDeveloperExtensions/NUnit/NUnit.csproj5
-rw-r--r--main/src/addins/NUnit/Commands/NUnitCommands.cs3
-rw-r--r--main/src/addins/NUnit/Gui/TestResultsPad.cs40
-rw-r--r--main/src/addins/NUnit/MonoDevelop.NUnit.csproj2
-rw-r--r--main/src/addins/NUnit/MonoDevelopNUnit.addin.xml2
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating.Tests/GenerateIndentedClassCodeTests.cs108
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj1
-rw-r--r--main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplatingEngine.cs29
-rw-r--r--main/src/addins/TextTemplating/TextTransform/TextTransform.csproj1
-rw-r--r--main/src/addins/VBNetBinding/VBNetBinding.csproj2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs34
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs8
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/GitIntegrityTests.cs27
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj3
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj5
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditRemoteDialog.cs21
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtension.cs16
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs105
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs163
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs7
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs6
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/TfsSmartSubtransport.cs13
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs5
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix.csproj2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs18
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs3
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs5
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs7
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs19
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/VersionControlDocumentInfo.cs6
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ChangeLogWriter.cs1
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs41
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitDialogExtension.cs5
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IgnoreCommand.cs4
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LockCommand.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs5
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs14
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertRevisionsCommands.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnlockCommand.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UpdateCommand.cs2
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlItem.cs13
-rw-r--r--main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs28
-rw-r--r--main/src/addins/VersionControl/Subversion.Win32.Tests/RepositoryTests.cs16
-rw-r--r--main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs17
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs4
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs3
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/SelectFileDialogHandler.cs4
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj2
-rw-r--r--main/src/addins/Xml/Properties/MonoDevelop.XmlEditor.addin.xml1
-rw-r--r--main/src/addins/Xml/Tests/MonoDevelop.Xml.Tests.csproj1
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs16
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs2
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs36
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs14
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs4
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs2
-rw-r--r--main/src/core/Mono.Texteditor/SyntaxModes/XmlSyntaxMode.xml15
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs5
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/TimeCounter.cs13
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.Logging/FileLogger.cs4
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs11
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs4
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Core/SystemInformation.cs11
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs14
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyService.cs5
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFormatter.cs10
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs16
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectConfiguration.cs2
-rw-r--r--main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/Commands.addin.xml35
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/MainMenu.addin.xml11
-rw-r--r--main/src/core/MonoDevelop.Ide/ExtensionModel/Templates.addin.xml4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs29
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs39
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs52
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs15
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs32
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs296
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs64
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs13
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs8
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ISelectFileDialog.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainStatusBarContextImpl.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs29
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs112
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarModels.cs57
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FilePathEditor.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditor.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs14
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs60
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileEntry.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileSelector.cs12
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FolderDialog.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFileDialog.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFolderDialog.cs6
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs142
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWin32Interop.cs118
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs21
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs42
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ToolsCommands.cs63
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs43
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs166
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs21
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs5
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs54
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs3
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs39
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddFileDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs4
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs2
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs29
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs41
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs640
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplateCategorizer.cs7
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerationService.cs23
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs9
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj47
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs20
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs10
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs11
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v14.0.cs9
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.csproj1
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v14.0.csproj69
-rw-r--r--main/src/core/MonoDevelop.Projects.Formats.MSBuild/app.v14.0.config16
-rw-r--r--main/src/core/MonoDevelop.Startup/MonoDevelop.Startup.csproj12
-rw-r--r--main/src/core/MonoDevelop.Startup/app.config5
-rw-r--r--main/src/core/MonoDevelop.Startup/app.manifest54
-rw-r--r--main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj1
-rw-r--r--main/src/tools/mdmonitor/InstrumentationViewerDialog.cs2
239 files changed, 3756 insertions, 2500 deletions
diff --git a/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj b/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj
index cdde498cdf..32b81dba69 100644
--- a/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj
+++ b/main/src/addins/AspNet/Tests/MonoDevelop.AspNet.Tests.csproj
@@ -55,6 +55,7 @@
<Compile Include="Razor\RazorCompletionTests.cs" />
<Compile Include="Html\HtmlParsingTests.cs" />
<Compile Include="Html\HtmlImplicitClosingTests.cs" />
+ <Compile Include="WebForms\WebFormsSyntaxModeTests.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
diff --git a/main/src/addins/AspNet/Tests/WebForms/WebFormsSyntaxModeTests.cs b/main/src/addins/AspNet/Tests/WebForms/WebFormsSyntaxModeTests.cs
new file mode 100644
index 0000000000..3018f97c46
--- /dev/null
+++ b/main/src/addins/AspNet/Tests/WebForms/WebFormsSyntaxModeTests.cs
@@ -0,0 +1,66 @@
+//
+// WebFormsSyntaxModeTests.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.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.Linq;
+using NUnit.Framework;
+using Mono.TextEditor;
+using Mono.TextEditor.Highlighting;
+using MonoDevelop.AspNet.WebForms;
+
+namespace MonoDevelop.AspNet.Tests.WebForms
+{
+ [TestFixture]
+ class WebFormsSyntaxModeTests
+ {
+ [Test]
+ public void InvalidMimeTypeInScriptTypeAttribute ()
+ {
+ var doc = new TextDocument ();
+ var syntaxMode = new WebFormsSyntaxMode ();
+ syntaxMode.Document = doc;
+ doc.Text =
+@"<%@ Page Language=""C#"" Inherits=""AspnetTest.Default"" %>
+<!DOCTYPE html>
+<html>
+<head runat=""server"">
+ <title>Default</title>
+</head>
+<body>
+ <form id=""form1"" runat=""server"">
+ <asp:Button id=""button1"" runat=""server"" Text=""Click me!"" OnClick=""button1Clicked"" />
+ </form>
+ <script type=""></script>
+</body>
+</html>
+";
+ var style = new ColorScheme ();
+ foreach (DocumentLine line in doc.Lines) {
+ Assert.DoesNotThrow (() => syntaxMode.GetChunks (style, line, line.Offset, line.Length).ToList ());
+ }
+ }
+ }
+}
+
diff --git a/main/src/addins/AspNet/WebForms/WebFormsSyntaxMode.cs b/main/src/addins/AspNet/WebForms/WebFormsSyntaxMode.cs
index fb7261cf2a..44942b8354 100644
--- a/main/src/addins/AspNet/WebForms/WebFormsSyntaxMode.cs
+++ b/main/src/addins/AspNet/WebForms/WebFormsSyntaxMode.cs
@@ -24,9 +24,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using MonoDevelop.Core;
using Mono.TextEditor;
using Mono.TextEditor.Highlighting;
using MonoDevelop.AspNet.WebForms.Parser;
@@ -174,8 +176,12 @@ namespace MonoDevelop.AspNet.WebForms
if (mime != null) {
CodeDeclarationSpan span = new CodeDeclarationSpan (mime);
- FoundSpanBegin (span, i, 0);
- return true;
+ try {
+ FoundSpanBegin (span, i, 0);
+ return true;
+ } catch (Exception ex) {
+ LoggingService.LogInternalError (ex);
+ }
}
}
}
diff --git a/main/src/addins/CBinding/CBinding.Autotools/CBinding.Autotools.csproj b/main/src/addins/CBinding/CBinding.Autotools/CBinding.Autotools.csproj
index 9a1b28c5ed..5cb50bacca 100644
--- a/main/src/addins/CBinding/CBinding.Autotools/CBinding.Autotools.csproj
+++ b/main/src/addins/CBinding/CBinding.Autotools/CBinding.Autotools.csproj
@@ -14,7 +14,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
- <Optimize>True</Optimize>
+ <Optimize>false</Optimize>
<OutputPath>..\..\..\..\build\AddIns\BackendBindings\</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
diff --git a/main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs b/main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs
index 1b8fa5ed30..5187231f59 100644
--- a/main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs
+++ b/main/src/addins/CBinding/Gui/GeneralOptionsPanel.cs
@@ -36,6 +36,7 @@ using Mono.Addins;
using MonoDevelop.Core;
using MonoDevelop.Ide.Gui.Dialogs;
+using MonoDevelop.Components;
namespace CBinding
{
@@ -173,7 +174,7 @@ namespace CBinding
protected virtual void OnCtagsBrowseClicked (object sender, System.EventArgs e)
{
- OpenFileDialog dialog = new OpenFileDialog (GettextCatalog.GetString ("Choose ctags executable"), Gtk.FileChooserAction.Open);
+ OpenFileDialog dialog = new OpenFileDialog (GettextCatalog.GetString ("Choose ctags executable"), FileChooserAction.Open);
if (dialog.Run ())
ctagsEntry.Text = dialog.SelectedFile;
}
diff --git a/main/src/addins/CSharpBinding/AddinInfo.cs b/main/src/addins/CSharpBinding/AddinInfo.cs
index 2b9deee4f4..90e1d63e5c 100644
--- a/main/src/addins/CSharpBinding/AddinInfo.cs
+++ b/main/src/addins/CSharpBinding/AddinInfo.cs
@@ -15,6 +15,7 @@ using Mono.Addins.Description;
[assembly:AddinDependency ("Ide", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("Refactoring", MonoDevelop.BuildInfo.Version)]
[assembly:AddinDependency ("SourceEditor2", MonoDevelop.BuildInfo.Version)]
+[assembly:AddinDependency ("NUnit", MonoDevelop.BuildInfo.Version)]
// Submodules
[assembly:AddinModule ("MonoDevelop.CSharpBinding.Autotools.dll")]
diff --git a/main/src/addins/CSharpBinding/Autotools/Autotools.csproj b/main/src/addins/CSharpBinding/Autotools/Autotools.csproj
index 5bcda79d90..c6e075378a 100644
--- a/main/src/addins/CSharpBinding/Autotools/Autotools.csproj
+++ b/main/src/addins/CSharpBinding/Autotools/Autotools.csproj
@@ -37,8 +37,8 @@
<Execution clr-version="Net_2_0" />
</Execution>
<DebugSymbols>true</DebugSymbols>
- <DefineConstants>1591</DefineConstants>
<DocumentationFile>..\..\..\..\build\AddIns\BackendBindings\MonoDevelop.CSharpBinding.Autotools.xml</DocumentationFile>
+ <NoWarn>1591;1573</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\MonoDevelop.Autotools\MonoDevelop.Autotools.csproj">
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs
index aa6e7a7ce4..008f06c026 100644
--- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs
+++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Refactoring.CodeActions/MDRefactoringScript.cs
@@ -162,7 +162,7 @@ namespace MonoDevelop.CSharp.Refactoring.CodeActions
var tcs = new TaskCompletionSource<Script>();
if (parentType == null)
return tcs.Task;
- var part = parentType.Parts.FirstOrDefault ();
+ var part = MonoDevelop.Ide.TypeSystem.CodeGenerationService.FindCurrentPart(parentType);
if (part == null)
return tcs.Task;
diff --git a/main/src/addins/CSharpBinding/templates/PortableLibrary.xpt.xml b/main/src/addins/CSharpBinding/templates/PortableLibrary.xpt.xml
index 82e17f6c04..f09a65c7f1 100644
--- a/main/src/addins/CSharpBinding/templates/PortableLibrary.xpt.xml
+++ b/main/src/addins/CSharpBinding/templates/PortableLibrary.xpt.xml
@@ -6,7 +6,7 @@
<!-- Template Header -->
<TemplateConfiguration>
<_Name>Portable Library</_Name>
- <Category>crossplat/library/general</Category>
+ <Category>multiplat/library/general</Category>
<Icon>md-project-library</Icon>
<Image id="md-pcl-project" />
<LanguageName>C#</LanguageName>
diff --git a/main/src/addins/CSharpBinding/templates/SharedAssetsProject.xpt.xml b/main/src/addins/CSharpBinding/templates/SharedAssetsProject.xpt.xml
index ad48a9b358..6f2f0a7584 100644
--- a/main/src/addins/CSharpBinding/templates/SharedAssetsProject.xpt.xml
+++ b/main/src/addins/CSharpBinding/templates/SharedAssetsProject.xpt.xml
@@ -6,7 +6,7 @@
<!-- Template Header -->
<TemplateConfiguration>
<_Name>Shared Project</_Name>
- <Category>crossplat/library/general</Category>
+ <Category>multiplat/library/general</Category>
<Icon>md-project-shared-assets</Icon>
<Image id="md-shared-project" />
<_Description>Creates a project that allows sharing files between projects</_Description>
diff --git a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj
index 511567e76c..6950d93dc2 100644
--- a/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj
+++ b/main/src/addins/Deployment/MonoDevelop.Deployment/MonoDevelop.Deployment.csproj
@@ -24,6 +24,7 @@
<DefineConstants>DEBUG</DefineConstants>
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>..\..\..\..\build\AddIns\MonoDevelop.Deployment\MonoDevelop.Deployment.xml</DocumentationFile>
+ <DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
diff --git a/main/src/addins/MacPlatform/Dialogs/MacAddFileDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacAddFileDialogHandler.cs
index 87c62c87c9..fb0e5fe557 100644
--- a/main/src/addins/MacPlatform/Dialogs/MacAddFileDialogHandler.cs
+++ b/main/src/addins/MacPlatform/Dialogs/MacAddFileDialogHandler.cs
@@ -60,7 +60,8 @@ namespace MonoDevelop.MacIntegration
};
box.Layout ();
panel.AccessoryView = box.View;
- box.Layout (box.View.Superview.Frame.Size);
+ if (box.View.Superview != null)
+ box.Layout (box.View.Superview.Frame.Size);
} else {
dropdownBox.Layout ();
panel.AccessoryView = dropdownBox.View;
diff --git a/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs
index 71d22d6965..5dca5957c8 100644
--- a/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs
+++ b/main/src/addins/MacPlatform/Dialogs/MacOpenFileDialogHandler.cs
@@ -31,6 +31,7 @@ using System.Text;
using AppKit;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Extensions;
@@ -47,15 +48,12 @@ namespace MonoDevelop.MacIntegration
NSSavePanel panel = null;
try {
- bool directoryMode = data.Action != Gtk.FileChooserAction.Open
- && data.Action != Gtk.FileChooserAction.Save;
-
- if (data.Action == Gtk.FileChooserAction.Save) {
+ if (data.Action == FileChooserAction.Save) {
panel = new NSSavePanel ();
} else {
panel = new NSOpenPanel {
- CanChooseDirectories = directoryMode,
- CanChooseFiles = !directoryMode,
+ CanChooseDirectories = (data.Action & FileChooserAction.FolderFlags) != 0,
+ CanChooseFiles = (data.Action & FileChooserAction.FileFlags) != 0,
};
}
@@ -70,7 +68,7 @@ namespace MonoDevelop.MacIntegration
List<FileViewer> currentViewers = null;
var labels = new List<MDAlignment> ();
- if (!directoryMode) {
+ if ((data.Action & FileChooserAction.FileFlags) != 0) {
var filterPopup = MacSelectFileDialogHandler.CreateFileFilterPopup (data, panel);
if (filterPopup != null) {
@@ -84,7 +82,7 @@ namespace MonoDevelop.MacIntegration
}
if (data.ShowEncodingSelector) {
- encodingSelector = new SelectEncodingPopUpButton (data.Action != Gtk.FileChooserAction.Save);
+ encodingSelector = new SelectEncodingPopUpButton (data.Action != FileChooserAction.Save);
encodingSelector.SelectedEncodingId = data.Encoding != null ? data.Encoding.CodePage : 0;
var encodingLabel = new MDAlignment (new MDLabel (GettextCatalog.GetString ("Encoding:")), true);
diff --git a/main/src/addins/MacPlatform/Dialogs/MacSelectFileDialogHandler.cs b/main/src/addins/MacPlatform/Dialogs/MacSelectFileDialogHandler.cs
index 9355e85bda..fa9914aab5 100644
--- a/main/src/addins/MacPlatform/Dialogs/MacSelectFileDialogHandler.cs
+++ b/main/src/addins/MacPlatform/Dialogs/MacSelectFileDialogHandler.cs
@@ -34,6 +34,7 @@ using Foundation;
using CoreGraphics;
using AppKit;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide;
using MonoDevelop.Components.Extensions;
@@ -48,21 +49,19 @@ namespace MonoDevelop.MacIntegration
NSSavePanel panel = null;
try {
- bool directoryMode = data.Action != Gtk.FileChooserAction.Open;
-
- if (data.Action == Gtk.FileChooserAction.Save) {
+ if (data.Action == FileChooserAction.Save) {
panel = new NSSavePanel ();
} else {
panel = new NSOpenPanel {
- CanChooseDirectories = directoryMode,
- CanChooseFiles = !directoryMode,
+ CanChooseDirectories = (data.Action & FileChooserAction.FolderFlags) != 0,
+ CanChooseFiles = (data.Action & FileChooserAction.FileFlags) != 0,
ResolvesAliases = false,
};
}
SetCommonPanelProperties (data, panel);
- if (!directoryMode) {
+ if ((data.Action & FileChooserAction.FileFlags) != 0) {
var popup = CreateFileFilterPopup (data, panel);
if (popup != null) {
panel.AccessoryView = popup;
@@ -107,7 +106,7 @@ namespace MonoDevelop.MacIntegration
if (!string.IsNullOrEmpty (data.CurrentFolder))
panel.DirectoryUrl = new NSUrl (data.CurrentFolder, true);
- panel.ParentWindow = NSApplication.SharedApplication.KeyWindow;
+ panel.ParentWindow = NSApplication.SharedApplication.KeyWindow ?? NSApplication.SharedApplication.MainWindow;
var openPanel = panel as NSOpenPanel;
if (openPanel != null) {
diff --git a/main/src/addins/MacPlatform/MacPlatform.cs b/main/src/addins/MacPlatform/MacPlatform.cs
index 5777cdddfa..203f239de5 100644
--- a/main/src/addins/MacPlatform/MacPlatform.cs
+++ b/main/src/addins/MacPlatform/MacPlatform.cs
@@ -791,10 +791,12 @@ namespace MonoDevelop.MacIntegration
// When we're looking for modal windows that don't belong to GTK, exclude
// NSStatusBarWindow (which is visible on Mavericks when we're in fullscreen) and
// NSToolbarFullscreenWindow (which is visible on Yosemite in fullscreen).
+ // _NSFullScreenTileDividerWindow (which is visible on El Capitan when two apps share the same fullscreen).
return toplevels.Any (t => t.Key.IsVisible && (t.Value == null || t.Value.Modal) &&
!(t.Key.DebugDescription.StartsWith("<NSStatusBarWindow", StringComparison.Ordinal) ||
t.Key.DebugDescription.StartsWith ("<NSToolbarFullScreenWindow", StringComparison.Ordinal) ||
- t.Key.DebugDescription.StartsWith ("<NSCarbonMenuWindow", StringComparison.Ordinal)
+ t.Key.DebugDescription.StartsWith ("<NSCarbonMenuWindow", StringComparison.Ordinal) ||
+ t.Key.DebugDescription.StartsWith ("<_NSFullScreenTileDividerWindow", StringComparison.Ordinal)
));
}
diff --git a/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs b/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs
index edeabb1070..cd14af52ea 100644
--- a/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/MainToolbar.cs
@@ -33,6 +33,7 @@ using AppKit;
using CoreGraphics;
using Foundation;
using MonoDevelop.Ide;
+using Xwt;
namespace MonoDevelop.MacIntegration.MainToolbar
{
@@ -66,6 +67,10 @@ namespace MonoDevelop.MacIntegration.MainToolbar
}
int selectorIdx;
+ SelectorView selector {
+ get { return (SelectorView)widget.Items[selectorIdx].View; }
+ }
+
SelectorView.PathSelectorView selectorView {
get { return (SelectorView.PathSelectorView)widget.Items[selectorIdx].View.Subviews [0]; }
}
@@ -96,6 +101,35 @@ namespace MonoDevelop.MacIntegration.MainToolbar
return item;
}
+ OverflowInfoEventArgs FillOverflowInfo (OverflowInfoEventArgs e)
+ {
+ var visibleItems = widget.VisibleItems;
+ var allItems = widget.Items;
+
+ e.WindowWidth = gtkWindow.Allocation.Width;
+ foreach (var iter in allItems) {
+ e.AllItemsWidth += iter.MinSize.Width;
+ if (!visibleItems.Contains (iter))
+ e.ItemsInOverflowWidth += iter.MinSize.Width;
+ }
+ // Add spacings.
+ nfloat spacing = (allItems.Length - 1) * 16;
+ e.AllItemsWidth += spacing;
+
+ return e;
+ }
+
+ bool IsCorrectNotification (NSView view, NSObject notifObject)
+ {
+ var window = selector.Window;
+
+ // Skip updates with a null Window. Only crashes on Mavericks.
+ // The View gets updated once again when the window resize finishes.
+ // We're getting notified about all windows in the application (for example, NSPopovers) that change size when really we only care about
+ // the window the bar is in.
+ return window != null && notifObject == window;
+ }
+
NSToolbarItem CreateSelectorToolbarItem ()
{
var selector = new SelectorView ();
@@ -109,6 +143,43 @@ namespace MonoDevelop.MacIntegration.MainToolbar
item.MinSize = item.MaxSize = e.Size;
centeringSpace.UpdateWidth ();
};
+ selector.OverflowInfoRequested += (o, e) => {
+ FillOverflowInfo (e);
+ };
+
+ IDisposable resizeTimer = null;
+ NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.WillStartLiveResizeNotification, notif => DispatchService.GuiDispatch (() => {
+ if (!IsCorrectNotification (selector, notif.Object))
+ return;
+
+ if (resizeTimer != null)
+ resizeTimer.Dispose ();
+
+ resizeTimer = Application.TimeoutInvoke (100, () => {
+ if (widget.Items.Length != widget.VisibleItems.Length)
+ selector.RequestResize ();
+ return true;
+ });
+ }));
+
+ NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResizeNotification, notif => DispatchService.GuiDispatch (() => {
+ if (!IsCorrectNotification (selector, notif.Object))
+ return;
+
+ // Don't check difference in overflow menus. This could cause issues since we're doing resizing of widgets and the views might go in front
+ // or behind while we're doing the resize request.
+ selector.RequestResize ();
+ }));
+
+ NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidEndLiveResizeNotification, notif => DispatchService.GuiDispatch (() => {
+ if (!IsCorrectNotification (selector, notif.Object))
+ return;
+
+ if (resizeTimer != null)
+ resizeTimer.Dispose ();
+
+ resizeTimer = Application.TimeoutInvoke (300, selector.RequestResize);
+ }));
var pathSelector = (SelectorView.PathSelectorView)selector.Subviews [0];
pathSelector.ConfigurationChanged += (sender, e) => {
@@ -143,6 +214,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
nfloat resize = 6 + 33 * bar.SegmentCount;
item.MinSize = new CGSize (resize, bar.FittingSize.Height);
item.MaxSize = new CGSize (resize, bar.FittingSize.Height);
+ selector.RequestResize ();
centeringSpace.UpdateWidth ();
};
return item;
@@ -181,15 +253,9 @@ namespace MonoDevelop.MacIntegration.MainToolbar
bar.GainedFocus += (o, e) => IdeApp.Workbench.RootWindow.Focus = null;
viewCache.Add (bar);
- var menuBar = new SearchBar {
- Frame = new CGRect (0, 0, 180, bar.FittingSize.Height),
- };
var item = new NSToolbarItem (SearchBarId) {
View = bar,
- MenuFormRepresentation = new NSMenuItem {
- View = menuBar,
- },
- MinSize = new CGSize (180, bar.FittingSize.Height),
+ MinSize = new CGSize (150, bar.FittingSize.Height),
MaxSize = new CGSize (270, bar.FittingSize.Height),
};
AttachToolbarEvents (bar);
@@ -207,18 +273,26 @@ namespace MonoDevelop.MacIntegration.MainToolbar
MaxSize = new CGSize (360, 22),
};
- NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResizeNotification, notif => DispatchService.GuiDispatch (() => {
+ Action<NSNotification> resizeAction = notif => DispatchService.GuiDispatch (() => {
// Skip updates with a null Window. Only crashes on Mavericks.
// The View gets updated once again when the window resize finishes.
if (bar.Window == null)
return;
+ // We're getting notified about all windows in the application (for example, NSPopovers) that change size when really we only care about
+ // the window the bar is in.
+ if (notif.Object != bar.Window)
+ return;
+
double maxSize = Math.Round (bar.Window.Frame.Width * 0.30f);
double minSize = Math.Round (bar.Window.Frame.Width * 0.25f);
- item.MinSize = new CGSize ((nfloat)Math.Max (280, minSize), 22);
+ item.MinSize = new CGSize ((nfloat)Math.Max (220, minSize), 22);
item.MaxSize = new CGSize ((nfloat)Math.Min (700, maxSize), 22);
bar.RepositionStatusLayers ();
- }));
+ });
+
+ NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidResizeNotification, resizeAction);
+ NSNotificationCenter.DefaultCenter.AddObserver (NSWindow.DidEndLiveResizeNotification, resizeAction);
return item;
}
@@ -279,32 +353,12 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public event EventHandler SearchEntryResized;
#pragma warning restore 0067
- bool IsSearchEntryInOverflow {
- get { return widget.Items.Length != widget.VisibleItems.Length; }
- }
-
public void FocusSearchBar ()
{
searchEntry.Focus ();
var entry = searchEntry;
- if (!IsSearchEntryInOverflow)
- entry.SelectText (entry);
- else {
- // NSSearchField -> NSToolbarItemViewer -> _NSToolbarClipView -> NSToolbarView -> NSToolbarClippedItemsIndicator
- var clipItem = (NSButton)searchEntry.Superview.Superview.Superview.Subviews [1];
- var sel = new ObjCRuntime.Selector ("_computeMenuForClippedItemsIfNeeded");
- if (!clipItem.RespondsToSelector (sel))
- throw new Exception ("Cocoa selector changed for clipped items menu.");
-
- clipItem.PerformSelector (sel);
- var menu = clipItem.Menu;
- var searchItem = menu.ItemAt (0);
- var searchView = (SearchBar)searchItem.View;
- AttachToolbarEvents (searchView);
- menu.PopUpMenu (menu.ItemAt (0), new CGPoint (0, -5), clipItem);
- searchView.SelectText (searchView);
- }
+ entry.SelectText (entry);
}
List<IButtonBarButton> barItems = new List<IButtonBarButton> ();
@@ -404,44 +458,10 @@ namespace MonoDevelop.MacIntegration.MainToolbar
public string SearchText {
get {
- if (!IsSearchEntryInOverflow) {
- return searchEntry.StringValue;
- }
-
- // NSSearchField -> NSToolbarItemViewer -> _NSToolbarClipView -> NSToolbarView -> NSToolbarClippedItemsIndicator
- var clipItem = (NSButton)searchEntry.Superview.Superview.Superview.Subviews [1];
- var sel = new ObjCRuntime.Selector ("_computeMenuForClippedItemsIfNeeded");
- if (!clipItem.RespondsToSelector (sel))
- throw new Exception ("Cocoa selector changed for clipped items menu.");
-
- clipItem.PerformSelector (sel);
-
- var menuBar = (SearchBar)clipItem.Menu.ItemAt (0).View;
- AttachToolbarEvents (menuBar);
- return menuBar.StringValue;
+ return searchEntry.StringValue;
}
set {
- if (!IsSearchEntryInOverflow) {
- searchEntry.StringValue = value;
- return;
- }
-
- // NSSearchField -> NSToolbarItemViewer -> _NSToolbarClipView -> NSToolbarView -> NSToolbarClippedItemsIndicator
- var clipItem = (NSButton)searchEntry.Superview.Superview.Superview.Subviews [1];
- var sel = new ObjCRuntime.Selector ("_computeMenuForClippedItemsIfNeeded");
- if (!clipItem.RespondsToSelector (sel))
- throw new Exception ("Cocoa selector changed for clipped items menu.");
-
- clipItem.PerformSelector (sel);
-
- foreach (NSMenuItem item in clipItem.Menu.ItemArray ()) {
- if (item.View is SearchBar) {
- var menuBar = (SearchBar)item.View;
- AttachToolbarEvents (menuBar);
- menuBar.StringValue = value;
- break;
- }
- }
+ searchEntry.StringValue = value;
}
}
@@ -464,8 +484,12 @@ namespace MonoDevelop.MacIntegration.MainToolbar
var workbenchNsWindow = nsWindows.FirstOrDefault (nswin =>
GtkMacInterop.GetGtkWindow (nswin) is MonoDevelop.Ide.Gui.DefaultWorkbench);
- widget.Allocation = new Gdk.Rectangle (0, (int)(fullscreenToolbarNsWindow.Frame.Bottom - workbenchNsWindow.Frame.Height),
- (int)fullscreenToolbarNsWindow.Frame.Width, 0);
+ // Gtk and Cocoa coordinates are not the same. Offset by left and top screens to get the correct
+ // coordinate for the popup window based on Cocoa coordinates which offset left/top from current desktop.
+ nfloat xOffset = -NSScreen.Screens.Min (screen => screen.Frame.Left);
+ nfloat yOffset = NSScreen.Screens.Max (screen => screen.Frame.Bottom);
+ widget.Allocation = new Gdk.Rectangle (0, (int)(yOffset - workbenchNsWindow.Frame.Height),
+ (int)(xOffset + fullscreenToolbarNsWindow.Frame.Width), 0);
}
return widget;
}
diff --git a/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs b/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs
index f61007805d..21b7f938d0 100644
--- a/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/SelectorView.cs
@@ -45,10 +45,18 @@ namespace MonoDevelop.MacIntegration.MainToolbar
}
}
+ class OverflowInfoEventArgs : EventArgs
+ {
+ public nfloat WindowWidth { get; set; }
+ public nfloat AllItemsWidth { get; set; }
+ public nfloat ItemsInOverflowWidth { get; set; }
+ }
+
[Register]
class SelectorView : NSButton
{
public event EventHandler<SizeRequestedEventArgs> ResizeRequested;
+ public event EventHandler<OverflowInfoEventArgs> OverflowInfoRequested;
internal const int ConfigurationIdx = 0;
internal const int RuntimeIdx = 1;
@@ -56,31 +64,109 @@ namespace MonoDevelop.MacIntegration.MainToolbar
{
Title = "";
BezelStyle = NSBezelStyle.TexturedRounded;
- AddSubview (new PathSelectorView (new CGRect (6, 0, 1, 1)));
+ var pathSelectorView = new PathSelectorView (new CGRect (6, 0, 1, 1));
+ pathSelectorView.UnregisterDraggedTypes ();
+ AddSubview (pathSelectorView);
+ }
+
+ public bool RequestResize ()
+ {
+ var p = (PathSelectorView)Subviews [0];
+ var overflowInfo = new OverflowInfoEventArgs ();
+ if (OverflowInfoRequested != null)
+ OverflowInfoRequested (this, overflowInfo);
+
+ var size = new CGSize (p.ResizeIfNeeded (overflowInfo), Frame.Height);
+
+ if (size != Frame.Size) {
+ if (ResizeRequested != null)
+ ResizeRequested (this, new SizeRequestedEventArgs (size));
+
+ SetFrameSize (size);
+ p.SetFrameSize (size);
+
+ SetNeedsDisplay ();
+ p.SetNeedsDisplay ();
+ return true;
+ }
+ return false;
}
- public override void DrawRect (CGRect dirtyRect)
+ public override void ViewWillDraw ()
{
- var p = (NSPathControl)Subviews [0];
- var size = new CGSize (10 +
- p.PathComponentCells [ConfigurationIdx].CellSize.Width +
- p.PathComponentCells [RuntimeIdx].CellSize.Width + p.Frame.Left,
- Frame.Size.Height);
- if (ResizeRequested != null)
- ResizeRequested (this, new SizeRequestedEventArgs (size));
-
- SetFrameSize (size);
- p.SetFrameSize (size);
- p.SetNeedsDisplay ();
- base.DrawRect (new CGRect (CGPoint.Empty, size));
+ RequestResize ();
+ base.ViewWillDraw ();
}
#region PathSelectorView
[Register]
public class PathSelectorView : NSPathControl
{
+ [Flags]
+ enum CellState
+ {
+ AllHidden = 0x0,
+ RuntimeShown = 0x1,
+ ConfigurationShown = 0x2,
+ AllShown = 0x3,
+ }
+
static readonly string ConfigurationPlaceholder = GettextCatalog.GetString ("Default");
static readonly string RuntimePlaceholder = GettextCatalog.GetString ("Default");
+ CellState state = CellState.AllShown;
+
+ nfloat UpdatePathCellForSize (int idx, nfloat remaining, CellState newStateIfEnoughSize)
+ {
+ var cell = PathComponentCells [idx];
+ string text;
+ if (idx == ConfigurationIdx) {
+ if (ActiveConfiguration != null)
+ text = ActiveConfiguration.DisplayString;
+ else
+ text = ConfigurationPlaceholder;
+ } else {
+ if (ActiveRuntime != null) {
+ using (var mutableModel = ActiveRuntime.GetMutableModel ())
+ text = mutableModel.FullDisplayString;
+ } else
+ text = RuntimePlaceholder;
+ }
+ var size = new NSAttributedString (text, new NSStringAttributes { Font = cell.Font }).Size.Width + 20;
+ if (size < remaining) {
+ state |= newStateIfEnoughSize;
+ UpdatePathText (idx, text);
+ }
+ return remaining - size;
+ }
+
+ internal nfloat ResizeIfNeeded (OverflowInfoEventArgs args)
+ {
+ var remaining = args.WindowWidth - args.AllItemsWidth;
+ if (remaining < 0 || args.ItemsInOverflowWidth > 0) {
+ var cell = PathComponentCells [RuntimeIdx];
+ var size = new NSAttributedString (cell.Title, new NSStringAttributes { Font = cell.Font }).Size.Width;
+ remaining += size;
+ args.ItemsInOverflowWidth -= size;
+ if ((state & CellState.RuntimeShown) != 0) {
+ state &= ~CellState.RuntimeShown;
+ UpdatePathText (RuntimeIdx, string.Empty);
+ }
+ if ((remaining < 0 || args.ItemsInOverflowWidth > 0) && (state & CellState.ConfigurationShown) != 0) {
+ state &= ~CellState.ConfigurationShown;
+ UpdatePathText (ConfigurationIdx, string.Empty);
+ }
+ } else {
+ remaining = remaining - args.ItemsInOverflowWidth;
+ if ((state & CellState.ConfigurationShown) == 0)
+ remaining = UpdatePathCellForSize (ConfigurationIdx, remaining, CellState.ConfigurationShown);
+ if ((state & CellState.RuntimeShown) == 0)
+ UpdatePathCellForSize (RuntimeIdx, remaining, CellState.RuntimeShown);
+ }
+
+ return 10 +
+ PathComponentCells [ConfigurationIdx].CellSize.Width +
+ PathComponentCells [RuntimeIdx].CellSize.Width + Frame.Left;
+ }
NSMenu CreateSubMenuForRuntime (IRuntimeModel runtime)
{
@@ -99,14 +185,21 @@ namespace MonoDevelop.MacIntegration.MainToolbar
void CreateMenuItem (NSMenu menu, IRuntimeModel runtime)
{
- var menuItem = new NSMenuItem {
- IndentationLevel = runtime.IsIndented ? 2 : 1,
- Enabled = runtime.Enabled,
- Hidden = !runtime.Visible,
- AttributedTitle = new NSAttributedString (runtime.DisplayString, new NSStringAttributes {
- Font = runtime.Notable ? NSFontManager.SharedFontManager.ConvertFont (menu.Font, NSFontTraitMask.Bold) : menu.Font,
- }),
- };
+ NSMenuItem menuItem;
+ string runtimeFullDisplayString;
+
+ using (var mutableModel = runtime.GetMutableModel ()) {
+ runtimeFullDisplayString = mutableModel.FullDisplayString;
+
+ menuItem = new NSMenuItem {
+ IndentationLevel = runtime.IsIndented ? 2 : 1,
+ AttributedTitle = new NSAttributedString (mutableModel.DisplayString, new NSStringAttributes {
+ Font = runtime.Notable ? NSFontManager.SharedFontManager.ConvertFont (menu.Font, NSFontTraitMask.Bold) : menu.Font,
+ }),
+ Enabled = mutableModel.Enabled,
+ Hidden = !mutableModel.Visible,
+ };
+ }
var subMenu = CreateSubMenuForRuntime (runtime);
if (subMenu != null) {
@@ -114,14 +207,27 @@ namespace MonoDevelop.MacIntegration.MainToolbar
menuItem.Enabled = true;
} else {
menuItem.Activated += (o2, e2) => {
- string old = ActiveRuntime.FullDisplayString;
- ActiveRuntime = runtimeModel.First (r => r.FullDisplayString == runtime.FullDisplayString);
+ string old;
+ using (var activeMutableModel = ActiveRuntime.GetMutableModel ())
+ old = activeMutableModel.FullDisplayString;
+
+ IRuntimeModel newRuntime = runtimeModel.FirstOrDefault (r => {
+ using (var newRuntimeMutableModel = r.GetMutableModel ())
+ return newRuntimeMutableModel.FullDisplayString == runtimeFullDisplayString;
+ });
+ if (newRuntime == null)
+ return;
+
+ ActiveRuntime = newRuntime;
var ea = new HandledEventArgs ();
if (RuntimeChanged != null)
RuntimeChanged (o2, ea);
if (ea.Handled)
- ActiveRuntime = runtimeModel.First (r => r.FullDisplayString == old);
+ ActiveRuntime = runtimeModel.First (r => {
+ using (var newRuntimeMutableModel = r.GetMutableModel ())
+ return newRuntimeMutableModel.FullDisplayString == old;
+ });
};
}
menu.AddItem (menuItem);
@@ -162,6 +268,9 @@ namespace MonoDevelop.MacIntegration.MainToolbar
Font = NSFont.MenuFontOfSize (12),
};
if (object.ReferenceEquals (ClickedPathComponentCell, PathComponentCells [ConfigurationIdx])) {
+ if (ActiveConfiguration == null)
+ return;
+
foreach (var configuration in ConfigurationModel) {
if (idx == -1 && configuration.OriginalId == ActiveConfiguration.OriginalId)
idx = i;
@@ -179,18 +288,25 @@ namespace MonoDevelop.MacIntegration.MainToolbar
++i;
}
} else if (object.ReferenceEquals (ClickedPathComponentCell, PathComponentCells [RuntimeIdx])) {
- foreach (var runtime in RuntimeModel) {
- if (idx == -1 && runtime.DisplayString == ActiveRuntime.DisplayString)
- idx = i;
-
- if (runtime.HasParent)
- continue;
-
- if (runtime.IsSeparator)
- menu.AddItem (NSMenuItem.SeparatorItem);
- else
- CreateMenuItem (menu, runtime);
- ++i;
+ if (ActiveRuntime == null)
+ return;
+
+ using (var activeMutableModel = ActiveRuntime.GetMutableModel ()) {
+ foreach (var runtime in RuntimeModel) {
+ using (var mutableModel = runtime.GetMutableModel ()) {
+ if (idx == -1 && mutableModel.DisplayString == activeMutableModel.DisplayString)
+ idx = i;
+ }
+
+ if (runtime.HasParent)
+ continue;
+
+ if (runtime.IsSeparator)
+ menu.AddItem (NSMenuItem.SeparatorItem);
+ else
+ CreateMenuItem (menu, runtime);
+ ++i;
+ }
}
} else
throw new NotSupportedException ();
@@ -228,7 +344,8 @@ namespace MonoDevelop.MacIntegration.MainToolbar
void UpdatePathText (int idx, string text)
{
- PathComponentCells [idx].Title = text;
+ bool showText = (idx == ConfigurationIdx && (state & CellState.ConfigurationShown) != 0) || (idx == RuntimeIdx && (state & CellState.RuntimeShown) != 0);
+ PathComponentCells [idx].Title = showText ? text : "\u00A0";
PathComponentCells [ConfigurationIdx].Image = ImageService.GetIcon ("project").ToNSImage ();
PathComponentCells [RuntimeIdx].Image = ImageService.GetIcon ("device").ToNSImage ();
@@ -240,7 +357,9 @@ namespace MonoDevelop.MacIntegration.MainToolbar
get { return activeConfiguration; }
set {
activeConfiguration = value;
+ state |= CellState.ConfigurationShown;
UpdatePathText (ConfigurationIdx, value.DisplayString);
+ ((SelectorView)Superview).RequestResize ();
}
}
@@ -249,7 +368,11 @@ namespace MonoDevelop.MacIntegration.MainToolbar
get { return activeRuntime; }
set {
activeRuntime = value;
- UpdatePathText (RuntimeIdx, value.FullDisplayString);
+ using (var mutableModel = value.GetMutableModel ()) {
+ state |= CellState.RuntimeShown;
+ UpdatePathText (RuntimeIdx, mutableModel.FullDisplayString);
+ ((SelectorView)Superview).RequestResize ();
+ }
}
}
@@ -259,8 +382,11 @@ namespace MonoDevelop.MacIntegration.MainToolbar
set {
configurationModel = value;
int count = value.Count ();
- if (count == 0)
+ if (count == 0) {
+ state |= CellState.ConfigurationShown;
UpdatePathText (ConfigurationIdx, ConfigurationPlaceholder);
+ ((SelectorView)Superview).RequestResize ();
+ }
PathComponentCells [ConfigurationIdx].Enabled = count > 1;
}
}
@@ -271,8 +397,11 @@ namespace MonoDevelop.MacIntegration.MainToolbar
set {
runtimeModel = value;
int count = value.Count ();
- if (count == 0)
+ if (count == 0) {
+ state |= CellState.RuntimeShown;
UpdatePathText (RuntimeIdx, RuntimePlaceholder);
+ ((SelectorView)Superview).RequestResize ();
+ }
PathComponentCells [RuntimeIdx].Enabled = count > 1;
}
}
diff --git a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs
index 319b197290..2331b24551 100644
--- a/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs
+++ b/main/src/addins/MacPlatform/MainToolbar/StatusBar.cs
@@ -154,7 +154,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
BezelStyle = NSTextFieldBezelStyle.Rounded;
WantsLayer = true;
- Layer.CornerRadius = 4;
+ Layer.CornerRadius = MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 6 : 4;
ctxHandler = new StatusBarContextHandler (this);
updateHandler = delegate {
@@ -201,7 +201,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
if (Window == null)
return;
- ReconstructString ();
+ ReconstructString (updateTrackingAreas: true);
foreach (var layer in Layer.Sublayers) {
if (layer.Name != null && layer.Name.StartsWith (StatusIconPrefixId, StringComparison.Ordinal))
layer.SetImage (layerToStatus [layer.Name].Image, Window.BackingScaleFactor);
@@ -234,7 +234,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
}
NSTrackingArea textFieldArea;
- void ReconstructString ()
+ void ReconstructString (bool updateTrackingAreas)
{
if (string.IsNullOrEmpty (text)) {
textField.AttributedStringValue = new NSAttributedString ("");
@@ -247,6 +247,9 @@ namespace MonoDevelop.MacIntegration.MainToolbar
var width = textField.AttributedStringValue.BoundingRectWithSize (new CGSize (nfloat.MaxValue, textField.Frame.Height),
NSStringDrawingOptions.UsesFontLeading | NSStringDrawingOptions.UsesLineFragmentOrigin).Width;
+ if (!updateTrackingAreas)
+ return;
+
if (textFieldArea != null) {
RemoveTrackingArea (textFieldArea);
DestroyPopover ();
@@ -298,12 +301,12 @@ namespace MonoDevelop.MacIntegration.MainToolbar
right -= 9;
if (layer != null) {
- layer.Frame = new CGRect (right, 3, 1, 16);
+ layer.Frame = new CGRect (right, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 4 : 3, 1, 16);
layer.SetNeedsDisplay ();
} else {
layer = CALayer.Create ();
layer.Name = SeparatorLayerId;
- layer.Frame = new CGRect (right, 3, 1, 16);
+ layer.Frame = new CGRect (right, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 4 : 3, 1, 16);
layer.BackgroundColor = NSColor.LightGray.CGColor;
Layer.AddSublayer (layer);
}
@@ -341,12 +344,12 @@ namespace MonoDevelop.MacIntegration.MainToolbar
nfloat right = DrawSeparatorIfNeeded (LeftMostStatusItemX ());
CGSize size = buildResultText.AttributedString.Size;
right = right - 6 - size.Width;
- buildResultText.Frame = new CGRect (right, 5f, size.Width, size.Height);
+ buildResultText.Frame = new CGRect (right, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 6 : 5, size.Width, size.Height);
if (buildResultText.SuperLayer == null)
Layer.AddSublayer (buildResultText);
buildResultText.SetNeedsDisplay ();
right -= buildResultIcon.Bounds.Width;
- buildResultIcon.Frame = new CGRect (right, 3, buildResultIcon.Bounds.Width, buildResultIcon.Bounds.Height);
+ buildResultIcon.Frame = new CGRect (right, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 4 : 3, buildResultIcon.Bounds.Width, buildResultIcon.Bounds.Height);
if (buildResultIcon.SuperLayer == null)
Layer.AddSublayer (buildResultIcon);
@@ -360,10 +363,11 @@ namespace MonoDevelop.MacIntegration.MainToolbar
foreach (var item in Layer.Sublayers) {
if (item.Name != null && item.Name.StartsWith (StatusIconPrefixId, StringComparison.Ordinal)) {
var icon = layerToStatus [item.Name];
- RemoveTrackingArea (icon.TrackingArea);
+ if (icon.TrackingArea != null)
+ RemoveTrackingArea (icon.TrackingArea);
right -= item.Bounds.Width + 6;
- item.Frame = new CGRect (right, 3, item.Bounds.Width, item.Bounds.Height);
+ item.Frame = new CGRect (right, MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 4 : 3, item.Bounds.Width, item.Bounds.Height);
var area = new NSTrackingArea (item.Frame, NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveInKeyWindow, this, null);
AddTrackingArea (area);
@@ -383,27 +387,17 @@ namespace MonoDevelop.MacIntegration.MainToolbar
long statusCounter;
public StatusBarIcon ShowStatusIcon (Xwt.Drawing.Image pixbuf)
{
- nfloat right = layerToStatus.Count == 0 ?
- Layer.Frame.Width :
- Layer.Sublayers.Last (i => i.Name != null && i.Name.StartsWith (StatusIconPrefixId, StringComparison.Ordinal)).Frame.Left;
-
- right -= (nfloat)pixbuf.Width + 6;
var layer = CALayer.Create ();
layer.Name = StatusIconPrefixId + (++statusCounter);
layer.Bounds = new CGRect (0, 0, (nfloat)pixbuf.Width, (nfloat)pixbuf.Height);
- layer.Frame = new CGRect (right, 3, (nfloat)pixbuf.Width, (nfloat)pixbuf.Height);
-
- var area = new NSTrackingArea (layer.Frame, NSTrackingAreaOptions.MouseEnteredAndExited | NSTrackingAreaOptions.ActiveInKeyWindow, this, null);
- AddTrackingArea (area);
-
- var statusIcon = new StatusIcon (this, layer, area) {
+ var statusIcon = new StatusIcon (this, layer, null) {
Image = pixbuf,
};
layerToStatus [layer.Name] = statusIcon;
Layer.AddSublayer (layer);
- textField.SetFrameSize (new CGSize (right - 6 - textField.Frame.Left, Frame.Height));
+ RepositionStatusLayers ();
return statusIcon;
}
@@ -458,18 +452,25 @@ namespace MonoDevelop.MacIntegration.MainToolbar
{
DispatchService.AssertGuiThread ();
- LoadText (message, isMarkup, color);
+ bool changed = LoadText (message, isMarkup, color);
LoadPixbuf (image);
- ReconstructString ();
+ if (changed)
+ ReconstructString (updateTrackingAreas: true);
}
- void LoadText (string message, bool isMarkup, NSColor color)
+ bool LoadText (string message, bool isMarkup, NSColor color)
{
message = message ?? "";
+ message = message.Replace (Environment.NewLine, " ").Replace ("\n", " ").Trim ();
- text = message.Replace (Environment.NewLine, " ").Replace ("\n", " ").Trim ();
+ if (message == text)
+ return false;
+
+ text = message;
currentTextIsMarkup = isMarkup;
textColor = color;
+
+ return true;
}
static bool iconLoaded;
@@ -498,7 +499,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
image = iconAnimation.FirstFrame.ToNSImage ();
xwtAnimation = iconAnimation.StartAnimation (p => {
image = p.ToNSImage ();
- ReconstructString ();
+ ReconstructString (updateTrackingAreas: false);
});
} else {
image = ImageService.GetIcon (iconId).ToNSImage ();
@@ -570,6 +571,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
}
static CGColor xamBlue = new CGColor (52f / 255, 152f / 255, 219f / 255);
+ static nfloat verticalOffset = MacSystemInformation.OsVersion >= MacSystemInformation.ElCapitan ? 2 : 0;
CALayer CreateProgressBarLayer (double width)
{
CALayer progress = ProgressLayer;
@@ -579,7 +581,7 @@ namespace MonoDevelop.MacIntegration.MainToolbar
progress.BackgroundColor = xamBlue;
progress.BorderColor = xamBlue;
progress.FillMode = CAFillMode.Forwards;
- progress.Frame = new CGRect (0, Frame.Height - barHeight, (nfloat)width, barHeight);
+ progress.Frame = new CGRect (0, Frame.Height - barHeight - verticalOffset, (nfloat)width, barHeight);
}
return progress;
}
@@ -713,13 +715,14 @@ namespace MonoDevelop.MacIntegration.MainToolbar
((NSTextField)popover.ContentViewController.View).AttributedStringValue = attrString;
}
- void CreatePopoverForLayer (CALayer layer)
+ bool CreatePopoverForLayer (CALayer layer)
{
string tooltip = layerToStatus [layer.Name].ToolTip;
if (tooltip == null)
- return;
+ return false;
CreatePopoverCommon (230, tooltip);
+ return true;
}
void CreatePopoverForStatusBar ()
@@ -735,7 +738,9 @@ namespace MonoDevelop.MacIntegration.MainToolbar
if (!layerToStatus.ContainsKey (layer.Name))
return;
- CreatePopoverForLayer (layer);
+ if (!CreatePopoverForLayer (layer))
+ return;
+
popover.Show (layer.Frame, this, NSRectEdge.MinYEdge);
}
diff --git a/main/src/addins/MacPlatform/icons/build.png b/main/src/addins/MacPlatform/icons/build.png
index a0c40fc091..60db083214 100644
--- a/main/src/addins/MacPlatform/icons/build.png
+++ b/main/src/addins/MacPlatform/icons/build.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/build@2x.png b/main/src/addins/MacPlatform/icons/build@2x.png
index 240baf14f5..7dfb19221b 100644
--- a/main/src/addins/MacPlatform/icons/build@2x.png
+++ b/main/src/addins/MacPlatform/icons/build@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/continue.png b/main/src/addins/MacPlatform/icons/continue.png
index 393b1621bd..9d8db8c1cb 100644
--- a/main/src/addins/MacPlatform/icons/continue.png
+++ b/main/src/addins/MacPlatform/icons/continue.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/continue@2x.png b/main/src/addins/MacPlatform/icons/continue@2x.png
index 01099f61a6..1a74564c7d 100644
--- a/main/src/addins/MacPlatform/icons/continue@2x.png
+++ b/main/src/addins/MacPlatform/icons/continue@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/device.png b/main/src/addins/MacPlatform/icons/device.png
index 52a605662d..51690547be 100644
--- a/main/src/addins/MacPlatform/icons/device.png
+++ b/main/src/addins/MacPlatform/icons/device.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/device@2x.png b/main/src/addins/MacPlatform/icons/device@2x.png
index ce96416250..a045e0817c 100644
--- a/main/src/addins/MacPlatform/icons/device@2x.png
+++ b/main/src/addins/MacPlatform/icons/device@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/project.png b/main/src/addins/MacPlatform/icons/project.png
index f1246f7cf4..f25fdbfb2e 100644
--- a/main/src/addins/MacPlatform/icons/project.png
+++ b/main/src/addins/MacPlatform/icons/project.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/project@2x.png b/main/src/addins/MacPlatform/icons/project@2x.png
index 04e1fe7d90..e5e08d504f 100644
--- a/main/src/addins/MacPlatform/icons/project@2x.png
+++ b/main/src/addins/MacPlatform/icons/project@2x.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/stop.png b/main/src/addins/MacPlatform/icons/stop.png
index 1c83109ce3..62501d3cab 100644
--- a/main/src/addins/MacPlatform/icons/stop.png
+++ b/main/src/addins/MacPlatform/icons/stop.png
Binary files differ
diff --git a/main/src/addins/MacPlatform/icons/stop@2x.png b/main/src/addins/MacPlatform/icons/stop@2x.png
index 05db67ecd6..3870bc446d 100644
--- a/main/src/addins/MacPlatform/icons/stop@2x.png
+++ b/main/src/addins/MacPlatform/icons/stop@2x.png
Binary files differ
diff --git a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs
index 9d9992d9e3..acdfd4e14a 100644
--- a/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs
+++ b/main/src/addins/MonoDevelop.Debugger.Soft/MonoDevelop.Debugger.Soft/SoftDebuggerEngine.cs
@@ -138,6 +138,18 @@ namespace MonoDevelop.Debugger.Soft
class MDLogger : ICustomLogger
{
+ public string GetNewDebuggerLogFilename ()
+ {
+ if (PropertyService.Get ("MonoDevelop.Debugger.DebuggingService.DebuggerLogging", false)) {
+ string filename;
+ var logWriter = LoggingService.CreateLogFile ("Debugger", out filename);
+ logWriter.Dispose ();
+ return filename;
+ } else {
+ return null;
+ }
+ }
+
public void LogError (string message, Exception ex)
{
LoggingService.LogError (message, ex);
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.NonUserCodeTestLib/MonoDevelop.Debugger.Tests.NonUserCodeTestLib.csproj b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.NonUserCodeTestLib/MonoDevelop.Debugger.Tests.NonUserCodeTestLib.csproj
index 5de4c16d4a..a6ad6eb5a0 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.NonUserCodeTestLib/MonoDevelop.Debugger.Tests.NonUserCodeTestLib.csproj
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.Tests.NonUserCodeTestLib/MonoDevelop.Debugger.Tests.NonUserCodeTestLib.csproj
@@ -22,12 +22,13 @@
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>full</DebugType>
+ <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
+ <DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj
index 6d77e0d638..b90a0b4dd1 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger.csproj
@@ -156,7 +156,6 @@
<Compile Include="MonoDevelop.Debugger\BusyEvaluatorDialog.cs" />
<Compile Include="gtk-gui\MonoDevelop.Debugger.BusyEvaluatorDialog.cs" />
<Compile Include="MonoDevelop.Debugger\DebuggerOptionsPanelWidget.cs" />
- <Compile Include="gtk-gui\MonoDevelop.Debugger.DebuggerOptionsPanelWidget.cs" />
<Compile Include="MonoDevelop.Debugger\PinnedWatch.cs" />
<Compile Include="MonoDevelop.Debugger\PinnedWatchStore.cs" />
<Compile Include="MonoDevelop.Debugger\DebuggerEngine.cs" />
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
index f468753ed1..fe65568897 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BreakpointPad.cs
@@ -397,6 +397,8 @@ namespace MonoDevelop.Debugger
if (breakpoints != null) {
lock (breakpoints) {
foreach (BreakEvent be in breakpoints.GetBreakevents ()) {
+ if (be.NonUserBreakpoint)
+ continue;
string hitCount = be.HitCountMode != HitCountMode.None ? be.CurrentHitCount.ToString () : "";
string traceExp = (be.HitAction & HitAction.PrintExpression) != HitAction.None ? be.TraceExpression : "";
string traceVal = (be.HitAction & HitAction.PrintExpression) != HitAction.None ? be.LastTraceValue : "";
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BusyEvaluatorDialog.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BusyEvaluatorDialog.cs
index e2f8a93769..d82779bcbc 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BusyEvaluatorDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/BusyEvaluatorDialog.cs
@@ -34,27 +34,24 @@ namespace MonoDevelop.Debugger
public BusyEvaluatorDialog ()
{
this.Build ();
+ //Prevent closing dialog via X button, user can either wait with
+ //dialog open or press "Stop Debugger" button
+ DeleteEvent += (o, args) => args.RetVal = true;
}
-
+
public void UpdateBusyState (BusyStateEventArgs args)
{
if (!args.IsBusy) {
Hide ();
} else {
- labelMethod.Text = args.Description;
Show ();
}
}
-
+
protected virtual void OnButtonCancelClicked (object sender, System.EventArgs e)
{
Hide ();
DebuggingService.Stop ();
}
-
- protected virtual void OnButtonOkClicked (object sender, System.EventArgs e)
- {
- Hide ();
- }
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs
index f4f86afdd1..85c5ef476b 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggerOptionsPanelWidget.cs
@@ -1,4 +1,4 @@
-//
+//
// DebuggerOptionsPanelWidget.cs
//
// Author:
@@ -24,30 +24,81 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
+using System;
using Mono.Debugging.Client;
using MonoDevelop.Ide.Gui.Dialogs;
+using Xwt;
+using MonoDevelop.Core;
namespace MonoDevelop.Debugger
{
- public class DebuggerOptionsPanel: OptionsPanel
+ public class DebuggerOptionsPanel : OptionsPanel
{
DebuggerOptionsPanelWidget w;
-
+
public override Gtk.Widget CreatePanelWidget ()
{
- return w = new DebuggerOptionsPanelWidget ();
+ w = new DebuggerOptionsPanelWidget ();
+
+ return (Gtk.Widget)Toolkit.CurrentEngine.GetNativeWidget (w);
}
-
+
public override void ApplyChanges ()
{
w.Store ();
}
}
- [System.ComponentModel.ToolboxItem(true)]
- public partial class DebuggerOptionsPanelWidget : Gtk.Bin
+ public class DebuggerOptionsPanelWidget : VBox
{
DebuggerSessionOptions options;
+ CheckBox checkProjectCodeOnly;
+ CheckBox checkStepOverPropertiesAndOperators;
+ CheckBox checkAllowEval;
+ CheckBox checkAllowToString;
+ CheckBox checkShowBaseGroup;
+ CheckBox checkGroupPrivate;
+ CheckBox checkGroupStatic;
+ SpinButton spinTimeout;
+ CheckBox enableLogging;
+
+ void Build ()
+ {
+ checkProjectCodeOnly = new CheckBox (GettextCatalog.GetString ("Debug project code only; do not step into framework code."));
+ PackStart (checkProjectCodeOnly);
+ checkStepOverPropertiesAndOperators = new CheckBox (GettextCatalog.GetString ("Step over properties and operators"));
+ PackStart (checkStepOverPropertiesAndOperators);
+ checkAllowEval = new CheckBox (GettextCatalog.GetString ("Allow implicit property evaluation and method invocation"));
+ checkAllowEval.Toggled += OnCheckAllowEvalToggled;
+ PackStart (checkAllowEval);
+ checkAllowToString = new CheckBox (GettextCatalog.GetString ("Call string-conversion function on objects in variables windows"));
+ checkAllowToString.MarginLeft = 18;
+ PackStart (checkAllowToString);
+ checkShowBaseGroup = new CheckBox (GettextCatalog.GetString ("Show inherited class members in a base class group"));
+ PackStart (checkShowBaseGroup);
+ checkGroupPrivate = new CheckBox (GettextCatalog.GetString ("Group non-public members"));
+ PackStart (checkGroupPrivate);
+ checkGroupStatic = new CheckBox (GettextCatalog.GetString ("Group static members"));
+ PackStart (checkGroupStatic);
+ var evalBox = new HBox ();
+ evalBox.PackStart (new Label (GettextCatalog.GetString ("Evaluation Timeout:")));
+ spinTimeout = new SpinButton ();
+ spinTimeout.ClimbRate = 100;
+ spinTimeout.Digits = 0;
+ spinTimeout.IncrementValue = 100;
+ spinTimeout.MaximumValue = 1000000;
+ spinTimeout.MinimumValue = 0;
+ spinTimeout.Wrap = false;
+ spinTimeout.WidthRequest = 80;
+ evalBox.PackStart (spinTimeout);
+ evalBox.PackStart (new Label (GettextCatalog.GetString ("ms")));
+ PackStart (evalBox);
+ PackStart (new Label () {
+ Markup = "<b>" + GettextCatalog.GetString ("Advanced options") + "</b>"
+ });
+ enableLogging = new CheckBox (GettextCatalog.GetString ("Enable diagnostic logging", BrandingService.ApplicationName));
+ PackStart (enableLogging);
+ }
public DebuggerOptionsPanelWidget ()
{
@@ -63,6 +114,7 @@ namespace MonoDevelop.Debugger
checkGroupStatic.Active = options.EvaluationOptions.GroupStaticMembers;
checkAllowToString.Sensitive = checkAllowEval.Active;
spinTimeout.Value = options.EvaluationOptions.EvaluationTimeout;
+ enableLogging.Active = PropertyService.Get ("MonoDevelop.Debugger.DebuggingService.DebuggerLogging", false);
}
public void Store ()
@@ -74,13 +126,14 @@ namespace MonoDevelop.Debugger
ops.FlattenHierarchy = !checkShowBaseGroup.Active;
ops.GroupPrivateMembers = checkGroupPrivate.Active;
ops.GroupStaticMembers = checkGroupStatic.Active;
- ops.EvaluationTimeout = (int) spinTimeout.Value;
+ ops.EvaluationTimeout = (int)spinTimeout.Value;
options.StepOverPropertiesAndOperators = checkStepOverPropertiesAndOperators.Active;
options.ProjectAssembliesOnly = checkProjectCodeOnly.Active;
options.EvaluationOptions = ops;
DebuggingService.SetUserOptions (options);
+ PropertyService.Set ("MonoDevelop.Debugger.DebuggingService.DebuggerLogging", enableLogging.Active);
}
protected virtual void OnCheckAllowEvalToggled (object sender, System.EventArgs e)
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
index abb2d6544f..3422b1cf87 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DebuggingService.cs
@@ -98,6 +98,7 @@ namespace MonoDevelop.Debugger
IdeApp.Workspace.LoadingUserPreferences += OnLoadUserPrefs;
IdeApp.Workspace.LastWorkspaceItemClosed += OnSolutionClosed;
busyDialog = new BusyEvaluatorDialog ();
+ busyDialog.Modal = true;
busyDialog.TransientFor = MessageService.RootWindow;
busyDialog.DestroyWithParent = true;
};
@@ -706,7 +707,7 @@ namespace MonoDevelop.Debugger
if (busyStatusIcon == null) {
busyStatusIcon = IdeApp.Workbench.StatusBar.ShowStatusIcon (ImageService.GetIcon ("md-execute-debug", Gtk.IconSize.Menu));
busyStatusIcon.SetAlertMode (100);
- busyStatusIcon.ToolTip = GettextCatalog.GetString ("The Debugger is waiting for an expression evaluation to finish.");
+ busyStatusIcon.ToolTip = GettextCatalog.GetString ("The debugger runtime is not responding. You can wait for it to recover, or stop debugging.");
busyStatusIcon.Clicked += delegate {
MessageService.PlaceDialog (busyDialog, MessageService.RootWindow);
};
@@ -744,6 +745,8 @@ namespace MonoDevelop.Debugger
static void OnTargetEvent (object sender, TargetEventArgs args)
{
+ if (args.BreakEvent != null && args.BreakEvent.NonUserBreakpoint)
+ return;
nextStatementLocations.Clear ();
try {
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
index 90973bb76f..890d216812 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/DisassemblyView.cs
@@ -127,7 +127,7 @@ namespace MonoDevelop.Debugger
messageOverlayWindow.SizeFunc = () => openButton.SizeRequest ().Width + w + hbox.Spacing * 5 + containerPadding * 2;
openButton.Clicked += delegate {
- var dlg = new OpenFileDialog (GettextCatalog.GetString ("File to Open"), Gtk.FileChooserAction.Open) {
+ var dlg = new OpenFileDialog (GettextCatalog.GetString ("File to Open"), MonoDevelop.Components.FileChooserAction.Open) {
TransientFor = IdeApp.Workbench.RootWindow,
ShowEncodingSelector = true,
ShowViewerSelector = true
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs
index 0984737f9e..feb6d9c0c3 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/LocalsPad.cs
@@ -49,6 +49,7 @@ namespace MonoDevelop.Debugger
if (frame == null)
return;
+ tree.ClearAll ();
tree.AddValues (frame.GetAllLocals ().Where (l => !string.IsNullOrWhiteSpace (l.Name) && l.Name != "?").ToArray ());
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
index 5aad501f40..97164a0ca5 100644
--- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
+++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/StackTracePad.cs
@@ -220,7 +220,7 @@ namespace MonoDevelop.Debugger
options.AllowTargetInvoke = false;
}
- var args = frame.GetParameters ();
+ var args = frame.GetParameters (options);
//MethodName starting with "["... it's something like [ExternalCode]
if (!frame.SourceLocation.MethodName.StartsWith ("[", StringComparison.Ordinal)) {
diff --git a/main/src/addins/MonoDevelop.Debugger/gtk-gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs b/main/src/addins/MonoDevelop.Debugger/gtk-gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs
index 20c77c6ed8..ea62abdeb4 100644
--- a/main/src/addins/MonoDevelop.Debugger/gtk-gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs
+++ b/main/src/addins/MonoDevelop.Debugger/gtk-gui/MonoDevelop.Debugger.BusyEvaluatorDialog.cs
@@ -5,113 +5,65 @@ namespace MonoDevelop.Debugger
public partial class BusyEvaluatorDialog
{
private global::Gtk.VBox vbox2;
+
private global::Gtk.Label label1;
- private global::Gtk.HBox hbox1;
- private global::Gtk.Label label2;
- private global::Gtk.Label labelMethod;
+
private global::Gtk.Button buttonCancel;
- private global::Gtk.Button buttonOk;
-
- protected virtual void Build ()
+
+ protected virtual void Build()
{
- global::Stetic.Gui.Initialize (this);
+ global::Stetic.Gui.Initialize(this);
// Widget MonoDevelop.Debugger.BusyEvaluatorDialog
this.Name = "MonoDevelop.Debugger.BusyEvaluatorDialog";
- this.Title = global::Mono.Unix.Catalog.GetString ("The Debugger is Busy");
+ this.Title = global::Mono.Unix.Catalog.GetString("The Debugger is Busy");
this.WindowPosition = ((global::Gtk.WindowPosition)(4));
// Internal child MonoDevelop.Debugger.BusyEvaluatorDialog.VBox
global::Gtk.VBox w1 = this.VBox;
w1.Name = "dialog1_VBox";
w1.BorderWidth = ((uint)(2));
// Container child dialog1_VBox.Gtk.Box+BoxChild
- this.vbox2 = new global::Gtk.VBox ();
+ this.vbox2 = new global::Gtk.VBox();
this.vbox2.Name = "vbox2";
this.vbox2.Spacing = 6;
this.vbox2.BorderWidth = ((uint)(9));
// Container child vbox2.Gtk.Box+BoxChild
- this.label1 = new global::Gtk.Label ();
+ this.label1 = new global::Gtk.Label();
this.label1.Name = "label1";
this.label1.Xalign = 0F;
- this.label1.LabelProp = global::Mono.Unix.Catalog.GetString ("The Debugger is waiting for an expression evaluation to finish.");
- this.vbox2.Add (this.label1);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.label1]));
+ this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("The debugger runtime is not responding. You can wait for it to recover, or stop debugging.");
+ this.vbox2.Add(this.label1);
+ global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.label1]));
w2.Position = 0;
w2.Expand = false;
w2.Fill = false;
- // Container child vbox2.Gtk.Box+BoxChild
- this.hbox1 = new global::Gtk.HBox ();
- this.hbox1.Name = "hbox1";
- this.hbox1.Spacing = 6;
- // Container child hbox1.Gtk.Box+BoxChild
- this.label2 = new global::Gtk.Label ();
- this.label2.Name = "label2";
- this.label2.Xalign = 0F;
- this.label2.LabelProp = global::Mono.Unix.Catalog.GetString ("Method:");
- this.hbox1.Add (this.label2);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.label2]));
+ w1.Add(this.vbox2);
+ global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1[this.vbox2]));
w3.Position = 0;
- w3.Expand = false;
- w3.Fill = false;
- // Container child hbox1.Gtk.Box+BoxChild
- this.labelMethod = new global::Gtk.Label ();
- this.labelMethod.Name = "labelMethod";
- this.labelMethod.Xalign = 0F;
- this.labelMethod.LabelProp = "<method>";
- this.labelMethod.Wrap = true;
- this.labelMethod.Selectable = true;
- this.labelMethod.MaxWidthChars = 120;
- this.hbox1.Add (this.labelMethod);
- global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1 [this.labelMethod]));
- w4.Position = 1;
- w4.Expand = false;
- w4.Fill = false;
- this.vbox2.Add (this.hbox1);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2 [this.hbox1]));
- w5.Position = 1;
- w5.Expand = false;
- w5.Fill = false;
- w1.Add (this.vbox2);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1 [this.vbox2]));
- w6.Position = 0;
- w6.Expand = false;
- w6.Fill = false;
// Internal child MonoDevelop.Debugger.BusyEvaluatorDialog.ActionArea
- global::Gtk.HButtonBox w7 = this.ActionArea;
- w7.Name = "dialog1_ActionArea";
- w7.Spacing = 10;
- w7.BorderWidth = ((uint)(5));
- w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
+ global::Gtk.HButtonBox w4 = this.ActionArea;
+ w4.Name = "dialog1_ActionArea";
+ w4.Spacing = 10;
+ w4.BorderWidth = ((uint)(5));
+ w4.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonCancel = new global::Gtk.Button ();
+ this.buttonCancel = new global::Gtk.Button();
this.buttonCancel.CanDefault = true;
this.buttonCancel.CanFocus = true;
this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.UseUnderline = true;
- this.buttonCancel.Label = global::Mono.Unix.Catalog.GetString ("Stop Debugger");
- w7.Add (this.buttonCancel);
- global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonCancel]));
- w8.Expand = false;
- w8.Fill = false;
- // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
- this.buttonOk = new global::Gtk.Button ();
- this.buttonOk.CanDefault = true;
- this.buttonOk.CanFocus = true;
- this.buttonOk.Name = "buttonOk";
- this.buttonOk.UseUnderline = true;
- this.buttonOk.Label = global::Mono.Unix.Catalog.GetString ("Keep Waiting");
- w7.Add (this.buttonOk);
- global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7 [this.buttonOk]));
- w9.Position = 1;
- w9.Expand = false;
- w9.Fill = false;
- if ((this.Child != null)) {
- this.Child.ShowAll ();
+ this.buttonCancel.Label = global::Mono.Unix.Catalog.GetString("Stop Debugger");
+ w4.Add(this.buttonCancel);
+ global::Gtk.ButtonBox.ButtonBoxChild w5 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w4[this.buttonCancel]));
+ w5.Expand = false;
+ w5.Fill = false;
+ if ((this.Child != null))
+ {
+ this.Child.ShowAll();
}
- this.DefaultWidth = 381;
- this.DefaultHeight = 126;
- this.Hide ();
- this.buttonCancel.Clicked += new global::System.EventHandler (this.OnButtonCancelClicked);
- this.buttonOk.Clicked += new global::System.EventHandler (this.OnButtonOkClicked);
+ this.DefaultWidth = 548;
+ this.DefaultHeight = 98;
+ this.Hide();
+ this.buttonCancel.Clicked += new global::System.EventHandler(this.OnButtonCancelClicked);
}
}
}
diff --git a/main/src/addins/MonoDevelop.Debugger/gtk-gui/MonoDevelop.Debugger.DebuggerOptionsPanelWidget.cs b/main/src/addins/MonoDevelop.Debugger/gtk-gui/MonoDevelop.Debugger.DebuggerOptionsPanelWidget.cs
deleted file mode 100644
index ddefc1bfbf..0000000000
--- a/main/src/addins/MonoDevelop.Debugger/gtk-gui/MonoDevelop.Debugger.DebuggerOptionsPanelWidget.cs
+++ /dev/null
@@ -1,187 +0,0 @@
-
-// This file has been generated by the GUI designer. Do not modify.
-namespace MonoDevelop.Debugger
-{
- public partial class DebuggerOptionsPanelWidget
- {
- private global::Gtk.VBox vbox3;
-
- private global::Gtk.CheckButton checkProjectCodeOnly;
-
- private global::Gtk.CheckButton checkStepOverPropertiesAndOperators;
-
- private global::Gtk.CheckButton checkAllowEval;
-
- private global::Gtk.Alignment alignmentAllowToString;
-
- private global::Gtk.CheckButton checkAllowToString;
-
- private global::Gtk.CheckButton checkShowBaseGroup;
-
- private global::Gtk.CheckButton checkGroupPrivate;
-
- private global::Gtk.CheckButton checkGroupStatic;
-
- private global::Gtk.Table tableEval;
-
- private global::Gtk.Label label3;
-
- private global::Gtk.Label labelEvalTimeout;
-
- private global::Gtk.SpinButton spinTimeout;
-
- protected virtual void Build ()
- {
- global::Stetic.Gui.Initialize (this);
- // Widget MonoDevelop.Debugger.DebuggerOptionsPanelWidget
- global::Stetic.BinContainer.Attach (this);
- this.Name = "MonoDevelop.Debugger.DebuggerOptionsPanelWidget";
- // Container child MonoDevelop.Debugger.DebuggerOptionsPanelWidget.Gtk.Container+ContainerChild
- this.vbox3 = new global::Gtk.VBox ();
- this.vbox3.Name = "vbox3";
- this.vbox3.Spacing = 6;
- this.vbox3.BorderWidth = ((uint)(9));
- // Container child vbox3.Gtk.Box+BoxChild
- this.checkProjectCodeOnly = new global::Gtk.CheckButton ();
- this.checkProjectCodeOnly.CanFocus = true;
- this.checkProjectCodeOnly.Name = "checkProjectCodeOnly";
- this.checkProjectCodeOnly.Label = global::Mono.Unix.Catalog.GetString ("Debug project code only; do not step into framework code.");
- this.checkProjectCodeOnly.Active = true;
- this.checkProjectCodeOnly.DrawIndicator = true;
- this.checkProjectCodeOnly.UseUnderline = true;
- this.vbox3.Add (this.checkProjectCodeOnly);
- global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.checkProjectCodeOnly]));
- w1.Position = 0;
- w1.Expand = false;
- w1.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.checkStepOverPropertiesAndOperators = new global::Gtk.CheckButton ();
- this.checkStepOverPropertiesAndOperators.CanFocus = true;
- this.checkStepOverPropertiesAndOperators.Name = "checkStepOverPropertiesAndOperators";
- this.checkStepOverPropertiesAndOperators.Label = global::Mono.Unix.Catalog.GetString ("Step over properties and operators");
- this.checkStepOverPropertiesAndOperators.Active = true;
- this.checkStepOverPropertiesAndOperators.DrawIndicator = true;
- this.checkStepOverPropertiesAndOperators.UseUnderline = true;
- this.vbox3.Add (this.checkStepOverPropertiesAndOperators);
- global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.checkStepOverPropertiesAndOperators]));
- w2.Position = 1;
- w2.Expand = false;
- w2.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.checkAllowEval = new global::Gtk.CheckButton ();
- this.checkAllowEval.CanFocus = true;
- this.checkAllowEval.Name = "checkAllowEval";
- this.checkAllowEval.Label = global::Mono.Unix.Catalog.GetString ("Allow implicit property evaluation and method invocation");
- this.checkAllowEval.Active = true;
- this.checkAllowEval.DrawIndicator = true;
- this.checkAllowEval.UseUnderline = true;
- this.vbox3.Add (this.checkAllowEval);
- global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.checkAllowEval]));
- w3.Position = 2;
- w3.Expand = false;
- w3.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.alignmentAllowToString = new global::Gtk.Alignment (0F, 0.5F, 1F, 1F);
- this.alignmentAllowToString.Name = "alignmentAllowToString";
- this.alignmentAllowToString.LeftPadding = ((uint)(18));
- // Container child alignmentAllowToString.Gtk.Container+ContainerChild
- this.checkAllowToString = new global::Gtk.CheckButton ();
- this.checkAllowToString.CanFocus = true;
- this.checkAllowToString.Name = "checkAllowToString";
- this.checkAllowToString.Label = global::Mono.Unix.Catalog.GetString ("Call string-conversion function on objects in variables windows");
- this.checkAllowToString.Active = true;
- this.checkAllowToString.DrawIndicator = true;
- this.checkAllowToString.UseUnderline = true;
- this.alignmentAllowToString.Add (this.checkAllowToString);
- this.vbox3.Add (this.alignmentAllowToString);
- global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.alignmentAllowToString]));
- w5.Position = 3;
- w5.Expand = false;
- w5.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.checkShowBaseGroup = new global::Gtk.CheckButton ();
- this.checkShowBaseGroup.CanFocus = true;
- this.checkShowBaseGroup.Name = "checkShowBaseGroup";
- this.checkShowBaseGroup.Label = global::Mono.Unix.Catalog.GetString ("Show inherited class members in a base class group");
- this.checkShowBaseGroup.DrawIndicator = true;
- this.checkShowBaseGroup.UseUnderline = true;
- this.vbox3.Add (this.checkShowBaseGroup);
- global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.checkShowBaseGroup]));
- w6.Position = 4;
- w6.Expand = false;
- w6.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.checkGroupPrivate = new global::Gtk.CheckButton ();
- this.checkGroupPrivate.CanFocus = true;
- this.checkGroupPrivate.Name = "checkGroupPrivate";
- this.checkGroupPrivate.Label = global::Mono.Unix.Catalog.GetString ("Group non-public members");
- this.checkGroupPrivate.DrawIndicator = true;
- this.checkGroupPrivate.UseUnderline = true;
- this.vbox3.Add (this.checkGroupPrivate);
- global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.checkGroupPrivate]));
- w7.Position = 5;
- w7.Expand = false;
- w7.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.checkGroupStatic = new global::Gtk.CheckButton ();
- this.checkGroupStatic.CanFocus = true;
- this.checkGroupStatic.Name = "checkGroupStatic";
- this.checkGroupStatic.Label = global::Mono.Unix.Catalog.GetString ("Group static members");
- this.checkGroupStatic.DrawIndicator = true;
- this.checkGroupStatic.UseUnderline = true;
- this.vbox3.Add (this.checkGroupStatic);
- global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.checkGroupStatic]));
- w8.Position = 6;
- w8.Expand = false;
- w8.Fill = false;
- // Container child vbox3.Gtk.Box+BoxChild
- this.tableEval = new global::Gtk.Table (((uint)(1)), ((uint)(3)), false);
- this.tableEval.Name = "tableEval";
- this.tableEval.RowSpacing = ((uint)(6));
- this.tableEval.ColumnSpacing = ((uint)(6));
- // Container child tableEval.Gtk.Table+TableChild
- this.label3 = new global::Gtk.Label ();
- this.label3.Name = "label3";
- this.label3.LabelProp = global::Mono.Unix.Catalog.GetString ("ms");
- this.tableEval.Add (this.label3);
- global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.tableEval [this.label3]));
- w9.LeftAttach = ((uint)(2));
- w9.RightAttach = ((uint)(3));
- w9.XOptions = ((global::Gtk.AttachOptions)(4));
- w9.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child tableEval.Gtk.Table+TableChild
- this.labelEvalTimeout = new global::Gtk.Label ();
- this.labelEvalTimeout.Name = "labelEvalTimeout";
- this.labelEvalTimeout.Xalign = 0F;
- this.labelEvalTimeout.LabelProp = global::Mono.Unix.Catalog.GetString ("Evaluation Timeout:");
- this.tableEval.Add (this.labelEvalTimeout);
- global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.tableEval [this.labelEvalTimeout]));
- w10.XOptions = ((global::Gtk.AttachOptions)(4));
- w10.YOptions = ((global::Gtk.AttachOptions)(4));
- // Container child tableEval.Gtk.Table+TableChild
- this.spinTimeout = new global::Gtk.SpinButton (0, 1000000, 100);
- this.spinTimeout.CanFocus = true;
- this.spinTimeout.Name = "spinTimeout";
- this.spinTimeout.Adjustment.PageIncrement = 10;
- this.spinTimeout.ClimbRate = 100;
- this.spinTimeout.Numeric = true;
- this.tableEval.Add (this.spinTimeout);
- global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.tableEval [this.spinTimeout]));
- w11.LeftAttach = ((uint)(1));
- w11.RightAttach = ((uint)(2));
- w11.XOptions = ((global::Gtk.AttachOptions)(4));
- w11.YOptions = ((global::Gtk.AttachOptions)(4));
- this.vbox3.Add (this.tableEval);
- global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(this.vbox3 [this.tableEval]));
- w12.Position = 7;
- w12.Expand = false;
- w12.Fill = false;
- this.Add (this.vbox3);
- if ((this.Child != null)) {
- this.Child.ShowAll ();
- }
- this.Hide ();
- this.checkAllowEval.Toggled += new global::System.EventHandler (this.OnCheckAllowEvalToggled);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.Debugger/gtk-gui/generated.cs b/main/src/addins/MonoDevelop.Debugger/gtk-gui/generated.cs
index 3285e87c05..4842e95d78 100644
--- a/main/src/addins/MonoDevelop.Debugger/gtk-gui/generated.cs
+++ b/main/src/addins/MonoDevelop.Debugger/gtk-gui/generated.cs
@@ -6,75 +6,23 @@ namespace Stetic
{
private static bool initialized;
- internal static void Initialize (Gtk.Widget iconRenderer)
+ internal static void Initialize(Gtk.Widget iconRenderer)
{
- if ((Stetic.Gui.initialized == false)) {
+ if ((Stetic.Gui.initialized == false))
+ {
Stetic.Gui.initialized = true;
}
}
}
- internal class BinContainer
- {
- private Gtk.Widget child;
-
- private Gtk.UIManager uimanager;
-
- public static BinContainer Attach (Gtk.Bin bin)
- {
- BinContainer bc = new BinContainer ();
- bin.SizeRequested += new Gtk.SizeRequestedHandler (bc.OnSizeRequested);
- bin.SizeAllocated += new Gtk.SizeAllocatedHandler (bc.OnSizeAllocated);
- bin.Added += new Gtk.AddedHandler (bc.OnAdded);
- return bc;
- }
-
- private void OnSizeRequested (object sender, Gtk.SizeRequestedArgs args)
- {
- if ((this.child != null)) {
- args.Requisition = this.child.SizeRequest ();
- }
- }
-
- private void OnSizeAllocated (object sender, Gtk.SizeAllocatedArgs args)
- {
- if ((this.child != null)) {
- this.child.Allocation = args.Allocation;
- }
- }
-
- private void OnAdded (object sender, Gtk.AddedArgs args)
- {
- this.child = args.Widget;
- }
-
- public void SetUiManager (Gtk.UIManager uim)
- {
- this.uimanager = uim;
- this.child.Realized += new System.EventHandler (this.OnRealized);
- }
-
- private void OnRealized (object sender, System.EventArgs args)
- {
- if ((this.uimanager != null)) {
- Gtk.Widget w;
- w = this.child.Toplevel;
- if (((w != null) && typeof(Gtk.Window).IsInstanceOfType (w))) {
- ((Gtk.Window)(w)).AddAccelGroup (this.uimanager.AccelGroup);
- this.uimanager = null;
- }
- }
- }
- }
-
internal class ActionGroups
{
- public static Gtk.ActionGroup GetActionGroup (System.Type type)
+ public static Gtk.ActionGroup GetActionGroup(System.Type type)
{
- return Stetic.ActionGroups.GetActionGroup (type.FullName);
+ return Stetic.ActionGroups.GetActionGroup(type.FullName);
}
- public static Gtk.ActionGroup GetActionGroup (string name)
+ public static Gtk.ActionGroup GetActionGroup(string name)
{
return null;
}
diff --git a/main/src/addins/MonoDevelop.Debugger/gtk-gui/gui.stetic b/main/src/addins/MonoDevelop.Debugger/gtk-gui/gui.stetic
index a78350eb13..9b600748d0 100644
--- a/main/src/addins/MonoDevelop.Debugger/gtk-gui/gui.stetic
+++ b/main/src/addins/MonoDevelop.Debugger/gtk-gui/gui.stetic
@@ -287,12 +287,12 @@
</widget>
</child>
</widget>
- <widget class="Gtk.Dialog" id="MonoDevelop.Debugger.BusyEvaluatorDialog" design-size="381 126">
+ <widget class="Gtk.Dialog" id="MonoDevelop.Debugger.BusyEvaluatorDialog" design-size="548 98">
<property name="MemberName" />
<property name="Visible">False</property>
<property name="Title" translatable="yes">The Debugger is Busy</property>
<property name="WindowPosition">CenterOnParent</property>
- <property name="Buttons">2</property>
+ <property name="Buttons">1</property>
<property name="HelpButton">False</property>
<child internal-child="VBox">
<widget class="Gtk.VBox" id="dialog1_VBox">
@@ -307,7 +307,7 @@
<widget class="Gtk.Label" id="label1">
<property name="MemberName" />
<property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">The Debugger is waiting for an expression evaluation to finish.</property>
+ <property name="LabelProp" translatable="yes">The debugger runtime is not responding. You can wait for it to recover, or stop debugging.</property>
</widget>
<packing>
<property name="Position">0</property>
@@ -317,52 +317,12 @@
</packing>
</child>
<child>
- <widget class="Gtk.HBox" id="hbox1">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <child>
- <widget class="Gtk.Label" id="label2">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Method:</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="labelMethod">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp">&lt;method&gt;</property>
- <property name="Wrap">True</property>
- <property name="Selectable">True</property>
- <property name="MaxWidthChars">120</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
+ <placeholder />
</child>
</widget>
<packing>
<property name="Position">0</property>
<property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
</packing>
</child>
</widget>
@@ -372,7 +332,7 @@
<property name="MemberName" />
<property name="Spacing">10</property>
<property name="BorderWidth">5</property>
- <property name="Size">2</property>
+ <property name="Size">1</property>
<property name="LayoutStyle">End</property>
<child>
<widget class="Gtk.Button" id="buttonCancel">
@@ -390,233 +350,6 @@
<property name="Fill">False</property>
</packing>
</child>
- <child>
- <widget class="Gtk.Button" id="buttonOk">
- <property name="MemberName" />
- <property name="CanDefault">True</property>
- <property name="CanFocus">True</property>
- <property name="Type">TextOnly</property>
- <property name="Label" translatable="yes">Keep Waiting</property>
- <property name="UseUnderline">True</property>
- <property name="ResponseId">-1</property>
- <signal name="Clicked" handler="OnButtonOkClicked" />
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="Gtk.Bin" id="MonoDevelop.Debugger.DebuggerOptionsPanelWidget" design-size="523 241">
- <property name="MemberName" />
- <property name="Visible">False</property>
- <child>
- <widget class="Gtk.VBox" id="vbox3">
- <property name="MemberName" />
- <property name="Spacing">6</property>
- <property name="BorderWidth">9</property>
- <child>
- <widget class="Gtk.CheckButton" id="checkProjectCodeOnly">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Debug project code only; do not step into framework code.</property>
- <property name="Active">True</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">0</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.CheckButton" id="checkStepOverPropertiesAndOperators">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Step over properties and operators</property>
- <property name="Active">True</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">1</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.CheckButton" id="checkAllowEval">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Allow implicit property evaluation and method invocation</property>
- <property name="Active">True</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- <signal name="Toggled" handler="OnCheckAllowEvalToggled" />
- </widget>
- <packing>
- <property name="Position">2</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Alignment" id="alignmentAllowToString">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LeftPadding">18</property>
- <child>
- <widget class="Gtk.CheckButton" id="checkAllowToString">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Call string-conversion function on objects in variables windows</property>
- <property name="Active">True</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="Position">3</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.CheckButton" id="checkShowBaseGroup">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Show inherited class members in a base class group</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">4</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.CheckButton" id="checkGroupPrivate">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Group non-public members</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">5</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.CheckButton" id="checkGroupStatic">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Label" translatable="yes">Group static members</property>
- <property name="DrawIndicator">True</property>
- <property name="HasLabel">True</property>
- <property name="UseUnderline">True</property>
- </widget>
- <packing>
- <property name="Position">6</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Table" id="tableEval">
- <property name="MemberName" />
- <property name="NColumns">3</property>
- <property name="RowSpacing">6</property>
- <property name="ColumnSpacing">6</property>
- <child>
- <widget class="Gtk.Label" id="label3">
- <property name="MemberName" />
- <property name="LabelProp" translatable="yes">ms</property>
- </widget>
- <packing>
- <property name="LeftAttach">2</property>
- <property name="RightAttach">3</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.Label" id="labelEvalTimeout">
- <property name="MemberName" />
- <property name="Xalign">0</property>
- <property name="LabelProp" translatable="yes">Evaluation Timeout:</property>
- </widget>
- <packing>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- <child>
- <widget class="Gtk.SpinButton" id="spinTimeout">
- <property name="MemberName" />
- <property name="CanFocus">True</property>
- <property name="Upper">1000000</property>
- <property name="PageIncrement">10</property>
- <property name="StepIncrement">100</property>
- <property name="ClimbRate">100</property>
- <property name="Numeric">True</property>
- </widget>
- <packing>
- <property name="LeftAttach">1</property>
- <property name="RightAttach">2</property>
- <property name="AutoSize">True</property>
- <property name="XOptions">Fill</property>
- <property name="YOptions">Fill</property>
- <property name="XExpand">False</property>
- <property name="XFill">True</property>
- <property name="XShrink">False</property>
- <property name="YExpand">False</property>
- <property name="YFill">True</property>
- <property name="YShrink">False</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="Position">7</property>
- <property name="AutoSize">True</property>
- <property name="Expand">False</property>
- <property name="Fill">False</property>
- </packing>
- </child>
</widget>
</child>
</widget>
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs
index 0a95a9c589..50cb4254fe 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Projects/ProjectFileDescriptor.cs
@@ -31,16 +31,41 @@ using System.ComponentModel;
using MonoDevelop.Projects;
using MonoDevelop.Core;
using MonoDevelop.Ide;
+using System.Linq;
namespace MonoDevelop.DesignerSupport
{
- class ProjectFileDescriptor: CustomDescriptor
+ class ProjectFileDescriptor: CustomDescriptor, IDisposable
{
ProjectFile file;
-
+ Project project;
+
public ProjectFileDescriptor (ProjectFile file)
{
this.file = file;
+ project = file.Project;
+ if (project != null) {
+ project.FilePropertyChangedInProject += OnFilePropertyChangedInProject;
+ }
+ }
+
+ void OnFilePropertyChangedInProject (object sender, ProjectFileEventArgs args)
+ {
+ var pad = IdeApp.Workbench.GetPad <PropertyPad> ();
+ if (pad == null)
+ return;
+
+ var grid = ((PropertyPad)pad.Content).PropertyGrid;
+ if (args.Any (arg => arg.ProjectFile == file))
+ grid.Refresh ();
+ }
+
+ void IDisposable.Dispose ()
+ {
+ if (project != null) {
+ project.FilePropertyChangedInProject -= OnFilePropertyChangedInProject;
+ project = null;
+ }
}
[LocalizedCategory ("Misc")]
@@ -71,6 +96,7 @@ namespace MonoDevelop.DesignerSupport
[LocalizedDisplayName ("Build action")]
[LocalizedDescription ("Action to perform when building this file.")]
[TypeConverter (typeof (BuildActionStringsConverter))]
+ [RefreshProperties(RefreshProperties.All)]
public string BuildAction {
get { return file.BuildAction; }
set { file.BuildAction = value; }
diff --git a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs
index 071501d38a..d15045ffbc 100644
--- a/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs
+++ b/main/src/addins/MonoDevelop.DesignerSupport/MonoDevelop.DesignerSupport.Toolbox/ToolboxWidget.cs
@@ -243,11 +243,15 @@ namespace MonoDevelop.DesignerSupport.Toolbox
Category lastCategory = null;
int lastCategoryYpos = 0;
+ cr.LineWidth = 1;
+
Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) {
const int foldSegmentHeight = 8;
ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos);
+ if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension)))
+ return true;
cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height);
using (var pat = new Cairo.LinearGradient (xpos, ypos, xpos, ypos + itemDimension.Height)) {
pat.AddColorStop (0, CategoryBackgroundGradientStartColor);
@@ -262,7 +266,6 @@ namespace MonoDevelop.DesignerSupport.Toolbox
cr.MoveTo (0, ypos + itemDimension.Height - 0.5);
cr.LineTo (xpos + Allocation.Width, ypos + itemDimension.Height - 0.5);
cr.SetSourceColor (CategoryBorderColor);
- cr.LineWidth = 1;
cr.Stroke ();
headerLayout.SetText (category.Text);
@@ -278,7 +281,11 @@ namespace MonoDevelop.DesignerSupport.Toolbox
lastCategory = category;
lastCategoryYpos = ypos + itemDimension.Height;
+ return true;
}, delegate (Category curCategory, Item item, Gdk.Size itemDimension) {
+ if (!area.IntersectsWith (new Gdk.Rectangle (new Gdk.Point (xpos, ypos), itemDimension)))
+ return true;
+
if (item == SelectedItem) {
cr.SetSourceColor (Style.Base (StateType.Selected).ToCairoColor ());
cr.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height);
@@ -301,6 +308,8 @@ namespace MonoDevelop.DesignerSupport.Toolbox
cr.Rectangle (xpos + 0.5, ypos + 0.5, itemDimension.Width - 1, itemDimension.Height - 1);
cr.Stroke ();
}
+
+ return true;
});
ProcessExpandAnimation (cr, lastCategory, lastCategoryYpos, backColor, area, ref ypos);
@@ -540,6 +549,7 @@ namespace MonoDevelop.DesignerSupport.Toolbox
HideTooltipWindow ();
var oldItem = mouseOverItem;
mouseOverItem = null;
+ Gdk.Rectangle newItemExtents = Gdk.Rectangle.Zero;
this.mouseX = (int)e.X + (int)(this.hAdjustement != null ? this.hAdjustement.Value : 0);
this.mouseY = (int)e.Y + (int)(this.vAdjustement != null ? this.vAdjustement.Value : 0);
Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) {
@@ -547,22 +557,34 @@ namespace MonoDevelop.DesignerSupport.Toolbox
ypos <= mouseY && mouseY <= ypos + itemDimension.Height) {
mouseOverItem = category;
GdkWindow.Cursor = handCursor;
- ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16);
+ if (!e.State.HasFlag (ModifierType.Button1Mask))
+ ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16);
+ newItemExtents = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height);
+ return false;
}
+ return true;
}, delegate (Category curCategory, Item item, Gdk.Size itemDimension) {
if (xpos <= mouseX && mouseX <= xpos + itemDimension.Width &&
ypos <= mouseY && mouseY <= ypos + itemDimension.Height) {
mouseOverItem = item;
GdkWindow.Cursor = null;
- ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16);
+ if (!e.State.HasFlag (ModifierType.Button1Mask))
+ ShowTooltip (mouseOverItem, TipTimer, (int)e.X + 2, (int)e.Y + 16);
+ newItemExtents = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height);
+ return false;
}
+ return true;
});
if (mouseOverItem == null)
GdkWindow.Cursor = null;
- if (oldItem != mouseOverItem)
+ if (oldItem != mouseOverItem) {
this.QueueDraw ();
+ var oldItemExtents = GetItemExtends (oldItem);
+ QueueDrawArea (oldItemExtents.X, oldItemExtents.Y, oldItemExtents.Width, oldItemExtents.Height);
+ QueueDrawArea (newItemExtents.X, newItemExtents.Y, newItemExtents.Width, newItemExtents.Height);
+ }
return base.OnMotionNotifyEvent (e);
}
@@ -612,10 +634,12 @@ namespace MonoDevelop.DesignerSupport.Toolbox
{
Category result = null;
int xpos = 0, ypos = 0;
- Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) {
- }, delegate (Category curCategory, Item innerItem, Gdk.Size itemDimension) {
- if (innerItem == item)
+ Iterate (ref xpos, ref ypos, null, delegate (Category curCategory, Item innerItem, Gdk.Size itemDimension) {
+ if (innerItem == item) {
result = curCategory;
+ return false;
+ }
+ return true;
});
return result;
}
@@ -626,11 +650,13 @@ namespace MonoDevelop.DesignerSupport.Toolbox
Category last = null;
int xpos = 0, ypos = 0;
Iterate (ref xpos, ref ypos, delegate (Category curCategory, Gdk.Size itemDimension) {
- if (last == category)
+ if (last == category) {
result = curCategory;
+ return false;
+ }
last = curCategory;
- }, delegate (Category curCategory, Item innerItem, Gdk.Size itemDimension) {
- });
+ return true;
+ }, null);
return result;
}
@@ -639,10 +665,12 @@ namespace MonoDevelop.DesignerSupport.Toolbox
Item result = item;
Gdk.Rectangle rect = GetItemExtends (item);
int xpos = 0, ypos = 0;
- Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) {
- }, delegate (Category curCategory, Item curItem, Gdk.Size itemDimension) {
- if (xpos > rect.X && ypos == rect.Y && result == item)
+ Iterate (ref xpos, ref ypos, null, delegate (Category curCategory, Item curItem, Gdk.Size itemDimension) {
+ if (xpos > rect.X && ypos == rect.Y && result == item) {
result = curItem;
+ return false;
+ }
+ return true;
});
return result;
}
@@ -652,10 +680,12 @@ namespace MonoDevelop.DesignerSupport.Toolbox
Item result = item;
Gdk.Rectangle rect = GetItemExtends (item);
int xpos = 0, ypos = 0;
- Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) {
- }, delegate (Category curCategory, Item curItem, Gdk.Size itemDimension) {
- if (xpos < rect.X && ypos == rect.Y)
+ Iterate (ref xpos, ref ypos, null, delegate (Category curCategory, Item curItem, Gdk.Size itemDimension) {
+ if (xpos < rect.X && ypos == rect.Y) {
result = curItem;
+ return false;
+ }
+ return true;
});
return result;
}
@@ -667,10 +697,12 @@ namespace MonoDevelop.DesignerSupport.Toolbox
Item result = item;
Gdk.Rectangle rect = GetItemExtends (item);
int xpos = 0, ypos = 0;
- Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) {
- }, delegate (Category curCategory, Item curItem, Gdk.Size itemDimension) {
- if (ypos > rect.Y && xpos == rect.X && result == item && curCategory == itemCategory)
+ Iterate (ref xpos, ref ypos, null, delegate (Category curCategory, Item curItem, Gdk.Size itemDimension) {
+ if (ypos > rect.Y && xpos == rect.X && result == item && curCategory == itemCategory) {
result = curItem;
+ return false;
+ }
+ return true;
});
return result;
}
@@ -681,10 +713,12 @@ namespace MonoDevelop.DesignerSupport.Toolbox
Item result = item;
Gdk.Rectangle rect = GetItemExtends (item);
int xpos = 0, ypos = 0;
- Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) {
- }, delegate (Category curCategory, Item curItem, Gdk.Size itemDimension) {
- if (ypos < rect.Y && xpos == rect.X && curCategory == itemCategory)
+ Iterate (ref xpos, ref ypos, null, delegate (Category curCategory, Item curItem, Gdk.Size itemDimension) {
+ if (ypos < rect.Y && xpos == rect.X && curCategory == itemCategory) {
result = curItem;
+ return false;
+ }
+ return true;
});
return result;
}
@@ -694,11 +728,17 @@ namespace MonoDevelop.DesignerSupport.Toolbox
Gdk.Rectangle result = new Gdk.Rectangle (0, 0, 0, 0);
int xpos = 0, ypos = 0;
Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) {
- if (item == category)
+ if (item == category) {
result = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height);
+ return false;
+ }
+ return true;
}, delegate (Category curCategory, Item curItem, Gdk.Size itemDimension) {
- if (item == curItem)
+ if (item == curItem) {
result = new Gdk.Rectangle (xpos, ypos, itemDimension.Width, itemDimension.Height);
+ return false;
+ }
+ return true;
});
return result;
}
@@ -709,13 +749,19 @@ namespace MonoDevelop.DesignerSupport.Toolbox
Item lastItem = null;
int xpos = 0, ypos = 0;
Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) {
- if (currentItem == category && lastItem != null)
+ if (currentItem == category && lastItem != null) {
result = lastItem;
+ return false;
+ }
lastItem = category;
+ return true;
}, delegate (Category curCategory, Item item, Gdk.Size itemDimension) {
- if (currentItem == item && lastItem != null)
+ if (currentItem == item && lastItem != null) {
result = lastItem;
+ return false;
+ }
lastItem = item;
+ return true;
});
return result;
@@ -729,13 +775,17 @@ namespace MonoDevelop.DesignerSupport.Toolbox
Iterate (ref xpos, ref ypos, delegate (Category category, Gdk.Size itemDimension) {
if (lastItem == currentItem) {
result = category;
+ return false;
}
lastItem = category;
+ return true;
}, delegate (Category curCategory, Item item, Gdk.Size itemDimension) {
if (lastItem == currentItem) {
result = item;
+ return false;
}
lastItem = item;
+ return true;
});
return result;
}
@@ -774,28 +824,32 @@ namespace MonoDevelop.DesignerSupport.Toolbox
#endregion
#region Item & Category iteration
- delegate void CategoryAction (Category category, Gdk.Size categoryDimension);
- delegate void ItemAction (Category curCategory, Item item, Gdk.Size itemDimension);
- void IterateItems (Category category, ref int xpos, ref int ypos, ItemAction action)
+ delegate bool CategoryAction (Category category, Gdk.Size categoryDimension);
+ delegate bool ItemAction (Category curCategory, Item item, Gdk.Size itemDimension);
+ bool IterateItems (Category category, ref int xpos, ref int ypos, ItemAction action)
{
if (listMode || !category.CanIconizeItems) {
foreach (Item item in category.Items) {
if (!item.IsVisible)
continue;
-
- layout.SetText (item.Text);
- int x, y;
- layout.GetPixelSize (out x, out y);
- y = Math.Max (IconSize.Height, y);
- y += ItemTopBottomPadding * 2;
+
+ int x, y = item.ItemHeight;
+
+ if (y == 0) {
+ layout.SetText (item.Text);
+ layout.GetPixelSize (out x, out y);
+ y = Math.Max (IconSize.Height, y);
+ y += ItemTopBottomPadding * 2;
+ item.ItemHeight = y;
+ }
xpos = 0;
- if (action != null)
- action (category, item, new Gdk.Size (Allocation.Width, y));
+ if (action != null && !action (category, item, new Gdk.Size (Allocation.Width, y)))
+ return false;
ypos += y;
}
- return;
+ return true;
}
foreach (Item item in category.Items) {
if (!item.IsVisible)
@@ -804,11 +858,12 @@ namespace MonoDevelop.DesignerSupport.Toolbox
xpos = 0;
ypos += IconSize.Height;
}
- if (action != null)
- action (category, item, IconSize);
+ if (action != null && !action (category, item, IconSize))
+ return false;
xpos += IconSize.Width;
}
ypos += IconSize.Height;
+ return true;
}
void Iterate (ref int xpos, ref int ypos, CategoryAction catAction, ItemAction action)
@@ -818,18 +873,22 @@ namespace MonoDevelop.DesignerSupport.Toolbox
continue;
xpos = 0;
if (this.showCategories) {
-
- layout.SetText (category.Text);
- int x, y;
- layout.GetPixelSize (out x, out y);
- y += CategoryTopBottomPadding * 2;
+ int x, y = category.ItemHeight;
+
+ if (y == 0) {
+ layout.SetText (category.Text);
+ layout.GetPixelSize (out x, out y);
+ y += CategoryTopBottomPadding * 2;
+ category.ItemHeight = y;
+ }
- if (catAction != null)
- catAction (category, new Size (this.Allocation.Width, y));
+ if (catAction != null && !catAction (category, new Size (this.Allocation.Width, y)))
+ return;
ypos += y;
}
if (category.IsExpanded || category.AnimatingExpand || !this.showCategories) {
- IterateItems (category, ref xpos, ref ypos, action);
+ if (!IterateItems (category, ref xpos, ref ypos, action))
+ return;
}
}
}
@@ -1081,6 +1140,11 @@ namespace MonoDevelop.DesignerSupport.Toolbox
return text;
}
}
+
+ public int ItemHeight {
+ get;
+ set;
+ }
public bool IsVisible {
get {
diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj b/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj
index eb1701a30e..053a866ec1 100644
--- a/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj
+++ b/main/src/addins/MonoDevelop.GtkCore/libstetic/libstetic.csproj
@@ -27,7 +27,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>bin\Release</OutputPath>
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.GtkCore</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Execution>
@@ -35,7 +35,7 @@
</Execution>
<DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
- <DocumentationFile>bin\Release\libstetic.xml</DocumentationFile>
+ <DocumentationFile>..\..\..\..\build\AddIns\MonoDevelop.GtkCore\libstetic.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Posix" />
diff --git a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Misc.cs b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Misc.cs
index 44624a73d6..757ab62afd 100644
--- a/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Misc.cs
+++ b/main/src/addins/MonoDevelop.GtkCore/libstetic/wrapper/Misc.cs
@@ -31,5 +31,10 @@ namespace Stetic.Wrapper
((Gtk.Misc)Wrapped).Xalign = 0.5f;
}
}
+
+ public static Gtk.Image CreateInstance ()
+ {
+ return new Gtk.Image (Gtk.Stock.MissingImage, Gtk.IconSize.Menu);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj b/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj
index fb9b52a59d..07386f8269 100644
--- a/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj
+++ b/main/src/addins/MonoDevelop.GtkCore/libsteticui/libsteticui.csproj
@@ -29,7 +29,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
- <OutputPath>bin\Release</OutputPath>
+ <OutputPath>..\..\..\..\build\AddIns\MonoDevelop.GtkCore</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Execution>
@@ -38,7 +38,7 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
- <DocumentationFile>bin\Release\libsteticui.xml</DocumentationFile>
+ <DocumentationFile>..\..\..\..\build\AddIns\MonoDevelop.GtkCore\libsteticui.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Posix" />
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageManagementStartupHandler.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageManagementStartupHandler.cs
index 1177b4d023..4a9a933c57 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageManagementStartupHandler.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Commands/PackageManagementStartupHandler.cs
@@ -113,7 +113,7 @@ namespace MonoDevelop.PackageManagement.Commands
try {
PackageManagementServices.UpdatedPackagesInSolution.CheckForUpdates ();
} catch (Exception ex) {
- LoggingService.LogInternalError ("Check for NuGet package updates error.", ex);
+ LoggingService.LogError ("Check for NuGet package updates error.", ex);
}
}
@@ -125,7 +125,7 @@ namespace MonoDevelop.PackageManagement.Commands
e.Cancel = true;
}
} catch (Exception ex) {
- LoggingService.LogInternalError (ex);
+ LoggingService.LogError ("Error on unloading workspace item.", ex);
}
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackage.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackage.cs
index 1a22b06d86..7ebab31800 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackage.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakePackage.cs
@@ -231,6 +231,15 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
public bool DevelopmentDependency { get; set; }
public bool IsValid { get; set; }
+
+ public IFileSystem FileSystemPassedToExtractContents;
+ public string ExtractPathPassedToExtractContents;
+
+ public void ExtractContents (IFileSystem fileSystem, string extractPath)
+ {
+ FileSystemPassedToExtractContents = fileSystem;
+ ExtractPathPassedToExtractContents = extractPath;
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSettings.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSettings.cs
index 769caa8028..24b3593320 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSettings.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/FakeSettings.cs
@@ -83,30 +83,30 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
PackageSources.Add (valuePair);
}
- public Dictionary<string, KeyValuePair<string, string>> SavedSectionValues =
- new Dictionary<string, KeyValuePair<string, string>> ();
+ public Dictionary<string, SettingValue> SavedSectionValues =
+ new Dictionary<string, SettingValue> ();
public void SetValue (string section, string key, string value)
{
SavedSectionValues.Remove (section);
- SavedSectionValues.Add (section, new KeyValuePair<string, string> (key, value));
+ SavedSectionValues.Add (section, new SettingValue (key, value, false));
}
- public KeyValuePair<string, string> GetValuePassedToSetValueForActivePackageSourceSection ()
+ public SettingValue GetValuePassedToSetValueForActivePackageSourceSection ()
{
return SavedSectionValues [RegisteredPackageSourceSettings.ActivePackageSourceSectionName];
}
- public void SetValues (string section, IList<KeyValuePair<string, string>> values)
+ public void SetValues (string section, IList<SettingValue> values)
{
SavedSectionValueLists.Remove (section);
SavedSectionValueLists.Add (section, values);
}
- public Dictionary<string, IList<KeyValuePair<string, string>>> SavedSectionValueLists
- = new Dictionary<string, IList<KeyValuePair<string, string>>> ();
+ public Dictionary<string, IList<SettingValue>> SavedSectionValueLists
+ = new Dictionary<string, IList<SettingValue>> ();
- public IList<KeyValuePair<string, string>> GetValuesPassedToSetValuesForPackageSourcesSection ()
+ public IList<SettingValue> GetValuesPassedToSetValuesForPackageSourcesSection ()
{
return SavedSectionValueLists [PackageSourcesSectionName];
}
@@ -184,7 +184,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
DisabledPackageSources.Add (setting);
}
- public IList<KeyValuePair<string, string>> GetValuesPassedToSetValuesForDisabledPackageSourcesSection ()
+ public IList<SettingValue> GetValuesPassedToSetValuesForDisabledPackageSourcesSection ()
{
return SavedSectionValueLists [DisabledPackageSourcesSectionName];
}
@@ -202,7 +202,7 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
Sections.Add ("packageRestore", items);
}
- public KeyValuePair<string, string> GetValuePassedToSetValueForPackageRestoreSection ()
+ public SettingValue GetValuePassedToSetValueForPackageRestoreSection ()
{
return SavedSectionValues ["packageRestore"];
}
@@ -219,6 +219,16 @@ namespace MonoDevelop.PackageManagement.Tests.Helpers
items.Add (new SettingValue ("repositoryPath", fullPath, false));
Sections.Add (ConfigSectionName, items);
}
+
+ public Dictionary<string, IList<SettingValue>> SectionsUpdated =
+ new Dictionary<string, IList<SettingValue>> ();
+
+ public void UpdateSections (string section, IList<SettingValue> values)
+ {
+ SectionsUpdated.Remove (section);
+ SectionsUpdated.Add (section, values);
+ SetValues (section, values);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/TestableCheckForUpdatesTaskRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableCheckForUpdatesTaskRunner.cs
index 548db011cc..6744012901 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/TestableCheckForUpdatesTaskRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableCheckForUpdatesTaskRunner.cs
@@ -25,36 +25,32 @@
// THE SOFTWARE.
using System;
+using System.Collections.Generic;
using ICSharpCode.PackageManagement;
using MonoDevelop.Ide;
-using MonoDevelop.PackageManagement.Tests.Helpers;
-namespace MonoDevelop.PackageManagement.Tests
+namespace MonoDevelop.PackageManagement.Tests.Helpers
{
public class TestableCheckForUpdatesTaskRunner : CheckForUpdatesTaskRunner
{
- public TestableCheckForUpdatesTaskRunner (
- ITaskFactory taskFactory,
- IPackageManagementProgressMonitorFactory progressMonitorFactory,
- IPackageManagementEvents packageManagementEvents)
- : base (taskFactory, progressMonitorFactory, packageManagementEvents)
- {
- }
+ public List<string> LoggedErrorMessages = new List<string> ();
+ public List<Exception> LoggedExceptions = new List<Exception> ();
- protected override CheckForUpdatesProgressMonitor CreateProgressMonitor (
- IPackageManagementProgressMonitorFactory progressMonitorFactory,
- IPackageManagementEvents packageManagementEvents)
+ public TestableCheckForUpdatesTaskRunner (ITaskFactory taskFactory)
+ : base (taskFactory)
{
- ProgressMonitorCreated = new TestableCheckForUpdatesProgressMonitor (progressMonitorFactory, packageManagementEvents);
- return ProgressMonitorCreated;
}
- public TestableCheckForUpdatesProgressMonitor ProgressMonitorCreated { get; set; }
-
protected override void GuiBackgroundDispatch (MessageHandler handler)
{
handler.Invoke ();
}
+
+ protected override void LogError (string message, Exception ex)
+ {
+ LoggedErrorMessages.Add (message);
+ LoggedExceptions.Add (ex);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj
index ec5a0df98e..71f6d04262 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.csproj
@@ -42,6 +42,7 @@
<OutputPath>..\..\..\..\build\tests</OutputPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
+ <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
@@ -204,14 +205,13 @@
<Compile Include="MonoDevelop.PackageManagement.Tests\MSBuildTargetsRestoredMonitorTests.cs" />
<Compile Include="MonoDevelop.PackageManagement.Tests\EnsureNuGetPackageBuildImportsTargetUpdaterTests.cs" />
<Compile Include="MonoDevelop.PackageManagement.Tests.Helpers\ExceptionThrowingSolutionPackageRepository.cs" />
- <Compile Include="MonoDevelop.PackageManagement.Tests\CheckForUpdatesProgressMonitorTests.cs" />
- <Compile Include="MonoDevelop.PackageManagement.Tests.Helpers\TestableCheckForUpdatesProgressMonitor.cs" />
- <Compile Include="MonoDevelop.PackageManagement.Tests\TestableCheckForUpdatesTaskRunner.cs" />
<Compile Include="MonoDevelop.PackageManagement.Tests\OpenPackageReadMeMonitorTests.cs" />
<Compile Include="MonoDevelop.PackageManagement.Tests.Helpers\TestableInstallPackageAction.cs" />
<Compile Include="MonoDevelop.PackageManagement.Tests.Helpers\TestableUpdatePackageAction.cs" />
<Compile Include="MonoDevelop.PackageManagement.Tests\FilePathExtensionsTests.cs" />
<Compile Include="MonoDevelop.PackageManagement.Tests\DotNetProjectExtensionsTests.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Tests.Helpers\TestableCheckForUpdatesTaskRunner.cs" />
+ <Compile Include="MonoDevelop.PackageManagement.Tests\MinClientVersionTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/CheckForUpdatesProgressMonitorTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/CheckForUpdatesProgressMonitorTests.cs
deleted file mode 100644
index 56abc52484..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/CheckForUpdatesProgressMonitorTests.cs
+++ /dev/null
@@ -1,148 +0,0 @@
-//
-// CheckForUpdatesProgressMonitorTests.cs
-//
-// Author:
-// Matt Ward <matt.ward@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.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 NUnit.Framework;
-using MonoDevelop.PackageManagement.Tests.Helpers;
-using MonoDevelop.Core;
-using ICSharpCode.PackageManagement;
-using NuGet;
-
-namespace MonoDevelop.PackageManagement.Tests
-{
- [TestFixture]
- public class CheckForUpdatesProgressMonitorTests
- {
- TestableCheckForUpdatesProgressMonitor progressMonitor;
- FakeProgressMonitorFactory progressMonitorFactory;
- FakeProgressMonitor fakeProgressMonitor;
- PackageManagementEvents packageEvents;
-
- void CreateProgressMonitor ()
- {
- progressMonitorFactory = new FakeProgressMonitorFactory ();
- fakeProgressMonitor = progressMonitorFactory.ProgressMonitor;
- packageEvents = new PackageManagementEvents ();
- progressMonitor = new TestableCheckForUpdatesProgressMonitor (progressMonitorFactory, packageEvents);
- }
-
- [Test]
- public void Constructor_NewInstance_CreatesProgressMonitor ()
- {
- CreateProgressMonitor ();
-
- Assert.AreEqual (GettextCatalog.GetString ("Checking for package updates..."), progressMonitorFactory.StatusText);
- }
-
- [Test]
- public void Dispose_NewInstance_ProgressMonitorIsDisposed ()
- {
- CreateProgressMonitor ();
-
- progressMonitor.Dispose ();
-
- Assert.IsTrue (fakeProgressMonitor.IsDisposed);
- }
-
- [Test]
- public void Constructor_PackageManagementMessageEventFired_MessageLoggedToProgressMonitor ()
- {
- CreateProgressMonitor ();
-
- packageEvents.OnPackageOperationMessageLogged (MessageLevel.Info, "MyMessage");
-
- fakeProgressMonitor.AssertMessageIsLogged ("MyMessage");
- }
-
- [Test]
- public void Dispose_MessageLoggedAfterDispose_MessageNotLoggedToProgressMonitor ()
- {
- CreateProgressMonitor ();
- progressMonitor.Dispose ();
-
- packageEvents.OnPackageOperationMessageLogged (MessageLevel.Info, "MyMessage");
-
- fakeProgressMonitor.AssertMessageIsNotLogged ("MyMessage");
- }
-
- [Test]
- public void ReportError_ReportException_ExceptionReportedToProgressMonitor ()
- {
- CreateProgressMonitor ();
- var exception = new Exception ("Error");
-
- progressMonitor.ReportError (exception);
-
- fakeProgressMonitor.AssertMessageIsLogged ("Error");
- Assert.AreEqual (GettextCatalog.GetString ("Could not check for package updates."), fakeProgressMonitor.ReportedErrorMessage);
- Assert.IsTrue (progressMonitor.IsPackageConsoleShown);
- }
-
- [Test]
- public void ReportError_ReportDispatchServiceException_UnderlyingExceptionReported ()
- {
- CreateProgressMonitor ();
- var exception = new Exception ("Error");
- string message = "An exception was thrown while dispatching a method call in the UI thread.";
- var dispatchServiceException = new Exception (message, exception);
-
- progressMonitor.ReportError (dispatchServiceException);
-
- fakeProgressMonitor.AssertMessageIsLogged ("Error");
- }
-
- [Test]
- public void ReportSuccess_UpdatesAvailable_UpdatesAvailableMessageShownByProgressMonitor ()
- {
- CreateProgressMonitor ();
-
- progressMonitor.ReportSuccess (true);
-
- Assert.AreEqual (GettextCatalog.GetString ("Package updates are available."), fakeProgressMonitor.ReportedSuccessMessage);
- }
-
- [Test]
- public void ReportSuccess_NoUpdatesAvailable_NoUpdatesAvailableMessageShownByProgressMonitor ()
- {
- CreateProgressMonitor ();
-
- progressMonitor.ReportSuccess (false);
-
- Assert.AreEqual (GettextCatalog.GetString ("Packages are up to date."), fakeProgressMonitor.ReportedSuccessMessage);
- }
-
- [Test]
- public void ReportSuccess_NoUpdatesAvailableButWarningLogged_NoUpdatesAvailableWithWarningMessageShownByProgressMonitor ()
- {
- CreateProgressMonitor ();
- packageEvents.OnPackageOperationMessageLogged (MessageLevel.Warning, "WarningMessage");
-
- progressMonitor.ReportSuccess (false);
-
- Assert.AreEqual (GettextCatalog.GetString ("No updates found but warnings were reported."), fakeProgressMonitor.ReportedWarningMessage);
- }
- }
-}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MinClientVersionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MinClientVersionTests.cs
new file mode 100644
index 0000000000..4fa2b48c68
--- /dev/null
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/MinClientVersionTests.cs
@@ -0,0 +1,69 @@
+//
+// MinClientVersionTests.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.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 MonoDevelop.PackageManagement.Tests.Helpers;
+using NuGet;
+using NUnit.Framework;
+
+namespace MonoDevelop.PackageManagement.Tests
+{
+ [TestFixture]
+ public class MinClientVersionTests
+ {
+ FakePackage CreatePackageWithMinClientVersion (string minClientVersion)
+ {
+ return new FakePackage ("Test", "1.0") {
+ MinClientVersion = new Version (minClientVersion)
+ };
+ }
+
+ void WalkPackage (IPackage package)
+ {
+ var localRepository = new FakePackageRepository ();
+ var sourceRepository = new FakePackageRepository ();
+ var walker = new InstallWalker (localRepository, sourceRepository, null, NullLogger.Instance, true, false, DependencyVersion.Lowest);
+ walker.Walk (package);
+ }
+
+ [Test]
+ public void MinClientVersion_MicrosoftApplicationInsights_ShouldBeSupportedByNuGet ()
+ {
+ FakePackage package = CreatePackageWithMinClientVersion ("2.8.50313");
+
+ Assert.DoesNotThrow (() => WalkPackage (package));
+ }
+
+ [Test]
+ public void MinClientVersion_VeryHighNuGetVersion_ShouldNotBeSupportedByNuGet ()
+ {
+ FakePackage package = CreatePackageWithMinClientVersion ("9999.99");
+
+ Assert.Throws<NuGetVersionNotSatisfiedException> (() => WalkPackage (package));
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFromRepositoryTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFromRepositoryTests.cs
index b3ad384a74..c83b4aee72 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFromRepositoryTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageFromRepositoryTests.cs
@@ -462,6 +462,19 @@ namespace MonoDevelop.PackageManagement.Tests
Assert.IsTrue (dependency);
}
+
+ [Test]
+ public void ExtractPath_WrappedPackage_WrappedPackageExtractContentsCalled ()
+ {
+ CreatePackage ();
+ var expectedFileSystem = new FakeFileSystem ();
+ string expectedPath = @"d:\projects\test\packages";
+
+ package.ExtractContents (expectedFileSystem, expectedPath);
+
+ Assert.AreEqual (expectedFileSystem, fakePackage.FileSystemPassedToExtractContents);
+ Assert.AreEqual (expectedPath, fakePackage.ExtractPathPassedToExtractContents);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsTests.cs
index f0bf3da6ca..48f81bc6d7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/PackageManagementOptionsTests.cs
@@ -179,16 +179,16 @@ namespace MonoDevelop.PackageManagement.Tests
registeredPackageSources.Clear ();
registeredPackageSources.Add (packageSource);
- var expectedSavedPackageSourceSettings = new List<KeyValuePair<string, string>> ();
- expectedSavedPackageSourceSettings.Add (new KeyValuePair<string, string> ("Test", "http://codeplex.com"));
+ var expectedSavedPackageSourceSettings = new List<SettingValue> ();
+ expectedSavedPackageSourceSettings.Add (new SettingValue ("Test", "http://codeplex.com", false));
- IList<KeyValuePair<string, string>> actualSavedPackageSourceSettings = fakeSettings.GetValuesPassedToSetValuesForPackageSourcesSection ();
+ IList<SettingValue> actualSavedPackageSourceSettings = fakeSettings.GetValuesPassedToSetValuesForPackageSourcesSection ();
Assert.AreEqual (expectedSavedPackageSourceSettings, actualSavedPackageSourceSettings);
}
[Test]
- public void PackageSources_OnePackageSourceAdded_PackageSourcesSectionDeletedFromSettings ()
+ public void PackageSources_OnePackageSourceAdded_PackageSourcesSectionUpdated ()
{
CreateSettings ();
CreateOptions (fakeSettings);
@@ -198,9 +198,11 @@ namespace MonoDevelop.PackageManagement.Tests
registeredPackageSources.Clear ();
registeredPackageSources.Add (packageSource);
- bool sectionDeleted = fakeSettings.IsPackageSourcesSectionDeleted;
+ IList<SettingValue> settings = fakeSettings.SectionsUpdated [RegisteredPackageSourceSettings.PackageSourcesSectionName];
- Assert.IsTrue (sectionDeleted);
+ Assert.AreEqual (1, settings.Count);
+ Assert.AreEqual ("Test", settings[0].Key);
+ Assert.AreEqual ("http://codeplex.com", settings[0].Value);
}
[Test]
@@ -230,10 +232,10 @@ namespace MonoDevelop.PackageManagement.Tests
options.ActivePackageSource = packageSource;
- var expectedKeyValuePair = new KeyValuePair<string, string> ("Test", "http://sharpdevelop.com");
- KeyValuePair<string, string> actualKeyValuePair = fakeSettings.GetValuePassedToSetValueForActivePackageSourceSection ();
+ var expectedSetting = new SettingValue ("Test", "http://sharpdevelop.com", false);
+ SettingValue actualSetting = fakeSettings.GetValuePassedToSetValueForActivePackageSourceSection ();
- Assert.AreEqual (expectedKeyValuePair, actualKeyValuePair);
+ Assert.AreEqual (expectedSetting, actualSetting);
}
[Test]
@@ -395,9 +397,9 @@ namespace MonoDevelop.PackageManagement.Tests
registeredPackageSources.Clear ();
registeredPackageSources.Add (packageSource);
- bool sectionDeleted = fakeSettings.IsDisabledPackageSourcesSectionDeleted;
+ IList<SettingValue> settings = fakeSettings.SectionsUpdated[RegisteredPackageSourceSettings.DisabledPackageSourceSectionName];
- Assert.IsTrue (sectionDeleted);
+ Assert.AreEqual (0, settings.Count);
}
[Test]
@@ -411,10 +413,10 @@ namespace MonoDevelop.PackageManagement.Tests
registeredPackageSources.Clear ();
registeredPackageSources.Add (packageSource);
- var expectedSavedPackageSourceSettings = new List<KeyValuePair<string, string>> ();
- expectedSavedPackageSourceSettings.Add (new KeyValuePair<string, string> (packageSource.Name, "true"));
+ var expectedSavedPackageSourceSettings = new List<SettingValue> ();
+ expectedSavedPackageSourceSettings.Add (new SettingValue (packageSource.Name, "true", false));
- IList<KeyValuePair<string, string>> actualSavedPackageSourceSettings =
+ IList<SettingValue> actualSavedPackageSourceSettings =
fakeSettings.GetValuesPassedToSetValuesForDisabledPackageSourcesSection ();
Assert.AreEqual (expectedSavedPackageSourceSettings, actualSavedPackageSourceSettings);
}
@@ -430,7 +432,7 @@ namespace MonoDevelop.PackageManagement.Tests
registeredPackageSources.Clear ();
registeredPackageSources.Add (packageSource);
- IList<KeyValuePair<string, string>> actualSavedPackageSourceSettings =
+ IList<SettingValue> actualSavedPackageSourceSettings =
fakeSettings.GetValuesPassedToSetValuesForDisabledPackageSourcesSection ();
Assert.AreEqual (0, actualSavedPackageSourceSettings.Count);
}
@@ -464,10 +466,10 @@ namespace MonoDevelop.PackageManagement.Tests
options.IsPackageRestoreEnabled = true;
- KeyValuePair<string, string> keyPair = fakeSettings.GetValuePassedToSetValueForPackageRestoreSection ();
+ SettingValue setting = fakeSettings.GetValuePassedToSetValueForPackageRestoreSection ();
- Assert.AreEqual ("enabled", keyPair.Key);
- Assert.AreEqual ("True", keyPair.Value);
+ Assert.AreEqual ("enabled", setting.Key);
+ Assert.AreEqual ("True", setting.Value);
}
[Test]
@@ -492,8 +494,8 @@ namespace MonoDevelop.PackageManagement.Tests
options.IsPackageRestoreEnabled = false;
- KeyValuePair<string, string> keyValuePair = fakeSettings.GetValuePassedToSetValueForPackageRestoreSection ();
- Assert.AreEqual ("False", keyValuePair.Value);
+ SettingValue setting = fakeSettings.GetValuePassedToSetValueForPackageRestoreSection ();
+ Assert.AreEqual ("False", setting.Value);
}
[Test]
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesInSolutionTests.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesInSolutionTests.cs
index 0469b53d99..a67593fd7c 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesInSolutionTests.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests/UpdatedPackagesInSolutionTests.cs
@@ -54,10 +54,7 @@ namespace MonoDevelop.PackageManagement.Tests
taskFactory = new FakeTaskFactory ();
taskFactory.RunTasksSynchronously = true;
progressMonitorFactory = new FakeProgressMonitorFactory ();
- checkForUpdatesTaskRunner = new TestableCheckForUpdatesTaskRunner (
- taskFactory,
- progressMonitorFactory,
- packageManagementEvents);
+ checkForUpdatesTaskRunner = new TestableCheckForUpdatesTaskRunner (taskFactory);
updatedPackagesInSolution = new TestableUpdatedPackagesInSolution (
solution,
registeredPackageRepositories,
@@ -387,61 +384,7 @@ namespace MonoDevelop.PackageManagement.Tests
}
[Test]
- public void CheckForUpdates_OnePackageUpdated_ProgressMonitorCreatedAndDisposedAfterCheckForUpdatesReturned ()
- {
- CreateUpdatedPackagesInSolution ();
- taskFactory.RunTasksSynchronously = false;
- FakePackageManagementProject project = AddProjectToSolution ();
- project.AddPackageReference ("MyPackage", "1.0");
- AddUpdatedPackageToAggregateSourceRepository ("MyPackage", "1.1");
- updatedPackagesInSolution.CheckForUpdates ();
- bool progressMonitorCreated = checkForUpdatesTaskRunner.ProgressMonitorCreated != null;
- bool disposedBeforeTaskRun = progressMonitorFactory.ProgressMonitor.IsDisposed;
-
- taskFactory.ExecuteAllTasks<CheckForUpdatesTask> ();
-
- Assert.IsTrue (progressMonitorCreated);
- Assert.IsFalse (disposedBeforeTaskRun);
- Assert.IsTrue (progressMonitorFactory.ProgressMonitor.IsDisposed);
- }
-
- [Test]
- public void CheckForUpdates_OnePackageUpdatedButSolutionClosedBeforeResultsReturned_ProgressMonitorIsDisposed ()
- {
- CreateUpdatedPackagesInSolution ();
- taskFactory.RunTasksSynchronously = false;
- FakePackageManagementProject project = AddProjectToSolution ();
- project.AddPackageReference ("MyPackage", "1.0");
- AddUpdatedPackageToAggregateSourceRepository ("MyPackage", "1.1");
- updatedPackagesInSolution.CheckForUpdates ();
- bool progressMonitorCreated = checkForUpdatesTaskRunner.ProgressMonitorCreated != null;
- bool disposedBeforeTaskRun = progressMonitorFactory.ProgressMonitor.IsDisposed;
- var task = taskFactory.FakeTasksCreated [0] as FakeTask<CheckForUpdatesTask>;
- task.ExecuteTaskButNotContinueWith ();
- updatedPackagesInSolution.Clear ();
-
- task.ExecuteContinueWith ();
-
- Assert.IsTrue (progressMonitorCreated);
- Assert.IsFalse (disposedBeforeTaskRun);
- Assert.IsTrue (progressMonitorFactory.ProgressMonitor.IsDisposed);
- }
-
- [Test]
- public void CheckForUpdates_OnePackageUpdated_SuccessReportedToProgressMonitor ()
- {
- CreateUpdatedPackagesInSolution ();
- FakePackageManagementProject project = AddProjectToSolution ();
- project.AddPackageReference ("MyPackage", "1.0");
- AddUpdatedPackageToAggregateSourceRepository ("MyPackage", "1.1");
-
- updatedPackagesInSolution.CheckForUpdates ();
-
- Assert.AreEqual (GettextCatalog.GetString ("Package updates are available."), progressMonitorFactory.ProgressMonitor.ReportedSuccessMessage);
- }
-
- [Test]
- public void CheckForUpdates_NoPackagesUpdated_SuccessReportedToProgressMonitor ()
+ public void CheckForUpdates_NoPackagesUpdated_NoUpdates ()
{
CreateUpdatedPackagesInSolution ();
FakePackageManagementProject project = AddProjectToSolution ();
@@ -451,11 +394,10 @@ namespace MonoDevelop.PackageManagement.Tests
UpdatedPackagesInProject updatedPackages = updatedPackagesInSolution.GetUpdatedPackages (project.Project);
Assert.IsFalse (updatedPackagesInSolution.AnyUpdates ());
- Assert.AreEqual (GettextCatalog.GetString ("Packages are up to date."), progressMonitorFactory.ProgressMonitor.ReportedSuccessMessage);
}
[Test]
- public void CheckForUpdates_ExceptionThrownWhilstCheckingForUpdates_ErrorReportedToProgressMonitorWhichIsDisposed ()
+ public void CheckForUpdates_ExceptionThrownWhilstCheckingForUpdates_ExceptionLogged ()
{
CreateUpdatedPackagesInSolution ();
taskFactory.RunTasksSynchronously = false;
@@ -471,14 +413,12 @@ namespace MonoDevelop.PackageManagement.Tests
task.Result = null;
task.ExecuteContinueWith ();
- Assert.AreEqual (GettextCatalog.GetString ("Could not check for package updates."), progressMonitorFactory.ProgressMonitor.ReportedErrorMessage);
- Assert.IsTrue (checkForUpdatesTaskRunner.ProgressMonitorCreated.IsPackageConsoleShown);
- progressMonitorFactory.ProgressMonitor.AssertMessageIsLogged ("Inner exception error message");
- Assert.IsTrue (progressMonitorFactory.ProgressMonitor.IsDisposed);
+ Assert.AreEqual ("Current check for updates task error.", checkForUpdatesTaskRunner.LoggedErrorMessages[0]);
+ Assert.AreEqual (task.Exception, checkForUpdatesTaskRunner.LoggedExceptions[0]);
}
[Test]
- public void CheckForUpdates_ExceptionThrownWhilstCheckingForUpdatesButSolutionClosedBeforeCheckForUpdatesReturns_ErrorIsNotReportedButProgressMonitorIsDisposed ()
+ public void CheckForUpdates_ExceptionThrownWhilstCheckingForUpdatesButSolutionClosedBeforeCheckForUpdatesReturns_ErrorIsLogged ()
{
CreateUpdatedPackagesInSolution ();
taskFactory.RunTasksSynchronously = false;
@@ -494,13 +434,12 @@ namespace MonoDevelop.PackageManagement.Tests
task.Result = null;
task.ExecuteContinueWith ();
- Assert.IsNull (progressMonitorFactory.ProgressMonitor.ReportedErrorMessage);
- progressMonitorFactory.ProgressMonitor.AssertMessageIsNotLogged ("Error message");
- Assert.IsTrue (progressMonitorFactory.ProgressMonitor.IsDisposed);
+ Assert.AreEqual ("Check for updates task error.", checkForUpdatesTaskRunner.LoggedErrorMessages[0]);
+ Assert.AreEqual (task.Exception, checkForUpdatesTaskRunner.LoggedExceptions[0]);
}
[Test]
- public void CheckForUpdates_ExceptionThrownWhilstCheckingForUpdatesButSolutionClosedBeforeCheckForUpdatesReturnsAndSecondCheckForUpdatesIsStarted_ErrorIsNotReported ()
+ public void CheckForUpdates_ExceptionThrownWhilstCheckingForUpdatesButSolutionClosedBeforeCheckForUpdatesReturnsAndSecondCheckForUpdatesIsStarted_ErrorIsLogged ()
{
CreateUpdatedPackagesInSolution ();
taskFactory.RunTasksSynchronously = false;
@@ -516,9 +455,8 @@ namespace MonoDevelop.PackageManagement.Tests
task.Result = null;
task.ExecuteContinueWith ();
- Assert.IsNull (progressMonitorFactory.ProgressMonitor.ReportedErrorMessage);
- progressMonitorFactory.ProgressMonitor.AssertMessageIsNotLogged ("Error message");
- Assert.IsTrue (progressMonitorFactory.ProgressMonitor.IsDisposed);
+ Assert.AreEqual ("Check for updates task error.", checkForUpdatesTaskRunner.LoggedErrorMessages[0]);
+ Assert.AreEqual (task.Exception, checkForUpdatesTaskRunner.LoggedExceptions[0]);
}
[Test]
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj
index 111d26d622..e1673e7ae1 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.csproj
@@ -46,6 +46,7 @@
<OutputPath>..\..\..\build\AddIns\MonoDevelop.PackageManagement</OutputPath>
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
+ <CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
</PropertyGroup>
<ItemGroup>
<Reference Include="pango-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
@@ -342,7 +343,6 @@
<Compile Include="MonoDevelop.PackageManagement\IUpdatedPackagesInSolution.cs" />
<Compile Include="MonoDevelop.PackageManagement\FallbackRepository.cs" />
<Compile Include="MonoDevelop.PackageManagement.Commands\PackageManagementStartupHandler.cs" />
- <Compile Include="MonoDevelop.PackageManagement\PackageUpdatesEventMonitor.cs" />
<Compile Include="MonoDevelop.PackageManagement\UpdatedPackagesMonitor.cs" />
<Compile Include="MonoDevelop.PackageManagement\UpdatePackagesProgressMonitorStatusMessage.cs" />
<Compile Include="MonoDevelop.PackageManagement\CheckForUpdatedPackagesAction.cs" />
@@ -364,13 +364,13 @@
<Compile Include="MonoDevelop.PackageManagement\MSBuildTargetsRestoredMonitor.cs" />
<Compile Include="MonoDevelop.PackageManagement\PackageManagementMSBuildExtension.cs" />
<Compile Include="MonoDevelop.PackageManagement\EnsureNuGetPackageBuildImportsTargetUpdater.cs" />
- <Compile Include="MonoDevelop.PackageManagement\CheckForUpdatesProgressMonitor.cs" />
<Compile Include="MonoDevelop.PackageManagement\CheckForUpdatesTaskRunner.cs" />
<Compile Include="MonoDevelop.PackageManagement\CheckForUpdatesTask.cs" />
<Compile Include="MonoDevelop.PackageManagement\ProjectReloadedEventArgs.cs" />
<Compile Include="MonoDevelop.PackageManagement\OpenPackageReadmeMonitor.cs" />
<Compile Include="MonoDevelop.PackageManagement\IOpenPackageReadMeMonitor.cs" />
<Compile Include="MonoDevelop.PackageManagement\NullOpenPackageReadMeMonitor.cs" />
+ <Compile Include="MonoDevelop.PackageManagement\PackageManagementSolutionExtensions.cs" />
<Compile Include="MonoDevelop.PackageManagement\DotNetProjectReferenceEventArgs.cs" />
<Compile Include="MonoDevelop.PackageManagement\LocalCopyReferenceMaintainer.cs" />
<Compile Include="MonoDevelop.PackageManagement\DotNetSolutionEventArgs.cs" />
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/BackgroundPackageActionRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/BackgroundPackageActionRunner.cs
index fbe1ad52f9..258e102084 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/BackgroundPackageActionRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/BackgroundPackageActionRunner.cs
@@ -210,7 +210,7 @@ namespace MonoDevelop.PackageManagement
public void ShowError (ProgressMonitorStatusMessage progressMessage, Exception exception)
{
- LoggingService.LogInternalError (progressMessage.Status, exception);
+ LoggingService.LogError (progressMessage.Error, exception);
ShowError (progressMessage, exception.Message);
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesProgressMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesProgressMonitor.cs
deleted file mode 100644
index dbcb6fe501..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesProgressMonitor.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-//
-// CheckForUpdatesProgressMonitor.cs
-//
-// Author:
-// Matt Ward <matt.ward@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.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 ICSharpCode.PackageManagement;
-using MonoDevelop.Core;
-
-namespace MonoDevelop.PackageManagement
-{
- public class CheckForUpdatesProgressMonitor : IDisposable
- {
- ProgressMonitorStatusMessage progressMessage;
- IProgressMonitor progressMonitor;
- PackageUpdatesEventMonitor eventMonitor;
-
- public CheckForUpdatesProgressMonitor ()
- : this (
- PackageManagementServices.ProgressMonitorFactory,
- PackageManagementServices.PackageManagementEvents)
- {
- }
-
- public CheckForUpdatesProgressMonitor (
- IPackageManagementProgressMonitorFactory progressMonitorFactory,
- IPackageManagementEvents packageEvents)
- {
- progressMessage = ProgressMonitorStatusMessageFactory.CreateCheckingForPackageUpdatesMessage ();
- this.progressMonitor = progressMonitorFactory.CreateProgressMonitor (progressMessage.Status);
-
- eventMonitor = new PackageUpdatesEventMonitor (progressMonitor, packageEvents);
- }
-
- public void Dispose ()
- {
- eventMonitor.Dispose ();
- progressMonitor.Dispose ();
- }
-
- public void ReportError (Exception ex)
- {
- LoggingService.LogInternalError (ex);
- if (IsGuiDispatchException (ex)) {
- progressMonitor.Log.WriteLine (ex.InnerException.Message);
- } else if (ex is AggregateException) {
- LogAggregateException ((AggregateException)ex);
- } else {
- progressMonitor.Log.WriteLine (ex.Message);
- }
- progressMonitor.ReportError (progressMessage.Error, null);
- ShowPackageConsole ();
- }
-
- static bool IsGuiDispatchException (Exception ex)
- {
- return (ex.InnerException != null) &&
- (ex.Message == "An exception was thrown while dispatching a method call in the UI thread.");
- }
-
- void LogAggregateException (AggregateException ex)
- {
- progressMonitor.Log.WriteLine (new AggregateExceptionErrorMessage (ex));
- }
-
- protected virtual void ShowPackageConsole ()
- {
- progressMonitor.ShowPackageConsole ();
- }
-
- public void ReportSuccess (bool anyUpdates)
- {
- if (anyUpdates) {
- progressMonitor.ReportSuccess (GettextCatalog.GetString ("Package updates are available."));
- } else if (eventMonitor.WarningReported) {
- progressMonitor.ReportWarning (progressMessage.Warning);
- } else {
- progressMonitor.ReportSuccess (progressMessage.Success);
- }
- }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTask.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTask.cs
index 45d7c73716..d59e6517f8 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTask.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTask.cs
@@ -65,7 +65,6 @@ namespace MonoDevelop.PackageManagement
public void CheckForUpdatesCompleted ()
{
- ProgressMonitor.ReportSuccess (projectsWithUpdatedPackages.Any ());
updatedPackagesInSolution.CheckForUpdatesCompleted (this);
}
@@ -73,23 +72,12 @@ namespace MonoDevelop.PackageManagement
get { return projectsWithUpdatedPackages; }
}
- public CheckForUpdatesProgressMonitor ProgressMonitor { get; set; }
-
public void Dispose ()
{
if (!disposed) {
disposed = true;
- if (ProgressMonitor != null) {
- ProgressMonitor.Dispose ();
- ProgressMonitor = null;
- }
}
}
-
- public void ReportError (Exception ex)
- {
- ProgressMonitor.ReportError (ex);
- }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTaskRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTaskRunner.cs
index 0a01ea6163..c323d30246 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTaskRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/CheckForUpdatesTaskRunner.cs
@@ -25,7 +25,6 @@
// THE SOFTWARE.
using System;
-using System.Collections.Generic;
using ICSharpCode.PackageManagement;
using MonoDevelop.Core;
using MonoDevelop.Ide;
@@ -35,26 +34,16 @@ namespace MonoDevelop.PackageManagement
public class CheckForUpdatesTaskRunner : IDisposable
{
ITaskFactory taskFactory;
- IPackageManagementProgressMonitorFactory progressMonitorFactory;
- IPackageManagementEvents packageManagementEvents;
CheckForUpdatesTask currentCheckForUpdatesTask;
ITask<CheckForUpdatesTask> task;
- public CheckForUpdatesTaskRunner (
- ITaskFactory taskFactory,
- IPackageManagementProgressMonitorFactory progressMonitorFactory,
- IPackageManagementEvents packageManagementEvents)
+ public CheckForUpdatesTaskRunner (ITaskFactory taskFactory)
{
this.taskFactory = taskFactory;
- this.progressMonitorFactory = progressMonitorFactory;
- this.packageManagementEvents = packageManagementEvents;
}
public CheckForUpdatesTaskRunner ()
- : this (
- new PackageManagementTaskFactory (),
- PackageManagementServices.ProgressMonitorFactory,
- PackageManagementServices.PackageManagementEvents)
+ : this (new PackageManagementTaskFactory ())
{
}
@@ -74,7 +63,6 @@ namespace MonoDevelop.PackageManagement
void CreateCheckForUpdatesTask (CheckForUpdatesTask checkForUpdatesTask)
{
currentCheckForUpdatesTask = checkForUpdatesTask;
- checkForUpdatesTask.ProgressMonitor = CreateProgressMonitor ();
task = taskFactory.CreateTask (
() => CheckForUpdates (checkForUpdatesTask),
@@ -108,9 +96,9 @@ namespace MonoDevelop.PackageManagement
{
if (task.IsFaulted) {
if (IsCurrentTask (task)) {
- ReportError (task.Exception);
+ LogError ("Current check for updates task error.", task.Exception);
} else {
- LoggingService.LogInternalError ("Check for updates task error.", task.Exception);
+ LogError ("Check for updates task error.", task.Exception);
}
} else if (task.IsCancelled) {
// Ignore.
@@ -134,13 +122,9 @@ namespace MonoDevelop.PackageManagement
return currentCheckForUpdatesTask == task;
}
- void ReportError (Exception ex)
+ protected virtual void LogError (string message, Exception ex)
{
- CheckForUpdatesTask task = currentCheckForUpdatesTask;
- task.ReportError (ex);
- GuiBackgroundDispatch (() => {
- task.Dispose ();
- });
+ LoggingService.LogError (message, ex);
}
bool IsCurrentTask (ITask<CheckForUpdatesTask> taskToCompare)
@@ -148,18 +132,6 @@ namespace MonoDevelop.PackageManagement
return taskToCompare == task;
}
- CheckForUpdatesProgressMonitor CreateProgressMonitor ()
- {
- return CreateProgressMonitor (progressMonitorFactory, packageManagementEvents);
- }
-
- protected virtual CheckForUpdatesProgressMonitor CreateProgressMonitor (
- IPackageManagementProgressMonitorFactory progressMonitorFactory,
- IPackageManagementEvents packageManagementEvents)
- {
- return new CheckForUpdatesProgressMonitor (progressMonitorFactory, packageManagementEvents);
- }
-
protected virtual void GuiBackgroundDispatch (MessageHandler handler)
{
DispatchService.BackgroundDispatch (handler);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs
index 56a5227376..f597c22480 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageFromRepository.cs
@@ -231,5 +231,10 @@ namespace ICSharpCode.PackageManagement
return true;
}
}
+
+ public void ExtractContents (IFileSystem fileSystem, string extractPath)
+ {
+ package.ExtractContents (fileSystem, extractPath);
+ }
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEventsMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEventsMonitor.cs
index 5e8ec633b8..a6130d65f7 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEventsMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementEventsMonitor.cs
@@ -192,7 +192,7 @@ namespace MonoDevelop.PackageManagement
public void ReportError (ProgressMonitorStatusMessage progressMessage, Exception ex)
{
- LoggingService.LogInternalError (ex);
+ LoggingService.LogError (progressMessage.Error, ex);
progressMonitor.Log.WriteLine (ex.Message);
progressMonitor.ReportError (progressMessage.Error, null);
ShowPackageConsole (progressMonitor);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs
index ccf2cb438c..f07f6e48b2 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementServices.cs
@@ -100,7 +100,7 @@ namespace ICSharpCode.PackageManagement
try {
return Settings.LoadDefaultSettings (null, null, null);
} catch (Exception ex) {
- LoggingService.LogInternalError ("Unable to load NuGet.Config.", ex);
+ LoggingService.LogError ("Unable to load NuGet.Config.", ex);
}
return NullSettings.Instance;
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableCheckForUpdatesProgressMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs
index d35e6aefe5..4f9ef87876 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Tests/MonoDevelop.PackageManagement.Tests.Helpers/TestableCheckForUpdatesProgressMonitor.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageManagementSolutionExtensions.cs
@@ -1,49 +1,43 @@
-//
-// TestableCheckForUpdatesProgressMonitor.cs
-//
-// Author:
-// Matt Ward <matt.ward@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.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 ICSharpCode.PackageManagement;
-
-namespace MonoDevelop.PackageManagement.Tests.Helpers
-{
- public class TestableCheckForUpdatesProgressMonitor : CheckForUpdatesProgressMonitor
- {
- public TestableCheckForUpdatesProgressMonitor (
- IPackageManagementProgressMonitorFactory progressMonitorFactory,
- IPackageManagementEvents packageEvents)
- : base (progressMonitorFactory, packageEvents)
- {
- }
-
- public bool IsPackageConsoleShown;
-
- protected override void ShowPackageConsole ()
- {
- IsPackageConsoleShown = true;
- }
- }
-}
-
+//
+// PackageManagementSolutionExtensions.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.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 MonoDevelop.PackageManagement;
+using MonoDevelop.Projects;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class PackageManagementSolutionExtensions
+ {
+ public static IPackageManagementProject GetProject (this IPackageManagementSolution solution, DotNetProject project)
+ {
+ var projectProxy = new DotNetProjectProxy (project);
+ var repository = PackageManagementServices.PackageRepositoryCache.CreateAggregateWithPriorityMachineCacheRepository ();
+ return solution.GetProject (repository, projectProxy);
+ }
+ }
+}
+
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoreRunner.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoreRunner.cs
index 2dd4d79a71..0b905a25cb 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoreRunner.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestoreRunner.cs
@@ -82,7 +82,7 @@ namespace MonoDevelop.PackageManagement
try {
RestorePackages (progressMonitor, progressMessage);
} catch (Exception ex) {
- LoggingService.LogInternalError (ex);
+ LoggingService.LogError (progressMessage.Error, ex);
progressMonitor.Log.WriteLine (ex.Message);
progressMonitor.ReportError (progressMessage.Error, null);
progressMonitor.ShowPackageConsole ();
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestorer.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestorer.cs
index 912e981ecc..f13c9f3fb3 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestorer.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageRestorer.cs
@@ -77,7 +77,7 @@ namespace MonoDevelop.PackageManagement
RestoreWithProgressMonitor (progressMessage);
}
} catch (Exception ex) {
- LoggingService.LogInternalError (ex);
+ LoggingService.LogError ("Package restore failed", ex);
RestoreFailed = true;
}
}
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageUpdatesEventMonitor.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageUpdatesEventMonitor.cs
deleted file mode 100644
index cfb21f91da..0000000000
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/PackageUpdatesEventMonitor.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// PackageUpdatesEventMonitor.cs
-//
-// Author:
-// Matt Ward <matt.ward@xamarin.com>
-//
-// Copyright (c) 2014 Xamarin Inc. (http://xamarin.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 ICSharpCode.PackageManagement;
-using MonoDevelop.Core;
-using NuGet;
-
-namespace MonoDevelop.PackageManagement
-{
- public class PackageUpdatesEventMonitor : IDisposable
- {
- IPackageManagementEvents packageEvents;
- IProgressMonitor progressMonitor;
-
- public PackageUpdatesEventMonitor (IProgressMonitor progressMonitor)
- : this (
- progressMonitor,
- PackageManagementServices.PackageManagementEvents)
- {
- }
-
- public PackageUpdatesEventMonitor (
- IProgressMonitor progressMonitor,
- IPackageManagementEvents packageEvents)
- {
- this.progressMonitor = progressMonitor;
- this.packageEvents = packageEvents;
-
- packageEvents.PackageOperationMessageLogged += PackageOperationMessageLogged;
- }
-
- void PackageOperationMessageLogged (object sender, PackageOperationMessageLoggedEventArgs e)
- {
- progressMonitor.Log.WriteLine (e.Message.ToString ());
-
- if (e.Message.Level == MessageLevel.Warning) {
- WarningReported = true;
- }
- }
-
- public void Dispose ()
- {
- packageEvents.PackageOperationMessageLogged -= PackageOperationMessageLogged;
- }
-
- public bool WarningReported { get; private set; }
- }
-}
-
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs
index cf75931581..6cb5f30fb4 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProcessPackageOperationsAction.cs
@@ -28,9 +28,7 @@
using System.Collections.Generic;
using System.Linq;
-using MonoDevelop.PackageManagement;
using NuGet;
-using MonoDevelop.PackageManagement;
namespace ICSharpCode.PackageManagement
{
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs
index 6bc99bf3f8..6c42dbef5f 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/ProgressMonitorStatusMessageFactory.cs
@@ -213,15 +213,6 @@ namespace MonoDevelop.PackageManagement
);
}
- public static ProgressMonitorStatusMessage CreateCheckingForPackageUpdatesMessage ()
- {
- return new ProgressMonitorStatusMessage (
- GetString ("Checking for package updates..."),
- GetString ("Packages are up to date."),
- GetString ("Could not check for package updates."),
- GetString ("No updates found but warnings were reported."));
- }
-
static string GetString (string phrase)
{
return GettextCatalog.GetString (phrase);
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs
index 8369605e22..1986fcc729 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/RegisteredPackageSourceSettings.cs
@@ -39,7 +39,9 @@ namespace ICSharpCode.PackageManagement
{
public class RegisteredPackageSourceSettings
{
+ public static readonly string PackageSourcesSectionName = "packageSources";
public static readonly string ActivePackageSourceSectionName = "activePackageSource";
+ public static readonly string DisabledPackageSourceSectionName = "disabledPackageSources";
public static readonly PackageSource AggregatePackageSource =
new PackageSource("(Aggregate source)", "All");
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsProvider.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsProvider.cs
index 2488c558da..7f89c7f8bb 100644
--- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsProvider.cs
+++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement/SettingsProvider.cs
@@ -66,7 +66,7 @@ namespace MonoDevelop.PackageManagement
try {
return LoadSettings (GetSolutionDirectory ());
} catch (Exception ex) {
- LoggingService.LogInternalError ("Unable to load NuGet.Config file.", ex);
+ LoggingService.LogError ("Unable to load NuGet.Config file.", ex);
}
return NullSettings.Instance;
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs
index 392aacd522..619a60fa9e 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.AnalysisCore/AnalysisCommands.cs
@@ -25,6 +25,7 @@
// THE SOFTWARE.
using System;
+using MonoDevelop.Components;
using MonoDevelop.Components.Commands;
using System.Linq;
using MonoDevelop.Core;
@@ -120,6 +121,8 @@ namespace MonoDevelop.AnalysisCore
((System.Action)dataItem) ();
return;
}
+ if (!RefactoringService.CheckUserSettings ())
+ return;
var action = dataItem as IAnalysisFixAction;
if (action != null) {
action.Fix ();
@@ -289,7 +292,7 @@ namespace MonoDevelop.AnalysisCore
{
var lang = "text/x-csharp";
- OpenFileDialog dlg = new OpenFileDialog ("Export Rules", FileChooserAction.Save);
+ OpenFileDialog dlg = new OpenFileDialog ("Export Rules", MonoDevelop.Components.FileChooserAction.Save);
dlg.InitialFileName = "rules.html";
if (!dlg.Run ())
return;
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
index 8cbdfbf6dc..fc93c8dc00 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.CodeActions/CodeActionEditorExtension.cs
@@ -429,6 +429,8 @@ namespace MonoDevelop.CodeActions
void PopulateFixes (FixMenuDescriptor menu, ref int items)
{
+ if (!RefactoringService.ShowFixes)
+ return;
int mnemonic = 1;
bool gotImportantFix = false, addedSeparator = false;
var fixesAdded = new List<string> ();
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs
index e4498221a7..69852183a5 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.Rename/RenameItemDialog.cs
@@ -140,6 +140,7 @@ namespace MonoDevelop.Refactoring.Rename
buttonPreview.Clicked += OnPreviewClicked;
entry.Changed += delegate { buttonPreview.Sensitive = buttonOk.Sensitive = ValidateName (); };
ValidateName ();
+ this.hbox1.HideAll ();
}
bool ValidateName ()
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml
index 8151d80966..ed0ba0695c 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.addin.xml
@@ -95,7 +95,7 @@
defaultHandler = "MonoDevelop.Refactoring.ResolveCommandHandler"
type="array"
_label = "Resolve"/>
-
+
<Command id = "MonoDevelop.Refactoring.RefactoryCommands.CurrentRefactoryOperations"
defaultHandler = "MonoDevelop.Refactoring.CurrentRefactoryOperationsHandler"
type="array"
@@ -182,7 +182,7 @@
func="MonoDevelop.AnalysisCore.Rules.NamingConventions.ClassNaming" />-->
</Category>
</Extension>
-
+
<Extension path = "/MonoDevelop/AnalysisCore/FixHandlers">
<Handler fixName="RenameMember" class = "MonoDevelop.AnalysisCore.Fixes.RenameMemberHandler" />
<Handler fixName="Generic" class = "MonoDevelop.AnalysisCore.Fixes.GenericFixHandler" />
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj
index d47fae2ad7..6fe3d47b41 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring.csproj
@@ -42,6 +42,7 @@
<NoWarn>1591;1573</NoWarn>
<DebugSymbols>true</DebugSymbols>
<DocumentationFile>..\..\..\build\AddIns\MonoDevelop.Refactoring\MonoDevelop.Refactoring.xml</DocumentationFile>
+ <DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseMac|AnyCPU' ">
<Optimize>true</Optimize>
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs
index 64096e8329..9e18efff67 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoringService.cs
@@ -42,6 +42,7 @@ using Mono.TextEditor;
using MonoDevelop.Ide.TypeSystem;
using System.Diagnostics;
using MonoDevelop.Core.Instrumentation;
+using MonoDevelop.Ide;
namespace MonoDevelop.Refactoring
{
@@ -293,10 +294,53 @@ namespace MonoDevelop.Refactoring
return RunAll (allFixes, refactoringContext, script);
}
}
-
+
+ const string EnableRefactorings = "RefactoringSettings.EnableRefactorings";
+
+ internal static bool CheckUserSettings()
+ {
+ var hasRefactoringSettings = IdeApp.ProjectOperations.CurrentSelectedSolution == null ||
+ IdeApp.ProjectOperations.CurrentSelectedSolution.UserProperties.HasValue (EnableRefactorings);
+ if (!hasRefactoringSettings) {
+ var useRefactoringsButton = new AlertButton (GettextCatalog.GetString("Use refactorings on this solution"));
+ var text = GettextCatalog.GetString (
+@"WARNING: The Xamarin Studio refactoring operations do not yet support C# 6.
+
+You may continue to use refactoring operations with C# 6, however you should check the results carefully to make sure that they have not made incorrect changes to your code. In particular, the ""?."" null propagating dereference will be changed to ""."", a simple dereference, which can cause unexpected NullReferenceExceptions at runtime.");
+ var message = new QuestionMessage (text);
+ message.Buttons.Add (useRefactoringsButton);
+ message.Buttons.Add (AlertButton.Cancel);
+ message.Icon = Gtk.Stock.DialogWarning;
+ message.DefaultButton = 1;
+
+ var result = MessageService.AskQuestion (message);
+ if (result == AlertButton.Cancel)
+ return false;
+ ShowFixes = result == useRefactoringsButton;
+ }
+ return ShowFixes;
+ }
+
+ internal static bool ShowFixes {
+ get {
+ if (Ide.IdeApp.ProjectOperations.CurrentSelectedSolution != null) {
+ var hasRefactoringSettings = IdeApp.ProjectOperations.CurrentSelectedSolution.UserProperties.HasValue (EnableRefactorings);
+ return !hasRefactoringSettings || IdeApp.ProjectOperations.CurrentSelectedSolution.UserProperties.GetValue<bool> (EnableRefactorings);
+ }
+ return true;
+ }
+ set {
+ IdeApp.ProjectOperations.CurrentSelectedSolution.UserProperties.SetValue (EnableRefactorings, value);
+ IdeApp.ProjectOperations.CurrentSelectedSolution.SaveUserProperties ();
+ }
+ }
+
+
public static void ApplyFix (CodeAction action, IRefactoringContext context)
{
- using(var script = context.CreateScript ()) {
+ if (!CheckUserSettings ())
+ return;
+ using (var script = context.CreateScript ()) {
action.Run (context, script);
}
}
diff --git a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs
index 1dd79118c7..d89a7c4081 100644
--- a/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs
+++ b/main/src/addins/MonoDevelop.Refactoring/MonoDevelop.Refactoring/RefactoryCommands.cs
@@ -269,49 +269,49 @@ namespace MonoDevelop.Refactoring
}));
added = true;
}
-
- foreach (var refactoring in RefactoringService.Refactorings) {
- if (refactoring.IsValid (options)) {
- CommandInfo info = new CommandInfo (refactoring.GetMenuDescription (options));
- info.AccelKey = refactoring.AccelKey;
- ciset.CommandInfos.Add (info, new Action (new RefactoringOperationWrapper (refactoring, options).Operation));
+ if (RefactoringService.ShowFixes) {
+ foreach (var refactoring in RefactoringService.Refactorings) {
+ if (refactoring.IsValid (options)) {
+ CommandInfo info = new CommandInfo (refactoring.GetMenuDescription (options));
+ info.AccelKey = refactoring.AccelKey;
+ ciset.CommandInfos.Add (info, new Action (new RefactoringOperationWrapper (refactoring, options).Operation));
+ }
}
- }
- var refactoringInfo = doc.Annotation<RefactoringDocumentInfo> ();
- if (refactoringInfo == null) {
- refactoringInfo = new RefactoringDocumentInfo ();
- doc.AddAnnotation (refactoringInfo);
- }
- var loc = doc.Editor.Caret.Location;
- bool first = true;
- if (refactoringInfo.lastDocument != doc.ParsedDocument || loc != lastLocation) {
- try {
- refactoringInfo.validActions = RefactoringService.GetValidActions (doc, loc, new CancellationTokenSource (500).Token);
- } catch (TaskCanceledException) {
- } catch (AggregateException ae) {
- ae.Flatten ().Handle (x => x is TaskCanceledException);
+ var refactoringInfo = doc.Annotation<RefactoringDocumentInfo> ();
+ if (refactoringInfo == null) {
+ refactoringInfo = new RefactoringDocumentInfo ();
+ doc.AddAnnotation (refactoringInfo);
}
+ var loc = doc.Editor.Caret.Location;
+ bool first = true;
+ if (refactoringInfo.lastDocument != doc.ParsedDocument || loc != lastLocation) {
+ try {
+ refactoringInfo.validActions = RefactoringService.GetValidActions (doc, loc, new CancellationTokenSource (500).Token);
+ } catch (TaskCanceledException) {
+ } catch (AggregateException ae) {
+ ae.Flatten ().Handle (x => x is TaskCanceledException);
+ }
- lastLocation = loc;
- refactoringInfo.lastDocument = doc.ParsedDocument;
- }
- if (refactoringInfo.validActions != null && refactoringInfo.lastDocument != null && refactoringInfo.lastDocument.CreateRefactoringContext != null) {
- var context = refactoringInfo.lastDocument.CreateRefactoringContext (doc, CancellationToken.None);
+ lastLocation = loc;
+ refactoringInfo.lastDocument = doc.ParsedDocument;
+ }
+ if (refactoringInfo.validActions != null && refactoringInfo.lastDocument != null && refactoringInfo.lastDocument.CreateRefactoringContext != null) {
+ var context = refactoringInfo.lastDocument.CreateRefactoringContext (doc, CancellationToken.None);
- foreach (var fix_ in refactoringInfo.validActions.OrderByDescending (i => Tuple.Create (CodeActionEditorExtension.IsAnalysisOrErrorFix(i), (int)i.Severity, CodeActionEditorExtension.GetUsage (i.IdString)))) {
- if (CodeActionEditorExtension.IsAnalysisOrErrorFix (fix_))
- continue;
- var fix = fix_;
- if (first) {
- first = false;
- if (ciset.CommandInfos.Count > 0)
- ciset.CommandInfos.AddSeparator ();
- }
+ foreach (var fix_ in refactoringInfo.validActions.OrderByDescending (i => Tuple.Create (CodeActionEditorExtension.IsAnalysisOrErrorFix(i), (int)i.Severity, CodeActionEditorExtension.GetUsage (i.IdString)))) {
+ if (CodeActionEditorExtension.IsAnalysisOrErrorFix (fix_))
+ continue;
+ var fix = fix_;
+ if (first) {
+ first = false;
+ if (ciset.CommandInfos.Count > 0)
+ ciset.CommandInfos.AddSeparator ();
+ }
- ciset.CommandInfos.Add (fix.Title, new Action (() => RefactoringService.ApplyFix (fix, context)));
+ ciset.CommandInfos.Add (fix.Title, new Action (() => RefactoringService.ApplyFix (fix, context)));
+ }
}
}
-
if (ciset.CommandInfos.Count > 0) {
ainfo.Add (ciset, null);
added = true;
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs
index 621ced902e..013f184cb4 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.OptionPanels/HighlightingPanel.cs
@@ -38,14 +38,24 @@ namespace MonoDevelop.SourceEditor.OptionPanels
public partial class HighlightingPanel : Gtk.Bin, IOptionsPanel
{
string schemeName;
+ ListStore styleStore = new ListStore (typeof (string), typeof (Mono.TextEditor.Highlighting.ColorScheme), typeof(bool));
+ Lazy<Gdk.Pixbuf> errorPixbuf = new Lazy<Gdk.Pixbuf> (() => ImageService.GetIcon (Stock.DialogError, IconSize.Menu).ToPixbuf ());
-
- ListStore styleStore = new ListStore (typeof (string), typeof (Mono.TextEditor.Highlighting.ColorScheme));
-
public HighlightingPanel ()
{
this.Build ();
- styleTreeview.AppendColumn ("", new CellRendererText (), "markup", 0);
+ var col = new TreeViewColumn ();
+ var crpixbuf = new CellRendererPixbuf ();
+ col.PackStart (crpixbuf, false);
+ col.SetCellDataFunc (crpixbuf, (TreeViewColumn tree_column, CellRenderer cell, TreeModel tree_model, TreeIter iter) => {
+ var isError = (bool)styleStore.GetValue (iter, 2);
+ crpixbuf.Visible = isError;
+ crpixbuf.Pixbuf = isError ? errorPixbuf.Value : null;
+ });
+ var crtext = new CellRendererText ();
+ col.PackEnd (crtext, true);
+ col.SetAttributes (crtext, "markup", 0);
+ styleTreeview.AppendColumn (col);
styleTreeview.Model = styleStore;
// ensure that custom styles are loaded.
new SourceEditorDisplayBinding ();
@@ -101,7 +111,11 @@ namespace MonoDevelop.SourceEditor.OptionPanels
var sheme = (Mono.TextEditor.Highlighting.ColorScheme)styleStore.GetValue (iter, 1);
if (sheme == null)
return;
-
+ var isError = (bool)styleStore.GetValue (iter, 2);
+ if (isError) {
+ this.removeButton.Sensitive = true;
+ return;
+ }
DefaultSourceEditorOptions.Instance.ColorScheme = sheme.Name;
this.buttonExport.Sensitive = true;
string fileName = sheme.FileName;
@@ -118,19 +132,24 @@ namespace MonoDevelop.SourceEditor.OptionPanels
using (var editor = new ColorShemeEditor (this)) {
var colorScheme = (Mono.TextEditor.Highlighting.ColorScheme)this.styleStore.GetValue (selectedIter, 1);
editor.SetSheme (colorScheme);
- MessageService.ShowCustomDialog (editor, dialog);
+ MessageService. ShowCustomDialog (editor, dialog);
}
}
}
- Mono.TextEditor.Highlighting.ColorScheme LoadStyle (string styleName, bool showException = true)
+ Mono.TextEditor.Highlighting.ColorScheme LoadStyle (string styleName, out bool error)
{
try {
+ error = false;
return Mono.TextEditor.Highlighting.SyntaxModeService.GetColorStyle (styleName);
} catch (Exception e) {
- if (showException)
- MessageService.ShowError ("Error while importing color style " + styleName, (e.InnerException ?? e).Message);
- return Mono.TextEditor.Highlighting.SyntaxModeService.DefaultColorStyle;
+ LoggingService.LogError ("Error while loading color style " + styleName, e);
+ error = true;
+ var style = Mono.TextEditor.Highlighting.SyntaxModeService.DefaultColorStyle.Clone ();
+ style.Name = styleName;
+ style.Description = GettextCatalog.GetString ("Loading error:" + e.Message);
+ style.FileName = Mono.TextEditor.Highlighting.SyntaxModeService.GetFileName (styleName);
+ return style;
}
}
@@ -138,11 +157,12 @@ namespace MonoDevelop.SourceEditor.OptionPanels
internal void ShowStyles ()
{
styleStore.Clear ();
- TreeIter selectedIter = styleStore.AppendValues (GetMarkup (GettextCatalog.GetString ("Default"), GettextCatalog.GetString ("The default color scheme.")), LoadStyle ("Default"));
+ bool error;
+ TreeIter selectedIter = styleStore.AppendValues (GetMarkup (GettextCatalog.GetString ("Default"), GettextCatalog.GetString ("The default color scheme.")), LoadStyle ("Default", out error));
foreach (string styleName in Mono.TextEditor.Highlighting.SyntaxModeService.Styles) {
if (styleName == "Default")
continue;
- var style = LoadStyle (styleName);
+ var style = LoadStyle (styleName, out error);
string name = style.Name ?? "";
string description = style.Description ?? "";
// translate only build-in sheme names
@@ -154,7 +174,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
} catch {
}
}
- TreeIter iter = styleStore.AppendValues (GetMarkup (name, description), style);
+ TreeIter iter = styleStore.AppendValues (GetMarkup (name, description), style, error);
if (style.Name == DefaultSourceEditorOptions.Instance.ColorScheme)
selectedIter = iter;
}
@@ -179,7 +199,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
void HandleButtonExportClicked (object sender, EventArgs e)
{
- var dialog = new SelectFileDialog (GettextCatalog.GetString ("Highlighting Scheme"), Gtk.FileChooserAction.Save) {
+ var dialog = new SelectFileDialog (GettextCatalog.GetString ("Highlighting Scheme"), MonoDevelop.Components.FileChooserAction.Save) {
TransientFor = this.Toplevel as Gtk.Window,
};
dialog.AddFilter (GettextCatalog.GetString ("Color schemes"), "*.json");
@@ -198,7 +218,7 @@ namespace MonoDevelop.SourceEditor.OptionPanels
void AddColorScheme (object sender, EventArgs args)
{
- var dialog = new SelectFileDialog (GettextCatalog.GetString ("Highlighting Scheme"), Gtk.FileChooserAction.Open) {
+ var dialog = new SelectFileDialog (GettextCatalog.GetString ("Highlighting Scheme"), MonoDevelop.Components.FileChooserAction.Open) {
TransientFor = this.Toplevel as Gtk.Window,
};
dialog.AddFilter (GettextCatalog.GetString ("Color schemes"), "*.json");
diff --git a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
index 6030f79e7e..9c6b608723 100644
--- a/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
+++ b/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor.csproj
@@ -44,7 +44,7 @@
</Execution>
<DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\build\AddIns\DisplayBindings\SourceEditor\MonoDevelop.SourceEditor.xml</DocumentationFile>
+ <DocumentationFile>..\..\..\build\AddIns\DisplayBindings\SourceEditor\MonoDevelop.SourceEditor2.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
diff --git a/main/src/addins/MonoDeveloperExtensions/NUnit/NUnit.csproj b/main/src/addins/MonoDeveloperExtensions/NUnit/NUnit.csproj
index 0303e2ded5..2074526569 100644
--- a/main/src/addins/MonoDeveloperExtensions/NUnit/NUnit.csproj
+++ b/main/src/addins/MonoDeveloperExtensions/NUnit/NUnit.csproj
@@ -9,6 +9,7 @@
<OutputType>Library</OutputType>
<RootNamespace>NUnit</RootNamespace>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ <AssemblyName>MonoDeveloperExtensions_nunit</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
@@ -21,7 +22,6 @@
<Execution>
<Execution clr-version="Net_2_0" />
</Execution>
- <AssemblyName>MonoDeveloperExtensions_nunit</AssemblyName>
<DefineConstants>DEBUG</DefineConstants>
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>..\..\..\..\build\AddIns\MonoDeveloperExtensions\MonoDeveloperExtensions_nunit.xml</DocumentationFile>
@@ -36,10 +36,9 @@
<Execution>
<Execution clr-version="Net_2_0" />
</Execution>
- <AssemblyName>NUnit</AssemblyName>
<DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\..\build\AddIns\MonoDeveloperExtensions\NUnit.xml</DocumentationFile>
+ <DocumentationFile>..\..\..\..\build\AddIns\MonoDeveloperExtensions\MonoDeveloperExtensions_nunit.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\MonoDeveloperExtensions.csproj">
diff --git a/main/src/addins/NUnit/Commands/NUnitCommands.cs b/main/src/addins/NUnit/Commands/NUnitCommands.cs
index f0d9322df4..0a581fdb81 100644
--- a/main/src/addins/NUnit/Commands/NUnitCommands.cs
+++ b/main/src/addins/NUnit/Commands/NUnitCommands.cs
@@ -41,7 +41,8 @@ namespace MonoDevelop.NUnit.Commands
ShowTestCode,
SelectTestInTree,
ShowTestDetails,
- GoToFailure
+ GoToFailure,
+ RerunTest,
}
public enum TestChartCommands
diff --git a/main/src/addins/NUnit/Gui/TestResultsPad.cs b/main/src/addins/NUnit/Gui/TestResultsPad.cs
index 7758886781..5110f4de4d 100644
--- a/main/src/addins/NUnit/Gui/TestResultsPad.cs
+++ b/main/src/addins/NUnit/Gui/TestResultsPad.cs
@@ -213,7 +213,7 @@ namespace MonoDevelop.NUnit
buttonRun = new Button ();
buttonRun.Label = GettextCatalog.GetString ("Rerun Tests");
- buttonRun.Image = new Gtk.Image (Gtk.Stock.Execute, IconSize.Menu);
+ buttonRun.Image = new ImageView (ImageService.GetIcon ("nunit-run", IconSize.Menu));
buttonRun.Image.Show ();
buttonRun.Sensitive = false;
toolbar.Add (buttonRun);
@@ -250,6 +250,8 @@ namespace MonoDevelop.NUnit
progressBar.HeightRequest = infoLabel.SizeRequest ().Height;
runPanel.ShowAll ();
+ progressBar.Hide ();
+ infoSep.Hide ();
resultSummary = new UnitTestResult ();
UpdateCounters ();
}
@@ -289,7 +291,9 @@ namespace MonoDevelop.NUnit
progressBar.Text = "";
testsRun = 0;
resultSummary = new UnitTestResult ();
- resultLabel.Markup = GetResultsMarkup ();
+ resultLabel.Markup = "";
+ resultLabel.Hide ();
+ labels.Show ();
UpdateCounters ();
}
@@ -512,7 +516,7 @@ namespace MonoDevelop.NUnit
Gtk.TreeIter iter;
if (!failuresTreeView.Selection.GetSelected (out foo, out iter))
return;
-
+
int type = (int)failuresStore.GetValue (iter, 5);
var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
@@ -535,9 +539,23 @@ namespace MonoDevelop.NUnit
{
UnitTest test = GetSelectedTest ();
if (test != null) {
- var result = test.GetLastResult ();
- if (result != null) {
- info.Enabled = !string.IsNullOrEmpty (result.StackTrace);
+ var last = test.GetLastResult ();
+
+ Gtk.TreeModel foo;
+ Gtk.TreeIter iter;
+ if (!failuresTreeView.Selection.GetSelected (out foo, out iter)) {
+ info.Enabled = false;
+ return;
+ }
+
+ int type = (int)failuresStore.GetValue (iter, 5);
+ switch (type) {
+ case ErrorMessage:
+ info.Enabled = !string.IsNullOrEmpty (last.Message);
+ return;
+ case StackTrace:
+ default:
+ info.Enabled = !string.IsNullOrEmpty (last.StackTrace);
return;
}
}
@@ -586,9 +604,19 @@ namespace MonoDevelop.NUnit
if (loc != null)
IdeApp.Workbench.OpenDocument (loc.FileName, loc.Line, loc.Column);
}
+
+ [CommandHandler (TestCommands.RerunTest)]
+ protected void OnRerunTest ()
+ {
+ UnitTest test = GetSelectedTest ();
+ if (test == null)
+ return;
+ NUnitService.Instance.RunTest (test, null);
+ }
[CommandUpdateHandler (TestCommands.ShowTestCode)]
[CommandUpdateHandler (TestCommands.GoToFailure)]
+ [CommandUpdateHandler (TestCommands.RerunTest)]
protected void OnUpdateRunTest (CommandInfo info)
{
UnitTest test = GetSelectedTest ();
diff --git a/main/src/addins/NUnit/MonoDevelop.NUnit.csproj b/main/src/addins/NUnit/MonoDevelop.NUnit.csproj
index 65cda081fd..40f784226e 100644
--- a/main/src/addins/NUnit/MonoDevelop.NUnit.csproj
+++ b/main/src/addins/NUnit/MonoDevelop.NUnit.csproj
@@ -30,7 +30,7 @@
<Optimize>True</Optimize>
<OutputPath>..\..\..\build\AddIns\NUnit\</OutputPath>
<ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
+ <WarningLevel>3</WarningLevel>
<Execution>
<Execution clr-version="Net_2_0" />
</Execution>
diff --git a/main/src/addins/NUnit/MonoDevelopNUnit.addin.xml b/main/src/addins/NUnit/MonoDevelopNUnit.addin.xml
index 96f4fb6295..25aef50656 100644
--- a/main/src/addins/NUnit/MonoDevelopNUnit.addin.xml
+++ b/main/src/addins/NUnit/MonoDevelopNUnit.addin.xml
@@ -91,6 +91,7 @@
<Command id = "MonoDevelop.NUnit.Commands.TestCommands.GoToFailure" _label = "Go to failure" />
<Command id = "MonoDevelop.NUnit.Commands.TestCommands.SelectTestInTree" _label = "Select test in tree" />
<Command id = "MonoDevelop.NUnit.Commands.TestCommands.ShowTestDetails" _label = "Show results pad" />
+ <Command id = "MonoDevelop.NUnit.Commands.TestCommands.RerunTest" _label = "Rerun test" />
<Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.UseTimeScale" _label = "Proportional time scale" type="check"/>
<Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.SingleDayResult" _label = "Show one result per day" type="check"/>
<Command id = "MonoDevelop.NUnit.Commands.TestChartCommands.ShowResults" _label = "Results chart" type="radio"/>
@@ -136,6 +137,7 @@
<CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.GoToFailure" />
<CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.ShowTestCode" />
<CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.SelectTestInTree" />
+ <CommandItem id = "MonoDevelop.NUnit.Commands.TestCommands.RerunTest" />
<SeparatorItem id = "s1" />
<CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.Copy" />
</Extension>
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/GenerateIndentedClassCodeTests.cs b/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/GenerateIndentedClassCodeTests.cs
new file mode 100644
index 0000000000..0810e2e783
--- /dev/null
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/GenerateIndentedClassCodeTests.cs
@@ -0,0 +1,108 @@
+//
+// GenerateIndentedClassCodeTests.cs
+//
+// Author:
+// Matt Ward <matt.ward@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin Inc. (http://xamarin.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.CodeDom;
+using System.CodeDom.Compiler;
+using NUnit.Framework;
+using System.IO;
+
+namespace Mono.TextTemplating.Tests
+{
+ [TestFixture]
+ public class GenerateIndentedClassCodeTests
+ {
+ [Test]
+ public void FieldAndPropertyGenerated ()
+ {
+ var provider = CodeDomProvider.CreateProvider ("C#");
+ var field = CreateBoolField ();
+ var property = CreateBoolProperty ();
+
+ string output = TemplatingEngine.GenerateIndentedClassCode (provider, field, property);
+ output = FixOutput (output);
+ string expectedOutput = FixOutput (MethodAndFieldGeneratedOutput);
+
+ Assert.AreEqual (expectedOutput, output);
+ }
+
+ static CodeTypeMember CreateVoidMethod ()
+ {
+ var meth = new CodeMemberMethod { Name = "MyMethod" };
+ meth.ReturnType = new CodeTypeReference (typeof(void));
+ return meth;
+ }
+
+ static CodeTypeMember CreateBoolField ()
+ {
+ var type = new CodeTypeReference (typeof(bool));
+ return new CodeMemberField { Name = "myField", Type = type };
+ }
+
+ static CodeTypeMember CreateBoolProperty ()
+ {
+ var type = new CodeTypeReference (typeof(bool));
+ var prop = new CodeMemberProperty { Name = "MyProperty", Type = type };
+ prop.GetStatements.Add (
+ new CodeMethodReturnStatement (
+ new CodePrimitiveExpression (true)
+ )
+ );
+ return prop;
+ }
+
+ /// <summary>
+ /// Remove empty lines which are not generated on Mono.
+ /// </summary>
+ static string FixOutput (string output, string newLine = "\n")
+ {
+ using (var writer = new StringWriter ()) {
+ using (var reader = new StringReader (output)) {
+
+ string line;
+ while ((line = reader.ReadLine ()) != null) {
+ if (!String.IsNullOrWhiteSpace (line)) {
+ writer.Write (line);
+ writer.Write (newLine);
+ }
+ }
+ }
+ return writer.ToString ();
+ }
+ }
+
+ public static string MethodAndFieldGeneratedOutput =
+@"
+ private bool myField;
+
+ private bool MyProperty {
+ get {
+ return true;
+ }
+ }
+";
+ }
+}
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj b/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj
index 3b67d5045d..fec16c1aac 100644
--- a/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating.Tests/Mono.TextTemplating.Tests.csproj
@@ -41,6 +41,7 @@
<Compile Include="GenerationTests.cs" />
<Compile Include="TemplatingEngineHelper.cs" />
<Compile Include="TemplateEnginePreprocessTemplateTests.cs" />
+ <Compile Include="GenerateIndentedClassCodeTests.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Mono.TextTemplating\Mono.TextTemplating.csproj">
diff --git a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplatingEngine.cs b/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplatingEngine.cs
index 8a312101d2..9425f6dae8 100644
--- a/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplatingEngine.cs
+++ b/main/src/addins/TextTemplating/Mono.TextTemplating/Mono.TextTemplating/TemplatingEngine.cs
@@ -1091,7 +1091,7 @@ namespace Mono.TextTemplating
}
var cgType = typeof (CodeGenerator);
- var cgInit = cgType.GetMethod ("InitOutput", BindingFlags.NonPublic | BindingFlags.Instance);
+ var initializeCodeGenerator = GetInitializeCodeGeneratorAction (cgType);
var cgFieldGen = cgType.GetMethod ("GenerateField", BindingFlags.NonPublic | BindingFlags.Instance);
var cgPropGen = cgType.GetMethod ("GenerateProperty", BindingFlags.NonPublic | BindingFlags.Instance);
@@ -1103,19 +1103,42 @@ namespace Mono.TextTemplating
foreach (CodeTypeMember member in members) {
var f = member as CodeMemberField;
if (f != null) {
- cgInit.Invoke (generator, new object[] { sw, options });
+ initializeCodeGenerator (generator, sw, options);
cgFieldGen.Invoke (generator, new object[] { f });
continue;
}
var p = member as CodeMemberProperty;
if (p != null) {
- cgInit.Invoke (generator, new object[] { sw, options });
+ initializeCodeGenerator (generator, sw, options);
cgPropGen.Invoke (generator, new object[] { p, dummy });
continue;
}
}
}
+ static Action<CodeGenerator, StringWriter, CodeGeneratorOptions> GetInitializeCodeGeneratorAction (Type cgType)
+ {
+ var cgInit = cgType.GetMethod ("InitOutput", BindingFlags.NonPublic | BindingFlags.Instance);
+ if (cgInit != null) {
+ return new Action<CodeGenerator, StringWriter, CodeGeneratorOptions> ((generator, sw, options) => {
+ cgInit.Invoke (generator, new object[] { sw, options });
+ });
+ }
+
+ var cgOptions = cgType.GetField ("options", BindingFlags.NonPublic | BindingFlags.Instance);
+ var cgOutput = cgType.GetField ("output", BindingFlags.NonPublic | BindingFlags.Instance);
+
+ if (cgOptions != null && cgOutput != null) {
+ return new Action<CodeGenerator, StringWriter, CodeGeneratorOptions> ((generator, sw, options) => {
+ var output = new IndentedTextWriter (sw);
+ cgOptions.SetValue (generator, options);
+ cgOutput.SetValue (generator, output);
+ });
+ }
+
+ throw new InvalidOperationException ("Unable to initialize CodeGenerator.");
+ }
+
public static string GenerateIndentedClassCode (CodeDomProvider provider, params CodeTypeMember[] members)
{
return GenerateIndentedClassCode (provider, (IEnumerable<CodeTypeMember>)members);
diff --git a/main/src/addins/TextTemplating/TextTransform/TextTransform.csproj b/main/src/addins/TextTemplating/TextTransform/TextTransform.csproj
index 69822959b6..5cc987754f 100644
--- a/main/src/addins/TextTemplating/TextTransform/TextTransform.csproj
+++ b/main/src/addins/TextTemplating/TextTransform/TextTransform.csproj
@@ -32,6 +32,7 @@
<DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
<DocumentationFile>..\..\..\..\build\AddIns\MonoDevelop.TextTemplating\TextTransform.xml</DocumentationFile>
+ <Commandlineparameters>-o:out.txt in.tt</Commandlineparameters>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
diff --git a/main/src/addins/VBNetBinding/VBNetBinding.csproj b/main/src/addins/VBNetBinding/VBNetBinding.csproj
index d730d2a3f5..8fb1dca2f8 100644
--- a/main/src/addins/VBNetBinding/VBNetBinding.csproj
+++ b/main/src/addins/VBNetBinding/VBNetBinding.csproj
@@ -30,7 +30,7 @@
<Optimize>True</Optimize>
<OutputPath>..\..\..\build\AddIns\BackendBindings\</OutputPath>
<ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
+ <WarningLevel>3</WarningLevel>
<Execution>
<Execution clr-version="Net_2_0" />
</Execution>
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs
index a3d92cdaf7..e1767c556a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseGitRepositoryTests.cs
@@ -392,6 +392,11 @@ index 0000000..009b64b
return new GitRepository (VersionControlService.GetVersionControlSystems ().First (id => id.Name == "Git"), path, url);
}
+ protected override Repository GetRepo ()
+ {
+ return new GitRepository ();
+ }
+
// This test is for a memory usage improvement on status.
[Test]
public void TestSameGitRevision ()
@@ -497,5 +502,34 @@ index 0000000..009b64b
foreach (var rev in revisions)
Assert.AreEqual (GettextCatalog.GetString ("working copy"), rev);
}
+
+ [Test]
+ public void TestGitRebaseCommitOrdering ()
+ {
+ var gitRepo = (GitRepository)Repo;
+
+ AddFile ("init", "init", toVcs: true, commit: true);
+
+ // Create a branch from initial commit.
+ gitRepo.CreateBranch ("test", null, null);
+
+ // Create two commits in master.
+ AddFile ("init2", "init", toVcs: true, commit: true);
+ AddFile ("init3", "init", toVcs: true, commit: true);
+
+ // Create two commits in test.
+ gitRepo.SwitchToBranch (new NullProgressMonitor (), "test");
+ AddFile ("init4", "init", toVcs: true, commit: true);
+ AddFile ("init5", "init", toVcs: true, commit: true);
+
+ gitRepo.Rebase ("master", GitUpdateOptions.None, new NullProgressMonitor ());
+
+ // Commits come in reverse (recent to old).
+ var history = gitRepo.GetHistory (LocalPath, null).Reverse ().ToArray ();
+ Assert.AreEqual (5, history.Length);
+ for (int i = 0; i < 5; ++i) {
+ Assert.AreEqual (string.Format ("Commit #{0}\n", i), history [i].Message);
+ }
+ }
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs
index bf8a61fa1c..46b64db071 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/BaseRepositoryTests.cs
@@ -654,8 +654,11 @@ namespace MonoDevelop.VersionControl.Tests
protected void Checkout (string path, string url)
{
- Repository _repo = GetRepo (path, url);
- _repo.Checkout (path, true, new NullProgressMonitor ());
+ var mockRepo = (UrlBasedRepository)GetRepo ();
+ mockRepo.Url = url;
+ mockRepo.Checkout (path, true, new NullProgressMonitor ());
+
+ var _repo = GetRepo (path, url);
if (Repo == null)
Repo = _repo;
else
@@ -714,6 +717,7 @@ namespace MonoDevelop.VersionControl.Tests
AddedItems.Add (added);
}
+ protected abstract Repository GetRepo ();
protected abstract Repository GetRepo (string path, string url);
protected static void DeleteDirectory (string path)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/GitIntegrityTests.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/GitIntegrityTests.cs
index 491a8ff3df..99288e1474 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/GitIntegrityTests.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/GitIntegrityTests.cs
@@ -24,7 +24,7 @@
// 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;
using System.Linq;
using NUnit.Framework;
using System.IO;
@@ -54,7 +54,6 @@ namespace MonoDevelop.VersionControl.Git.Tests
}
[Test]
- [Ignore ("This fails with NGit, probably because the diff algorithm is different")]
public void TestBlameRevisionsWithMultipleCommits ()
{
Commit[] blameCommits = GetBlameForFixedFile ("c5f4319ee3e077436e3950c8a764959d50bf57c0");
@@ -84,7 +83,6 @@ namespace MonoDevelop.VersionControl.Git.Tests
}
[Test]
- [Ignore ("This fails with NGit, probably because the diff algorithm is different")]
public void TestBlameRevisionsWithTwoCommits ()
{
string commit1 = "b6e41ee2dd00e8744abc4835567e06667891b2cf";
@@ -134,12 +132,10 @@ namespace MonoDevelop.VersionControl.Git.Tests
[Test]
public void TestBlameLineCountWithNoCommits ()
{
- Commit[] blameCommits = GetBlameForFixedFile ("39fe1158de8da8b82822e299958d35c51d493298");
- Assert.That (blameCommits, Is.Null);
+ Assert.Throws<NotFoundException> (() => GetBlameForFixedFile ("39fe1158de8da8b82822e299958d35c51d493298"));
}
[Test]
- [Ignore]
public void TestBlameForProjectDom ()
{
Commit[] blameCommits = GetBlameForFile ("6469602e3c0ba6953fd3ef0ae01d77abe1d9ab70", "main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Dom.Parser/ProjectDom.cs");
@@ -277,13 +273,20 @@ namespace MonoDevelop.VersionControl.Git.Tests
if (blame == null)
{
- var result = repo.Blame (filePath);
- if (result == null)
+ var result = repo.Blame (filePath, new BlameOptions {
+ StartingAt = revision,
+ });
+ if (!result.Any ())
return null;
- blame = new Commit [result.Count ()];
- for (int i = 0; i < result.Count (); i ++)
- blame [i] = result[i].FinalCommit;
+ var count = result.Sum (hunk => hunk.LineCount);
+ blame = new Commit [count];
+ int x = 0;
+ foreach (var res in result) {
+ for (int i = 0; i < res.LineCount; ++i)
+ blame [x++] = res.FinalCommit;
+ }
+
blames.Add(key, blame);
}
@@ -316,4 +319,4 @@ namespace MonoDevelop.VersionControl.Git.Tests
}
}
}
-*/
+
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj
index 8d3035bf6f..1fc7c56620 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git.Tests/MonoDevelop.VersionControl.Git.Tests.csproj
@@ -80,6 +80,7 @@
<NoWarn>1591;1573</NoWarn>
<DebugType>pdbonly</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseMac|AnyCPU' ">
<Optimize>true</Optimize>
@@ -89,6 +90,7 @@
<NoWarn>1591;1573</NoWarn>
<DebugType>pdbonly</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseGnome|AnyCPU' ">
<Optimize>true</Optimize>
@@ -98,6 +100,7 @@
<NoWarn>1591;1573</NoWarn>
<DebugType>pdbonly</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj
index 12e0013822..7b5fee7c62 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git.csproj
@@ -80,10 +80,11 @@
<OutputPath>..\..\..\..\build\AddIns\VersionControl</OutputPath>
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
- <NoWarn>1591;1573</NoWarn>
+ <NoWarn>1591</NoWarn>
<DocumentationFile>..\..\..\..\build\AddIns\VersionControl\MonoDevelop.VersionControl.Git.xml</DocumentationFile>
<DebugType>pdbonly</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseMac|AnyCPU' ">
<Optimize>true</Optimize>
@@ -94,6 +95,7 @@
<DocumentationFile>..\..\..\..\build\AddIns\VersionControl\MonoDevelop.VersionControl.Git.xml</DocumentationFile>
<DebugType>pdbonly</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseGnome|AnyCPU' ">
<Optimize>true</Optimize>
@@ -104,6 +106,7 @@
<DocumentationFile>..\..\..\..\build\AddIns\VersionControl\MonoDevelop.VersionControl.Git.xml</DocumentationFile>
<DebugType>pdbonly</DebugType>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditRemoteDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditRemoteDialog.cs
index 06d6659086..5e05821a6e 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditRemoteDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/EditRemoteDialog.cs
@@ -36,6 +36,7 @@ namespace MonoDevelop.VersionControl.Git
{
}
+ bool sameUrls;
public EditRemoteDialog (Remote remote)
{
this.Build ();
@@ -47,10 +48,20 @@ namespace MonoDevelop.VersionControl.Git
entryUrl.Text = remote.Url ?? "";
entryPushUrl.Text = remote.PushUrl ?? "";
}
+
+ sameUrls = entryPushUrl.Text == entryUrl.Text;
+ SetPushUrlTextStyle (sameUrls);
+
checkImportTags.Visible = remote == null;
UpdateButtons ();
}
+ void SetPushUrlTextStyle (bool disabled)
+ {
+ entryPushUrl.ModifyText (Gtk.StateType.Normal, entryUrl.Style.Text (disabled ? Gtk.StateType.Insensitive : Gtk.StateType.Normal));
+ entryPushUrl.ModifyText (Gtk.StateType.Active, entryUrl.Style.Text (disabled ? Gtk.StateType.Insensitive : Gtk.StateType.Active));
+ }
+
public string RemoteName {
get { return entryName.Text; }
}
@@ -79,11 +90,21 @@ namespace MonoDevelop.VersionControl.Git
protected virtual void OnEntryUrlChanged (object sender, System.EventArgs e)
{
+ // If we had the same text or we're now having matching text, then change styling.
+ if (sameUrls || entryPushUrl.Text == entryUrl.Text) {
+ entryPushUrl.Text = entryUrl.Text;
+ sameUrls = true;
+ SetPushUrlTextStyle (sameUrls);
+ }
+
UpdateButtons ();
}
protected void OnEntryPushUrlChanged (object sender, System.EventArgs e)
{
+ sameUrls = entryPushUrl.Text == entryUrl.Text;
+ SetPushUrlTextStyle (sameUrls);
+
UpdateButtons ();
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtension.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtension.cs
index eb5035ecf0..e058292500 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtension.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCommitDialogExtension.cs
@@ -55,6 +55,12 @@ namespace MonoDevelop.VersionControl.Git
return false;
}
+ public override string FormatDialogTitle (ChangeSet changeSet, string title)
+ {
+ var gitRepo = changeSet.Repository as GitRepository;
+ return gitRepo != null ? string.Format ("{0} ({1})", title, gitRepo.GetCurrentBranch ()) : title;
+ }
+
public override bool OnBeginCommit (ChangeSet changeSet)
{
// In this callback we check if the user information configured in Git
@@ -178,10 +184,12 @@ namespace MonoDevelop.VersionControl.Git
var text = textView.Buffer.Text;
var lines = text.Split ('\n');
if (lines.Length > 0 && lines [0].Length > maxLengthConventionForFirstLineOfCommitMessage) {
- textView.TooltipText = String.Format (GettextCatalog.GetString (
- "When using Git, it is not recommended to surpass the character count of {0} in the first line of the commit message"),
- maxLengthConventionForFirstLineOfCommitMessage);
- textView.HasTooltip = true;
+ if (!textView.HasTooltip) {
+ textView.TooltipText = String.Format (GettextCatalog.GetString (
+ "When using Git, it is not recommended to surpass the character count of {0} in the first line of the commit message"),
+ maxLengthConventionForFirstLineOfCommitMessage);
+ textView.HasTooltip = true;
+ }
textView.Buffer.GetBounds (out start, out unused);
start.ForwardChars (maxLengthConventionForFirstLineOfCommitMessage);
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs
index 0c23113c5d..f6aaa17013 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitCredentials.cs
@@ -34,23 +34,42 @@ using MonoDevelop.Components;
namespace MonoDevelop.VersionControl.Git
{
+ public enum GitCredentialsType
+ {
+ Normal,
+ Tfs,
+ }
+
+ public class GitCredentialsState
+ {
+ public string UrlUsed { get; set; }
+ public bool AgentUsed { get; set; }
+ public int KeyUsed { get; set; }
+ public bool NativePasswordUsed { get; set; }
+ public Dictionary<string, int> KeyForUrl = new Dictionary<string, int> ();
+ public Dictionary<string, bool> AgentForUrl = new Dictionary<string, bool> ();
+
+ public GitCredentialsState ()
+ {
+ KeyUsed = -1;
+ }
+ }
+
static class GitCredentials
{
// Gather keys on initialize.
static readonly List<string> Keys = new List<string> ();
- static readonly Dictionary<string, int> KeyForUrl = new Dictionary<string, int> ();
- static readonly Dictionary<string, bool> AgentForUrl = new Dictionary<string, bool> ();
- static string urlUsed;
- static bool agentUsed;
- static int keyUsed = -1;
- static bool nativePasswordUsed;
+ static Dictionary<GitCredentialsType, GitCredentialsState> credState = new Dictionary<GitCredentialsType, GitCredentialsState> ();
static GitCredentials ()
{
string keyStorage = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), ".ssh");
- if (!Directory.Exists (keyStorage))
- return;
+ if (!Directory.Exists (keyStorage)) {
+ keyStorage = Path.Combine (Environment.ExpandEnvironmentVariables ("%HOME%"), ".ssh");
+ if (!Directory.Exists (keyStorage))
+ return;
+ }
foreach (var privateKey in Directory.EnumerateFiles (keyStorage)) {
string publicKey = privateKey + ".pub";
@@ -59,12 +78,15 @@ namespace MonoDevelop.VersionControl.Git
}
}
- public static Credentials TryGet (string url, string userFromUrl, SupportedCredentialTypes types)
+ public static Credentials TryGet (string url, string userFromUrl, SupportedCredentialTypes types, GitCredentialsType type)
{
bool result = true;
Uri uri = null;
- urlUsed = url;
+ GitCredentialsState state;
+ if (!credState.TryGetValue (type, out state))
+ credState [type] = state = new GitCredentialsState ();
+ state.UrlUsed = url;
// We always need to run the TryGet* methods as we need the passphraseItem/passwordItem populated even
// if the password store contains an invalid password/no password
@@ -72,8 +94,8 @@ namespace MonoDevelop.VersionControl.Git
uri = new Uri (url);
string username;
string password;
- if (!nativePasswordUsed && TryGetUsernamePassword (uri, out username, out password)) {
- nativePasswordUsed = true;
+ if (!state.NativePasswordUsed && TryGetUsernamePassword (uri, out username, out password)) {
+ state.NativePasswordUsed = true;
return new UsernamePasswordCredentials {
Username = username,
Password = password
@@ -86,13 +108,13 @@ namespace MonoDevelop.VersionControl.Git
cred = new UsernamePasswordCredentials ();
else {
// Try ssh-agent on Linux.
- if (!Platform.IsWindows && !agentUsed) {
+ if (!Platform.IsWindows && !state.AgentUsed) {
bool agentUsable;
- if (!AgentForUrl.TryGetValue (url, out agentUsable))
- AgentForUrl [url] = agentUsable = true;
+ if (!state.AgentForUrl.TryGetValue (url, out agentUsable))
+ state.AgentForUrl [url] = agentUsable = true;
if (agentUsable) {
- agentUsed = true;
+ state.AgentUsed = true;
return new SshAgentCredentials {
Username = userFromUrl,
};
@@ -100,9 +122,9 @@ namespace MonoDevelop.VersionControl.Git
}
int key;
- if (!KeyForUrl.TryGetValue (url, out key)) {
- if (keyUsed + 1 < Keys.Count)
- keyUsed++;
+ if (!state.KeyForUrl.TryGetValue (url, out key)) {
+ if (state.KeyUsed + 1 < Keys.Count)
+ state.KeyUsed++;
else {
SelectFileDialog dlg = null;
bool success = false;
@@ -135,13 +157,13 @@ namespace MonoDevelop.VersionControl.Git
throw new VersionControlException (GettextCatalog.GetString ("Invalid credentials were supplied. Aborting operation."));
}
} else
- keyUsed = key;
+ state.KeyUsed = key;
cred = new SshUserKeyCredentials {
Username = userFromUrl,
Passphrase = "",
- PrivateKey = Keys [keyUsed],
- PublicKey = Keys [keyUsed] + ".pub",
+ PrivateKey = Keys [state.KeyUsed],
+ PublicKey = Keys [state.KeyUsed] + ".pub",
};
return cred;
}
@@ -194,31 +216,40 @@ namespace MonoDevelop.VersionControl.Git
return false;
}
- internal static void StoreCredentials ()
+ internal static void StoreCredentials (GitCredentialsType type)
{
- nativePasswordUsed = false;
+ GitCredentialsState state;
+ if (!credState.TryGetValue (type, out state))
+ return;
+
+ var url = state.UrlUsed;
+ var key = state.KeyUsed;
- if (!string.IsNullOrEmpty (urlUsed))
- if (keyUsed != -1)
- KeyForUrl [urlUsed] = keyUsed;
+ state.NativePasswordUsed = false;
- Cleanup ();
+ if (!string.IsNullOrEmpty (url) && key != -1)
+ state.KeyForUrl [url] = key;
+
+ Cleanup (state);
}
- internal static void InvalidateCredentials ()
+ internal static void InvalidateCredentials (GitCredentialsType type)
{
- if (!string.IsNullOrEmpty (urlUsed))
- if (AgentForUrl.ContainsKey (urlUsed))
- AgentForUrl [urlUsed] &= !agentUsed;
+ GitCredentialsState state;
+ if (!credState.TryGetValue (type, out state))
+ return;
+
+ if (!string.IsNullOrEmpty (state.UrlUsed) && state.AgentForUrl.ContainsKey (state.UrlUsed))
+ state.AgentForUrl [state.UrlUsed] &= !state.AgentUsed;
- Cleanup ();
+ Cleanup (state);
}
- static void Cleanup ()
+ static void Cleanup (GitCredentialsState state)
{
- urlUsed = null;
- agentUsed = false;
- keyUsed = -1;
+ state.UrlUsed = null;
+ state.AgentUsed = false;
+ state.KeyUsed = -1;
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
index 4385ab1ec2..a91ff501a2 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitRepository.cs
@@ -62,14 +62,14 @@ namespace MonoDevelop.VersionControl.Git
public GitRepository (VersionControlSystem vcs, FilePath path, string url) : base (vcs)
{
RootPath = path;
- string discovered = LibGit2Sharp.Repository.Discover (path);
- if (!string.IsNullOrEmpty (discovered))
- RootRepository = new LibGit2Sharp.Repository (discovered);
+ RootRepository = new LibGit2Sharp.Repository (path);
Url = url;
}
public override void Dispose ()
{
+ base.Dispose ();
+
if (VersionControlSystem != null)
((GitVersionControl)VersionControlSystem).UnregisterRepo (this);
@@ -77,7 +77,6 @@ namespace MonoDevelop.VersionControl.Git
RootRepository.Dispose ();
foreach (var rep in cachedSubmodules)
rep.Item2.Dispose ();
- base.Dispose ();
}
public override string[] SupportedProtocols {
@@ -163,33 +162,49 @@ namespace MonoDevelop.VersionControl.Git
return true;
}
+ const int progressThrottle = 200;
+ static System.Diagnostics.Stopwatch throttleWatch = new System.Diagnostics.Stopwatch ();
static bool OnTransferProgress (TransferProgress tp, IProgressMonitor monitor, ref int progress)
{
- if (progress == 0 && tp.ReceivedObjects == 0)
+ if (progress == 0 && tp.ReceivedObjects == 0) {
monitor.BeginTask ("Receiving and indexing objects", 2 * tp.TotalObjects);
+ throttleWatch.Restart ();
+ }
int currentProgress = tp.ReceivedObjects + tp.IndexedObjects;
int steps = currentProgress - progress;
- monitor.Step (steps);
+ if (throttleWatch.ElapsedMilliseconds > progressThrottle) {
+ monitor.Step (steps);
+ throttleWatch.Restart ();
+ }
progress = currentProgress;
- if (tp.IndexedObjects >= tp.TotalObjects)
+ if (tp.IndexedObjects >= tp.TotalObjects) {
monitor.EndTask ();
+ throttleWatch.Stop ();
+ }
return !monitor.IsCancelRequested;
}
static void OnCheckoutProgress (int completedSteps, int totalSteps, IProgressMonitor monitor, ref int progress)
{
- if (progress == 0 && completedSteps == 0)
+ if (progress == 0 && completedSteps == 0) {
monitor.BeginTask ("Checking out files", totalSteps);
+ throttleWatch.Restart ();
+ }
int steps = completedSteps - progress;
- monitor.Step (steps);
+ if (throttleWatch.ElapsedMilliseconds > progressThrottle) {
+ monitor.Step (steps);
+ throttleWatch.Restart ();
+ }
progress = completedSteps;
- if (completedSteps >= totalSteps)
+ if (completedSteps >= totalSteps) {
monitor.EndTask ();
+ throttleWatch.Stop ();
+ }
}
void NotifyFilesChangedForStash (Stash stash)
@@ -215,7 +230,7 @@ namespace MonoDevelop.VersionControl.Git
OnCheckoutProgress = (path, completedSteps, totalSteps) => OnCheckoutProgress (completedSteps, totalSteps, monitor, ref progress),
OnCheckoutNotify = RefreshFile,
CheckoutNotifyFlags = refreshFlags,
- }
+ },
});
NotifyFilesChangedForStash (RootRepository.Stashes [stashIndex]);
@@ -237,7 +252,7 @@ namespace MonoDevelop.VersionControl.Git
OnCheckoutProgress = (path, completedSteps, totalSteps) => OnCheckoutProgress (completedSteps, totalSteps, monitor, ref progress),
OnCheckoutNotify = RefreshFile,
CheckoutNotifyFlags = refreshFlags,
- }
+ },
});
NotifyFilesChangedForStash (stash);
if (monitor != null)
@@ -559,18 +574,16 @@ namespace MonoDevelop.VersionControl.Git
RootRepository.Branches.Update (RootRepository.Branches ["master"], branch => branch.TrackedBranch = "refs/remotes/origin/master");
- RetryUntilSuccess (monitor, delegate {
- RootRepository.Network.Push (RootRepository.Head, new PushOptions {
- OnPushStatusError = delegate (PushStatusError e) {
- RootRepository.Dispose ();
- RootRepository = null;
- if (RootPath.Combine (".git").IsDirectory)
- Directory.Delete (RootPath.Combine (".git"), true);
- throw new VersionControlException (e.Message);
- },
- CredentialsProvider = GitCredentials.TryGet
- });
- });
+ RetryUntilSuccess (monitor, credType => RootRepository.Network.Push (RootRepository.Head, new PushOptions {
+ OnPushStatusError = delegate (PushStatusError e) {
+ RootRepository.Dispose ();
+ RootRepository = null;
+ if (RootPath.Combine (".git").IsDirectory)
+ Directory.Delete (RootPath.Combine (".git"), true);
+ throw new VersionControlException (e.Message);
+ },
+ CredentialsProvider = (url, userFromUrl, types) => GitCredentials.TryGet (url, userFromUrl, types, credType)
+ }));
return this;
}
@@ -595,35 +608,36 @@ namespace MonoDevelop.VersionControl.Git
monitor.EndTask ();
}
- static void RetryUntilSuccess (IProgressMonitor monitor, Action func)
+ static void RetryUntilSuccess (IProgressMonitor monitor, Action<GitCredentialsType> func)
{
bool retry;
using (var tfsSession = new TfsSmartSession ()) {
do {
+ var credType = tfsSession.Disposed ? GitCredentialsType.Normal : GitCredentialsType.Tfs;
try {
- func ();
- GitCredentials.StoreCredentials ();
+ func (credType);
+ GitCredentials.StoreCredentials (credType);
retry = false;
} catch (AuthenticationException) {
- GitCredentials.InvalidateCredentials ();
+ GitCredentials.InvalidateCredentials (credType);
retry = true;
} catch (VersionControlException e) {
- GitCredentials.InvalidateCredentials ();
+ GitCredentials.InvalidateCredentials (credType);
if (monitor != null)
monitor.ReportError (e.Message, null);
retry = false;
} catch (UserCancelledException) {
- GitCredentials.StoreCredentials ();
+ GitCredentials.StoreCredentials (credType);
retry = false;
} catch (LibGit2SharpException e) {
+ GitCredentials.InvalidateCredentials (credType);
+
if (!tfsSession.Disposed) {
retry = true;
tfsSession.Dispose ();
continue;
}
- GitCredentials.InvalidateCredentials ();
-
string message;
// TODO: Remove me once https://github.com/libgit2/libgit2/pull/3137 goes in.
if (string.Equals (e.Message, "early EOF", StringComparison.OrdinalIgnoreCase))
@@ -645,12 +659,10 @@ namespace MonoDevelop.VersionControl.Git
{
monitor.Log.WriteLine (GettextCatalog.GetString ("Fetching from '{0}'", remote));
int progress = 0;
- RetryUntilSuccess (monitor, delegate {
- RootRepository.Fetch (remote, new FetchOptions {
- CredentialsProvider = GitCredentials.TryGet,
- OnTransferProgress = (tp) => OnTransferProgress (tp, monitor, ref progress),
- });
- });
+ RetryUntilSuccess (monitor, credType => RootRepository.Fetch (remote, new FetchOptions {
+ CredentialsProvider = (url, userFromUrl, types) => GitCredentials.TryGet (url, userFromUrl, types, credType),
+ OnTransferProgress = tp => OnTransferProgress (tp, monitor, ref progress),
+ }));
monitor.Step (1);
}
@@ -690,26 +702,27 @@ namespace MonoDevelop.VersionControl.Git
return true;
}
- void ConflictResolver(IProgressMonitor monitor, Commit resetToIfFail, string message)
+ bool ConflictResolver(IProgressMonitor monitor, Commit resetToIfFail, string message)
{
- bool commit = true;
foreach (var conflictFile in RootRepository.Index.Conflicts) {
ConflictResult res = ResolveConflict (RootRepository.FromGitPath (conflictFile.Ancestor.Path));
if (res == ConflictResult.Abort) {
RootRepository.Reset (ResetMode.Hard, resetToIfFail);
- commit = false;
- break;
+ return false;
}
if (res == ConflictResult.Skip) {
Revert (RootRepository.FromGitPath (conflictFile.Ancestor.Path), false, monitor);
break;
}
}
- if (commit)
- RootRepository.Commit (message);
+ if (!string.IsNullOrEmpty (message)) {
+ var sig = GetSignature ();
+ RootRepository.Commit (message, sig, sig);
+ }
+ return true;
}
- void CommonPostMergeRebase(int stashIndex, GitUpdateOptions options, IProgressMonitor monitor)
+ void CommonPostMergeRebase(int stashIndex, GitUpdateOptions options, IProgressMonitor monitor, Commit oldHead)
{
if ((options & GitUpdateOptions.SaveLocalChanges) == GitUpdateOptions.SaveLocalChanges) {
monitor.Step (1);
@@ -717,7 +730,13 @@ namespace MonoDevelop.VersionControl.Git
// Restore local changes
if (stashIndex != -1) {
monitor.Log.WriteLine (GettextCatalog.GetString ("Restoring local changes"));
- PopStash (monitor, stashIndex);
+ ApplyStash (monitor, stashIndex);
+ // FIXME: No StashApplyStatus.Conflicts here.
+ if (RootRepository.Index.Conflicts.Any () && !ConflictResolver (monitor, oldHead, string.Empty))
+ PopStash (monitor, stashIndex);
+ else
+ RootRepository.Stashes.Remove (stashIndex);
+
monitor.Step (1);
}
}
@@ -727,6 +746,8 @@ namespace MonoDevelop.VersionControl.Git
public void Rebase (string branch, GitUpdateOptions options, IProgressMonitor monitor)
{
int stashIndex = -1;
+ var oldHead = RootRepository.Head.Tip;
+
try {
monitor.BeginTask (GettextCatalog.GetString ("Rebasing"), 5);
if (!CommonPreMergeRebase (options, monitor, out stashIndex))
@@ -735,14 +756,14 @@ namespace MonoDevelop.VersionControl.Git
// Do a rebase.
var divergence = RootRepository.ObjectDatabase.CalculateHistoryDivergence (RootRepository.Head.Tip, RootRepository.Branches [branch].Tip);
var toApply = RootRepository.Commits.QueryBy (new CommitFilter {
- Since = RootRepository.Head.Tip,
- Until = divergence.CommonAncestor,
- SortBy = CommitSortStrategies.Topological
- });
+ IncludeReachableFrom = RootRepository.Head.Tip,
+ ExcludeReachableFrom = divergence.CommonAncestor,
+ SortBy = CommitSortStrategies.Topological | CommitSortStrategies.Reverse
+ }).ToArray ();
RootRepository.Reset (ResetMode.Hard, divergence.Another);
- int count = toApply.Count ();
+ int count = toApply.Length;
int i = 1;
foreach (var com in toApply) {
monitor.Log.WriteLine ("Cherry-picking {0} - {1}/{2}", com.Id, i, count);
@@ -755,13 +776,14 @@ namespace MonoDevelop.VersionControl.Git
++i;
}
} finally {
- CommonPostMergeRebase (stashIndex, options, monitor);
+ CommonPostMergeRebase (stashIndex, options, monitor, oldHead);
}
}
public void Merge (string branch, GitUpdateOptions options, IProgressMonitor monitor)
{
int stashIndex = -1;
+ var oldHead = RootRepository.Head.Tip;
Signature sig = GetSignature ();
if (sig == null)
@@ -780,7 +802,7 @@ namespace MonoDevelop.VersionControl.Git
if (mergeResult.Status == MergeStatus.Conflicts)
ConflictResolver (monitor, RootRepository.Head.Tip, RootRepository.Info.Message);
} finally {
- CommonPostMergeRebase (stashIndex, GitUpdateOptions.SaveLocalChanges, monitor);
+ CommonPostMergeRebase (stashIndex, GitUpdateOptions.SaveLocalChanges, monitor, oldHead);
}
}
@@ -832,7 +854,7 @@ namespace MonoDevelop.VersionControl.Git
(string)changeSet.ExtendedProperties ["Git.AuthorEmail"],
DateTimeOffset.Now), sig);
else
- repo.RootRepository.Commit (message, sig);
+ repo.RootRepository.Commit (message, sig, sig);
}
public bool IsUserInfoDefault ()
@@ -885,9 +907,9 @@ namespace MonoDevelop.VersionControl.Git
{
int transferProgress = 0;
int checkoutProgress = 0;
- RetryUntilSuccess (monitor, delegate {
+ RetryUntilSuccess (monitor, credType => {
RootPath = LibGit2Sharp.Repository.Clone (Url, targetLocalPath, new CloneOptions {
- CredentialsProvider = GitCredentials.TryGet,
+ CredentialsProvider = (url, userFromUrl, types) => GitCredentials.TryGet (url, userFromUrl, types, credType),
OnTransferProgress = (tp) => OnTransferProgress (tp, monitor, ref transferProgress),
OnCheckoutProgress = (path, completedSteps, totalSteps) => OnCheckoutProgress (completedSteps, totalSteps, monitor, ref checkoutProgress),
@@ -1103,10 +1125,10 @@ namespace MonoDevelop.VersionControl.Git
RootRepository.Branches.Update (branch, b => b.TrackedBranch = "refs/remotes/" + remote + "/" + remoteBranch);
}
- RetryUntilSuccess (monitor, () =>
+ RetryUntilSuccess (monitor, credType =>
RootRepository.Network.Push (RootRepository.Network.Remotes [remote], "refs/heads/" + remoteBranch, new PushOptions {
OnPushStatusError = pushStatusErrors => success = false,
- CredentialsProvider = GitCredentials.TryGet
+ CredentialsProvider = (url, userFromUrl, types) => GitCredentials.TryGet (url, userFromUrl, types, credType)
})
);
@@ -1225,11 +1247,9 @@ namespace MonoDevelop.VersionControl.Git
public void PushTag (string name)
{
- RetryUntilSuccess (null, delegate {
- RootRepository.Network.Push (RootRepository.Network.Remotes [GetCurrentRemote ()], "refs/tags/" + name + ":refs/tags/" + name, new PushOptions {
- CredentialsProvider = GitCredentials.TryGet,
- });
- });
+ RetryUntilSuccess (null, credType => RootRepository.Network.Push (RootRepository.Network.Remotes [GetCurrentRemote ()], "refs/tags/" + name + ":refs/tags/" + name, new PushOptions {
+ CredentialsProvider = (url, userFromUrl, types) => GitCredentials.TryGet (url, userFromUrl, types, credType),
+ }));
}
public IEnumerable<string> GetRemoteBranches (string remoteName)
@@ -1388,6 +1408,9 @@ namespace MonoDevelop.VersionControl.Git
protected override void OnMoveFile (FilePath localSrcPath, FilePath localDestPath, bool force, IProgressMonitor monitor)
{
+ var srcRepo = GetRepository (localSrcPath);
+ var dstRepo = GetRepository (localDestPath);
+
VersionInfo vi = GetVersionInfo (localSrcPath, VersionInfoQueryFlags.IgnoreCache);
if (vi == null || !vi.IsVersioned) {
base.OnMoveFile (localSrcPath, localDestPath, force, monitor);
@@ -1396,10 +1419,16 @@ namespace MonoDevelop.VersionControl.Git
vi = GetVersionInfo (localDestPath, VersionInfoQueryFlags.IgnoreCache);
if (vi != null && ((vi.Status & (VersionStatus.ScheduledDelete | VersionStatus.ScheduledReplace)) != VersionStatus.Unversioned))
- RootRepository.Unstage (localDestPath);
+ dstRepo.Unstage (localDestPath);
- RootRepository.Move (localSrcPath, localDestPath);
- ClearCachedVersionInfo (localSrcPath, localDestPath);
+ if (srcRepo == dstRepo) {
+ srcRepo.Move (localSrcPath, localDestPath);
+ ClearCachedVersionInfo (localSrcPath, localDestPath);
+ } else {
+ File.Copy (localSrcPath, localDestPath);
+ srcRepo.Remove (localSrcPath, true);
+ dstRepo.Stage (localDestPath);
+ }
}
protected override void OnMoveDirectory (FilePath localSrcPath, FilePath localDestPath, bool force, IProgressMonitor monitor)
@@ -1433,7 +1462,7 @@ namespace MonoDevelop.VersionControl.Git
repositoryPath = repository.ToGitPath (repositoryPath);
var status = repository.RetrieveStatus (repositoryPath);
if (status != FileStatus.NewInIndex && status != FileStatus.NewInWorkdir) {
- foreach (var hunk in repository.Blame (repositoryPath, new BlameOptions { Strategy = BlameStrategy.FollowExactRenames })) {
+ foreach (var hunk in repository.Blame (repositoryPath, new BlameOptions { FindExactRenames = true, })) {
var commit = hunk.FinalCommit;
var author = hunk.FinalSignature;
working = new Annotation (commit.Sha, author.Name, author.When.LocalDateTime, String.Format ("<{0}>", author.Email));
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
index 57b2afc7f3..44776dafe0 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitUtil.cs
@@ -71,12 +71,5 @@ namespace MonoDevelop.VersionControl.Git
repo.Network.Remotes.Add ("origin", url);
return repo;
}
-
- internal static bool IsGitRepository (this FilePath path)
- {
- // Maybe check if it has a HEAD file? But this check should be enough.
- var newPath = path.Combine (".git");
- return Directory.Exists (newPath) && Directory.Exists (newPath.Combine ("objects")) && Directory.Exists (newPath.Combine ("refs"));
- }
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs
index 89d279df66..96bc74e8fc 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/GitVersionControl.cs
@@ -63,11 +63,7 @@ namespace MonoDevelop.VersionControl.Git
protected override FilePath OnGetRepositoryPath (FilePath path, string id)
{
- if (path.IsEmpty || path.ParentDirectory.IsEmpty || path.IsNull || path.ParentDirectory.IsNull)
- return null;
- if (path.IsGitRepository ())
- return path;
- return OnGetRepositoryPath (path.ParentDirectory, id);
+ return LibGit2Sharp.Repository.Discover (path.ResolveLinks ());
}
internal void UnregisterRepo (GitRepository repo)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/TfsSmartSubtransport.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/TfsSmartSubtransport.cs
index 5d90c377b4..a9b1485780 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/TfsSmartSubtransport.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Git/MonoDevelop.VersionControl.Git/TfsSmartSubtransport.cs
@@ -79,12 +79,19 @@ namespace MonoDevelop.VersionControl.Git
}
// Grab the credentials from the user.
- var cred = (UsernamePasswordCredentials)GitCredentials.TryGet (url, "", SupportedCredentialTypes.UsernamePassword);
-
- var httpClient = new HttpClient (new HttpClientHandler { Credentials = new System.Net.NetworkCredential (cred.Username, cred.Password) }) {
+ var httpClient = new HttpClient {
Timeout = TimeSpan.FromMinutes (1.0),
};
+ var res = httpClient.GetAsync (serviceUri).Result;
+ if (res.StatusCode == System.Net.HttpStatusCode.Unauthorized) {
+ var cred = (UsernamePasswordCredentials)GitCredentials.TryGet (url, "", SupportedCredentialTypes.UsernamePassword, GitCredentialsType.Tfs);
+
+ httpClient = new HttpClient (new HttpClientHandler { Credentials = new System.Net.NetworkCredential (cred.Username, cred.Password) }) {
+ Timeout = TimeSpan.FromMinutes (1.0),
+ };
+ }
+
return new TfsSmartSubtransportStream(this) {
HttpClient = httpClient,
ServiceUri = new Uri (serviceUri),
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs
index ddbc5124ab..d46fe7313a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Tests/RepositoryTests.cs
@@ -137,6 +137,11 @@ namespace VersionControl.Subversion.Unix.Tests
{
return new SubversionRepository (new SvnClient (), url, path);
}
+
+ protected override Repository GetRepo ()
+ {
+ return new SubversionRepository (new SvnClient (), string.Empty, FilePath.Empty);
+ }
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix.csproj
index b787abf01d..39a4ab53a3 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix.csproj
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion.Unix/MonoDevelop.VersionControl.Subversion.Unix.csproj
@@ -57,6 +57,8 @@
<DebugSymbols>true</DebugSymbols>
<DocumentationFile>..\..\..\..\build\AddIns\VersionControl\MonoDevelop.VersionControl.Subversion.Unix.xml</DocumentationFile>
<DebugType>pdbonly</DebugType>
+ <ConsolePause>false</ConsolePause>
+ <NoWarn>1591;1573</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj
index 5ffb4039fe..191e7cc630 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion.csproj
@@ -29,9 +29,9 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>True</Optimize>
- <OutputPath>..\..\..\..\build\AddIns\VersionControl\</OutputPath>
+ <OutputPath>..\..\..\..\build\AddIns\VersionControl</OutputPath>
<ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
+ <WarningLevel>3</WarningLevel>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<Execution>
<Execution clr-version="Net_2_0" />
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs
index 13e705e53a..54dae06291 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl.Subversion/MonoDevelop.VersionControl.Subversion/SubversionRepository.cs
@@ -124,7 +124,7 @@ namespace MonoDevelop.VersionControl.Subversion
var toLock = new List<FilePath>();
foreach (var path in paths) {
- if (!File.Exists (path) || !Svn.HasNeedLock (path) || (File.GetAttributes (path) & FileAttributes.ReadOnly) == 0)
+ if (!File.Exists (path) || !GetVersionInfo (path).IsVersioned || !Svn.HasNeedLock (path) || (File.GetAttributes (path) & FileAttributes.ReadOnly) == 0)
continue;
toLock.Add (path);
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs
index 76b7e4337b..437ef02106 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitDialog.cs
@@ -39,14 +39,16 @@ using Mono.Addins;
using MonoDevelop.Ide;
using MonoDevelop.Projects;
using MonoDevelop.Components;
+using System.Collections.Generic;
+using System.Linq;
namespace MonoDevelop.VersionControl.Dialogs
{
partial class CommitDialog : Gtk.Dialog
{
ListStore store;
- ArrayList selected = new ArrayList ();
- ArrayList extensions = new ArrayList ();
+ List<FilePath> selected = new List<FilePath> ();
+ List<CommitDialogExtension> extensions = new List<CommitDialogExtension> ();
ChangeSet changeSet;
string oldMessage;
bool responseSensitive;
@@ -90,6 +92,10 @@ namespace MonoDevelop.VersionControl.Dialogs
continue;
}
if (ext.Initialize (changeSet)) {
+ var newTitle = ext.FormatDialogTitle (changeSet, Title);
+ if (newTitle != null)
+ Title = newTitle;
+
ext.CommitMessageTextViewHook (textview);
if (separatorRequired) {
HSeparator sep = new HSeparator ();
@@ -216,7 +222,7 @@ namespace MonoDevelop.VersionControl.Dialogs
}
// Update the change set
- ArrayList todel = new ArrayList ();
+ List<FilePath> todel = new List<FilePath> ();
foreach (ChangeSetItem it in changeSet.Items) {
if (!selected.Contains (it.LocalPath))
todel.Add (it.LocalPath);
@@ -229,7 +235,7 @@ namespace MonoDevelop.VersionControl.Dialogs
int n;
for (n=0; n<extensions.Count; n++) {
- CommitDialogExtension ext = (CommitDialogExtension) extensions [n];
+ CommitDialogExtension ext = extensions [n];
bool res;
try {
res = ext.OnBeginCommit (changeSet);
@@ -240,7 +246,7 @@ namespace MonoDevelop.VersionControl.Dialogs
if (!res) {
// Commit failed. Rollback the previous extensions
for (int m=0; m<n; m++) {
- ext = (CommitDialogExtension) extensions [m];
+ ext = extensions [m];
try {
ext.OnEndCommit (changeSet, false);
} catch {}
@@ -285,7 +291,7 @@ namespace MonoDevelop.VersionControl.Dialogs
public string[] GetFilesToCommit ()
{
- return (string[]) selected.ToArray (typeof(string));
+ return selected.ToPathStrings ().ToArray ();
}
public string Message {
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs
index ec28d6d478..79a73b6d11 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/CommitMessageStylePanelWidget.cs
@@ -44,8 +44,7 @@ namespace MonoDevelop.VersionControl
public CommitMessageStylePanelWidget()
{
this.Build();
-
- textview.ModifyFont (FontService.MonospaceFont.CopyModified (0.8d));
+
textview.AcceptsTab = true;
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs
index 32a43eddf8..091af96b7b 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/EditRepositoryDialog.cs
@@ -1,12 +1,13 @@
using System;
using System.Collections;
+using System.Collections.Generic;
namespace MonoDevelop.VersionControl.Dialogs
{
internal partial class EditRepositoryDialog : Gtk.Dialog
{
Repository repo;
- ArrayList systems = new ArrayList ();
+ List<VersionControlSystem> systems = new List<VersionControlSystem> ();
IRepositoryEditor editor;
public EditRepositoryDialog (Repository editedRepository)
@@ -58,7 +59,7 @@ namespace MonoDevelop.VersionControl.Dialogs
string oldname = repo != null ? repo.Name : "";
- VersionControlSystem vcs = (VersionControlSystem) systems [versionControlType.Active];
+ VersionControlSystem vcs = systems [versionControlType.Active];
repo = vcs.CreateRepositoryInstance ();
repo.Name = oldname;
repo.NameChanged += OnNameChanged;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs
index 972fad24cf..a514938b0e 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Dialogs/SelectRepositoryDialog.cs
@@ -6,6 +6,7 @@ using MonoDevelop.Core;
using Gtk;
using MonoDevelop.Ide;
using MonoDevelop.Components;
+using System.Collections.Generic;
namespace MonoDevelop.VersionControl.Dialogs
{
@@ -18,10 +19,10 @@ namespace MonoDevelop.VersionControl.Dialogs
internal partial class SelectRepositoryDialog : Gtk.Dialog
{
Repository repo;
- ArrayList systems = new ArrayList ();
+ List<VersionControlSystem> systems = new List<VersionControlSystem> ();
Gtk.TreeStore store;
SelectRepositoryMode mode;
- ArrayList loadingRepos = new ArrayList ();
+ List<Repository> loadingRepos = new List<Repository> ();
IRepositoryEditor currentEditor;
string defaultPath;
@@ -116,7 +117,7 @@ namespace MonoDevelop.VersionControl.Dialogs
if (repCombo.Active == -1)
return;
- VersionControlSystem vcs = (VersionControlSystem) systems [repCombo.Active];
+ VersionControlSystem vcs = systems [repCombo.Active];
repo = vcs.CreateRepositoryInstance ();
currentEditor = vcs.CreateRepositoryEditor (repo);
repoContainer.Add (currentEditor.Widget);
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs
index 51c3dbfa41..ef94cc2166 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/BlameWidget.cs
@@ -399,7 +399,7 @@ namespace MonoDevelop.VersionControl.Views
}
internal double highlightPositon;
- internal Annotation highlightAnnotation;
+ internal Annotation highlightAnnotation, menuAnnotation;
protected override bool OnMotionNotifyEvent (EventMotion evnt)
{
TooltipText = null;
@@ -438,6 +438,9 @@ namespace MonoDevelop.VersionControl.Views
protected override bool OnButtonPressEvent (EventButton evnt)
{
if (evnt.TriggersContextMenu ()) {
+ int startLine = widget.Editor.YToLine (widget.Editor.VAdjustment.Value + evnt.Y);
+ menuAnnotation = startLine > 0 && startLine <= annotations.Count ? annotations[startLine - 1] : null;
+
CommandEntrySet opset = new CommandEntrySet ();
opset.AddItem (BlameCommands.ShowDiff);
opset.AddItem (BlameCommands.ShowLog);
@@ -460,24 +463,24 @@ namespace MonoDevelop.VersionControl.Views
[CommandHandler (BlameCommands.CopyRevision)]
protected void OnCopyRevision ()
{
- if (highlightAnnotation == null)
+ if (menuAnnotation == null)
return;
var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
- clipboard.Text = highlightAnnotation.Revision.ToString ();
+ clipboard.Text = menuAnnotation.Revision.ToString ();
clipboard = Clipboard.Get (Gdk.Atom.Intern ("PRIMARY", false));
- clipboard.Text = highlightAnnotation.Revision.ToString ();
+ clipboard.Text = menuAnnotation.Revision.ToString ();
}
[CommandHandler (BlameCommands.ShowDiff)]
protected void OnShowDiff ()
{
- if (highlightAnnotation == null)
+ if (menuAnnotation == null)
return;
foreach (var view in widget.info.Document.ParentDocument.Views) {
DiffView diffView = view.GetContent<DiffView> ();
if (diffView != null) {
view.Select ();
- var rev = widget.info.History.FirstOrDefault (h => h.ToString () == highlightAnnotation.Revision);
+ var rev = widget.info.History.FirstOrDefault (h => h.ToString () == menuAnnotation.Revision);
if (rev == null)
return;
diffView.ComparisonWidget.SetRevision (diffView.ComparisonWidget.DiffEditor, rev.GetPrevious ());
@@ -490,13 +493,13 @@ namespace MonoDevelop.VersionControl.Views
[CommandHandler (BlameCommands.ShowLog)]
protected void OnShowLog ()
{
- if (highlightAnnotation == null)
+ if (menuAnnotation == null)
return;
foreach (var view in widget.info.Document.ParentDocument.Views) {
LogView logView = view.GetContent<LogView> ();
if (logView != null) {
view.Select ();
- var rev = widget.info.History.FirstOrDefault (h => h.ToString () == highlightAnnotation.Revision);
+ var rev = widget.info.History.FirstOrDefault (h => h.ToString () == menuAnnotation.Revision);
if (rev == null)
return;
logView.LogWidget.SelectedRevision = rev;
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs
index 166eadcd2b..32905950ad 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/LogWidget.cs
@@ -469,7 +469,7 @@ namespace MonoDevelop.VersionControl.Views
// Grab today's day and the start of tomorrow's day to make Today/Yesterday calculations.
var now = DateTime.Now;
- var age = new DateTime (now.Year, now.Month, now.Day + 1) - rev.Time;
+ var age = new DateTime (now.Year, now.Month, now.Day).AddDays(1) - rev.Time;
if (age.Days >= 0 && age.Days < 1) { // Check whether it's a commit that's less than a day away. Also discard future commits.
day = GettextCatalog.GetString ("Today");
} else if (age.Days < 2) { // Check whether it's a commit from yesterday.
@@ -477,7 +477,7 @@ namespace MonoDevelop.VersionControl.Views
} else {
day = rev.Time.ToShortDateString ();
}
- renderer.Text = string.Format ("{0} {1:HH:MM}", day, rev.Time);
+ renderer.Text = string.Format ("{0} {1:HH:mm}", day, rev.Time);
}
static void GraphFunc (Gtk.TreeViewColumn tree_column, Gtk.CellRenderer cell, Gtk.TreeModel model, Gtk.TreeIter iter)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/VersionControlDocumentInfo.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/VersionControlDocumentInfo.cs
index 62faf89ddb..a002693010 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/VersionControlDocumentInfo.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl.Views/VersionControlDocumentInfo.cs
@@ -58,8 +58,8 @@ namespace MonoDevelop.VersionControl.Views
}
public Repository Repository {
- get;
- set;
+ get { return Item.Repository; }
+ set { Item.Repository = value; }
}
public bool Started {
@@ -70,7 +70,7 @@ namespace MonoDevelop.VersionControl.Views
{
this.Document = document;
this.Item = item;
- this.Repository = repository;
+ item.Repository = repository;
}
public void Start (bool rerun = false)
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs
index 70766591ea..7a164f686a 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/AddRemoveMoveCommand.cs
@@ -33,13 +33,14 @@ namespace MonoDevelop.VersionControl
protected override void Run ()
{
IProgressMonitor monitor = Monitor;
-
+
foreach (VersionControlItemList list in items.SplitByRepository ())
list[0].Repository.Add (list.Paths, true, monitor);
Gtk.Application.Invoke (delegate {
VersionControlService.NotifyFileStatusChanged (items);
});
+ monitor.ReportSuccess (GettextCatalog.GetString ("Add operation completed."));
}
}
@@ -133,6 +134,7 @@ namespace MonoDevelop.VersionControl
Gtk.Application.Invoke (delegate {
VersionControlService.NotifyFileStatusChanged (items);
});
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Remove operation completed."));
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ChangeLogWriter.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ChangeLogWriter.cs
index 40317e6674..c49cea3faa 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ChangeLogWriter.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/ChangeLogWriter.cs
@@ -89,6 +89,7 @@ namespace MonoDevelop.VersionControl
formatter.MaxColumns = MessageFormat.MaxColumns;
formatter.TabWidth = MessageFormat.TabWidth;
formatter.TabsAsSpaces = MessageFormat.TabsAsSpaces;
+ formatter.KeepLines = true;
if (message_style.Header.Length > 0) {
string [,] tags = new string[,] { {"AuthorName", uinfo.Name}, {"AuthorEmail", uinfo.Email} };
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs
index a8ffdc9e4a..64dd18ff92 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Commands.cs
@@ -37,21 +37,20 @@ namespace MonoDevelop.VersionControl
{
VersionControlItemList list = new VersionControlItemList ();
- WorkspaceItem wob;
- SolutionItem sol;
+ IWorkspaceObject wob;
Repository repo = null;
wob = IdeApp.ProjectOperations.CurrentSelectedWorkspaceItem;
if (wob != null)
repo = VersionControlService.GetRepository (wob);
if (repo == null) {
- sol = IdeApp.ProjectOperations.CurrentSelectedSolutionItem;
- if (sol != null)
- repo = VersionControlService.GetRepository (sol);
+ wob = IdeApp.ProjectOperations.CurrentSelectedSolutionItem;
+ if (wob != null)
+ repo = VersionControlService.GetRepository (wob);
}
if (repo == null || repo.VersionControlSystem == null || !repo.VersionControlSystem.IsInstalled)
return list;
- list.Add (new VersionControlItem (repo, wob, wob.FileName, true, null));
+ list.Add (new VersionControlItem (repo, wob, wob.BaseDirectory, true, null));
return list;
}
@@ -107,7 +106,7 @@ namespace MonoDevelop.VersionControl
return new VersionControlItem (repo, project, doc.FileName, false, null);
}
- protected override void Run ()
+ protected sealed override void Run ()
{
VersionControlItemList items = GetItems ();
RunCommand (items, false);
@@ -244,30 +243,28 @@ namespace MonoDevelop.VersionControl
}
}
- class CurrentFileDiffHandler : FileVersionControlCommandHandler
+ class CurrentFileViewHandler<T> : FileVersionControlCommandHandler where T:IAttachableViewContent
{
- protected override void Run ()
+ protected override bool RunCommand (VersionControlItemList items, bool test)
{
+ if (test)
+ return true;
+
var window = IdeApp.Workbench.ActiveDocument.Window;
- window.SwitchView (window.FindView<IDiffView> ());
+ window.SwitchView (window.FindView<T> ());
+ return true;
}
}
+
+ class CurrentFileDiffHandler : CurrentFileViewHandler<IDiffView>
+ {
+ }
- class CurrentFileBlameHandler : FileVersionControlCommandHandler
+ class CurrentFileBlameHandler : CurrentFileViewHandler<IBlameView>
{
- protected override void Run ()
- {
- var window = IdeApp.Workbench.ActiveDocument.Window;
- window.SwitchView (window.FindView<IBlameView> ());
- }
}
- class CurrentFileLogHandler : FileVersionControlCommandHandler
+ class CurrentFileLogHandler : CurrentFileViewHandler<ILogView>
{
- protected override void Run ()
- {
- var window = IdeApp.Workbench.ActiveDocument.Window;
- window.SwitchView (window.FindView<ILogView> ());
- }
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitDialogExtension.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitDialogExtension.cs
index 6c51bed69f..eb2d119063 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitDialogExtension.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/CommitDialogExtension.cs
@@ -24,6 +24,11 @@ namespace MonoDevelop.VersionControl
return true;
}
+ public virtual string FormatDialogTitle (ChangeSet changeSet, string title)
+ {
+ return null;
+ }
+
public virtual void CommitMessageTextViewHook (Gtk.TextView textView)
{
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IgnoreCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IgnoreCommand.cs
index b36d523c30..b39bfb8af4 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IgnoreCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/IgnoreCommand.cs
@@ -81,7 +81,6 @@ namespace MonoDevelop.VersionControl
foreach (VersionControlItemList list in items.SplitByRepository ())
list[0].Repository.Ignore (list.Paths);
- Monitor.ReportSuccess (GettextCatalog.GetString ("Ignore operation completed."));
Gtk.Application.Invoke (delegate {
foreach (VersionControlItem item in items)
if (!item.IsDirectory)
@@ -89,6 +88,7 @@ namespace MonoDevelop.VersionControl
VersionControlService.NotifyFileStatusChanged (items);
});
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Ignore operation completed."));
}
}
}
@@ -144,7 +144,6 @@ namespace MonoDevelop.VersionControl
foreach (VersionControlItemList list in items.SplitByRepository ())
list[0].Repository.Unignore (list.Paths);
- Monitor.ReportSuccess (GettextCatalog.GetString ("Unignore operation completed."));
Gtk.Application.Invoke (delegate {
foreach (VersionControlItem item in items)
if (!item.IsDirectory)
@@ -152,6 +151,7 @@ namespace MonoDevelop.VersionControl
VersionControlService.NotifyFileStatusChanged (items);
});
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Unignore operation completed."));
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LockCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LockCommand.cs
index 66507132e4..2e318afdd6 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LockCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/LockCommand.cs
@@ -60,11 +60,11 @@ namespace MonoDevelop.VersionControl
foreach (VersionControlItemList list in items.SplitByRepository ())
list[0].Repository.Lock (Monitor, list.Paths);
- Monitor.ReportSuccess (GettextCatalog.GetString ("Lock operation completed."));
Gtk.Application.Invoke (delegate {
VersionControlService.NotifyFileStatusChanged (items);
});
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Lock operation completed."));
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs
index 1650087e48..7f0f78f8d1 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/PublishCommand.cs
@@ -57,7 +57,7 @@ namespace MonoDevelop.VersionControl
{
// Ensure that we strip out all linked files from outside of the solution/projects path.
if (entry is IWorkspaceFileObject)
- files.AddRange (((IWorkspaceFileObject)entry).GetItemFiles (true).Where (file => file.IsChildPathOf (entry.BaseDirectory)));
+ files.AddRange (((IWorkspaceFileObject)entry).GetItemFiles (true).Where (file => file.CanonicalPath.IsChildPathOf (entry.BaseDirectory)));
}
public static bool CanPublish (Repository vc, string path, bool isDir) {
@@ -101,11 +101,10 @@ namespace MonoDevelop.VersionControl
return;
}
- Monitor.ReportSuccess (GettextCatalog.GetString ("Publish operation completed."));
-
Gtk.Application.Invoke (delegate {
VersionControlService.NotifyFileStatusChanged (new FileUpdateEventArgs (vc, path, true));
});
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Publish operation completed."));
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs
index 0d80dc03d1..205c00e128 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/Repository.cs
@@ -94,9 +94,19 @@ namespace MonoDevelop.VersionControl
if (--references == 0)
Dispose ();
}
-
+
+ internal bool Disposed { get; private set; }
public virtual void Dispose ()
{
+ Disposed = true;
+ if (!queryRunning)
+ return;
+
+ lock (queryLock) {
+ fileQueryQueue.Clear ();
+ directoryQueryQueue.Clear ();
+ recursiveDirectoryQueryQueue.Clear ();
+ }
}
// Display name of the repository
@@ -327,7 +337,7 @@ namespace MonoDevelop.VersionControl
class RecursiveDirectoryInfoQuery : DirectoryInfoQuery
{
- public VersionInfo[] Result;
+ public VersionInfo[] Result = new VersionInfo[0];
public ManualResetEvent ResetEvent;
public int Count;
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs
index 8543f3733b..600af23154 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertCommand.cs
@@ -59,7 +59,6 @@ namespace MonoDevelop.VersionControl
foreach (VersionControlItemList list in items.SplitByRepository ())
list[0].Repository.Revert (list.Paths, true, Monitor);
- Monitor.ReportSuccess (GettextCatalog.GetString ("Revert operation completed."));
Gtk.Application.Invoke (delegate {
foreach (VersionControlItem item in items) {
if (!item.IsDirectory) {
@@ -72,6 +71,7 @@ namespace MonoDevelop.VersionControl
}
VersionControlService.NotifyFileStatusChanged (items);
});
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Revert operation completed."));
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertRevisionsCommands.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertRevisionsCommands.cs
index 6e365cd1d5..dea73b39bf 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertRevisionsCommands.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/RevertRevisionsCommands.cs
@@ -115,7 +115,6 @@ namespace MonoDevelop.VersionControl
if (!(isDir || Directory.Exists (path)))
isDir = false;
- Monitor.ReportSuccess (GettextCatalog.GetString ("Revert operation completed."));
Gtk.Application.Invoke (delegate {
if (!isDir) {
// Reload reverted files
@@ -128,6 +127,7 @@ namespace MonoDevelop.VersionControl
VersionControlService.NotifyFileStatusChanged (new FileUpdateEventArgs (vc, path, true));
}
});
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Revert operation completed."));
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnlockCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnlockCommand.cs
index 599e3d56f0..52b57bec2f 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnlockCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UnlockCommand.cs
@@ -62,10 +62,10 @@ namespace MonoDevelop.VersionControl
foreach (VersionControlItemList list in items.SplitByRepository ())
list[0].Repository.Unlock (Monitor, list.Paths);
- Monitor.ReportSuccess (GettextCatalog.GetString ("Unlock operation completed."));
Gtk.Application.Invoke (delegate {
VersionControlService.NotifyFileStatusChanged (items);
});
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Unlock operation completed."));
}
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UpdateCommand.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UpdateCommand.cs
index 6677562bb1..5c4c641fc3 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UpdateCommand.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/UpdateCommand.cs
@@ -33,10 +33,10 @@ namespace MonoDevelop.VersionControl
foreach (VersionControlItemList list in items.SplitByRepository ()) {
list[0].Repository.Update (list.Paths, true, Monitor);
}
- Monitor.ReportSuccess (GettextCatalog.GetString ("Update operation completed."));
Gtk.Application.Invoke (delegate {
VersionControlService.NotifyFileStatusChanged (items);
});
+ Monitor.ReportSuccess (GettextCatalog.GetString ("Update operation completed."));
}
}
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlItem.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlItem.cs
index 5eea5c18aa..9ee8889509 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlItem.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlItem.cs
@@ -48,10 +48,17 @@ namespace MonoDevelop.VersionControl
get;
private set;
}
-
+
+ Repository repository;
public Repository Repository {
- get;
- private set;
+ get {
+ if (repository != null && repository.Disposed)
+ repository = VersionControlService.GetRepository (WorkspaceObject);
+ return repository;
+ }
+ internal set {
+ repository = value;
+ }
}
public FilePath Path {
diff --git a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs
index 800859dc81..1b305bdee5 100644
--- a/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs
+++ b/main/src/addins/VersionControl/MonoDevelop.VersionControl/MonoDevelop.VersionControl/VersionControlService.cs
@@ -95,7 +95,15 @@ namespace MonoDevelop.VersionControl
static void OnExtensionChanged (object s, ExtensionNodeEventArgs args)
{
- VersionControlSystem vcs = (VersionControlSystem) args.ExtensionObject;
+ VersionControlSystem vcs;
+
+ try {
+ vcs = (VersionControlSystem) args.ExtensionObject;
+ } catch (Exception e) {
+ LoggingService.LogError ("Failed to initialize VersionControlSystem type.", e);
+ return;
+ }
+
if (args.Change == ExtensionChange.Add) {
handlers.Add (vcs);
try {
@@ -210,26 +218,28 @@ namespace MonoDevelop.VersionControl
return repo;
}
-
+
public static Repository GetRepositoryReference (string path, string id)
{
VersionControlSystem detectedVCS = null;
- FilePath shortestPath = FilePath.Null;
+ FilePath bestMatch = FilePath.Null;
foreach (VersionControlSystem vcs in GetVersionControlSystems ()) {
var newPath = vcs.GetRepositoryPath (path, id);
if (!newPath.IsNullOrEmpty) {
- if (string.IsNullOrEmpty (shortestPath)) {
- shortestPath = newPath;
+ // Check whether we have no match or if a new match is found with a longer path.
+ // TODO: If the repo root is not the same as the repo reference, ask user for input.
+ // TODO: If we have two version control directories in the same place, ask user for input.
+ if (bestMatch.IsNullOrEmpty) {
+ bestMatch = newPath;
detectedVCS = vcs;
- } else if (shortestPath.CompareTo (newPath) <= 0) {
- // They are guaranteed to be on the same path segments, so choose by path length.
- shortestPath = newPath;
+ } else if (bestMatch.CompareTo (newPath) <= 0) {
+ bestMatch = newPath;
detectedVCS = vcs;
}
}
}
- return detectedVCS == null ? null : detectedVCS.GetRepositoryReference (shortestPath, id);
+ return detectedVCS == null ? null : detectedVCS.GetRepositoryReference (bestMatch, id);
}
diff --git a/main/src/addins/VersionControl/Subversion.Win32.Tests/RepositoryTests.cs b/main/src/addins/VersionControl/Subversion.Win32.Tests/RepositoryTests.cs
index 3d93fc42cf..e57d6c0ec5 100644
--- a/main/src/addins/VersionControl/Subversion.Win32.Tests/RepositoryTests.cs
+++ b/main/src/addins/VersionControl/Subversion.Win32.Tests/RepositoryTests.cs
@@ -42,19 +42,10 @@ namespace MonoDevelop.VersionControl.Subversion.Tests
public override void Setup ()
{
RemotePath = new FilePath (FileService.CreateTempDirectory ());
- RemoteUrl = "svn://localhost:3690/repo";
- SvnServe = new Process ();
+ RemoteUrl = "file://" + RemotePath + "/repo";
base.Setup ();
}
- [TearDown]
- public override void TearDown ()
- {
- SvnServe.Kill ();
-
- base.TearDown ();
- }
-
protected override void TestDiff ()
{
string difftext = @"--- testfile (revision 1)
@@ -131,6 +122,11 @@ namespace MonoDevelop.VersionControl.Subversion.Tests
{
return new SubversionRepository (new SvnSharpClient (), url, path);
}
+
+ protected override Repository GetRepo ()
+ {
+ return new SubversionRepository (new SvnSharpClient (), string.Empty, FilePath.Empty);
+ }
}
}
diff --git a/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs b/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs
index e15becae6d..009341e6e9 100644
--- a/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs
+++ b/main/src/addins/VersionControl/Subversion.Win32/SvnSharpClient.cs
@@ -419,6 +419,9 @@ namespace SubversionAddinWindows
public override IEnumerable<VersionInfo> Status (Repository repo, FilePath path, SvnRevision revision, bool descendDirs, bool changedItemsOnly, bool remoteStatus)
{
+ if (path == FilePath.Null)
+ throw new ArgumentNullException ();
+
var list = new List<VersionInfo> ();
var args = new SvnStatusArgs {
Revision = GetRevision (revision),
@@ -430,12 +433,14 @@ namespace SubversionAddinWindows
try {
client.Status (path, args, (o, a) => list.Add (CreateVersionInfo (repo, a)));
} catch (SvnInvalidNodeKindException e) {
- if (e.SvnErrorCode == SvnErrorCode.SVN_ERR_WC_NOT_WORKING_COPY)
- list.Add (VersionInfo.CreateUnversioned (e.File, true));
- else if (e.SvnErrorCode == SvnErrorCode.SVN_ERR_WC_NOT_FILE)
- list.Add (VersionInfo.CreateUnversioned (e.File, false));
- else
- throw;
+ if (!string.IsNullOrEmpty (e.File)) {
+ if (e.SvnErrorCode == SvnErrorCode.SVN_ERR_WC_NOT_WORKING_COPY)
+ list.Add (VersionInfo.CreateUnversioned (e.File, true));
+ else if (e.SvnErrorCode == SvnErrorCode.SVN_ERR_WC_NOT_FILE)
+ list.Add (VersionInfo.CreateUnversioned (e.File, false));
+ else
+ throw;
+ }
} catch (SvnWorkingCopyPathNotFoundException e) {
list.Add (VersionInfo.CreateUnversioned (e.File, Directory.Exists (e.File)));
}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs
index 8f3ad07d78..71cbbdc966 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/CommonFileDialogExtensions.cs
@@ -26,8 +26,8 @@
using System;
using System.IO;
using System.Linq;
-using Gtk;
using Microsoft.WindowsAPICodePack.Dialogs;
+using MonoDevelop.Components;
using MonoDevelop.Components.Extensions;
using MonoDevelop.Core;
@@ -50,11 +50,11 @@ namespace MonoDevelop.Platform
dialog.Title = data.Title;
dialog.InitialDirectory = data.CurrentFolder;
+ dialog.ShowHiddenItems = data.ShowHidden;
var fileDialog = dialog as CommonOpenFileDialog;
if (fileDialog != null) {
fileDialog.Multiselect = data.SelectMultiple;
- fileDialog.ShowHiddenItems = data.ShowHidden;
if (data.Action == FileChooserAction.SelectFolder) {
fileDialog.IsFolderPicker = true;
return;
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs
index 51e84a743f..de8c74197f 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/OpenFileDialogHandler.cs
@@ -34,14 +34,15 @@ using System.Runtime.InteropServices;
using System.Text;
using Microsoft.WindowsAPICodePack.Dialogs;
using Microsoft.WindowsAPICodePack.Dialogs.Controls;
+using MonoDevelop.Components;
using MonoDevelop.Core;
+using MonoDevelop.Components.Extensions;
using MonoDevelop.Ide;
using MonoDevelop.Ide.Extensions;
using MonoDevelop.Ide.Gui;
using MonoDevelop.Projects.Text;
using Microsoft.WindowsAPICodePack.Shell;
using System.Windows;
-using Gtk;
namespace MonoDevelop.Platform
{
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/SelectFileDialogHandler.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/SelectFileDialogHandler.cs
index ec5123aded..ee641eb696 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/SelectFileDialogHandler.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/Dialogs/SelectFileDialogHandler.cs
@@ -29,8 +29,8 @@
using System;
using System.IO;
using System.Linq;
-using Gtk;
using Microsoft.WindowsAPICodePack.Dialogs;
+using MonoDevelop.Components;
using MonoDevelop.Components.Extensions;
using MonoDevelop.Core;
using MonoDevelop.Ide;
@@ -44,7 +44,7 @@ namespace MonoDevelop.Platform
var parent = data.TransientFor ?? MessageService.RootWindow;
CommonFileDialog dialog;
- if (data.Action == FileChooserAction.Open || data.Action == FileChooserAction.SelectFolder)
+ if ((data.Action & (FileChooserAction.Open | FileChooserAction.SelectFolder)) != 0)
dialog = new CustomCommonOpenFileDialog ();
else
dialog = new CommonSaveFileDialog ();
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
index 2a4612a1f0..0f19949e44 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
@@ -32,7 +32,7 @@
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\build\AddIns\WindowsPlatform.xml</DocumentationFile>
+ <DocumentationFile>..\..\..\..\build\AddIns\WindowsPlatform\WindowsPlatform.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
diff --git a/main/src/addins/Xml/Properties/MonoDevelop.XmlEditor.addin.xml b/main/src/addins/Xml/Properties/MonoDevelop.XmlEditor.addin.xml
index 632f38711b..d2da8c8f7e 100644
--- a/main/src/addins/Xml/Properties/MonoDevelop.XmlEditor.addin.xml
+++ b/main/src/addins/Xml/Properties/MonoDevelop.XmlEditor.addin.xml
@@ -23,6 +23,7 @@
<Extension path = "/MonoDevelop/Xml/Editor/XmlFileAssociations">
<Association extension = ".build" namespaceUri="http://nant.sf.net/release/0.85-rc3/nant.xsd" />
<Association extension = ".config" namespaceUri="urn:app-config" />
+ <Association extension = ".manifest" namespaceUri="schemas-microsoft-com:asm.v1" />
<Association extension = ".xsd" namespaceUri="http://www.w3.org/2001/XMLSchema" namespacePrefix="xs" />
<Association extension = ".xsl" namespaceUri="http://www.w3.org/1999/XSL/Transform" namespacePrefix="xsl" />
<Association extension = ".xslt" namespaceUri="http://www.w3.org/1999/XSL/Transform" namespacePrefix="xsl" />
diff --git a/main/src/addins/Xml/Tests/MonoDevelop.Xml.Tests.csproj b/main/src/addins/Xml/Tests/MonoDevelop.Xml.Tests.csproj
index 19cc5c4b38..f218032b4d 100644
--- a/main/src/addins/Xml/Tests/MonoDevelop.Xml.Tests.csproj
+++ b/main/src/addins/Xml/Tests/MonoDevelop.Xml.Tests.csproj
@@ -39,6 +39,7 @@
</Execution>
<DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
+ <DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\core\MonoDevelop.Core\MonoDevelop.Core.csproj">
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs
index 2c36b575ca..0b74632ea2 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs
@@ -92,13 +92,24 @@ namespace Mono.TextEditor.Highlighting
return styleLookup[style.Name];
return null;
}
-
+
+ public static string GetFileName (string name)
+ {
+ if (!styleLookup.ContainsKey (name))
+ throw new System.ArgumentException ("Style " + name + " not found", "name");
+ var provider = styleLookup [name];
+ if (provider is UrlStreamProvider) {
+ var usp = provider as UrlStreamProvider;
+ return usp.Url;
+ }
+ return null;
+ }
+
static void LoadStyle (string name)
{
if (!styleLookup.ContainsKey (name))
throw new System.ArgumentException ("Style " + name + " not found", "name");
var provider = styleLookup [name];
- styleLookup.Remove (name);
var stream = provider.Open ();
try {
if (provider is UrlStreamProvider) {
@@ -112,6 +123,7 @@ namespace Mono.TextEditor.Highlighting
} else {
styles [name] = ColorScheme.LoadFrom (stream);
}
+ styleLookup.Remove (name);
} catch (Exception e) {
throw new IOException ("Error while loading style :" + name, e);
} finally {
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
index f69c94d427..a60ae490f5 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Document/TextDocument.cs
@@ -815,6 +815,7 @@ namespace Mono.TextEditor
operation.Undo (this);
isInUndo = false;
OnUndone (new UndoOperationEventArgs (operation));
+ CommitDocumentUpdate ();
}
public void RollbackTo (ICSharpCode.NRefactory.Editor.ITextSourceVersion version)
@@ -861,6 +862,7 @@ namespace Mono.TextEditor
operation.Redo (this);
isInUndo = false;
OnRedone (new UndoOperationEventArgs (operation));
+ CommitDocumentUpdate ();
}
internal protected virtual void OnRedone (UndoOperationEventArgs e)
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs
index 73fdfd2306..43bfd4e04b 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/GtkWorkarounds.cs
@@ -489,13 +489,32 @@ namespace Mono.TextEditor
public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, Gdk.EventButton evt, Gdk.Rectangle caret)
{
int x, y;
- var window = evt.Window;
+ uint time, button;
+
+ var window = evt != null ? evt.Window : parent.GdkWindow;
+
+ if (window == null)
+ return;
window.GetOrigin (out x, out y);
- x += (int)evt.X;
- y += (int)evt.Y;
- ShowContextMenuInternal (menu, parent, x, y, caret, window, evt.Time, evt.Button);
+ if (evt == null) {
+ evt = Global.CurrentEvent as Gdk.EventButton;
+ }
+
+ if (evt != null) {
+ button = evt.Button;
+ time = evt.Time;
+ x += (int)evt.X;
+ y += (int)evt.Y;
+ } else {
+ button = 3;
+ time = 0;
+ x += caret.X;
+ y += caret.Y;
+ }
+
+ ShowContextMenuInternal (menu, parent, x, y, caret, window, time, button);
}
public static void ShowContextMenu (Gtk.Menu menu, Gtk.Widget parent, int ix, int iy, Gdk.Rectangle caret)
@@ -1023,7 +1042,7 @@ namespace Mono.TextEditor
}
}
- static bool canSetOverlayScrollbarPolicy = true;
+ static bool canSetOverlayScrollbarPolicy = Platform.IsMac;
[DllImport (PangoUtil.LIBQUARTZ)]
static extern void gtk_scrolled_window_set_overlay_policy (IntPtr sw, Gtk.PolicyType hpolicy, Gtk.PolicyType vpolicy);
@@ -1190,6 +1209,13 @@ namespace Mono.TextEditor
else
return 1d;
}
+
+ public static int ConvertToPixelScale (int size)
+ {
+ double scale = GetPixelScale ();
+
+ return (int)(size * scale);
+ }
public static Gdk.Pixbuf RenderIcon (this Gtk.IconSet iconset, Gtk.Style style, Gtk.TextDirection direction, Gtk.StateType state, Gtk.IconSize size, Gtk.Widget widget, string detail, double scale)
{
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
index f7fcf64ee9..7795463769 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextArea.cs
@@ -376,12 +376,6 @@ namespace Mono.TextEditor
#if ATK
TextEditorAccessible.Factory.Init (this);
#endif
-
- if (GtkGestures.IsSupported) {
- this.AddGestureMagnifyHandler ((sender, args) => {
- Options.Zoom += Options.Zoom * (args.Magnification / 4d);
- });
- }
OptionsChanged (this, EventArgs.Empty);
}
@@ -1297,13 +1291,9 @@ namespace Mono.TextEditor
scrollWindowTimer_mod = mod;
if (scrollWindowTimer == 0) {
scrollWindowTimer = GLib.Timeout.Add (50, delegate {
- //'If' below shouldn't be needed, but after reproducing bug with FireMotionEvent being called
- //when it shouldn't and attaching with debugger it turned out that it's called from here
- //even when scrollWindowTimer was 0, looks like GLib bug
- if (scrollWindowTimer == 0) {
- return false;
+ if (HasFocus) {
+ FireMotionEvent (scrollWindowTimer_x, scrollWindowTimer_y, scrollWindowTimer_mod);
}
- FireMotionEvent (scrollWindowTimer_x, scrollWindowTimer_y, scrollWindowTimer_mod);
return true;
});
}
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs
index c055338beb..b3dafffb02 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/Gui/TextViewMargin.cs
@@ -476,7 +476,9 @@ namespace Mono.TextEditor
protected internal override void OptionsChanged ()
{
DisposeGCs ();
-
+ selectionColor = null;
+ currentLineColor = null;
+
var markerFont = textEditor.Options.Font.Copy ();
markerFont.Size = markerFont.Size * 8 / 10;
markerLayout.FontDescription = markerFont;
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs
index 4f832f4456..824011e8a4 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs
@@ -392,7 +392,9 @@ namespace Mono.TextEditor
keyBindings.Add (GetKeyCode (Gdk.Key.f, Gdk.ModifierType.ControlMask), CaretMoveActions.Right);
keyBindings.Add (GetKeyCode (Gdk.Key.b, Gdk.ModifierType.ControlMask), CaretMoveActions.Left);
keyBindings.Add (GetKeyCode (Gdk.Key.p, Gdk.ModifierType.ControlMask), CaretMoveActions.Up);
+ keyBindings.Add (GetKeyCode (Gdk.Key.p, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask), SelectionActions.MoveUp);
keyBindings.Add (GetKeyCode (Gdk.Key.n, Gdk.ModifierType.ControlMask), CaretMoveActions.Down);
+ keyBindings.Add (GetKeyCode (Gdk.Key.n, Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask), SelectionActions.MoveDown);
keyBindings.Add (GetKeyCode (Gdk.Key.h, Gdk.ModifierType.ControlMask), DeleteActions.Backspace);
keyBindings.Add (GetKeyCode (Gdk.Key.d, Gdk.ModifierType.ControlMask), DeleteActions.Delete);
keyBindings.Add (GetKeyCode (Gdk.Key.o, Gdk.ModifierType.ControlMask), MiscActions.InsertNewLinePreserveCaretPosition);
diff --git a/main/src/core/Mono.Texteditor/SyntaxModes/XmlSyntaxMode.xml b/main/src/core/Mono.Texteditor/SyntaxModes/XmlSyntaxMode.xml
index 5b778909d5..ea169d2554 100644
--- a/main/src/core/Mono.Texteditor/SyntaxModes/XmlSyntaxMode.xml
+++ b/main/src/core/Mono.Texteditor/SyntaxModes/XmlSyntaxMode.xml
@@ -34,9 +34,8 @@
<End>--&gt;</End>
</Span>
- <Span color = "Xml Attribute" rule = "Comment">
- <Begin>&amp;</Begin>
-
+ <Span color = "Preprocessor" rule = "Comment">
+ <Begin>&amp;</Begin>
<End>;</End>
</Span>
@@ -62,14 +61,10 @@
</Span>
<Rule name = "Comment">
- <Span color = "Preprocessor">
- <Begin>&amp;</Begin>
- <End>;</End>
- </Span>
</Rule>
<Rule name = "InDocType" color = "Html Attribute Name" >
- <Span color = "Xml Attribute">
+ <Span color = "Preprocessor">
<Begin>&amp;</Begin>
<End>;</End>
</Span>
@@ -79,7 +74,7 @@
</Rule>
<Rule name = "InTag">
- <Span color = "Xml Attribute">
+ <Span color = "Preprocessor">
<Begin>&amp;</Begin>
<End>;</End>
</Span>
@@ -108,7 +103,7 @@
</Rule>
<Rule name = "InLiteral">
- <Span color = "Xml Attribute">
+ <Span color = "Preprocessor">
<Begin>&amp;</Begin>
<End>;</End>
</Span>
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs
index 837dac0d7a..84fc117ddc 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Assemblies/MonoTargetRuntime.cs
@@ -241,7 +241,10 @@ namespace MonoDevelop.Core.Assemblies
return;
foreach (string pcfile in GetAllPkgConfigFiles ()) {
try {
- ParsePCFile (new FilePath (pcfile).ResolveLinks ());
+ var pc = new FilePath (pcfile).ResolveLinks ();
+ if (!string.IsNullOrEmpty (pc))
+ ParsePCFile (pc);
+
if (ShuttingDown)
return;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/TimeCounter.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/TimeCounter.cs
index 55227a859f..051e80845e 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/TimeCounter.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Instrumentation/TimeCounter.cs
@@ -26,6 +26,7 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
namespace MonoDevelop.Core.Instrumentation
{
@@ -52,7 +53,7 @@ namespace MonoDevelop.Core.Instrumentation
class TimeCounter: ITimeTracker
{
- DateTime begin;
+ Stopwatch stopWatch = new Stopwatch ();
TimerTraceList traceList;
TimerTrace lastTrace;
TimerCounter counter;
@@ -97,16 +98,18 @@ namespace MonoDevelop.Core.Instrumentation
internal void Begin ()
{
- begin = DateTime.Now;
+ stopWatch.Start ();
}
public void End ()
{
- if (counter == null) {
+ if (!stopWatch.IsRunning) {
Console.WriteLine ("Timer already finished");
return;
}
- traceList.TotalTime = DateTime.Now - begin;
+
+ stopWatch.Stop ();
+ traceList.TotalTime = TimeSpan.FromMilliseconds (stopWatch.ElapsedMilliseconds);
if (traceList.TotalTime.TotalSeconds < counter.MinSeconds)
counter.RemoveValue (traceList.ValueIndex);
else
@@ -118,7 +121,7 @@ namespace MonoDevelop.Core.Instrumentation
t.Dispose ();
} else if (linkedTrackers != null)
((IDisposable)linkedTrackers).Dispose ();
-
+ stopWatch.Reset ();
}
void IDisposable.Dispose ()
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Logging/FileLogger.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Logging/FileLogger.cs
index 317c9134ba..3d39961f7b 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Logging/FileLogger.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.Logging/FileLogger.cs
@@ -45,7 +45,9 @@ namespace MonoDevelop.Core.Logging
public FileLogger (string filename, bool append)
{
- writer = new StreamWriter (filename, append);
+ writer = new StreamWriter (filename, append) {
+ AutoFlush = true
+ };
name = filename;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs
index 82410eae20..90cecfdb54 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core.ProgressMonitoring/ConsoleProgressMonitor.cs
@@ -51,15 +51,12 @@ namespace MonoDevelop.Core.ProgressMonitoring
public ConsoleProgressMonitor () : this (Console.Out, true)
{
//TODO: can we efficiently update Console.WindowWidth when it changes?
- // TODO: Use Console.IsOutputRedirected in .NET 4.5.
- try {
- columns = Console.WindowWidth;
- }
//when the output is redirected, Mono returns 0 but .NET throws IOException
- catch (IOException) {
+ if (Console.IsOutputRedirected)
columns = 0;
- }
-
+ else
+ columns = Console.WindowWidth;
+
wrap = columns > 0;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs
index 646af320a1..d93a7257d6 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/FilePath.cs
@@ -69,13 +69,13 @@ namespace MonoDevelop.Core
const int PATHMAX = 4096 + 1;
- static readonly char[] invalidPathChars = Path.GetInvalidPathChars ().Concat ("#%&").ToArray ();
+ static readonly char[] invalidPathChars = Path.GetInvalidPathChars ().Concat ("#%").ToArray ();
public static char[] GetInvalidPathChars()
{
return (char[])invalidPathChars.Clone();
}
- static readonly char[] invalidFileNameChars = Path.GetInvalidFileNameChars ().Concat ("#%&").ToArray ();
+ static readonly char[] invalidFileNameChars = Path.GetInvalidFileNameChars ().Concat ("#%").ToArray ();
public static char[] GetInvalidFileNameChars ()
{
return (char[])invalidFileNameChars.Clone ();
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/SystemInformation.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/SystemInformation.cs
index 69e83d4d0b..bbf4868d2e 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Core/SystemInformation.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Core/SystemInformation.cs
@@ -120,6 +120,17 @@ namespace MonoDevelop.Core
Title = "Operating System",
Description = sb.ToString ()
};
+
+ string userAddins = string.Join (Environment.NewLine,
+ AddinManager.Registry.GetModules (AddinSearchFlags.IncludeAddins | AddinSearchFlags.LatestVersionsOnly)
+ .Where (addin => addin.IsUserAddin && addin.Enabled)
+ .Select (addin => string.Format ("{0} {1}", addin.Name, addin.Version))
+ );
+ if (!string.IsNullOrEmpty (userAddins))
+ yield return new SystemInformationSection () {
+ Title = "Enabled user installed addins",
+ Description = userAddins,
+ };
}
internal static string GetReleaseId ()
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
index 51013f182a..c8efc96d0c 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/MSBuildProjectService.cs
@@ -504,12 +504,16 @@ namespace MonoDevelop.Projects.Formats.MSBuild
internal static RemoteProjectBuilder GetProjectBuilder (TargetRuntime runtime, string minToolsVersion, string file, string solutionFile)
{
lock (builders) {
- //attempt to use 12.0 builder first if available
- string toolsVersion = "12.0";
- string binDir = runtime.GetMSBuildBinPath ("12.0");
+ //attempt to use 14.0 builder first if available
+ string toolsVersion = "14.0";
+ string binDir = runtime.GetMSBuildBinPath ("14.0");
if (binDir == null) {
- //fall back to 4.0, we know it's always available
- toolsVersion = "4.0";
+ toolsVersion = "12.0";
+ binDir = runtime.GetMSBuildBinPath ("12.0");
+ if (binDir == null) {
+ //fall back to 4.0, we know it's always available
+ toolsVersion = "4.0";
+ }
}
//check the ToolsVersion we found can handle the project
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs
index b1aacadd0e..0ebb7f4c4a 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Formats.MSBuild/SlnFileFormat.cs
@@ -80,7 +80,7 @@ namespace MonoDevelop.Projects.Formats.MSBuild
monitor.BeginTask (GettextCatalog.GetString ("Saving solution: {0}", file), 1);
try {
if (File.Exists (file))
- tmpfilename = Path.GetTempFileName ();
+ tmpfilename = Path.GetDirectoryName (file) + Path.DirectorySeparatorChar + ".#" + Path.GetFileName (file);
} catch (IOException) {
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyService.cs
index 0e7b6e5b61..e3604edc2d 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Policies/PolicyService.cs
@@ -1240,6 +1240,11 @@ namespace MonoDevelop.Projects.Policies
if (pset.Id == "Default") {
defaultPolicies = pset;
} else {
+ // if the policy file does not have a name, use the file name as one
+ if (!string.IsNullOrEmpty (pset.Name)) {
+ pset.Name = file.FileNameWithoutExtension;
+ }
+
AddUserPolicySet (pset);
}
xr.MoveToContent ();
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs
index 099b33784e..112b9e8fb0 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.SharedAssetsProjects/SharedAssetsProject.cs
@@ -223,7 +223,7 @@ namespace MonoDevelop.Projects.SharedAssetsProjects
pref.Flags = ProjectItemFlags.DontPersist;
pref.SetItemsProjectPath (ProjItemsPath);
foreach (var f in Files) {
- if (pref.OwnerProject.Files.GetFile (f.FilePath) == null) {
+ if (pref.OwnerProject.Files.GetFile (f.FilePath) == null && f.Subtype != Subtype.Directory) {
var cf = (ProjectFile)f.Clone ();
cf.Flags |= ProjectItemFlags.DontPersist | ProjectItemFlags.Hidden;
pref.OwnerProject.Files.Add (cf);
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFormatter.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFormatter.cs
index 4d6efb199a..aee449009a 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFormatter.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects.Text/TextFormatter.cs
@@ -113,6 +113,10 @@ namespace MonoDevelop.Projects.Text
}
}
}
+
+ public bool KeepLines {
+ get; set;
+ }
public bool TabsAsSpaces {
get { return tabsAsSpaces; }
@@ -304,8 +308,12 @@ namespace MonoDevelop.Projects.Text
void AppendCurrentWord (char separatorChar)
{
- if (currentWord.Length == 0)
+ if (currentWord.Length == 0) {
+ if (KeepLines && lineStart && separatorChar == '\n') {
+ AppendChar (separatorChar, true);
+ }
return;
+ }
if (Wrap == WrappingType.Word || Wrap == WrappingType.WordChar) {
if (curCol + currentWord.Length > MaxColumns) {
// If the last char was a word separator, remove it
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
index 28040d75c5..904ecdf71a 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProject.cs
@@ -471,21 +471,28 @@ namespace MonoDevelop.Projects
for (int n=0; n<References.Count; n++) {
ProjectReference pr = References [n];
if (pr.ReferenceType == ReferenceType.Assembly && DefaultConfiguration != null) {
- if (pr.GetReferencedFileNames (DefaultConfiguration.Selector).Any (f => f == updatedFile))
+ if (pr.GetReferencedFileNames (DefaultConfiguration.Selector).Any (f => f == updatedFile)) {
+ SetFastBuildCheckDirty ();
pr.NotifyStatusChanged ();
+ }
} else if (pr.HintPath == updatedFile) {
+ SetFastBuildCheckDirty ();
var nr = pr.GetRefreshedReference ();
if (nr != null)
References [n] = nr;
}
}
+ /* Removed because it is very slow. SetFastBuildCheckDirty() is being called above. It is not the perfect solution but it is good enough
+ * In the new project model GetReferencedAssemblies is asynchronous, so the code can be uncommented there.
+
// If a referenced assembly changes, dirtify the project.
foreach (var asm in GetReferencedAssemblies (DefaultConfiguration.Selector))
if (asm == updatedFile) {
SetFastBuildCheckDirty ();
break;
}
+ */
}
internal override void OnFileChanged (object source, MonoDevelop.Core.FileEventArgs e)
@@ -960,8 +967,11 @@ namespace MonoDevelop.Projects
// Hack to keep backwards compatibility with the old behavior. For example, a MonoDroid project is a library, but OnGetSupportsExecute
// is not overriden, so it depends on DotNetProject to return true by default.
- if (compileTarget == CompileTarget.Library && GetType () == typeof (DotNetAssemblyProject))
- return false;
+ if (compileTarget == CompileTarget.Library) {
+ Type thisType = GetType ();
+ if (thisType == typeof (DotNetAssemblyProject) || thisType == typeof (PortableDotNetProject))
+ return false;
+ }
return true;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectConfiguration.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectConfiguration.cs
index 19b60f692b..524f7a6587 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectConfiguration.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/DotNetProjectConfiguration.cs
@@ -247,7 +247,7 @@ namespace MonoDevelop.Projects
case "TARGETNAME": return conf.CompiledOutputName.FileName;
case "TARGETDIR": return conf.CompiledOutputName.ParentDirectory;
case "TARGETEXT": return conf.CompiledOutputName.Extension;
- case "PROJECTCONFIG": return conf.Name + "." + conf.Platform;
+ case "PROJECTCONFIG": return string.IsNullOrEmpty (conf.Platform) ? conf.Name : conf.Name + "." + conf.Platform;
case "PROJECTCONFIGNAME": return conf.Name;
case "PROJECTCONFIGPLAT": return conf.Platform;
}
diff --git a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
index cadf15d78c..ab4ca63590 100644
--- a/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
+++ b/main/src/core/MonoDevelop.Core/MonoDevelop.Projects/ProjectService.cs
@@ -375,9 +375,10 @@ namespace MonoDevelop.Projects
obj.ConvertToFormat (format, true);
obj.Save (monitor);
List<FilePath> newFiles = obj.GetItemFiles (true);
-
+ var resolvedTargetPath = new FilePath (targetPath).ResolveLinks ().FullPath;
+
foreach (FilePath f in newFiles) {
- if (!f.IsChildPathOf (targetPath)) {
+ if (!f.IsChildPathOf (resolvedTargetPath)) {
if (obj is Solution)
monitor.ReportError ("The solution '" + obj.Name + "' is referencing the file '" + f.FileName + "' which is located outside the root solution directory.", null);
else
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/Commands.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/Commands.addin.xml
index 1ae62d65bf..3b0e686d93 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/Commands.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/Commands.addin.xml
@@ -619,15 +619,15 @@
defaultHandler = "MonoDevelop.Ide.Commands.ZoomIn"
_label = "_Zoom In"
icon = "gtk-zoom-in"
- shortcut = "Control|+"
- macShortcut = "Meta|+"
+ shortcut = "Control|+ Control|="
+ macShortcut = "Meta|+ Meta|="
_description = "Zooms view in" />
<Command id = "MonoDevelop.Ide.Commands.ViewCommands.ZoomOut"
defaultHandler = "MonoDevelop.Ide.Commands.ZoomOut"
_label = "Zoom _Out"
icon = "gtk-zoom-out"
- shortcut = "Control|-"
- macShortcut = "Meta|-"
+ shortcut = "Control|- Control|_"
+ macShortcut = "Meta|- Meta|_"
_description = "Zooms view out" />
<Command id = "MonoDevelop.Ide.Commands.ViewCommands.ZoomReset"
defaultHandler = "MonoDevelop.Ide.Commands.ZoomReset"
@@ -683,26 +683,37 @@
defaultHandler = "MonoDevelop.Ide.Commands.InstrumentationViewerHandler"
_label = "Instrumentation Monitor" />
+ <Command id = "MonoDevelop.Ide.Commands.ToolCommands.ToggleSessionRecorder"
+ defaultHandler = "MonoDevelop.Ide.Commands.ToggleSessionRecorderHandler"
+ _label = "Start Session Recorder" />
+
+ <Command id = "MonoDevelop.Ide.Commands.ToolCommands.ReplaySession"
+ defaultHandler = "MonoDevelop.Ide.Commands.ReplaySessionHandler"
+ _label = "Replay Session..." />
</Category>
<!-- WindowCommands -->
<Category _name = "Window" id = "Window">
- <Command id = "MonoDevelop.Ide.Commands.WindowCommands.NextWindow"
- defaultHandler = "MonoDevelop.Ide.Commands.NextWindowHandler"
- _label = "_Next Window"
+ <Command id = "MonoDevelop.Ide.Commands.WindowCommands.NextDocument"
+ defaultHandler = "MonoDevelop.Ide.Commands.NextDocumentHandler"
+ _label = "_Next Document"
icon = "gtk-go-forward"
- _description = "Show next window"
+ _description = "Show next document"
shortcut = "Control|Page_Down"
macShortcut = "Meta|}" />
- <Command id = "MonoDevelop.Ide.Commands.WindowCommands.PrevWindow"
- defaultHandler = "MonoDevelop.Ide.Commands.PrevWindowHandler"
- _label = "_Previous Window"
+ <Command id = "MonoDevelop.Ide.Commands.WindowCommands.PrevDocument"
+ defaultHandler = "MonoDevelop.Ide.Commands.PrevDocumentHandler"
+ _label = "_Previous Document"
icon = "gtk-go-back"
- _description = "Show previous window"
+ _description = "Show previous document"
shortcut = "Control|Page_Up"
macShortcut = "Meta|{" />
+ <Command id = "MonoDevelop.Ide.Commands.WindowCommands.OpenDocumentList"
+ defaultHandler = "MonoDevelop.Ide.Commands.OpenDocumentListHandler"
+ type="radio|array"
+ _label = "Document List" />
<Command id = "MonoDevelop.Ide.Commands.WindowCommands.OpenWindowList"
defaultHandler = "MonoDevelop.Ide.Commands.OpenWindowListHandler"
type="radio|array"
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/MainMenu.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/MainMenu.addin.xml
index e3a7cc997a..28e93193d0 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/MainMenu.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/MainMenu.addin.xml
@@ -222,6 +222,10 @@
<CommandItem id = "MonoDevelop.Ide.Commands.ToolCommands.ToolList" />
<CommandItem id = "MonoDevelop.Ide.Commands.ToolCommands.InstrumentationViewer" />
<CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.InsertGuid" />
+ <ItemSet id = "SessionRecorder" _label = "Session Recorder" autohide = "true">
+ <CommandItem id = "MonoDevelop.Ide.Commands.ToolCommands.ToggleSessionRecorder" />
+ <CommandItem id = "MonoDevelop.Ide.Commands.ToolCommands.ReplaySession" />
+ </ItemSet>
<SeparatorItem id = "OptionsSection" />
<Condition id="Platform" value="windows">
<CommandItem id = "MonoDevelop.Ide.Commands.EditCommands.MonodevelopPreferences" />
@@ -230,8 +234,8 @@
</ItemSet>
<ItemSet id = "Window" _label = "_Window">
- <CommandItem id = "MonoDevelop.Ide.Commands.WindowCommands.NextWindow" />
- <CommandItem id = "MonoDevelop.Ide.Commands.WindowCommands.PrevWindow" />
+ <CommandItem id = "MonoDevelop.Ide.Commands.WindowCommands.NextDocument" />
+ <CommandItem id = "MonoDevelop.Ide.Commands.WindowCommands.PrevDocument" />
<SeparatorItem id ="NxtPrvSeparator" />
<CommandItem id = "MonoDevelop.Ide.Commands.FileCommands.CloseAllFiles" />
<!-- <SeparatorItem id ="SplitSeparator" />
@@ -241,6 +245,9 @@
<CommandItem id = "MonoDevelop.Ide.Commands.WindowCommands.SwitchSplitWindow" />-->
<SeparatorItem id = "contentSep" />
<CommandItem id = "MonoDevelop.Ide.Commands.WindowCommands.OpenWindowList" />
+ <SeparatorItem id = "windowDocSep" />
+ <CommandItem id = "MonoDevelop.Ide.Commands.WindowCommands.OpenDocumentList" />
+ <SeparatorItem id = "docMinimizeSep" />
</ItemSet>
<ItemSet id = "Help" _label = "_Help">
diff --git a/main/src/core/MonoDevelop.Ide/ExtensionModel/Templates.addin.xml b/main/src/core/MonoDevelop.Ide/ExtensionModel/Templates.addin.xml
index 31a626501e..d53bd4470a 100644
--- a/main/src/core/MonoDevelop.Ide/ExtensionModel/Templates.addin.xml
+++ b/main/src/core/MonoDevelop.Ide/ExtensionModel/Templates.addin.xml
@@ -94,9 +94,9 @@
</Extension>
<Extension path="/MonoDevelop/Ide/ProjectTemplateCategories">
- <Category id="crossplat" name="Cross-platform" icon="md-platform-cross-platform">
+ <Category id="multiplat" name="Multi-platform" icon="md-platform-cross-platform">
<Category id="library" name="Library">
- <Category id="general" name="General" />
+ <Category id="general" name="General" mappedCategories="crossplat/library/general" />
</Category>
</Category>
<Category id="other" name="Other" icon="md-platform-other">
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs
index 8a5f04b35b..bf7a4fd98b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkTreeModelResult.cs
@@ -78,7 +78,11 @@ namespace MonoDevelop.Components.AutoTest.Results
public override AppResult Model (string column)
{
- return null;
+ var columnNumber = GetColumnNumber (column, TModel);
+ if (columnNumber == -1)
+ return null;
+ Column = columnNumber;
+ return this;
}
bool CheckForText (TreeModel model, TreeIter iter, bool exact)
@@ -234,6 +238,7 @@ namespace MonoDevelop.Components.AutoTest.Results
if (ParentWidget is TreeView) {
TreeView treeView = (TreeView) ParentWidget;
treeView.Selection.UnselectAll ();
+ treeView.ExpandRow (TModel.GetPath (resultIter.Value), false);
treeView.Selection.SelectIter ((TreeIter) resultIter);
treeView.SetCursor (TModel.GetPath ((TreeIter) resultIter), treeView.Columns [0], false);
@@ -256,23 +261,15 @@ namespace MonoDevelop.Components.AutoTest.Results
return false;
}
- public override bool TypeKey (char key, string state = "")
- {
- return false;
- }
-
- public override bool TypeKey (string keyString, string state = "")
- {
- throw new NotImplementedException ();
- }
-
- public override bool EnterText (string text)
- {
- return false;
- }
-
public override bool Toggle (bool active)
{
+ if (resultIter.HasValue) {
+ var modelValue = TModel.GetValue ((TreeIter)resultIter, Column);
+ if (modelValue is bool) {
+ TModel.SetValue ((TreeIter)resultIter, Column, active);
+ return true;
+ }
+ }
return false;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs
index 9f08c97267..50d4f4b082 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/GtkWidgetResult.cs
@@ -152,7 +152,7 @@ namespace MonoDevelop.Components.AutoTest.Results
return null;
}
- TreeModel ModelFromWidget (Widget widget)
+ protected TreeModel ModelFromWidget (Widget widget)
{
TreeView tv = widget as TreeView;
if (tv != null) {
@@ -179,25 +179,23 @@ namespace MonoDevelop.Components.AutoTest.Results
}
// Check if the class has the SemanticModelAttribute
+ var columnNumber = GetColumnNumber (column, model);
+ return columnNumber == -1 ? null : new GtkTreeModelResult (resultWidget, model, columnNumber) { SourceQuery = this.SourceQuery };
+ }
+
+ protected int GetColumnNumber (string column, TreeModel model)
+ {
Type modelType = model.GetType ();
SemanticModelAttribute attr = modelType.GetCustomAttribute<SemanticModelAttribute> ();
-
if (attr == null) {
// Check if the instance has the attributes
AttributeCollection attrs = TypeDescriptor.GetAttributes (model);
attr = (SemanticModelAttribute)attrs [typeof(SemanticModelAttribute)];
-
if (attr == null) {
- return null;
+ return -1;
}
}
-
- int columnNumber = Array.IndexOf (attr.ColumnNames, column);
- if (columnNumber == -1) {
- return null;
- }
-
- return new GtkTreeModelResult (resultWidget, model, columnNumber) { SourceQuery = this.SourceQuery };
+ return Array.IndexOf (attr.ColumnNames, column);
}
public override AppResult Property (string propertyName, object value)
@@ -296,7 +294,7 @@ namespace MonoDevelop.Components.AutoTest.Results
}
}
- void RealTypeKey (Gdk.Key key, Gdk.ModifierType state)
+ internal void RealTypeKey (Gdk.Key key, Gdk.ModifierType state)
{
SendKeyEvent (resultWidget, (uint)key, state, Gdk.EventType.KeyPress, null);
SendKeyEvent (resultWidget, (uint)key, state, Gdk.EventType.KeyRelease, null);
@@ -400,6 +398,12 @@ namespace MonoDevelop.Components.AutoTest.Results
case "TAB":
return Gdk.Key.Tab;
+ case "BKSP":
+ return Gdk.Key.BackSpace;
+
+ case "DELETE":
+ return Gdk.Key.Delete;
+
default:
throw new Exception ("Unknown keystring: " + keyString);
}
@@ -442,12 +446,13 @@ namespace MonoDevelop.Components.AutoTest.Results
return;
}
- Cairo.Context cr = Gdk.CairoHelper.Create (resultWidget.GdkWindow);
- cr.SetSourceRGB (1.0, 0.0, 0.0);
+ using (var cr = Gdk.CairoHelper.Create (resultWidget.GdkWindow)) {
+ cr.SetSourceRGB (1.0, 0.0, 0.0);
- Gdk.Rectangle allocation = resultWidget.Allocation;
- Gdk.CairoHelper.Rectangle (cr, allocation);
- cr.Stroke ();
+ Gdk.Rectangle allocation = resultWidget.Allocation;
+ Gdk.CairoHelper.Rectangle (cr, allocation);
+ cr.Stroke ();
+ }
}
public override void Flash ()
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
index b9fa5d5b05..e12c8ab3ed 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest.Results/NSObjectResult.cs
@@ -26,12 +26,15 @@
#if MAC
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Reflection;
using System.Xml;
using AppKit;
using Foundation;
+using MonoDevelop.Components.MainToolbar;
+
namespace MonoDevelop.Components.AutoTest.Results
{
public class NSObjectResult : AppResult
@@ -240,6 +243,55 @@ namespace MonoDevelop.Components.AutoTest.Results
{
}
+
+#region MacPlatform.MacIntegration.MainToolbar.SelectorView
+ public override bool SetActiveConfiguration (string configurationName)
+ {
+ Type type = ResultObject.GetType ();
+ PropertyInfo pinfo = type.GetProperty ("ConfigurationModel");
+ if (pinfo == null) {
+ return false;
+ }
+
+ IEnumerable<IConfigurationModel> model = (IEnumerable<IConfigurationModel>)pinfo.GetValue (ResultObject, null);
+ var configuration = model.FirstOrDefault (c => c.DisplayString == configurationName);
+ if (configuration == null) {
+ return false;
+ }
+
+ pinfo = type.GetProperty ("ActiveConfiguration");
+ if (pinfo == null) {
+ return false;
+ }
+
+ pinfo.SetValue (ResultObject, configuration);
+ return true;
+ }
+
+ public override bool SetActiveRuntime (string runtimeName)
+ {
+ Type type = ResultObject.GetType ();
+ PropertyInfo pinfo = type.GetProperty ("RuntimeModel");
+ if (pinfo == null) {
+ return false;
+ }
+
+ IEnumerable<IRuntimeModel> model = (IEnumerable<IRuntimeModel>)pinfo.GetValue (ResultObject, null);
+
+ var runtime = model.FirstOrDefault (r => r.GetMutableModel ().FullDisplayString == runtimeName);
+ if (runtime == null) {
+ return false;
+ }
+
+ pinfo = type.GetProperty ("ActiveRuntime");
+ if (pinfo == null) {
+ return false;
+ }
+
+ pinfo.SetValue (ResultObject, runtime);
+ return true;
+ }
+#endregion
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs
index 925b3eead2..20a71e2df5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AppResult.cs
@@ -63,9 +63,22 @@ namespace MonoDevelop.Components.AutoTest
public abstract bool TypeKey (string keyString, string state = "");
public abstract bool EnterText (string text);
public abstract bool Toggle (bool active);
-
public abstract void Flash ();
+ // More specific actions for complicated widgets
+
+ #region For MacPlatform.MacIntegration.MainToolbar.SelectorView
+ public virtual bool SetActiveConfiguration (string configurationName)
+ {
+ return false;
+ }
+
+ public virtual bool SetActiveRuntime (string runtimeName)
+ {
+ return false;
+ }
+ #endregion
+
// Inspection Operations
public abstract ObjectProperties Properties ();
public abstract string GetResultType ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs
index d8d656db72..56047273c4 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestClientSession.cs
@@ -65,6 +65,15 @@ namespace MonoDevelop.Components.AutoTest
if (file == null) {
var binDir = Path.GetDirectoryName (typeof(AutoTestClientSession).Assembly.Location);
file = Path.Combine (binDir, "MonoDevelop.exe");
+ if (!File.Exists (file)) {
+ file = Path.Combine (binDir, "XamarinStudio.exe");
+ }
+ } else if (!File.Exists (file)) {
+ file = file.Replace ("MonoDevelop.exe", "XamarinStudio.exe");
+ }
+
+ if (!File.Exists (file)) {
+ throw new FileNotFoundException (file);
}
MonoDevelop.Core.Execution.RemotingService.RegisterRemotingChannel ();
@@ -77,7 +86,6 @@ namespace MonoDevelop.Components.AutoTest
var pi = new ProcessStartInfo (file, args) { UseShellExecute = false };
pi.EnvironmentVariables ["MONO_AUTOTEST_CLIENT"] = sref;
- pi.EnvironmentVariables ["GTK_MODULES"] = "gail:atk-bridge";
if (environment != null)
foreach (var e in environment)
pi.EnvironmentVariables [e.Key] = e.Value;
@@ -355,11 +363,31 @@ namespace MonoDevelop.Components.AutoTest
}
}
+ public bool SetActiveConfiguration (Func<AppQuery, AppQuery> query, string configuration)
+ {
+ AppResult[] results = Query (query);
+ if (results.Length == 0) {
+ return false;
+ }
+
+ return session.SetActiveConfiguration (results [0], configuration);
+ }
+
+ public bool SetActiveRuntime (Func<AppQuery, AppQuery> query, string runtime)
+ {
+ AppResult[] results = Query (query);
+ if (results.Length == 0) {
+ return false;
+ }
+
+ return session.SetActiveRuntime (results [0], runtime);
+ }
+
public void RunAndWaitForTimer (Action action, string counterName, int timeout = 20000)
{
AutoTestSession.TimerCounterContext context = session.CreateNewTimerContext (counterName);
action ();
- session.WaitForTimerContext (context);
+ session.WaitForTimerContext (context, timeout);
}
public XmlDocument ResultsAsXml (AppResult[] results)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs
index 7c58a76780..64b48200c2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestService.cs
@@ -26,10 +26,16 @@
using System;
using MonoDevelop.Components.Commands;
+using MonoDevelop.Core;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Remoting;
+using System.Diagnostics;
using System.Collections.Generic;
+using System.Linq;
+using System.Xml;
+using System.Xml.Linq;
+using System.Text;
namespace MonoDevelop.Components.AutoTest
{
@@ -41,6 +47,11 @@ namespace MonoDevelop.Components.AutoTest
get { return manager.currentSession; }
}
+ static SessionRecord currentRecordSession;
+ public static SessionRecord CurrentRecordSession {
+ get { return currentRecordSession; }
+ }
+
public static void Start (CommandManager commandManager, bool publishServer)
{
AutoTestService.commandManager = commandManager;
@@ -65,12 +76,35 @@ namespace MonoDevelop.Components.AutoTest
File.WriteAllText (SessionReferenceFile, sref);
}
}
-
+
+ public static void ReplaySessionFromFile (string filename)
+ {
+ currentRecordSession = new SessionRecord (commandManager, filename);
+ currentRecordSession.ReplayEvents (() => {
+ currentRecordSession = null;
+ });
+ }
+
public static SessionRecord StartRecordingSession ()
{
- return new SessionRecord (commandManager);
+ currentRecordSession = new SessionRecord (commandManager);
+ return currentRecordSession;
}
-
+
+ public static void StopRecordingSession (string filename = null)
+ {
+ if (currentRecordSession == null) {
+ return;
+ }
+
+ currentRecordSession.Pause ();
+
+ if (filename != null) {
+ currentRecordSession.WriteLogToFile (filename);
+ }
+ currentRecordSession = null;
+ }
+
internal static string SessionReferenceFile {
get {
return Path.Combine (Path.GetTempPath (), "monodevelop-autotest-objref");
@@ -146,18 +180,104 @@ namespace MonoDevelop.Components.AutoTest
{
CommandManager commandManager;
List<RecordEvent> events = new List<RecordEvent> ();
- bool recording;
-
- public class RecordEvent
+ enum State {
+ Idle,
+ Recording,
+ Replaying
+ };
+ State state;
+
+ StringBuilder pendingText;
+ Gdk.ModifierType pendingModifiers = Gdk.ModifierType.None;
+
+ public abstract class RecordEvent
{
+ public abstract XElement ToXML ();
+ public abstract void ParseXML (XElement element);
+ public abstract void Replay (AutoTestSession testSession);
}
public class KeyPressEvent: RecordEvent
{
public Gdk.Key Key { get; set; }
public Gdk.ModifierType Modifiers { get; set; }
+
+ public override XElement ToXML ()
+ {
+ return new XElement ("event", new XAttribute ("type", "KeyPressEvent"),
+ new XElement ("key", Key.ToString ()),
+ new XElement ("modifier", Modifiers.ToString ()));
+ }
+
+ public override void ParseXML (XElement element)
+ {
+ foreach (var e in element.Elements ()) {
+ if (e.Name == "key") {
+ Key = (Gdk.Key)Enum.Parse (typeof (Gdk.Key), e.Value);
+ } else if (e.Name == "modifier") {
+ Modifiers = (Gdk.ModifierType)Enum.Parse (typeof (Gdk.ModifierType), e.Value);
+ }
+ }
+ }
+
+ public override void Replay (AutoTestSession testSession)
+ {
+ // Select the main window and then we can push key events to it.
+ AppQuery query = testSession.CreateNewQuery ();
+ AppResult[] results = query.Window ().Marked ("MonoDevelop.Ide.Gui.DefaultWorkbench").Execute ();
+ if (results.Length == 0) {
+ return;
+ }
+
+ testSession.Select (results[0]);
+ // We need the GtkWidgetResult for the main window as we only have the keys as a Gdk key
+ if (results [0] is AutoTest.Results.GtkWidgetResult) {
+ AutoTest.Results.GtkWidgetResult widgetResult = (AutoTest.Results.GtkWidgetResult) results[0];
+ widgetResult.RealTypeKey (Key, Modifiers);
+ }
+ }
}
-
+
+ public class StringEvent: RecordEvent
+ {
+ internal string Text;
+ internal Gdk.ModifierType Modifiers { get; set; }
+
+ public override XElement ToXML ()
+ {
+ return new XElement ("event", new XAttribute ("type", "StringEvent"),
+ new XElement ("text", Text),
+ new XElement ("modifier", Modifiers.ToString ()));
+ }
+
+ public override void ParseXML (XElement element)
+ {
+ foreach (var e in element.Elements ()) {
+ if (e.Name == "text") {
+ Text = e.Value;
+ } else if (e.Name == "modifier") {
+ Modifiers = (Gdk.ModifierType)Enum.Parse (typeof(Gdk.ModifierType), e.Value);
+ }
+ }
+ }
+
+ public override void Replay (AutoTestSession testSession)
+ {
+ AppQuery query = testSession.CreateNewQuery ();
+ AppResult[] results = query.Window ().Marked ("MonoDevelop.Ide.Gui.DefaultWorkbench").Execute ();
+ if (results.Length == 0) {
+ return;
+ }
+
+ testSession.Select (results [0]);
+
+ if (results [0] is AutoTest.Results.GtkWidgetResult) {
+ AutoTest.Results.GtkWidgetResult widgetResult = (AutoTest.Results.GtkWidgetResult)results [0];
+ widgetResult.EnterText (Text);
+ }
+ }
+ }
+
public class CommandEvent: RecordEvent
{
public object CommandId { get; set; }
@@ -165,6 +285,29 @@ namespace MonoDevelop.Components.AutoTest
public bool IsCommandArray {
get { return DataItemIndex != -1; }
}
+
+ public override XElement ToXML ()
+ {
+ return new XElement ("event", new XAttribute ("type", "CommandEvent"),
+ new XElement ("commandID", CommandId.ToString ()),
+ new XElement ("dataItemIndex", DataItemIndex));
+ }
+
+ public override void ParseXML (XElement element)
+ {
+ foreach (var e in element.Elements ()) {
+ if (e.Name == "commandID") {
+ CommandId = e.Value;
+ } else if (e.Name == "dataItemIndex") {
+ DataItemIndex = Convert.ToInt32 (e.Value);
+ }
+ }
+ }
+
+ public override void Replay (AutoTestSession testSession)
+ {
+ testSession.ExecuteCommand (CommandId);
+ }
}
internal SessionRecord (CommandManager commandManager)
@@ -172,39 +315,56 @@ namespace MonoDevelop.Components.AutoTest
this.commandManager = commandManager;
Resume ();
}
+
+ internal SessionRecord (CommandManager commandManager, string logFile)
+ {
+ state = State.Idle;
+ this.commandManager = commandManager;
+ LoadFromLogFile (logFile);
+ }
public IEnumerable<RecordEvent> Events {
get {
- if (recording)
+ if (state == State.Recording)
throw new InvalidOperationException ("The record session must be paused before getting the recorded events.");
return events;
}
}
public bool IsPaused {
- get { return !recording; }
+ get { return state == State.Idle; }
+ }
+
+ public bool IsReplaying {
+ get { return state == State.Replaying; }
}
public void Pause ()
{
- if (recording) {
+ if (state == State.Recording) {
commandManager.KeyPressed -= HandleCommandManagerKeyPressed;
commandManager.CommandActivated -= HandleCommandManagerCommandActivated;
- recording = false;
+ state = State.Idle;
}
}
public void Resume ()
{
- if (!recording) {
+ if (state == State.Idle) {
commandManager.KeyPressed += HandleCommandManagerKeyPressed;
commandManager.CommandActivated += HandleCommandManagerCommandActivated;
- recording = true;
+ state = State.Recording;
+ LoggingService.LogError ("Starting up session recording");
}
}
void HandleCommandManagerCommandActivated (object sender, CommandActivationEventArgs e)
{
+ if ((string)e.CommandId == "MonoDevelop.Ide.Commands.ToolCommands.ToggleSessionRecorder" ||
+ (string)e.CommandId == "MonoDevelop.Ide.Commands.ToolCommands.ReplaySession") {
+ return;
+ }
+
CommandEvent cme = new CommandEvent () { CommandId = e.CommandId };
cme.DataItemIndex = -1;
@@ -219,9 +379,117 @@ namespace MonoDevelop.Components.AutoTest
events.Add (cme);
}
+ void CompleteStringEvent (string s, Gdk.ModifierType modifiers)
+ {
+ events.Add (new StringEvent { Text = pendingText.ToString (), Modifiers = pendingModifiers });
+ pendingText = null;
+ pendingModifiers = Gdk.ModifierType.None;
+ }
+
void HandleCommandManagerKeyPressed (object sender, KeyPressArgs e)
{
- events.Add (new KeyPressEvent () { Key = e.Key, Modifiers = e.Modifiers });
+ uint unicode = Gdk.Keyval.ToUnicode (e.KeyValue);
+ if (pendingText != null) {
+ if (pendingModifiers != e.Modifiers || unicode == 0) {
+ CompleteStringEvent (pendingText.ToString (), pendingModifiers);
+ } else {
+ pendingText.Append ((char)unicode);
+ return;
+ }
+
+ // If text event has been completed, then we need to reset the pending events
+ if (unicode != 0) {
+ pendingText = new StringBuilder ();
+ pendingText.Append ((char)unicode);
+ pendingModifiers = e.Modifiers;
+ } else {
+ // Don't have a unicode key, so just issue a standard key event
+ events.Add (new KeyPressEvent { Key = e.Key, Modifiers = e.Modifiers });
+ pendingText = null;
+ pendingModifiers = Gdk.ModifierType.None;
+ }
+ } else {
+ if (unicode == 0) {
+ events.Add (new KeyPressEvent () { Key = e.Key, Modifiers = e.Modifiers });
+ return;
+ }
+
+ pendingText = new StringBuilder ();
+ pendingText.Append ((char)unicode);
+ pendingModifiers = e.Modifiers;
+ }
+ }
+
+ public void WriteLogToFile (string filepath)
+ {
+ var doc = new XDocument (new XElement ("xs-event-replay-log",
+ from ev in events
+ select ev.ToXML ()));
+
+ using (XmlWriter xw = XmlWriter.Create (filepath, new XmlWriterSettings { Indent = true })) {
+ doc.Save (xw);
+ }
+ }
+
+ public bool LoadFromLogFile (string filepath)
+ {
+ XDocument doc = XDocument.Load (filepath);
+ foreach (XElement element in doc.Element("xs-event-replay-log").Elements ()) {
+ if (element == null) {
+ continue;
+ }
+
+ string evType = element.Attribute ("type").Value;
+ RecordEvent ev = null;
+ if (evType == "KeyPressEvent") {
+ ev = new KeyPressEvent ();
+ } else if (evType == "CommandEvent") {
+ ev = new CommandEvent ();
+ } else if (evType == "StringEvent") {
+ ev = new StringEvent ();
+ }
+
+ if (ev == null) {
+ return false;
+ }
+
+ ev.ParseXML (element);
+ events.Add (ev);
+ }
+
+ return true;
+ }
+
+ public void ReplayEvents (Action completionHandler = null)
+ {
+ AutoTestSession testSession = new AutoTestSession ();
+ Stopwatch sw = new Stopwatch ();
+ int eventCount = events.Count;
+
+ state = State.Replaying;
+
+ sw.Start ();
+ // Each spin of the main loop, remove an event from the queue and replay it.
+ GLib.Idle.Add (() => {
+ RecordEvent ev = events[0];
+ events.RemoveAt (0);
+
+ ev.Replay (testSession);
+
+ if (events.Count > 0) {
+ return true;
+ }
+
+ sw.Stop ();
+ LoggingService.LogInfo ("Time elapsed to replay {0} events: {1}", eventCount, sw.Elapsed);
+ state = State.Idle;
+
+ if (completionHandler != null) {
+ completionHandler ();
+ }
+
+ return false;
+ });
}
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs
index 2d35b53b90..a4fb16bb70 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.AutoTest/AutoTestSession.cs
@@ -194,6 +194,27 @@ namespace MonoDevelop.Components.AutoTest
throw;
}
});
+ #else
+ Sync (delegate {
+ try {
+ using (var bmp = new System.Drawing.Bitmap (System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width,
+ System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height)) {
+ using (var g = System.Drawing.Graphics.FromImage(bmp))
+ {
+ g.CopyFromScreen(System.Windows.Forms.Screen.PrimaryScreen.Bounds.X,
+ System.Windows.Forms.Screen.PrimaryScreen.Bounds.Y,
+ 0, 0,
+ bmp.Size,
+ System.Drawing.CopyPixelOperation.SourceCopy);
+ }
+ bmp.Save(screenshotPath);
+ }
+ return null;
+ } catch (Exception e) {
+ Console.WriteLine (e);
+ throw;
+ }
+ });
#endif
}
@@ -253,6 +274,8 @@ namespace MonoDevelop.Components.AutoTest
if (remaining == null)
return res;
+ else if (res == null)
+ return null;
else
return GetValue (res, res.GetType (), remaining);
}
@@ -302,14 +325,20 @@ namespace MonoDevelop.Components.AutoTest
public void ExecuteOnIdle (Action idleFunc, bool wait = true, int timeout = 20000)
{
+ if (DispatchService.IsGuiThread) {
+ idleFunc ();
+ return;
+ }
+
if (wait == false) {
GLib.Idle.Add (() => {
idleFunc ();
return false;
});
+
return;
}
-
+
syncEvent.Reset ();
GLib.Idle.Add (() => {
idleFunc ();
@@ -324,7 +353,7 @@ namespace MonoDevelop.Components.AutoTest
// Executes the query outside of a syncEvent wait so it is safe to call from
// inside an ExecuteOnIdleAndWait
- AppResult[] ExecuteQueryNoWait (AppQuery query)
+ internal AppResult[] ExecuteQueryNoWait (AppQuery query)
{
AppResult[] resultSet = query.Execute ();
Sync (() => {
@@ -346,7 +375,6 @@ namespace MonoDevelop.Components.AutoTest
} catch (TimeoutException e) {
throw new TimeoutException (string.Format ("Timeout while executing ExecuteQuery: {0}", query), e);
}
-
return resultSet;
}
@@ -530,6 +558,36 @@ namespace MonoDevelop.Components.AutoTest
}
}
+ public bool SetActiveConfiguration (AppResult result, string configuration)
+ {
+ bool success = false;
+
+ try {
+ ExecuteOnIdle (() => {
+ success = result.SetActiveConfiguration (configuration);
+ });
+ } catch (TimeoutException e) {
+ ThrowOperationTimeoutException ("SetActiveConfiguration", result.SourceQuery, result, e);
+ }
+
+ return success;
+ }
+
+ public bool SetActiveRuntime (AppResult result, string runtime)
+ {
+ bool success = false;
+
+ try {
+ ExecuteOnIdle (() => {
+ success = result.SetActiveRuntime (runtime);
+ });
+ } catch (TimeoutException e) {
+ ThrowOperationTimeoutException ("SetActiveRuntime", result.SourceQuery, result, e);
+ }
+
+ return success;
+ }
+
void ThrowOperationTimeoutException (string operation, string query, AppResult result, Exception innerException)
{
throw new TimeoutException (string.Format ("Timeout while executing {0}: {1}\n\ton Element: {2}", operation, query, result), innerException);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
index 205ac7ecfc..12296f22e9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs
@@ -333,6 +333,12 @@ namespace MonoDevelop.Components.Commands
return null;
}
+ // If a modal dialog is running then the menus are disabled, even if the commands are not
+ // See MDMenuItem::IsGloballyDisabled
+ if (DesktopService.IsModalDialogRunning ()) {
+ return ev;
+ }
+
var gdkev = MonoDevelop.Components.Mac.GtkMacInterop.ConvertKeyEvent (ev);
if (gdkev != null) {
if (ProcessKeyEvent (gdkev))
@@ -348,7 +354,7 @@ namespace MonoDevelop.Components.Commands
e.RetVal = ProcessKeyEvent (e.Event);
}
- bool ProcessKeyEvent (Gdk.EventKey ev)
+ internal bool ProcessKeyEvent (Gdk.EventKey ev)
{
if (!IsEnabled)
return true;
@@ -426,7 +432,7 @@ namespace MonoDevelop.Components.Commands
void NotifyKeyPressed (Gdk.EventKey ev)
{
if (KeyPressed != null)
- KeyPressed (this, new KeyPressArgs () { Key = ev.Key, Modifiers = ev.State });
+ KeyPressed (this, new KeyPressArgs () { Key = ev.Key, KeyValue = ev.KeyValue, Modifiers = ev.State });
}
/// <summary>
@@ -1166,7 +1172,7 @@ namespace MonoDevelop.Components.Commands
return false;
commandId = CommandManager.ToCommandId (commandId);
-
+
List<HandlerCallback> handlers = new List<HandlerCallback> ();
ActionCommand cmd = null;
try {
@@ -2602,6 +2608,7 @@ namespace MonoDevelop.Components.Commands
public class KeyPressArgs: EventArgs
{
public Gdk.Key Key { get; internal set; }
+ public uint KeyValue { get; internal set; }
public Gdk.ModifierType Modifiers { get; internal set; }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
index dcddc4acd5..c293fd3b81 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/DockNotebook.cs
@@ -85,7 +85,7 @@ namespace MonoDevelop.Components.DockNotebook
var item = new ContextMenuItem (tab.Markup ?? tab.Text);
var locTab = tab;
item.Clicked += (object sender, ContextMenuItemClickedEventArgs e) => {
- currentTab = locTab;
+ CurrentTab = locTab;
};
menu.Items.Add (item);
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
index 4437cfeff1..90a8668d8e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.DockNotebook/TabStrip.cs
@@ -441,8 +441,10 @@ namespace MonoDevelop.Components.DockNotebook
// If the user clicks and drags on the 'x' which closes the current
// tab we can end up with a null tab here
- if (t == null)
+ if (t == null) {
+ TooltipText = null;
return base.OnMotionNotifyEvent (evnt);
+ }
SetHighlightedTab (t);
var newOver = IsOverCloseButton (t, (int)evnt.X, (int)evnt.Y);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs
index 3938cb3d6d..6022b195bc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockFrame.cs
@@ -886,6 +886,8 @@ namespace MonoDevelop.Components.Docking
t.Hide ();
t.Show ();
}
+
+ MonoDevelop.Ide.IdeApp.CommandService.RegisterTopWindow (win);
} else {
w.Parent = this;
w.Size = new Size (width, height);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs
index 02f788d000..913edeebc1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockItem.cs
@@ -327,7 +327,12 @@ namespace MonoDevelop.Components.Docking
{
if (dockBarItem != null)
dockBarItem.Present (Status == DockItemStatus.AutoHide || giveFocus);
- else
+ else if (floatingWindow != null) {
+ if (giveFocus)
+ floatingWindow.Present ();
+ else
+ floatingWindow.Show ();
+ } else
frame.Present (this, Status == DockItemStatus.AutoHide || giveFocus);
}
@@ -412,6 +417,7 @@ namespace MonoDevelop.Components.Docking
SetRegionStyle (frame.GetRegionStyleForItem (this));
floatingWindow = new DockFloatingWindow ((Window)frame.Toplevel, GetWindowTitle ());
+ Ide.IdeApp.CommandService.RegisterTopWindow (floatingWindow);
VBox box = new VBox ();
box.Show ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ISelectFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ISelectFileDialog.cs
index 9784169415..447623b2da 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ISelectFileDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Extensions/ISelectFileDialog.cs
@@ -50,7 +50,7 @@ namespace MonoDevelop.Components.Extensions
FilterSet = new FileFilterSet ();
}
internal FileFilterSet FilterSet { get; set; }
- public Gtk.FileChooserAction Action { get; set; }
+ public FileChooserAction Action { get; set; }
public IList<SelectFileDialogFilter> Filters { get { return FilterSet.Filters; } }
public FilePath CurrentFolder { get; set; }
public bool SelectMultiple { get; set; }
@@ -107,7 +107,7 @@ namespace MonoDevelop.Components.Extensions
/// <summary>
/// Action to perform with the file dialog.
/// </summary>
- public Gtk.FileChooserAction Action {
+ public FileChooserAction Action {
get { return data.Action; }
set { data.Action = value; }
}
@@ -269,7 +269,7 @@ namespace MonoDevelop.Components.Extensions
internal void SetDefaultProperties (FileSelector fdiag)
{
fdiag.Title = Title;
- fdiag.Action = Action;
+ fdiag.Action = Action.ToGtkAction ();
fdiag.LocalOnly = true;
fdiag.SelectMultiple = SelectMultiple;
fdiag.TransientFor = TransientFor;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainStatusBarContextImpl.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainStatusBarContextImpl.cs
index 84e6d44cdb..e381a31c65 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainStatusBarContextImpl.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainStatusBarContextImpl.cs
@@ -71,6 +71,7 @@ namespace MonoDevelop.Components.MainToolbar
public void ShowReady ()
{
statusBar.ShowReady ();
+ statusBar.SetMessageSourcePad (null);
}
public void SetMessageSourcePad (Pad pad)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs
index 0c2f09ee5c..751ebc8329 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbar.cs
@@ -110,19 +110,22 @@ namespace MonoDevelop.Components.MainToolbar
return;
}
- renderer.Visible = runtime.Visible;
- renderer.Sensitive = runtime.Enabled;
- renderer.Xpad = (uint)(runtime.IsIndented ? 18 : 3);
-
- if (!runtimeCombo.PopupShown) {
- // no need to ident text when the combo dropdown is not showing
- if (Platform.IsWindows)
- renderer.Xpad = 3;
- renderer.Text = runtime.FullDisplayString;
- renderer.Attributes = normalAttributes;
- } else {
- renderer.Text = runtime.DisplayString;
- renderer.Attributes = runtime.Notable ? boldAttributes : normalAttributes;
+ using (var mutableModel = runtime.GetMutableModel ()) {
+ renderer.Visible = mutableModel.Visible;
+ renderer.Sensitive = mutableModel.Enabled;
+ renderer.Xpad = (uint)(runtime.IsIndented ? 18 : 3);
+
+ if (!runtimeCombo.PopupShown) {
+ // no need to ident text when the combo dropdown is not showing
+ if (Platform.IsWindows)
+ renderer.Xpad = 3;
+ renderer.Text = mutableModel.FullDisplayString;
+ renderer.Attributes = normalAttributes;
+ } else {
+ renderer.Text = mutableModel.DisplayString;
+ renderer.Attributes = runtime.Notable ? boldAttributes : normalAttributes;
+ }
+
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs
index e07e8dd7e3..9b36617840 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarController.cs
@@ -341,10 +341,16 @@ namespace MonoDevelop.Components.MainToolbar
bool SelectActiveRuntime (ref bool selected, ref ExecutionTarget defaultTarget, ref int defaultIter)
{
var runtimes = ToolbarView.RuntimeModel.Cast<RuntimeModel> ().ToList ();
+ string lastRuntimeForProject = currentStartupProject != null ? currentStartupProject.UserProperties.GetValue<string> ("PreferredExecutionTarget", defaultValue: null) : null;
+ var activeTarget = IdeApp.Workspace.ActiveExecutionTarget;
+ var activeTargetId = activeTarget != null ? activeTarget.Id : null;
+
for (int iter = 0; iter < runtimes.Count; ++iter) {
var item = runtimes [iter];
- if (!item.Enabled)
- continue;
+ using (var model = item.GetMutableModel ()) {
+ if (!model.Enabled)
+ continue;
+ }
var target = item.ExecutionTarget;
if (target == null || !target.Enabled)
@@ -354,12 +360,12 @@ namespace MonoDevelop.Components.MainToolbar
if (item.HasChildren)
continue;
- if (defaultTarget == null) {
+ if (defaultTarget == null || lastRuntimeForProject == target.Id) {
defaultTarget = target;
defaultIter = iter;
}
- if (target.Id == IdeApp.Workspace.PreferredActiveExecutionTarget) {
+ if (target.Id == activeTargetId) {
IdeApp.Workspace.ActiveExecutionTarget = target;
ToolbarView.ActiveRuntime = ToolbarView.RuntimeModel.ElementAt (iter);
UpdateBuildConfiguration ();
@@ -367,7 +373,7 @@ namespace MonoDevelop.Components.MainToolbar
return true;
}
- if (target.Equals (IdeApp.Workspace.ActiveExecutionTarget)) {
+ if (target.Equals (activeTarget)) {
ToolbarView.ActiveRuntime = ToolbarView.RuntimeModel.ElementAt (iter);
UpdateBuildConfiguration ();
selected = true;
@@ -395,7 +401,6 @@ namespace MonoDevelop.Components.MainToolbar
UpdateBuildConfiguration ();
}
}
-
} finally {
ignoreRuntimeChangedCount--;
}
@@ -438,6 +443,9 @@ namespace MonoDevelop.Components.MainToolbar
void TrackStartupProject ()
{
if (currentStartupProject != null && ((currentSolution != null && currentStartupProject != currentSolution.StartupItem) || currentSolution == null)) {
+ var runtime = (RuntimeModel)ToolbarView.ActiveRuntime;
+ if (runtime != null && runtime.Command == null)
+ currentStartupProject.UserProperties.SetValue<string> ("PreferredExecutionTarget", runtime.TargetId);
currentStartupProject.ExecutionTargetsChanged -= executionTargetsChanged;
currentStartupProject.Saved -= HandleUpdateCombos;
}
@@ -762,8 +770,6 @@ namespace MonoDevelop.Components.MainToolbar
public RuntimeModel (MainToolbarController controller, ExecutionTarget target) : this (controller)
{
ExecutionTarget = target;
- Enabled = !(ExecutionTarget is ExecutionTargetGroup);
- Visible = true;
}
public RuntimeModel (MainToolbarController controller, ExecutionTarget target, RuntimeModel parent) : this (controller, target)
@@ -785,6 +791,7 @@ namespace MonoDevelop.Components.MainToolbar
public IEnumerable<IRuntimeModel> Children {
get { return children; }
}
+
public bool Notable {
get { return ExecutionTarget != null && ExecutionTarget.Notable; }
}
@@ -799,16 +806,6 @@ namespace MonoDevelop.Components.MainToolbar
set;
}
- public bool Visible {
- get;
- private set;
- }
-
- public bool Enabled {
- get;
- private set;
- }
-
public bool IsSeparator {
get { return Command == null && ExecutionTarget == null; }
}
@@ -818,43 +815,72 @@ namespace MonoDevelop.Components.MainToolbar
set;
}
- public string DisplayString {
- get {
- if (Command != null) {
- var ci = IdeApp.CommandService.GetCommandInfo (Command, new CommandTargetRoute (Controller.lastCommandTarget));
- Visible = ci.Visible;
- Enabled = ci.Enabled;
- return RemoveUnderline (ci.Text);
- }
+ public bool NotifyActivated ()
+ {
+ if (Command != null && IdeApp.CommandService.DispatchCommand (Command, CommandSource.ContextMenu))
+ return true;
+ return false;
+ }
+ internal string TargetId {
+ get {
if (ExecutionTarget == null)
return "";
-
- return !HasParent ? ExecutionTarget.FullName : ExecutionTarget.Name;
+ return ExecutionTarget.Id;
}
}
- public string FullDisplayString {
- get {
- if (Command != null) {
- var ci = IdeApp.CommandService.GetCommandInfo (Command, new CommandTargetRoute (Controller.lastCommandTarget));
- Visible = ci.Visible;
- Enabled = ci.Enabled;
- return RemoveUnderline (ci.Text);
- }
+ public IRuntimeMutableModel GetMutableModel ()
+ {
+ return Command != null ? new RuntimeMutableModel (Controller, Command) : new RuntimeMutableModel (ExecutionTarget, HasParent);
+ }
+ }
- if (ExecutionTarget == null)
- return "";
+ class RuntimeMutableModel : IRuntimeMutableModel
+ {
+ public RuntimeMutableModel (MainToolbarController controller, object command)
+ {
+ var ci = IdeApp.CommandService.GetCommandInfo (command, new CommandTargetRoute (controller.lastCommandTarget));
+ Visible = ci.Visible;
+ Enabled = ci.Enabled;
+ DisplayString = FullDisplayString = RemoveUnderline (ci.Text);
+ }
- return ExecutionTarget.FullName;
+ public RuntimeMutableModel (ExecutionTarget target, bool hasParent)
+ {
+ Enabled = !(target is ExecutionTargetGroup);
+ Visible = true;
+ if (target == null)
+ DisplayString = FullDisplayString = string.Empty;
+ else {
+ FullDisplayString = target.FullName;
+ DisplayString = !hasParent ? target.FullName : target.Name;
}
}
- public bool NotifyActivated ()
+ // Marker so it won't be reused.
+ public void Dispose ()
{
- if (Command != null && IdeApp.CommandService.DispatchCommand (Command, CommandSource.ContextMenu))
- return true;
- return false;
+ }
+
+ public bool Visible {
+ get;
+ private set;
+ }
+
+ public bool Enabled {
+ get;
+ private set;
+ }
+
+ public string DisplayString {
+ get;
+ private set;
+ }
+
+ public string FullDisplayString {
+ get;
+ private set;
}
static string RemoveUnderline (string s)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarModels.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarModels.cs
index bdd0036f0d..eb814b067b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarModels.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/MainToolbarModels.cs
@@ -51,30 +51,6 @@ namespace MonoDevelop.Components.MainToolbar
IEnumerable<IRuntimeModel> Children { get; }
/// <summary>
- /// Gets the display string to be used inside a context menu.
- /// </summary>
- /// <value>The display string.</value>
- string DisplayString { get; }
-
- /// <summary>
- /// Gets the display string to be for selected items.
- /// </summary>
- /// <value>The full display string.</value>
- string FullDisplayString { get; }
-
- /// <summary>
- /// Gets whether the menu item is visible.
- /// </summary>
- /// <value><c>true</c> if visible; otherwise, <c>false</c>.</value>
- bool Visible { get; }
-
- /// <summary>
- /// Gets whether the menu item is enabled.
- /// </summary>
- /// <value><c>true</c> if enabled; otherwise, <c>false</c>.</value>
- bool Enabled { get; }
-
- /// <summary>
/// Gets whether the menu item is a separator.
/// </summary>
/// <value><c>true</c> if this instance is separator; otherwise, <c>false</c>.</value>
@@ -100,6 +76,39 @@ namespace MonoDevelop.Components.MainToolbar
/// </remarks>
/// <value><c>true</c> if this instance has a parent; otherwise, <c>false</c>.</value>
bool HasParent { get; }
+
+ /// <summary>
+ /// Gets the runtime combo item model.
+ /// </summary>
+ /// <value>The runtime combo item.</value>
+ IRuntimeMutableModel GetMutableModel();
+ }
+
+ public interface IRuntimeMutableModel : IDisposable
+ {
+ /// <summary>
+ /// Gets the display string to be used inside a context menu.
+ /// </summary>
+ /// <value>The display string.</value>
+ string DisplayString { get; }
+
+ /// <summary>
+ /// Gets the display string to be for selected items.
+ /// </summary>
+ /// <value>The full display string.</value>
+ string FullDisplayString { get; }
+
+ /// <summary>
+ /// Gets whether the menu item is visible.
+ /// </summary>
+ /// <value><c>true</c> if visible; otherwise, <c>false</c>.</value>
+ bool Visible { get; }
+
+ /// <summary>
+ /// Gets whether the menu item is enabled.
+ /// </summary>
+ /// <value><c>true</c> if enabled; otherwise, <c>false</c>.</value>
+ bool Enabled { get; }
}
public interface ISearchMenuModel
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs
index c204647762..cd1a9c87e5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchInSolutionSearchCategory.cs
@@ -30,7 +30,7 @@ using MonoDevelop.Core;
using ICSharpCode.NRefactory.TypeSystem;
using MonoDevelop.Ide.FindInFiles;
using System.Linq;
-using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide;
namespace MonoDevelop.Components.MainToolbar
{
@@ -42,9 +42,13 @@ namespace MonoDevelop.Components.MainToolbar
public override Task<ISearchDataSource> GetResults (SearchPopupSearchPattern searchPattern, int resultsCount, CancellationToken token)
{
- return Task.Factory.StartNew (delegate {
- return (ISearchDataSource)new SearchInSolutionDataSource (searchPattern);
- });
+ if (IdeApp.ProjectOperations.CurrentSelectedSolution != null) {
+ return Task.Factory.StartNew (delegate {
+ return (ISearchDataSource)new SearchInSolutionDataSource (searchPattern);
+ });
+ }
+
+ return Task.FromResult<ISearchDataSource> (default(ISearchDataSource));
}
public override bool IsValidTag (string tag)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs
index 7deca2de99..b84db63c31 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.MainToolbar/SearchPopupWindow.cs
@@ -120,6 +120,7 @@ namespace MonoDevelop.Components.MainToolbar
categories.Add (new ProjectSearchCategory (this));
categories.Add (new FileSearchCategory (this));
categories.Add (new CommandSearchCategory (this));
+
categories.Add (new SearchInSolutionSearchCategory ());
categories.AddRange (AddinManager.GetExtensionObjects<SearchCategory> ("/MonoDevelop/Ide/SearchCategories"));
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FilePathEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FilePathEditor.cs
index 23df98afc8..9f4149a059 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FilePathEditor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/FilePathEditor.cs
@@ -26,7 +26,6 @@
using System;
using System.Linq;
-using Gtk;
using MonoDevelop.Core;
namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditor.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditor.cs
index 7d7d5a0f9b..a553b2d48c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditor.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid.Editors/TextEditor.cs
@@ -88,6 +88,7 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
// no standard values, so just use an entry
else {
entry = new Entry ();
+ entry.IsEditable = !session.Property.IsReadOnly;
PackStart (entry, true, true, 0);
}
@@ -96,9 +97,11 @@ namespace MonoDevelop.Components.PropertyGrid.PropertyEditors
entry.HasFrame = false;
entry.Changed += TextChanged;
entry.FocusOutEvent += FirePendingChangeEvent;
+ if (!entry.IsEditable)
+ entry.ModifyText (StateType.Normal, entry.Style.Text (Gtk.StateType.Insensitive));
}
- if (entry != null && ShouldShowDialogButton ()) {
+ if (entry != null && ShouldShowDialogButton () && entry.IsEditable) {
var button = new Button ("...");
PackStart (button, false, false, 0);
button.Clicked += ButtonClicked;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs
index 5f5e6d9e95..b3914cc0ec 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGrid.cs
@@ -252,6 +252,10 @@ namespace MonoDevelop.Components.PropertyGrid
{
if (this.currentObject == obj)
return;
+ if (this.propertyProviders != null) {
+ foreach (var old in this.propertyProviders.OfType<IDisposable> ())
+ old.Dispose ();
+ }
this.currentObject = obj;
this.propertyProviders = propertyProviders;
UpdateTabs ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs
index b8b16247fd..f6e785dec9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.PropertyGrid/PropertyGridTable.cs
@@ -609,7 +609,7 @@ namespace MonoDevelop.Components.PropertyGrid
if (row != null && editSession == null) {
var bounds = GetInactiveEditorBounds (row);
- if (!bounds.IsEmpty && bounds.Contains ((int)evnt.X, (int)evnt.Y) && row.Enabled) {
+ if (!bounds.IsEmpty && bounds.Contains ((int)evnt.X, (int)evnt.Y)) {
StartEditing (row);
return true;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs
index 0b03a1e8a3..3fd766ba13 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs
@@ -67,8 +67,18 @@ namespace MonoDevelop.Components
var toplevel = parent.Toplevel as Gtk.Window;
var nswindow = MonoDevelop.Components.Mac.GtkMacInterop.GetNSWindow (toplevel);
- var titleBarHeight = MonoDevelop.Components.Mac.GtkMacInterop.GetTitleBarHeight ();
- var pt = new CoreGraphics.CGPoint (x, nswindow.Frame.Height - y - titleBarHeight - 12);
+
+ int titleBarOffset;
+ if (toplevel.TypeHint == Gdk.WindowTypeHint.Toolbar && toplevel.Type == Gtk.WindowType.Toplevel && toplevel.Decorated == false) {
+ // Undecorated toplevel toolbars are used for auto-hide pad windows. Don't add a titlebar offset for them.
+ titleBarOffset = 0;
+ } else if (MonoDevelop.Ide.DesktopService.GetIsFullscreen (toplevel)) {
+ titleBarOffset = 0;
+ } else {
+ titleBarOffset = MonoDevelop.Components.Mac.GtkMacInterop.GetTitleBarHeight () + 12;
+ }
+
+ var pt = new CoreGraphics.CGPoint (x, nswindow.Frame.Height - y - titleBarOffset);
var tmp_event = NSEvent.MouseEvent (NSEventType.LeftMouseDown,
pt,
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs
new file mode 100644
index 0000000000..280379a4a8
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileChooserAction.cs
@@ -0,0 +1,60 @@
+//
+// FileChooserAction.cs
+//
+// Author:
+// therzok <marius.ungureanu@xamarin.com>
+//
+// Copyright (c) 2015 therzok
+//
+// 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;
+
+namespace MonoDevelop.Components
+{
+ [Flags]
+ public enum FileChooserAction
+ {
+ Open = 0x1,
+ Save = 0x2,
+ SelectFolder = 0x4,
+ CreateFolder = 0x8,
+
+ FolderFlags = CreateFolder | SelectFolder,
+ FileFlags = Open | Save,
+ }
+
+ static class FileChooserActionExtensions
+ {
+ public static Gtk.FileChooserAction ToGtkAction(this FileChooserAction action)
+ {
+ if ((action & FileChooserAction.CreateFolder) != 0)
+ return Gtk.FileChooserAction.CreateFolder;
+ else if ((action & FileChooserAction.SelectFolder) != 0)
+ return Gtk.FileChooserAction.SelectFolder;
+ else if ((action & FileChooserAction.Open) != 0)
+ return Gtk.FileChooserAction.Open;
+ else if ((action & FileChooserAction.Save) != 0)
+ return Gtk.FileChooserAction.Save;
+ else
+ throw new NotSupportedException ();
+
+ }
+ }
+}
+
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileEntry.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileEntry.cs
index a47612b712..7445a727a2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileEntry.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileEntry.cs
@@ -40,7 +40,7 @@ namespace MonoDevelop.Components
public FileEntry (string name) : base (name)
{
- Action = Gtk.FileChooserAction.Open;
+ Action = FileChooserAction.Open;
}
protected override string ShowBrowseDialog (string name, string startIn)
@@ -57,6 +57,6 @@ namespace MonoDevelop.Components
return null;
}
- public Gtk.FileChooserAction Action { get; set; }
+ public new FileChooserAction Action { get; set; }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileSelector.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileSelector.cs
index 3831933b38..6149980115 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileSelector.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FileSelector.cs
@@ -36,29 +36,29 @@ namespace MonoDevelop.Components
{
const string LastPathProperty = "MonoDevelop.FileSelector.LastPath";
- public FileSelector () : this (GettextCatalog.GetString ("Open file..."), FileChooserAction.Open)
+ public FileSelector () : this (GettextCatalog.GetString ("Open file..."), Gtk.FileChooserAction.Open)
{
}
- public FileSelector (string title) : this (title, FileChooserAction.Open)
+ public FileSelector (string title) : this (title, Gtk.FileChooserAction.Open)
{
}
//for some reason GTK# needs this to create wrapper objects
protected FileSelector (IntPtr ptr) : base (ptr) {}
- public FileSelector (string title, FileChooserAction action) : base (title, null, action)
+ public FileSelector (string title, Gtk.FileChooserAction action) : base (title, null, action)
{
switch (action) {
- case FileChooserAction.Open:
+ case Gtk.FileChooserAction.Open:
AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
AddButton (Gtk.Stock.Open, ResponseType.Ok);
break;
- case FileChooserAction.SelectFolder:
+ case Gtk.FileChooserAction.SelectFolder:
AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
AddButton (GettextCatalog.GetString ("Select Folder"), ResponseType.Ok);
break;
- case FileChooserAction.Save:
+ case Gtk.FileChooserAction.Save:
AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
AddButton (Gtk.Stock.Save, ResponseType.Ok);
break;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FolderDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FolderDialog.cs
index 1b70163b82..d9c25d6c34 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FolderDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/FolderDialog.cs
@@ -4,13 +4,12 @@
//
using System;
-using Gtk;
namespace MonoDevelop.Components
{
class FolderDialog : FileSelector
{
- public FolderDialog (string title) : base (title, FileChooserAction.SelectFolder)
+ public FolderDialog (string title) : base (title, Gtk.FileChooserAction.SelectFolder)
{
this.SelectMultiple = false;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFileDialog.cs
index 45913593b5..d0db7ef86d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFileDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFileDialog.cs
@@ -25,7 +25,6 @@
// THE SOFTWARE.
using System;
-using Gtk;
using MonoDevelop.Components.Extensions;
@@ -44,7 +43,7 @@ namespace MonoDevelop.Components
{
}
- public SelectFileDialog (string title, Gtk.FileChooserAction action)
+ public SelectFileDialog (string title, FileChooserAction action)
{
Title = title;
Action = action;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFolderDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFolderDialog.cs
index a2a253f162..8f2f7562b2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFolderDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/SelectFolderDialog.cs
@@ -39,14 +39,14 @@ namespace MonoDevelop.Components
{
public SelectFolderDialog ()
{
- Action = Gtk.FileChooserAction.SelectFolder;
+ Action = FileChooserAction.SelectFolder;
}
- public SelectFolderDialog (string title): this (title, Gtk.FileChooserAction.SelectFolder)
+ public SelectFolderDialog (string title): this (title, FileChooserAction.SelectFolder)
{
}
- public SelectFolderDialog (string title, Gtk.FileChooserAction action)
+ public SelectFolderDialog (string title, FileChooserAction action)
{
Title = title;
Action = action;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs
new file mode 100644
index 0000000000..10dd3d4b6e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs
@@ -0,0 +1,142 @@
+//
+// GtkWPFWidget.cs
+//
+// Author:
+// Marius Ungureanu <marius.ungureanu@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.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.
+
+#if WIN32
+using System;
+using System.Windows;
+using System.Windows.Interop;
+using Gtk;
+using Gdk;
+
+namespace MonoDevelop.Components.Windows
+{
+ public class GtkWPFWidget : Widget
+ {
+ bool fromGtk;
+ internal System.Windows.Window wpfWindow {
+ get;
+ private set;
+ }
+
+ public GtkWPFWidget (System.Windows.Controls.Control wpfControl)
+ {
+ wpfWindow = new System.Windows.Window {
+ Content = wpfControl,
+ AllowsTransparency = true,
+ WindowStyle = WindowStyle.None,
+ Background = System.Windows.Media.Brushes.Transparent,
+ };
+ wpfWindow.PreviewKeyDown += (sender, e) => {
+ // TODO: Some commands check for toplevels, and this window is not a toplevel.
+ var key = e.Key == System.Windows.Input.Key.System ? e.SystemKey : e.Key;
+ e.Handled = Ide.IdeApp.CommandService.ProcessKeyEvent (GtkWin32Interop.ConvertKeyEvent (e.KeyboardDevice.Modifiers, key));
+ };
+
+ wpfWindow.Closed += (sender, e) => {
+ if (fromGtk)
+ return;
+
+ Ide.IdeApp.Exit ();
+ };
+ wpfWindow.ShowInTaskbar = false;
+ WidgetFlags |= WidgetFlags.NoWindow;
+ }
+
+ void RepositionWpfWindow ()
+ {
+ int x, y;
+
+ var gtkWnd = Toplevel as Gtk.Window;
+ int offset = 0;
+ if (gtkWnd.Decorated)
+ offset = System.Windows.Forms.SystemInformation.CaptionHeight;
+
+ int root_x, root_y;
+ gtkWnd.GetPosition (out root_x, out root_y);
+ if (TranslateCoordinates (Toplevel, root_x, root_y + offset, out x, out y)) {
+ wpfWindow.Left = x;
+ wpfWindow.Top = y;
+ } else {
+ wpfWindow.Left = Allocation.Left;
+ wpfWindow.Top = Allocation.Top;
+ }
+ wpfWindow.Width = Allocation.Width;
+ wpfWindow.Height = Allocation.Height;
+ }
+
+ protected override void OnRealized ()
+ {
+ base.OnRealized ();
+
+ RepositionWpfWindow ();
+ }
+
+ protected override void OnSizeAllocated (Gdk.Rectangle allocation)
+ {
+ base.OnSizeAllocated (allocation);
+
+ RepositionWpfWindow ();
+ }
+
+ protected override void OnDestroyed ()
+ {
+ base.OnDestroyed ();
+
+ fromGtk = true;
+ wpfWindow.Close ();
+ }
+
+ protected override void OnShown ()
+ {
+ base.OnShown ();
+
+ wpfWindow.Show ();
+ AttachWindow ();
+ }
+
+ void AttachWindow ()
+ {
+ IntPtr gtkWindowPtr = GtkWin32Interop.HWndGet (Ide.IdeApp.Workbench.RootWindow.GdkWindow);
+ IntPtr wpfWindowPtr = new WindowInteropHelper (wpfWindow).Handle;
+ GtkWin32Interop.SetWindowLongPtr (wpfWindowPtr, (int)GtkWin32Interop.GWLParameter.GWL_HWNDPARENT, gtkWindowPtr);
+ Ide.IdeApp.Workbench.RootWindow.ConfigureEvent += OnWindowConfigured;
+ }
+
+ void OnWindowConfigured (object sender, ConfigureEventArgs args)
+ {
+ RepositionWpfWindow ();
+ }
+
+ protected override void OnHidden ()
+ {
+ base.OnHidden ();
+
+ wpfWindow.Hide ();
+ Ide.IdeApp.Workbench.RootWindow.ConfigureEvent -= OnWindowConfigured;
+ }
+ }
+}
+#endif
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWin32Interop.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWin32Interop.cs
new file mode 100644
index 0000000000..49fcec4936
--- /dev/null
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWin32Interop.cs
@@ -0,0 +1,118 @@
+//
+// GtkWin32Interop.cs
+//
+// Author:
+// Marius Ungureanu <marius.ungureanu@xamarin.com>
+//
+// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.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.
+#if WIN32
+using System;
+using System.Runtime.InteropServices;
+using System.Windows.Input;
+
+namespace MonoDevelop.Components.Windows
+{
+ public static class GtkWin32Interop
+ {
+ internal const string LIBGDK = "libgdk-win32-2.0-0.dll";
+ internal const string USER32 = "user32.dll";
+
+ public enum ExtendedWindowStyles
+ {
+ // Hides it from alt-tab.
+ WS_EX_TOOLWINDOW = 0x80,
+ }
+
+ public enum GWLParameter
+ {
+ // Sets a new extended style.
+ GWL_EXSTYLE = -20,
+
+ // Sets a new application handle instance.
+ GWL_HINSTANCE = -6,
+
+ // Sets a new window handle as the parent.
+ GWL_HWNDPARENT = -8,
+
+ // Sets a new identifier of the window.
+ GWL_ID = -12,
+
+ // Sets a new window style.
+ GWL_STYLE = -16,
+
+ // Sets a new user data associated with the window. Initially zero.
+ GWL_USERDATA = -21,
+
+ // Sets a new address of the window procedure.
+ GWL_WNDPROC = -4,
+ }
+
+ [DllImport (LIBGDK, CallingConvention = CallingConvention.Cdecl)]
+ static extern IntPtr gdk_win32_window_get_impl_hwnd (IntPtr window);
+
+ public static IntPtr HWndGet (Gdk.Window window)
+ {
+ return gdk_win32_window_get_impl_hwnd (window.Handle);
+ }
+
+ [DllImport (USER32, EntryPoint="SetWindowLongPtr")]
+ static extern IntPtr SetWindowLongPtr64 (IntPtr hWnd, int nIndex, IntPtr dwNewLong);
+
+ [DllImport(USER32, EntryPoint="SetWindowLong")]
+ static extern IntPtr SetWindowLongPtr32 (IntPtr hWnd, int nIndex, IntPtr dwNewLong);
+
+ public static IntPtr SetWindowLongPtr (IntPtr hWnd, int nIndex, IntPtr dwNewLong)
+ {
+ if (IntPtr.Size == 4)
+ return SetWindowLongPtr32 (hWnd, nIndex, dwNewLong);
+ return SetWindowLongPtr64 (hWnd, nIndex, dwNewLong);
+ }
+
+ [DllImport (USER32, EntryPoint="GetWindowLongPtr")]
+ static extern IntPtr GetWindowLongPtr64 (IntPtr hWnd, int nIndex);
+
+ [DllImport(USER32, EntryPoint="GetWindowLong")]
+ static extern IntPtr GetWindowLongPtr32 (IntPtr hWnd, int nIndex);
+
+ public static IntPtr GetWindowLongPtr (IntPtr hWnd, int nIndex)
+ {
+ if (IntPtr.Size == 4)
+ return GetWindowLongPtr32 (hWnd, nIndex);
+ return GetWindowLongPtr64 (hWnd, nIndex);
+ }
+
+ internal static Gdk.EventKey ConvertKeyEvent (ModifierKeys mod, Key key)
+ {
+ var state = Gdk.ModifierType.None;
+ if ((mod & ModifierKeys.Control) != 0)
+ state |= Gdk.ModifierType.ControlMask;
+ if ((mod & ModifierKeys.Shift) != 0)
+ state |= Gdk.ModifierType.ShiftMask;
+ if ((mod & ModifierKeys.Windows) != 0)
+ state |= Gdk.ModifierType.MetaMask;
+ if ((mod & ModifierKeys.Alt) != 0)
+ state |= Gdk.ModifierType.Mod1Mask;
+
+ return GtkUtil.CreateKeyEventFromKeyCode ((ushort)KeyInterop.VirtualKeyFromKey (key), state, Gdk.EventType.KeyPress, Ide.IdeApp.Workbench.RootWindow.GdkWindow);
+ }
+ }
+}
+#endif
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs
index cd4b4c4c64..6d78400369 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.CodeTemplates/CodeTemplate.cs
@@ -431,7 +431,7 @@ namespace MonoDevelop.Ide.CodeTemplates
document.Editor.Caret.Location = document.Editor.OffsetToLocation (newoffset) ;
var prettyPrinter = CodeFormatterService.GetFormatter (data.MimeType);
- if (prettyPrinter != null) {
+ if (prettyPrinter != null && prettyPrinter.SupportsOnTheFlyFormatting) {
int endOffset = template.InsertPosition + template.Code.Length;
var oldVersion = data.Version;
prettyPrinter.OnTheFlyFormat (document, template.InsertPosition, endOffset);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
index 38d4b566a4..cba2475b4a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
@@ -79,7 +79,7 @@ namespace MonoDevelop.Ide.Commands
{
protected override void Run ()
{
- var dlg = new OpenFileDialog (GettextCatalog.GetString ("File to Open"), Gtk.FileChooserAction.Open) {
+ var dlg = new OpenFileDialog (GettextCatalog.GetString ("File to Open"), MonoDevelop.Components.FileChooserAction.Open) {
TransientFor = IdeApp.Workbench.RootWindow,
ShowEncodingSelector = true,
ShowViewerSelector = true,
@@ -273,8 +273,12 @@ namespace MonoDevelop.Ide.Commands
int i = 0;
foreach (var ri in files) {
- string acceleratorKeyPrefix = i < 10 ? "_" + ((i + 1) % 10).ToString() + " " : "";
- var cmd = new CommandInfo (acceleratorKeyPrefix + ri.DisplayName.Replace ("_", "__")) {
+ string commandText = ri.DisplayName.Replace ("_", "__");
+ if (!Platform.IsMac) {
+ string acceleratorKeyPrefix = i < 10 ? "_" + ((i + 1) % 10).ToString() + " " : "";
+ commandText = acceleratorKeyPrefix + commandText;
+ }
+ var cmd = new CommandInfo (commandText) {
Description = GettextCatalog.GetString ("Open {0}", ri.FileName)
};
/* Gdk.Pixbuf icon = DesktopService.GetIconForFile (ri.FileName, IconSize.Menu);
@@ -347,13 +351,18 @@ namespace MonoDevelop.Ide.Commands
LoggingService.LogWarning ("Error building recent solutions list", ex);
continue;
}
-
- string acceleratorKeyPrefix = i < 10 ? "_" + ((i + 1) % 10).ToString() + " " : "";
+
+ string commandText = ri.DisplayName.Replace ("_", "__");
+ if (!Platform.IsMac) {
+ string acceleratorKeyPrefix = i < 10 ? "_" + ((i + 1) % 10).ToString() + " " : "";
+ commandText = acceleratorKeyPrefix + commandText;
+ }
+
string str = GettextCatalog.GetString ("Load solution {0}", ri.ToString ());
if (IdeApp.Workspace.IsOpen)
str += " - " + GettextCatalog.GetString ("Hold Control to open in current workspace.");
- var cmd = new CommandInfo (acceleratorKeyPrefix + ri.DisplayName.Replace ("_", "__")) {
+ var cmd = new CommandInfo (commandText) {
Icon = icon,
Description = str,
};
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs
index 60c9b06e60..20ace23f75 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileTabCommands.cs
@@ -35,6 +35,7 @@ using MonoDevelop.Ide.Gui;
using MonoDevelop.Ide.Navigation;
using MonoDevelop.Core;
using System.Linq;
+using MonoDevelop.Ide.Gui.Dialogs;
namespace MonoDevelop.Ide.Commands
{
@@ -49,33 +50,46 @@ namespace MonoDevelop.Ide.Commands
class CloseAllHandler : CommandHandler
{
+ protected virtual IViewContent GetDocumentException ()
+ {
+ return null;
+ }
+
protected override void Run ()
{
var active = IdeApp.Workbench.ActiveDocument;
if (active == null)
return;
+
var activeNotebook = ((SdiWorkspaceWindow)active.Window).TabControl;
- foreach (Document doc in IdeApp.Workbench.Documents.ToArray ()) {
- var w1 = (SdiWorkspaceWindow) doc.Window;
- if (w1.TabControl == activeNotebook)
+ var except = GetDocumentException ();
+
+ var docs = IdeApp.Workbench.Documents
+ .Where (doc => ((SdiWorkspaceWindow)doc.Window).TabControl == activeNotebook && (except == null || doc.Window.ViewContent != except))
+ .ToArray ();
+
+ var dirtyDialogShown = docs.Count (doc => doc.IsDirty) > 1;
+ if (dirtyDialogShown)
+ using (var dlg = new DirtyFilesDialog (docs, closeWorkspace: false, groupByProject: false)) {
+ dlg.Modal = true;
+ if (MessageService.ShowCustomDialog (dlg) != (int)Gtk.ResponseType.Ok)
+ return;
+ }
+
+ foreach (Document doc in docs)
+ if (dirtyDialogShown)
+ doc.Window.CloseWindow (true);
+ else
doc.Close ();
- }
}
}
- class CloseAllButThisHandler : CommandHandler
+ class CloseAllButThisHandler : CloseAllHandler
{
- protected override void Run ()
+ protected override IViewContent GetDocumentException ()
{
var active = IdeApp.Workbench.ActiveDocument;
- if (active == null)
- return;
- var activeNotebook = ((SdiWorkspaceWindow)active.Window).TabControl;
- foreach (Document doc in IdeApp.Workbench.Documents.ToArray ()) {
- var w1 = (SdiWorkspaceWindow) doc.Window;
- if (w1.TabControl == activeNotebook && doc != active)
- doc.Close ();
- }
+ return active == null ? null : active.Window.ViewContent;
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ToolsCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ToolsCommands.cs
index 797e266a66..109d363505 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ToolsCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/ToolsCommands.cs
@@ -25,11 +25,11 @@
//
//
-
+using MonoDevelop.Components.AutoTest;
using MonoDevelop.Components.Commands;
using MonoDevelop.Core;
using MonoDevelop.Core.Execution;
-using MonoDevelop.Ide.Gui;
+using MonoDevelop.Ide.Gui.Dialogs;
using System;
using MonoDevelop.Ide.Updater;
@@ -39,7 +39,9 @@ namespace MonoDevelop.Ide.Commands
{
AddinManager,
ToolList,
- InstrumentationViewer
+ InstrumentationViewer,
+ ToggleSessionRecorder,
+ ReplaySession,
}
internal class AddinManagerHandler : CommandHandler
@@ -138,4 +140,59 @@ namespace MonoDevelop.Ide.Commands
info.Visible = MonoDevelop.Core.Instrumentation.InstrumentationService.Enabled;
}
}
+
+ internal class ToggleSessionRecorderHandler : CommandHandler
+ {
+ protected override void Run ()
+ {
+ if (AutoTestService.CurrentRecordSession == null) {
+ AutoTestService.StartRecordingSession ();
+ } else {
+ var selector = new FileSelectorDialog ("Save session as...", Gtk.FileChooserAction.Save);
+ try {
+ var result = MessageService.RunCustomDialog (selector, MessageService.RootWindow);
+
+ if (result == (int)Gtk.ResponseType.Cancel) {
+ return;
+ }
+
+ AutoTestService.StopRecordingSession (selector.Filename);
+ } finally {
+ selector.Destroy ();
+ }
+ }
+ }
+
+ protected override void Update (CommandInfo info)
+ {
+ info.Visible = IdeApp.Preferences.EnableAutomatedTesting;
+ info.Text = AutoTestService.CurrentRecordSession == null ? "Start Session Recorder" : "Stop Session Recorder";
+ }
+ }
+
+ internal class ReplaySessionHandler : CommandHandler
+ {
+ protected override void Run ()
+ {
+ var selector = new FileSelectorDialog ("Open session");
+ string filename = null;
+ try {
+ var result = MessageService.RunCustomDialog (selector, MessageService.RootWindow);
+
+ if (result == (int)Gtk.ResponseType.Cancel) {
+ return;
+ }
+
+ filename = selector.Filename;
+ } finally {
+ selector.Destroy ();
+ }
+ AutoTestService.ReplaySessionFromFile (filename);
+ }
+
+ protected override void Update (CommandInfo info)
+ {
+ info.Visible = IdeApp.Preferences.EnableAutomatedTesting;
+ }
+ }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs
index b1ca6d43d4..3f758fce2e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/WindowCommands.cs
@@ -37,8 +37,9 @@ namespace MonoDevelop.Ide.Commands
{
public enum WindowCommands
{
- NextWindow,
- PrevWindow,
+ NextDocument,
+ PrevDocument,
+ OpenDocumentList,
OpenWindowList,
SplitWindowVertically,
SplitWindowHorizontally,
@@ -48,7 +49,7 @@ namespace MonoDevelop.Ide.Commands
SwitchPreviousDocument
}
- internal class NextWindowHandler : CommandHandler
+ internal class NextDocumentHandler : CommandHandler
{
protected override void Update (CommandInfo info)
{
@@ -70,7 +71,7 @@ namespace MonoDevelop.Ide.Commands
}
}
- internal class PrevWindowHandler : CommandHandler
+ internal class PrevDocumentHandler : CommandHandler
{
protected override void Update (CommandInfo info)
{
@@ -91,7 +92,7 @@ namespace MonoDevelop.Ide.Commands
}
}
- internal class OpenWindowListHandler : CommandHandler
+ internal class OpenDocumentListHandler : CommandHandler
{
protected override void Update (CommandArrayInfo info)
{
@@ -103,7 +104,7 @@ namespace MonoDevelop.Ide.Commands
commandInfo.Text = document.Window.Title.Replace ("_", "__");
if (document == IdeApp.Workbench.ActiveDocument)
commandInfo.Checked = true;
- commandInfo.Description = GettextCatalog.GetString ("Activate window '{0}'", commandInfo.Text);
+ commandInfo.Description = GettextCatalog.GetString ("Activate document '{0}'", commandInfo.Text);
if (document.Window.ShowNotification) {
commandInfo.UseMarkup = true;
commandInfo.Text = "<span foreground=" + '"' + "blue" + '"' + ">" + commandInfo.Text + "</span>";
@@ -129,6 +130,34 @@ namespace MonoDevelop.Ide.Commands
}
}
+ internal class OpenWindowListHandler : CommandHandler
+ {
+ protected override void Update (CommandArrayInfo info)
+ {
+ int i = 0;
+ foreach (Gtk.Window window in IdeApp.CommandService.TopLevelWindowStack) {
+
+ //Create CommandInfo object
+ CommandInfo commandInfo = new CommandInfo ();
+ commandInfo.Text = window.Title.Replace ("_", "__");
+ if (window.HasToplevelFocus)
+ commandInfo.Checked = true;
+ commandInfo.Description = GettextCatalog.GetString ("Activate window '{0}'", commandInfo.Text);
+
+ //Add menu item
+ info.Add (commandInfo, window);
+
+ i++;
+ }
+ }
+
+ protected override void Run (object dataItem)
+ {
+ Window window = (Window)dataItem;
+ window.Present ();
+ }
+ }
+
internal class SplitWindowVertically : CommandHandler
{
protected override void Update (CommandInfo info)
@@ -223,7 +252,7 @@ namespace MonoDevelop.Ide.Commands
{
//FIXME: does this option need to exist?
if (!PropertyService.Get ("MonoDevelop.Core.Gui.EnableDocumentSwitchDialog", true)) {
- IdeApp.CommandService.DispatchCommand (next? WindowCommands.NextWindow : WindowCommands.PrevWindow);
+ IdeApp.CommandService.DispatchCommand (next? WindowCommands.NextDocument : WindowCommands.PrevDocument);
return;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs
index d5bc44bb67..8ad57a0cfa 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/RecentOpen.cs
@@ -44,7 +44,7 @@ namespace MonoDevelop.Ide.Desktop
const string projGroup = "MonoDevelop Projects";
const string fileGroup = "MonoDevelop Files";
- const int ItemLimit = 10;
+ const int ItemLimit = 25;
public FdoRecentFiles () : this (RecentFileStorage.DefaultPath)
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs
index e32c6cba41..51b808b831 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.FindInFiles/FindInFilesDialog.cs
@@ -148,7 +148,7 @@ namespace MonoDevelop.Ide.FindInFiles
SetButtonIcon (toggleFindInFiles, "gtk-find");
// If we have an active floating window, attach the dialog to it. Otherwise use the main IDE window.
- var current_toplevel = Gtk.Window.ListToplevels ().Where (x => x.IsActive).First ();
+ var current_toplevel = Gtk.Window.ListToplevels ().FirstOrDefault (x => x.IsActive);
if (current_toplevel is Components.DockNotebook.DockWindow)
TransientFor = current_toplevel;
else
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs
index 9e0f7e6724..6f22cda97c 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/ExtensibleTreeView.cs
@@ -195,11 +195,20 @@ namespace MonoDevelop.Ide.Gui.Components
tree.MotionNotifyEvent += HandleMotionNotifyEvent;
tree.LeaveNotifyEvent += HandleLeaveNotifyEvent;
+ if (GtkGestures.IsSupported) {
+ tree.AddGestureMagnifyHandler ((sender, args) => {
+ Zoom += Zoom * (args.Magnification / 4d);
+ });
+ }
+
for (int n=3; n<16; n++) {
Gtk.Rc.ParseString ("style \"MonoDevelop.ExtensibleTreeView_" + n + "\" {\n GtkTreeView::expander-size = " + n + "\n }\n");
Gtk.Rc.ParseString ("widget \"*.MonoDevelop.ExtensibleTreeView_" + n + "\" style \"MonoDevelop.ExtensibleTreeView_" + n + "\"\n");
}
+ if (!string.IsNullOrEmpty (Id))
+ Zoom = PropertyService.Get<double> ("MonoDevelop.Ide.ExtensibleTreeView.Zoom." + Id, 1d);
+
this.Add (tree);
this.ShowAll ();
@@ -244,8 +253,9 @@ namespace MonoDevelop.Ide.Gui.Components
var info = (NodeInfo)model.GetValue (it, NodeInfoColumn);
var cell = (ZoomableCellRendererPixbuf)renderer;
- cell.Image = info.Icon != null && info.Icon != CellRendererImage.NullImage && info.DisabledStyle ? info.Icon.WithAlpha (0.5) : info.Icon;
- cell.ImageExpanderOpen = cell.Image;
+ var img = info.Icon != null && info.Icon != CellRendererImage.NullImage && info.DisabledStyle ? info.Icon.WithAlpha (0.5) : info.Icon;
+ cell.Image = img;
+ cell.ImageExpanderOpen = img;
cell.ImageExpanderClosed = info.ClosedIcon != null && info.ClosedIcon != CellRendererImage.NullImage && info.DisabledStyle ? info.ClosedIcon.WithAlpha (0.5) : info.ClosedIcon;
cell.OverlayBottomLeft = info.OverlayBottomLeft;
cell.OverlayBottomRight = info.OverlayBottomRight;
@@ -1019,12 +1029,92 @@ namespace MonoDevelop.Ide.Gui.Components
public event EventHandler CurrentItemActivated;
- [Obsolete ("Not supported anymore")]
+ #region Zoom
+
+ const double ZOOM_FACTOR = 1.1f;
+ const int ZOOM_MIN_POW = -4;
+ const int ZOOM_MAX_POW = 8;
+ static readonly double ZOOM_MIN = System.Math.Pow (ZOOM_FACTOR, ZOOM_MIN_POW);
+ static readonly double ZOOM_MAX = System.Math.Pow (ZOOM_FACTOR, ZOOM_MAX_POW);
+ double zoom;
+
public double Zoom {
- get { return 1d; }
- set { }
+ get {
+ return zoom;
+ }
+ set {
+ value = System.Math.Min (ZOOM_MAX, System.Math.Max (ZOOM_MIN, value));
+ if (value > ZOOM_MAX || value < ZOOM_MIN)
+ return;
+ //snap to one, if within 0.001d
+ if ((System.Math.Abs (value - 1d)) < 0.001d) {
+ value = 1d;
+ }
+ if (zoom != value) {
+ zoom = value;
+ OnZoomChanged (value);
+ }
+ }
}
+ void OnZoomChanged (double value)
+ {
+ pix_render.Zoom = value;
+ text_render.Zoom = value;
+
+ int expanderSize = (int) (12 * Zoom);
+ if (expanderSize < 3) expanderSize = 3;
+ if (expanderSize > 15) expanderSize = 15;
+ if (expanderSize != 12)
+ tree.Name = "MonoDevelop.ExtensibleTreeView_" + expanderSize;
+ else
+ tree.Name = "";
+ tree.ColumnsAutosize ();
+ if (!string.IsNullOrEmpty (Id)) {
+ PropertyService.Set ("MonoDevelop.Ide.ExtensibleTreeView.Zoom." + Id, Zoom);
+ }
+ }
+
+ [CommandHandler (ViewCommands.ZoomIn)]
+ public void ZoomIn ()
+ {
+ int oldPow = (int)System.Math.Round (System.Math.Log (zoom) / System.Math.Log (ZOOM_FACTOR));
+ Zoom = System.Math.Pow (ZOOM_FACTOR, oldPow + 1);
+ }
+
+ [CommandHandler (ViewCommands.ZoomOut)]
+ public void ZoomOut ()
+ {
+ int oldPow = (int)System.Math.Round (System.Math.Log (zoom) / System.Math.Log (ZOOM_FACTOR));
+ Zoom = System.Math.Pow (ZOOM_FACTOR, oldPow - 1);
+ }
+
+ [CommandHandler (ViewCommands.ZoomReset)]
+ public void ZoomReset ()
+ {
+ Zoom = 1d;
+ }
+
+ [CommandUpdateHandler (ViewCommands.ZoomIn)]
+ protected void UpdateZoomIn (CommandInfo cinfo)
+ {
+ cinfo.Enabled = zoom < ZOOM_MAX - 0.000001d;
+ }
+
+ [CommandUpdateHandler (ViewCommands.ZoomOut)]
+ protected void UpdateZoomOut (CommandInfo cinfo)
+ {
+ cinfo.Enabled = zoom > ZOOM_MIN + 0.000001d;
+ }
+
+ [CommandUpdateHandler (ViewCommands.ZoomReset)]
+ protected void UpdateZoomReset (CommandInfo cinfo)
+ {
+ cinfo.Enabled = zoom != 1d;
+ }
+
+ #endregion Zoom
+
[CommandHandler (EditCommands.Copy)]
public void CopyCurrentItem ()
{
@@ -1783,7 +1873,9 @@ namespace MonoDevelop.Ide.Gui.Components
void ShowPopup (Gdk.EventButton evt)
{
- var entryset = BuildEntrySet () ?? new CommandEntrySet ();
+ var entryset = BuildEntrySet ();
+ if (entryset == null)
+ return;
if (evt == null) {
var paths = tree.Selection.GetSelectedRows ();
@@ -1950,6 +2042,24 @@ namespace MonoDevelop.Ide.Gui.Components
}
}
+ protected override bool OnScrollEvent (Gdk.EventScroll evnt)
+ {
+ var modifier = !Platform.IsMac? Gdk.ModifierType.ControlMask
+ //Mac window manager already uses control-scroll, so use command
+ //Command might be either meta or mod1, depending on GTK version
+ : (Gdk.ModifierType.MetaMask | Gdk.ModifierType.Mod1Mask);
+
+ if ((evnt.State & modifier) !=0) {
+ if (evnt.Direction == Gdk.ScrollDirection.Up)
+ ZoomIn ();
+ else if (evnt.Direction == Gdk.ScrollDirection.Down)
+ ZoomOut ();
+
+ return true;
+ }
+ return base.OnScrollEvent (evnt);
+ }
+
protected virtual void OnNodeActivated (object sender, Gtk.RowActivatedArgs args)
{
ActivateCurrentItem ();
@@ -2248,6 +2358,7 @@ namespace MonoDevelop.Ide.Gui.Components
class CustomCellRendererText: Gtk.CellRendererText
{
+ double zoom;
Pango.Layout layout;
Pango.FontDescription scaledFont, customFont;
@@ -2309,7 +2420,7 @@ namespace MonoDevelop.Ide.Gui.Components
if (scaledFont != null)
scaledFont.Dispose ();
scaledFont = (customFont ?? parent.Style.FontDesc).Copy ();
- scaledFont.Size = customFont.Size;
+ scaledFont.Size = (int)(customFont.Size * Zoom);
if (layout != null)
layout.FontDescription = scaledFont;
}
@@ -2455,6 +2566,19 @@ namespace MonoDevelop.Ide.Gui.Components
width += (int) StatusIcon.Width + StatusIconSpacing;
}
+ public double Zoom {
+ get {
+ return zoom;
+ }
+ set {
+ if (scaledFont != null) {
+ scaledFont.Dispose ();
+ scaledFont = null;
+ }
+ zoom = value;
+ }
+ }
+
public bool PointerInButton (int px, int py)
{
return buttonScreenRect.Contains (px, py);
@@ -2535,6 +2659,8 @@ namespace MonoDevelop.Ide.Gui.Components
class ZoomableCellRendererPixbuf: CellRendererImage
{
+ double zoom = 1f;
+
Dictionary<Xwt.Drawing.Image,Xwt.Drawing.Image> resizedCache = new Dictionary<Xwt.Drawing.Image, Xwt.Drawing.Image> ();
Xwt.Drawing.Image overlayBottomLeft;
@@ -2542,6 +2668,17 @@ namespace MonoDevelop.Ide.Gui.Components
Xwt.Drawing.Image overlayTopLeft;
Xwt.Drawing.Image overlayTopRight;
+ public double Zoom {
+ get { return zoom; }
+ set {
+ if (zoom != value) {
+ zoom = value;
+ resizedCache.Clear ();
+ Notify ("image");
+ }
+ }
+ }
+
public override Xwt.Drawing.Image Image {
get {
return base.Image;
@@ -2616,7 +2753,20 @@ namespace MonoDevelop.Ide.Gui.Components
if (value == null || value == CellRendererImage.NullImage)
return null;
- return value;
+ if (zoom == 1)
+ return value;
+
+ Xwt.Drawing.Image resized;
+ if (resizedCache.TryGetValue (value, out resized))
+ return resized;
+
+ int w = (int) (zoom * (double) value.Width);
+ int h = (int) (zoom * (double) value.Height);
+ if (w == 0) w = 1;
+ if (h == 0) h = 1;
+ resized = value.WithSize (w, h);
+ resizedCache [value] = resized;
+ return resized;
}
public override void GetSize (Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs
index 17a65a2364..9932f93145 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Components/LogView.cs
@@ -112,8 +112,11 @@ namespace MonoDevelop.Ide.Gui.Components
var clipboard = Clipboard.Get (Gdk.Atom.Intern ("CLIPBOARD", false));
clipboard.Text = text;
- clipboard = Clipboard.Get (Gdk.Atom.Intern ("PRIMARY", false));
- clipboard.Text = text;
+ if (Platform.IsLinux) {
+ // gtk has different clipboards for CLIPBOARD and PRIMARY only on Linux.
+ clipboard = Clipboard.Get (Gdk.Atom.Intern ("PRIMARY", false));
+ clipboard.Text = text;
+ }
}
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs
index 290c2f37a5..85be8e40f3 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/DirtyFilesDialog.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections;
+using System.Collections.Generic;
using Gtk;
@@ -10,7 +11,6 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
internal class DirtyFilesDialog : Gtk.Dialog
{
-
Button btnSaveAndQuit;
Button btnQuit;
Button btnCancel;
@@ -18,21 +18,26 @@ namespace MonoDevelop.Ide.Gui.Dialogs
TreeStore tsFiles;
CellRendererToggle togRender;
CellRendererText textRender;
-
- public DirtyFilesDialog () : base (GettextCatalog.GetString ("Save Files"), IdeApp.Workbench.RootWindow, DialogFlags.Modal)
+
+ public DirtyFilesDialog () : this (IdeApp.Workbench.Documents, true, true)
+ {
+ }
+
+ public DirtyFilesDialog (IReadOnlyList<Document> docs, bool closeWorkspace, bool groupByProject) :
+ base (GettextCatalog.GetString ("Save Files"), IdeApp.Workbench.RootWindow, DialogFlags.Modal)
{
tsFiles = new TreeStore (typeof(string), typeof(bool), typeof(SdiWorkspaceWindow), typeof(bool));
tvFiles = new TreeView (tsFiles);
TreeIter topCombineIter = TreeIter.Zero;
Hashtable projectIters = new Hashtable ();
- foreach (Document doc in IdeApp.Workbench.Documents) {
+ foreach (Document doc in docs) {
if (!doc.IsDirty)
continue;
IViewContent viewcontent = doc.Window.ViewContent;
- if (viewcontent.Project != null) {
+ if (groupByProject && viewcontent.Project != null) {
TreeIter projIter = TreeIter.Zero;
if (projectIters.ContainsKey (viewcontent.Project))
projIter = (TreeIter)projectIters [viewcontent.Project];
@@ -79,9 +84,9 @@ namespace MonoDevelop.Ide.Gui.Dialogs
sc.BorderWidth = 6;
this.VBox.PackStart (sc, true, true, 6);
-
- btnSaveAndQuit = new Button (GettextCatalog.GetString ("_Save and Quit"));
- btnQuit = new Button (Gtk.Stock.Quit);
+
+ btnSaveAndQuit = new Button (closeWorkspace ? GettextCatalog.GetString ("_Save and Quit") : GettextCatalog.GetString ("_Save and Close"));
+ btnQuit = new Button (closeWorkspace ? Gtk.Stock.Quit : Gtk.Stock.Close);
btnCancel = new Button (Gtk.Stock.Cancel);
btnSaveAndQuit.Clicked += SaveAndQuit;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs
index 430502ff21..d778a8c1bd 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Dialogs/OpenFileDialog.cs
@@ -27,6 +27,7 @@
using System;
using MonoDevelop.Core;
using MonoDevelop.Ide.Extensions;
+using MonoDevelop.Components;
using MonoDevelop.Components.Extensions;
using System.Collections.Generic;
using Mono.Addins;
@@ -43,11 +44,11 @@ namespace MonoDevelop.Ide.Gui.Dialogs
{
}
- public OpenFileDialog (string title) : this (title, Gtk.FileChooserAction.Save)
+ public OpenFileDialog (string title) : this (title, FileChooserAction.Save)
{
}
- public OpenFileDialog (string title, Gtk.FileChooserAction action)
+ public OpenFileDialog (string title, FileChooserAction action)
{
Title = title;
Action = action;
@@ -93,7 +94,7 @@ namespace MonoDevelop.Ide.Gui.Dialogs
protected override bool RunDefault ()
{
- var win = new FileSelectorDialog (Title, Action);
+ var win = new FileSelectorDialog (Title, Action.ToGtkAction ());
win.SelectedEncoding = Encoding != null ? Encoding.CodePage : 0;
win.ShowEncodingSelector = ShowEncodingSelector;
win.ShowViewerSelector = ShowViewerSelector;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs
index 0734f172b9..2d9e6c4a76 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/FolderNodeBuilder.cs
@@ -90,6 +90,9 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
{
string dir;
+ if (!file.Visible || file.Flags.HasFlag (ProjectItemFlags.Hidden))
+ continue;
+
if (file.Subtype != Subtype.Directory) {
if (file.DependsOnFile != null)
continue;
@@ -130,6 +133,8 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
foreach (var file in project.Files) {
FilePath path;
+ if (!file.Visible || file.Flags.HasFlag (ProjectItemFlags.Hidden))
+ continue;
if (file.Subtype != Subtype.Directory)
path = file.IsLink ? project.BaseDirectory.Combine (file.ProjectVirtualPath) : file.FilePath;
else
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs
index ca2204543b..57608e02bb 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFileNodeBuilder.cs
@@ -224,60 +224,6 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
return DragOperation.Copy | DragOperation.Move;
}
- public override bool CanDropNode (object dataObject, DragOperation operation)
- {
- var target = (ProjectFile) CurrentNode.DataItem;
- var pf = dataObject as ProjectFile;
-
- return pf != null && pf != target && !pf.HasChildren && target.DependsOn == null;
- }
-
- void Drop (ProjectFile pf, DragOperation operation, HashSet<SolutionEntityItem> projectsToSave)
- {
- var target = (ProjectFile) CurrentNode.DataItem;
- var targetDirectory = target.FilePath.ParentDirectory;
-
- // file dependencies only work if they are in the same physical folder
- if (pf.FilePath.ParentDirectory != targetDirectory) {
- var targetPath = targetDirectory.Combine (pf.FilePath.FileName);
-
- // if copying to the same directory, make a copy with a different name
- if (targetPath == pf.FilePath)
- targetPath = ProjectOperations.GetTargetCopyName (targetPath, false);
-
- if (File.Exists (targetPath))
- if (!MessageService.Confirm (GettextCatalog.GetString ("The file '{0}' already exists. Do you want to overwrite it?", targetPath.FileName), AlertButton.OverwriteFile))
- return;
-
- // unlink the project file from its current parent
- pf.DependsOn = null;
-
- projectsToSave.Add (pf.Project);
-
- bool move = operation == DragOperation.Move;
- var opText = move ? GettextCatalog.GetString ("Moving file...") : GettextCatalog.GetString ("Copying file...");
-
- using (var monitor = IdeApp.Workbench.ProgressMonitors.GetStatusProgressMonitor (opText, Stock.StatusWorking, true))
- IdeApp.ProjectOperations.TransferFiles (monitor, pf.Project, pf.FilePath, target.Project, targetPath, move, true);
-
- pf = target.Project.Files.GetFile (targetPath);
- }
-
- // the dropped project file now depends on the file it was just dropped onto
- pf.DependsOn = target.FilePath.FileName;
- projectsToSave.Add (pf.Project);
- }
-
- public override void OnMultipleNodeDrop (object[] dataObjects, DragOperation operation)
- {
- var projectsToSave = new HashSet<SolutionEntityItem> ();
-
- foreach (var dataObject in dataObjects)
- Drop ((ProjectFile) dataObject, operation, projectsToSave);
-
- IdeApp.ProjectOperations.Save (projectsToSave);
- }
-
public override bool CanDeleteItem ()
{
return true;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs
index 26b22e7047..28c623f1cf 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectFolderNodeBuilder.cs
@@ -198,16 +198,16 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
"The Delete option permanently removes the directory and any files it contains from your hard disk. " +
"Click Remove from Project if you only want to remove it from your current solution.")
};
- question.Buttons.Add (AlertButton.Cancel);
question.Buttons.Add (AlertButton.Delete);
question.Buttons.Add (removeButton);
+ question.Buttons.Add (AlertButton.Cancel);
var deleteOnlyQuestion = new QuestionMessage () {
AllowApplyToAll = folders.Count > 1,
SecondaryText = GettextCatalog.GetString ("The directory and any files it contains will be permanently removed from your hard disk. ")
};
- deleteOnlyQuestion.Buttons.Add (AlertButton.Cancel);
deleteOnlyQuestion.Buttons.Add (AlertButton.Delete);
+ deleteOnlyQuestion.Buttons.Add (AlertButton.Cancel);
foreach (var folder in folders) {
var project = folder.Project;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs
index f647227771..28ac0a8e8a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads.ProjectPad/ProjectNodeBuilder.cs
@@ -222,6 +222,9 @@ namespace MonoDevelop.Ide.Gui.Pads.ProjectPad
void AddFile (ProjectFile file, Project project)
{
+ if (!file.Visible || file.Flags.HasFlag (ProjectItemFlags.Hidden))
+ return;
+
ITreeBuilder tb = Context.GetTreeBuilder ();
if (file.DependsOnFile != null) {
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs
index 55e2afe829..5ac9296bad 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/ErrorListPad.cs
@@ -126,7 +126,7 @@ namespace MonoDevelop.Ide.Gui.Pads
DockItemToolbar toolbar = window.GetToolbar (PositionType.Top);
- errorBtn = new ToggleButton ();
+ errorBtn = new ToggleButton { Name = "toggleErrors" };
errorBtn.Active = (bool)PropertyService.Get (showErrorsPropertyName, true);
errorBtn.Image = new Gtk.Image (Stock.Error, Gtk.IconSize.Menu);
errorBtn.Image.Show ();
@@ -135,7 +135,7 @@ namespace MonoDevelop.Ide.Gui.Pads
UpdateErrorsNum();
toolbar.Add (errorBtn);
- warnBtn = new ToggleButton ();
+ warnBtn = new ToggleButton { Name = "toggleWarnings" };
warnBtn.Active = (bool)PropertyService.Get (showWarningsPropertyName, true);
warnBtn.Image = new Gtk.Image (Stock.Warning, Gtk.IconSize.Menu);
warnBtn.Image.Show ();
@@ -144,7 +144,7 @@ namespace MonoDevelop.Ide.Gui.Pads
UpdateWarningsNum();
toolbar.Add (warnBtn);
- msgBtn = new ToggleButton ();
+ msgBtn = new ToggleButton { Name = "toggleMessages" };
msgBtn.Active = (bool)PropertyService.Get (showMessagesPropertyName, true);
msgBtn.Image = new Gtk.Image (Stock.Information, Gtk.IconSize.Menu);
msgBtn.Image.Show ();
@@ -155,7 +155,7 @@ namespace MonoDevelop.Ide.Gui.Pads
toolbar.Add (new SeparatorToolItem ());
- logBtn = new ToggleButton ();
+ logBtn = new ToggleButton { Name = "toggleBuildOutput" };
logBtn.Label = GettextCatalog.GetString ("Build Output");
logBtn.Image = ImageService.GetImage ("md-message-log", Gtk.IconSize.Menu);
logBtn.Image.Show ();
@@ -231,7 +231,7 @@ namespace MonoDevelop.Ide.Gui.Pads
control.Add1 (sw);
- outputView = new LogView ();
+ outputView = new LogView { Name = "buildOutput" };
control.Add2 (outputView);
Control.ShowAll ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs
index 915ae8612a..0eb985da7d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Pads/MonodocTreePad.cs
@@ -46,7 +46,7 @@ namespace MonoDevelop.Ide.Gui.Pads
ScrolledWindow scroller;
TreeIter root_iter;
- public HelpTree () : base (GettextCatalog.GetString ("Help"), "md-help")
+ public HelpTree () : base (GettextCatalog.GetString ("Help"), Stock.Help)
{
tree_view = new MonoDevelop.Ide.Gui.Components.PadTreeView ();
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
index 58d6768512..82a7646774 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/DefaultWorkbench.cs
@@ -1028,7 +1028,8 @@ namespace MonoDevelop.Ide.Gui
protected override bool OnConfigureEvent (Gdk.EventConfigure evnt)
{
SetActiveWidget (Focus);
- return base.OnConfigureEvent (evnt);
+ base.OnConfigureEvent (evnt);
+ return false;
}
protected override bool OnFocusInEvent (Gdk.EventFocus evnt)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
index 069845ada8..e471350082 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Document.cs
@@ -414,7 +414,7 @@ namespace MonoDevelop.Ide.Gui
}
if (filename == null) {
- var dlg = new OpenFileDialog (GettextCatalog.GetString ("Save as..."), FileChooserAction.Save) {
+ var dlg = new OpenFileDialog (GettextCatalog.GetString ("Save as..."), MonoDevelop.Components.FileChooserAction.Save) {
TransientFor = IdeApp.Workbench.RootWindow,
Encoding = encoding,
ShowEncodingSelector = (tbuffer != null),
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs
index 05d64ce084..5e50878b93 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/ProgressMonitors.cs
@@ -77,7 +77,7 @@ namespace MonoDevelop.Ide.Gui
public IProgressMonitor GetRunProgressMonitor ()
{
- return GetOutputProgressMonitor ("MonoDevelop.Ide.ApplicationOutput", GettextCatalog.GetString ("Application Output"), Stock.RunProgramIcon, true, true);
+ return GetOutputProgressMonitor ("MonoDevelop.Ide.ApplicationOutput", GettextCatalog.GetString ("Application Output"), Stock.RunProgramIcon, false, true);
}
public IProgressMonitor GetToolOutputProgressMonitor (bool bringToFront)
@@ -102,7 +102,7 @@ namespace MonoDevelop.Ide.Gui
public IConsole CreateConsole (bool closeOnDispose)
{
- return (IConsole) GetOutputProgressMonitor ("MonoDevelop.Ide.ApplicationOutput", GettextCatalog.GetString ("Application Output"), Stock.MessageLog, true, true);
+ return (IConsole) GetOutputProgressMonitor ("MonoDevelop.Ide.ApplicationOutput", GettextCatalog.GetString ("Application Output"), Stock.MessageLog, false, true);
}
/******************************/
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
index 01ea62b0ca..58e4750c86 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/Workbench.cs
@@ -201,6 +201,14 @@ namespace MonoDevelop.Ide.Gui
return false;
if (toplevel == RootWindow)
return true;
+ #if WIN32
+ var app = System.Windows.Application.Current;
+ if (app != null) {
+ var wpfWindow = app.Windows.OfType<System.Windows.Window>().SingleOrDefault (x => x.IsActive);
+ if (wpfWindow != null)
+ return true;
+ }
+ #endif
var dock = toplevel as DockFloatingWindow;
return dock != null && dock.DockParent == RootWindow;
}
@@ -311,6 +319,37 @@ namespace MonoDevelop.Ide.Gui
foreach (Document doc in docs)
doc.Save ();
}
+
+ internal bool SaveAllDirtyFiles ()
+ {
+ Document[] docs = Documents.Where (doc => doc.IsDirty && doc.Window.ViewContent != null).ToArray ();
+ if (!docs.Any ())
+ return true;
+
+ foreach (Document doc in docs) {
+ AlertButton result = PromptToSaveChanges (doc);
+ if (result == AlertButton.Cancel)
+ return false;
+
+ doc.Save ();
+ if (doc.IsDirty) {
+ doc.Select ();
+ return false;
+ }
+ }
+ return true;
+ }
+
+ static AlertButton PromptToSaveChanges (Document doc)
+ {
+ return MessageService.GenericAlert (MonoDevelop.Ide.Gui.Stock.Warning,
+ GettextCatalog.GetString ("Save the changes to document '{0}' before creating a new solution?",
+ doc.Window.ViewContent.IsUntitled
+ ? doc.Window.ViewContent.UntitledName
+ : System.IO.Path.GetFileName (doc.FileName)),
+ "",
+ AlertButton.Cancel, doc.Window.ViewContent.IsUntitled ? AlertButton.SaveAs : AlertButton.Save);
+ }
public void CloseAllDocuments (bool leaveActiveDocumentOpen)
{
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs
index a1af09c25c..c8ff32acb6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Navigation/NavigationHistoryService.cs
@@ -349,12 +349,11 @@ namespace MonoDevelop.Ide.Navigation
bool closedHistoryChanged = false;
foreach (ProjectFileRenamedEventInfo args in e) {
foreach (NavigationHistoryItem point in history) {
- DocumentNavigationPoint dp = point.NavigationPoint as DocumentNavigationPoint;
+ var dp = point.NavigationPoint as DocumentNavigationPoint;
historyChanged &= (dp != null && dp.HandleRenameEvent (args.OldName, args.NewName));
- }
- foreach (NavigationHistoryItem point in history) {
- DocumentNavigationPoint cdp = point.NavigationPoint as DocumentNavigationPoint;
- closedHistoryChanged &= (cdp != null && cdp.HandleRenameEvent (args.OldName, args.NewName));
+ closedHistoryChanged &= (dp != null && dp.HandleRenameEvent (args.OldName, args.NewName));
+ if (historyChanged && closedHistoryChanged)
+ break;
}
}
if (historyChanged)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddFileDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddFileDialog.cs
index 6377843060..0adbed59b7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddFileDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AddFileDialog.cs
@@ -42,7 +42,7 @@ namespace MonoDevelop.Ide.Projects
public AddFileDialog (string title)
{
Title = title;
- Action = FileChooserAction.Open;
+ Action = MonoDevelop.Components.FileChooserAction.Open;
data.SelectMultiple = true;
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs
index 7c53d25e86..5f84923e08 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/AssemblyReferencePanel.cs
@@ -150,7 +150,7 @@ namespace MonoDevelop.Ide.Projects
void HandleClicked (object sender, EventArgs e)
{
- var dlg = new OpenFileDialog (GettextCatalog.GetString ("Select Assembly"), FileChooserAction.Open);
+ var dlg = new OpenFileDialog (GettextCatalog.GetString ("Select Assembly"), MonoDevelop.Components.FileChooserAction.Open);
// dlg.AddFilter (GettextCatalog.GetString ("Assemblies"), "*.[Dd][Ll][Ll]", "*.[Ee][Xx][Ee]");
dlg.AddFilter (GettextCatalog.GetString ("Assemblies"), "*.dll", "*.exe");
dlg.CurrentFolder = basePath;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs
index 2ac9f2edac..b14e549df5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/DefaultPolicyOptionsDialog.cs
@@ -221,7 +221,7 @@ namespace MonoDevelop.Ide.Projects
void HandleFromFile (object sender, EventArgs e)
{
OpenFileDialog dlg = new OpenFileDialog (GettextCatalog.GetString ("Select Policy File"));
- dlg.Action = FileChooserAction.Open;
+ dlg.Action = MonoDevelop.Components.FileChooserAction.Open;
dlg.TransientFor = this;
dlg.AddFilter (BrandingService.BrandApplicationName (GettextCatalog.GetString ("MonoDevelop policy files")), "*.mdpolicy");
dlg.AddAllFilesFilter ();
@@ -280,7 +280,7 @@ namespace MonoDevelop.Ide.Projects
OpenFileDialog dlg = new OpenFileDialog (GettextCatalog.GetString ("Select Policy File"));
dlg.TransientFor = this;
dlg.InitialFileName = currentSet.Name + ".mdpolicy";
- dlg.Action = FileChooserAction.Save;
+ dlg.Action = MonoDevelop.Components.FileChooserAction.Save;
dlg.AddFilter (BrandingService.BrandApplicationName (GettextCatalog.GetString ("MonoDevelop policy files")), "*.mdpolicy");
dlg.AddAllFilesFilter ();
dlg.CurrentFolder = ExportProjectPolicyDialog.DefaultFileDialogPolicyDir;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs
index 4f51bb1f38..58df08302e 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/ExportProjectPolicyDialog.cs
@@ -24,7 +24,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System;
-using Gtk;
+using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using MonoDevelop.Projects.Policies;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs
index 3861ff60df..611343c253 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkNewProjectDialogBackend.UI.cs
@@ -29,6 +29,7 @@ using Gtk;
using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Templates;
+using Mono.TextEditor;
namespace MonoDevelop.Ide.Projects
{
@@ -72,8 +73,8 @@ namespace MonoDevelop.Ide.Projects
void Build ()
{
BorderWidth = 0;
- WidthRequest = 901;
- HeightRequest = 632;
+ WidthRequest = GtkWorkarounds.ConvertToPixelScale (901);
+ HeightRequest = GtkWorkarounds.ConvertToPixelScale (632);
Name = "wizard_dialog";
Title = GettextCatalog.GetString ("New Project");
@@ -84,9 +85,9 @@ namespace MonoDevelop.Ide.Projects
projectConfigurationWidget.Name = "projectConfigurationWidget";
// Top banner of dialog.
- var topLabelEventBox = new EventBox ();
+ var topLabelEventBox = new EventBox ();
topLabelEventBox.Name = "topLabelEventBox";
- topLabelEventBox.HeightRequest = 52;
+ topLabelEventBox.HeightRequest = GtkWorkarounds.ConvertToPixelScale (52);
topLabelEventBox.ModifyBg (StateType.Normal, bannerBackgroundColor);
topLabelEventBox.ModifyFg (StateType.Normal, whiteColor);
topLabelEventBox.BorderWidth = 0;
@@ -130,7 +131,7 @@ namespace MonoDevelop.Ide.Projects
var templateCategoriesVBox = new VBox ();
templateCategoriesVBox.Name = "templateCategoriesVBox";
templateCategoriesVBox.BorderWidth = 0;
- templateCategoriesVBox.WidthRequest = 220;
+ templateCategoriesVBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale (220);
var templateCategoriesScrolledWindow = new ScrolledWindow ();
templateCategoriesScrolledWindow.Name = "templateCategoriesScrolledWindow";
templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;
@@ -148,9 +149,9 @@ namespace MonoDevelop.Ide.Projects
templatesHBox.PackStart (templateCategoriesVBox, false, false, 0);
// Templates.
- var templatesVBox = new VBox ();
+ var templatesVBox = new VBox ();
templatesVBox.Name = "templatesVBox";
- templatesVBox.WidthRequest = 400;
+ templatesVBox.WidthRequest = GtkWorkarounds.ConvertToPixelScale (400);
templatesHBox.PackStart (templatesVBox, false, false, 0);
var templatesScrolledWindow = new ScrolledWindow ();
templatesScrolledWindow.Name = "templatesScrolledWindow";
@@ -178,23 +179,23 @@ namespace MonoDevelop.Ide.Projects
templateEventBox.Add (templateVBox);
// Template large image.
- templateImage = new ImageView ();
+ templateImage = new ImageView ();
templateImage.Name = "templateImage";
- templateImage.HeightRequest = 140;
- templateImage.WidthRequest = 240;
+ templateImage.HeightRequest = GtkWorkarounds.ConvertToPixelScale (140);
+ templateImage.WidthRequest = GtkWorkarounds.ConvertToPixelScale (240);
templateVBox.PackStart (templateImage, false, false, 10);
// Template description.
- templateNameLabel = new Label ();
+ templateNameLabel = new Label ();
templateNameLabel.Name = "templateNameLabel";
- templateNameLabel.WidthRequest = 240;
+ templateNameLabel.WidthRequest = GtkWorkarounds.ConvertToPixelScale (240);
templateNameLabel.Wrap = true;
templateNameLabel.Xalign = 0;
templateNameLabel.Markup = MarkupTemplateName ("TemplateName");
templateVBox.PackStart (templateNameLabel, false, false, 0);
- templateDescriptionLabel = new Label ();
+ templateDescriptionLabel = new Label ();
templateDescriptionLabel.Name = "templateDescriptionLabel";
- templateDescriptionLabel.WidthRequest = 240;
+ templateDescriptionLabel.WidthRequest = GtkWorkarounds.ConvertToPixelScale (240);
templateDescriptionLabel.Wrap = true;
templateDescriptionLabel.Xalign = 0;
templateVBox.PackStart (templateDescriptionLabel, false, false, 0);
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs
index 55f54d1c3e..ed5388bc5a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/GtkTemplateCellRenderer.cs
@@ -32,6 +32,7 @@ using Gtk;
using MonoDevelop.Components;
using MonoDevelop.Core;
using MonoDevelop.Ide.Templates;
+using Mono.TextEditor;
namespace MonoDevelop.Ide.Projects
{
@@ -118,7 +119,8 @@ namespace MonoDevelop.Ide.Projects
SetMarkup (layout, GetSelectedLanguage ());
layout.GetPixelSize (out textWidth, out textHeight);
- languageRect = GetLanguageButtonRectangle (window, widget, cell_area, textHeight, textWidth);
+ double scale = GtkWorkarounds.GetPixelScale ();
+ languageRect = GetLanguageButtonRectangle (window, widget, cell_area, textHeight, textWidth, scale);
DrawTemplateNameText (window, widget, cell_area, iconRect, languageRect, flags);
@@ -126,7 +128,7 @@ namespace MonoDevelop.Ide.Projects
SetSourceColor (ctx, LanguageButtonBackgroundColor.ToCairoColor ());
ctx.Fill ();
- int languageTextX = languageRect.X + languageLeftHandPadding;
+ int languageTextX = languageRect.X + GetLanguageLeftHandPadding (scale);
if (!TemplateHasMultipleLanguages ()) {
languageTextX = languageRect.X + (languageRect.Width - textWidth) / 2;
}
@@ -135,14 +137,30 @@ namespace MonoDevelop.Ide.Projects
window.DrawLayout (widget.Style.TextGC (StateType.Normal), languageTextX, languageTextY, layout);
if (TemplateHasMultipleLanguages ()) {
- int triangleX = languageTextX + textWidth + languageRightHandPadding;
- int triangleY = languageRect.Y + (languageRect.Height - dropdownTriangleHeight) / 2;
- DrawTriangle (ctx, triangleX, triangleY);
+ int triangleX = languageTextX + textWidth + GetLanguageRightHandPadding (scale);
+ int triangleY = languageRect.Y + (languageRect.Height - ((int)(scale * dropdownTriangleHeight))) / 2;
+ DrawTriangle (ctx, triangleX, triangleY, scale);
}
}
}
}
+ int GetLanguageLeftHandPadding (double scale)
+ {
+ if (Platform.IsWindows && scale > 1.0) {
+ return (int)(scale * (languageLeftHandPadding + 3));
+ }
+ return languageLeftHandPadding;
+ }
+
+ int GetLanguageRightHandPadding (double scale)
+ {
+ if (Platform.IsWindows && scale > 1.0) {
+ return (int)(scale * languageRightHandPadding);
+ }
+ return languageRightHandPadding;
+ }
+
void DrawTemplateCategoryText (Drawable window, Widget widget, Rectangle cell_area, CellRendererState flags)
{
StateType state = GetState (widget, flags);
@@ -233,7 +251,7 @@ namespace MonoDevelop.Ide.Projects
layout.SetMarkup (markup);
}
- Rectangle GetLanguageButtonRectangle (Drawable window, Widget widget, Rectangle cell_area, int textHeight, int textWidth)
+ Rectangle GetLanguageButtonRectangle (Drawable window, Widget widget, Rectangle cell_area, int textHeight, int textWidth, double scale)
{
int languageRectangleHeight = cell_area.Height - 8;
int languageRectangleWidth = textWidth + languageLeftHandPadding;
@@ -244,6 +262,8 @@ namespace MonoDevelop.Ide.Projects
languageRectangleWidth = Math.Max (languageRectangleWidth, minLanguageRectWidth);
}
+ languageRectangleWidth = (int)(scale * languageRectangleWidth);
+
var dy = (cell_area.Height - languageRectangleHeight) / 2 - 1;
var y = cell_area.Y + dy;
var x = widget.Allocation.Width - languageRectangleWidth - (int)Xpad;
@@ -256,12 +276,15 @@ namespace MonoDevelop.Ide.Projects
return Template.AvailableLanguages.Count > 1;
}
- void DrawTriangle (Cairo.Context ctx, int x, int y)
+ void DrawTriangle (Cairo.Context ctx, int x, int y, double scale)
{
+ int width = (int)(scale * dropdownTriangleWidth);
+ int height = (int)(scale * dropdownTriangleHeight);
+
SetSourceColor (ctx, triangleColor.ToCairoColor ());
ctx.MoveTo (x, y);
- ctx.LineTo (x + dropdownTriangleWidth, y);
- ctx.LineTo (x + (dropdownTriangleWidth / 2), y + dropdownTriangleHeight);
+ ctx.LineTo (x + width, y);
+ ctx.LineTo (x + (width / 2), y + height);
ctx.LineTo (x, y);
ctx.Fill ();
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs
index 914e8cd91d..2b58dfc474 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Tasks/UserTasksView.cs
@@ -98,6 +98,7 @@ namespace MonoDevelop.Ide.Tasks
cellRendCompleted.Toggled += new ToggledHandler (UserTaskCompletedToggled);
cellRendCompleted.Activatable = true;
col = view.AppendColumn (String.Empty, cellRendCompleted, "active", Columns.Completed);
+ col.SortColumnId = (int)Columns.Completed;
cellRendDesc = view.TextRenderer;
cellRendDesc.Editable = true;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs
index 95b4648acf..c120b9a57b 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/FileTemplate.cs
@@ -6,6 +6,7 @@
// Michael Hutchinson (mhutchinson@novell.com)
// Marek Sieradzki (marek.sieradzki@gmail.com)
// Viktoria Dudka (viktoriad@remobjects.com)
+// Vincent Dondain (vincent@xamarin.com)
//
// Copyright (c) 2009 RemObjects Software
//
@@ -29,229 +30,161 @@
//
//
-
using System;
-using MonoDevelop.Core;
-using Mono.Addins;
-using MonoDevelop.Ide.Gui;
-using MonoDevelop.Projects;
+using System.Collections.Generic;
using System.IO;
+using System.Linq;
+using System.Xml;
using Gtk;
-using System.Collections.Generic;
-using System.Collections;
+using Mono.Addins;
+using MonoDevelop.Core;
using MonoDevelop.Ide.Codons;
-using System.Xml;
-using System.Linq;
+using MonoDevelop.Ide.Gui;
+using MonoDevelop.Projects;
namespace MonoDevelop.Ide.Templates
{
- class FileTemplate
- {
-
-
- public static List<FileTemplate> fileTemplates = new List<FileTemplate> ();
-
-
- private List<FileDescriptionTemplate> files = new List<FileDescriptionTemplate> ();
- public List<FileDescriptionTemplate> Files
- {
- get { return files; }
- }
-
- private List<FileTemplateCondition> conditions = new List<FileTemplateCondition> ();
- public List<FileTemplateCondition> Сonditions
- {
- get { return conditions; }
- }
-
- private string id = String.Empty;
- public string Id
- {
- get { return id; }
- }
-
- private string icon = String.Empty;
- public IconId Icon
- {
- get { return icon; }
- }
-
- private string category = String.Empty;
- public string Category
- {
- get { return category; }
- }
-
- private string wizardPath = String.Empty;
- public string WizardPath
- {
- get { return wizardPath; }
- }
-
- private string description = String.Empty;
- public string Description
- {
- get { return description; }
- }
-
- private bool isFixedFilename = false;
- public bool IsFixedFilename
- {
- get { return isFixedFilename; }
- }
-
- private string defaultFilename = String.Empty;
- public string DefaultFilename
- {
- get { return defaultFilename; }
- }
-
- public string name = String.Empty;
- public string Name
- {
- get { return name; }
- }
-
- private string languageName = String.Empty;
- public string LanguageName
- {
- get { return languageName; }
- }
-
- private string originator = String.Empty;
- public string Originator
- {
- get { return originator; }
- }
-
- private string created = String.Empty;
- public string Created
- {
- get { return created; }
- }
-
- private string lastModified = String.Empty;
- public string LastModified
- {
- get { return lastModified; }
- }
-
- private string projecttype = String.Empty;
- public string ProjectType
- {
- get { return projecttype; }
- }
-
-
- private static FileTemplate LoadFileTemplate (RuntimeAddin addin, ProjectTemplateCodon codon)
- {
+ class FileTemplate
+ {
+ public string Category { get; private set; } = String.Empty;
+
+ public List<FileTemplateCondition> Conditions { get; private set; } = new List<FileTemplateCondition> ();
+
+ public string Created { get; private set; } = String.Empty;
+
+ public string DefaultFilename { get; private set; } = String.Empty;
+
+ public string Description { get; private set; } = String.Empty;
+
+ public List<FileDescriptionTemplate> Files { get; private set; } = new List<FileDescriptionTemplate> ();
+
+ public static List<FileTemplate> fileTemplates = new List<FileTemplate> ();
+
+ public IconId Icon { get; private set; } = String.Empty;
+
+ public string Id { get; private set; } = String.Empty;
+
+ public bool IsFixedFilename { get; private set; }
+
+ public string LanguageName { get; private set; } = String.Empty;
+
+ public string LastModified { get; private set; } = String.Empty;
+
+ public string Name { get; private set; } = String.Empty;
+
+ public string Originator { get; private set; } = String.Empty;
+
+ public string ProjectType { get; private set; } = String.Empty;
+
+ public string WizardPath { get; private set; } = String.Empty;
+
+ static FileTemplate LoadFileTemplate (RuntimeAddin addin, ProjectTemplateCodon codon)
+ {
XmlDocument xmlDocument = codon.GetTemplate ();
FilePath baseDirectory = codon.BaseDirectory;
- //Configuration
- XmlElement xmlNodeConfig = xmlDocument.DocumentElement["TemplateConfiguration"];
-
- FileTemplate fileTemplate = null;
- if (xmlNodeConfig["Type"] != null) {
- Type configType = addin.GetType (xmlNodeConfig["Type"].InnerText);
-
- if (typeof (FileTemplate).IsAssignableFrom (configType)) {
- fileTemplate = (FileTemplate)Activator.CreateInstance (configType);
- }
- else
- throw new InvalidOperationException (string.Format ("The file template class '{0}' must be a subclass of MonoDevelop.Ide.Templates.FileTemplate", xmlNodeConfig["Type"].InnerText));
- }
- else
- fileTemplate = new FileTemplate ();
-
- fileTemplate.originator = xmlDocument.DocumentElement.GetAttribute ("Originator");
- fileTemplate.created = xmlDocument.DocumentElement.GetAttribute ("Created");
- fileTemplate.lastModified = xmlDocument.DocumentElement.GetAttribute ("LastModified");
-
- if (xmlNodeConfig["_Name"] != null) {
- fileTemplate.name = xmlNodeConfig["_Name"].InnerText;
- }
- else {
- throw new InvalidOperationException (string.Format ("Missing element '_Name' in file template: {0}", codon.Id));
- }
-
- if (xmlNodeConfig["_Category"] != null) {
- fileTemplate.category = xmlNodeConfig["_Category"].InnerText;
- }
- else {
- throw new InvalidOperationException (string.Format ("Missing element '_Category' in file template: {0}", codon.Id));
- }
-
- if (xmlNodeConfig["LanguageName"] != null) {
- fileTemplate.languageName = xmlNodeConfig["LanguageName"].InnerText;
- }
-
- if (xmlNodeConfig["ProjectType"] != null) {
- fileTemplate.projecttype = xmlNodeConfig["ProjectType"].InnerText;
- }
-
- if (xmlNodeConfig["_Description"] != null) {
- fileTemplate.description = xmlNodeConfig["_Description"].InnerText;
- }
-
- if (xmlNodeConfig["Icon"] != null) {
- fileTemplate.icon = ImageService.GetStockId (addin, xmlNodeConfig["Icon"].InnerText, IconSize.Dnd); //xmlNodeConfig["_Description"].InnerText;
- }
-
- if (xmlNodeConfig["Wizard"] != null) {
- fileTemplate.icon = xmlNodeConfig["Wizard"].Attributes["path"].InnerText;
- }
-
- if (xmlNodeConfig["DefaultFilename"] != null) {
- fileTemplate.defaultFilename = xmlNodeConfig["DefaultFilename"].InnerText;
- string isFixed = xmlNodeConfig["DefaultFilename"].GetAttribute ("IsFixed");
+ //Configuration
+ XmlElement xmlNodeConfig = xmlDocument.DocumentElement ["TemplateConfiguration"];
+
+ FileTemplate fileTemplate;
+ if (xmlNodeConfig ["Type"] != null) {
+ Type configType = addin.GetType (xmlNodeConfig ["Type"].InnerText);
+
+ if (typeof(FileTemplate).IsAssignableFrom (configType)) {
+ fileTemplate = (FileTemplate)Activator.CreateInstance (configType);
+ } else
+ throw new InvalidOperationException (string.Format ("The file template class '{0}' must be a subclass of MonoDevelop.Ide.Templates.FileTemplate", xmlNodeConfig ["Type"].InnerText));
+ } else
+ fileTemplate = new FileTemplate ();
+
+ fileTemplate.Originator = xmlDocument.DocumentElement.GetAttribute ("Originator");
+ fileTemplate.Created = xmlDocument.DocumentElement.GetAttribute ("Created");
+ fileTemplate.LastModified = xmlDocument.DocumentElement.GetAttribute ("LastModified");
+
+ if (xmlNodeConfig ["_Name"] != null) {
+ fileTemplate.Name = xmlNodeConfig ["_Name"].InnerText;
+ } else {
+ throw new InvalidOperationException (string.Format ("Missing element '_Name' in file template: {0}", codon.Id));
+ }
+
+ if (xmlNodeConfig ["_Category"] != null) {
+ fileTemplate.Category = xmlNodeConfig ["_Category"].InnerText;
+ } else {
+ throw new InvalidOperationException (string.Format ("Missing element '_Category' in file template: {0}", codon.Id));
+ }
+
+ if (xmlNodeConfig ["LanguageName"] != null) {
+ fileTemplate.LanguageName = xmlNodeConfig ["LanguageName"].InnerText;
+ }
+
+ if (xmlNodeConfig ["ProjectType"] != null) {
+ fileTemplate.ProjectType = xmlNodeConfig ["ProjectType"].InnerText;
+ }
+
+ if (xmlNodeConfig ["_Description"] != null) {
+ fileTemplate.Description = xmlNodeConfig ["_Description"].InnerText;
+ }
+
+ if (xmlNodeConfig ["Icon"] != null) {
+ fileTemplate.Icon = ImageService.GetStockId (addin, xmlNodeConfig ["Icon"].InnerText, IconSize.Dnd);
+ }
+
+ if (xmlNodeConfig ["Wizard"] != null) {
+ fileTemplate.Icon = xmlNodeConfig ["Wizard"].Attributes ["path"].InnerText;
+ }
+
+ if (xmlNodeConfig ["DefaultFilename"] != null) {
+ fileTemplate.DefaultFilename = xmlNodeConfig ["DefaultFilename"].InnerText;
+ string isFixed = xmlNodeConfig ["DefaultFilename"].GetAttribute ("IsFixed");
if (isFixed.Length > 0) {
bool bFixed;
if (bool.TryParse (isFixed, out bFixed))
- fileTemplate.isFixedFilename = bFixed;
+ fileTemplate.IsFixedFilename = bFixed;
else
throw new InvalidOperationException ("Invalid value for IsFixed in template.");
}
- }
+ }
- //Template files
- XmlNode xmlNodeTemplates = xmlDocument.DocumentElement["TemplateFiles"];
+ //Template files
+ XmlNode xmlNodeTemplates = xmlDocument.DocumentElement ["TemplateFiles"];
- if(xmlNodeTemplates != null) {
- foreach(XmlNode xmlNode in xmlNodeTemplates.ChildNodes) {
- if(xmlNode is XmlElement) {
- fileTemplate.files.Add (
- FileDescriptionTemplate.CreateTemplate ((XmlElement)xmlNode, baseDirectory));
+ if (xmlNodeTemplates != null) {
+ foreach (XmlNode xmlNode in xmlNodeTemplates.ChildNodes) {
+ var xmlElement = xmlNode as XmlElement;
+ if (xmlElement != null) {
+ fileTemplate.Files.Add (
+ FileDescriptionTemplate.CreateTemplate (xmlElement, baseDirectory));
}
}
}
- //Conditions
- XmlNode xmlNodeConditions = xmlDocument.DocumentElement["Conditions"];
- if(xmlNodeConditions != null) {
- foreach(XmlNode xmlNode in xmlNodeConditions.ChildNodes) {
- if(xmlNode is XmlElement) {
- fileTemplate.conditions.Add (FileTemplateCondition.CreateCondition ((XmlElement)xmlNode));
+ //Conditions
+ XmlNode xmlNodeConditions = xmlDocument.DocumentElement ["Conditions"];
+ if (xmlNodeConditions != null) {
+ foreach (XmlNode xmlNode in xmlNodeConditions.ChildNodes) {
+ var xmlElement = xmlNode as XmlElement;
+ if (xmlElement != null) {
+ fileTemplate.Conditions.Add (FileTemplateCondition.CreateCondition (xmlElement));
}
}
}
- return fileTemplate;
- }
+ return fileTemplate;
+ }
- static FileTemplate()
- {
- AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Ide/FileTemplates", OnExtensionChanged);
- }
+ static FileTemplate ()
+ {
+ AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Ide/FileTemplates", OnExtensionChanged);
+ }
static void OnExtensionChanged (object s, ExtensionNodeEventArgs args)
- {
- if (args.Change == ExtensionChange.Add) {
- ProjectTemplateCodon codon = (ProjectTemplateCodon) args.ExtensionNode;
- try {
- FileTemplate t = LoadFileTemplate (codon.Addin, codon);
- t.id = codon.Id;
- fileTemplates.Add (t);
+ {
+ if (args.Change == ExtensionChange.Add) {
+ var codon = (ProjectTemplateCodon)args.ExtensionNode;
+ try {
+ FileTemplate t = LoadFileTemplate (codon.Addin, codon);
+ t.Id = codon.Id;
+ fileTemplates.Add (t);
} catch (Exception e) {
string extId = null, addinId = null;
if (codon != null) {
@@ -261,19 +194,18 @@ namespace MonoDevelop.Ide.Templates
addinId = codon.Addin.Id;
}
LoggingService.LogError ("Error loading template id {0} in addin {1}:\n{2}",
- extId ?? "(null)", addinId ?? "(null)", e.ToString ());
+ extId ?? "(null)", addinId ?? "(null)", e.ToString ());
+ }
+ } else {
+ var codon = (ProjectTemplateCodon)args.ExtensionNode;
+ foreach (FileTemplate t in fileTemplates) {
+ if (t.Id == codon.Id) {
+ fileTemplates.Remove (t);
+ break;
+ }
}
- }
- else {
- ProjectTemplateCodon codon = (ProjectTemplateCodon) args.ExtensionNode;
- foreach (FileTemplate t in fileTemplates) {
- if (t.Id == codon.Id) {
- fileTemplates.Remove (t);
- break;
- }
- }
- }
- }
+ }
+ }
internal static List<FileTemplate> GetFileTemplates (Project project, string projectPath)
{
@@ -286,45 +218,37 @@ namespace MonoDevelop.Ide.Templates
}
internal static FileTemplate GetFileTemplateByID (string templateID)
- {
- foreach (FileTemplate t in fileTemplates)
- if (t.Id == templateID)
- return t;
+ {
+ foreach (FileTemplate t in fileTemplates)
+ if (t.Id == templateID)
+ return t;
- return null;
- }
+ return null;
+ }
public virtual bool Create (SolutionItem policyParent, Project project, string directory, string language, string name)
- {
- if (!String.IsNullOrEmpty(WizardPath)) {
- //Properties customizer = new Properties();
- //customizer.Set("Template", item);
- //customizer.Set("Creator", this);
- //WizardDialog wizard = new WizardDialog("File Wizard", customizer, item.WizardPath);
- //if (wizard.ShowDialog() == DialogResult.OK) {
- //DialogResult = DialogResult.OK;
- //}
- return false;
+ {
+ if (!String.IsNullOrEmpty (WizardPath)) {
+ return false;
} else {
- foreach (FileDescriptionTemplate newfile in Files)
- if (!CreateFile (newfile, policyParent, project, directory, language, name))
- return false;
- return true;
- }
- }
+ foreach (FileDescriptionTemplate newfile in Files)
+ if (!CreateFile (newfile, policyParent, project, directory, language, name))
+ return false;
+ return true;
+ }
+ }
public virtual bool IsValidName (string name, string language)
- {
- if (isFixedFilename)
- return (name == defaultFilename);
+ {
+ if (IsFixedFilename)
+ return (name == DefaultFilename);
- bool valid = true;
- foreach (FileDescriptionTemplate templ in Files)
- if (!templ.IsValidName (name, language))
- valid = false;
+ bool valid = true;
+ foreach (FileDescriptionTemplate templ in Files)
+ valid &= templ.IsValidName (name, language);
- return valid;
- }
+ return valid;
+ }
public static string GuessMimeType (string fileName)
{
@@ -337,17 +261,17 @@ namespace MonoDevelop.Ide.Templates
FileService.MoveFile (fn, fn + n + ext);
string mimeType = DesktopService.GetMimeTypeForUri (fn + n + ext);
FileService.DeleteFile (fn + n + ext);
- if (mimeType == null || mimeType == "")
+ if (string.IsNullOrEmpty (mimeType))
mimeType = "text";
return mimeType;
}
-
+
public virtual bool CanCreateUnsavedFiles (FileDescriptionTemplate newfile, SolutionItem policyParent, Project project, string directory, string language, string name)
{
if (project != null) {
return true;
} else {
- SingleFileDescriptionTemplate singleFile = newfile as SingleFileDescriptionTemplate;
+ var singleFile = newfile as SingleFileDescriptionTemplate;
if (singleFile == null)
return false;
@@ -362,145 +286,145 @@ namespace MonoDevelop.Ide.Templates
}
protected virtual bool CreateFile (FileDescriptionTemplate newfile, SolutionItem policyParent, Project project, string directory, string language, string name)
- {
- if (project != null) {
+ {
+ if (project != null) {
var model = project.GetStringTagModel (new DefaultConfigurationSelector ());
newfile.SetProjectTagModel (model);
try {
- if (newfile.AddToProject (policyParent, project, language, directory, name)) {
- newfile.Show ();
- return true;
+ if (newfile.AddToProject (policyParent, project, language, directory, name)) {
+ newfile.Show ();
+ return true;
}
} finally {
newfile.SetProjectTagModel (null);
}
} else {
- SingleFileDescriptionTemplate singleFile = newfile as SingleFileDescriptionTemplate;
- if (singleFile == null)
- throw new InvalidOperationException ("Single file template expected");
+ var singleFile = newfile as SingleFileDescriptionTemplate;
+ if (singleFile == null)
+ throw new InvalidOperationException ("Single file template expected");
- if (directory != null) {
- string fileName = singleFile.SaveFile (policyParent, project, language, directory, name);
- if (fileName != null) {
+ if (directory != null) {
+ string fileName = singleFile.SaveFile (policyParent, project, language, directory, name);
+ if (fileName != null) {
IdeApp.Workbench.OpenDocument (fileName, project);
- return true;
- }
+ return true;
+ }
} else {
- string fileName = singleFile.GetFileName (policyParent, project, language, directory, name);
- Stream stream = singleFile.CreateFileContent (policyParent, project, language, fileName, name);
+ string fileName = singleFile.GetFileName (policyParent, project, language, directory, name);
+ Stream stream = singleFile.CreateFileContent (policyParent, project, language, fileName, name);
string mimeType = GuessMimeType (fileName);
IdeApp.Workbench.NewDocument (fileName, mimeType, stream);
return true;
- }
- }
- return false;
- }
+ }
+ }
+ return false;
+ }
protected virtual bool IsValidForProject (Project project, string projectPath)
- {
- // When there is no project, only single template files can be created.
- if (project == null) {
- foreach (FileDescriptionTemplate f in files)
- if (!(f is SingleFileDescriptionTemplate))
- return false;
- }
-
- // Filter on templates
- foreach (FileDescriptionTemplate f in files)
- if (!f.SupportsProject (project, projectPath))
- return false;
-
- //filter on conditions
- if (project != null) {
- if (!string.IsNullOrEmpty (projecttype) && project.GetProjectTypes ().All (p => p != projecttype))
- return false;
-
- foreach (FileTemplateCondition condition in conditions)
- if (!condition.ShouldEnableFor (project, projectPath))
- return false;
- }
-
- return true;
- }
+ {
+ // When there is no project, only single template files can be created.
+ if (project == null) {
+ foreach (FileDescriptionTemplate f in Files)
+ if (!(f is SingleFileDescriptionTemplate))
+ return false;
+ }
+
+ // Filter on templates
+ foreach (FileDescriptionTemplate f in Files)
+ if (!f.SupportsProject (project, projectPath))
+ return false;
+
+ //filter on conditions
+ if (project != null) {
+ if (!string.IsNullOrEmpty (ProjectType) && project.GetProjectTypes ().All (p => p != ProjectType))
+ return false;
+
+ foreach (FileTemplateCondition condition in Conditions)
+ if (!condition.ShouldEnableFor (project, projectPath))
+ return false;
+ }
+
+ return true;
+ }
public virtual List<string> GetCompatibleLanguages (Project project, string projectPath)
- {
- if (project == null)
- return SupportedLanguages;
-
- //find the languages that both the template and the project support
- List<string> langMatches = MatchLanguagesWithProject (project);
-
- //filter on conditions
- List<string> filtered = new List<string> ();
- foreach (string lang in langMatches) {
- bool shouldEnable = true;
- foreach (FileTemplateCondition condition in conditions) {
- if (!condition.ShouldEnableFor (project, projectPath, lang)) {
- shouldEnable = false;
- break;
- }
- }
- if (shouldEnable)
- filtered.Add (lang);
- }
-
- return filtered;
- }
-
- //The languages that the template supports
- //FIXME: would it be memory-effective to cache this?
+ {
+ if (project == null)
+ return SupportedLanguages;
+
+ //find the languages that both the template and the project support
+ List<string> langMatches = MatchLanguagesWithProject (project);
+
+ //filter on conditions
+ var filtered = new List<string> ();
+ foreach (string lang in langMatches) {
+ bool shouldEnable = true;
+ foreach (FileTemplateCondition condition in Conditions) {
+ if (!condition.ShouldEnableFor (project, projectPath, lang)) {
+ shouldEnable = false;
+ break;
+ }
+ }
+ if (shouldEnable)
+ filtered.Add (lang);
+ }
+
+ return filtered;
+ }
+
+ //The languages that the template supports
+ //FIXME: would it be memory-effective to cache this?
List<string> SupportedLanguages {
get {
- List<string> templateLangs = new List<string> ();
- foreach (string s in this.LanguageName.Split (','))
- templateLangs.Add (s.Trim ());
- ExpandLanguageWildcards (templateLangs);
- return templateLangs;
- }
- }
+ var templateLangs = new List<string> ();
+ foreach (string s in LanguageName.Split (','))
+ templateLangs.Add (s.Trim ());
+ ExpandLanguageWildcards (templateLangs);
+ return templateLangs;
+ }
+ }
List<string> MatchLanguagesWithProject (Project project)
- {
- //The languages that the project supports
- List<string> projectLangs = new List<string> (project.SupportedLanguages);
- ExpandLanguageWildcards (projectLangs);
-
- List<string> templateLangs = SupportedLanguages;
-
- //Find all matches between the language strings of project and template
- List<string> langMatches = new List<string> ();
-
- foreach (string templLang in templateLangs)
- foreach (string projLang in projectLangs)
- if (templLang == projLang)
- langMatches.Add (projLang);
-
- //Eliminate duplicates
- int pos = 0;
- while (pos < langMatches.Count) {
- int next = langMatches.IndexOf (langMatches [pos], pos +1);
- if (next != -1)
- langMatches.RemoveAt (next);
- else
- pos++;
- }
-
- return langMatches;
- }
-
- void ExpandLanguageWildcards (List<string> list)
- {
- //Template can match all CodeDom .NET languages with a "*"
- if (list.Contains ("*")) {
- foreach (var lb in LanguageBindingService.LanguageBindings) {
- IDotNetLanguageBinding dnlang = lb as IDotNetLanguageBinding;
- if (dnlang != null && dnlang.GetCodeDomProvider () != null)
- list.Add (dnlang.Language);
- list.Remove ("*");
- }
- }
- }
- }
+ {
+ //The languages that the project supports
+ var projectLangs = new List<string> (project.SupportedLanguages);
+ ExpandLanguageWildcards (projectLangs);
+
+ List<string> templateLangs = SupportedLanguages;
+
+ //Find all matches between the language strings of project and template
+ var langMatches = new List<string> ();
+
+ foreach (string templLang in templateLangs)
+ foreach (string projLang in projectLangs)
+ if (templLang == projLang)
+ langMatches.Add (projLang);
+
+ //Eliminate duplicates
+ int pos = 0;
+ while (pos < langMatches.Count) {
+ int next = langMatches.IndexOf (langMatches [pos], pos + 1);
+ if (next != -1)
+ langMatches.RemoveAt (next);
+ else
+ pos++;
+ }
+
+ return langMatches;
+ }
+
+ static void ExpandLanguageWildcards (ICollection<string> list)
+ {
+ //Template can match all CodeDom .NET languages with a "*"
+ if (list.Contains ("*")) {
+ foreach (var lb in LanguageBindingService.LanguageBindings) {
+ var dnlang = lb as IDotNetLanguageBinding;
+ if (dnlang != null && dnlang.GetCodeDomProvider () != null)
+ list.Add (dnlang.Language);
+ list.Remove ("*");
+ }
+ }
+ }
+ }
}
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplateCategorizer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplateCategorizer.cs
index cb0e0ebf53..1742eb86ec 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplateCategorizer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Templates/ProjectTemplateCategorizer.cs
@@ -37,6 +37,7 @@ namespace MonoDevelop.Ide.Templates
TemplateCategory defaultCategory;
Dictionary<string, TemplateCategory> mappedCategories = new Dictionary<string, TemplateCategory> ();
Predicate<SolutionTemplate> templateMatch;
+ bool removedEmptyCategories;
public static readonly Predicate<SolutionTemplate> MatchNewProjectTemplates = template => template.IsMatch (SolutionTemplateVisibility.NewProject);
public static readonly Predicate<SolutionTemplate> MatchNewSolutionTemplates = template => template.IsMatch (SolutionTemplateVisibility.NewSolution);
@@ -86,6 +87,11 @@ namespace MonoDevelop.Ide.Templates
public IEnumerable<TemplateCategory> GetCategorizedTemplates ()
{
+ if (!removedEmptyCategories) {
+ RemoveEmptyCategories ();
+ removedEmptyCategories = true;
+ }
+
return categories;
}
@@ -99,7 +105,6 @@ namespace MonoDevelop.Ide.Templates
LogNoCategoryMatch (template);
}
}
- RemoveEmptyCategories ();
}
IEnumerable<SolutionTemplate> GetFilteredTemplates (IEnumerable<SolutionTemplate> templates)
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerationService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerationService.cs
index 4c857af7d9..42d8e0116f 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerationService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/CodeGenerationService.cs
@@ -115,7 +115,7 @@ namespace MonoDevelop.Ide.TypeSystem
var tcs = new TaskCompletionSource<bool>();
if (parentType == null)
return tcs.Task;
- part = part ?? parentType.Parts.FirstOrDefault ();
+ part = part ?? FindCurrentPart (parentType);
if (part == null)
return tcs.Task;
var loadedDocument = IdeApp.Workbench.OpenDocument (part.Region.FileName);
@@ -160,7 +160,24 @@ namespace MonoDevelop.Ide.TypeSystem
return tcs.Task;
}
-
+
+ public static IUnresolvedTypeDefinition FindCurrentPart (ITypeDefinition type)
+ {
+ var active = IdeApp.Workbench.ActiveDocument;
+ if (active != null) {
+ var partsInFile = type.Parts.Where (p => p.Region.FileName == active.FileName).ToList ();
+
+ foreach (var p in partsInFile) {
+ if (p.Region.Contains (active.Editor.Caret.Location))
+ return p;
+ }
+ if (partsInFile.Count > 0)
+ return partsInFile[0];
+ }
+
+ return type.Parts.FirstOrDefault ();
+ }
+
public static Task<bool> InsertMember (
ITypeDefinition parentType, IUnresolvedTypeDefinition part,
IUnresolvedMember newMember, bool implementExplicit = false)
@@ -168,7 +185,7 @@ namespace MonoDevelop.Ide.TypeSystem
var tcs = new TaskCompletionSource<bool>();
if (parentType == null)
return tcs.Task;
- part = part ?? parentType.Parts.FirstOrDefault ();
+ part = part ?? FindCurrentPart (parentType);
if (part == null)
return tcs.Task;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
index 68dd562d56..d1cc52adfc 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.TypeSystem/TypeSystemService.cs
@@ -160,7 +160,7 @@ namespace MonoDevelop.Ide.TypeSystem
public static class TypeSystemService
{
- const string CurrentVersion = "1.1.8";
+ const string CurrentVersion = "1.1.9";
static readonly List<TypeSystemParserNode> parsers;
static string[] filesSkippedInParseThread = new string[0];
@@ -674,6 +674,11 @@ namespace MonoDevelop.Ide.TypeSystem
throw new Exception ("Too many cache directories");
}
+ static string EscapeToXml (string txt)
+ {
+ return new System.Xml.Linq.XText (txt).ToString ();
+ }
+
static string CreateCacheDirectory (FilePath fileName)
{
CanonicalizePath (ref fileName);
@@ -685,7 +690,7 @@ namespace MonoDevelop.Ide.TypeSystem
File.WriteAllText (
Path.Combine (cacheDir, "data.xml"),
- string.Format ("<DerivedData><File name=\"{0}\" version =\"{1}\"/></DerivedData>", fileName, CurrentVersion)
+ string.Format ("<DerivedData><File name=\"{0}\" version =\"{1}\"/></DerivedData>", EscapeToXml (fileName), CurrentVersion)
);
return cacheDir;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
index 39388cf2c3..03e49acac9 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj
@@ -31,14 +31,14 @@
<Optimize>True</Optimize>
<OutputPath>..\..\..\build\bin</OutputPath>
<ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
+ <WarningLevel>3</WarningLevel>
<Execution>
<Execution clr-version="Net_2_0" />
</Execution>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\build\AddIns\MonoDevelop.Ide.xml</DocumentationFile>
+ <DocumentationFile>..\..\..\build\bin\MonoDevelop.Ide.xml</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugMac|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -62,8 +62,38 @@
<OutputPath>..\..\..\build\bin</OutputPath>
<DefineConstants>MAC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <DocumentationFile>..\..\..\build\AddIns\MonoDevelop.Ide.xml</DocumentationFile>
+ <WarningLevel>3</WarningLevel>
+ <DocumentationFile>..\..\..\build\bin\MonoDevelop.Ide.xml</DocumentationFile>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ <NoWarn>1591;1573</NoWarn>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugWin32|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\build\bin</OutputPath>
+ <DefineConstants>DEBUG,WIN32</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>3</WarningLevel>
+ <DocumentationFile>..\..\..\build\bin\MonoDevelop.Ide.xml</DocumentationFile>
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+ <NoWarn>1591;1573</NoWarn>
+ <Execution>
+ <Execution clr-version="Net_2_0" />
+ </Execution>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseWin32|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\build\bin</OutputPath>
+ <DefineConstants>WIN32</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>3</WarningLevel>
+ <DocumentationFile>..\..\..\build\bin\MonoDevelop.Ide.xml</DocumentationFile>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Execution>
<Execution clr-version="Net_2_0" />
@@ -104,6 +134,11 @@
<Reference Include="Xamarin.Mac" Condition=" '$(Configuration)' == 'DebugMac' Or '$(Configuration)' == 'ReleaseMac' ">
<HintPath>..\..\..\external\Xamarin.Mac.dll</HintPath>
</Reference>
+ <Reference Include="System.Windows" Condition=" '$(Configuration)' == 'DebugWin32' Or '$(Configuration)' == 'ReleaseWin32' " />
+ <Reference Include="PresentationCore" Condition=" '$(Configuration)' == 'DebugWin32' Or '$(Configuration)' == 'ReleaseWin32' " />
+ <Reference Include="PresentationFramework" Condition=" '$(Configuration)' == 'DebugWin32' Or '$(Configuration)' == 'ReleaseWin32' " />
+ <Reference Include="WindowsBase" Condition=" '$(Configuration)' == 'DebugWin32' Or '$(Configuration)' == 'ReleaseWin32' " />
+ <Reference Include="System.Xaml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -3379,6 +3414,9 @@
<Compile Include="MonoDevelop.Components.AutoTest\PropertyMetadata.cs" />
<Compile Include="MonoDevelop.Components.AutoTest\ObjectProperties.cs" />
<Compile Include="MonoDevelop.Components.AutoTest.Operations\SelectedOperation.cs" />
+ <Compile Include="MonoDevelop.Components\Windows\GtkWPFWidget.cs" />
+ <Compile Include="MonoDevelop.Components\Windows\GtkWin32Interop.cs" />
+ <Compile Include="MonoDevelop.Components\FileChooserAction.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Makefile.am" />
@@ -3423,6 +3461,7 @@
<Folder Include="MonoDevelop.Ide.TextEditing\" />
<Folder Include="MonoDevelop.Components.DockNotebook\" />
<Folder Include="icons\mac\" />
+ <Folder Include="MonoDevelop.Components\Windows\" />
</ItemGroup>
<ItemGroup>
<Content Include="gtkrc.win32">
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
index 9aaca48201..9231b18f8a 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/IdeStartup.cs
@@ -219,7 +219,13 @@ namespace MonoDevelop.Ide
Counters.Initialization.Trace ("Loading Icons");
//force initialisation before the workbench so that it can register stock icons for GTK before they get requested
ImageService.Initialize ();
-
+
+ // If we display an error dialog before the main workbench window on OS X then a second application menu is created
+ // which is then replaced with a second empty Apple menu.
+ // XBC #33699
+ Counters.Initialization.Trace ("Initializing IdeApp");
+ IdeApp.Initialize (monitor);
+
if (errorsList.Count > 0) {
using (AddinLoadErrorDialog dlg = new AddinLoadErrorDialog ((AddinError[]) errorsList.ToArray (typeof(AddinError)), false)) {
if (!dlg.Run ())
@@ -234,9 +240,6 @@ namespace MonoDevelop.Ide
// no alternative for Application.ThreadException?
// Application.ThreadException += new ThreadExceptionEventHandler(ShowErrorBox);
- Counters.Initialization.Trace ("Initializing IdeApp");
- IdeApp.Initialize (monitor);
-
// Load requested files
Counters.Initialization.Trace ("Opening Files");
@@ -356,7 +359,10 @@ namespace MonoDevelop.Ide
gtkrc += "-yosemite";
}
}
- Environment.SetEnvironmentVariable ("GTK2_RC_FILES", PropertyService.EntryAssemblyPath.Combine (gtkrc));
+
+ var gtkrcf = PropertyService.EntryAssemblyPath.Combine (gtkrc);
+ LoggingService.LogInfo ("GTK: Using gtkrc from {0}", gtkrcf);
+ Environment.SetEnvironmentVariable ("GTK2_RC_FILES", gtkrcf);
}
}
@@ -731,6 +737,10 @@ namespace MonoDevelop.Ide
Console.WriteLine (BrandingService.ApplicationName + " " + BuildInfo.VersionLabel);
Console.WriteLine ("Options:");
optSet.WriteOptionDescriptions (Console.Out);
+ const string openFileText = " file.ext;line;column";
+ Console.Write (openFileText);
+ Console.Write (new string (' ', 29 - openFileText.Length));
+ Console.WriteLine ("Opens a file at specified integer line and column");
}
return opt;
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
index dff2ba3017..e944b75f55 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/ProjectOperations.cs
@@ -53,6 +53,7 @@ using ICSharpCode.NRefactory.TypeSystem.Implementation;
using System.Text;
using MonoDevelop.Ide.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem;
+using MonoDevelop.Components.Extensions;
namespace MonoDevelop.Ide
{
@@ -622,6 +623,9 @@ namespace MonoDevelop.Ide
public void NewSolution (string defaultTemplate)
{
+ if (!IdeApp.Workbench.SaveAllDirtyFiles ())
+ return;
+
var newProjectDialog = new NewProjectDialogController ();
newProjectDialog.OpenSolution = true;
newProjectDialog.SelectedTemplateId = defaultTemplate;
@@ -653,7 +657,7 @@ namespace MonoDevelop.Ide
WorkspaceItem res = null;
var dlg = new SelectFileDialog () {
- Action = Gtk.FileChooserAction.Open,
+ Action = FileChooserAction.Open,
CurrentFolder = parentWorkspace.BaseDirectory,
SelectMultiple = false,
};
@@ -716,7 +720,7 @@ namespace MonoDevelop.Ide
SolutionItem res = null;
var dlg = new SelectFileDialog () {
- Action = Gtk.FileChooserAction.Open,
+ Action = FileChooserAction.Open,
CurrentFolder = parentFolder.BaseDirectory,
SelectMultiple = false,
};
@@ -1621,7 +1625,7 @@ namespace MonoDevelop.Ide
{
var dlg = new SelectFileDialog () {
SelectMultiple = true,
- Action = Gtk.FileChooserAction.Open,
+ Action = FileChooserAction.Open,
CurrentFolder = folder.BaseDirectory,
TransientFor = MessageService.RootWindow,
};
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
index 7f63bb7925..c18aa74bb2 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/RootWorkspace.cs
@@ -52,7 +52,6 @@ namespace MonoDevelop.Ide
// IParserDatabase parserDatabase;
string activeConfiguration;
bool useDefaultRuntime;
- string preferredActiveExecutionTarget;
ProjectFileEventHandler fileAddedToProjectHandler;
ProjectFileEventHandler fileRemovedFromProjectHandler;
@@ -153,11 +152,6 @@ namespace MonoDevelop.Ide
ActiveExecutionTargetChanged (this, EventArgs.Empty);
}
- internal string PreferredActiveExecutionTarget {
- get { return ActiveExecutionTarget != null ? ActiveExecutionTarget.Id : preferredActiveExecutionTarget; }
- set { preferredActiveExecutionTarget = value; }
- }
-
public ConfigurationSelector ActiveConfiguration {
get { return new SolutionConfigurationSelector (activeConfiguration); }
}
@@ -693,7 +687,6 @@ namespace MonoDevelop.Ide
try {
WorkspaceUserData data = item.UserProperties.GetValue<WorkspaceUserData> ("MonoDevelop.Ide.Workspace");
if (data != null) {
- PreferredActiveExecutionTarget = data.PreferredExecutionTarget;
ActiveExecutionTarget = null;
if (GetConfigurations ().Contains (data.ActiveConfiguration))
@@ -762,8 +755,6 @@ namespace MonoDevelop.Ide
WorkspaceUserData data = new WorkspaceUserData ();
data.ActiveConfiguration = ActiveConfigurationId;
data.ActiveRuntime = UseDefaultRuntime ? null : ActiveRuntime.Id;
- if (ActiveExecutionTarget != null)
- data.PreferredExecutionTarget = ActiveExecutionTarget.Id;
item.UserProperties.SetValue ("MonoDevelop.Ide.Workspace", data);
// Allow add-ins to fill-up data
@@ -1497,8 +1488,6 @@ namespace MonoDevelop.Ide
public string ActiveConfiguration;
[ItemProperty]
public string ActiveRuntime;
- [ItemProperty]
- public string PreferredExecutionTarget;
}
public class ItemUnloadingEventArgs: EventArgs
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v14.0.cs b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v14.0.cs
new file mode 100644
index 0000000000..6b3d27577c
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/AssemblyInfo.v14.0.cs
@@ -0,0 +1,9 @@
+[assembly: System.Reflection.AssemblyTitle ("MonoDevelop MSBuild 14.0 Builder")]
+
+namespace MonoDevelop.Projects.Formats.MSBuild
+{
+ static class MSBuildConsts
+ {
+ public const string Version = "14.0";
+ }
+}
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.csproj b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.csproj
index 6e56a94fd8..0d4ccd83d2 100644
--- a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.csproj
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.csproj
@@ -28,7 +28,6 @@
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
<NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\build\bin\MonoDevelop.Projects.Formats.MSBuild.xml</DocumentationFile>
<DefineConstants>NET_3_5,NET_4_0</DefineConstants>
</PropertyGroup>
<ItemGroup>
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v14.0.csproj b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v14.0.csproj
new file mode 100644
index 0000000000..923f0f38d6
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/MonoDevelop.Projects.Formats.MSBuild.dotnet.v14.0.csproj
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{8EE5A588-9445-48EC-97BD-BF066E7FFD51}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <RootNamespace>MonoDevelop.Projects.Formats.MSBuild</RootNamespace>
+ <AssemblyName>MonoDevelop.Projects.Formats.MSBuild</AssemblyName>
+ <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
+ <TargetFrameworkProfile />
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\build\bin\MSBuild\dotnet.14.0\</OutputPath>
+ <DefineConstants>DEBUG;</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ExternalConsole>true</ExternalConsole>
+ <IntermediateOutputPath>obj\Debug</IntermediateOutputPath>
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\build\bin\MSBuild\dotnet.14.0\</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ExternalConsole>true</ExternalConsole>
+ <IntermediateOutputPath>obj\Release</IntermediateOutputPath>
+ <PlatformTarget>x86</PlatformTarget>
+ </PropertyGroup>
+ <PropertyGroup>
+ <StartupObject>MonoDevelop.Projects.Formats.MSBuild.MainClass</StartupObject>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Microsoft.Build, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.Build.Framework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+ <Reference Include="Microsoft.Build.Utilities.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
+ <Reference Include="System" />
+ <Reference Include="System.Runtime.Remoting" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="app.v14.0.config">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <Link>MonoDevelop.Projects.Formats.MSBuild.exe.config</Link>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\BuildEngine.v4.0.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\IBuildEngine.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\ILogWriter.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\IProjectBuilder.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\LocalLogger.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildEvaluatedItem.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildResult.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\MSBuildTargetResult.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\ProjectBuilder.Shared.cs" />
+ <Compile Include="MonoDevelop.Projects.Formats.MSBuild\ProjectBuilder.v4.0.cs" />
+ <Compile Include="AssemblyInfo.v14.0.cs" />
+ <Compile Include="Main.cs" />
+ <Compile Include="AssemblyInfo.cs" />
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project> \ No newline at end of file
diff --git a/main/src/core/MonoDevelop.Projects.Formats.MSBuild/app.v14.0.config b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/app.v14.0.config
new file mode 100644
index 0000000000..a1efcc318e
--- /dev/null
+++ b/main/src/core/MonoDevelop.Projects.Formats.MSBuild/app.v14.0.config
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <generatePublisherEvidence enabled="false" />
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="Microsoft.Build.Framework" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="14.0.0.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="Microsoft.Build.Engine" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-100.0.0.0" newVersion="14.0.0.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration>
diff --git a/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup.csproj b/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup.csproj
index 1ce70038af..9a0c8ca36e 100644
--- a/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup.csproj
+++ b/main/src/core/MonoDevelop.Startup/MonoDevelop.Startup.csproj
@@ -37,15 +37,13 @@
<Optimize>true</Optimize>
<OutputPath>..\..\..\build\bin</OutputPath>
<WarningLevel>4</WarningLevel>
- <PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
- <NoWarn>1591;1573</NoWarn>
- <DocumentationFile>..\..\..\build\bin\MonoDevelop.xml</DocumentationFile>
+ <Commandlineparameters>-no-redirect</Commandlineparameters>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>full</DebugType>
- <Optimize>True</Optimize>
+ <Optimize>false</Optimize>
<OutputPath>..\..\..\build\bin</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@@ -69,6 +67,11 @@
<Execution>
<Execution clr-version="Net_2_0" />
</Execution>
+ <DebugSymbols>true</DebugSymbols>
+ <Commandlineparameters>-no-redirect</Commandlineparameters>
+ </PropertyGroup>
+ <PropertyGroup>
+ <ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\MonoDevelop.Core\MonoDevelop.Core.csproj">
@@ -93,6 +96,7 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
+ <None Include="app.manifest" />
</ItemGroup>
<ItemGroup>
<Compile Include="MonoDevelop.Startup\MonoDevelopMain.cs" />
diff --git a/main/src/core/MonoDevelop.Startup/app.config b/main/src/core/MonoDevelop.Startup/app.config
index 187469f353..7a19cb2817 100644
--- a/main/src/core/MonoDevelop.Startup/app.config
+++ b/main/src/core/MonoDevelop.Startup/app.config
@@ -20,9 +20,4 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
-
- <!-- This is required by the subversion add-in for windows, which uses a mixed mode assembly built with .NET 2.0 -->
- <startup useLegacyV2RuntimeActivationPolicy="true">
- <supportedRuntime version="v4.0"/>
- </startup>
</configuration>
diff --git a/main/src/core/MonoDevelop.Startup/app.manifest b/main/src/core/MonoDevelop.Startup/app.manifest
new file mode 100644
index 0000000000..9eccbecb2f
--- /dev/null
+++ b/main/src/core/MonoDevelop.Startup/app.manifest
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+ <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+ <security>
+ <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+ <!-- UAC Manifest Options
+ If you want to change the Windows User Account Control level replace the
+ requestedExecutionLevel node with one of the following.
+
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+ <requestedExecutionLevel level="highestAvailable" uiAccess="false" />
+
+ Specifying requestedExecutionLevel element will disable file and registry virtualization.
+ Remove this element if your application requires this virtualization for backwards
+ compatibility.
+ -->
+ <requestedExecutionLevel level="asInvoker" uiAccess="false" />
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <application>
+ <!-- Windows Vista -->
+ <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />
+
+ <!-- Windows 7 -->
+ <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />
+
+ <!-- Windows 8 -->
+ <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />
+
+ <!-- Windows 8.1 -->
+ <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />
+
+ <!-- Windows 10 -->
+ <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
+
+ </application>
+ </compatibility>
+
+ <!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
+ DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
+ to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
+ also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->
+ <!--
+ <application xmlns="urn:schemas-microsoft-com:asm.v3">
+ <windowsSettings>
+ <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
+ </windowsSettings>
+ </application>
+ -->
+</assembly>
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj
index 12ade68796..e91c85430b 100644
--- a/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj
+++ b/main/src/core/MonoDevelop.TextEditor.Tests/MonoDevelop.TextEditor.Tests.csproj
@@ -21,6 +21,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
+ <DebugType>full</DebugType>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
diff --git a/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs b/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs
index c7434c4eab..f1e16c50e5 100644
--- a/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs
+++ b/main/src/tools/mdmonitor/InstrumentationViewerDialog.cs
@@ -287,7 +287,7 @@ namespace Mono.Instrumentation.Monitor
protected virtual void OnOpenActionActivated (object sender, System.EventArgs e)
{
- FileChooserDialog fdiag = new FileChooserDialog ("Open Data File", this, FileChooserAction.Open);
+ FileChooserDialog fdiag = new FileChooserDialog ("Open Data File", this, Gtk.FileChooserAction.Open);
fdiag.AddButton (Gtk.Stock.Cancel, ResponseType.Cancel);
fdiag.AddButton (Gtk.Stock.Open, ResponseType.Ok);
fdiag.SelectMultiple = false;