Mailinglist Archive: yast-commit (815 mails)

< Previous Next >
[yast-commit] r39912 - in /trunk/qt: VERSION package/yast2-qt.changes src/pkg/YQPkgPatchFilterView.cc src/pkg/YQPkgPatchFilterView.h src/pkg/YQPkgPatchList.cc src/pkg/YQPkgPatchList.h
  • From: sh-sh-sh@xxxxxxxxxxxxxxxx
  • Date: Thu, 02 Aug 2007 15:36:24 -0000
  • Message-id: <20070802153625.27502B590D@xxxxxxxxxxxxxxxx>
Author: sh-sh-sh
Date: Thu Aug  2 17:36:24 2007
New Revision: 39912

URL: http://svn.opensuse.org/viewcvs/yast?rev=39912&view=rev
Log:
Fate #302052: Restrict patches view to show only update stack
patches if there are any

Modified:
    trunk/qt/VERSION
    trunk/qt/package/yast2-qt.changes
    trunk/qt/src/pkg/YQPkgPatchFilterView.cc
    trunk/qt/src/pkg/YQPkgPatchFilterView.h
    trunk/qt/src/pkg/YQPkgPatchList.cc
    trunk/qt/src/pkg/YQPkgPatchList.h

Modified: trunk/qt/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/VERSION?rev=39912&r1=39911&r2=39912&view=diff
==============================================================================
--- trunk/qt/VERSION (original)
+++ trunk/qt/VERSION Thu Aug  2 17:36:24 2007
@@ -1 +1 @@
-2.15.7
+2.15.8

Modified: trunk/qt/package/yast2-qt.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/package/yast2-qt.changes?rev=39912&r1=39911&r2=39912&view=diff
==============================================================================
--- trunk/qt/package/yast2-qt.changes (original)
+++ trunk/qt/package/yast2-qt.changes Thu Aug  2 17:36:24 2007
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Thu Aug  2 17:34:26 CEST 2007 - sh@xxxxxxx
+
+- V 2.17.8
+- Fate #302052: Restrict patches view to show only update stack
+  patches if there are any 
+
+-------------------------------------------------------------------
 Tue Jul 24 10:59:06 CEST 2007 - sh@xxxxxxx
 
 - Fixed bug #285915: Can't cancel package search

Modified: trunk/qt/src/pkg/YQPkgPatchFilterView.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/pkg/YQPkgPatchFilterView.cc?rev=39912&r1=39911&r2=39912&view=diff
==============================================================================
--- trunk/qt/src/pkg/YQPkgPatchFilterView.cc (original)
+++ trunk/qt/src/pkg/YQPkgPatchFilterView.cc Thu Aug  2 17:36:24 2007
@@ -53,6 +53,7 @@
     : QVBox( parent )
 {
     QVBox * vbox;
+    _haveUpdateStackPatches    = YQPkgPatchList::haveUpdateStackPatches();
 
     _splitter                  = new QSplitter( QSplitter::Vertical, this );   CHECK_PTR( _splitter    );
     vbox                       = new QVBox( _splitter );                       CHECK_PTR( vbox         );
@@ -68,9 +69,15 @@
     _patchFilter               = new QComboBox( hbox );
     CHECK_PTR( _patchFilter );
 
-    _patchFilter->insertItem( _( "Installable Patches" ),                 0 );
-    _patchFilter->insertItem( _( "Installable and Installed Patches" ),   1 );
-    _patchFilter->insertItem( _( "All Patches" ),                         2 );
+    int index = 0;
+    
+    if ( _haveUpdateStackPatches )
+       // Translators: This is about patches that patch the update engine (libzypp, YaST) itself
+       _patchFilter->insertItem( _( "Update Stack Patches" ),                     index++ );
+       
+    _patchFilter->insertItem( _( "Installable Patches" ),                 index++ );
+    _patchFilter->insertItem( _( "Installable and Installed Patches"      ),      index++ );
+    _patchFilter->insertItem( _( "All Patches" ),                         index++ );
     _patchFilter->setCurrentItem( 0 );
     _patchFilter->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert
     label->setBuddy( _patchFilter );
@@ -118,6 +125,7 @@
     connect( _patchList,       SIGNAL( statusChanged()                 ),
             this,              SLOT  ( updateTotalDownloadSize()       ) );
 
+    fillPatchList();
     updateTotalDownloadSize();
 }
 
