public inbox for cygwin-apps-cvs@sourceware.org
help / color / mirror / Atom feed
* [setup - the official Cygwin setup program] branch master, updated. release_2.895
@ 2018-10-21 15:55 jturney
  0 siblings, 0 replies; only message in thread
From: jturney @ 2018-10-21 15:55 UTC (permalink / raw)
  To: cygwin-apps-cvs




https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=3969f3ea7bf6c9de04d6cec6e1ae2f1dd6b7e99d

commit 3969f3ea7bf6c9de04d6cec6e1ae2f1dd6b7e99d
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sun Oct 21 13:14:05 2018 +0100

    Only dump transaction list when it's finalized
    
    Dumping the transaction list after 1) trust level is set, 2) solving for
    dependencies, and 3) adding source packages is a bit much.

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=22e01f519bb83bce9250a6467ce6da9f5f195baa

commit 22e01f519bb83bce9250a6467ce6da9f5f195baa
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sat Jul 21 22:19:51 2018 +0100

    Simple keyboard accelerators for Listview
    
    Wire-up certain actions to keyboard accelerators.
    
    To permit selecting a subitem apparently needs us to custom-draw everything,
    so for simplicity, just make the accelerators per row.
    
    Getting the enter keypress to be delivered to the listview is tricky (the
    propsheet really want to hold onto it), so for the moment we just use the
    Windows menu key and space bar as accelerators.

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=d76a9ffd0c78ca31d0aea2c4f237af1855b0cbe9

commit d76a9ffd0c78ca31d0aea2c4f237af1855b0cbe9
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Wed Oct 17 14:12:26 2018 +0100

    Indicate test packages in action menu

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=7231b543a4ffc32b1ed93867b4a4b46ff894d79d

commit 7231b543a4ffc32b1ed93867b4a4b46ff894d79d
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Sat Jul 21 22:19:51 2018 +0100

    Add listview to tab order on chooser page

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=05edbf2154acdd08e0a833e36b10a0048f6aa36e

commit 05edbf2154acdd08e0a833e36b10a0048f6aa36e
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Wed Oct 17 13:39:17 2018 +0100

    Use selected row background colour for a checkbox column

https://sourceware.org/git/gitweb.cgi?p=cygwin-apps/setup.git;h=d5a81cbe8d4319b0d8f5e77f314ca7affc5593a6

commit d5a81cbe8d4319b0d8f5e77f314ca7affc5593a6
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Mon Oct 15 20:46:31 2018 +0100

    Allow for width of dropdown button in popup columns
    
    Currently, the dropdown button in the 'New' column can overlap the version,
    because  'New' columns is just sized to hold the widest version.
    
    Allow for the width of the dropdown button as well in the 'New' column width


Diff:
---
 ListView.cc         |   49 ++++++++++++++++++++++++++++++++++++++++++++++++-
 ListView.h          |    1 +
 PickCategoryLine.cc |   18 ++++++++++++++++++
 PickCategoryLine.h  |    1 +
 PickPackageLine.cc  |   15 +++++++++++++++
 PickPackageLine.h   |    1 +
 libsolv.cc          |   18 ++++++++++++++++++
 libsolv.h           |    2 +-
 package_meta.cc     |    5 ++++-
 res.rc              |    2 +-
 10 files changed, 108 insertions(+), 4 deletions(-)

diff --git a/ListView.cc b/ListView.cc
index e287270..d58780b 100644
--- a/ListView.cc
+++ b/ListView.cc
@@ -159,6 +159,12 @@ ListView::noteColumnWidth(int col_num, const std::string& string)
 
   int width = addend + s.cx;
 
+  // allow for width of dropdown button in popup columns
+  if (headers[col_num].type == ListView::ControlType::popup)
+    {
+      width += GetSystemMetrics(SM_CXVSCROLL);
+    }
+
   if (width > headers[col_num].width)
     headers[col_num].width = width;
 }
@@ -408,7 +414,12 @@ ListView::OnNotify (NMHDR *pNmHdr, LRESULT *pResult)
                   // erase and draw a checkbox
                   RECT r;
                   ListView_GetSubItemRect(hWndListView, iRow, iCol, LVIR_BOUNDS, &r);
