Hello community,
here is the log from the commit of package yast2-gtk for openSUSE:Factory
checked in at Thu Jun 4 00:19:09 CEST 2009.
--------
--- yast2-gtk/yast2-gtk.changes 2009-01-07 13:23:53.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-gtk/yast2-gtk.changes 2009-04-27 11:47:45.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Apr 27 11:28:40 CEST 2009 - coolo@suse.de
+
+- fix compilation with gcc 4.4
+- 2.18.0
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-gtk-2.17.9.tar.bz2
New:
----
yast2-gtk-2.18.0.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-gtk.spec ++++++
--- /var/tmp/diff_new_pack.N20942/_old 2009-06-04 00:18:57.000000000 +0200
+++ /var/tmp/diff_new_pack.N20942/_new 2009-06-04 00:18:57.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-gtk (Version 2.17.9)
+# spec file for package yast2-gtk (Version 2.18.0)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -20,12 +20,12 @@
Url: http://en.opensuse.org/YaST2-GTK
Name: yast2-gtk
-Version: 2.17.9
+Version: 2.18.0
Release: 1
License: LGPL v2.1 or later
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-gtk-2.17.9.tar.bz2
+Source0: yast2-gtk-2.18.0.tar.bz2
Prefix: /usr
Source2: yast2-gtk-rpmlintrc
BuildRequires: blocxx-devel gcc-c++ gtk2-devel libxcrypt-devel libzypp-devel yast2-devtools
@@ -48,7 +48,7 @@
Michael Meeks
%prep
-%setup -n yast2-gtk-2.17.9
+%setup -n yast2-gtk-2.18.0
%build
%{prefix}/bin/y2tool y2autoconf
@@ -79,6 +79,9 @@
%{_libdir}/YaST2/plugin/libpy2gtk.so
%{_datadir}/YaST2/gtk
%changelog
+* Mon Apr 27 2009 coolo@suse.de
+- fix compilation with gcc 4.4
+- 2.18.0
* Wed Jan 07 2009 michael.meeks@novell.com
* label / tick spacing in wizard #449320#
* table multi-select fix #460746#
@@ -309,7 +312,7 @@
- Ricardo fixed make test
* Wed Jan 16 2008 coolo@suse.de
- update to latest yast2-core API
-* Fri Jan 11 2008 btimothy@suse.de
+* Sat Jan 12 2008 btimothy@suse.de
- Updating the tarball directly from SVN Trunk revision to be
version 2.15.9r43566 so the package won't fail to build anymore.
- Removed all the old patches since they are no longer necessary
++++++ yast2-gtk-2.17.9.tar.bz2 -> yast2-gtk-2.18.0.tar.bz2 ++++++
++++ 2415 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/ChangeLog new/yast2-gtk-2.18.0/ChangeLog
--- old/yast2-gtk-2.17.9/ChangeLog 2009-01-07 12:22:29.000000000 +0100
+++ new/yast2-gtk-2.18.0/ChangeLog 2009-04-27 11:11:05.000000000 +0200
@@ -1,3 +1,85 @@
+2009-03-18 Martin Kudlvasr
+
+ * tests/ButtonOrder.ycp added test to see button order heuristic
+ behaviour (bnc#479874)
+
+2009-03-11 Martin Kudlvasr
+
+ * src/YGPackageSelector.cc add YGPackageSelector::modifiedPackagesExist
+ initial state of the Apply button should be enabled, if there are some
+ modified packages on start (for instance when PS is called from addon
+ yast module)
+ fixes bnc#475259
+
+2009-03-05 Martin Kudlvasr
+
+ * add tests/MultiLine.ycp for bnc#459657
+ * src/YGText.cc: overload doSetEnabled for YGMultiLineEdit
+
+2009-02-26 Martin Kudlvasr
+
+ * change src/YGDialog.cc to maximize window when screen width <= 800 OR
+ * screen height <= 600. There was AND previously.
+
+2009-02-13 Michael Meeks
+
+ * src/YGUtils.cc (ygutils_convert_to_xhtml): handle
+ mangled entities appearing in URLs around the place:
+ bug 475275.
+
+ * src/test.cc (testXHtmlConvert): upd. regression tests.
+
+2009-01-26 Ricardo Cruz
+
+ * src/YGSelectionModel.h: decoupled doSelectItem(NULL) into
+ doUnselectAllItem().
+
+ * src/YGTable.cc: bug fix 468974: selection was broken. Also
+ fixed YTree's double click crash, and YMultiSelectionBox
+ check boxes default values.
+
+2009-01-21 Ricardo Cruz
+
+ * src/YGProgressBar.cc (YGDownloadProgress): bug fix 460106:
+ set size units translatable.
+
+2009-01-19 Ricardo Cruz
+
+ * src/YGPackageSelector (PackageSelector): a couple of mockups
+ (change PKG_SELECTOR_FACE to enable).
+
+2009-01-17 Ricardo Cruz
+
+ * src/ygtkwizard.c: bug fix 464900: reduce space between buttons,
+ added some border to contents.
+
+ * src/YGUtils.cc: process &product; entity here, at least for now.
+
+ * src/pkg-selector-help.h: bug fix 448192 & 459457: improved
+ pkg selector help a bit.
+
+ * src/YGLayout.cc: bug fix 464904: looks odd when adjusting menu
+ buttons to the same height as the other buttons.
+
+ * src/YGDialog.h/cc: methods to retrive function key widget and
+ and list of widgets from a given class.
+
+ * src/YGPackageSelector.cc & src/ygtkscrolledwindow.h/c: moved
+ right-click tree hack from the pkg selector to its own widget.
+
+ * src/YGTable.cc: implemented Martin Vidner suggestion on function
+ keys: http://mvidner.blogspot.com/2009/01/yast-ui-table-usability.html
+
+ * src/ygtkzyppwrapper.h/cc: exposed a couple new data columns.
+
+ * src/YGPackageSelector.cc (PackagesView): added CheckView for
+ mockup purposes.
+
+2009-01-08 Ricardo Cruz
+
+ * src/YGUI.cc: bug fix 461617: return opposite arrow glyph for
+ Arabic languages.
+
2009-01-07 Michael Meeks
* Version 2.17.9
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/configure.in new/yast2-gtk-2.18.0/configure.in
--- old/yast2-gtk-2.17.9/configure.in 2009-01-07 12:25:05.000000000 +0100
+++ new/yast2-gtk-2.18.0/configure.in 2009-06-03 11:29:32.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.17.6 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-gtk, 2.17.9, http://bugs.opensuse.org/, yast2-gtk)
+AC_INIT(yast2-gtk, 2.18.0, 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.17.9"
+VERSION="2.18.0"
RPMNAME="yast2-gtk"
MAINTAINER="Ricardo Cruz \
Michael Meeks "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/pkg-selector-help.h new/yast2-gtk-2.18.0/src/pkg-selector-help.h
--- old/yast2-gtk-2.17.9/src/pkg-selector-help.h 2008-11-21 12:48:55.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/pkg-selector-help.h 2009-02-20 10:50:33.000000000 +0100
@@ -5,7 +5,7 @@
static const char *pkg_help =
__("<h1>Purpose</h1>"
"<p>This tool lets you install, remove, and update applications.</p>"
-"<p>openSUSE's software management is also called 'package management'. A package is "
+"<p>&product; 's software management is also called 'package management'. A package is "
"generally an application bundle, but multiple packages that extend the application "
"may be offered in order to avoid clutter (e.g. games tend to de-couple the music "
"data in another package, since its not essential and requires significant disk space). "
@@ -21,7 +21,7 @@
"<p>You will find both packages installed on your system, and packages that are made "
"available through the setup-ed repositories. You cans either install or upgrade "
"an available package, or remove an installed one.</p>"
-"<blockquote>A repository is a packages media; it can either be local (like your Suse CDs), "
+"<blockquote>A repository is a packages media; it can either be local (such as the &product; CDs), "
"or a remote internet server. You can find utilities to setup repositories "
"on the YaST control center.</blockquote>"
""
@@ -39,17 +39,15 @@
"AbiWord which carries the word 'office' in its description). You can also "
"choose to view software from a specific repository.</p>"
""
-"<h2>Categories & Collections</h2>"
-"<p>Software for openSUSE is indexed so that you can find software for a specific "
+"<h2>Groups & Collections</h2>"
+"<p>Software for &product; is indexed so that you can find software for a specific "
"task when you don't know the name of the software you are looking for. Browse "
-"indices of software by using the tree-view in the left column; you can view the "
-"available software by their Package names, or grouped in 'Categories' or 'Patterns' "
-"by the selecting a view-mode from the drop-down-menu below. Categories' are simple, "
-"hierarchical classifications of software packages, like 'Multimedia/Video', while "
-"'Patterns' are task-oriented collections of multiple packages that install like one "
-"(the installation of the 'server'-pattern for example will install various software "
-"needed for running a server). By using 'Install All' you make sure that future "
-"collection changes, when you upgrade openSUSE, will be honored.</p>"
+"indexes of software through the Groups pane. A more detailed, hierarchical classification "
+"of software packages, like 'Multimedia/Video' is available through the 'Detailed' check "
+"button. 'Patterns' and 'Languages' are task-oriented collections of multiple packages that "
+"install like one (the installation of the 'server'-pattern for example will install various "
+"software needed for running a server). By using 'Install All' you make sure that future "
+"collection changes, when you upgrade &product;, will be honored.</p>"
""
"<h2>Software details in the box below</h2>"
"<p>In the package detail view you can perform actions affecting this software; "
@@ -61,14 +59,14 @@
"<p>The lock button can be used to lock the selected package state; it won't allow "
"some automatic operation to install, upgrade or remove the package. This is only "
"useful in very unusual cases: for instance, you may not want to install some "
-"drivers because they interfer with your system, yet you want to install some "
+"drivers because they interfere with your system, yet you want to install some "
"collection that includes them.</p>"
-"<p>The changes will be performed once you decide to click the 'perform changes' "
+"<p>The changes will be performed once you decide to click the Apply "
"button in the lower-right corner. If you want to leave the software-manager "
-"without performing any changes, simply press the button labeled 'Abort'.</p>"
+"without performing any changes, simply press 'Cancel'.</p>"
""
"<blockquote><i>Developed by Ricardo Cruz <rpmcruz@alunos.dcc.fc.up.pt><br>"
-"Thanks to Christian Jager for co-designing this tool.</i></blockquote>");
+"Thanks to Christian Jaeger for co-designing this tool.</i></blockquote>");
static const char *patch_help =
__("<h1>Purpose</h1>"
@@ -85,7 +83,7 @@
"performance slowdown)</li>"
"<li>Optional: ones that only apply to few users.</li>"
"</ul>"
-"<p>Only patches that apply to your system will be visible. openSUSE developers "
+"<p>Only patches that apply to your system will be visible. &product; developers "
"are very restrained in pushing patches; you can be sure that all patches are "
"of signficant severity.</p>"
"<p>If you are looking for applications enhancements, you should check for Upgrades "
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/test.cc new/yast2-gtk-2.18.0/src/test.cc
--- old/yast2-gtk-2.17.9/src/test.cc 2008-12-01 18:11:05.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/test.cc 2009-02-20 10:50:33.000000000 +0100
@@ -41,6 +41,22 @@
#include "ygtkrichtext.h"
+bool testParse(const char *xml)
+{
+ GError *error = NULL;
+ GMarkupParser parser = { 0, };
+ GMarkupParseContext *ctx = g_markup_parse_context_new (&parser, GMarkupParseFlags (0), NULL, NULL);
+
+ if (!g_markup_parse_context_parse (ctx, xml, -1, &error))
+ {
+ fprintf (stderr, "Invalid XML: '%s'\n '%s'\n", xml, error->message);
+ return false;
+ }
+ g_markup_parse_context_free (ctx);
+
+ return true;
+}
+
bool testXHtmlConvert()
{
fprintf (stderr, "Test HTML->XML rewrite \t");
@@ -76,6 +92,12 @@
// comment
{ "we need <b>to <!-- really need to? --> do something</b> about it.",
"<body>we need <b>to do something</b> about it.</body>" },
+ { "&", "<body>&</body>" },
+ { "&", "<body>&</body>" },
+ { "& foo", "<body>& foo</body>" },
+ { "& foo", "<body>& foo</body>" },
+ { "<pre>https://foo.com/regsvc-1.0/?lang=de-DE&guid=1529f49dc701449fbd854aebf7e40806&command=interactive</pre>\n",
+ "<body><pre>https://foo.com/regsvc-1.0/?lang=de-DE&guid=1529f49dc701449fbd854aebf7e4...</pre> </body>" },
{ NULL, NULL }
};
for (int i = 0; aTests[i].in; i++) {
@@ -85,6 +107,9 @@
i, out, aTests[i].out);
return false;
}
+ if (!testParse (out))
+ return false;
+
fprintf (stderr, "%d ", i);
g_free (out);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGBarGraph.cc new/yast2-gtk-2.18.0/src/YGBarGraph.cc
--- old/yast2-gtk-2.17.9/src/YGBarGraph.cc 2009-01-07 12:10:31.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGBarGraph.cc 2009-04-27 11:27:01.000000000 +0200
@@ -38,7 +38,7 @@
static GdkColor ycolorToGdk (const YColor &ycolor)
{
- GdkColor color = { 0, ycolor.red() << 8, ycolor.green() << 8, ycolor.blue() << 8 };
+ GdkColor color = { 0, guint16(ycolor.red() << 8), guint16(ycolor.green() << 8), guint16(ycolor.blue() << 8) };
return color;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGComboBox.cc new/yast2-gtk-2.18.0/src/YGComboBox.cc
--- old/yast2-gtk-2.17.9/src/YGComboBox.cc 2009-01-07 12:10:30.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGComboBox.cc 2009-02-20 10:50:33.000000000 +0100
@@ -82,11 +82,10 @@
virtual void setText (const string &value)
{
- IMPL
BlockEvents block (this);
- GtkTreeIter iter;
- if (findByText (value, &iter))
- doSelectItem (&iter);
+ GtkTreeIter iter;
+ if (findByText (value, &iter))
+ doSelectItem (&iter);
else
gtk_entry_set_text (getEntry(), value.c_str());
}
@@ -95,12 +94,16 @@
virtual void doSelectItem (GtkTreeIter *iter)
{
BlockEvents block (this);
- if (iter)
- gtk_combo_box_set_active_iter (getComboBox(), iter);
- else
- gtk_combo_box_set_active (getComboBox(), -1);
+ gtk_combo_box_set_active_iter (getComboBox(), iter);
}
+ virtual void doUnselectAll()
+ {
+ BlockEvents block (this);
+ gtk_combo_box_set_active (getComboBox(), -1);
+ }
+
+
virtual YItem *doSelectedItem()
{
GtkTreeIter iter;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGDialog.cc new/yast2-gtk-2.18.0/src/YGDialog.cc
--- old/yast2-gtk-2.17.9/src/YGDialog.cc 2009-01-07 12:10:30.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGDialog.cc 2009-04-27 11:11:05.000000000 +0200
@@ -11,6 +11,7 @@
#endif
#include
#include // easter
+#include
/* In the main dialog case, it doesn't necessarly have a window of its own. If
there is already a main window, it should replace its content -- and when closed,
@@ -92,7 +93,7 @@
gtk_window_set_default_size (window, DEFAULT_WIDTH, DEFAULT_HEIGHT);
if (YGUI::ui()->setFullscreen())
gtk_window_fullscreen (window);
- else if (YUI::app()->displayWidth() <= 800 && YUI::app()->displayHeight() <= 600)
+ else if (YUI::app()->displayWidth() <= 800 || YUI::app()->displayHeight() <= 600)
// maximize for small displays
gtk_window_maximize (window);
}
@@ -529,6 +530,38 @@
}
}
+typedef bool (*FindWidgetsCb) (YWidget *widget, void *data) ;
+
+static void findWidgets (
+ std::list *widgets, YWidget *widget, FindWidgetsCb find_cb, void *cb_data)
+{
+ if (find_cb (widget, cb_data))
+ widgets->push_back (widget);
+ for (YWidgetListConstIterator it = widget->childrenBegin();
+ it != widget->childrenEnd(); it++)
+ findWidgets (widgets, *it, find_cb, cb_data);
+}
+
+static bool IsFunctionWidget (YWidget *widget, void *data)
+{ return widget->functionKey() == GPOINTER_TO_INT (data); }
+
+YWidget *YGDialog::getFunctionWidget (int key)
+{
+ std::list widgets;
+ findWidgets (&widgets, this, IsFunctionWidget, GINT_TO_POINTER (key));
+ return widgets.empty() ? NULL : widgets.front();
+}
+
+static bool IsClassWidget (YWidget *widget, void *data)
+{ return !strcmp (widget->widgetClass(), (char *) data); }
+
+std::list YGDialog::getClassWidgets (const char *className)
+{
+ std::list widgets;
+ findWidgets (&widgets, this, IsClassWidget, (void *) className);
+ return widgets;
+}
+
YDialog *YGWidgetFactory::createDialog (YDialogType dialogType, YDialogColorMode colorMode)
{
IMPL
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGDialog.h new/yast2-gtk-2.18.0/src/YGDialog.h
--- old/yast2-gtk-2.17.9/src/YGDialog.h 2009-01-07 12:10:30.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGDialog.h 2009-02-20 10:50:33.000000000 +0100
@@ -45,6 +45,9 @@
void setTitle (const std::string &title, bool sticky = false);
void setIcon (const std::string &icon);
+ YWidget *getFunctionWidget (int key);
+ std::list getClassWidgets (const char *className);
+
YGWIDGET_IMPL_CONTAINER (YDialog)
};
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGLayout.cc new/yast2-gtk-2.18.0/src/YGLayout.cc
--- old/yast2-gtk-2.17.9/src/YGLayout.cc 2009-01-07 12:10:30.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGLayout.cc 2009-02-20 10:50:33.000000000 +0100
@@ -36,7 +36,6 @@
{ doMoveChild (getWidget(), ychild, x, y); } \
#include
-#include
class ButtonHeightGroup
{
@@ -47,8 +46,7 @@
void addWidget (YWidget *ywidget)
{
- if (dynamic_cast (ywidget) ||
- dynamic_cast (ywidget)) {
+ if (dynamic_cast (ywidget)) {
bool create_group = !group;
if (create_group)
group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGPackageSelector.cc new/yast2-gtk-2.18.0/src/YGPackageSelector.cc
--- old/yast2-gtk-2.17.9/src/YGPackageSelector.cc 2009-01-07 12:10:30.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGPackageSelector.cc 2009-04-27 11:11:05.000000000 +0200
@@ -415,44 +415,17 @@
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, event_time);
gtk_widget_show_all (menu);
}
-
- static gboolean popup_key_cb (GtkWidget *widget, View *pThis)
- { pThis->signalPopup (0, gtk_get_current_event_time()); return TRUE; }
};
- struct ListView : public View
+ // TreeView: base class for ListView and CheckView (see append*Col methods)
+ struct TreeView : public View
{
bool m_isTree, m_descriptiveTooltip;
- ListView (bool isTree, bool descriptiveTooltip, bool editable, PackagesView *parent)
+ TreeView (bool isTree, bool descriptiveTooltip, bool editable, PackagesView *parent)
: View (parent), m_isTree (isTree), m_descriptiveTooltip (descriptiveTooltip)
{
- GtkTreeView *view = GTK_TREE_VIEW (m_widget = gtk_tree_view_new());
+ GtkTreeView *view = GTK_TREE_VIEW (m_widget = ygtk_tree_view_new());
gtk_tree_view_set_headers_visible (view, FALSE);
gtk_tree_view_set_search_column (view, YGtkZyppModel::NAME_COLUMN);
- GtkTreeViewColumn *column;
- GtkCellRenderer *renderer;
- renderer = gtk_cell_renderer_pixbuf_new();
- column = gtk_tree_view_column_new_with_attributes ("", renderer,
- "pixbuf", YGtkZyppModel::ICON_COLUMN, NULL);
- gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
- gtk_tree_view_column_set_fixed_width (column, 38);
- gtk_tree_view_append_column (view, column);
- renderer = gtk_cell_renderer_text_new();
- if (isTree) {
- int height = MAX (34, YGUtils::getCharsHeight (m_widget, 2));
- gtk_cell_renderer_set_fixed_size (renderer, -1, height);
- }
- g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
- gboolean reverse = gtk_widget_get_default_direction() == GTK_TEXT_DIR_RTL;
- if (reverse) { // work-around: Pango ignored alignment flag on RTL
- gtk_widget_set_direction (m_widget, GTK_TEXT_DIR_LTR);
- g_object_set (renderer, "alignment", PANGO_ALIGN_RIGHT, NULL);
- }
- column = gtk_tree_view_column_new_with_attributes ("", renderer,
- "markup", YGtkZyppModel::NAME_DESCRIPTION_COLUMN, NULL);
- gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
- gtk_tree_view_column_set_fixed_width (column, 50 /* it will expand */);
- gtk_tree_view_column_set_expand (column, TRUE);
- gtk_tree_view_insert_column (view, column, reverse ? 0 : -1);
gtk_tree_view_set_fixed_height_mode (view, TRUE);
gtk_tree_view_set_show_expanders (view, FALSE); /* would conflict with icons */
@@ -467,10 +440,8 @@
if (editable) {
g_signal_connect (G_OBJECT (m_widget), "row-activated",
G_CALLBACK (package_activated_cb), this);
- g_signal_connect (G_OBJECT (m_widget), "popup-menu",
- G_CALLBACK (popup_key_cb), this);
- g_signal_connect (G_OBJECT (m_widget), "button-press-event",
- G_CALLBACK (popup_button_cb), this);
+ g_signal_connect (G_OBJECT (m_widget), "right-click",
+ G_CALLBACK (popup_menu_cb), this);
}
gtk_widget_set_has_tooltip (m_widget, TRUE);
g_signal_connect (G_OBJECT (m_widget), "query-tooltip",
@@ -478,6 +449,54 @@
ensure_view_visible_hook (m_widget);
}
+ void appendIconCol()
+ {
+ GtkTreeView *view = GTK_TREE_VIEW (m_widget);
+ GtkTreeViewColumn *column;
+ GtkCellRenderer *renderer = gtk_cell_renderer_pixbuf_new();
+ if (m_isTree) {
+ int height = MAX (34, YGUtils::getCharsHeight (m_widget, 2));
+ gtk_cell_renderer_set_fixed_size (renderer, -1, height);
+ }
+ column = gtk_tree_view_column_new_with_attributes (
+ "", renderer, "pixbuf", YGtkZyppModel::ICON_COLUMN, NULL);
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
+ gtk_tree_view_column_set_fixed_width (column, 38);
+ gtk_tree_view_append_column (view, column);
+ }
+ void appendTextCol (int modelCol)
+ {
+ GtkTreeView *view = GTK_TREE_VIEW (m_widget);
+ GtkCellRenderer *renderer = gtk_cell_renderer_text_new();
+ g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ gboolean reverse = gtk_widget_get_default_direction() == GTK_TEXT_DIR_RTL;
+ if (reverse) { // work-around: Pango ignored alignment flag on RTL
+ gtk_widget_set_direction (m_widget, GTK_TEXT_DIR_LTR);
+ g_object_set (renderer, "alignment", PANGO_ALIGN_RIGHT, NULL);
+ }
+ GtkTreeViewColumn *column;
+ column = gtk_tree_view_column_new_with_attributes (
+ "", renderer, "markup", modelCol, NULL);
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
+ gtk_tree_view_column_set_fixed_width (column, 50 /* it will expand */);
+ gtk_tree_view_column_set_expand (column, TRUE);
+ gtk_tree_view_insert_column (view, column, reverse ? 0 : -1);
+ }
+ void appendCheckCol()
+ {
+ GtkTreeView *view = GTK_TREE_VIEW (m_widget);
+ GtkCellRenderer *renderer = gtk_cell_renderer_toggle_new();
+ GtkTreeViewColumn *column;
+ column = gtk_tree_view_column_new_with_attributes (
+ "", renderer, "active", YGtkZyppModel::IS_INSTALLED_COLUMN, NULL);
+ gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_FIXED);
+ // it seems like GtkCellRendererToggle has no width at start, so fixed doesn't work
+ gtk_tree_view_column_set_fixed_width (column, 25);
+ gtk_tree_view_append_column (view, column);
+ g_signal_connect (G_OBJECT (renderer), "toggled",
+ G_CALLBACK (toggled_cb), this);
+ }
+
virtual void setModel (GtkTreeModel *model)
{
GtkTreeView *view = GTK_TREE_VIEW (m_widget);
@@ -514,26 +533,26 @@
packages.install();
}
- static gboolean popup_button_cb (GtkWidget *widget, GdkEventButton *event, View *pThis)
+ static void toggled_cb (GtkCellRendererToggle *renderer, gchar *path_str,
+ TreeView *pThis)
{
- // workaround (based on gedit): we want the tree view to receive this press in order
- // to select the row, but we can't use connect_after, so we throw a dummy mouse press
- if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
- static bool safeguard = false;
- if (safeguard) return false;
- safeguard = true;
- if (pThis->countSelected() <= 1) { // if there is a selection, let it be
- event->button = 1;
- if (!gtk_widget_event (widget, (GdkEvent *) event))
- return FALSE;
- }
- pThis->signalPopup (3, event->time);
- safeguard = false;
- return TRUE;
- }
- return FALSE;
+ Ypp::Package *package = 0;
+ GtkTreeIter iter;
+ GtkTreeView *view = GTK_TREE_VIEW (pThis->m_widget);
+ GtkTreeModel *model = gtk_tree_view_get_model (view);
+ gtk_tree_model_get_iter_from_string (model, &iter, path_str);
+ gtk_tree_model_get (model, &iter, YGtkZyppModel::PTR_COLUMN, &package, -1);
+ if (package->toModify())
+ package->undo();
+ else if (package->isInstalled())
+ package->remove();
+ else
+ package->install (0);
}
+ static void popup_menu_cb (YGtkTreeView *view, gboolean outreach, View *pThis)
+ { if (!outreach) pThis->signalPopup(3, gtk_get_current_event_time()); }
+
static gboolean can_select_row_cb (GtkTreeSelection *selection, GtkTreeModel *model,
GtkTreePath *path, gboolean path_currently_selected, gpointer data)
{
@@ -545,7 +564,7 @@
}
static gboolean query_tooltip_cb (GtkWidget *widget, gint x, gint y,
- gboolean keyboard_mode, GtkTooltip *tooltip, ListView *pThis)
+ gboolean keyboard_mode, GtkTooltip *tooltip, TreeView *pThis)
{
GtkTreeView *view = GTK_TREE_VIEW (widget);
GtkTreeModel *model;
@@ -624,13 +643,31 @@
return FALSE;
}
};
+ struct ListView : public TreeView
+ {
+ ListView (bool isTree, bool descriptiveTooltip, bool editable, PackagesView *parent)
+ : TreeView (isTree, descriptiveTooltip, editable, parent)
+ {
+ appendIconCol();
+ appendTextCol (YGtkZyppModel::NAME_DESCRIPTION_COLUMN);
+ }
+ };
+ struct CheckView : public TreeView
+ {
+ CheckView (PackagesView *parent)
+ : TreeView (false, false, true, parent)
+ {
+ appendCheckCol();
+ appendTextCol (YGtkZyppModel::NAME_COLUMN);
+ }
+ };
struct IconView : public View
{
IconView (bool editable, PackagesView *parent)
: View (parent)
{
GtkIconView *view = GTK_ICON_VIEW (m_widget = gtk_icon_view_new());
- gtk_icon_view_set_text_column (view, YGtkZyppModel::NAME_COLUMN);
+ gtk_icon_view_set_text_column (view, YGtkZyppModel::NAME_TRUNCATE_COLUMN);
gtk_icon_view_set_pixbuf_column (view, YGtkZyppModel::ICON_COLUMN);
gtk_icon_view_set_selection_mode (view, GTK_SELECTION_MULTIPLE);
g_signal_connect (G_OBJECT (m_widget), "selection-changed",
@@ -681,6 +718,8 @@
pThis->signalPopup (3, event->time);
return FALSE;
}
+ static gboolean popup_key_cb (GtkWidget *widget, View *pThis)
+ { pThis->signalPopup (0, gtk_get_current_event_time()); return TRUE; }
};
GtkWidget *m_bin;
@@ -721,7 +760,7 @@
}
enum ViewMode {
- LIST_MODE, ICON_MODE
+ LIST_MODE, ICON_MODE, CHECK_MODE
};
void setMode (ViewMode mode, bool editable)
{
@@ -729,10 +768,17 @@
if (m_view)
gtk_container_remove (GTK_CONTAINER (m_bin), m_view->m_widget);
delete m_view;
- if (mode == LIST_MODE)
- m_view = new ListView (m_isTree, m_descriptiveTooltip, editable, this);
- else // if (mode == ICON_MODE)
- m_view = new IconView (editable, this);
+ switch (mode) {
+ case LIST_MODE:
+ m_view = new ListView (m_isTree, m_descriptiveTooltip, editable, this);
+ break;
+ case ICON_MODE:
+ m_view = new IconView (editable, this);
+ break;
+ case CHECK_MODE:
+ m_view = new CheckView (this);
+ break;
+ }
gtk_container_add (GTK_CONTAINER (m_bin), m_view->m_widget);
if (m_model)
m_view->setModel (m_model);
@@ -2549,6 +2595,9 @@
}
};
+// mockup experiments
+#define PKG_SELECTOR_FACE 0
+
class PackageSelector : public Filters::Listener, public PackagesView::Listener,
public PackageDetails::Listener
{
@@ -2577,6 +2626,7 @@
m_filters->setListener (this);
m_details->setListener (this);
+#if (PKG_SELECTOR_FACE == 0)
GtkWidget *categories_box = gtk_vbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (categories_box), m_filters->getTypeWidget(), FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (categories_box), m_filters->getCollectionWidget(),
@@ -2613,6 +2663,103 @@
gtk_box_pack_start (GTK_BOX (m_box), m_filters->getStatusesWidget(),
FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (m_box), details_pane, TRUE, TRUE, 0);
+#endif
+#if (PKG_SELECTOR_FACE == 1)
+ // based on KPorts: http://kde-apps.org/content/show.php/KPorts?content=24579
+ GtkWidget *type_combo = gtk_combo_box_new_text();
+ gtk_combo_box_append_text (GTK_COMBO_BOX (type_combo), "Search");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (type_combo), "Groups");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (type_combo), "Changed");
+ gtk_combo_box_set_active (GTK_COMBO_BOX (type_combo), 0);
+
+ GtkWidget *pkg_box = gtk_vbox_new (FALSE, 6);
+ //gtk_box_pack_start (GTK_BOX (pkg_box), m_filters->getTypeWidget(), FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (pkg_box), type_combo, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (pkg_box), m_filters->getNameWidget(), FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (pkg_box), m_packages->getWidget(), TRUE, TRUE, 0);
+ m_packages->setMode (PackagesView::CHECK_MODE, true);
+
+ GtkWidget *control_align = gtk_alignment_new (0, 0, 0, 1);
+ gtk_container_add (GTK_CONTAINER (control_align), m_control->getWidget());
+
+ m_details_box = gtk_vbox_new (FALSE, 6);
+ gtk_box_pack_start (GTK_BOX (m_details_box), m_details->getWidget(), TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_details_box), control_align, FALSE, TRUE, 0);
+
+ m_box = gtk_hpaned_new();
+ gtk_paned_pack1 (GTK_PANED (m_box), pkg_box, TRUE, FALSE);
+ gtk_paned_pack2 (GTK_PANED (m_box), m_details_box, TRUE, FALSE);
+ gtk_paned_set_position (GTK_PANED (m_box), 250);
+#endif
+#if (PKG_SELECTOR_FACE == 2)
+ struct inner {
+ static void install_button_clicked_cb (GtkButton *button, PackagesView *view)
+ {
+ PkgList pkgs = view->getSelected();
+ pkgs.install();
+ }
+ static void remove_button_clicked_cb (GtkButton *button, PackagesView *view)
+ {
+ PkgList pkgs = view->getSelected();
+ pkgs.remove();
+ }
+ static void undo_button_clicked_cb (GtkButton *button, PackagesView *view)
+ {
+ PkgList pkgs = view->getSelected();
+ pkgs.undo();
+ }
+ };
+
+ Ypp::QueryPool::Query *query = new Ypp::QueryPool::Query();
+ query->setToModify (true);
+ PackagesView *changes = new PackagesView (true, false, false, true, true);
+ changes->setQuery (query);
+
+ GtkWidget *install_btn = gtk_button_new_with_label (" install > ");
+ GtkWidget *undo_btn = gtk_button_new_with_label (" < undo ");
+ g_signal_connect (G_OBJECT (install_btn), "clicked",
+ G_CALLBACK (inner::install_button_clicked_cb), m_packages);
+ g_signal_connect (G_OBJECT (undo_btn), "clicked",
+ G_CALLBACK (inner::undo_button_clicked_cb), changes);
+ //gtk_widget_set_sensitive (undo_btn, FALSE);
+
+ m_details_box = gtk_vbox_new (FALSE, 18);
+ //gtk_box_pack_start (GTK_BOX (m_details_box), m_control->getWidget(), FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_details_box), gtk_label_new (""), TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_details_box), install_btn, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_details_box), undo_btn, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_details_box), gtk_label_new (""), TRUE, TRUE, 0);
+
+ GtkWidget *type_combo = gtk_combo_box_new_text();
+ gtk_combo_box_append_text (GTK_COMBO_BOX (type_combo), "Available");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (type_combo), "Upgrades");
+ gtk_combo_box_append_text (GTK_COMBO_BOX (type_combo), "Installed");
+ gtk_combo_box_set_active (GTK_COMBO_BOX (type_combo), 0);
+
+ GtkWidget *find_align = gtk_alignment_new (0, 0, 0, 1);
+ gtk_container_add (GTK_CONTAINER (find_align), m_filters->getNameWidget());
+
+ GtkWidget *packages_box = gtk_vbox_new (FALSE, 6);
+ gtk_box_pack_start (GTK_BOX (packages_box), type_combo, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (packages_box), m_packages->getWidget(), TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (packages_box), find_align, FALSE, TRUE, 0);
+
+ GtkWidget *changes_label = gtk_label_new ("Changes:");
+ gtk_misc_set_alignment (GTK_MISC (changes_label), 0, 0.5);
+ GtkWidget *changes_box = gtk_vbox_new (FALSE, 6);
+ gtk_box_pack_start (GTK_BOX (changes_box), changes_label, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (changes_box), changes->getWidget(), TRUE, TRUE, 0);
+
+ GtkSizeGroup *labels_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
+ gtk_size_group_add_widget (labels_group, type_combo); // type_combo is acting as a label
+ gtk_size_group_add_widget (labels_group, changes_label);
+ g_object_unref (G_OBJECT (labels_group));
+
+ m_box = gtk_hbox_new (FALSE, 6);
+ gtk_box_pack_start (GTK_BOX (m_box), packages_box, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_box), m_details_box, FALSE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (m_box), changes_box, TRUE, TRUE, 0);
+#endif
gtk_widget_show_all (m_box);
m_changes->startHack();
@@ -2631,6 +2778,10 @@
virtual void doQuery (Ypp::QueryPool::Query *query)
{
+#if (PKG_SELECTOR_FACE == 1)
+query = new Ypp::QueryPool::Query();
+query->addType (Ypp::Package::PACKAGE_TYPE);
+#endif
m_packages->setQuery (query);
}
@@ -2700,11 +2851,15 @@
busyCursor();
m_package_selector = new PackageSelector();
+ ygtk_wizard_enable_button (wizard, wizard->next_button,
+ modifiedPackagesExist() ? TRUE : FALSE);
ygtk_wizard_set_child (YGTK_WIZARD (wizard), m_package_selector->getWidget());
createToolsButton();
+#if (PKG_SELECTOR_FACE == 0)
ygtk_wizard_set_information_widget (YGTK_WIZARD (wizard),
m_package_selector->m_changes->getWidget(), FALSE);
+#endif
Ypp::get()->setInterface (this);
Ypp::get()->addPkgListener (this);
@@ -2720,6 +2875,19 @@
}
protected:
+
+ bool modifiedPackagesExist()
+ {
+ Ypp::QueryPool::Query *query = new Ypp::QueryPool::Query();
+ query->setToModify (true);
+ if (pkg_selector->onlineUpdateMode())
+ query->addType (Ypp::Package::PATCH_TYPE);
+ Ypp::QueryPool * tmp_pool = new Ypp::QueryPool (query);
+ bool m_p_exist = tmp_pool->getFirst() != NULL;
+ delete tmp_pool;
+ return m_p_exist;
+ }
+
static void wizard_action_cb (YGtkWizard *wizard, gpointer id,
gint id_type, YGPackageSelector *pThis)
{
@@ -3160,7 +3328,7 @@
ygtk_menu_button_set_popup (YGTK_MENU_BUTTON (button), popup);
gtk_widget_show_all (popup);
- GtkWidget *box = gtk_hbox_new (FALSE, 12);
+ GtkWidget *box = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (box), button, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (box),
m_package_selector->m_disk->getWidget(), FALSE, TRUE, 0);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGProgressBar.cc new/yast2-gtk-2.18.0/src/YGProgressBar.cc
--- old/yast2-gtk-2.17.9/src/YGProgressBar.cc 2009-01-07 12:10:31.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGProgressBar.cc 2009-02-20 10:50:33.000000000 +0100
@@ -11,6 +11,30 @@
#include "YGWidget.h"
#include "YGi18n.h"
+std::string size_stdform (YFileSize_t size)
+{
+ long double mantissa = size;
+ int unit = 0;
+ for (; mantissa/1024 > 1; unit++)
+ mantissa /= 1024;
+
+ const char *unit_str = "";
+ switch (unit) {
+ // translator: byte shorthand
+ case 0: unit_str = _("B"); break;
+ case 1: unit_str = _("KB"); break;
+ case 2: unit_str = _("MB"); break;
+ case 3: unit_str = _("GB"); break;
+ case 4: unit_str = _("TB"); break;
+ default: mantissa = 0; break;
+ }
+
+ gchar *text = g_strdup_printf ("%.1f %s", (float) mantissa, unit_str);
+ std::string str (text);
+ g_free (text);
+ return str;
+}
+
#include "YProgressBar.h"
class YGProgressBar : public YProgressBar, public YGLabeledWidget
@@ -82,42 +106,13 @@
YGDownloadProgress *pThis = (YGDownloadProgress*) pData;
GtkProgressBar *bar = GTK_PROGRESS_BAR (pThis->getWidget());
- double current, total;
- int unit = 0;
- for (current = pThis->currentFileSize(), total = pThis->expectedSize(); total/1024>1; unit++) {
- current /= 1024;
- total /= 1024;
+ gtk_progress_bar_set_fraction (bar, pThis->currentPercent() / 100.0);
+ if (pThis->expectedSize() > 0) {
+ std::string current (size_stdform (pThis->currentFileSize()));
+ std::string total (size_stdform (pThis->expectedSize()));
+ std::string text = current + " " + _("of") + " " + total;
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (bar), text.c_str());
}
- float fraction = 0;
- if (total)
- fraction = MIN ((float) current / total, 1);
-
- gtk_progress_bar_set_fraction (bar, fraction);
- const char *unit_str;
- switch (unit) {
- case 0:
- unit_str = "B";
- break;
- case 1:
- unit_str = "KB";
- break;
- case 2:
- unit_str = "MB";
- break;
- case 3:
- unit_str = "GB";
- break;
- default:
- unit_str = "";
- break;
- }
- char *text;
- if (total)
- text = g_strdup_printf ("%.1f %s %s %.1f %s", current, unit_str, _("of"), total, unit_str);
- else
- text = g_strdup_printf ("%.1f %s", current, unit_str);
- gtk_progress_bar_set_text (GTK_PROGRESS_BAR (bar), text);
- g_free (text);
return TRUE;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGPushButton.cc new/yast2-gtk-2.18.0/src/YGPushButton.cc
--- old/yast2-gtk-2.17.9/src/YGPushButton.cc 2009-01-07 12:10:31.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGPushButton.cc 2009-02-20 10:50:33.000000000 +0100
@@ -40,7 +40,7 @@
case 7: stock = GTK_STOCK_PREFERENCES; break; // Expert
case 8: stock = GTK_STOCK_GO_BACK; break;
case 9: stock = GTK_STOCK_CANCEL; break;
-// case 10: stock = GTK_STOCK_GO_FORWARD; break;
+ case 10: stock = GTK_STOCK_OK; break; // Next/Finish/OK
default: break;
}
#if YAST2_VERSION >= 2017006
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGSelectionModel.h new/yast2-gtk-2.18.0/src/YGSelectionModel.h
--- old/yast2-gtk-2.17.9/src/YGSelectionModel.h 2009-01-07 12:10:30.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGSelectionModel.h 2009-02-20 10:50:33.000000000 +0100
@@ -29,7 +29,8 @@
virtual void doAddItem (YItem *item);
virtual void doDeleteAllItems();
virtual YItem *doSelectedItem() = 0;
- virtual void doSelectItem (GtkTreeIter *iter) = 0; // NULL to unselect all
+ virtual void doSelectItem (GtkTreeIter *iter) = 0;
+ virtual void doUnselectAll() = 0;
YItemConstIterator itemsBegin() { return ywidget->itemsBegin(); }
YItemConstIterator itemsEnd() { return ywidget->itemsEnd(); }
@@ -79,7 +80,7 @@
} \
virtual void deselectAllItems() { \
ParentClass::deselectAllItems(); \
- doSelectItem (NULL); \
+ doUnselectAll(); \
} \
virtual YItem *selectedItem() { \
return doSelectedItem(); \
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGTable.cc new/yast2-gtk-2.18.0/src/YGTable.cc
--- old/yast2-gtk-2.17.9/src/YGTable.cc 2009-01-07 12:10:31.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGTable.cc 2009-04-27 11:25:46.000000000 +0200
@@ -9,23 +9,25 @@
#include "YSelectionWidget.h"
#include "YGSelectionModel.h"
#include "ygtkcellrenderertextpixbuf.h"
+#include "ygtkscrolledwindow.h"
+#include
/* A generic widget for table related widgets. */
class YGTableView : public YGScrolledWidget, public YGSelectionModel
{
protected:
int m_colsNb;
- bool m_blockSelected; // GtkTreeSelection signals act weird
+ time_t m_blockTime; // GtkTreeSelection signals act weird
public:
YGTableView (YWidget *ywidget, YWidget *parent, const string &label,
bool ordinaryModel, bool isTree)
: YGScrolledWidget (ywidget, parent, label, YD_VERT,
- GTK_TYPE_TREE_VIEW, NULL)
+ YGTK_TYPE_TREE_VIEW, NULL)
, YGSelectionModel ((YSelectionWidget *) ywidget, ordinaryModel, isTree)
{
IMPL
- m_blockSelected = false;
+ m_blockTime = time (NULL);
if (ordinaryModel) {
appendIconTextColumn ("", YAlignUnchanged, YGSelectionModel::ICON_COLUMN,
YGSelectionModel::LABEL_COLUMN);
@@ -81,7 +83,6 @@
void appendCheckColumn (string header, int bool_col)
{
- IMPL
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;
@@ -99,7 +100,6 @@
void appendDumbColumn()
{
- IMPL
gtk_tree_view_append_column (getView(), gtk_tree_view_column_new());
}
@@ -109,20 +109,28 @@
virtual bool immediateEvent() { return true; }
// YGSelectionModel
+
virtual void doSelectItem (GtkTreeIter *iter)
{
- m_blockSelected = true;
- if (iter) {
+ if (!gtk_tree_selection_iter_is_selected (getSelection(), iter)) {
+ m_blockTime = time (NULL);
GtkTreePath *path = gtk_tree_model_get_path (getModel(), iter);
gtk_tree_view_expand_to_path (getView(), path);
- gtk_tree_selection_select_iter (getSelection(), iter);
if (gtk_tree_selection_get_mode (getSelection()) != GTK_SELECTION_MULTIPLE)
gtk_tree_view_scroll_to_cell (getView(), path, NULL, TRUE, 0.5, 0);
gtk_tree_path_free (path);
+
+ gtk_tree_selection_select_iter (getSelection(), iter);
}
- else
+ }
+
+ virtual void doUnselectAll()
+ {
+ if (gtk_tree_selection_count_selected_rows (getSelection())) {
+ m_blockTime = time (NULL);
gtk_tree_selection_unselect_all (getSelection());
+ }
}
virtual YItem *doSelectedItem()
@@ -148,7 +156,6 @@
return 80;
}
-protected:
// toggled by user (through clicking on the renderer or some other action)
void toggle (GtkTreePath *path, gint column)
{
@@ -167,10 +174,8 @@
static void selection_changed_cb (GtkTreeSelection *selection, YGTableView *pThis)
{
- if (pThis->m_blockSelected) {
- pThis->m_blockSelected = false;
+ if (time (NULL) - pThis->m_blockTime <= 2)
return;
- }
if (!pThis->toggleMode()) {
GtkTreeSelection *selection = pThis->getSelection();
for (YItemConstIterator it = pThis->itemsBegin(); it != pThis->itemsEnd(); it++) {
@@ -203,6 +208,8 @@
};
#include "YTable.h"
+#include "YGDialog.h"
+#include
class YGTable : public YTable, public YGTableView
{
@@ -243,6 +250,8 @@
connect (getWidget(), "row-activated", G_CALLBACK (activated_cb), (YGTableView *) this);
connect (getSelection(), "changed", G_CALLBACK (selection_changed_cb), (YGTableView *) this);
+ connect (getWidget(), "right-click", G_CALLBACK (right_click_cb), this);
+ connect (getWidget(), "key-press-event", G_CALLBACK (key_press_event_cb), this);
}
virtual void setKeepSorting (bool keepSorting)
@@ -322,6 +331,65 @@
}
YGSELECTION_WIDGET_IMPL (YTable)
+
+ // callbacks
+
+ // hack up a popup menu and honor the delete key as suggested at:
+ // http://mvidner.blogspot.com/2009/01/yast-ui-table-usability.html
+ static void activateButton (YWidget *button)
+ {
+ YWidgetEvent *event = new YWidgetEvent (button, YEvent::Activated);
+ YGUI::ui()->sendEvent (event);
+ }
+
+ static void right_click_cb (YGtkTreeView *view, gboolean outreach, YGTable *pThis)
+ {
+ if (!YGDialog::currentDialog()->getFunctionWidget (5) ||
+ // undetermined case -- more than one table exists
+ YGDialog::currentDialog()->getClassWidgets ("YTable").size() > 1) {
+ gtk_widget_error_bell (GTK_WIDGET (view));
+ return;
+ }
+
+ struct inner {
+ static void key_activate_cb (GtkMenuItem *item, YWidget *button)
+ { activateButton (button); }
+ static void appendItem (GtkWidget *menu, const gchar *stock, int key)
+ {
+ YWidget *button = YGDialog::currentDialog()->getFunctionWidget (key);
+ if (button) {
+ GtkWidget *item;
+ item = gtk_image_menu_item_new_from_stock (stock, NULL);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ g_signal_connect (G_OBJECT (item), "activate",
+ G_CALLBACK (key_activate_cb), button);
+ }
+ }
+ };
+
+ GtkWidget *menu = gtk_menu_new();
+ if (outreach)
+ inner::appendItem (menu, GTK_STOCK_ADD, 3);
+ else {
+ inner::appendItem (menu, GTK_STOCK_EDIT, 4);
+ inner::appendItem (menu, GTK_STOCK_DELETE, 5);
+ }
+ ygtk_tree_view_popup_menu (view, menu);
+ }
+
+ static gboolean key_press_event_cb (GtkWidget *widget, GdkEventKey *event, YGTable *pThis)
+ {
+ if (event->keyval == GDK_Delete) {
+ YWidget *button = YGDialog::currentDialog()->getFunctionWidget (5);
+ if (button)
+ activateButton (button);
+ else
+ gtk_widget_error_bell (widget);
+ return TRUE;
+ }
+ return FALSE;
+ }
+
};
#if YAST2_VERSION >= 2017005
@@ -386,8 +454,8 @@
}
// YMultiSelectionBox
- virtual void doAddItem (YItem *item)
- {
+ virtual void doAddItem (YItem *item)
+ {
GtkTreeIter iter;
addRow (&iter, item, false);
setCellToggle (&iter, 0, item->selected());
@@ -395,20 +463,6 @@
setCellLabel (&iter, 2, item->label());
}
- virtual void doSelectItem (YItem *item)
- {
- GtkTreeIter iter;
- if (getIter (item, &iter))
- setCellToggle (&iter, 0, item->selected());
- else { // unselect all
- if (gtk_tree_model_get_iter_first (getModel(), &iter)) {
- do {
- setCellToggle (&iter, 0, false);
- } while (gtk_tree_model_iter_next (getModel(), &iter));
- }
- }
- }
-
virtual YItem *currentItem()
{ return doSelectedItem(); }
@@ -426,13 +480,28 @@
// Events
static void multi_activated_cb (GtkTreeView *tree_view, GtkTreePath *path,
GtkTreeViewColumn *column, YGMultiSelectionBox* pThis)
+ { pThis->toggle (path, 0); }
+
+ // YGSelectionModel
+
+ virtual void doSelectItem (GtkTreeIter *iter)
{
- IMPL
- pThis->toggle (path, 0);
+ setCellToggle (iter, 0, true);
}
- virtual bool isShrinkable() { return shrinkable(); }
+ virtual void doUnselectAll()
+ {
+ GtkTreeIter iter;
+ if (gtk_tree_model_get_iter_first (getModel(), &iter)) {
+ do {
+ setCellToggle (&iter, 0, false);
+ } while (gtk_tree_model_iter_next (getModel(), &iter));
+ }
+ }
+ // YGWidget
+
+ virtual bool isShrinkable() { return shrinkable(); }
YGWIDGET_IMPL_COMMON (YMultiSelectionBox)
YGSELECTION_WIDGET_IMPL (YMultiSelectionBox)
};
@@ -454,10 +523,10 @@
: YTree (NULL, label)
, YGTableView (this, parent, label, true, true)
{
- connect (getWidget(), "row-activated", G_CALLBACK (activated_cb), this);
- connect (getWidget(), "cursor-changed", G_CALLBACK (row_selected_cb), this);
connect (getWidget(), "row-collapsed", G_CALLBACK (row_collapsed_cb), this);
connect (getWidget(), "row-expanded", G_CALLBACK (row_expanded_cb), this);
+ connect (getWidget(), "cursor-changed", G_CALLBACK (row_selected_cb), this);
+ connect (getWidget(), "row-activated", G_CALLBACK (activated_cb), (YGTableView *) this);
}
// YTree
@@ -519,6 +588,7 @@
}
}
}
+
static void row_selected_cb (GtkTreeView *view, YGTree *pThis)
{
// expand selected row
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGText.cc new/yast2-gtk-2.18.0/src/YGText.cc
--- old/yast2-gtk-2.17.9/src/YGText.cc 2009-01-07 12:10:31.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGText.cc 2009-05-26 13:43:12.000000000 +0200
@@ -187,11 +187,14 @@
ygtk_html_wrap_set_text (getWidget(), text.c_str(), TRUE);
}
- void setRichText (const string &_text)
+ void setRichText (const string &text)
{
+#if 0 // current done at the XHTML treatment level, we may want to enable
+ // this code so that we replace the entity for all widgets
string text (_text);
std::string productName = YUI::app()->productName();
YGUtils::replace (text, "&product;", 9, productName.c_str());
+#endif
ygtk_html_wrap_set_text (getWidget(), text.c_str(), FALSE);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/ygtkscrolledwindow.c new/yast2-gtk-2.18.0/src/ygtkscrolledwindow.c
--- old/yast2-gtk-2.17.9/src/ygtkscrolledwindow.c 2008-01-09 12:07:20.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/ygtkscrolledwindow.c 2009-02-20 10:50:33.000000000 +0100
@@ -97,3 +97,82 @@
gtkobject_class->destroy = ygtk_scrolled_window_destroy;
}
+/* YGtkTreeView widget */
+// check the header file for information about this widget
+
+static guint right_click_signal = 0;
+
+G_DEFINE_TYPE (YGtkTreeView, ygtk_tree_view, GTK_TYPE_TREE_VIEW)
+
+static void ygtk_tree_view_init (YGtkTreeView *view)
+{
+}
+
+static void _gtk_widget_destroy (gpointer widget)
+{ gtk_widget_destroy (GTK_WIDGET (widget)); }
+
+void ygtk_tree_view_popup_menu (YGtkTreeView *view, GtkWidget *menu)
+{
+ GtkWidget *widget = GTK_WIDGET (view);
+ // popup hack -- we can't destroy the menu at hide because it may not have
+ // emitted signals yet -- destroy it when replaced or the widget destroyed
+ g_object_set_data_full (G_OBJECT (view), "popup", menu, _gtk_widget_destroy);
+
+ guint32 time = gtk_get_current_event_time();
+ gtk_menu_attach_to_widget (GTK_MENU (menu), widget, NULL);
+ gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 3, time);
+ gtk_widget_show_all (menu);
+}
+
+static gboolean ygtk_tree_view_button_press_event (GtkWidget *widget, GdkEventButton *event)
+{
+ // workaround (based on gedit): we want the tree view to receive this press in order
+ // to select the row, but we can't use connect_after, so we throw a dummy mouse press
+ if (event->type == GDK_BUTTON_PRESS && event->button == 3) {
+ static gboolean safeguard = FALSE;
+ if (safeguard) return FALSE;
+ safeguard = TRUE;
+
+ GtkTreeView *view = GTK_TREE_VIEW (widget);
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (view);
+
+ gboolean outreach;
+ outreach = !gtk_tree_view_get_path_at_pos (view, event->x, event->y, 0, 0, 0, 0);
+ if (gtk_tree_selection_count_selected_rows (selection) <= 1) {
+ // if there is a selection, let it be
+ event->button = 1;
+ if (!gtk_widget_event (widget, (GdkEvent *) event))
+ return FALSE;
+ }
+ g_signal_emit (widget, right_click_signal, 0, outreach);
+ safeguard = FALSE;
+ return TRUE;
+ }
+ return GTK_WIDGET_CLASS (ygtk_tree_view_parent_class)->button_press_event (widget, event);
+}
+
+static gboolean _ygtk_tree_view_popup_menu (GtkWidget *widget)
+{
+ GtkTreeView *view = GTK_TREE_VIEW (widget);
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (view);
+ gboolean outreach = gtk_tree_selection_count_selected_rows (selection) == 0;
+
+ g_signal_emit (widget, right_click_signal, 0, outreach);
+ return TRUE;
+}
+
+GtkWidget *ygtk_tree_view_new (void)
+{ return g_object_new (YGTK_TYPE_TREE_VIEW, NULL); }
+
+static void ygtk_tree_view_class_init (YGtkTreeViewClass *klass)
+{
+ GtkWidgetClass *gtkwidget_class = GTK_WIDGET_CLASS (klass);
+ gtkwidget_class->button_press_event = ygtk_tree_view_button_press_event;
+ gtkwidget_class->popup_menu = _ygtk_tree_view_popup_menu;
+
+ right_click_signal = g_signal_new ("right-click",
+ G_OBJECT_CLASS_TYPE (klass), G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (YGtkTreeViewClass, right_click),
+ NULL, NULL, gtk_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
+}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/ygtkscrolledwindow.h new/yast2-gtk-2.18.0/src/ygtkscrolledwindow.h
--- old/yast2-gtk-2.17.9/src/ygtkscrolledwindow.h 2008-01-09 12:07:20.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/ygtkscrolledwindow.h 2009-02-20 10:50:33.000000000 +0100
@@ -49,3 +49,45 @@
G_END_DECLS
#endif /*YGTK_SCROLLED_WINDOW_H*/
+/* YGtkTreeView hacks support for a right-click signal.
+*/
+
+#ifndef YGTK_TREE_VIEW_H
+#define YGTK_TREE_VIEW_H
+
+#include
+G_BEGIN_DECLS
+
+#define YGTK_TYPE_TREE_VIEW (ygtk_tree_view_get_type ())
+#define YGTK_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+ YGTK_TYPE_TREE_VIEW, YGtkScrolledWindow))
+#define YGTK_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
+ YGTK_TYPE_TREE_VIEW, YGtkScrolledWindowClass))
+#define YGTK_IS_TREE_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+ YGTK_TYPE_TREE_VIEW))
+#define YGTK_IS_TREE_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+ YGTK_TYPE_TREE_VIEW))
+#define YGTK_TREE_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+ YGTK_TYPE_TREE_VIEW, YGtkScrolledWindowClass))
+
+typedef struct _YGtkTreeView
+{
+ GtkTreeView parent;
+} YGtkTreeView;
+
+typedef struct _YGtkTreeViewClass
+{
+ GtkTreeViewClass parent_class;
+
+ // signals:
+ void (*right_click) (YGtkTreeView *view, gboolean outreach);
+} YGtkTreeViewClass;
+
+GtkWidget* ygtk_tree_view_new (void);
+GType ygtk_tree_view_get_type (void) G_GNUC_CONST;
+
+void ygtk_tree_view_popup_menu (YGtkTreeView *view, GtkWidget *menu);
+
+G_END_DECLS
+#endif /*YGTK_TREE_VIEW_H*/
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/ygtkwizard.c new/yast2-gtk-2.18.0/src/ygtkwizard.c
--- old/yast2-gtk-2.17.9/src/ygtkwizard.c 2008-12-02 10:35:04.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/ygtkwizard.c 2009-02-20 10:50:33.000000000 +0100
@@ -591,7 +591,7 @@
g_signal_connect (G_OBJECT (wizard->help_button), "toggled",
G_CALLBACK (help_button_toggled_cb), wizard);
- wizard->m_buttons = gtk_hbox_new (FALSE, 12);
+ wizard->m_buttons = gtk_hbox_new (FALSE, 6);
gtk_widget_show (wizard->m_buttons);
gtk_box_pack_start (GTK_BOX (wizard->m_buttons), wizard->help_button, FALSE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (wizard->m_buttons), wizard->release_notes_button,
@@ -618,19 +618,17 @@
wizard->m_menu_box = gtk_event_box_new();
wizard->m_pane = gtk_hpaned_new();
- GtkWidget *contents_align = gtk_alignment_new (0, 0, 1, 1);
- gtk_alignment_set_padding (GTK_ALIGNMENT (contents_align), 6, 12, 0, 0);
- gtk_container_add (GTK_CONTAINER (contents_align), wizard->m_pane);
- gtk_widget_show_all (contents_align);
+ gtk_widget_show (wizard->m_pane);
wizard->m_contents_box = gtk_hbox_new (FALSE, 6);
- gtk_box_pack_start (GTK_BOX (wizard->m_contents_box), contents_align, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (wizard->m_contents_box), wizard->m_pane, TRUE, TRUE, 0);
gtk_widget_show (wizard->m_contents_box);
GtkWidget *vbox;
- vbox = gtk_vbox_new (FALSE, 0);
+ vbox = gtk_vbox_new (FALSE, 12);
+ gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); // content's border
gtk_box_pack_start (GTK_BOX (vbox), wizard->m_contents_box, TRUE, TRUE, 0);
- gtk_box_pack_start (GTK_BOX (vbox), wizard->m_buttons, FALSE, TRUE, 6);
+ gtk_box_pack_start (GTK_BOX (vbox), wizard->m_buttons, FALSE, TRUE, 0);
gtk_widget_show (vbox);
wizard->m_contents_buttons_box = gtk_hbox_new (FALSE, 6);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/ygtkzyppwrapper.cc new/yast2-gtk-2.18.0/src/ygtkzyppwrapper.cc
--- old/yast2-gtk-2.17.9/src/ygtkzyppwrapper.cc 2008-11-21 12:26:26.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/ygtkzyppwrapper.cc 2009-02-20 10:50:33.000000000 +0100
@@ -222,8 +222,11 @@
case YGtkZyppModel::ICON_COLUMN:
return GDK_TYPE_PIXBUF;
case YGtkZyppModel::NAME_COLUMN:
+ case YGtkZyppModel::NAME_TRUNCATE_COLUMN:
case YGtkZyppModel::NAME_DESCRIPTION_COLUMN:
return G_TYPE_STRING;
+ case YGtkZyppModel::IS_INSTALLED_COLUMN:
+ return G_TYPE_BOOLEAN;
case YGtkZyppModel::PTR_COLUMN:
return G_TYPE_POINTER;
}
@@ -315,8 +318,19 @@
}
case YGtkZyppModel::NAME_COLUMN:
{
- std::string name = YGUtils::truncate (package->name(), 15, 1);
- g_value_set_string (value, g_strdup (name.c_str()));
+ bool highlight = zmodel->pool->highlight (pool_iter);
+ std::string str (package->name());
+ if (highlight)
+ str = "<b>" + str + "</b>";
+ if (package->toModify())
+ str = "<i>" + str + "</i>";
+ g_value_set_string (value, g_strdup (str.c_str()));
+ break;
+ }
+ case YGtkZyppModel::NAME_TRUNCATE_COLUMN:
+ {
+ std::string str (YGUtils::truncate (package->name(), 15, 1));
+ g_value_set_string (value, g_strdup (str.c_str()));
break;
}
case YGtkZyppModel::NAME_DESCRIPTION_COLUMN:
@@ -335,6 +349,13 @@
g_value_set_string (value, g_strdup (str.c_str()));
break;
}
+ case YGtkZyppModel::IS_INSTALLED_COLUMN:
+ {
+ bool installed = package->toInstall() ||
+ (package->isInstalled() && !package->toRemove());
+ g_value_set_boolean (value, installed);
+ break;
+ }
case YGtkZyppModel::PTR_COLUMN:
{
void *ptr;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/ygtkzyppwrapper.h new/yast2-gtk-2.18.0/src/ygtkzyppwrapper.h
--- old/yast2-gtk-2.17.9/src/ygtkzyppwrapper.h 2008-11-17 18:08:50.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/ygtkzyppwrapper.h 2009-02-20 10:50:33.000000000 +0100
@@ -26,8 +26,8 @@
GObject parent;
enum Columns {
- ICON_COLUMN, NAME_COLUMN, NAME_DESCRIPTION_COLUMN,
- PTR_COLUMN, TOTAL_COLUMNS
+ ICON_COLUMN, NAME_COLUMN, NAME_TRUNCATE_COLUMN, NAME_DESCRIPTION_COLUMN,
+ IS_INSTALLED_COLUMN, PTR_COLUMN, TOTAL_COLUMNS
};
Ypp::Pool *pool;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGUI.cc new/yast2-gtk-2.18.0/src/YGUI.cc
--- old/yast2-gtk-2.17.9/src/YGUI.cc 2009-01-07 12:10:30.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGUI.cc 2009-02-20 10:50:33.000000000 +0100
@@ -521,10 +521,11 @@
std::string YGApplication::glyph (const std::string &sym)
{
+ bool reverse = gtk_widget_get_default_direction() == GTK_TEXT_DIR_RTL;
if (sym == YUIGlyph_ArrowLeft)
- return "\u2190";
+ return reverse ? "\u2192" : "\u2190";
if (sym == YUIGlyph_ArrowRight)
- return "\u2192";
+ return reverse ? "\u2190" : "\u2192";
if (sym == YUIGlyph_ArrowUp)
return "\u2191";
if (sym == YUIGlyph_ArrowDown)
@@ -532,7 +533,7 @@
if (sym == YUIGlyph_CheckMark)
return "\u2714";
if (sym == YUIGlyph_BulletArrowRight)
- return (gtk_widget_get_default_direction() == GTK_TEXT_DIR_RTL) ? "\u21e6" : "\u279c";
+ return reverse ? "\u21e6" : "\u279c";
if (sym == YUIGlyph_BulletCircle)
return "\u274d";
if (sym == YUIGlyph_BulletSquare)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/src/YGUtils.cc new/yast2-gtk-2.18.0/src/YGUtils.cc
--- old/yast2-gtk-2.17.9/src/YGUtils.cc 2008-12-02 10:35:04.000000000 +0100
+++ new/yast2-gtk-2.18.0/src/YGUtils.cc 2009-02-20 10:50:33.000000000 +0100
@@ -100,6 +100,7 @@
static const EntityMap entities[] = {
{ "nbsp", " " },
+ { "product", 0 }, // dynamic
};
static const EntityMap *lookup_entity (const char *html)
@@ -238,12 +239,25 @@
else if (instr[i] == '&') { // Entity
const EntityMap *entity = lookup_entity (instr+i);
if (entity) {
- g_string_append (outp, entity->text);
+ if (!strcmp (entity->html, "product"))
+ g_string_append (outp, YUI::app()->productName().c_str());
+ else
+ g_string_append (outp, entity->text);
i += strlen (entity->html);
if (instr[i+1] == ';') i++;
}
- else
- g_string_append_c (outp, instr[i]);
+ else {
+ int j;
+ // check it is a valid entity - not a floating '&' in a <pre> tag eg.
+ for (j = i + 1; instr[j] != '\0'; j++) {
+ if (!g_ascii_isalnum (instr[j]) && instr[j] != '#')
+ break;
+ }
+ if (instr[j] != ';') // entity terminator
+ g_string_append (outp, "&");
+ else
+ g_string_append_c (outp, instr[i]);
+ }
was_space = FALSE;
}
@@ -303,7 +317,7 @@
if (!*j) {
// not valid text
g_signal_stop_emission_by_name (editable, "insert_text");
- gdk_beep();
+ gtk_widget_error_bell (GTK_WIDGET (editable));
return;
}
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-gtk-2.17.9/VERSION new/yast2-gtk-2.18.0/VERSION
--- old/yast2-gtk-2.17.9/VERSION 2009-01-07 12:22:25.000000000 +0100
+++ new/yast2-gtk-2.18.0/VERSION 2009-04-27 11:28:37.000000000 +0200
@@ -1 +1 @@
-2.17.9
+2.18.0
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org