Bug 42077 - "Mark all packages" feature
Summary: "Mark all packages" feature
Status: RESOLVED FIXED
Alias: None
Product: kpackage
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: Stefan Hetzl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-03 09:33 UTC by gabbe
Modified: 2003-04-30 12:47 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gabbe 2002-05-03 09:21:34 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kpackage
Version:           KDE 2.2.2 
Severity:          wishlist
Installed from:    RedHat RPMs
Compiler:          Not Specified
OS:                Linux
OS/Compiler notes: Not Specified

It would be nice with a feature to be able to select all packages in the selected view. Most of the time I use KPackage to update the installed RPM's on my system and to do this I have to manually mark every "updated" package and then klick "install marked". Would save me alot of klicking if I could mark them all at once.

/Gabriel

(Submitted via bugs.kde.org)
Comment 1 Stefan Hetzl 2003-04-30 12:47:57 UTC
Subject: kdeadmin

CVS commit by shetzl: 

add a "Packages->Mark All" menu item

CCMAIL:42077-done@bugs.kde.org


  M +6 -0      doc/kpackage/index.docbook   1.27
  M +10 -1     kpackage/kpackage.cpp   1.85
  M +4 -1      kpackage/kpackage.h   1.43
  M +1 -0      kpackage/kpackageui.rc   1.15
  M +16 -1     kpackage/managementWidget.cpp   1.66
  M +4 -1      kpackage/managementWidget.h   1.26


--- kdeadmin/doc/kpackage/index.docbook  #1.26:1.27
@@ -426,4 +426,10 @@
 <listitem><para>Unmarks all packages</para></listitem>
 </varlistentry>
+
+<varlistentry>
+<term><menuchoice> <guimenu>Packages</guimenu>
+<guimenuitem>Mark All</guimenuitem> </menuchoice></term>
+<listitem><para>Marks all packages that are members of the selected view</para></listitem>
+</varlistentry>
 </variablelist>
 

--- kdeadmin/kpackage/kpackage.cpp  #1.84:1.85
@@ -122,4 +122,8 @@ void KPKG::setupMenu()
                        SLOT(clearMarked()), actionCollection(), "kpack_clear"))->plugAccel(keys);
 
+  (void) (new KAction( i18n("Mark &All"), QString::null,
+                       0, kpackage,
+                       SLOT(markAll()), actionCollection(), "kpack_markall"))->plugAccel(keys);
+
   pack_install = new KAction( i18n("&Install"), QString::null,
                        0, kpackage->management,
@@ -427,4 +431,9 @@ void KPACKAGE::clearMarked()
 {
   management->clearMarked(management->treeList->firstChild());
+}
+
+void KPACKAGE::markAll()
+{
+  management->markAll(management->treeList->firstChild());
 }
 

--- kdeadmin/kpackage/kpackage.h  #1.42:1.43
@@ -125,4 +125,7 @@ public slots:
   // clear package Marks
 
+  void markAll();
+  // mark all packages in the selected view
+
   void expandTree();
   void collapseTree();

--- kdeadmin/kpackage/kpackageui.rc  #1.14:1.15
@@ -19,4 +19,5 @@
  <Separator/>
  <Action name="kpack_clear" />
+ <Action name="kpack_markall" />
  <Separator/>
  <Action name="install_single" />

--- kdeadmin/kpackage/managementWidget.cpp  #1.65:1.66
@@ -845,4 +845,19 @@ void managementWidget::clearMarked(KPLVI
 }
 
+void managementWidget::markAll(KPLVItem *item)
+{
+  while (item) {
+    if (item->childCount() > 0) {
+      markAll(item->firstChild());
+    }
+    else {
+      if (item->info->display(treeType)) {
+        item->setMark(true);
+      }
+    }
+    item = item->nextSibling();
+  }
+}
+
 void managementWidget::findMarked(KPLVItem *item)
 {

--- kdeadmin/kpackage/managementWidget.h  #1.25:1.26
@@ -93,4 +93,7 @@ public:
   // unmark marked tree items
 
+  // mark all packages in the selected view
+  void markAll(KPLVItem *item) ;
+
   void sweep() ;
   // sweep package tree adjusting visibility