-                  HBRUSH hBrush = CreateSolidBrush(ListView_GetBkColor(hWndListView));
+                  DWORD bkg_color;
+                  if (pNmLvCustomDraw->nmcd.uItemState & CDIS_SELECTED)
+                    bkg_color = GetSysColor(COLOR_HIGHLIGHT);
+                  else
+                    bkg_color = ListView_GetBkColor(hWndListView);
+                  HBRUSH hBrush = CreateSolidBrush(bkg_color);
                   FillRect(pNmLvCustomDraw->nmcd.hdc, &r, hBrush);
                   DeleteObject(hBrush);
                   DrawFrameControl(pNmLvCustomDraw->nmcd.hdc, &r, DFC_BUTTON, state);
@@ -490,6 +501,42 @@ ListView::OnNotify (NMHDR *pNmHdr, LRESULT *pResult)
     }
     break;
 
+  case LVN_KEYDOWN:
+    {
+      NMLVKEYDOWN *pNmLvKeyDown = (NMLVKEYDOWN *)pNmHdr;
+      int iRow = ListView_GetSelectionMark(hWndListView);
+#if DEBUG
+      Log (LOG_PLAIN) << "LVN_KEYDOWN vkey " << pNmLvKeyDown->wVKey << " on row " << iRow << endLog;
+#endif
+
+      if (contents && iRow >= 0)
+        {
+          int col_num;
+          int action_id;
+          if ((*contents)[iRow]->map_key_to_action(pNmLvKeyDown->wVKey, &col_num, &action_id))
+            {
+              int update;
+              if (action_id >= 0)
+                update = (*contents)[iRow]->do_action(col_num, action_id);
+              else
+                {
+                  POINT p;
+                  RECT r;
+                  ListView_GetSubItemRect(hWndListView, iRow, col_num, LVIR_BOUNDS, &r);
+                  p.x = r.left;
+                  p.y = r.top;
+                  ClientToScreen(hWndListView, &p);
+
+                  update = popup_menu(iRow, col_num, p);
+                }
+
+              if (update > 0)
+                ListView_RedrawItems(hWndListView, iRow, iRow + update -1);
+            }
+        }
+    }
+    break;
+
   case TTN_GETDISPINFO:
     {
       // convert mouse position to item/subitem
diff --git a/ListView.h b/ListView.h
index b4fd1fd..97b138a 100644
--- a/ListView.h
+++ b/ListView.h
@@ -37,6 +37,7 @@ class ListViewLine
   virtual int get_indent() const = 0;
   virtual ActionList *get_actions(int col) const = 0;
   virtual int do_action(int col, int id) = 0;
+  virtual bool map_key_to_action(WORD vkey, int *col_num, int *action_id) const = 0;
 };
 
 typedef std::vector<ListViewLine *> ListViewContents;
diff --git a/PickCategoryLine.cc b/PickCategoryLine.cc
index 1dbecf2..c088cd4 100644
--- a/PickCategoryLine.cc
+++ b/PickCategoryLine.cc
@@ -88,3 +88,21 @@ PickCategoryLine::get_tooltip(int col_num) const
 {
   return "";
 }
+
+bool
+PickCategoryLine::map_key_to_action(WORD vkey, int *col_num, int *action_id) const
+{
+  switch (vkey)
+    {
+    case VK_SPACE:
+      *col_num = pkgname_col;
+      *action_id = 0;
+      return true;
+    case VK_APPS:
+      *col_num = new_col;
+      *action_id = -1;
+      return true;
+    }
+
+  return false;
+}
diff --git a/PickCategoryLine.h b/PickCategoryLine.h
index 9c5e996..9486904 100644
--- a/PickCategoryLine.h
+++ b/PickCategoryLine.h
@@ -40,6 +40,7 @@ public:
   int get_indent() const;
   ActionList *get_actions(int col) const;
   int do_action(int col, int action_id);
+  bool map_key_to_action(WORD vkey, int *col_num, int *action_id) const;
 
 private:
   CategoryTree * cat_tree;
