Hello community,
here is the log from the commit of package yast2-gtk for openSUSE:Factory
checked in at Mon Dec 20 15:41:25 CET 2010.
--------
--- yast2-gtk/yast2-gtk.changes 2010-11-10 19:07:19.000000000 +0100
+++ yast2-gtk/yast2-gtk.changes 2010-12-15 14:18:52.000000000 +0100
@@ -1,0 +2,20 @@
+Tue Dec 15 13:13:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt
+
+- 2.21.84
+- code to close packagekit deamon when running will be moved
+to the sw_single ycp level (bnc#659522)
+
+-------------------------------------------------------------------
+Thu Dec 09 23:33:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt
+
+- 2.21.83
+- fix: can't use combo-box popup menu when items are too
+long (bnc#595560).
+- table fix: not showing all popup entries on right-click.
+- log view fix: fixed flickering, and allow user to freely
+scroll.
+- sw_single: use same height for "all packages" item, and
+keep items sorted by name when sorting by status or another
+column.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-gtk-2.21.82.tar.bz2
New:
----
yast2-gtk-2.21.84.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-gtk.spec ++++++
--- /var/tmp/diff_new_pack.mJuMKT/_old 2010-12-20 15:02:47.000000000 +0100
+++ /var/tmp/diff_new_pack.mJuMKT/_new 2010-12-20 15:02:47.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-gtk (Version 2.21.82)
+# spec file for package yast2-gtk (Version 2.21.84)
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -18,11 +18,11 @@
Name: yast2-gtk
-Version: 2.21.82
+Version: 2.21.84
Release: 1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-gtk-2.21.82.tar.bz2
+Source0: yast2-gtk-2.21.84.tar.bz2
Url: http://en.opensuse.org/YaST2-GTK
Summary: YaST2 - GTK+ Graphical User Interface
Group: System/YaST
@@ -75,6 +75,5 @@
%defattr (-, root, root)
%dir %_libdir/YaST2
%_libdir/YaST2/plugin/
-# %_prefix/share/YaST2/gtk/
%changelog
++++++ yast2-gtk-2.21.82.tar.bz2 -> yast2-gtk-2.21.84.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/ChangeLog new/yast2-gtk-2.21.84/ChangeLog
--- old/yast2-gtk-2.21.82/ChangeLog 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/ChangeLog 2010-12-15 14:18:09.000000000 +0100
@@ -1,3 +1,49 @@
+2010-12-15 Ricardo Cruz
+
+ * src/YGUI.cc: got rid of code to exit package kit
+ daemon.
+
+2010-12-09 Ricardo Cruz
+
+ * src/YGComboBox.cc: bug fix 655977: don't layout
+ combo-box popup menu as a table.
+
+2010-12-09 Ricardo Cruz
+
+ * src/pkg/yzyppwrapper.cc: bug fix: when sorting
+ equal attributes maintain previous arranging order.
+
+2010-12-08 Ricardo Cruz
+
+ * src/ygtktreeview.c: bug fix: now showing menu
+ entries when pressing an item. Reported by Atri.
+
+ * src/pkg/ygtkpkgfilterview.cc: use same height for
+ the "All packages" as is used by the categories.
+
+2010-12-08 Ricardo Cruz
+
+ * src/ygtkpkgvestigialdialog.cc: fixed remove-all
+ button. Fixed progress bar's progress. Refresh more
+ frequenltly. Smaller progress bar.
+
+ * src/ygtkpkglistview.h/cc: new method: getList().
+
+2010-12-05 Ricardo Cruz
+
+ * src/ygtkpkgvestigialdialog.h/cc: now functional.
+
+ * src/YGText.cc: reduced flickering of LogView,
+ and allowed user to freely scroll it.
+
+2010-12-05 Ricardo Cruz
+
+ * src/ygtkpkgvestigialdialog.h/cc: show unneeded
+ packages (not done yet), as requested by Atri.
+
+ * src/YGUI.cc: tell package kit to shut down if
+ running, as requested by Atri.
+
2010-11-10 Ricardo Cruz
* src/pkg/ygtkpkgfilterview.cc: use bold for "all
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/VERSION new/yast2-gtk-2.21.84/VERSION
--- old/yast2-gtk-2.21.82/VERSION 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/VERSION 2010-12-15 14:18:10.000000000 +0100
@@ -1 +1 @@
-2.21.82
+2.21.84
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/VERSION.cmake new/yast2-gtk-2.21.84/VERSION.cmake
--- old/yast2-gtk-2.21.82/VERSION.cmake 2010-11-10 19:09:14.000000000 +0100
+++ new/yast2-gtk-2.21.84/VERSION.cmake 2010-12-15 14:18:09.000000000 +0100
@@ -1,3 +1,3 @@
SET(VERSION_MAJOR "2")
SET(VERSION_MINOR "21")
-SET(VERSION_PATCH "82")
+SET(VERSION_PATCH "84")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/package/yast2-gtk.changes new/yast2-gtk-2.21.84/package/yast2-gtk.changes
--- old/yast2-gtk-2.21.82/package/yast2-gtk.changes 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/package/yast2-gtk.changes 2010-12-15 14:18:09.000000000 +0100
@@ -1,4 +1,24 @@
-------------------------------------------------------------------
+Tue Dec 15 13:13:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt
+
+- 2.21.84
+- code to close packagekit deamon when running will be moved
+to the sw_single ycp level (bnc#659522)
+
+-------------------------------------------------------------------
+Thu Dec 09 23:33:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt
+
+- 2.21.83
+- fix: can't use combo-box popup menu when items are too
+long (bnc#595560).
+- table fix: not showing all popup entries on right-click.
+- log view fix: fixed flickering, and allow user to freely
+scroll.
+- sw_single: use same height for "all packages" item, and
+keep items sorted by name when sorting by status or another
+column.
+
+-------------------------------------------------------------------
Wed Nov 10 18:07:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt
- 2.21.82
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/package/yast2-gtk.spec new/yast2-gtk-2.21.84/package/yast2-gtk.spec
--- old/yast2-gtk-2.21.82/package/yast2-gtk.spec 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/package/yast2-gtk.spec 2010-12-15 14:18:09.000000000 +0100
@@ -1,16 +1,16 @@
#
-# spec file for package yast2-gtk (Version 2.21.81)
+# spec file for package yast2-gtk (Version 2.21.83)
#
# norootforbuild;,
Name: yast2-gtk
-Version: 2.21.81
+Version: 2.21.83
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-gtk-2.21.81.tar.bz2
+Source0: yast2-gtk-2.21.83.tar.bz2
Url: http://en.opensuse.org/YaST2-GTK
Summary: YaST2 - GTK+ Graphical User Interface
Group: System/YaST
@@ -63,7 +63,6 @@
%defattr (-, root, root)
%dir %_libdir/YaST2
%_libdir/YaST2/plugin/
-# %_prefix/share/YaST2/gtk/
%changelog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/YGComboBox.cc new/yast2-gtk-2.21.84/src/YGComboBox.cc
--- old/yast2-gtk-2.21.82/src/YGComboBox.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/YGComboBox.cc 2010-12-15 14:18:09.000000000 +0100
@@ -21,10 +21,9 @@
{
gtk_combo_box_set_model (getComboBox(), getModel());
GtkCellRenderer* cell;
- if (editable) {
+ if (editable)
gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (getWidget()),
YGSelectionModel::LABEL_COLUMN);
- }
else {
cell = gtk_cell_renderer_text_new ();
gtk_cell_layout_pack_end (GTK_CELL_LAYOUT (getWidget()), cell, TRUE);
@@ -37,9 +36,6 @@
"pixbuf", YGSelectionModel::ICON_COLUMN, NULL);
connect (getWidget(), "changed", G_CALLBACK (selected_changed_cb), this);
- // realize doesn't seem reliable -- expose then disconnect
- g_signal_connect (G_OBJECT (getWidget()), "expose-event",
- G_CALLBACK (realize_cb), this);
}
inline GtkComboBox *getComboBox()
@@ -130,19 +126,6 @@
static void selected_changed_cb (GtkComboBox *widget, YGComboBox *pThis)
{ pThis->emitEvent (YEvent::ValueChanged); }
- static gboolean realize_cb (GtkWidget *widget, GdkEventExpose *event,
- YGComboBox *pThis)
- {
- // some combo boxes have too many items -- wrap the thing in columns
- int rows;
- pThis->getMaxDepth (&rows);
- int cols = MIN (rows / 20, 5) + 1;
- if (cols > 1) // this changes the popup width, so only set it for cols > 1
- gtk_combo_box_set_wrap_width (pThis->getComboBox(), cols);
- g_signal_handlers_disconnect_by_func (widget, (gpointer) realize_cb, pThis);
- return FALSE;
- }
-
YGLABEL_WIDGET_IMPL (YComboBox)
YGSELECTION_WIDGET_IMPL (YComboBox)
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/YGDialog.cc new/yast2-gtk-2.21.84/src/YGDialog.cc
--- old/yast2-gtk-2.21.82/src/YGDialog.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/YGDialog.cc 2010-12-15 14:18:09.000000000 +0100
@@ -25,7 +25,7 @@
//#define DEFAULT_WIDTH 750
//#define DEFAULT_HEIGHT 650
-#define DEFAULT_CHAR_WIDTH 65
+#define DEFAULT_CHAR_WIDTH 62
#define DEFAULT_CHAR_HEIGHT 28
#define DEFAULT_PIXEL_WIDTH 350
#define DEFAULT_PIXEL_HEIGHT 200
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/YGText.cc new/yast2-gtk-2.21.84/src/YGText.cc
--- old/yast2-gtk-2.21.82/src/YGText.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/YGText.cc 2010-12-15 14:18:09.000000000 +0100
@@ -47,12 +47,19 @@
gtk_text_buffer_delete (getBuffer(), &start_it, &end_it);
}
- void setText (const string &text)
+ void setText (const std::string &text)
{
BlockEvents block (this);
gtk_text_buffer_set_text (getBuffer(), text.c_str(), -1);
}
+ void appendText (const std::string &text)
+ {
+ GtkTextIter end_it;
+ gtk_text_buffer_get_end_iter (getBuffer(), &end_it);
+ gtk_text_buffer_insert (getBuffer(), &end_it, text.c_str(), -1);
+ }
+
std::string getText()
{
GtkTextIter start_it, end_it;
@@ -66,8 +73,9 @@
void scrollToBottom()
{
- //YGUtils::scrollWidget (GTK_TEXT_VIEW (getWidget())->vadjustment, false);
-
+#if 1
+ YGUtils::scrollWidget (GTK_TEXT_VIEW (getWidget())->vadjustment, false);
+#else
GtkTextBuffer *buffer = getBuffer();
GtkTextIter iter;
gtk_text_buffer_get_end_iter (buffer, &iter);
@@ -81,6 +89,7 @@
GtkTextView *view = GTK_TEXT_VIEW (getWidget());
gtk_text_view_scroll_mark_onscreen (view, mark);
+#endif
}
// Event callbacks
@@ -140,6 +149,8 @@
class YGLogView : public YLogView, public YGTextView
{
+std::string m_text;
+
public:
YGLogView (YWidget *parent, const string &label, int visibleLines, int maxLines)
: YLogView (NULL, label, visibleLines, maxLines)
@@ -147,10 +158,29 @@
{}
// YLogView
- virtual void displayLogText (const string &text)
+ virtual void displayLogText (const std::string &text)
{
- setText (text);
- scrollToBottom();
+ // libyui calls clearText before setting it: let's ignore it
+ if (text.empty()) return;
+
+ if (text.compare (0, m_text.size(), m_text) == 0) {
+ if (text.size() == m_text.size()) return;
+
+ // appending text: avoid flickering and allow user to scroll freely
+ GtkAdjustment *vadj = GTK_TEXT_VIEW (getWidget())->vadjustment;
+ bool autoScroll = vadj->value >= vadj->upper - vadj->page_size;
+
+ std::string diff (text.substr (m_text.size()));
+ YGTextView::appendText (diff);
+ if (autoScroll)
+ YGTextView::scrollToBottom();
+
+ }
+ else {
+ YGTextView::setText (text);
+ YGTextView::scrollToBottom();
+ }
+ m_text = text;
}
// YGWidget
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/YGWidget.h new/yast2-gtk-2.21.84/src/YGWidget.h
--- old/yast2-gtk-2.21.82/src/YGWidget.h 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/YGWidget.h 2010-12-15 14:18:09.000000000 +0100
@@ -50,7 +50,7 @@
{ DELAY_EVENT = 2, IGNORE_NOTIFY_EVENT = 4, IF_NOT_PENDING_EVENT = 8 };
void emitEvent (YEvent::EventReason reason, EventFlags flags = (EventFlags) 0);
- // signal registration; use "BlockEvents (this)" to temp block all signals
+ // signal registration; use "BlockEvents (this)" to temp-ly block all signals
friend struct BlockEvents;
void connect (gpointer object, const char *name,
GCallback callback, gpointer data, bool after = true);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/CMakeLists.txt new/yast2-gtk-2.21.84/src/pkg/CMakeLists.txt
--- old/yast2-gtk-2.21.82/src/pkg/CMakeLists.txt 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/CMakeLists.txt 2010-12-15 14:18:09.000000000 +0100
@@ -19,6 +19,7 @@
ygtkpkgundolist.cc
yzypptags.cc
yzyppwrapper.cc
+ #ygtkpkgvestigialdialog.cc
ygtkcellrendererbutton.c
ygtkcellrenderersidebutton.c
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/YGPackageSelector.cc new/yast2-gtk-2.21.84/src/pkg/YGPackageSelector.cc
--- old/yast2-gtk-2.21.82/src/pkg/YGPackageSelector.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/YGPackageSelector.cc 2010-12-15 14:18:09.000000000 +0100
@@ -27,6 +27,11 @@
#include "ygtkpkgstatusbar.h"
#include "ygtkpkgdetailview.h"
+#include "ygtkpkghistorydialog.h"
+#ifdef HAS_VESTIGIAL_DIALOG
+#include "ygtkpkgvestigialdialog.h"
+#endif
+
//#define USE_LIST_BUTTONS
YGPackageSelector *YGPackageSelector::singleton = 0;
@@ -653,7 +658,11 @@
}
YGPackageSelector::YGPackageSelector (YWidget *parent, long mode)
-: YPackageSelector (NULL, mode), YGWidget (this, parent, YGTK_TYPE_WIZARD, NULL)
+: YPackageSelector (NULL, mode), YGWidget (this, parent, YGTK_TYPE_WIZARD, NULL),
+m_historyDialog (NULL)
+#ifdef HAS_VESTIGIAL_DIALOG
+, m_vestigialDialog (NULL)
+#endif
{
singleton = this;
setBorder (0);
@@ -709,6 +718,10 @@
YGPackageSelector::~YGPackageSelector()
{
+ delete m_historyDialog;
+#ifdef HAS_VESTIGIAL_DIALOG
+ delete m_vestigialDialog;
+#endif
delete impl;
singleton = 0;
}
@@ -756,10 +769,6 @@
impl->refreshQuery();
}
-void YGPackageSelector::showSelectableDetails (Ypp::Selectable &sel)
-{
-}
-
void YGPackageSelector::popupChanges()
{ impl->m_undo->popupDialog (false); }
@@ -775,6 +784,22 @@
void YGPackageSelector::showRepoManager()
{ YGUI::ui()->sendEvent (new YMenuEvent ("repo_mgr")); }
+void YGPackageSelector::showHistoryDialog()
+{
+ if (!m_historyDialog)
+ m_historyDialog = new YGtkPkgHistoryDialog();
+ m_historyDialog->popup();
+}
+
+#ifdef HAS_VESTIGIAL_DIALOG
+void YGPackageSelector::showVestigialDialog()
+{
+ if (!m_vestigialDialog)
+ m_vestigialDialog = new YGtkPkgVestigialDialog();
+ m_vestigialDialog->popup();
+}
+#endif
+
YGtkPkgUndoList *YGPackageSelector::undoList()
{ return impl->m_undo; }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/YGPackageSelector.h new/yast2-gtk-2.21.84/src/pkg/YGPackageSelector.h
--- old/yast2-gtk-2.21.82/src/pkg/YGPackageSelector.h 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/YGPackageSelector.h 2010-12-15 14:18:09.000000000 +0100
@@ -13,8 +13,12 @@
#include "YGWidget.h"
#include "yzyppwrapper.h"
+//#define HAS_VESTIGIAL_DIALOG
+
struct YGtkPkgUndoList;
struct YGtkPkgSearchEntry;
+struct YGtkPkgHistoryDialog;
+struct YGtkPkgVestigialDialog;
class YGPackageSelector : public YPackageSelector, YGWidget
{
@@ -29,11 +33,15 @@
void showFilterWidget (const char *filter);
void searchFor (Ypp::PoolQuery::StringAttribute attrb, const std::string &text);
- void showSelectableDetails (Ypp::Selectable &sel);
void popupChanges();
void filterPkgSuffix (const std::string &suffix, bool enable_filter);
void showRepoManager();
+ void showHistoryDialog();
+#ifdef HAS_VESTIGIAL_DIALOG
+ void showVestigialDialog();
+#endif
+
YGtkPkgUndoList *undoList();
YGtkPkgSearchEntry *getSearchEntry();
@@ -46,8 +54,14 @@
struct Impl;
Impl *impl;
+
private:
static YGPackageSelector *singleton;
+
+ YGtkPkgHistoryDialog *m_historyDialog;
+#ifdef HAS_VESTIGIAL_DIALOG
+ YGtkPkgVestigialDialog *m_vestigialDialog;
+#endif
};
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkgdetailview.cc new/yast2-gtk-2.21.84/src/pkg/ygtkpkgdetailview.cc
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkgdetailview.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkgdetailview.cc 2010-12-15 14:18:09.000000000 +0100
@@ -396,6 +396,27 @@
box = gtk_vbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (box), versions_box, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box), button_box, FALSE, TRUE, 0);
+
+#if 1 // draw border all around
+ GtkWidget *frame = gtk_frame_new (NULL);
+ gtk_container_set_border_width (GTK_CONTAINER (frame), 2);
+ gtk_container_add (GTK_CONTAINER (frame), box);
+ box = frame;
+#endif
+#if 0 // draw border only to the left
+ GtkWidget *frame_box = gtk_hbox_new (FALSE, 2);
+ gtk_box_pack_start (GTK_BOX (frame_box), gtk_vseparator_new(), FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (frame_box), box, TRUE, TRUE, 0);
+ box = frame_box;
+#endif
+#if 0 // colored background
+ GtkWidget *back = gtk_event_box_new();
+ GdkColor color = { 0, 230 << 8, 230 << 8, 230 << 8 };
+ gtk_widget_modify_bg (back, GTK_STATE_NORMAL, &color);
+ gtk_container_add (GTK_CONTAINER (back), box);
+ box = back;
+#endif
+
setChild (box);
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkgfilterview.cc new/yast2-gtk-2.21.84/src/pkg/ygtkpkgfilterview.cc
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkgfilterview.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkgfilterview.cc 2010-12-15 14:18:09.000000000 +0100
@@ -115,9 +115,15 @@
// we use cell-render-pixbuf's "pixbuf" rather than "icon-name" so we
// can use a fixed size
GdkPixbuf *pixbuf = 0;
- if (icon)
- pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default(),
- icon, 32, GtkIconLookupFlags (0), NULL);
+ if (icon) {
+ if (!strcmp (icon, "empty")) {
+ pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, 32, 32);
+ gdk_pixbuf_fill (pixbuf, 0xffffff00);
+ }
+ else
+ pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default(),
+ icon, 32, GtkIconLookupFlags (0), NULL);
+ }
int weight = PANGO_WEIGHT_NORMAL;
if (firstRowIsAll() && gtk_tree_model_iter_n_children (impl->model, NULL) == 0)
@@ -313,7 +319,7 @@
for (int i = 0; i < YPKG_GROUP_UNKNOWN; i++)
groups.insert (PKGroup ((YPkgGroupEnum) i));
- addRow (NULL, _("All packages"), true, 0);
+ addRow ("empty", _("All packages"), true, 0);
for (std::set <PKGroup>::const_iterator it = groups.begin();
it != groups.end(); it++)
addRow (it->icon, it->name, true, GINT_TO_POINTER (((int)it->id)+1));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkghistorydialog.cc new/yast2-gtk-2.21.84/src/pkg/ygtkpkghistorydialog.cc
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkghistorydialog.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkghistorydialog.cc 2010-12-15 14:18:09.000000000 +0100
@@ -22,27 +22,6 @@
#include
#define FILENAME "/var/log/zypp/history"
-static void getRepositoryInfo (const std::string &alias, std::string &name, std::string &url)
-{
- static std::map repos;
- if (repos.empty()) {
- zypp::RepoManager manager;
- std::list zypp::RepoInfo known_repos = manager.knownRepositories();
- for (std::list zypp::RepoInfo::const_iterator it = known_repos.begin();
- it != known_repos.end(); it++)
- repos[it->alias()] = *it;
- }
-
- std::map ::iterator it = repos.find (alias);
- if (it != repos.end()) {
- zypp::RepoInfo *repo = &it->second;
- name = repo->name();
- url = repo->url().asString();
- }
- else
- name = alias; // return alias if repo not currently setup-ed
-}
-
static std::string reqbyTreatment (const std::string &reqby)
{
if (reqby.empty())
@@ -284,7 +263,7 @@
static_cast (item.get());
name = _item->name;
descrpt = _item->edition.version();
- getRepositoryInfo (_item->repoalias, repoName, repoUrl);
+ Ypp::getRepositoryFromAlias (_item->repoalias, repoName, repoUrl);
reqby = _item->reqby; autoreq = reqby.empty();
reqby = reqbyTreatment (reqby);
zypp::Edition edition = _item->edition;
@@ -322,7 +301,7 @@
zypp::HistoryItemRepoAdd *_item =
static_cast (item.get());
action = _("add repository");
- getRepositoryInfo (_item->alias, name, t);
+ Ypp::getRepositoryFromAlias (_item->alias, name, t);
descrpt = _item->url.asString();
break;
}
@@ -344,7 +323,7 @@
zypp::HistoryItemRepoUrlChange *_item =
static_cast (item.get());
action = _("change repository url");
- getRepositoryInfo (_item->alias, name, t);
+ Ypp::getRepositoryFromAlias (_item->alias, name, t);
descrpt = _item->newurl.asString();
break;
}
@@ -506,6 +485,29 @@
ygtk_tree_view_popup_menu (view, menu);
}
+static gboolean read_logs_idle_cb (void *data)
+{
+ GtkWidget **views = (GtkWidget **) data;
+ GtkWidget *dialog = views[0];
+ GtkTreeView *log_view = GTK_TREE_VIEW (views[1]);
+ GtkTreeView *date_view = GTK_TREE_VIEW (views[2]);
+
+ ListHandler handler;
+ ZyppHistoryParser parser (&handler);
+
+ gtk_tree_view_set_model (date_view, handler.date_handler->getModel());
+ gtk_tree_view_set_model (log_view, handler.log_handler->getModel());
+
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (date_view);
+ GtkTreeIter iter;
+ if (gtk_tree_model_get_iter_first (
+ gtk_tree_view_get_model (date_view), &iter))
+ gtk_tree_selection_select_iter (selection, &iter);
+
+ gdk_window_set_cursor (dialog->window, NULL);
+ return FALSE;
+}
+
YGtkPkgHistoryDialog::YGtkPkgHistoryDialog()
{
GtkCellRenderer *renderer, *pix_renderer;
@@ -618,7 +620,7 @@
GtkWidget *dialog = gtk_message_dialog_new (YGDialog::currentWindow(),
GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_OTHER, GTK_BUTTONS_NONE,
- _("History (%s)"), FILENAME);
+ _("Show History (%s)"), FILENAME);
gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_JUMP_TO, 1);
gtk_dialog_add_button (GTK_DIALOG (dialog), _("Save to File"), 2);
gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
@@ -651,36 +653,18 @@
g_signal_connect (G_OBJECT (selection), "changed",
G_CALLBACK (date_selection_changed_cb), log_view);
- GdkDisplay *display = gtk_widget_get_display (dialog);
- GdkCursor *cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
- gdk_window_set_cursor (gtk_widget_get_window (dialog), cursor);
- while (g_main_context_iteration (NULL, FALSE)) ;
+ GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
+ gdk_window_set_cursor (dialog->window, cursor);
gdk_cursor_unref (cursor);
- ListHandler handler;
- ZyppHistoryParser parser (&handler);
- gtk_tree_view_set_model (GTK_TREE_VIEW (date_view), handler.date_handler->getModel());
- gtk_tree_view_set_model (GTK_TREE_VIEW (log_view), handler.log_handler->getModel());
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (date_view));
- GtkTreeIter iter;
- if (gtk_tree_model_get_iter_first (
- gtk_tree_view_get_model (GTK_TREE_VIEW (date_view)), &iter))
- gtk_tree_selection_select_iter (selection, &iter);
-
- gdk_window_set_cursor (dialog->window, NULL);
+ GtkWidget **views = g_new (GtkWidget *, 3);
+ views[0] = dialog; views[1] = log_view; views[2] = date_view;
+ g_idle_add_full (G_PRIORITY_LOW, read_logs_idle_cb, views, g_free);
}
-YGtkPkgHistoryDialog::~YGtkPkgHistoryDialog() {}
+YGtkPkgHistoryDialog::~YGtkPkgHistoryDialog()
+{ gtk_widget_destroy (m_dialog); }
void YGtkPkgHistoryDialog::popup()
{ gtk_window_present (GTK_WINDOW (m_dialog)); }
-void popupHistoryDialog()
-{
- static YGtkPkgHistoryDialog *dialog = 0;
- if (!dialog)
- dialog = new YGtkPkgHistoryDialog();
- dialog->popup();
-}
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkghistorydialog.h new/yast2-gtk-2.21.84/src/pkg/ygtkpkghistorydialog.h
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkghistorydialog.h 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkghistorydialog.h 2010-12-15 14:18:09.000000000 +0100
@@ -22,8 +22,8 @@
GtkWidget *m_dialog;
};
-// use this method to create the dialog -- so it is cached
-void popupHistoryDialog();
+// you do not want to use this class directly:
+// use YGPackageSelector::get()->showHistoryDialog()
#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkglanguageview.cc new/yast2-gtk-2.21.84/src/pkg/ygtkpkglanguageview.cc
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkglanguageview.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkglanguageview.cc 2010-12-15 14:18:09.000000000 +0100
@@ -17,8 +17,7 @@
addTextColumn (NULL, NAME_SUMMARY_PROP, true, -1);
Ypp::LangQuery query;
- Ypp::List list (query);
- YGtkPkgListView::setList (list);
+ YGtkPkgListView::setList (query);
YGtkPkgListView::setListener (this);
}
@@ -28,7 +27,7 @@
bool YGtkPkgLanguageView::writeQuery (Ypp::PoolQuery &query)
{
- Ypp::List list = getSelected();
+ Ypp::List list (getSelected());
if (list.size() > 0) {
Ypp::Collection col (list.get (0));
query.addCriteria (new Ypp::FromCollectionMatch (col));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkglistview.cc new/yast2-gtk-2.21.84/src/pkg/ygtkpkglistview.cc
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkglistview.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkglistview.cc 2010-12-15 14:18:09.000000000 +0100
@@ -874,6 +874,9 @@
void YGtkPkgListView::setListener (YGtkPkgListView::Listener *listener)
{ impl->listener = listener; }
+Ypp::List YGtkPkgListView::getList()
+{ return impl->list; }
+
Ypp::List YGtkPkgListView::getSelected()
{
GtkTreeModel *model;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkglistview.h new/yast2-gtk-2.21.84/src/pkg/ygtkpkglistview.h
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkglistview.h 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkglistview.h 2010-12-15 14:18:09.000000000 +0100
@@ -35,6 +35,8 @@
void addImageColumn (const char *header, int property, bool onlyManualModified = false);
void addButtonColumn (const char *header, int property);
+ Ypp::List getList();
+
struct Listener {
virtual void selectionChanged() = 0;
};
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkgmenubar.cc new/yast2-gtk-2.21.84/src/pkg/ygtkpkgmenubar.cc
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkgmenubar.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkgmenubar.cc 2010-12-15 14:18:09.000000000 +0100
@@ -655,11 +655,13 @@
static void show_pkg_changes_cb()
{ YGPackageSelector::get()->popupChanges(); }
-
-#include "ygtkpkghistorydialog.h"
-
static void show_log_changes_cb()
-{ popupHistoryDialog(); }
+{ YGPackageSelector::get()->showHistoryDialog(); }
+
+#ifdef HAS_VESTIGIAL_DIALOG
+static void show_vestigial_packages_cb()
+{ YGPackageSelector::get()->showVestigialDialog(); }
+#endif
static void reset_ignored_dependency_conflicts_cb()
{ zypp::getZYpp()->resolver()->undo(); }
@@ -730,9 +732,14 @@
G_CALLBACK (show_products_cb), this);
append_menu_item (submenu, _("Show _Changes"), NULL,
G_CALLBACK (show_pkg_changes_cb), this);
- if (!selector->onlineUpdateMode())
+ if (!selector->onlineUpdateMode()) {
append_menu_item (submenu, _("Show _History"), NULL,
G_CALLBACK (show_log_changes_cb), this);
+#ifdef HAS_VESTIGIAL_DIALOG
+ append_menu_item (submenu, _("Show _Unneeded Dependencies"), NULL,
+ G_CALLBACK (show_vestigial_packages_cb), this);
+#endif
+ }
append_menu_item (submenu, NULL, NULL, NULL, NULL);
// Translators: keep "-_devel" untranslated
append_menu_item (submenu, _("Install All Matching -_devel Packages"), NULL,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkgsearchentry.cc new/yast2-gtk-2.21.84/src/pkg/ygtkpkgsearchentry.cc
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkgsearchentry.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkgsearchentry.cc 2010-12-15 14:18:09.000000000 +0100
@@ -79,7 +79,7 @@
: YGtkPkgQueryWidget(), impl (new Impl())
{
impl->entry = gtk_entry_new();
- gtk_widget_set_size_request (impl->entry, 160, -1);
+ gtk_widget_set_size_request (impl->entry, 180, -1);
g_signal_connect (G_OBJECT (impl->entry), "realize", // grab focus at start
G_CALLBACK (gtk_widget_grab_focus), NULL);
g_signal_connect (G_OBJECT (impl->entry), "changed",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkgundolist.cc new/yast2-gtk-2.21.84/src/pkg/ygtkpkgundolist.cc
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkgundolist.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkgundolist.cc 2010-12-15 14:18:09.000000000 +0100
@@ -311,7 +311,7 @@
int ret = gtk_dialog_run (GTK_DIALOG (dialog));
if (ret == 1)
- popupHistoryDialog();
+ YGPackageSelector::get()->showHistoryDialog();
gtk_widget_destroy (dialog);
return ret == GTK_RESPONSE_YES;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkgvestigialdialog.cc new/yast2-gtk-2.21.84/src/pkg/ygtkpkgvestigialdialog.cc
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkgvestigialdialog.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkgvestigialdialog.cc 2010-12-15 14:18:09.000000000 +0100
@@ -0,0 +1,248 @@
+/********************************************************************
+ * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
+ ********************************************************************/
+/* YGtkPkgVestigialDialog, dialog */
+// check the header file for information about this widget
+
+/*
+ Textdomain "gtk"
+ */
+
+#include "YGi18n.h"
+#include "config.h"
+#include "YGDialog.h"
+#include "ygtkpkgvestigialdialog.h"
+#include "ygtkpkglistview.h"
+#include "YGPackageSelector.h"
+#include "yzyppwrapper.h"
+#include
+
+#include
+#define FILENAME "/var/log/zypp/history"
+
+struct ZyppVestigialParser
+{
+ std::set std::string m_dependencies;
+
+ ZyppVestigialParser()
+ {
+ zypp::parser::HistoryLogReader parser (FILENAME, boost::ref (*this));
+ try {
+ parser.readAll();
+ }
+ catch (const zypp::Exception &ex) {
+ yuiWarning () << "Error: Could not load log file" << FILENAME << ": "
+ << ex.asUserHistory() << std::endl;
+ }
+ }
+
+ bool operator() (const zypp::HistoryItem::Ptr &item)
+ {
+ if (item->action.toEnum() == zypp::HistoryActionID::INSTALL_e) {
+ zypp::HistoryItemInstall *_item =
+ static_cast (item.get());
+
+ const std::string &name (_item->name);
+ bool autoreq = _item->reqby.empty();
+ std::string repoName, repoUrl;
+ Ypp::getRepositoryFromAlias (_item->repoalias, repoName, repoUrl);
+ bool update = repoUrl.find ("update") != std::string::npos;
+
+ if (!update) { // updates are ambiguous
+ if (autoreq)
+ m_dependencies.insert (name);
+ else
+ m_dependencies.erase (name);
+ }
+ }
+
+ return true;
+ }
+};
+
+struct YGtkPkgVestigialDialog::Impl : public YGtkPkgListView::Listener
+{
+ GtkWidget *dialog;
+ YGtkPkgListView *view;
+ GtkWidget *progressbar;
+
+ virtual void selectionChanged()
+ {
+ Ypp::List selected (view->getSelected());
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), 1, selected.size());
+ }
+
+ void goto_clicked()
+ {
+ Ypp::List selected (view->getSelected());
+ if (selected.size()) {
+ std::string name (selected.get(0).name());
+ YGPackageSelector::get()->searchFor (Ypp::PoolQuery::NAME, name);
+ }
+ gtk_widget_hide (dialog);
+ }
+
+ void remove_all()
+ {
+ view->getList().remove();
+ }
+
+ static void response_cb (GtkDialog *dialog, gint response, Impl *pThis)
+ {
+ switch (response) {
+ case 1: pThis->goto_clicked(); break;
+ case 2: pThis->remove_all(); break;
+ default: gtk_widget_hide (GTK_WIDGET (pThis->dialog)); break;
+ }
+ }
+
+ void set_progress (gdouble fraction)
+ {
+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (progressbar), fraction);
+ while (g_main_context_iteration (NULL, FALSE)) ;
+ }
+};
+
+static bool testIsNeededDependency (ZyppSelectable zsel)
+{ // pass only installed packages: zsel->status() == S_KeepInstalled
+ zsel->setStatus (zypp::ui::S_Del);
+ zypp::Resolver_Ptr zResolver = zypp::getZYpp()->resolver();
+ bool noProbs = zResolver->resolvePool();
+ zResolver->undo();
+ zsel->setStatus (zypp::ui::S_KeepInstalled);
+ return !noProbs;
+}
+
+static void filterWhenContains (Ypp::Collection &col, std::list <ZyppSelectable> &pkgs)
+{
+ std::list <ZyppSelectable>::iterator it = pkgs.begin();
+ while (it != pkgs.end()) {
+ Ypp::Selectable p (*it);
+ if (col.contains (p))
+ it = pkgs.erase (it);
+ else it++;
+ }
+}
+
+static gboolean fill_list_idle_cb (void *data)
+{
+ YGtkPkgVestigialDialog::Impl *impl = (YGtkPkgVestigialDialog::Impl *) data;
+
+ // 1. get list of packages installed as dependencies
+ ZyppVestigialParser parser;
+ const std::set std::string &deps = parser.m_dependencies;
+ impl->set_progress (.1);
+ // 2. map string names to zypp objects and check whether they are still necessary
+ int size = deps.size(), i = 0;
+ std::list <ZyppSelectable> unneeded;
+ for (std::set std::string::const_iterator it = deps.begin();
+ it != deps.end(); it++) {
+ Ypp::PoolQuery query (Ypp::Selectable::PACKAGE);
+ query.addStringOr (*it);
+ query.addStringAttribute (Ypp::PoolQuery::NAME);
+ query.setStringMode (true, Ypp::PoolQuery::EXACT);
+ if (query.hasNext()) {
+ Ypp::Selectable sel (query.next());
+ ZyppSelectable zsel = sel.zyppSel();
+ if (zsel->status() == zypp::ui::S_KeepInstalled)
+ if (!testIsNeededDependency (zsel))
+ unneeded.push_back (zsel);
+ }
+
+ if ((i % 2) == 0)
+ impl->set_progress (.1 + ((i / (gdouble) size) * .80));
+ i++;
+ }
+ // 3. filter those installed by a container
+ impl->set_progress (.90);
+ Ypp::LangQuery langQuery;
+ size = langQuery.guessSize(); i = 0;
+ while (langQuery.hasNext()) {
+ Ypp::Selectable sel (langQuery.next());
+ if (!sel.isInstalled()) continue;
+ Ypp::Collection col (sel);
+ filterWhenContains (col, unneeded);
+ }
+ impl->set_progress (.95);
+ Ypp::PoolQuery patternQuery (Ypp::Selectable::PATTERN);
+ patternQuery.addCriteria (new Ypp::StatusMatch (Ypp::StatusMatch::IS_INSTALLED));
+ size = patternQuery.guessSize(); i = 0;
+ while (patternQuery.hasNext()) {
+ Ypp::Selectable sel (patternQuery.next());
+ Ypp::Collection col (sel);
+ filterWhenContains (col, unneeded);
+ }
+
+ Ypp::List list (unneeded.size());
+ for (std::list <ZyppSelectable>::const_iterator it = unneeded.begin();
+ it != unneeded.end(); it++)
+ list.append (*it);
+ impl->view->setList (list);
+
+ gtk_widget_hide (impl->progressbar);
+ gdk_window_set_cursor (impl->dialog->window, NULL);
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (impl->dialog), 2, unneeded.size());
+ gtk_window_present (GTK_WINDOW (impl->dialog));
+ return FALSE;
+}
+
+YGtkPkgVestigialDialog::YGtkPkgVestigialDialog()
+{
+ GtkWidget *dialog = gtk_message_dialog_new (YGDialog::currentWindow(),
+ GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_OTHER, GTK_BUTTONS_NONE,
+ _("Show Unneeded Dependencies"));
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ _("This is a listing of dependencies no longer used. It is neither "
+ "accurate, nor comprehensive. Use with care."));
+
+ impl = new Impl();
+ GtkWidget *action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
+ impl->progressbar = gtk_progress_bar_new();
+ gtk_widget_set_size_request (impl->progressbar, 0, 0);
+ gtk_container_add (GTK_CONTAINER (action_area), impl->progressbar);
+
+ gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_JUMP_TO, 1);
+ gtk_dialog_add_button (GTK_DIALOG (dialog), _("Remove All"), 2);
+ gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), 1, FALSE);
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), 2, FALSE);
+ gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
+ gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
+ gtk_window_set_default_size (GTK_WINDOW (dialog), 650, 600);
+ g_signal_connect (G_OBJECT (dialog), "response",
+ G_CALLBACK (Impl::response_cb), impl);
+ g_signal_connect (G_OBJECT (dialog), "delete-event",
+ G_CALLBACK (gtk_true), NULL);
+
+ impl->view = new YGtkPkgListView (true, Ypp::List::NAME_SORT, false, true);
+ impl->view->addCheckColumn (INSTALLED_CHECK_PROP);
+ impl->view->addTextColumn (_("Name"), NAME_SUMMARY_PROP, true, -1);
+ impl->view->addTextColumn (_("Version"), VERSION_PROP, true, 125);
+ impl->view->addTextColumn (_("Size"), SIZE_PROP, false, 85);
+ impl->view->addTextColumn (_("Repository"), REPOSITORY_PROP, false, 180);
+ impl->view->addTextColumn (_("Supportability"), SUPPORT_PROP, false, 120);
+ impl->view->setListener (impl);
+
+ GtkWidget *content = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ gtk_container_add (GTK_CONTAINER (content), impl->view->getWidget());
+
+ gtk_widget_show_all (dialog);
+ impl->dialog = dialog;
+
+ GdkCursor *cursor = gdk_cursor_new (GDK_WATCH);
+ gdk_window_set_cursor (dialog->window, cursor);
+ gdk_cursor_unref (cursor);
+
+ g_idle_add_full (G_PRIORITY_LOW, fill_list_idle_cb, impl, NULL);
+}
+
+YGtkPkgVestigialDialog::~YGtkPkgVestigialDialog()
+{
+ delete impl->view;
+ gtk_widget_destroy (impl->dialog);
+ delete impl;
+}
+
+void YGtkPkgVestigialDialog::popup()
+{ gtk_window_present (GTK_WINDOW (impl->dialog)); }
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/ygtkpkgvestigialdialog.h new/yast2-gtk-2.21.84/src/pkg/ygtkpkgvestigialdialog.h
--- old/yast2-gtk-2.21.82/src/pkg/ygtkpkgvestigialdialog.h 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/ygtkpkgvestigialdialog.h 2010-12-15 14:18:09.000000000 +0100
@@ -0,0 +1,28 @@
+/********************************************************************
+ * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
+ ********************************************************************/
+
+/* A dialog to help the user track no longer needed dependencies.
+*/
+
+#ifndef YGTK_PKG_VESTIGIAL_DIALOG_H
+#define YGTK_PKG_VESTIGIAL_DIALOG_H
+
+#include
+
+struct YGtkPkgVestigialDialog
+{
+ YGtkPkgVestigialDialog();
+ ~YGtkPkgVestigialDialog();
+
+ void popup();
+
+ struct Impl;
+ Impl *impl;
+};
+
+// you do not want to use this class directly:
+// use YGPackageSelector::get()->showVestigialDialog()
+
+#endif
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/yzyppwrapper.cc new/yast2-gtk-2.21.84/src/pkg/yzyppwrapper.cc
--- old/yast2-gtk-2.21.82/src/pkg/yzyppwrapper.cc 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/yzyppwrapper.cc 2010-12-15 14:18:09.000000000 +0100
@@ -45,6 +45,27 @@
bool Ypp::Repository::operator == (const Ypp::Repository &other) const
{ return this->m_repo.info().alias() == other.m_repo.info().alias(); }
+void Ypp::getRepositoryFromAlias (const std::string &alias, std::string &name, std::string &url)
+{
+ static std::map repos;
+ if (repos.empty()) {
+ zypp::RepoManager manager;
+ std::list zypp::RepoInfo known_repos = manager.knownRepositories();
+ for (std::list zypp::RepoInfo::const_iterator it = known_repos.begin();
+ it != known_repos.end(); it++)
+ repos[it->alias()] = *it;
+ }
+
+ std::map ::iterator it = repos.find (alias);
+ if (it != repos.end()) {
+ zypp::RepoInfo *repo = &it->second;
+ name = repo->name();
+ url = repo->url().asString();
+ }
+ else
+ name = alias; // return alias if repo not currently setup-ed
+}
+
// Version
Ypp::Version::Version (ZyppResObject zobj)
@@ -1368,6 +1389,7 @@
if (impl->vector.empty())
return;
+ bool unique_criteria = false;
switch (attrb) {
case IS_INSTALLED_SORT: _order = installed_order; break;
case NAME_SORT:
@@ -1376,13 +1398,17 @@
_order = utf8_name_order;
else
_order = name_order;
+ unique_criteria = true;
break;
- case SIZE_SORT: _order = size_order; break;
+ case SIZE_SORT: _order = size_order; unique_criteria = true; break;
case REPOSITORY_SORT: _order = repository_order; break;
case SUPPORT_SORT: _order = support_order; break;
}
_ascendent = ascendent;
- std::sort (impl->vector.begin(), impl->vector.end(), proxy_order);
+ if (unique_criteria)
+ std::sort (impl->vector.begin(), impl->vector.end(), proxy_order);
+ else // many attributes are equal: maintain previous order in such cases
+ std::stable_sort (impl->vector.begin(), impl->vector.end(), proxy_order);
}
void Ypp::List::reverse()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/pkg/yzyppwrapper.h new/yast2-gtk-2.21.84/src/pkg/yzyppwrapper.h
--- old/yast2-gtk-2.21.82/src/pkg/yzyppwrapper.h 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/pkg/yzyppwrapper.h 2010-12-15 14:18:09.000000000 +0100
@@ -110,6 +110,9 @@
bool m_onlyInfo;
};
+ void getRepositoryFromAlias (const std::string &alias,
+ std::string &name, std::string &url);
+
// Selectable & complementory structs
struct Version {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/src/ygtktreeview.c new/yast2-gtk-2.21.84/src/ygtktreeview.c
--- old/yast2-gtk-2.21.82/src/ygtktreeview.c 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/src/ygtktreeview.c 2010-12-15 14:18:09.000000000 +0100
@@ -40,15 +40,7 @@
static void _ygtk_tree_view_menu_position_func (
GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data)
-{
- GtkWidget *widget = (GtkWidget *) user_data;
- gtk_tree_view_convert_bin_window_to_widget_coords (
- GTK_TREE_VIEW (widget), _popup_x, _popup_y, x, y);
-
- gint root_x, root_y;
- gdk_window_get_origin (widget->window, &root_x, &root_y);
- *x += root_x; *y += root_y;
-}
+{ *x = _popup_x; *y = _popup_y; }
void ygtk_tree_view_popup_menu (YGtkTreeView *view, GtkWidget *menu)
{
@@ -69,8 +61,8 @@
GtkTreeView *view = GTK_TREE_VIEW (widget);
GtkTreePath *path;
gboolean outreach;
- outreach = gtk_tree_view_get_path_at_pos (view, event->x, event->y, &path, NULL, NULL, NULL);
- if (outreach) { // select row if it is not
+ outreach = !gtk_tree_view_get_path_at_pos (view, event->x, event->y, &path, NULL, NULL, NULL);
+ if (!outreach) { // select row if it is not
GtkTreeSelection *selection = gtk_tree_view_get_selection (view);
GtkTreeModel *model = gtk_tree_view_get_model (view);
GtkTreeIter iter;
@@ -82,7 +74,7 @@
}
_popup_time = event->time;
- _popup_x = event->x; _popup_y = event->y;
+ _popup_x = event->x_root; _popup_y = event->y_root;
gtk_widget_grab_focus (widget);
g_signal_emit (widget, right_click_signal, 0, outreach);
@@ -116,6 +108,12 @@
g_list_free (rows);
}
+ gtk_tree_view_convert_bin_window_to_widget_coords (
+ view, _popup_x, _popup_y, &_popup_x, &_popup_y);
+ gint x_orig, y_orig;
+ gdk_window_get_origin (widget->window, &x_orig, &y_orig);
+ _popup_x += x_orig; _popup_y += y_orig;
+
g_signal_emit (widget, right_click_signal, 0, outreach);
return TRUE;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.82/yast2-gtk.spec.in new/yast2-gtk-2.21.84/yast2-gtk.spec.in
--- old/yast2-gtk-2.21.82/yast2-gtk.spec.in 2010-11-10 19:09:13.000000000 +0100
+++ new/yast2-gtk-2.21.84/yast2-gtk.spec.in 2010-12-15 14:18:10.000000000 +0100
@@ -54,7 +54,6 @@
%defattr (-, root, root)
%dir %_libdir/YaST2
%_libdir/YaST2/plugin/
-# %_prefix/share/YaST2/gtk/
%changelog
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org