Author: rpmcruz
Date: Sat Dec 1 01:51:17 2007
New Revision: 42567
URL: http://svn.opensuse.org/viewcvs/yast?rev=42567&view=rev
Log:
* src/YGWizard.cc: bug fix (found during bug #342348). We were freeing
YWizard button wrapper widgets which we weren't supposed to. It was just
printing errors, instead of crashing, as libyui does a corruption testing
before freeing a widget to avoid double freeing.
* src/yzyppwrapper.cc: fixed search name query. Was not being inclusive.
Modified:
trunk/gtk/unstable/ChangeLog
trunk/gtk/unstable/src/YGLayout.cc
trunk/gtk/unstable/src/YGPushButton.cc
trunk/gtk/unstable/src/YGUI.cc
trunk/gtk/unstable/src/YGWizard.cc
trunk/gtk/unstable/src/yzyppwrapper.cc
Modified: trunk/gtk/unstable/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/unstable/ChangeLog?rev=42567&r1=42566&r2=42567&view=diff
==============================================================================
--- trunk/gtk/unstable/ChangeLog (original)
+++ trunk/gtk/unstable/ChangeLog Sat Dec 1 01:51:17 2007
@@ -1,3 +1,16 @@
+2007-11-30 Ricardo Cruz
+
+ * src/YGUI.cc: added Refresh button for the YWidget tree dialog.
+ Also added an optional (at compile time) column for the valid test. Not
+ much use for it though...
+
+ * src/YGWizard.cc: bug fix (found during bug #342348). We were freeing
+ YWizard button wrapper widgets which we weren't supposed to. It was just
+ printing errors, instead of crashing, as libyui does a corruption testing
+ before freeing a widget to avoid double freeing.
+
+ * src/yzyppwrapper.cc: fixed search name query. Was not being inclusive.
+
2007-11-29 Ricardo Cruz
* src/ygtkwizard.c: de-coupled navigation widgets: tree and steps. Tree
Modified: trunk/gtk/unstable/src/YGLayout.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/unstable/src/YGLayout.cc?rev=42567&r1=42566&r2=42567&view=diff
==============================================================================
--- trunk/gtk/unstable/src/YGLayout.cc (original)
+++ trunk/gtk/unstable/src/YGLayout.cc Sat Dec 1 01:51:17 2007
@@ -96,7 +96,7 @@
YGWidget::sync_stretchable();
}
- virtual void moveChild (YWidget *, long, long) {}; // ignore
+ virtual void moveChild (YWidget *, long, long) {} // ignore
};
YContainerWidget *
Modified: trunk/gtk/unstable/src/YGPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/unstable/src/YGPushButton.cc?rev=42567&r1=42566&r2=42567&view=diff
==============================================================================
--- trunk/gtk/unstable/src/YGPushButton.cc (original)
+++ trunk/gtk/unstable/src/YGPushButton.cc Sat Dec 1 01:51:17 2007
@@ -30,8 +30,6 @@
G_CALLBACK (set_default_cb), this);
}
- virtual ~YGPushButton() {}
-
// YPushButton
virtual void setLabel (const YCPString &label)
{
Modified: trunk/gtk/unstable/src/YGUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/unstable/src/YGUI.cc?rev=42567&r1=42566&r2=42567&view=diff
==============================================================================
--- trunk/gtk/unstable/src/YGUI.cc (original)
+++ trunk/gtk/unstable/src/YGUI.cc Sat Dec 1 01:51:17 2007
@@ -644,9 +644,7 @@
// debug dialogs
-static void destroy_dialog (GtkDialog *dialog, gint arg)
-{ IMPL; gtk_widget_destroy (GTK_WIDGET (dialog)); }
-
+//#define IS_VALID_COL
void dumpYastTree (YWidget *widget)
{
IMPL
@@ -667,7 +665,11 @@
gchar *weight = g_strdup_printf ("%ld x %ld",
widget->weight (YD_HORIZ), widget->weight (YD_VERT));
gtk_tree_store_set (store, &iter, 0, widget->widgetClass(),
- 1, ygwidget->getDebugLabel().c_str(), 2, stretch, 3, weight, -1);
+ 1, ygwidget->getDebugLabel().c_str(), 2, stretch, 3, weight,
+#ifdef IS_VALID_COL
+ 4, widget->isValid(),
+#endif
+ -1);
g_free (stretch);
g_free (weight);
@@ -675,14 +677,37 @@
for (int i = 0; i < container->numChildren(); i++)
dumpYastTree (container->child (i), store, &iter);
}
+ static void dialog_response_cb (GtkDialog *dialog, gint response, YWidget *ywidget)
+ {
+ if (response == 1) {
+ GtkTreeStore *store;
+ GtkTreeView *view;
+ store = (GtkTreeStore *) g_object_get_data (G_OBJECT (dialog), "store");
+ view = (GtkTreeView *) g_object_get_data (G_OBJECT (dialog), "view");
+ gtk_tree_store_clear (store);
+ dumpYastTree (ywidget, store, NULL);
+ gtk_tree_view_expand_all (view);
+ }
+ else
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+ }
};
- GtkTreeStore *store = gtk_tree_store_new (4, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_STRING);
- inner::dumpYastTree (widget, store, NULL);
+ int cols = 4;
+#ifdef IS_VALID_COL
+ cols++;
+#endif
+ GtkTreeStore *store = gtk_tree_store_new (cols,
+ G_TYPE_STRING, G_TYPE_STRING,
+ G_TYPE_STRING, G_TYPE_STRING,
+#ifdef IS_VALID_COL
+ G_TYPE_BOOLEAN
+#endif
+ );
GtkWidget *dialog = gtk_dialog_new_with_buttons ("YWidgets Tree", NULL,
- GtkDialogFlags (GTK_DIALOG_NO_SEPARATOR), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
+ GtkDialogFlags (GTK_DIALOG_NO_SEPARATOR), GTK_STOCK_REFRESH, 1,
+ GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL);
gtk_window_set_default_size (GTK_WINDOW (dialog), -1, 400);
GtkWidget *view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store));
@@ -692,13 +717,19 @@
gtk_tree_view_append_column (GTK_TREE_VIEW (view),
gtk_tree_view_column_new_with_attributes ("Label",
gtk_cell_renderer_text_new(), "text", 1, NULL));
+ gtk_tree_view_column_set_expand (gtk_tree_view_get_column (
+ GTK_TREE_VIEW (view), 1), TRUE);
gtk_tree_view_append_column (GTK_TREE_VIEW (view),
gtk_tree_view_column_new_with_attributes ("Stretch",
gtk_cell_renderer_text_new(), "text", 2, NULL));
gtk_tree_view_append_column (GTK_TREE_VIEW (view),
gtk_tree_view_column_new_with_attributes ("Weight",
gtk_cell_renderer_text_new(), "text", 3, NULL));
- gtk_tree_view_expand_all (GTK_TREE_VIEW (view));
+#ifdef IS_VALID_COL
+ gtk_tree_view_append_column (GTK_TREE_VIEW (view),
+ gtk_tree_view_column_new_with_attributes ("Valid",
+ gtk_cell_renderer_toggle_new(), "active", 4, NULL));
+#endif
gtk_tree_view_set_enable_tree_lines (GTK_TREE_VIEW (view), TRUE);
GtkWidget *scroll_win = gtk_scrolled_window_new (NULL, NULL);
@@ -709,10 +740,16 @@
gtk_container_add (GTK_CONTAINER (scroll_win), view);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), scroll_win);
- gtk_widget_show_all (dialog);
+ inner::dumpYastTree (widget, store, NULL);
+ gtk_tree_view_expand_all (GTK_TREE_VIEW (view));
+
+ g_object_set_data (G_OBJECT (dialog), "view", view);
+ g_object_set_data (G_OBJECT (dialog), "store", store);
g_signal_connect (G_OBJECT (dialog), "response",
- G_CALLBACK (destroy_dialog), 0);
+ G_CALLBACK (inner::dialog_response_cb), widget);
+
+ gtk_widget_show_all (dialog);
}
#include
@@ -754,6 +791,8 @@
for (int i = 0; i < container->numChildren(); i++)
dumpYastHtml (container->child (i), box);
}
+ static void destroy_dialog (GtkDialog *dialog, gint arg)
+ { gtk_widget_destroy (GTK_WIDGET (dialog)); }
};
IMPL
@@ -765,6 +804,6 @@
gtk_widget_show_all (dialog);
g_signal_connect (G_OBJECT (dialog), "response",
- G_CALLBACK (destroy_dialog), 0);
+ G_CALLBACK (inner::destroy_dialog), 0);
}
Modified: trunk/gtk/unstable/src/YGWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/unstable/src/YGWizard.cc?rev=42567&r1=42566&r2=42567&view=diff
==============================================================================
--- trunk/gtk/unstable/src/YGWizard.cc (original)
+++ trunk/gtk/unstable/src/YGWizard.cc Sat Dec 1 01:51:17 2007
@@ -128,12 +128,7 @@
G_CALLBACK (action_triggered_cb), this);
}
- ~YGWizard()
- {
- delete m_back_button;
- delete m_abort_button;
- delete m_next_button;
- }
+ virtual ~YGWizard() {}
/* The purpose of this function is to do some sanity checks, besides
the simple test "cmd->name() == func".
Modified: trunk/gtk/unstable/src/yzyppwrapper.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/unstable/src/yzyppwrapper.cc?rev=42567&r1=42566&r2=42567&view=diff
==============================================================================
--- trunk/gtk/unstable/src/yzyppwrapper.cc (original)
+++ trunk/gtk/unstable/src/yzyppwrapper.cc Sat Dec 1 01:51:17 2007
@@ -715,12 +715,14 @@
if (match && name.defined) {
const std::list std::string &names = name.value;
std::list std::string::const_iterator it;
- for (it = names.begin(); it != names.end(); it++)
- if (YGUtils::contains (package->name(), *it) ||
- YGUtils::contains (package->summary(), *it) ||
- YGUtils::contains (package->provides(), *it))
+ for (it = names.begin(); it != names.end(); it++) {
+ if (!YGUtils::contains (package->name(), *it) &&
+ !YGUtils::contains (package->summary(), *it) &&
+ !YGUtils::contains (package->provides(), *it)) {
+ match = false;
break;
- match = it != names.end();
+ }
+ }
}
if (match && category.defined) {
Ypp::Node *query_category = category.value;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org