Author: coolo
Date: Sun Jun 8 10:37:05 2008
New Revision: 48149
URL: http://svn.opensuse.org/viewcvs/yast?rev=48149&view=rev
Log:
merge in most of the changes since last update to get
the crash fixes
Modified:
branches/SuSE-Linux-11_0-Branch/gtk/ChangeLog
branches/SuSE-Linux-11_0-Branch/gtk/VERSION
branches/SuSE-Linux-11_0-Branch/gtk/package/yast2-gtk.changes
branches/SuSE-Linux-11_0-Branch/gtk/src/YGDialog.cc
branches/SuSE-Linux-11_0-Branch/gtk/src/YGDumbTab.cc
branches/SuSE-Linux-11_0-Branch/gtk/src/YGPackageSelector.cc
branches/SuSE-Linux-11_0-Branch/gtk/src/YGTable.cc
branches/SuSE-Linux-11_0-Branch/gtk/src/YGWidget.h
branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkmenubutton.c
branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkrichtext.c
branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkrichtext.h
branches/SuSE-Linux-11_0-Branch/gtk/src/ygtksteps.c
Modified: branches/SuSE-Linux-11_0-Branch/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/ChangeLog?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/ChangeLog (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/ChangeLog Sun Jun 8 10:37:05 2008
@@ -1,3 +1,29 @@
+2008-06-08 Ricardo Cruz
+
+ * src/ygtkrichtext.h/c: bug fix 393143: cursor ownership was
+ not judged properly.
+
+ * src/YGPackageSelector.cc: bug fix 398272: enable scroll bar on
+ Filtered Repositories Dependencies dialog.
+
+2008-06-04 Ricardo Cruz
+
+ * src/ygtkmenubutton.c: fixed bug 396731: popup menu from the button
+ up when near the bottom corner.
+
+ * src/YGTable.cc: fixed bug 396360 (more like a design flaw in libyui):
+ "last column in Table widget is too far right with option right".
+ Just ignoring the alignment for the last column, so it aligns left...
+
+ * src/YGTable.cc: fixed setKeepSorting(). Wasn't honoring when it
+ was set false.
+
+ * src/YGDumbTab.cc: fixed bug: 396033. Some minor bug resulted from
+ the fact we are supposed to call parent's methods before running
+ our code... NOTE
+
+ * src/YGDialog.cc: some changes to see if we fix bug 393143...
+
2008-06-02 Michael Meeks
* src/YGUI.cc (YGApplication::makeScreenShot),
@@ -10,6 +36,9 @@
* src/YGUI.cc: fixed bug 395484. Wrong check that assumed error
was set, crashing...
+ * 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
Modified: branches/SuSE-Linux-11_0-Branch/gtk/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/VERSION?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/VERSION (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/VERSION Sun Jun 8 10:37:05 2008
@@ -1 +1 @@
-2.16.13
+2.16.14
Modified: branches/SuSE-Linux-11_0-Branch/gtk/package/yast2-gtk.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/package/yast2-gtk.changes?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/package/yast2-gtk.changes (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/package/yast2-gtk.changes Sun Jun 8 10:37:05 2008
@@ -1,4 +1,15 @@
-------------------------------------------------------------------
+Sun Jun 8 10:34:15 CEST 2008 - coolo@suse.de
+
+- Update to 2.16.14
+* fixed bnc#395484: Wrong check that assumed error was set, crashing...
+* fixed bnc#396731: popup menu from the button up when near the bottom corner.
+* fixed bnc#396360: ignoring the alignment for the last column, so it aligns left
+* fixed bnc#396033: Some minor bug
+* fixed bnc#393143: cursor ownership was not judged properly
+* fixed bnc#398272: enable scroll bar on Filtered Repositories
+
+-------------------------------------------------------------------
Tue Jun 3 07:46:59 CEST 2008 - coolo@suse.de
- Update to version 2.16.13
Modified: branches/SuSE-Linux-11_0-Branch/gtk/src/YGDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/src/YGDialog.cc?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/src/YGDialog.cc (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/src/YGDialog.cc Sun Jun 8 10:37:05 2008
@@ -111,6 +111,7 @@
// we keep a pointer of the child just for debugging
// (ie. dump yast tree)
YWidget *m_child;
+ GdkCursor *m_busyCursor;
public:
YGWindowCloseFn m_canClose;
@@ -125,6 +126,7 @@
m_refcount = 0;
m_child = NULL;
m_canClose = NULL;
+ m_busyCursor = NULL;
{
std::stack &stack = YDialog::_dialogStack;
@@ -193,6 +195,8 @@
{
IMPL
setChild (NULL);
+ if (m_busyCursor)
+ gdk_cursor_unref (m_busyCursor);
gtk_widget_destroy (m_widget);
g_object_unref (G_OBJECT (m_widget));
}
@@ -202,17 +206,17 @@
void normalCursor()
{
- if (GTK_WIDGET_REALIZED (m_widget))
- gdk_window_set_cursor (m_widget->window, NULL);
+ gdk_window_set_cursor (m_widget->window, NULL);
}
void busyCursor()
{
- if (GTK_WIDGET_REALIZED (m_widget)) {
- 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);
+ GdkDisplay *display = gtk_widget_get_display (m_widget);
+ if (!m_busyCursor) {
+ m_busyCursor = gdk_cursor_new_for_display (display, GDK_WATCH);
+ gdk_cursor_ref (m_busyCursor);
}
+ gdk_window_set_cursor (m_widget->window, m_busyCursor);
}
void setChild (YWidget *new_child)
Modified: branches/SuSE-Linux-11_0-Branch/gtk/src/YGDumbTab.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/src/YGDumbTab.cc?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/src/YGDumbTab.cc (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/src/YGDumbTab.cc Sun Jun 8 10:37:05 2008
@@ -44,19 +44,16 @@
virtual void addItem (YItem *item)
{
- GtkWidget *tab_label, *image = 0, *label;
-
- string str = YGUtils::mapKBAccel (item->label());
- label = gtk_label_new_with_mnemonic (str.c_str());
- gtk_widget_show (label);
+ YDumbTab::addItem (item);
+ GtkWidget *tab_label, *image = 0, *label;
+ label = gtk_label_new (item->label().c_str());
if (item->hasIconName()) {
string path = iconFullPath (item->iconName());
GdkPixbuf *pixbuf = YGUtils::loadPixbuf (path);
if (pixbuf)
image = gtk_image_new_from_pixbuf (pixbuf);
}
-
if (image) {
tab_label = gtk_hbox_new (FALSE, 6);
gtk_box_pack_start (GTK_BOX (tab_label), image, FALSE, TRUE, 0);
@@ -78,16 +75,15 @@
selectItem (item, item->selected() || !m_last_tab /*first tab*/);
g_signal_handlers_unblock_by_func (notebook, (gpointer) changed_tab_cb, this);
- YDumbTab::addItem (item);
}
virtual void deleteAllItems()
{
+ YDumbTab::deleteAllItems();
GList *children = gtk_container_get_children (GTK_CONTAINER (getWidget()));
for (GList *i = children; i; i = i->next)
gtk_container_remove (GTK_CONTAINER (getWidget()), (GtkWidget *) i->data);
g_list_free (children);
- YDumbTab::deleteAllItems();
}
// to re-use the same widget in all tabs (m_fixed), we will remove and
@@ -110,6 +106,7 @@
IMPL
GtkNotebook *notebook = GTK_NOTEBOOK (getWidget());
int nb = gtk_notebook_get_current_page (notebook);
+ if (nb < 0) return NULL;
GtkWidget *child = gtk_notebook_get_nth_page (notebook, nb);
return (YItem *) g_object_get_data (G_OBJECT (child), "yitem");
}
Modified: branches/SuSE-Linux-11_0-Branch/gtk/src/YGPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/src/YGPackageSelector.cc?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/src/YGPackageSelector.cc (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/src/YGPackageSelector.cc Sun Jun 8 10:37:05 2008
@@ -793,14 +793,13 @@
G_CALLBACK (Entry::label_style_set_cb), NULL);
m_entries_box = gtk_vbox_new (FALSE, 4);
- GtkWidget *port = gtk_viewport_new (NULL, NULL);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (port), GTK_SHADOW_NONE);
- gtk_container_add (GTK_CONTAINER (port), m_entries_box);
-
GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (scroll), port);
+ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll),
+ m_entries_box);
+ GtkWidget *port = gtk_bin_get_child (GTK_BIN (scroll));
+ gtk_viewport_set_shadow_type (GTK_VIEWPORT (port), GTK_SHADOW_NONE);
GtkWidget *vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 4);
@@ -811,8 +810,6 @@
gtk_container_add (GTK_CONTAINER (m_box), vbox);
g_signal_connect_after (G_OBJECT (m_box), "style-set",
G_CALLBACK (style_set_cb), NULL);
- g_signal_connect_after (G_OBJECT (scroll), "style-set",
- G_CALLBACK (style_set_cb), NULL);
g_signal_connect_after (G_OBJECT (port), "style-set",
G_CALLBACK (style_set_cb), NULL);
@@ -2629,10 +2626,10 @@
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
- GtkWidget *scroll = gtk_viewport_new (NULL, NULL);
- gtk_viewport_set_shadow_type (GTK_VIEWPORT (scroll), GTK_SHADOW_IN);
- gtk_container_add (GTK_CONTAINER (scroll), label);
-
+ GtkWidget *scroll = gtk_scrolled_window_new (NULL, NULL);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll),
+ GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+ gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scroll), label);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), scroll);
gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE);
Modified: branches/SuSE-Linux-11_0-Branch/gtk/src/YGTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/src/YGTable.cc?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/src/YGTable.cc (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/src/YGTable.cc Sun Jun 8 10:37:05 2008
@@ -202,7 +202,13 @@
createModel (types);
for (int i = 0; i < columns(); i++) {
int col = i*2;
- appendIconTextColumn (header (i), alignment (i), col, col+1);
+
+ YAlignmentType align = alignment (i);
+ // last column is expandable, so don't let it be aligned to the right
+ if (i == columns()-1)
+ align = YAlignBegin;
+
+ appendIconTextColumn (header (i), align, col, col+1);
}
setModel();
@@ -210,17 +216,19 @@
G_CALLBACK (activated_cb), (YGTableView*) this);
g_signal_connect (G_OBJECT (getWidget()), "cursor-changed",
G_CALLBACK (selected_cb), (YGTableView*) this);
- setSortable (true);
+ if (!keepSorting())
+ setSortable (true);
}
virtual void setKeepSorting (bool keepSorting)
{
- setSortable (keepSorting);
YTable::setKeepSorting (keepSorting);
+ setSortable (!keepSorting);
}
virtual void addItem (YItem *_item)
{
+ YTable::addItem (_item);
YTableItem *item = dynamic_cast (_item);
if (item) {
GtkTreeIter iter;
@@ -230,7 +238,6 @@
}
else
yuiError() << "Can only add YTableItems to a YTable.\n";
- YTable::addItem (_item);
}
virtual void cellChanged (const YTableCell *cell)
@@ -254,10 +261,14 @@
GList *columns = gtk_tree_view_get_columns (getView());
for (GList *i = columns; i; i = i->next, n++) {
GtkTreeViewColumn *column = (GtkTreeViewColumn *) i->data;
- int index = (n*2)+1;
- if (!sortable)
- index = -1;
- gtk_tree_view_column_set_sort_column_id (column, index);
+ if (sortable) {
+ int index = (n*2)+1;
+ if (!sortable)
+ index = -1;
+ gtk_tree_view_column_set_sort_column_id (column, index);
+ }
+ else
+ gtk_tree_view_column_set_clickable (column, FALSE);
}
g_list_free (columns);
}
Modified: branches/SuSE-Linux-11_0-Branch/gtk/src/YGWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/src/YGWidget.h?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/src/YGWidget.h (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/src/YGWidget.h Sun Jun 8 10:37:05 2008
@@ -69,11 +69,11 @@
* for GTK+.
*/
#define YGWIDGET_IMPL_COMMON \
- virtual bool setKeyboardFocus() \
- { return doSetKeyboardFocus(); } \
+ virtual bool setKeyboardFocus() { \
+ return doSetKeyboardFocus(); } \
virtual void setEnabled (bool enabled) { \
- doSetEnabled (enabled); \
YWidget::setEnabled (enabled); \
+ doSetEnabled (enabled); \
} \
virtual int preferredWidth() { return 0; } \
virtual int preferredHeight() { return 0; } \
@@ -81,8 +81,8 @@
#define YGWIDGET_IMPL_USE_BOLD(ParentClass) \
virtual void setUseBoldFont (bool useBold) { \
- doSetUseBoldFont (useBold); \
ParentClass::setUseBoldFont (useBold); \
+ doSetUseBoldFont (useBold); \
}
// for containers
Modified: branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkmenubutton.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkmenubutton.c?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkmenubutton.c (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkmenubutton.c Sun Jun 8 10:37:05 2008
@@ -156,6 +156,12 @@
gdk_window_get_origin (widget->window, x, y);
*x += button_alloc->x - popup_width*button->xalign;
*y += (button_alloc->y-popup_height) + (button_alloc->height+popup_height)*button->yalign;
+
+ // GTK doesn't push up menus if they are near the bottom, but we will...
+ int screen_height;
+ screen_height = gdk_screen_get_height (gtk_widget_get_screen (widget));
+ if (*y > screen_height - popup_height)
+ *y -= popup_height + button_alloc->height;
}
static void ygtk_menu_button_get_menu_pos (GtkMenu *menu, gint *x, gint *y,
Modified: branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkrichtext.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkrichtext.c?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkrichtext.c (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkrichtext.c Sun Jun 8 10:37:05 2008
@@ -21,8 +21,6 @@
G_DEFINE_TYPE (YGtkRichText, ygtk_rich_text, GTK_TYPE_TEXT_VIEW)
-static GdkCursor *hand_cursor, *regular_cursor;
-static guint ref_cursor = 0;
static guint link_clicked_signal;
static GdkColor link_color = { 0, 0, 0, 0xeeee };
@@ -111,12 +109,9 @@
gtk_text_view_set_left_margin (tview, 4);
// Init link support
- if (!ref_cursor) {
- GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (rtext));
- hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
- regular_cursor = gdk_cursor_new_for_display (display, GDK_XTERM);
- }
- ref_cursor++;
+ GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (rtext));
+ rtext->hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND1);
+ gdk_cursor_ref (rtext->hand_cursor);
#if GTK_CHECK_VERSION(2,10,0)
gtk_widget_style_get (GTK_WIDGET (rtext), "link_color", &link_color, NULL);
@@ -152,8 +147,7 @@
gtk_text_buffer_create_tag (buffer, "b", "weight", PANGO_WEIGHT_BOLD, NULL);
gtk_text_buffer_create_tag (buffer, "i", "style", PANGO_STYLE_ITALIC, NULL);
gtk_text_buffer_create_tag (buffer, "u", "underline", PANGO_UNDERLINE_SINGLE, NULL);
- gtk_text_buffer_create_tag (buffer, "center", "justification", GTK_JUSTIFY_CENTER,
- NULL);
+ gtk_text_buffer_create_tag (buffer, "center", "justification", GTK_JUSTIFY_CENTER, NULL);
// helpers
gtk_text_buffer_create_tag (buffer, "keyword", "background", "yellow", NULL);
}
@@ -161,30 +155,25 @@
static void ygtk_rich_text_destroy (GtkObject *object)
{
// destroy can be called multiple times, and we must ref only once
- if (ref_cursor > 0 && (--ref_cursor == 0)) {
- gdk_cursor_unref (hand_cursor);
- gdk_cursor_unref (regular_cursor);
- }
+ YGtkRichText *rtext = YGTK_RICH_TEXT (object);
+ gdk_cursor_unref (rtext->hand_cursor);
GTK_OBJECT_CLASS (ygtk_rich_text_parent_class)->destroy (object);
}
// Change the cursor to the "hands" cursor typically used by web browsers,
// if there is a link in the given position.
-static void set_cursor_if_appropriate (GtkTextView *text_view, gint x, gint y)
+static void set_cursor_if_appropriate (GtkTextView *view, gint x, gint y)
{
static gboolean hovering_over_link = FALSE;
- gboolean hovering = get_link (text_view, x, y) != NULL;
+ gboolean hovering = get_link (view, x, y) != NULL;
if (hovering != hovering_over_link) {
hovering_over_link = hovering;
-
- if (hovering_over_link)
- gdk_window_set_cursor (gtk_text_view_get_window
- (text_view, GTK_TEXT_WINDOW_TEXT), hand_cursor);
- else
- gdk_window_set_cursor (gtk_text_view_get_window
- (text_view, GTK_TEXT_WINDOW_TEXT), regular_cursor);
- }
+ YGtkRichText *rtext = YGTK_RICH_TEXT (view);
+ GdkWindow *window = gtk_text_view_get_window (view, GTK_TEXT_WINDOW_TEXT);
+ GdkCursor *cursor = hovering ? rtext->hand_cursor : NULL;
+ gdk_window_set_cursor (window, cursor);
+ }
}
// Update the cursor image if the pointer moved.
Modified: branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkrichtext.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkrichtext.h?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkrichtext.h (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/src/ygtkrichtext.h Sun Jun 8 10:37:05 2008
@@ -28,6 +28,8 @@
typedef struct _YGtkRichText
{
GtkTextView parent;
+ // members:
+ GdkCursor *hand_cursor;
} YGtkRichText;
typedef struct _YGtkRichTextClass
Modified: branches/SuSE-Linux-11_0-Branch/gtk/src/ygtksteps.c
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/gtk/src/ygtksteps.c?rev=48149&r1=48148&r2=48149&view=diff
==============================================================================
--- branches/SuSE-Linux-11_0-Branch/gtk/src/ygtksteps.c (original)
+++ branches/SuSE-Linux-11_0-Branch/gtk/src/ygtksteps.c Sun Jun 8 10:37:05 2008
@@ -160,6 +160,7 @@
requisition->width += BORDER * 2;
requisition->height += BORDER * 2;
+ GTK_WIDGET_CLASS (ygtk_steps_parent_class)->size_request (widget, requisition);
}
static gboolean ygtk_steps_expose_event (GtkWidget *widget, GdkEventExpose *event)
@@ -312,6 +313,8 @@
static void ygtk_steps_class_init (YGtkStepsClass *klass)
{
+ ygtk_steps_parent_class = g_type_class_peek_parent (klass);
+
GtkWidgetClass* widget_class = GTK_WIDGET_CLASS (klass);
widget_class->expose_event = ygtk_steps_expose_event;
widget_class->size_request = ygtk_steps_size_request;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org