diff --git a/PickPackageLine.cc b/PickPackageLine.cc
index 133720b..1f884be 100644
--- a/PickPackageLine.cc
+++ b/PickPackageLine.cc
@@ -160,3 +160,18 @@ PickPackageLine::get_indent() const
 {
   return indent;
 }
+
+bool
+PickPackageLine::map_key_to_action(WORD vkey, int *col_num, int *action_id) const
+{
+  switch (vkey)
+    {
+    case VK_SPACE:
+    case VK_APPS:
+      *col_num = new_col;
+      *action_id = -1;
+      return true;
+    }
+
+  return false;
+}
diff --git a/PickPackageLine.h b/PickPackageLine.h
index 12c7636..a35f399 100644
--- a/PickPackageLine.h
+++ b/PickPackageLine.h
@@ -36,6 +36,7 @@ public:
   int get_indent() const;
   ActionList *get_actions(int col_num) const;
   int do_action(int col, int action_id);
+  bool map_key_to_action(WORD vkey, int *col_num, int *action_id) const;
 private:
   packagemeta & pkg;
   PickView & theView;
diff --git a/libsolv.cc b/libsolv.cc
index ba54fc5..9e3b066 100644
--- a/libsolv.cc
+++ b/libsolv.cc
@@ -603,6 +603,22 @@ SolverPool::internalize()
     }
 }
 
+bool
+SolverPool::is_test_package(SolvableVersion sv)
+{
+  Solvable *solvable = pool_id2solvable(pool, sv.id);
+
+  for (RepoList::iterator i = repos.begin();
+       i != repos.end();
+       i++)
+    {
+      if (solvable->repo == i->second->repo)
+        return i->second->test;
+    }
+
+  return false;
+}
+
 void
 SolverTasks::setTasks()
 {
@@ -902,7 +918,9 @@ SolverSolution::solutionToTransactionList()
 
   transaction_free(t);
 
+#if DEBUG
   dumpTransactionList();
+#endif
 }
 
 void
diff --git a/libsolv.h b/libsolv.h
index 2eb1f24..4fd6d61 100644
--- a/libsolv.h
+++ b/libsolv.h
@@ -165,7 +165,7 @@ public:
 
   void internalize(void);
   void use_test_packages(bool use_test_packages);
-
+  bool is_test_package(SolvableVersion id);
 
 private:
   void init();
diff --git a/package_meta.cc b/package_meta.cc
index 9880bcb..cbb7388 100644
--- a/package_meta.cc
+++ b/package_meta.cc
@@ -499,7 +499,10 @@ packagemeta::list_actions(trusts const trust)
         }
       else
         {
-          al->add(i->Canonical_version().c_str(),
+          std::string label = i->Canonical_version().c_str();
+          if (packagedb::solver.is_test_package(*i))
+            label += " (Test)";
+          al->add(label,
                   -std::distance(versions.begin (), i),
                   (action == Install_action) && (*i == desired),
                   TRUE);
diff --git a/res.rc b/res.rc
index 10f20ba..70b0e57 100644
--- a/res.rc
+++ b/res.rc
@@ -358,7 +358,7 @@ BEGIN
                     SETUP_EXP_X, 30, SETUP_KPCE_W, 14
     CONTROL         "", IDC_HEADSEPARATOR, "Static", SS_BLACKFRAME | SS_SUNKEN,
                     0, 28, SETUP_STANDARD_DIALOG_W, 1
-    CONTROL         "", IDC_CHOOSE_LIST, WC_LISTVIEW, LVS_NOSORTHEADER | LVS_REPORT | LVS_SINGLESEL,
+    CONTROL         "", IDC_CHOOSE_LIST, WC_LISTVIEW, LVS_NOSORTHEADER | LVS_REPORT | LVS_SINGLESEL | WS_TABSTOP,
                     7, 47, SETUP_STANDARD_DIALOG_W - 14, 120, WS_EX_CLIENTEDGE
     CONTROL         "&Hide obsolete packages", IDC_CHOOSE_HIDE,
                     "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 7, 167, 160, 14


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-10-21 15:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-21 15:55 [setup - the official Cygwin setup program] branch master, updated. release_2.895 jturney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).