Hello community, here is the log from the commit of package yast2-qt-pkg for openSUSE:Factory checked in at Wed Oct 5 17:48:54 CEST 2011.
-------- --- openSUSE:Factory/yast2-qt-pkg/yast2-qt-pkg.changes 2011-09-23 12:53:21.000000000 +0200 +++ /mounts/work_src_done/STABLE/yast2-qt-pkg/yast2-qt-pkg.changes 2011-10-05 09:34:44.000000000 +0200 @@ -1,0 +2,7 @@ +Wed Oct 5 08:34:23 CEST 2011 - [email protected] + +- Applied Stano's patch to make installation history accessible + from Yast GUI +- 2.21.8 + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- yast2-qt-pkg-2.21.7.tar.bz2 New: ---- yast2-qt-pkg-2.21.8.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-qt-pkg.spec ++++++ --- /var/tmp/diff_new_pack.DXsSUj/_old 2011-10-05 17:48:51.000000000 +0200 +++ /var/tmp/diff_new_pack.DXsSUj/_new 2011-10-05 17:48:51.000000000 +0200 @@ -15,17 +15,18 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + + Name: yast2-qt-pkg -Version: 2.21.7 +Version: 2.21.8 Release: 0 - BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-qt-pkg-2.21.7.tar.bz2 +Source0: yast2-qt-pkg-2.21.8.tar.bz2 Group: System/YaST License: GPL v2 or later BuildRequires: docbook-xsl-stylesheets doxygen libdrm-devel libjpeg-devel libxcrypt-devel -BuildRequires: libxslt perl-XML-Writer libqt4-devel sgml-skel update-desktop-files +BuildRequires: libqt4-devel libxslt perl-XML-Writer sgml-skel update-desktop-files Summary: YaST2 - Graphical User Interface BuildRequires: yast2-devtools >= 2.16.3 @@ -68,7 +69,6 @@ %clean rm -rf "$RPM_BUILD_ROOT" - %files %defattr (-, root, root) %doc COPYING ++++++ yast2-qt-pkg-2.21.7.tar.bz2 -> yast2-qt-pkg-2.21.8.tar.bz2 ++++++ ++++ 2026 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-qt-pkg-2.21.7/VERSION.cmake new/yast2-qt-pkg-2.21.8/VERSION.cmake --- old/yast2-qt-pkg-2.21.7/VERSION.cmake 2011-09-20 16:47:17.000000000 +0200 +++ new/yast2-qt-pkg-2.21.8/VERSION.cmake 2011-10-05 10:29:44.000000000 +0200 @@ -1,3 +1,3 @@ SET(VERSION_MAJOR "2") SET(VERSION_MINOR "21") -SET(VERSION_PATCH "7") +SET(VERSION_PATCH "8") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-qt-pkg-2.21.7/package/yast2-qt-pkg.changes new/yast2-qt-pkg-2.21.8/package/yast2-qt-pkg.changes --- old/yast2-qt-pkg-2.21.7/package/yast2-qt-pkg.changes 2011-09-20 16:47:17.000000000 +0200 +++ new/yast2-qt-pkg-2.21.8/package/yast2-qt-pkg.changes 2011-10-05 10:29:44.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Oct 5 08:34:23 CEST 2011 - [email protected] + +- Applied Stano's patch to make installation history accessible + from Yast GUI +- 2.21.8 + +------------------------------------------------------------------- Tue Sep 20 14:42:24 CEST 2011 - [email protected] - respect stylesheet in package selector diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-qt-pkg-2.21.7/src/CMakeLists.txt new/yast2-qt-pkg-2.21.8/src/CMakeLists.txt --- old/yast2-qt-pkg-2.21.7/src/CMakeLists.txt 2011-09-20 16:47:17.000000000 +0200 +++ new/yast2-qt-pkg-2.21.8/src/CMakeLists.txt 2011-10-05 10:29:44.000000000 +0200 @@ -35,6 +35,7 @@ YQPkgFileListView.cc YQPkgFilterTab.cc YQPkgGenericDetailsView.cc + YQPkgHistoryDialog.cc YQPkgLangList.cc YQPkgList.cc YQPkgObjList.cc diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-qt-pkg-2.21.7/src/YQPackageSelector.cc new/yast2-qt-pkg-2.21.8/src/YQPackageSelector.cc --- old/yast2-qt-pkg-2.21.7/src/YQPackageSelector.cc 2011-09-20 16:47:17.000000000 +0200 +++ new/yast2-qt-pkg-2.21.8/src/YQPackageSelector.cc 2011-10-05 10:29:44.000000000 +0200 @@ -90,6 +90,7 @@ #include "YQPkgDiskUsageWarningDialog.h" #include "YQPkgFileListView.h" #include "YQPkgFilterTab.h" +#include "YQPkgHistoryDialog.h" #include "YQPkgLangList.h" #include "YQPkgList.h" #include "YQPkgPackageKitGroupsFilterView.h" @@ -850,6 +851,7 @@ _extrasMenu->addAction( _( "Show &Products" ), this, SLOT( showProducts() ) ); _extrasMenu->addAction( _( "Show P&ackage Changes" ), this, SLOT( showAutoPkgList() ), Qt::CTRL + Qt::Key_A ); + _extrasMenu->addAction( _( "Show &History" ), this, SLOT( showHistory() ) ); _extrasMenu->addSeparator(); @@ -1510,6 +1512,12 @@ void +YQPackageSelector::showHistory() +{ + YQPkgHistoryDialog::showHistoryDialog(); +} + +void YQPackageSelector::installDevelPkgs() { installSubPkgs( "-devel" ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-qt-pkg-2.21.7/src/YQPackageSelector.h new/yast2-qt-pkg-2.21.8/src/YQPackageSelector.h --- old/yast2-qt-pkg-2.21.7/src/YQPackageSelector.h 2011-09-20 16:47:17.000000000 +0200 +++ new/yast2-qt-pkg-2.21.8/src/YQPackageSelector.h 2011-10-05 10:29:44.000000000 +0200 @@ -238,6 +238,11 @@ * Show all products in a popup dialog. **/ void showProducts(); + + /** + * Show dialog for pkgmgr history + */ + void showHistory(); /** * a link in the repo upgrade label was clicked diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-qt-pkg-2.21.7/src/YQPkgHistoryDialog.cc new/yast2-qt-pkg-2.21.8/src/YQPkgHistoryDialog.cc --- old/yast2-qt-pkg-2.21.7/src/YQPkgHistoryDialog.cc 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-qt-pkg-2.21.8/src/YQPkgHistoryDialog.cc 2011-10-05 10:29:44.000000000 +0200 @@ -0,0 +1,320 @@ +/************************************************************************** +Copyright (C) 2000 - 2011 Novell, Inc. +All Rights Reserved. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +**************************************************************************/ + + +/*---------------------------------------------------------------------\ +| | +| __ __ ____ _____ ____ | +| \ \ / /_ _/ ___|_ _|___ \ | +| \ V / _` \___ \ | | __) | | +| | | (_| |___) || | / __/ | +| |_|\__,_|____/ |_| |_____| | +| | +| core system | +| (C) SuSE GmbH | +\----------------------------------------------------------------------/ + + File: YQPkgHistoryDialog.cc + + Author: Stanislav Visnovsky <[email protected]> + + Textdomain "qt-pkg" + +/-*/ + +#define YUILogComponent "qt-pkg" +#include "YUILog.h" + +#include <QApplication> +#include <QDesktopWidget> +#include <QHBoxLayout> +#include <QLabel> +#include <QPushButton> +#include <QSplitter> +#include <QStyle> +#include <QList> +#include <QBoxLayout> +#include <QTreeWidget> +#include <QMessageBox> + +#include <zypp/parser/HistoryLogReader.h> +#include <zypp/Date.h> +#include <zypp/Edition.h> + +#include <boost/ref.hpp> + +#include "YQPkgHistoryDialog.h" +#include "YQPkgList.h" +#include "QY2LayoutUtils.h" +#include "YQi18n.h" +#include "YQUI.h" +#include "YQIconPool.h" +#include "utf8.h" + + +#define SPACING 2 // between subwidgets +#define MARGIN 4 // around the widget + +#define FILENAME "/var/log/zypp/history" + +YQPkgHistoryDialog::YQPkgHistoryDialog( QWidget * parent ) + : QDialog( parent ) +{ + // Dialog title + setWindowTitle( _( "Package History" ) ); + + // Enable dialog resizing even without window manager + setSizeGripEnabled( true ); + + // Layout for the dialog (can't simply insert a QVBox) + + QVBoxLayout * layout = new QVBoxLayout(); + Q_CHECK_PTR( layout ); + setLayout(layout); + layout->setMargin(MARGIN); + layout->setSpacing(SPACING); + + setMinimumSize (300,400); + + QLabel * label = new QLabel ( _("Show History (/var/log/zypp/history)" ), this ); + label->setFixedHeight (label->sizeHint ().height ()); + layout->addWidget (label); + + // VBox for splitter + QSplitter * splitter = new QSplitter( Qt::Horizontal, this ); + Q_CHECK_PTR( splitter ); + layout->addWidget( splitter ); + + // History view + _dates = new QTreeWidget (splitter); + _dates->setColumnCount (1); + _dates->setHeaderLabels ( QStringList( _("Date") ) ); + + _actions = new QTreeWidget (splitter); + _actions->setColumnCount (2); + _actions->setHeaderLabels ( QStringList( _("Action") ) << _("Version/URL") ); + _actions->setColumnWidth (0, 200); + + splitter->setStretchFactor (0, 1); + splitter->setStretchFactor (1, 2); + + // Button box (to center the single button) + + QHBoxLayout * hbox = new QHBoxLayout(); + Q_CHECK_PTR( hbox ); + hbox->setSpacing( SPACING ); + hbox->setMargin ( MARGIN ); + layout->addLayout( hbox ); + hbox->addStretch(); + + // "OK" button + + QPushButton * button = new QPushButton( _( "&Close" ), this ); + Q_CHECK_PTR( button ); + hbox->addWidget(button); + button->setDefault( true ); + + connect( button, SIGNAL( clicked() ), + this, SLOT ( accept() ) ); + + connect( _dates, SIGNAL( itemSelectionChanged () ), + this, SLOT ( moveToDate () ) ); + + connect( _actions, SIGNAL( itemSelectionChanged() ), + this, SLOT ( moveToAction () ) ); + + initialize (); +} + +QSize +YQPkgHistoryDialog::sizeHint() const +{ + QRect available = qApp->desktop()->availableGeometry( (QWidget *) this ); + QSize size = QDialog::sizeHint(); + size = size.boundedTo( QSize( available.width(), available.height() ) ); + + return size; +} + + +void +YQPkgHistoryDialog::showHistoryDialog() +{ + YQPkgHistoryDialog dialog( 0 ); + dialog.exec(); +} + +QPixmap actionIcon (zypp::HistoryActionID id) +{ + switch (id.toEnum ()) { + case zypp::HistoryActionID::INSTALL_e : return YQIconPool::pkgInstall (); + case zypp::HistoryActionID::REMOVE_e : return YQIconPool::pkgDel (); + case zypp::HistoryActionID::REPO_REMOVE_e : return YQIconPool::treeMinus (); + case zypp::HistoryActionID::REPO_ADD_e : return YQIconPool::treePlus (); + default: return QPixmap (); + } + + return QPixmap (); +} + +struct HistoryItemCollector +{ + QTreeWidget* actions, * dates; + std::string _last; + QTreeWidgetItem* date_start; + + bool operator()( const zypp::HistoryItem::Ptr & item_ptr ) + { + std::string d = item_ptr->date.form("%e %B %Y"); + if (d != _last) + { + _last = d; + date_start = new QTreeWidgetItem (actions, QStringList(QString(d.c_str()))); + date_start->setExpanded (true); + actions-> insertTopLevelItem ( 0, date_start ); + dates-> insertTopLevelItem ( 0, new QTreeWidgetItem (dates, QStringList(QString(d.c_str())))); + } + + QStringList columns; + if ( item_ptr->action.toEnum () == zypp::HistoryActionID::INSTALL_e ) + { + zypp::HistoryItemInstall* item = static_cast <zypp::HistoryItemInstall *> (item_ptr.get()); + + columns << QString(item->name.c_str()); + columns << QString(item->edition.version().c_str()); + } else + if ( item_ptr->action.toEnum () == zypp::HistoryActionID::REMOVE_e ) + { + zypp::HistoryItemRemove* item = static_cast <zypp::HistoryItemRemove *> (item_ptr.get()); + + columns << QString(item->name.c_str()); + columns << QString(item->edition.version().c_str()); + } else + if ( item_ptr->action.toEnum () == zypp::HistoryActionID::REPO_ADD_e ) + { + zypp::HistoryItemRepoAdd* item = static_cast <zypp::HistoryItemRepoAdd *> (item_ptr.get()); + + columns << QString(item->alias.c_str()); + columns << QString(item->url.asString().c_str()); + } else + if ( item_ptr->action.toEnum () == zypp::HistoryActionID::REPO_REMOVE_e ) + { + zypp::HistoryItemRepoRemove* item = static_cast <zypp::HistoryItemRepoRemove *> (item_ptr.get()); + + columns << QString(item->alias.c_str()); + } else + if ( item_ptr->action.toEnum () == zypp::HistoryActionID::REPO_CHANGE_ALIAS_e ) + { + zypp::HistoryItemRepoAliasChange* item = static_cast <zypp::HistoryItemRepoAliasChange *> (item_ptr.get()); + + columns << QString( (item->oldalias + " -> " + item->newalias).c_str()); + } else + if ( item_ptr->action.toEnum () == zypp::HistoryActionID::REPO_CHANGE_URL_e ) + { + zypp::HistoryItemRepoUrlChange* item = static_cast <zypp::HistoryItemRepoUrlChange *> (item_ptr.get()); + + columns << QString(item->alias.c_str()); + columns << QString(item->newurl.asString().c_str()); + } + + QTreeWidgetItem *action = new QTreeWidgetItem (date_start, columns); + action->setIcon (0,actionIcon (item_ptr->action) ); + return true; + } +}; + + +void +YQPkgHistoryDialog::initialize() +{ + HistoryItemCollector ic; + + ic.actions = _actions; + ic.dates = _dates; + zypp::parser::HistoryLogReader reader(FILENAME, boost::ref(ic)); + + try + { + reader.readAll(); + } + catch (const zypp::Exception & exception) + { + yuiWarning() << "CAUGHT zypp exception: " << exception.asUserHistory() << endl; + + QMessageBox msgBox; + + // Translators: This is a (short) text indicating that something went + // wrong while trying to read history file. + + QString heading = _( "Unable to read history" ); + + if ( heading.length() < 25 ) // Avoid very narrow message boxes + { + QString blanks; + blanks.fill( ' ', 50 - heading.length() ); + heading += blanks; + } + + msgBox.setText( heading ); + msgBox.setIcon( QMessageBox::Warning ); + msgBox.setInformativeText( fromUTF8( exception.asUserHistory() ) ); + msgBox.exec(); + } +} + + +void +YQPkgHistoryDialog::moveToDate () +{ + if (signalsBlocked() ) return; + QString item = _dates->selectedItems().first()->text(0); + QList<QTreeWidgetItem *> items = _actions->findItems (item, Qt::MatchExactly, 0); + + if( items.size () > 0 ) + { + blockSignals(true); + _actions->expandItem (items.first()); + _actions->setCurrentItem (items.first()); + _actions->scrollToItem( items.first(), QAbstractItemView::PositionAtTop ); + blockSignals(false); + } +} + +void +YQPkgHistoryDialog::moveToAction () +{ + if (signalsBlocked() ) return; + QTreeWidgetItem* item = _actions->selectedItems().first(); + + // if this is not top-level item, better pick top-level one + if (item->parent ()) + item = item->parent (); + + QList<QTreeWidgetItem *> items = _dates->findItems (item->text(0), Qt::MatchExactly | Qt::MatchRecursive, 0); + + if( items.size () > 0 ) + { + blockSignals(true); + _dates->setCurrentItem (items.first()); + blockSignals(false); + } +} + +#include "YQPkgHistoryDialog.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-qt-pkg-2.21.7/src/YQPkgHistoryDialog.h new/yast2-qt-pkg-2.21.8/src/YQPkgHistoryDialog.h --- old/yast2-qt-pkg-2.21.7/src/YQPkgHistoryDialog.h 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-qt-pkg-2.21.8/src/YQPkgHistoryDialog.h 2011-10-05 10:29:44.000000000 +0200 @@ -0,0 +1,95 @@ +/************************************************************************** +Copyright (C) 2000 - 2011 Novell, Inc. +All Rights Reserved. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +**************************************************************************/ + + +/*---------------------------------------------------------------------\ +| | +| __ __ ____ _____ ____ | +| \ \ / /_ _/ ___|_ _|___ \ | +| \ V / _` \___ \ | | __) | | +| | | (_| |___) || | / __/ | +| |_|\__,_|____/ |_| |_____| | +| | +| core system | +| (C) SuSE GmbH | +\----------------------------------------------------------------------/ + + File: YQPkgHistoryDialog.h + + Author: Stanislav Visnovsky <[email protected]> + +/-*/ + + +#ifndef YQPkgHistoryDialog_h +#define YQPkgHistoryDialog_h + +#include <qdialog.h> + + +class YQPkgList; +class YQPkgHistoryView; +class QTreeWidget; + + +/** + * Pkg status and History as a standalone popup dialog. + **/ +class YQPkgHistoryDialog : public QDialog +{ + Q_OBJECT + +public: + + /** + * Static convenience method: Post a History dialog for pkg 'pkgName'. + **/ + static void showHistoryDialog(); + + /** + * Returns the preferred size. + * + * Reimplemented from QWidget to limit the dialog to the screen dimensions. + **/ + virtual QSize sizeHint () const; + + +protected: + + void initialize (); + + /** + * Constructor: Creates a History dialog for all packages that match 'pkgName'. + **/ + YQPkgHistoryDialog( QWidget * parent ); + + // Data members + + QTreeWidget * _dates; + QTreeWidget * _actions; + +public slots: + void moveToDate (); + void moveToAction (); + +}; + + +#endif // ifndef YQPkgHistoryDialog_h diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-qt-pkg-2.21.7/yast2-qt-pkg.spec.in new/yast2-qt-pkg-2.21.8/yast2-qt-pkg.spec.in --- old/yast2-qt-pkg-2.21.7/yast2-qt-pkg.spec.in 2011-09-20 16:47:17.000000000 +0200 +++ new/yast2-qt-pkg-2.21.8/yast2-qt-pkg.spec.in 2011-10-05 10:29:44.000000000 +0200 @@ -1,19 +1,5 @@ -# -# spec file for package yast2-qt-pkg -# -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - -# Please submit bugfixes or comments via http://bugs.opensuse.org/ -# +@HEADERCOMMENT@ + @HEADER@ Group: System/YaST continue with "q"... Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
