Hello community, here is the log from the commit of package yast2-gtk for openSUSE:Factory checked in at Sun Apr 25 18:47:57 CEST 2010. -------- --- yast2-gtk/yast2-gtk.changes 2010-04-22 16:56:25.000000000 +0200 +++ /mounts/work_src_done/STABLE/yast2-gtk/yast2-gtk.changes 2010-04-25 12:18:27.000000000 +0200 @@ -1,0 +2,42 @@ +Sun Apr 25 11:15:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.52 +- sw_single: undo window: show 'inconsistent' when +env variable PKGMGR_ACTION_AT_EXIT==summary. + +------------------------------------------------------------------- +Sun Apr 25 10:48:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.51 +- sw_single: upgrades: don't lose patch information after +package is set for upgrade. + +------------------------------------------------------------------- +Fri Apr 23 23:15:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.50 +- sw_single: history window: fixed potential crash. + +------------------------------------------------------------------- +Fri Apr 23 20:16:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.49 +- sw_single: history window fix: show downgrades and +re-installs as such, not upgrades. +- sw_single list: show patch mark next to version number, +not name. + +------------------------------------------------------------------- +Fri Apr 23 12:16:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.48 +- sw_single: added patch mark for upgrades. + +------------------------------------------------------------------- +Fri Apr 23 08:59:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.47 +- sw_single: bug fix: patches were being (redundantly) +marked as "auto" in the history window. + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- yast2-gtk-2.21.46.tar.bz2 New: ---- yast2-gtk-2.21.52.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-gtk.spec ++++++ --- /var/tmp/diff_new_pack.on42eq/_old 2010-04-25 18:47:32.000000000 +0200 +++ /var/tmp/diff_new_pack.on42eq/_new 2010-04-25 18:47:32.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package yast2-gtk (Version 2.21.46) +# spec file for package yast2-gtk (Version 2.21.52) # # Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -18,11 +18,11 @@ Name: yast2-gtk -Version: 2.21.46 +Version: 2.21.52 Release: 1 BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-gtk-2.21.46.tar.bz2 +Source0: yast2-gtk-2.21.52.tar.bz2 Url: http://en.opensuse.org/YaST2-GTK Summary: YaST2 - GTK+ Graphical User Interface Group: System/YaST ++++++ yast2-gtk-2.21.46.tar.bz2 -> yast2-gtk-2.21.52.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/ChangeLog new/yast2-gtk-2.21.52/ChangeLog --- old/yast2-gtk-2.21.46/ChangeLog 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/ChangeLog 2010-04-25 12:16:11.000000000 +0200 @@ -1,3 +1,56 @@ +2010-04-25 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * src/pkg/ygtkpkgundolist.cc: show 'inconsistent' state + when PKGMGR_ACTION_AT_EXIT==summary + +2010-04-25 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * src/pkg/yzyppwrapper.cc: bug fix: remember patch status. + +2010-04-22 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * src/pkg/ygtkhistorydialog.cc: fixed potential crash. + +2010-04-22 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * src/pkg/ygtkhistorydialog.cc: bug fix: show downgrades + and re-installs as such, not upgrades. + + * src/pkg/ygtkpkglistview.cc: show patch mark next to + version number, not name. + +2010-04-22 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * src/pkg/ygtkpkgdetailview.cc: faster method to draw + description box background (modify it at the X11 level + rather than at expose). + +2010-04-22 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * src/pkg/yzyppwrapper.h/cc: added routines (in special + to Package) to tell if a package has a patch to be applied + to it. + + * src/pkg/ygtkpkglistview.cc: show "patch" mark next to + a package with a patch. + + * src/pkg/ygtkpkgdetailview.cc: show the patch description of + a package for which it should apply. + +2010-04-22 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * src/pkg/ygtkpkgdetailview.cc: reverted description + layout. + +2010-04-22 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> + + * src/pkg/ygtkpkgdetailview.cc: show version numbers in + dependencies table. + + * src/pkg/ygtkpkghistorydialog.cc: only mark as patches + those packages from the update server that were already + installed. Also, remove the auto mark when a patch. + 2010-04-22 Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt> * src/pkg/yzyppwrapper.cc:bug fix: ups: just broke diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/VERSION new/yast2-gtk-2.21.52/VERSION --- old/yast2-gtk-2.21.46/VERSION 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/VERSION 2010-04-25 12:16:11.000000000 +0200 @@ -1 +1 @@ -2.21.46 +2.21.52 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/VERSION.cmake new/yast2-gtk-2.21.52/VERSION.cmake --- old/yast2-gtk-2.21.46/VERSION.cmake 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/VERSION.cmake 2010-04-25 12:16:11.000000000 +0200 @@ -1,3 +1,3 @@ SET(VERSION_MAJOR "2") SET(VERSION_MINOR "21") -SET(VERSION_PATCH "46") +SET(VERSION_PATCH "52") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/package/yast2-gtk.changes new/yast2-gtk-2.21.52/package/yast2-gtk.changes --- old/yast2-gtk-2.21.46/package/yast2-gtk.changes 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/package/yast2-gtk.changes 2010-04-25 12:16:11.000000000 +0200 @@ -1,4 +1,46 @@ ------------------------------------------------------------------- +Sun Apr 25 11:15:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.52 +- sw_single: undo window: show 'inconsistent' when +env variable PKGMGR_ACTION_AT_EXIT==summary. + +------------------------------------------------------------------- +Sun Apr 25 10:48:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.51 +- sw_single: upgrades: don't lose patch information after +package is set for upgrade. + +------------------------------------------------------------------- +Fri Apr 23 23:15:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.50 +- sw_single: history window: fixed potential crash. + +------------------------------------------------------------------- +Fri Apr 23 20:16:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.49 +- sw_single: history window fix: show downgrades and +re-installs as such, not upgrades. +- sw_single list: show patch mark next to version number, +not name. + +------------------------------------------------------------------- +Fri Apr 23 12:16:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.48 +- sw_single: added patch mark for upgrades. + +------------------------------------------------------------------- +Fri Apr 23 08:59:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt + +- 2.21.47 +- sw_single: bug fix: patches were being (redundantly) +marked as "auto" in the history window. + +------------------------------------------------------------------- Thu Apr 22 15:52:00 WET 2010 - rpmcruz@alunos.dcc.fc.up.pt - 2.21.46 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/package/yast2-gtk.spec new/yast2-gtk-2.21.52/package/yast2-gtk.spec --- old/yast2-gtk-2.21.46/package/yast2-gtk.spec 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/package/yast2-gtk.spec 2010-04-25 12:16:11.000000000 +0200 @@ -1,16 +1,16 @@ # -# spec file for package yast2-gtk (Version 2.21.45) +# spec file for package yast2-gtk (Version 2.21.51) # # norootforbuild;, Name: yast2-gtk -Version: 2.21.45 +Version: 2.21.51 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source0: yast2-gtk-2.21.45.tar.bz2 +Source0: yast2-gtk-2.21.51.tar.bz2 Url: http://en.opensuse.org/YaST2-GTK Summary: YaST2 - GTK+ Graphical User Interface Group: System/YaST diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/src/pkg/ygtkpkgdetailview.cc new/yast2-gtk-2.21.52/src/pkg/ygtkpkgdetailview.cc --- old/yast2-gtk-2.21.46/src/pkg/ygtkpkgdetailview.cc 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/src/pkg/ygtkpkgdetailview.cc 2010-04-25 12:16:11.000000000 +0200 @@ -134,6 +134,7 @@ virtual void setList (Ypp::List list) { std::string str; + str.reserve (2048); if (list.size() == 1) { Ypp::Selectable &sel = list.get (0); str = sel.description (true); @@ -147,10 +148,22 @@ } if (sel.type() == Ypp::Selectable::PACKAGE) { - std::string url (Ypp::Package (sel).url()); - if (!url.empty()) - str += std::string ("<p><b>") + _("Web site:") + "</b> <a href=\"" + - url + "\">" + url + "</a></p>"; + Ypp::Package pkg (sel); + std::string url (pkg.url()); + if (!url.empty()) { + str += "<p><b>"; str += _("Web site:"); + str += "</b> <a href=\""; str += url; str += "\">"; + str += url; str += "</a></p>"; + } + if (pkg.isCandidatePatch()) { + Ypp::Selectable _patch = pkg.getCandidatePatch(); + Ypp::Patch patch (_patch); + str += "<p><b>"; str += _("Patch issued:"); + str += "</b> "; str += _patch.summary(); + str += " <b>("; str += Ypp::Patch::prioritySummary (patch.priority()); + str += ")</b>"; str += "</p>"; + + } } } else { @@ -680,14 +693,13 @@ : DetailExpander (_("Dependencies"), false) { vbox = gtk_vbox_new (FALSE, 6); - addLine ("", _("<b>Installed Version</b>"), _("<b>Candidate Version</b>"), -1); setChild (vbox); } void clear() { GList *children = gtk_container_get_children (GTK_CONTAINER (vbox)); - for (GList *i = children->next; i; i = i->next) + for (GList *i = children; i; i = i->next) gtk_container_remove (GTK_CONTAINER (vbox), (GtkWidget *) i->data); g_list_free (children); } @@ -740,6 +752,13 @@ Ypp::Selectable sel = list.get (0); clear(); + std::string installed_str (_("<b>Installed Version</b>")); + std::string candidate_str (_("<b>Candidate Version</b>")); + if (sel.hasInstalledVersion()) + installed_str += "\n" + sel.installed().number(); + if (sel.hasCandidateVersion()) + candidate_str += "\n" + sel.candidate().number(); + addLine ("", installed_str, candidate_str, -1); for (int dep = 0; dep < VersionDependencies::total(); dep++) { std::string inst, cand; if (sel.hasInstalledVersion()) @@ -985,7 +1004,9 @@ { std::string text; text.reserve (32768); - text = _("<p>Changelog applies only to the installed version.</p>"); + text += "<p><i>"; + text += _("Changelog applies only to the installed version."); + text += "</i></p>"; ZyppResObject zobj = sel.installed().zyppObj(); ZyppPackage zpkg = castZyppPackage (zobj); if (zpkg) { @@ -1118,7 +1139,7 @@ Ypp::Collection col (sel); Ypp::PoolQuery query (Ypp::Selectable::PACKAGE); - query.addCriteria (new Ypp::CollectionMatch (col)); + query.addCriteria (new Ypp::FromCollectionMatch (col)); view->setQuery (query); } @@ -1135,12 +1156,8 @@ { DetailWidget *widget; - GtkWidget *vbox = gtk_vbox_new (FALSE, 0); - widget = new DetailName(); - m_widgets.push_back (widget); - gtk_box_pack_start (GTK_BOX (vbox), widget->getWidget(), FALSE, TRUE, 0); - GtkWidget *side_vbox = gtk_vbox_new (FALSE, 0); + widget = new VersionExpander(); m_widgets.push_back (widget); gtk_box_pack_start (GTK_BOX (side_vbox), widget->getWidget(), FALSE, TRUE, 0); @@ -1151,6 +1168,11 @@ } GtkWidget *main_vbox = gtk_vbox_new (FALSE, 0); + + widget = new DetailName(); + m_widgets.push_back (widget); + gtk_box_pack_start (GTK_BOX (main_vbox), widget->getWidget(), FALSE, TRUE, 0); + widget = new DetailDescription(); m_widgets.push_back (widget); gtk_box_pack_start (GTK_BOX (main_vbox), widget->getWidget(), FALSE, TRUE, 0); @@ -1183,14 +1205,16 @@ gtk_box_pack_start (GTK_BOX (hbox), main_vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (hbox), side_vbox, FALSE, TRUE, 0); - gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0); - g_signal_connect (G_OBJECT (vbox), "expose-event", - G_CALLBACK (text_expose_cb), detail_description); + GtkWidget *child = gtk_event_box_new(); + gtk_container_add (GTK_CONTAINER (child), hbox); + + GdkColor *color = &detail_description->style->base [GTK_STATE_NORMAL]; + gtk_widget_modify_bg (child, GTK_STATE_NORMAL, color); m_scroll = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (m_scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (m_scroll), vbox); + gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (m_scroll), child); gtk_widget_show_all (m_scroll); g_signal_connect (G_OBJECT (m_scroll), "realize", @@ -1233,18 +1257,6 @@ YGUtils::scrollWidget (vadj, true); } - static gboolean text_expose_cb (GtkWidget *widget, GdkEventExpose *event, GtkWidget *text) - { - cairo_t *cr = gdk_cairo_create (widget->window); - GdkColor *color = &text->style->base [GTK_STATE_NORMAL]; - gdk_cairo_set_source_color (cr, color); - cairo_rectangle (cr, event->area.x, event->area.y, - event->area.width, event->area.height); - cairo_fill (cr); - cairo_destroy (cr); - return FALSE; - } - // fix cursor keys support static void move_cursor_cb (GtkTextView *view, GtkMovementStep step, gint count, gboolean extend_selection, GtkWidget *scroll) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/src/pkg/ygtkpkgfilterview.cc new/yast2-gtk-2.21.52/src/pkg/ygtkpkgfilterview.cc --- old/yast2-gtk-2.21.46/src/pkg/ygtkpkgfilterview.cc 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/src/pkg/ygtkpkgfilterview.cc 2010-04-25 12:16:11.000000000 +0200 @@ -220,7 +220,19 @@ return true; } -static void upgrade_clicked_cb (GtkButton *button, YGtkPkgStatusModel *pThis) +static void upgrade_patches_clicked_cb (GtkButton *button, YGtkPkgStatusModel *pThis) +{ + Ypp::startTransactions(); + for (int i = 0; i < pThis->impl->list.size(); i++) { + Ypp::Selectable sel = pThis->impl->list.get (i); + Ypp::Package pkg (sel); + if (sel.hasUpgrade() && pkg.isCandidatePatch()) + sel.install(); + } + Ypp::finishTransactions(); +} + +static void upgrade_all_clicked_cb (GtkButton *button, YGtkPkgStatusModel *pThis) { Ypp::startTransactions(); for (int i = 0; i < pThis->impl->list.size(); i++) { @@ -231,16 +243,37 @@ Ypp::finishTransactions(); } +struct PkgHasPatchMatch : public Ypp::Match { + virtual bool match (Ypp::Selectable &sel) + { + Ypp::Package pkg (sel); + return pkg.isCandidatePatch(); + } +}; + GtkWidget *YGtkPkgStatusModel::createToolboxRow (int row) { // "Upgrade All" button if (row == 3 && !YGPackageSelector::get()->onlineUpdateMode()) { - GtkWidget *button = gtk_button_new_with_label (_("Upgrade All")); - GtkWidget *icon = gtk_image_new_from_stock (GTK_STOCK_GO_UP, GTK_ICON_SIZE_BUTTON); + PkgHasPatchMatch match; + bool hasPatches = impl->list.count (&match); + + GtkWidget *hbox = gtk_hbox_new (FALSE, 6), *button, *icon; + + button = gtk_button_new_with_label (_("Upgrade Patches")); + gtk_widget_set_sensitive (button, hasPatches); + g_signal_connect (G_OBJECT (button), "clicked", + G_CALLBACK (upgrade_patches_clicked_cb), this); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0); + + button = gtk_button_new_with_label (_("Upgrade All")); + icon = gtk_image_new_from_stock (GTK_STOCK_GO_UP, GTK_ICON_SIZE_BUTTON); gtk_button_set_image (GTK_BUTTON (button), icon); g_signal_connect (G_OBJECT (button), "clicked", - G_CALLBACK (upgrade_clicked_cb), this); - gtk_widget_show (button); - return button; + G_CALLBACK (upgrade_all_clicked_cb), this); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, TRUE, 0); + + gtk_widget_show_all (hbox); + return hbox; } return NULL; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/src/pkg/ygtkpkghistorydialog.cc new/yast2-gtk-2.21.52/src/pkg/ygtkpkghistorydialog.cc --- old/yast2-gtk-2.21.46/src/pkg/ygtkpkghistorydialog.cc 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/src/pkg/ygtkpkghistorydialog.cc 2010-04-25 12:16:11.000000000 +0200 @@ -13,6 +13,7 @@ #include "ygtkpkglistview.h" #include <gtk/gtk.h> #include "ygtktreeview.h" +#include "ygtkcellrenderertext.h" #include <zypp/parser/HistoryLogReader.h> #define FILENAME "/var/log/zypp/history" @@ -105,13 +106,17 @@ { GtkTreeIter iter; const char *icon = 0; - std::string shortcut = name; + std::string shortcut (name); if (action == _("install")) icon = GTK_STOCK_ADD; else if (action == _("upgrade")) icon = GTK_STOCK_GO_UP; else if (action == _("remove")) icon = GTK_STOCK_REMOVE; + else if (action == _("downgrade")) + icon = GTK_STOCK_GO_DOWN; + else if (action == _("re-install")) + icon = GTK_STOCK_REFRESH; else { icon = getRepositoryStockIcon (name); shortcut = "_repo"; @@ -124,21 +129,24 @@ int xpad = 0; // autoReq ? 25 : 0; const char *repo_icon = 0, *color = 0; - if (!repositoryUrl.empty()) { + bool is_patch = false; + if (action == _("upgrade") && !repositoryUrl.empty()) { + // if 'upgrade' and from '*update*' server then mark as patch repo_icon = getRepositoryStockIcon (repositoryUrl); if (repositoryUrl.find ("update") != std::string::npos) { //color = "red"; std::string tag; tag.reserve (64); - tag = "<span color=\"#999999\">("; tag += _("patch"); tag += ")</span>"; - _name += " "; _name += tag; + tag = "<small><span color=\"#999999\">"; tag += _("patch"); tag += "</span></small>"; + _name += " "; _name += tag; + is_patch = true; } } - if (autoReq) { + if (autoReq && !is_patch) { // dependency std::string tag; tag.reserve (64); - tag = "<span color=\"#999999\">("; tag += _("auto"); tag += ")</span>"; - _name += " "; _name += tag; + tag = "<small><span color=\"#999999\">"; tag += _("auto"); tag += "</span></small>"; + _name += " "; _name += tag; } gtk_list_store_append (store, &iter); @@ -236,7 +244,7 @@ { Handler *handler; std::string _date; - std::map <std::string, int> installed; + std::map <std::string, zypp::Edition> installed; ZyppHistoryParser (Handler *handler) : handler (handler) @@ -270,13 +278,23 @@ name = _item->name; descrpt = _item->edition.version(); getRepositoryInfo (_item->repoalias, repoName, repoUrl); - reqby = _item->reqby; autoreq = reqby.empty(); reqby = reqbyTreatment (reqby); - if (installed.find (name) != installed.end()) - action = _("upgrade"); - else { + reqby = _item->reqby; autoreq = reqby.empty(); + reqby = reqbyTreatment (reqby); + zypp::Edition edition = _item->edition; + std::map <std::string, zypp::Edition>::iterator it; + it = installed.find (name); + if (it == installed.end()) action = _("install"); - installed[name] = 0; + else { + zypp::Edition prev_edition = it->second; + if (edition > prev_edition) + action = _("upgrade"); + else if (edition < prev_edition) + action = _("downgrade"); + else // (edition == prev_edition) + action = _("re-install"); } + installed[name] = edition; break; } case zypp::HistoryActionID::REMOVE_e: { @@ -285,8 +303,10 @@ action = _("remove"); name = _item->name; descrpt = _item->edition.version(); - reqby = _item->reqby; autoreq = reqby.empty(); reqby = reqbyTreatment (reqby); - std::map <std::string, int>::iterator it = installed.find (name); + reqby = _item->reqby; autoreq = reqby.empty(); + reqby = reqbyTreatment (reqby); + std::map <std::string, zypp::Edition>::iterator it; + it = installed.find (name); if (it != installed.end()) installed.erase (it); break; @@ -434,8 +454,7 @@ if (column == ygtk_tree_view_get_column (YGTK_TREE_VIEW (view), 2)) { // repository char *name, *url; - gtk_tree_model_get (model, &iter, - LogListHandler::REPOSITORY_COLUMN, &name, + gtk_tree_model_get (model, &iter, LogListHandler::REPOSITORY_COLUMN, &name, LogListHandler::REPOSITORY_URL_COLUMN, &url, -1); if (name && *name) { text = name; @@ -505,7 +524,7 @@ if (!reverse) gtk_tree_view_column_pack_start (column, pix_renderer, FALSE); - renderer = gtk_cell_renderer_text_new(); + renderer = ygtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start (column, renderer, TRUE); gtk_tree_view_column_set_attributes (column, renderer, "markup", LogListHandler::NAME_COLUMN, "xpad", LogListHandler::XPAD_COLUMN, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/src/pkg/ygtkpkglanguageview.cc new/yast2-gtk-2.21.52/src/pkg/ygtkpkglanguageview.cc --- old/yast2-gtk-2.21.46/src/pkg/ygtkpkglanguageview.cc 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/src/pkg/ygtkpkglanguageview.cc 2010-04-25 12:16:11.000000000 +0200 @@ -31,7 +31,7 @@ Ypp::List list = getSelected(); if (list.size() > 0) { Ypp::Collection col (list.get (0)); - query.addCriteria (new Ypp::CollectionMatch (col)); + query.addCriteria (new Ypp::FromCollectionMatch (col)); return true; } return false; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/src/pkg/ygtkpkglistview.cc new/yast2-gtk-2.21.52/src/pkg/ygtkpkglistview.cc --- old/yast2-gtk-2.21.46/src/pkg/ygtkpkglistview.cc 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/src/pkg/ygtkpkglistview.cc 2010-04-25 12:16:11.000000000 +0200 @@ -167,6 +167,7 @@ str.reserve (128); int cmp = 0; bool hasCandidate = sel.hasCandidateVersion(); + bool patch = false; if (hasCandidate) { Ypp::Version candidate = sel.candidate(); if (sel.isInstalled()) { @@ -177,8 +178,14 @@ cmp = -1; } } - if (cmp > 0) + if (cmp > 0) { str += "<span color=\"blue\">"; + + if (sel.type() == Ypp::Selectable::PACKAGE) { + Ypp::Package pkg (sel); + patch = pkg.isCandidatePatch(); + } + } else if (cmp < 0) str += "<span color=\"red\">"; @@ -195,6 +202,8 @@ } else { str += sel.candidate().number(); + if (patch) + { str += " <small>"; str += _("patch"); str += "</small>"; } str += "</span>\n<small>"; str += sel.installed().number(); str += "</small>"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/src/pkg/ygtkpkgpatternview.cc new/yast2-gtk-2.21.52/src/pkg/ygtkpkgpatternview.cc --- old/yast2-gtk-2.21.46/src/pkg/ygtkpkgpatternview.cc 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/src/pkg/ygtkpkgpatternview.cc 2010-04-25 12:16:11.000000000 +0200 @@ -523,7 +523,7 @@ if (gtk_tree_selection_get_selected (selection, &model, &iter)) { Ypp::Selectable sel (get_iter_selectable (model, &iter)); Ypp::Collection collection (sel); - query.addCriteria (new Ypp::CollectionMatch (collection)); + query.addCriteria (new Ypp::FromCollectionMatch (collection)); return true; } return false; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/src/pkg/ygtkpkgundolist.cc new/yast2-gtk-2.21.52/src/pkg/ygtkpkgundolist.cc --- old/yast2-gtk-2.21.46/src/pkg/ygtkpkgundolist.cc 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/src/pkg/ygtkpkgundolist.cc 2010-04-25 12:16:11.000000000 +0200 @@ -183,7 +183,9 @@ #define PATH_TO_YAST_SYSCONFIG "/etc/sysconfig/yast2" #include <zypp/base/Sysconfig.h> -static bool read_PKGMGR_ACTION_AT_EXIT() +enum { CLOSE_MODE, RESTART_MODE, SUMMARY_MODE }; + +static int read_PKGMGR_ACTION_AT_EXIT() { // from yast2-ncurses, NCPackageSelector.cc std::map <std::string, std::string> sysconfig = zypp::base::sysconfig::read( PATH_TO_YAST_SYSCONFIG ); @@ -191,33 +193,53 @@ sysconfig.find("PKGMGR_ACTION_AT_EXIT"); if (it != sysconfig.end()) { yuiMilestone() << "Read sysconfig's action at pkg mgr exit value: " << it->second << endl; - return it->second == "restart"; + std::string mode (it->second); + if (mode == "restart") + return RESTART_MODE; + else if (mode == "summary") + return SUMMARY_MODE; + else //if (mode == "close") + return CLOSE_MODE; } yuiMilestone() << "Could not read PKGMGR_ACTION_AT_EXIT variable from sysconfig" << endl; return false; } -static void write_PKGMGR_ACTION_AT_EXIT (bool restart) +static void write_PKGMGR_ACTION_AT_EXIT (int mode) { // from yast2-ncurses, NCPackageSelector.cc // this is really, really stupid. But we have no other iface for writing sysconfig so far - std::string actionAtExit (restart ? "restart" : "close"); + std::string _mode; + switch (mode) { + case CLOSE_MODE: _mode = "close"; break; + case RESTART_MODE: _mode = "restart"; break; + case SUMMARY_MODE: _mode = "summary"; break; + } int ret = -1; string cmd = "sed -i 's/^[ \t]*PKGMGR_ACTION_AT_EXIT.*$/PKGMGR_ACTION_AT_EXIT=\"" + - actionAtExit + "\"/' " + PATH_TO_YAST_SYSCONFIG; + _mode + "\"/' " + PATH_TO_YAST_SYSCONFIG; ret = system(cmd.c_str()); yuiMilestone() << "Executing system cmd " << cmd << " returned " << ret << endl; } static void close_when_done_toggled_cb (GtkToggleButton *button) -{ write_PKGMGR_ACTION_AT_EXIT (!gtk_toggle_button_get_active (button)); } +{ + gtk_toggle_button_set_inconsistent (button, FALSE); + int mode = gtk_toggle_button_get_active (button) ? CLOSE_MODE : RESTART_MODE; + write_PKGMGR_ACTION_AT_EXIT (mode); +} static GtkWidget *create_close_when_done_check() { GtkWidget *check_box = gtk_check_button_new_with_label (_("Close window when done")); - bool active = !read_PKGMGR_ACTION_AT_EXIT(); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_box), active); - g_signal_connect (G_OBJECT (check_box), "toggled", - G_CALLBACK (close_when_done_toggled_cb), NULL); + int mode = read_PKGMGR_ACTION_AT_EXIT(); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_box), mode == CLOSE_MODE); + gtk_toggle_button_set_inconsistent (GTK_TOGGLE_BUTTON (check_box), mode == SUMMARY_MODE); + if (access (PATH_TO_YAST_SYSCONFIG, W_OK) != 0) { + gtk_widget_set_sensitive (check_box, FALSE); + gtk_widget_set_tooltip_text (check_box, "Cannot write to " PATH_TO_YAST_SYSCONFIG); + } + g_signal_connect_after (G_OBJECT (check_box), "toggled", + G_CALLBACK (close_when_done_toggled_cb), NULL); gtk_widget_show (check_box); return check_box; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/src/pkg/yzyppwrapper.cc new/yast2-gtk-2.21.52/src/pkg/yzyppwrapper.cc --- old/yast2-gtk-2.21.46/src/pkg/yzyppwrapper.cc 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/src/pkg/yzyppwrapper.cc 2010-04-25 12:16:11.000000000 +0200 @@ -575,14 +575,16 @@ bool Ypp::Collection::contains (Ypp::Selectable &sel) { if (m_sel.type() == Ypp::Selectable::PATCH) { - ZyppResObject object = m_sel.zyppSel()->theObj(); - ZyppPatch patch = castZyppPatch (object); - zypp::Patch::Contents contents (patch->contents()); - ZyppSelectable pkg = sel.zyppSel(); - for (zypp::Patch::Contents::Selectable_iterator it = - contents.selectableBegin(); it != contents.selectableEnd(); it++) { - if (*it == pkg) - return true; + if (m_sel.hasCandidateVersion()) { + ZyppResObject object = m_sel.zyppSel()->candidateObj(); + ZyppPatch patch = castZyppPatch (object); + zypp::Patch::Contents contents (patch->contents()); + ZyppSelectable pkg = sel.zyppSel(); + for (zypp::Patch::Contents::Selectable_iterator it = + contents.selectableBegin(); it != contents.selectableEnd(); it++) { + if (*it == pkg) + return true; + } } return false; } @@ -666,6 +668,40 @@ return pkg->group(); } +static std::map <std::string, ZyppSelectable> g_selPatch; + +static ZyppSelectable getSelPatch (Ypp::Selectable &sel) +{ + std::string name (sel.name()); + std::map <std::string, ZyppSelectable>::iterator it = g_selPatch.find (name); + if (it != g_selPatch.end()) + return it->second; + + Ypp::PoolQuery query (Ypp::Selectable::PATCH); + query.addCriteria (new Ypp::StatusMatch (Ypp::StatusMatch::NOT_INSTALLED)); + query.addCriteria (new Ypp::CollectionContainsMatch (sel)); + if (query.hasNext()) { + Ypp::Selectable patch = query.next(); + g_selPatch[name] = patch.zyppSel(); + } + else + g_selPatch[name] = NULL; + return g_selPatch[name]; +} + +bool Ypp::Package::isCandidatePatch() +{ + if (m_sel.hasCandidateVersion() && m_sel.hasInstalledVersion()) { + Ypp::Version candidate (m_sel.candidate()), installed (m_sel.installed()); + if (candidate > installed) + return getSelPatch (m_sel) != NULL; + } + return false; +} + +Ypp::Selectable Ypp::Package::getCandidatePatch() +{ return Selectable (getSelPatch (m_sel)); } + // Patch Ypp::Patch::Patch (Ypp::Selectable &sel) @@ -992,12 +1028,21 @@ return m_group.compare (0, len, pkg_group, 0, len) == 0; } -Ypp::CollectionMatch::CollectionMatch (Collection &col) +Ypp::FromCollectionMatch::FromCollectionMatch (Collection &col) : m_collection (col) {} -bool Ypp::CollectionMatch::match (Selectable &sel) +bool Ypp::FromCollectionMatch::match (Selectable &sel) { return m_collection.contains (sel); } +Ypp::CollectionContainsMatch::CollectionContainsMatch (Ypp::Selectable &sel) +: m_contains (sel) {} + +bool Ypp::CollectionContainsMatch::match (Ypp::Selectable &sel) +{ + Collection collection (sel); + return collection.contains (m_contains); +} + struct Ypp::PoolQuery::Impl { ZyppQuery query; std::list <Match *> criterias; @@ -1404,5 +1449,6 @@ g_busy_running = false; g_patternsContent.clear(); g_languagesContent.clear(); + g_selPatch.clear(); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-gtk-2.21.46/src/pkg/yzyppwrapper.h new/yast2-gtk-2.21.52/src/pkg/yzyppwrapper.h --- old/yast2-gtk-2.21.46/src/pkg/yzyppwrapper.h 2010-04-22 16:53:55.000000000 +0200 +++ new/yast2-gtk-2.21.52/src/pkg/yzyppwrapper.h 2010-04-25 12:16:11.000000000 +0200 @@ -110,7 +110,7 @@ bool m_onlyInfo; }; - // Selectable & related funcs + // Selectable & complementory structs struct Version { Version (ZyppResObject zobj); @@ -219,6 +219,9 @@ YPkgGroupEnum group(); std::string rpm_group(); + bool isCandidatePatch(); + Selectable getCandidatePatch(); + private: Selectable m_sel; }; @@ -324,13 +327,20 @@ private: std::string m_group; }; - struct CollectionMatch : public Match { - CollectionMatch (Collection &col); + struct FromCollectionMatch : public Match { + FromCollectionMatch (Collection &col); virtual bool match (Selectable &sel); private: Collection m_collection; }; + struct CollectionContainsMatch : public Match { + CollectionContainsMatch (Selectable &sel); + virtual bool match (Selectable &collection); + + private: Selectable m_contains; + }; + struct SupportMatch : public Match { SupportMatch (int n) : m_n (n) {} virtual bool match (Selectable &sel) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org