Hello community,
here is the log from the commit of package yast2-gtk
checked in at Tue Jun 3 11:06:42 CEST 2008.
--------
--- yast2-gtk/yast2-gtk.changes 2008-05-20 03:13:56.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-gtk/yast2-gtk.changes 2008-06-03 07:53:50.144343000 +0200
@@ -1,0 +2,8 @@
+Tue Jun 3 07:46:59 CEST 2008 - coolo@suse.de
+
+- Update to version 2.16.13
+* tag more missing strings for translation (bnc#395803)
+* fixed bnc#395484
+* various fixes in the package selector by Ricardo
+
+-------------------------------------------------------------------
Old:
----
yast2-gtk-2.16.12.tar.bz2
New:
----
yast2-gtk-2.16.13.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-gtk.spec ++++++
--- /var/tmp/diff_new_pack.g18896/_old 2008-06-03 11:06:32.000000000 +0200
+++ /var/tmp/diff_new_pack.g18896/_new 2008-06-03 11:06:32.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-gtk (Version 2.16.12)
+# spec file for package yast2-gtk (Version 2.16.13)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -13,12 +13,12 @@
Url: http://en.opensuse.org/YaST2-GTK
Name: yast2-gtk
-Version: 2.16.12
+Version: 2.16.13
Release: 1
License: LGPL v2.1 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-gtk-2.16.12.tar.bz2
+Source0: yast2-gtk-2.16.13.tar.bz2
Prefix: /usr
Source2: yast2-gtk-rpmlintrc
BuildRequires: blocxx-devel gcc-c++ gtk2-devel libxcrypt-devel libzypp-devel yast2-devtools
@@ -41,7 +41,7 @@
Michael Meeks
%prep
-%setup -n yast2-gtk-2.16.12
+%setup -n yast2-gtk-2.16.13
%build
%{prefix}/bin/y2tool y2autoconf
@@ -70,8 +70,12 @@
%doc %{prefix}/share/doc/packages/yast2-gtk
%{_libdir}/YaST2/plugin/libpy2gtk.so.*
%{_libdir}/YaST2/plugin/libpy2gtk.so
-
%changelog
+* Tue Jun 03 2008 coolo@suse.de
+- Update to version 2.16.13
+ * tag more missing strings for translation (bnc#395803)
+ * fixed bnc#395484
+ * various fixes in the package selector by Ricardo
* Mon May 19 2008 mmichael@suse.de
- Update to version 2.16.12
* make PackageSelector more usable bnc #390471
++++++ yast2-gtk-2.16.12.tar.bz2 -> yast2-gtk-2.16.13.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/ChangeLog new/yast2-gtk-2.16.13/ChangeLog
--- old/yast2-gtk-2.16.12/ChangeLog 2008-05-19 16:43:51.000000000 +0200
+++ new/yast2-gtk-2.16.13/ChangeLog 2008-06-03 07:46:11.000000000 +0200
@@ -1,3 +1,57 @@
+2008-06-02 Michael Meeks
+
+ * src/YGUI.cc (YGApplication::makeScreenShot),
+ * src/ygtkwizard.c (ygtk_help_dialog_init),
+ * src/ygtkwizard.c (sync_window_title): tag more missing
+ strings for translation in the next version bug #395803#
+
+2008-06-02 Ricardo Cruz
+
+ * src/YGUI.cc: fixed bug 395484. Wrong check that assumed error
+ was set, crashing...
+
+2008-05-28 Ricardo Cruz
+
+ * src/YGDialog.cc: bug fix: seems like we shouldn't unref the
+ cursor -- GdkWindow will do that for us. This was crashing
+ for bug 393143...
+
+ * src/yzyppwrapper.h/cc: some hacks to add a second categories tree
+ for the yast-qt groups.
+ * src/yzypptags.h/cc: copied yast-qt categories treatment.
+ * src/YGPackageSelector.cc: added Groups option to type combo.
+
+2008-05-26 Ricardo Cruz
+
+ * src/YGTextView.cc, src/YGUI.cc & src/ygtkwizard.c: changed
+ gdk_beep() to the new GTK gtk_widget_error_bell() call. This one
+ will use the visual bell if setup at the "Sound" module from the
+ Gnome control center.
+
+ * src/YGDialog.cc: don't re-use the cursor -- possible fix for
+ bug 393143?
+
+2008-05-23 Ricardo Cruz
+
+ * src/YGPackageSelector (PackageControl): regresses to the old
+ buttons code until r47296. This aligns them vertically: wether
+ we want to align them horizontally or not, it's better we use
+ again this tested code...
+ Something interesting would be to compact the versions if the
+ pane area was small... Recurring to a notebook or expanders that
+ contract...
+ I guess we could also consider putting all the versions on the
+ combo, with the default selected on depending on the view: if
+ available, select some to upgrade. If install, selected installed...
+ The installed could have both Remove and Replace buttons I guess,
+ to avoid duplicating the entry...
+
+ * src/ygtkwizard.c: bug fix 385710: keep wizard and window title
+ sync-ed as wizard widgets can be added and removed at any point...
+
+ * src/YGPackageSelector (ChangePane): bug fix 391401: set pane
+ width based on the font char width...
+
2008-05-19 Michael Meeks
* Version 2.16.12
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/configure new/yast2-gtk-2.16.13/configure
--- old/yast2-gtk-2.16.12/configure 2008-05-07 19:22:13.000000000 +0200
+++ new/yast2-gtk-2.16.13/configure 2008-06-03 07:52:09.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for yast2-gtk 2.16.9.
+# Generated by GNU Autoconf 2.61 for yast2-gtk 2.16.13.
#
# Report bugs to http://bugs.opensuse.org/.
#
@@ -728,8 +728,8 @@
# Identity of this package.
PACKAGE_NAME='yast2-gtk'
PACKAGE_TARNAME='yast2-gtk'
-PACKAGE_VERSION='2.16.9'
-PACKAGE_STRING='yast2-gtk 2.16.9'
+PACKAGE_VERSION='2.16.13'
+PACKAGE_STRING='yast2-gtk 2.16.13'
PACKAGE_BUGREPORT='http://bugs.opensuse.org/'
ac_unique_file="RPMNAME"
@@ -1446,7 +1446,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures yast2-gtk 2.16.9 to adapt to many kinds of systems.
+\`configure' configures yast2-gtk 2.16.13 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1517,7 +1517,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of yast2-gtk 2.16.9:";;
+ short | recursive ) echo "Configuration of yast2-gtk 2.16.13:";;
esac
cat <<\_ACEOF
@@ -1628,7 +1628,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-yast2-gtk configure 2.16.9
+yast2-gtk configure 2.16.13
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1642,7 +1642,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by yast2-gtk $as_me 2.16.9, which was
+It was created by yast2-gtk $as_me 2.16.13, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -2463,7 +2463,7 @@
# Define the identity of the package.
PACKAGE='yast2-gtk'
- VERSION='2.16.9'
+ VERSION='2.16.13'
cat >>confdefs.h <<_ACEOF
@@ -2691,7 +2691,7 @@
-VERSION="2.16.9"
+VERSION="2.16.13"
RPMNAME="yast2-gtk"
MAINTAINER="Ricardo Cruz \
Michael Meeks "
@@ -22308,7 +22308,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by yast2-gtk $as_me 2.16.9, which was
+This file was extended by yast2-gtk $as_me 2.16.13, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -22361,7 +22361,7 @@
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-yast2-gtk config.status 2.16.9
+yast2-gtk config.status 2.16.13
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/configure.in new/yast2-gtk-2.16.13/configure.in
--- old/yast2-gtk-2.16.12/configure.in 2008-05-07 19:21:58.000000000 +0200
+++ new/yast2-gtk-2.16.13/configure.in 2008-06-03 07:51:55.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.16.7 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-gtk, 2.16.9, http://bugs.opensuse.org/, yast2-gtk)
+AC_INIT(yast2-gtk, 2.16.13, http://bugs.opensuse.org/, yast2-gtk)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.16.9"
+VERSION="2.16.13"
RPMNAME="yast2-gtk"
MAINTAINER="Ricardo Cruz \
Michael Meeks "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/README new/yast2-gtk-2.16.13/README
--- old/yast2-gtk-2.16.12/README 2008-05-19 17:59:35.000000000 +0200
+++ new/yast2-gtk-2.16.13/README 2008-06-03 07:53:44.000000000 +0200
@@ -17,7 +17,7 @@
To make this compile you'll need the following packages installed
(at a minimum):
- yast2-devtools yast2-core-devel libzypp libzypp-devel gettext-devel
+ g++, gtk2-devel, yast2-devtools yast2-core-devel libzypp-devel
They all are distributed with Suse's CDs.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/Makefile.am new/yast2-gtk-2.16.13/src/Makefile.am
--- old/yast2-gtk-2.16.12/src/Makefile.am 2008-05-13 17:16:09.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/Makefile.am 2008-06-03 07:42:03.000000000 +0200
@@ -54,6 +54,7 @@
ygtkhtmlwrap.c \
ygtkrichtext.c \
yzyppwrapper.cc \
+ yzypptags.cc \
ygtkzyppwrapper.cc
# should only append ygtkrichtext.c if USE_GTKHTML is set
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/Makefile.in new/yast2-gtk-2.16.13/src/Makefile.in
--- old/yast2-gtk-2.16.12/src/Makefile.in 2008-05-14 14:11:26.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/Makefile.in 2008-06-03 07:52:12.000000000 +0200
@@ -69,7 +69,8 @@
ygtkmenubutton.lo ygtkwizard.lo ygtkfindentry.lo \
ygdkmngloader.lo ygtkimage.lo ygtkcellrenderertextpixbuf.lo \
ygtkscrolledwindow.lo ygtktogglebutton.lo ygtkhtmlwrap.lo \
- ygtkrichtext.lo yzyppwrapper.lo ygtkzyppwrapper.lo
+ ygtkrichtext.lo yzyppwrapper.lo yzypptags.lo \
+ ygtkzyppwrapper.lo
libpy2gtk_la_OBJECTS = $(am_libpy2gtk_la_OBJECTS)
libpy2gtk_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
@@ -312,6 +313,7 @@
ygtkhtmlwrap.c \
ygtkrichtext.c \
yzyppwrapper.cc \
+ yzypptags.cc \
ygtkzyppwrapper.cc
# should only append ygtkrichtext.c if USE_GTKHTML is set
@@ -469,6 +471,7 @@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ygtktogglebutton.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ygtkwizard.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ygtkzyppwrapper.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yzypptags.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yzyppwrapper.Plo@am__quote@
.c.o:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/YGDialog.cc new/yast2-gtk-2.16.13/src/YGDialog.cc
--- old/yast2-gtk-2.16.12/src/YGDialog.cc 2008-05-19 16:43:51.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/YGDialog.cc 2008-06-03 07:42:03.000000000 +0200
@@ -209,12 +209,8 @@
void busyCursor()
{
if (GTK_WIDGET_REALIZED (m_widget)) {
- // GdkDisplay won't change for new dialogs
- static GdkCursor *cursor = NULL;
- if (!cursor) {
- GdkDisplay *display = gtk_widget_get_display (m_widget);
- cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
- }
+ GdkDisplay *display = gtk_widget_get_display (m_widget);
+ GdkCursor *cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
gdk_window_set_cursor (m_widget->window, cursor);
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/YGi18n.h new/yast2-gtk-2.16.13/src/YGi18n.h
--- old/yast2-gtk-2.16.12/src/YGi18n.h 2008-05-12 14:50:14.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/YGi18n.h 2008-06-03 07:46:11.000000000 +0200
@@ -25,15 +25,16 @@
#define TEXTDOMAIN "yast2-gtk"
-inline const char * _( const char * msgid )
+static inline const char * _( const char * msgid )
{
return ( !msgid || !*msgid ) ? "" : dgettext( TEXTDOMAIN, msgid );
}
-inline const char * _( const char * msgid1, const char * msgid2, unsigned long int n )
+#ifndef YGI18N_C
+static inline const char * _( const char * msgid1, const char * msgid2, unsigned long int n )
{
return dngettext( TEXTDOMAIN, msgid1, msgid2, n );
}
-
+#endif
#endif // YGi18n_h
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/YGPackageSelector.cc new/yast2-gtk-2.16.13/src/YGPackageSelector.cc
--- old/yast2-gtk-2.16.12/src/YGPackageSelector.cc 2008-05-19 16:43:51.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/YGPackageSelector.cc 2008-06-03 07:42:03.000000000 +0200
@@ -713,11 +713,12 @@
m_box = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (m_box), m_label, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (m_box), m_button, FALSE, FALSE, 0);
- gtk_widget_set_size_request (m_box, 140, -1);
gtk_widget_show_all (m_box);
modified (package);
g_signal_connect (G_OBJECT (m_label), "style-set",
- G_CALLBACK (style_set_cb), NULL);
+ G_CALLBACK (label_style_set_cb), NULL);
+ g_signal_connect (G_OBJECT (m_box), "style-set",
+ G_CALLBACK (box_style_set_cb), NULL);
g_signal_connect (G_OBJECT (m_button), "clicked",
G_CALLBACK (undo_clicked_cb), package);
}
@@ -757,7 +758,7 @@
package->undo();
}
- static void style_set_cb (GtkWidget *widget, GtkStyle *prev_style)
+ static void label_style_set_cb (GtkWidget *widget, GtkStyle *prev_style)
{
static bool safeguard = false;
if (safeguard) return;
@@ -766,6 +767,11 @@
gtk_widget_modify_fg (widget, GTK_STATE_NORMAL, color);
safeguard = false;
}
+ static void box_style_set_cb (GtkWidget *widget, GtkStyle *prev_style)
+ {
+ int width = YGUtils::getCharsWidth (widget, 22);
+ gtk_widget_set_size_request (widget, width, -1);
+ }
};
GtkWidget *m_box, *m_entries_box, *m_container;
@@ -784,7 +790,7 @@
YGUtils::setWidgetFont (heading, PANGO_WEIGHT_ULTRABOLD, PANGO_SCALE_LARGE);
gtk_misc_set_alignment (GTK_MISC (heading), 0, 0.5);
g_signal_connect (G_OBJECT (heading), "style-set",
- G_CALLBACK (Entry::style_set_cb), NULL);
+ G_CALLBACK (Entry::label_style_set_cb), NULL);
m_entries_box = gtk_vbox_new (FALSE, 4);
GtkWidget *port = gtk_viewport_new (NULL, NULL);
@@ -893,29 +899,6 @@
}
};
-// Maps icons to top package groups
-struct CategoriesIconMap {
- const char *category, *icon;
-};
-static const CategoriesIconMap catIconMap[] = {
- { "Amusements", "package_games" },
- { "Games", "package_games" },
- { "Applications", "package_system" },
- { "Development", "applications-development" },
- { "Libraries", "package_development" },
- { "Documentation", "package_documentation" },
- { "Hardware", "package_settings_peripherals" },
- { "Productivity", "package_applications" },
- { "System", "package_settings" },
- { "Multimedia", "package_multimedia" },
- { "Video", "package_multimedia" },
- { "Office", "applications-office" },
- { "Publishing", "applications-office" },
- { "X11", "applications-other" },
- { "Metapackages", "package_network" },
-};
-#define CAT_SIZE (sizeof (catIconMap)/sizeof (CategoriesIconMap))
-
#include "icons/pkg-installed.xpm"
#include "icons/pkg-installed-upgradable.xpm"
#include "icons/pkg-available.xpm"
@@ -946,12 +929,13 @@
struct Categories : public View
{
GtkWidget *m_scroll, *m_view;
+ bool m_alternative; // use second categories...
public:
virtual GtkWidget *getWidget()
{ return m_scroll; }
- Categories (Collections::Listener *listener, Ypp::Package::Type type)
- : View (listener)
+ Categories (Collections::Listener *listener, Ypp::Package::Type type, bool alternative)
+ : View (listener), m_alternative (alternative)
{
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
@@ -996,32 +980,25 @@
struct inner {
static void populate (GtkTreeStore *store, GtkTreeIter *parent,
- Ypp::Node *category)
+ Ypp::Node *category, Categories *pThis)
{
if (!category)
return;
GtkTreeIter iter;
gtk_tree_store_append (store, &iter, parent);
const std::string &name = category->name;
+ const char *icon = category->icon;
gtk_tree_store_set (store, &iter, 0, name.c_str(), 1, category, -1);
- if (!parent) {
- const gchar *icon = 0;
- for (unsigned int i = 0; i < CAT_SIZE; i++)
- if (name == catIconMap[i].category) {
- icon = catIconMap[i].icon;
- break;
- }
- if (icon) {
- GdkPixbuf *pixbuf = loadIcon (icon);
- gtk_tree_store_set (store, &iter, 2, pixbuf, -1);
- if (pixbuf)
- g_object_unref (G_OBJECT (pixbuf));
- }
+ if (icon) {
+ GdkPixbuf *pixbuf = loadThemeIcon (icon);
+ gtk_tree_store_set (store, &iter, 2, pixbuf, -1);
+ if (pixbuf)
+ g_object_unref (G_OBJECT (pixbuf));
}
- populate (store, &iter, category->child());
- populate (store, parent, category->next());
+ populate (store, &iter, category->child(), pThis);
+ populate (store, parent, category->next(), pThis);
}
- static GdkPixbuf *loadIcon (const char *icon)
+ static GdkPixbuf *loadThemeIcon (const char *icon)
{
GtkIconTheme *icons = gtk_icon_theme_get_default();
GdkPixbuf *pixbuf = gtk_icon_theme_load_icon (icons, icon, 22,
@@ -1043,15 +1020,23 @@
gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter, 0, _("All"), 1, NULL, -1);
- inner::populate (store, NULL, Ypp::get()->getFirstCategory (type));
- GdkPixbuf *pixbuf = inner::loadIcon (GTK_STOCK_ABOUT);
- gtk_tree_store_append (store, &iter, NULL);
- gtk_tree_store_set (store, &iter, 0, _("Recommended"), 1, GINT_TO_POINTER (1),
- 2, pixbuf, -1);
- gtk_tree_store_append (store, &iter, NULL);
- gtk_tree_store_set (store, &iter, 0, _("Suggested"), 1, GINT_TO_POINTER (2),
- 2, pixbuf, -1);
- g_object_unref (G_OBJECT (pixbuf));
+ Ypp::Node *first_category;
+ if (m_alternative)
+ first_category = Ypp::get()->getFirstCategory2 (type);
+ else
+ first_category = Ypp::get()->getFirstCategory (type);
+ inner::populate (store, NULL, first_category, this);
+ if (m_alternative) {
+ GdkPixbuf *pixbuf = inner::loadThemeIcon (GTK_STOCK_ABOUT);
+ gtk_tree_store_append (store, &iter, NULL);
+ gtk_tree_store_set (store, &iter, 0, _("Recommended"), 1, GINT_TO_POINTER (1),
+ 2, pixbuf, -1);
+ gtk_tree_store_append (store, &iter, NULL);
+ gtk_tree_store_set (store, &iter, 0, _("Suggested"), 1, GINT_TO_POINTER (2),
+ 2, pixbuf, -1);
+ g_object_unref (G_OBJECT (pixbuf));
+ gtk_tree_view_set_show_expanders (view, FALSE);
+ }
gtk_tree_view_set_model (view, model);
g_object_unref (G_OBJECT (model));
@@ -1102,8 +1087,12 @@
else
node = (Ypp::Node *) ptr;
}
- if (node)
- query->addCategory (node);
+ if (node) {
+ if (m_alternative)
+ query->addCategory2 (node);
+ else
+ query->addCategory (node);
+ }
}
};
@@ -1200,7 +1189,7 @@
GtkWidget *getWidget()
{ return m_bin; }
- void setType (Ypp::Package::Type type)
+ void setType (Ypp::Package::Type type, bool alternative = false)
{
if (m_view)
gtk_container_remove (GTK_CONTAINER (m_bin), m_view->getWidget());
@@ -1210,7 +1199,7 @@
{
case Ypp::Package::PACKAGE_TYPE:
case Ypp::Package::PATCH_TYPE:
- m_view = new Categories (m_listener, type);
+ m_view = new Categories (m_listener, type, alternative);
break;
case Ypp::Package::PATTERN_TYPE:
//case Ypp::Package::LANGUAGE_TYPE:
@@ -1313,9 +1302,11 @@
GtkWidget *m_name, *m_repos, *m_type;
Listener *m_listener;
guint timeout_id;
- int m_selectedType;
bool m_updateMode, m_enableRepoMgr;
+ enum PaneType { GROUPS_TYPE, CATEGORIES_TYPE, PATTERNS_TYPE };
+ int m_selectedType;
+
public:
GtkWidget *getCollectionWidget() { return m_collection->getWidget(); }
GtkWidget *getStatusesWidget() { return m_statuses->getWidget(); }
@@ -1324,8 +1315,8 @@
GtkWidget *getTypeWidget() { return m_type; }
Filters (bool updateMode, bool enableRepoMgr)
- : m_listener (NULL), timeout_id (0), m_selectedType (-1),
- m_updateMode (updateMode), m_enableRepoMgr (enableRepoMgr)
+ : m_listener (NULL), timeout_id (0), m_updateMode (updateMode),
+ m_enableRepoMgr (enableRepoMgr), m_selectedType (-1)
{
m_collection = new Collections (this);
m_statuses = new StatusButtons (this, updateMode);
@@ -1378,6 +1369,7 @@
if (updateMode)
gtk_combo_box_append_text (GTK_COMBO_BOX (m_type), _("Patches"));
else {
+ gtk_combo_box_append_text (GTK_COMBO_BOX (m_type), _("Groups"));
gtk_combo_box_append_text (GTK_COMBO_BOX (m_type), _("Categories"));
gtk_combo_box_append_text (GTK_COMBO_BOX (m_type), _("Patterns"));
#if 0
@@ -1429,16 +1421,24 @@
{
if (!m_listener) return;
+ PaneType t = (PaneType) gtk_combo_box_get_active (GTK_COMBO_BOX (m_type));
+ bool alternative = false;
Ypp::Package::Type type;
if (m_updateMode)
type = Ypp::Package::PATCH_TYPE;
- else
- type = (Ypp::Package::Type) gtk_combo_box_get_active (GTK_COMBO_BOX (m_type));
+ else {
+ if (t == PATTERNS_TYPE)
+ type = Ypp::Package::PATTERN_TYPE;
+ else {
+ type = Ypp::Package::PACKAGE_TYPE;
+ alternative = t == GROUPS_TYPE;
+ }
+ }
// adjust interface
- if (type != m_selectedType) {
- m_collection->setType (type);
- m_selectedType = type;
+ if (t != m_selectedType) {
+ m_collection->setType (type, alternative);
+ m_selectedType = t;
}
// create query
@@ -1523,11 +1523,8 @@
PackageControl (Filters *filters)
: m_filters (filters)
{
- GtkWidget *box;
-
// installed
- m_remove_button = createButton (NULL, GTK_STOCK_DELETE);
- gtk_widget_set_tooltip_text (m_remove_button, _("Remove"));
+ m_remove_button = createButton (_("_Remove"), GTK_STOCK_DELETE);
g_signal_connect (G_OBJECT (m_remove_button), "clicked",
G_CALLBACK (remove_clicked_cb), this);
@@ -1535,22 +1532,17 @@
gtk_label_set_selectable (GTK_LABEL (m_installed_version), TRUE);
gtk_misc_set_alignment (GTK_MISC (m_installed_version), 0, 0.5);
- box = gtk_vbox_new (FALSE, 2);
- gtk_box_pack_start (GTK_BOX (box), createBoldLabel (_("Installed:")),
+ m_installed_box = gtk_vbox_new (FALSE, 2);
+ gtk_box_pack_start (GTK_BOX (m_installed_box), createBoldLabel (_("Installed:")),
FALSE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (box), m_installed_version, FALSE, TRUE, 0);
-
- m_installed_box = gtk_hbox_new (FALSE, 2);
- gtk_box_pack_start (GTK_BOX (m_installed_box), box, TRUE, TRUE, 0);
- box = gtk_alignment_new (0, 1, 0, 0);
- gtk_container_add (GTK_CONTAINER (box), m_remove_button);
- gtk_box_pack_start (GTK_BOX (m_installed_box), box, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_installed_box), m_installed_version, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_installed_box), m_remove_button, FALSE, TRUE, 0);
// available
- const char *install_label = _("Install");
- m_install_button = createButton (install_label, GTK_STOCK_SAVE);
+ m_install_button = createButton ("", GTK_STOCK_SAVE);
g_signal_connect (G_OBJECT (m_install_button), "clicked",
G_CALLBACK (install_clicked_cb), this);
+
m_available_versions = gtk_combo_box_new();
GtkListStore *store = gtk_list_store_new (1, G_TYPE_STRING);
gtk_combo_box_set_model (GTK_COMBO_BOX (m_available_versions),
@@ -1563,25 +1555,19 @@
g_signal_connect (G_OBJECT (m_available_versions), "changed",
G_CALLBACK (version_changed_cb), this);
- box = gtk_vbox_new (FALSE, 2);
- gtk_box_pack_start (GTK_BOX (box), createBoldLabel (_("Available:")),
+ m_available_box = gtk_vbox_new (FALSE, 2);
+ gtk_box_pack_start (GTK_BOX (m_available_box), createBoldLabel (_("Available:")),
FALSE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (box), m_available_versions, FALSE, TRUE, 0);
-
- m_available_box = gtk_hbox_new (FALSE, 2);
- gtk_box_pack_start (GTK_BOX (m_available_box), box, TRUE, TRUE, 0);
- box = gtk_alignment_new (0, 1, 0, 0);
- gtk_container_add (GTK_CONTAINER (box), m_install_button);
- gtk_box_pack_start (GTK_BOX (m_available_box), box, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_available_box), m_available_versions, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_available_box), m_install_button, FALSE, TRUE, 0);
- // final box
m_widget = gtk_vbox_new (FALSE, 12);
gtk_box_pack_start (GTK_BOX (m_widget), m_installed_box, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (m_widget), m_available_box, FALSE, TRUE, 0);
#ifdef SHOW_LOCK_UNDO_BUTTON
m_lock_button = gtk_toggle_button_new();
- gtk_widget_set_tooltip_markup (m_lock_button, _(lock_tooltip));
+ gtk_widget_set_tooltip_markup (m_lock_button, lock_tooltip);
g_signal_connect (G_OBJECT (m_lock_button), "toggled",
G_CALLBACK (locked_toggled_cb), this);
m_locked_image = createImageFromXPM (pkg_locked_xpm);
@@ -1667,12 +1653,12 @@
if (packages.upgradable()) {
gtk_combo_box_append_text (GTK_COMBO_BOX (m_available_versions), "(upgrades)");
gtk_combo_box_set_active (GTK_COMBO_BOX (m_available_versions), 0);
- setInstallButtonIcon (GTK_STOCK_GO_UP, _("Upgrade"));
+ gtk_button_set_label (GTK_BUTTON (m_install_button), _("Upgrade"));
}
else if (packages.notInstalled()) {
gtk_combo_box_append_text (GTK_COMBO_BOX (m_available_versions), "(several)");
gtk_combo_box_set_active (GTK_COMBO_BOX (m_available_versions), 0);
- setInstallButtonIcon (GTK_STOCK_SAVE, _("Install"));
+ gtk_button_set_label (GTK_BUTTON (m_install_button), _("Install"));
}
else
gtk_widget_hide (m_available_box);
@@ -1748,14 +1734,6 @@
}
#endif
- void setInstallButtonIcon (const char *stock_icon, const char *tooltip)
- {
- GtkWidget *image = gtk_image_new_from_stock (stock_icon, GTK_ICON_SIZE_BUTTON);
- gtk_widget_show (image);
- gtk_button_set_image (GTK_BUTTON (m_install_button), image);
- gtk_widget_set_tooltip_text (m_install_button, tooltip);
- }
-
static void version_changed_cb (GtkComboBox *combo, PackageControl *pThis)
{
if (pThis->m_packages.single()) {
@@ -1767,22 +1745,16 @@
version = package->getAvailableVersion (nb);
assert (version != NULL);
- const char *tooltip = _("Install"), *stock = GTK_STOCK_SAVE;
+ const char *installLabel = _("Install");
if (package->isInstalled()) {
- if (version->cmp > 0) {
- tooltip = _("Upgrade");
- stock = GTK_STOCK_GO_UP;
- }
- else if (version->cmp == 0) {
- tooltip = _("Re-install");
- stock = GTK_STOCK_REFRESH;
- }
- else { //if (version->cmp < 0)
- tooltip = _("Downgrade");
- stock = GTK_STOCK_GO_DOWN;
- }
+ if (version->cmp > 0)
+ installLabel = _("Upgrade");
+ else if (version->cmp == 0)
+ installLabel = _("Re-install");
+ else //if (version->cmp < 0)
+ installLabel = _("Downgrade");
}
- pThis->setInstallButtonIcon (stock, tooltip);
+ gtk_button_set_label (GTK_BUTTON (pThis->m_install_button), installLabel);
}
}
@@ -2384,9 +2356,9 @@
MAX (enlarge_height, GTK_WIDGET (window)->allocation.height));
YGtkWizard *wizard = YGTK_WIZARD (getWidget());
- ygtk_wizard_set_header_icon (wizard, window,
+ ygtk_wizard_set_header_icon (wizard,
THEMEDIR "/icons/22x22/apps/yast-software.png");
- ygtk_wizard_set_header_text (wizard, window,
+ ygtk_wizard_set_header_text (wizard,
onlineUpdateMode() ? _("Patch Selection") : _("Package Selection"));
ygtk_wizard_set_abort_button_label (wizard, _("_Cancel"));
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/YGTextView.cc new/yast2-gtk-2.16.13/src/YGTextView.cc
--- old/yast2-gtk-2.16.12/src/YGTextView.cc 2008-05-07 15:06:50.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/YGTextView.cc 2008-06-03 07:42:03.000000000 +0200
@@ -89,7 +89,7 @@
{
if (pThis->maxChars != -1 && pThis->getCharsNb() > pThis->maxChars) {
pThis->truncateText (pThis->maxChars);
- gdk_beep();
+ gtk_widget_error_bell (pThis->getWidget());
}
pThis->emitEvent (YEvent::ValueChanged);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/ygtkwizard.c new/yast2-gtk-2.16.13/src/ygtkwizard.c
--- old/yast2-gtk-2.16.12/src/ygtkwizard.c 2008-05-13 17:16:09.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/ygtkwizard.c 2008-06-03 07:46:11.000000000 +0200
@@ -14,6 +14,8 @@
#include "ygtkhtmlwrap.h"
#include "ygtksteps.h"
#include "ygtkfindentry.h"
+#define YGI18N_C
+#include "YGi18n.h"
#define BUTTONS_SPACING 12
#define BORDER 4
@@ -56,7 +58,7 @@
white = { 0, 255 << 8, 255 << 8, 255 << 8 };
gtk_widget_modify_base (dialog->search_entry, GTK_STATE_NORMAL, &red);
gtk_widget_modify_text (dialog->search_entry, GTK_STATE_NORMAL, &white);
- gdk_beep();
+ gtk_widget_error_bell (GTK_WIDGET (dialog));
}
else {
gtk_widget_modify_base (dialog->search_entry, GTK_STATE_NORMAL, NULL);
@@ -75,7 +77,7 @@
gtk_window_set_type_hint (GTK_WINDOW (dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
- gtk_window_set_title (GTK_WINDOW (dialog), "Help");
+ gtk_window_set_title (GTK_WINDOW (dialog), _("Help"));
gtk_window_set_default_size (GTK_WINDOW (dialog), 400, 350);
// title
@@ -86,7 +88,7 @@
gtk_container_set_border_width (GTK_CONTAINER (dialog->title_box), 6);
dialog->title_image = gtk_image_new_from_stock (GTK_STOCK_HELP,
GTK_ICON_SIZE_LARGE_TOOLBAR);
- dialog->title_label = gtk_label_new ("Help");
+ dialog->title_label = gtk_label_new (_("Help"));
set_label_header (dialog->title_label, 0);
gtk_box_pack_start (GTK_BOX (dialog->title_box), dialog->title_image,
FALSE, FALSE, 0);
@@ -606,32 +608,49 @@
return TRUE;
}
-void ygtk_wizard_set_header_text (YGtkWizard *wizard, GtkWindow *window,
- const char *text)
+static void sync_window_title (YGtkWizard *wizard)
{
- gtk_label_set_text (GTK_LABEL (wizard->m_title_label), text);
- if (window) {
- char *title = g_strdup_printf ("%s - YaST", text);
- gtk_window_set_title (window, title);
+ GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (wizard));
+ if (GTK_WIDGET_TOPLEVEL (window)) {
+ const gchar *_title = gtk_label_get_text (GTK_LABEL (wizard->m_title_label));
+ char *title;
+ if (*_title == '\0')
+ title = g_strdup (_("YaST"));
+ else
+ title = g_strdup_printf (_("%s - YaST"), _title);
+ GdkPixbuf *pixbuf = gtk_image_get_pixbuf (GTK_IMAGE (wizard->m_title_image));
+
+ gtk_window_set_title (GTK_WINDOW (window), title);
+ gtk_window_set_icon (GTK_WINDOW (window), pixbuf);
+
g_free (title);
}
}
-gboolean ygtk_wizard_set_header_icon (YGtkWizard *wizard, GtkWindow *window,
- const char *icon)
+void ygtk_wizard_set_header_text (YGtkWizard *wizard, const char *text)
+{
+ gtk_label_set_text (GTK_LABEL (wizard->m_title_label), text);
+ sync_window_title (wizard);
+}
+
+gboolean ygtk_wizard_set_header_icon (YGtkWizard *wizard, const char *icon)
{
GError *error = 0;
GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (icon, &error);
if (!pixbuf)
return FALSE;
-
gtk_image_set_from_pixbuf (GTK_IMAGE (wizard->m_title_image), pixbuf);
- if (window)
- gtk_window_set_icon (window, pixbuf);
g_object_unref (G_OBJECT (pixbuf));
+ sync_window_title (wizard);
return TRUE;
}
+static void ygtk_wizard_map (GtkWidget *widget)
+{
+ GTK_WIDGET_CLASS (ygtk_wizard_parent_class)->map (widget);
+ sync_window_title (YGTK_WIZARD (widget));
+}
+
void ygtk_wizard_set_abort_button_label (YGtkWizard *wizard, const char *text)
{
gtk_button_set_label (GTK_BUTTON (wizard->m_abort_button), text);
@@ -1283,6 +1302,7 @@
widget_class->size_request = ygtk_wizard_size_request;
widget_class->size_allocate = ygtk_wizard_size_allocate;
widget_class->get_accessible = ygtk_wizard_get_accessible;
+ widget_class->map = ygtk_wizard_map;
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
container_class->forall = ygtk_wizard_forall;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/ygtkwizard.h new/yast2-gtk-2.16.13/src/ygtkwizard.h
--- old/yast2-gtk-2.16.12/src/ygtkwizard.h 2008-04-16 16:13:04.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/ygtkwizard.h 2008-06-03 07:42:03.000000000 +0200
@@ -122,11 +122,8 @@
// (commands that may fail return a sucess boolean.)
void ygtk_wizard_set_help_text (YGtkWizard *wizard, const gchar *text);
-// you may pass a window widget if you want the title/icon to be set on it as well
-void ygtk_wizard_set_header_text (YGtkWizard *wizard, GtkWindow *window,
- const char *text);
-gboolean ygtk_wizard_set_header_icon (YGtkWizard *wizard, GtkWindow *window,
- const char *icon);
+void ygtk_wizard_set_header_text (YGtkWizard *wizard, const char *text);
+gboolean ygtk_wizard_set_header_icon (YGtkWizard *wizard, const char *icon);
void ygtk_wizard_set_back_button_label (YGtkWizard *wizard, const char *text);
void ygtk_wizard_set_abort_button_label (YGtkWizard *wizard, const char *text);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/YGUI.cc new/yast2-gtk-2.16.13/src/YGUI.cc
--- old/yast2-gtk-2.16.12/src/YGUI.cc 2008-05-13 17:16:09.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/YGUI.cc 2008-06-03 07:46:11.000000000 +0200
@@ -349,7 +349,7 @@
GtkWidget *widget = GTK_WIDGET (YGDialog::currentWindow());
if (!widget) {
if (interactive)
- errorMsg ("No dialog to take screenshot of.");
+ errorMsg (_("No dialog to take screenshot of."));
return;
}
@@ -361,7 +361,7 @@
if (!shot) {
if (interactive)
- errorMsg ("Couldn't take a screenshot.");
+ errorMsg (_("Couldn't take a screenshot."));
return;
}
@@ -413,13 +413,15 @@
}
yuiDebug() << "Saving screen shot to " << filename << endl;
- if (gdk_pixbuf_save (shot, filename.c_str(), "png", &error, NULL)) {
- yuiError() << "Couldn't save screen shot " << filename << endl;
- if (interactive) {
- string msg = "Couldn't save screenshot to file " + filename
- + " - " + error->message;
- errorMsg (msg.c_str());
+ if (!gdk_pixbuf_save (shot, filename.c_str(), "png", &error, NULL)) {
+ string msg = _("Couldn't save screenshot to file ") + filename;
+ if (error) {
+ msg += "\n";
+ msg += std::string ("\n") + error->message;
}
+ yuiError() << msg << endl;
+ if (interactive)
+ errorMsg (msg.c_str());
goto makeScreenShot_ret;
}
@@ -429,10 +431,13 @@
void YGApplication::beep()
{
- gdk_beep();
GtkWindow *window = YGDialog::currentWindow();
- if (window)
+ if (window) {
gtk_window_present (window);
+ gtk_widget_error_bell (GTK_WIDGET (window));
+ }
+ else
+ gdk_beep();
}
// File/directory dialogs
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/YGWizard.cc new/yast2-gtk-2.16.13/src/YGWizard.cc
--- old/yast2-gtk-2.16.12/src/YGWizard.cc 2008-05-07 15:06:50.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/YGWizard.cc 2008-06-03 07:42:03.000000000 +0200
@@ -151,15 +151,13 @@
virtual void setDialogIcon (const string &icon)
{
- if (!ygtk_wizard_set_header_icon (getWizard(), YGDialog::currentWindow(),
- icon.c_str()))
+ if (!ygtk_wizard_set_header_icon (getWizard(), icon.c_str()))
yuiWarning() << "YGWizard: could not load image: " << icon << endl;
}
virtual void setDialogHeading (const string &heading)
{
- ygtk_wizard_set_header_text (getWizard(), YGDialog::currentWindow(),
- heading.c_str());
+ ygtk_wizard_set_header_text (getWizard(), heading.c_str());
}
virtual void addStep (const string &text, const string &id)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/yzypptags.cc new/yast2-gtk-2.16.13/src/yzypptags.cc
--- old/yast2-gtk-2.16.12/src/yzypptags.cc 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-gtk-2.16.13/src/yzypptags.cc 2008-06-03 07:42:03.000000000 +0200
@@ -0,0 +1,290 @@
+/********************************************************************
+ * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
+ ********************************************************************/
+
+/*
+ Textdomain "yast2-gtk"
+ */
+
+/* Tags PackageKit translator */
+// check the header file for information about this translator
+
+#include
+#include "YGi18n.h"
+#define YUILogComponent "gtk-pkg"
+#include
+#include
+#include "yzypptags.h"
+
+/**
+ * translations taken from packagekit
+ **/
+const char *
+zypp_tag_group_enum_to_localised_text (YPkgGroupEnum group)
+{
+ const char *text = 0;
+ switch (group)
+ {
+ case PK_GROUP_ENUM_ACCESSIBILITY:
+ text = _("Accessibility");
+ break;
+ case PK_GROUP_ENUM_ACCESSORIES:
+ text = _("Accessories");
+ break;
+ case PK_GROUP_ENUM_EDUCATION:
+ text = _("Education");
+ break;
+ case PK_GROUP_ENUM_GAMES:
+ text = _("Games");
+ break;
+ case PK_GROUP_ENUM_GRAPHICS:
+ text = _("Graphics");
+ break;
+ case PK_GROUP_ENUM_INTERNET:
+ text = _("Internet");
+ break;
+ case PK_GROUP_ENUM_OFFICE:
+ text = _("Office");
+ break;
+ case PK_GROUP_ENUM_OTHER:
+ text = _("Other");
+ break;
+ case PK_GROUP_ENUM_PROGRAMMING:
+ text = _("Programming");
+ break;
+ case PK_GROUP_ENUM_MULTIMEDIA:
+ text = _("Multimedia");
+ break;
+ case PK_GROUP_ENUM_SYSTEM:
+ text = _("System");
+ break;
+ case PK_GROUP_ENUM_DESKTOP_GNOME:
+ text = _("GNOME desktop");
+ break;
+ case PK_GROUP_ENUM_DESKTOP_KDE:
+ text = _("KDE desktop");
+ break;
+ case PK_GROUP_ENUM_DESKTOP_XFCE:
+ text = _("XFCE desktop");
+ break;
+ case PK_GROUP_ENUM_DESKTOP_OTHER:
+ text = _("Other desktops");
+ break;
+ case PK_GROUP_ENUM_PUBLISHING:
+ text = _("Publishing");
+ break;
+ case PK_GROUP_ENUM_SERVERS:
+ text = _("Servers");
+ break;
+ case PK_GROUP_ENUM_FONTS:
+ text = _("Fonts");
+ break;
+ case PK_GROUP_ENUM_ADMIN_TOOLS:
+ text = _("Admin tools");
+ break;
+ case PK_GROUP_ENUM_LEGACY:
+ text = _("Legacy");
+ break;
+ case PK_GROUP_ENUM_LOCALIZATION:
+ text = _("Localization");
+ break;
+ case PK_GROUP_ENUM_VIRTUALIZATION:
+ text = _("Virtualization");
+ break;
+ case PK_GROUP_ENUM_SECURITY:
+ text = _("Security");
+ break;
+ case PK_GROUP_ENUM_POWER_MANAGEMENT:
+ text = _("Power management");
+ break;
+ case PK_GROUP_ENUM_COMMUNICATION:
+ text = _("Communication");
+ break;
+ case PK_GROUP_ENUM_NETWORK:
+ text = _("Network");
+ break;
+ case PK_GROUP_ENUM_MAPS:
+ text = _("Maps");
+ break;
+ case PK_GROUP_ENUM_REPOS:
+ text = _("Software sources");
+ break;
+ case YPKG_GROUP_ALL:
+ text = _("All packages");
+ break;
+
+ case YPKG_GROUP_SUGGESTED:
+ text = _("Suggested packages");
+ break;
+
+ case YPKG_GROUP_RECOMMENDED:
+ text = _("Recommended packages");
+ break;
+
+ case PK_GROUP_ENUM_UNKNOWN:
+ text = _("Unknown group");
+ break;
+
+ }
+ return text;
+}
+
+const char *
+zypp_tag_enum_to_icon (YPkgGroupEnum group)
+{
+ const char *text;
+ switch (group)
+ {
+ case PK_GROUP_ENUM_ACCESSIBILITY:
+ text = "package_main";
+ break;
+ case PK_GROUP_ENUM_ACCESSORIES:
+ text = "package_applications";
+ break;
+ case PK_GROUP_ENUM_EDUCATION:
+ text = "package_edutainment";
+ break;
+ case PK_GROUP_ENUM_GAMES:
+ text = "package_games";
+ break;
+ case PK_GROUP_ENUM_GRAPHICS:
+ text = "package_graphics";
+ break;
+ case PK_GROUP_ENUM_INTERNET:
+ text = "package_network";
+ break;
+ case PK_GROUP_ENUM_OFFICE:
+ text = "package_office_addressbook";
+ break;
+ case PK_GROUP_ENUM_OTHER:
+ text = "package_main";
+ break;
+ case PK_GROUP_ENUM_PROGRAMMING:
+ text = "package_development";
+ break;
+ case PK_GROUP_ENUM_MULTIMEDIA:
+ text = "package_multimedia";
+ break;
+ case PK_GROUP_ENUM_SYSTEM:
+ text = "yast-system";
+ break;
+ case PK_GROUP_ENUM_DESKTOP_GNOME:
+ text = "pattern-gnome";
+ break;
+ case PK_GROUP_ENUM_DESKTOP_KDE:
+ text = "pattern-kde";
+ break;
+ case PK_GROUP_ENUM_DESKTOP_XFCE:
+ text = "package_utility_desktop";
+ break;
+ case PK_GROUP_ENUM_DESKTOP_OTHER:
+ text = "package_utility_desktop";
+ break;
+ case PK_GROUP_ENUM_PUBLISHING:
+ text = "package_main";
+ break;
+ case PK_GROUP_ENUM_SERVERS:
+ text = "package_editors";
+ break;
+ case PK_GROUP_ENUM_FONTS:
+ text = "package_main";
+ break;
+ case PK_GROUP_ENUM_ADMIN_TOOLS:
+ text = "yast-sysconfig";
+ break;
+ case PK_GROUP_ENUM_LEGACY:
+ text = "package_main";
+ break;
+ case PK_GROUP_ENUM_LOCALIZATION:
+ text = "yast-language";
+ break;
+ case PK_GROUP_ENUM_VIRTUALIZATION:
+ text = "yast-create-new-vm";
+ break;
+ case PK_GROUP_ENUM_SECURITY:
+ text = "yast-security";
+ break;
+ case PK_GROUP_ENUM_POWER_MANAGEMENT:
+ text = "package_settings_power";
+ break;
+ case PK_GROUP_ENUM_COMMUNICATION:
+ text = "yast-modem";
+ break;
+ case PK_GROUP_ENUM_NETWORK:
+ text = "package_network";
+ break;
+ case PK_GROUP_ENUM_MAPS:
+ text = "package_main";
+ break;
+ case PK_GROUP_ENUM_REPOS:
+ text = "package_main";
+ break;
+ case YPKG_GROUP_SUGGESTED:
+ case YPKG_GROUP_RECOMMENDED:
+ text = "package_edutainment_languages";
+
+ break;
+ case PK_GROUP_ENUM_UNKNOWN:
+ case YPKG_GROUP_ALL:
+ text = "package_main";
+ break;
+
+ }
+ return text;
+}
+
+
+YPkgGroupEnum
+zypp_tag_convert (const std::string &groupu)
+{
+ // TODO Look for a faster and nice way to do this conversion
+
+ std::string group = zypp::str::toLower(groupu);
+
+ if (group.find ("amusements") != std::string::npos) {
+ return PK_GROUP_ENUM_GAMES;
+ } else if (group.find ("development") != std::string::npos) {
+ return PK_GROUP_ENUM_PROGRAMMING;
+ } else if (group.find ("hardware") != std::string::npos) {
+ return PK_GROUP_ENUM_SYSTEM;
+ } else if (group.find ("archiving") != std::string::npos
+ || group.find("clustering") != std::string::npos
+ || group.find("system/monitoring") != std::string::npos
+ || group.find("databases") != std::string::npos
+ || group.find("system/management") != std::string::npos) {
+ return PK_GROUP_ENUM_ADMIN_TOOLS;
+ } else if (group.find ("graphics") != std::string::npos) {
+ return PK_GROUP_ENUM_GRAPHICS;
+ } else if (group.find ("multimedia") != std::string::npos) {
+ return PK_GROUP_ENUM_MULTIMEDIA;
+ } else if (group.find ("network") != std::string::npos) {
+ return PK_GROUP_ENUM_NETWORK;
+ } else if (group.find ("office") != std::string::npos
+ || group.find("text") != std::string::npos
+ || group.find("editors") != std::string::npos) {
+ return PK_GROUP_ENUM_OFFICE;
+ } else if (group.find ("publishing") != std::string::npos) {
+ return PK_GROUP_ENUM_PUBLISHING;
+ } else if (group.find ("security") != std::string::npos) {
+ return PK_GROUP_ENUM_SECURITY;
+ } else if (group.find ("telephony") != std::string::npos) {
+ return PK_GROUP_ENUM_COMMUNICATION;
+ } else if (group.find ("gnome") != std::string::npos) {
+ return PK_GROUP_ENUM_DESKTOP_GNOME;
+ } else if (group.find ("kde") != std::string::npos) {
+ return PK_GROUP_ENUM_DESKTOP_KDE;
+ } else if (group.find ("xfce") != std::string::npos) {
+ return PK_GROUP_ENUM_DESKTOP_XFCE;
+ } else if (group.find ("gui/other") != std::string::npos) {
+ return PK_GROUP_ENUM_DESKTOP_OTHER;
+ } else if (group.find ("localization") != std::string::npos) {
+ return PK_GROUP_ENUM_LOCALIZATION;
+ } else if (group.find ("system") != std::string::npos) {
+ return PK_GROUP_ENUM_SYSTEM;
+ } else if (group.find ("scientific") != std::string::npos) {
+ return PK_GROUP_ENUM_EDUCATION;
+ }
+
+ return PK_GROUP_ENUM_UNKNOWN;
+}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/yzypptags.h new/yast2-gtk-2.16.13/src/yzypptags.h
--- old/yast2-gtk-2.16.12/src/yzypptags.h 1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-gtk-2.16.13/src/yzypptags.h 2008-06-03 07:42:03.000000000 +0200
@@ -0,0 +1,51 @@
+/********************************************************************
+ * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
+ ********************************************************************/
+
+/* Converts RPM to PackageKit-like terminology.
+ Code from yast-qt-pkg.
+*/
+
+typedef enum {
+ /* PackageKit values */
+ PK_GROUP_ENUM_ACCESSIBILITY,
+ PK_GROUP_ENUM_ACCESSORIES,
+ PK_GROUP_ENUM_EDUCATION,
+ PK_GROUP_ENUM_GAMES,
+ PK_GROUP_ENUM_GRAPHICS,
+ PK_GROUP_ENUM_INTERNET,
+ PK_GROUP_ENUM_OFFICE,
+ PK_GROUP_ENUM_OTHER,
+ PK_GROUP_ENUM_PROGRAMMING,
+ PK_GROUP_ENUM_MULTIMEDIA,
+ PK_GROUP_ENUM_SYSTEM,
+ PK_GROUP_ENUM_DESKTOP_GNOME,
+ PK_GROUP_ENUM_DESKTOP_KDE,
+ PK_GROUP_ENUM_DESKTOP_XFCE,
+ PK_GROUP_ENUM_DESKTOP_OTHER,
+ PK_GROUP_ENUM_PUBLISHING,
+ PK_GROUP_ENUM_SERVERS,
+ PK_GROUP_ENUM_FONTS,
+ PK_GROUP_ENUM_ADMIN_TOOLS,
+ PK_GROUP_ENUM_LEGACY,
+ PK_GROUP_ENUM_LOCALIZATION,
+ PK_GROUP_ENUM_VIRTUALIZATION,
+ PK_GROUP_ENUM_SECURITY,
+ PK_GROUP_ENUM_POWER_MANAGEMENT,
+ PK_GROUP_ENUM_COMMUNICATION,
+ PK_GROUP_ENUM_NETWORK,
+ PK_GROUP_ENUM_MAPS,
+ PK_GROUP_ENUM_REPOS,
+ PK_GROUP_ENUM_UNKNOWN,
+ /* Other values */
+ YPKG_GROUP_SUGGESTED,
+ YPKG_GROUP_RECOMMENDED,
+ YPKG_GROUP_ALL,
+} YPkgGroupEnum;
+
+
+YPkgGroupEnum zypp_tag_convert (const std::string &rpm_group);
+
+const char *zypp_tag_group_enum_to_localised_text (YPkgGroupEnum group);
+const char *zypp_tag_enum_to_icon (YPkgGroupEnum group);
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/yzyppwrapper.cc new/yast2-gtk-2.16.13/src/yzyppwrapper.cc
--- old/yast2-gtk-2.16.12/src/yzyppwrapper.cc 2008-05-19 16:43:51.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/yzyppwrapper.cc 2008-06-03 07:42:03.000000000 +0200
@@ -12,6 +12,7 @@
#include
#include "YGi18n.h"
#include "yzyppwrapper.h"
+#include "yzypptags.h"
#include
#include <string>
#include <sstream>
@@ -83,7 +84,7 @@
return (Ypp::Node *) root->children->data;
}
- Ypp::Node *add (const std::string &tree_str)
+ Ypp::Node *add (const std::string &tree_str, const char *icon)
{
const std::list std::string nodes_str = YGUtils::splitString (tree_str, delim);
GNode *parent = root, *sibling = 0;
@@ -112,6 +113,7 @@
Ypp::Node *yNode = new Ypp::Node();
GNode *n = g_node_new ((void *) yNode);
yNode->name = *it;
+ yNode->icon = icon;
yNode->impl = (void *) n;
g_node_insert_before (parent, sibling, n);
parent = n;
@@ -161,13 +163,14 @@
bool resolveProblems();
Node *addCategory (Ypp::Package::Type type, const std::string &str);
void polishCategories (Ypp::Package::Type type);
+ Node *addCategory2 (Ypp::Package::Type type, const std::string &str);
void startTransactions();
void finishTransactions();
friend class Ypp;
GSList *packages [Package::TOTAL_TYPES]; // primitive pools
- StringTree *categories [Package::TOTAL_TYPES];
+ StringTree *categories [Package::TOTAL_TYPES], *categories2;
GSList *repos;
const Repository *favoriteRepo;
int favoriteRepoPriority;
@@ -182,8 +185,8 @@
struct Ypp::Package::Impl
{
- Impl (Type type, ZyppSelectable sel, Node *category)
- : type (type), zyppSel (sel), category (category),
+ Impl (Type type, ZyppSelectable sel, Node *category, Node *category2)
+ : type (type), zyppSel (sel), category (category), category2 (category2),
availableVersions (NULL), installedVersion (NULL)
{
// don't use getAvailableVersion(0) for hasUpgrade() has its inneficient.
@@ -228,7 +231,7 @@
std::string name, summary;
Type type;
ZyppSelectable zyppSel;
- Ypp::Node *category;
+ Ypp::Node *category, *category2;
GSList *availableVersions;
Version *installedVersion;
bool hasUpgrade;
@@ -358,7 +361,7 @@
const std::list std::string &filesList = package->filenames();
for (std::list std::string::const_iterator it = filesList.begin();
it != filesList.end(); it++)
- tree.add (*it);
+ tree.add (*it, 0);
struct inner {
static std::string getPath (GNode *node)
@@ -513,9 +516,10 @@
}
Ypp::Node *Ypp::Package::category()
-{
- return impl->category;
-}
+{ return impl->category; }
+
+Ypp::Node *Ypp::Package::category2()
+{ return impl->category2; }
bool Ypp::Package::fromCollection (const Ypp::Package *collection) const
{
@@ -870,7 +874,7 @@
Keys Ypp::Package::Type types;
Keys std::string names;
- Keys categories;
+ Keys categories, categories2;
Keys collections;
Keys repositories;
Key <bool> isInstalled;
@@ -934,6 +938,17 @@
}
match = it != values.end();
}
+ if (match && categories2.defined) {
+ Ypp::Node *pkg_category = package->category2();
+ const std::list &values = categories2.values;
+ std::list ::const_iterator it;
+ for (it = values.begin(); it != values.end(); it++) {
+ GNode *node = (GNode *) (*it)->impl;
+ if (g_node_find (node, G_PRE_ORDER, G_TRAVERSE_ALL, pkg_category))
+ break;
+ }
+ match = it != values.end();
+ }
if (match && repositories.defined) {
const std::list &values = repositories.values;
std::list ::const_iterator it;
@@ -989,6 +1004,8 @@
}
void Ypp::QueryPool::Query::addCategory (Ypp::Node *value)
{ impl->categories.add (value); }
+void Ypp::QueryPool::Query::addCategory2 (Ypp::Node *value)
+{ impl->categories2.add (value); }
void Ypp::QueryPool::Query::addCollection (const Ypp::Package *value)
{ impl->collections.add (value); }
void Ypp::QueryPool::Query::addRepository (const Repository *value)
@@ -1345,6 +1362,13 @@
return impl->categories[type]->getFirst();
}
+Ypp::Node *Ypp::getFirstCategory2 (Ypp::Package::Type type)
+{
+ if (!impl->getPackages (type))
+ return NULL;
+ return impl->categories2->getFirst();
+}
+
Ypp::Node *Ypp::Node::next()
{
GNode *ret = ((GNode *) impl)->next;
@@ -1375,9 +1399,59 @@
if (!categories[type])
categories[type] = new StringTree (inner::cmp, '/');
- return categories[type]->add (category_str);
+ return categories[type]->add (category_str, 0);
}
+Ypp::Node *Ypp::Impl::addCategory2 (Ypp::Package::Type type, const std::string &category_str)
+{
+ struct inner {
+ static int cmp (const char *a, const char *b)
+ {
+ int r = strcmp (a, b);
+ if (r != 0) {
+ const char *unknown = zypp_tag_group_enum_to_localised_text
+ (PK_GROUP_ENUM_UNKNOWN);
+ if (!strcmp (a, unknown))
+ return 1;
+ if (!strcmp (b, unknown))
+ return -1;
+ }
+ return r;
+ }
+ };
+
+ YPkgGroupEnum group = zypp_tag_convert (category_str);
+ const char *group_name = zypp_tag_group_enum_to_localised_text (group);
+ const char *group_icon = zypp_tag_enum_to_icon (group);
+
+ if (!categories2)
+ categories2 = new StringTree (inner::cmp, '/');
+ return categories2->add (group_name, group_icon);
+}
+
+// Maps icons to top package groups
+struct CategoriesIconMap {
+ const char *category, *icon;
+};
+static const CategoriesIconMap catIconMap[] = {
+ { "Amusements", "package_games" },
+ { "Games", "package_games" },
+ { "Applications", "package_system" },
+ { "Development", "applications-development" },
+ { "Libraries", "package_development" },
+ { "Documentation", "package_documentation" },
+ { "Hardware", "package_settings_peripherals" },
+ { "Productivity", "package_applications" },
+ { "System", "package_settings" },
+ { "Multimedia", "package_multimedia" },
+ { "Video", "package_multimedia" },
+ { "Office", "applications-office" },
+ { "Publishing", "applications-office" },
+ { "X11", "applications-other" },
+ { "Metapackages", "package_network" },
+};
+#define CAT_SIZE (sizeof (catIconMap)/sizeof (CategoriesIconMap))
+
void Ypp::Impl::polishCategories (Ypp::Package::Type type)
{
// some treatment on categories
@@ -1397,12 +1471,22 @@
Ypp::Node *yN = new Ypp::Node();
GNode *n = g_node_new ((void *) yN);
yN->name = "Other";
+ yN->icon = NULL;
yN->impl = (void *) n;
g_node_insert_before (node, NULL, n);
pkg->impl->category = yN;
}
}
}
+
+ Node *first = categories [Package::PACKAGE_TYPE]->getFirst();
+ for (Node *n = first; n; n = n->next()) {
+ for (unsigned int i = 0; i < CAT_SIZE; i++)
+ if (n->name == catIconMap[i].category) {
+ n->icon = catIconMap[i].icon;
+ break;
+ }
+ }
}
}
@@ -1415,6 +1499,7 @@
for (int i = 0; i < Package::TOTAL_TYPES; i++) {
packages[i] = NULL;
categories[i] = NULL;
+ categories2 = NULL;
}
}
@@ -1432,6 +1517,7 @@
g_slist_free (packages[t]);
delete categories[t];
}
+ delete categories2;
g_slist_foreach (repos, inner::free_repo, NULL);
g_slist_free (repos);
@@ -1665,7 +1751,7 @@
break;
}
for (; it != end; it++) {
- Ypp::Node *category = 0;
+ Ypp::Node *category = 0, *category2 = 0;
ZyppObject object = (*it)->theObj();
// add category and test visibility
switch (type) {
@@ -1675,6 +1761,7 @@
if (!zpackage)
continue;
category = addCategory (type, zpackage->group());
+ category2 = addCategory2 (type, zpackage->group());
break;
}
case Package::PATTERN_TYPE:
@@ -1700,7 +1787,7 @@
break;
}
- Package *package = new Package (new Package::Impl (type, *it, category));
+ Package *package = new Package (new Package::Impl (type, *it, category, category2));
pool = g_slist_prepend (pool, package);
}
// its faster to prepend then reverse, as we avoid iterating for each append
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/src/yzyppwrapper.h new/yast2-gtk-2.16.13/src/yzyppwrapper.h
--- old/yast2-gtk-2.16.12/src/yzyppwrapper.h 2008-05-19 16:43:51.000000000 +0200
+++ new/yast2-gtk-2.16.13/src/yzyppwrapper.h 2008-06-03 07:42:03.000000000 +0200
@@ -32,6 +32,7 @@
// Utilities
struct Node {
std::string name;
+ const char *icon;
Node *next();
Node *child();
void *impl;
@@ -47,6 +48,7 @@
const std::string &name() const;
const std::string &summary();
Node *category();
+ Node *category2();
bool fromCollection (const Ypp::Package *collection) const;
std::string description();
@@ -134,6 +136,7 @@
void addType (Package::Type type);
void addNames (std::string name, char separator = 0);
void addCategory (Ypp::Node *category);
+ void addCategory2 (Ypp::Node *category);
void addCollection (const Ypp::Package *package);
void addRepository (const Ypp::Repository *repositories);
void setIsInstalled (bool installed);
@@ -228,6 +231,7 @@
Package *findPackage (Package::Type type, const std::string &name);
Node *getFirstCategory (Package::Type type);
+ Node *getFirstCategory2 (Package::Type type);
struct Disk
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-gtk-2.16.12/VERSION new/yast2-gtk-2.16.13/VERSION
--- old/yast2-gtk-2.16.12/VERSION 2008-05-19 16:43:51.000000000 +0200
+++ new/yast2-gtk-2.16.13/VERSION 2008-06-03 07:46:53.000000000 +0200
@@ -1 +1 @@
-2.16.12
+2.16.13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org