]> err.no Git - dpkg/commitdiff
dselect: New key to set all selections back to what's currently installed
authorColin Watson <cjwatson@debian.org>
Mon, 21 Jan 2008 09:19:01 +0000 (11:19 +0200)
committerGuillem Jover <guillem@debian.org>
Mon, 21 Jan 2008 09:19:29 +0000 (11:19 +0200)
Closes: #151540
ChangeLog
debian/changelog
dselect/bindings.cc
dselect/pkgcmds.cc
dselect/pkgkeys.cc
dselect/pkglist.h
man/dselect.1

index 5b48aacd6ff32ae248d301bf4203124e2ab08bc8..bc921b2b8533df62fac1da64883a8fa63f24e6a3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-01-21  Colin Watson  <cjwatson@debian.org>
+
+       * dselect/pkgkeys.cc (packagelist_korgbindings): Add 'C'.
+       (packagelist_kinterps): Add 'revertinstalled'.
+       * dselect/bindings.cc (keybindings::descriptions): Likewise.
+       * dselect/pkglist.h (class packagelist): Add kd_revertinstalled.
+       * dselect/pkgcmds.cc (packagelist::kd_revertinstalled): New method.
+       * man/dselect.1: Document new 'C' keybinding.
+
 2008-01-21  Guillem Jover  <guillem@debian.org>
 
        * dpkg-deb/build.c (getfi): Use m_malloc instead of malloc.
index fa4a629e06736e0558b5159b0f9a4703c8934bb9..c5d895fcc8165cd8bf0acbc0bb2fb5414bedf503 100644 (file)
@@ -3,6 +3,9 @@ dpkg (1.14.17) UNRELEASED; urgency=low
   [ Guillem Jover ]
   * Replace strdup plus error checking usage with a new m_strdup function.
     Closes: #379028
+  * Add new keybinding in dselect to restore all selections back to
+    whatever's currently installed. Closes: #151540
+    Thanks to Colin Watson.
 
  -- Guillem Jover <guillem@debian.org>  Mon, 21 Jan 2008 10:11:55 +0200
 
index 444c6609456533ad88d7dd3acb7b8518e7d10ccc..d6f32a748e4fdfda8de2adbd3586dc842183ead4 100644 (file)
@@ -158,6 +158,7 @@ const keybindings::description keybindings::descriptions[]= {
   { "revert",          N_("Revert to old state for all packages")                },
   { "revertsuggest",   N_("Revert to suggested state for all packages")          },
   { "revertdirect",    N_("Revert to directly requested state for all packages") },
+  { "revertinstalled", N_("Revert to currently installed state for all packages") },
   
   // Actions which apply only to lists of methods.
   { "select-and-quit", N_("Select currently-highlighted access method")          },
index 14a95c79c519e1fec1a010c08f7d635605961041..32744c894dccb64d34cd08f076d158ff845c1fe5 100644 (file)
@@ -264,6 +264,21 @@ void packagelist::kd_revertsuggest() {
   refreshlist(); redrawthisstate();
 }
 
+void
+packagelist::kd_revertinstalled()
+{
+  int i;
+
+  for (i = 0; i < nitems; i++) {
+    if (table[i]->pkg->name)
+      table[i]->selected = reallywant(pkginfo::want_sentinel, table[i]);
+    ldrawnstart = ldrawnend = -1;
+  }
+
+  refreshlist();
+  redrawthisstate();
+}
+
 /* fixme: configurable purge/deselect */
 
 void packagelist::kd_toggleinfo() {
index 98029e7441957933b935327ba9b807feb462884a..0b249eb75bbf5008bf52ffe94035a4dd48e7ce13 100644 (file)
@@ -72,6 +72,7 @@ const keybindings::interpretation packagelist_kinterps[] = {
   { "revert",           0,  &packagelist::kd_revert_abort,     qa_noquit           },
   { "revertsuggest",    0,  &packagelist::kd_revertsuggest,    qa_noquit           },
   { "revertdirect",     0,  &packagelist::kd_revertdirect,     qa_noquit           },
+  { "revertinstalled",  0,  &packagelist::kd_revertinstalled,  qa_noquit           },
   {  0,                 0,  0,                                qa_noquit           }
 };
 
@@ -144,6 +145,7 @@ const keybindings::orgbinding packagelist_korgbindings[]= {
   { 'R',            "revert"           },
   { 'U',            "revertsuggest"    },
   { 'D',            "revertdirect"     },
+  { 'C',            "revertinstalled"  },
                                        
   {  -1,             0                 }
 };
index 25a5cf3fcf80b589b252561209710f9d7bf28238..89ff8277c0614a217d9f1482b75d1ba647e4d5ce 100644 (file)
@@ -183,6 +183,7 @@ protected:
   void kd_revert_abort();
   void kd_revertsuggest();
   void kd_revertdirect();  
+  void kd_revertinstalled();
   void kd_morespecific();
   void kd_lessspecific();
   void kd_swaporder();
index 3f6dd0c73cc76d36c1b49fdc00bda9cf3df286ea..03e11d2c761cf8e692e2706b320ddddbf4732798 100644 (file)
@@ -423,6 +423,13 @@ keys, any possibly detrimental changes to the requested package
 selections can be backed out completely to the last established
 settings.
 .sp
+If you mistakenly establish some settings and wish to revert all the
+selections to what is currently installed on the system, press the
+\fB'C'\fP key.
+This is somewhat similar to using the unhold command on all packages,
+but provides a more obvious panic button in cases where the user
+pressed \fBenter\fP by accident.
+.sp
 .
 .SH BUGS
 The