@@ -210,8 +218,14 @@
 void
 YQPkgPatchFilterView::fillPatchList()
 {
-    switch ( _patchFilter->currentItem() )
+    int currentIndex = _patchFilter->currentItem();
+
+    if ( _haveUpdateStackPatches )
+       currentIndex--;
+    
+    switch ( currentIndex )
     {
+       case -1:        _patchList->setFilterCriteria( YQPkgPatchList::UpdateStackPatches          );        break;
        case 0:         _patchList->setFilterCriteria( YQPkgPatchList::RelevantPatches                  );   break;
        case 1:         _patchList->setFilterCriteria( YQPkgPatchList::RelevantAndInstalledPatches );        break;
        case 2:         _patchList->setFilterCriteria( YQPkgPatchList::AllPatches               );   break;

Modified: trunk/qt/src/pkg/YQPkgPatchFilterView.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/pkg/YQPkgPatchFilterView.h?rev=39912&r1=39911&r2=39912&view=diff
==============================================================================
--- trunk/qt/src/pkg/YQPkgPatchFilterView.h (original)
+++ trunk/qt/src/pkg/YQPkgPatchFilterView.h Thu Aug  2 17:36:24 2007
@@ -91,6 +91,7 @@
     QLabel *                   _totalDownloadSize;
     
     YQPkgSelMapper             _selMapper;
+    bool                       _haveUpdateStackPatches;
 };
 
 

Modified: trunk/qt/src/pkg/YQPkgPatchList.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/pkg/YQPkgPatchList.cc?rev=39912&r1=39911&r2=39912&view=diff
==============================================================================
--- trunk/qt/src/pkg/YQPkgPatchList.cc (original)
+++ trunk/qt/src/pkg/YQPkgPatchList.cc Thu Aug  2 17:36:24 2007
@@ -34,7 +34,8 @@
 #include "YQPkgTextDialog.h"
 
 
-#define VERBOSE_PATCH_LIST     1
+#define VERBOSE_PATCH_LIST                     1
+#define DEBUG_SHOW_ALL_UPDATE_STACK_PATCHES    0
 
 
 typedef zypp::ui::PatchContents                        ZyppPatchContents;
@@ -72,7 +73,6 @@
             this,      SLOT  ( filter()                                    ) );
 
     setSorting( categoryCol() );
-    fillList();
 
     y2debug( "Creating patch list done" );
 }
@@ -122,6 +122,35 @@
 
            switch ( _filterCriteria )
            {
+               case UpdateStackPatches:
+
+                   if ( zyppPatch->affects_pkg_manager() )
+                   {
+#if DEBUG_SHOW_ALL_UPDATE_STACK_PATCHES
+                       displayPatch = true;
+#endif
+                       if ( selectable->hasCandidateObj() &&
+                            selectable->candidatePoolItem().status().isNeeded() )
+                       {
+                           displayPatch = true;
+
+                           y2milestone( "Found YaST patch that should be installed: %s - %s",
+                                        zyppPatch->name().c_str(),
+                                        zyppPatch->summary().c_str() );
+                       }
+
+                       if ( selectable->hasInstalledObj() &&
+                            selectable->installedPoolItem().status().isIncomplete() ) // patch broken?
+                       {
+                           displayPatch = true;
+
+                           y2warning( "Installed YaST patch is broken: %s - %s",
+                                      zyppPatch->name().c_str(),
+                                      zyppPatch->summary().c_str() );
+                       }
+                   }
+                   break;
+
                case RelevantPatches:   // needed + broken + satisfied (but not installed)
 
                    if ( selectable->hasInstalledObj() ) // installed?
@@ -347,6 +376,34 @@
 }
 
 
+bool
+YQPkgPatchList::haveUpdateStackPatches()
+{
+    for ( ZyppPoolIterator it = zyppPatchesBegin();
+         it != zyppPatchesEnd();
+         ++it )
+    {
+       ZyppSel selectable = *it;
+       ZyppPatch zyppPatch = tryCastToZyppPatch( selectable->theObj() );
+
+       if ( zyppPatch && zyppPatch->affects_pkg_manager() )
+       {
+#if DEBUG_SHOW_ALL_UPDATE_STACK_PATCHES
+           return true;
+#else
+           if ( selectable->hasCandidateObj() &&
+                selectable->candidatePoolItem().status().isNeeded() )
+           {
+               return true;
+           }
+#endif
+       }
+    }
+
+    return false;
+}
+
+
 YQPkgPatchListItem *
 YQPkgPatchList::selection() const
 {

Modified: trunk/qt/src/pkg/YQPkgPatchList.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/pkg/YQPkgPatchList.h?rev=39912&r1=39911&r2=39912&view=diff
==============================================================================
--- trunk/qt/src/pkg/YQPkgPatchList.h (original)
+++ trunk/qt/src/pkg/YQPkgPatchList.h Thu Aug  2 17:36:24 2007
@@ -67,6 +67,7 @@
 
     enum FilterCriteria
     {
+       UpdateStackPatches,             // zypp or YaST2
        RelevantPatches,                // needed + broken
        RelevantAndInstalledPatches,    // needed + broken + installed
        AllPatches                      // all
@@ -112,6 +113,12 @@
 public:
 
     /**
+     * Return 'true' if there is any patch for the update stack in the pool
+     * that is not installed yet or that could be updated.
+     **/
+    static bool haveUpdateStackPatches();
+
+    /**
      * Set the filter criteria for fillList().
      **/
     void setFilterCriteria( FilterCriteria filterCriteria );

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages