diff options
author | Matt Ward <matt.ward@microsoft.com> | 2019-08-22 19:48:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-22 19:48:50 +0300 |
commit | f88dd5f15186685385dcbf4cc7818841f1c93eee (patch) | |
tree | 3e3d6ce3ce1dd11a33689ae46d5a404fa0898280 /main/src/addins/MonoDevelop.PackageManagement | |
parent | 18cc49d53fd85ef5eb73f9bb55d63509ec995e52 (diff) | |
parent | 0e0531214446692f94185a6ad3fbf4553f70ccf5 (diff) |
Merge pull request #8482 from mono/nuget-manage-packages-checkbox-selection-via-keyboard
[NuGet] Allow checkboxes to be selected by keyboard in packages dialog
Diffstat (limited to 'main/src/addins/MonoDevelop.PackageManagement')
-rw-r--r-- | main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs | 49 |
1 files changed, 3 insertions, 46 deletions
diff --git a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs index 2cf875404d..967351c86e 100644 --- a/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs +++ b/main/src/addins/MonoDevelop.PackageManagement/MonoDevelop.PackageManagement.Gui/ManagePackagesDialog.cs @@ -101,7 +101,6 @@ namespace MonoDevelop.PackageManagement this.packageSourceComboBox.SelectionChanged += PackageSourceChanged; this.addPackagesButton.Clicked += AddPackagesButtonClicked; this.packageSearchEntry.Changed += PackageSearchEntryChanged; - this.packageSearchEntry.Activated += PackageSearchEntryActivated; this.packageVersionComboBox.SelectionChanged += PackageVersionChanged; imageLoader.Loaded += ImageLoaded; @@ -836,51 +835,9 @@ namespace MonoDevelop.PackageManagement void PackagesListRowActivated (object sender, ListViewRowEventArgs e) { - if (PackagesCheckedCount > 0) { - AddPackagesButtonClicked (sender, e); - } else { - ManagePackagesSearchResultViewModel packageViewModel = packageStore.GetValue (e.RowIndex, packageViewModelField); - ManagePackage (packageViewModel); - } - } - - void ManagePackage (ManagePackagesSearchResultViewModel packageViewModel) - { - try { - if (packageViewModel != null) { - if (viewModel.IsConsolidatePageSelected) { - List<IPackageAction> packageActions = viewModel.CreateConsolidatePackageActions ( - new ManagePackagesSearchResultViewModel [] { packageViewModel } - ); - RunPackageActions (packageActions); - } else { - var projects = SelectProjects (packageViewModel).ToList (); - if (!projects.Any ()) - return; - - List<IPackageAction> packageActions = viewModel.CreatePackageActions ( - new ManagePackagesSearchResultViewModel [] { packageViewModel }, - projects); - RunPackageActions (packageActions); - } - } - } catch (Exception ex) { - LoggingService.LogInternalError ("ManagePackage failed.", ex); - ShowErrorMessage (ex.Message); - } - } - - void PackageSearchEntryActivated (object sender, EventArgs e) - { - if (loadingMessageVisible) - return; - - if (PackagesCheckedCount > 0) { - AddPackagesButtonClicked (sender, e); - } else { - ManagePackagesSearchResultViewModel selectedPackageViewModel = GetSelectedPackageViewModel (); - ManagePackage (selectedPackageViewModel); - } + ManagePackagesSearchResultViewModel packageViewModel = packageStore.GetValue (e.RowIndex, packageViewModelField); + packageViewModel.IsChecked = !packageViewModel.IsChecked; + PackageCellViewPackageChecked (null, null); } void PackagesListViewScrollValueChanged (object sender, EventArgs e) |