[gnumeric] Fix selection for sheet object lists and combos. [#631322]
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Fix selection for sheet object lists and combos. [#631322]
- Date: Mon, 4 Oct 2010 15:33:07 +0000 (UTC)
commit c6c7ce614b1ad485cfaf0c5467bffb2fc98b7177
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Mon Oct 4 09:32:53 2010 -0600
Fix selection for sheet object lists and combos. [#631322]
2010-10-04 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/sheet-object-widget.c (sheet_widget_list_create_widget): set the
correct selection
(sheet_widget_combo_create_widget): ditto
ChangeLog | 6 ++++++
NEWS | 1 +
src/sheet-object-widget.c | 5 +++++
3 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 910021b..dcfc8e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-04 Andreas J. Guelzow <aguelzow pyrshep ca>
+
+ * src/sheet-object-widget.c (sheet_widget_list_create_widget): set the
+ correct selection
+ (sheet_widget_combo_create_widget): ditto
+
2010-10-01 Morten Welinder <terra gnome org>
* configure.in: Post-release bump.
diff --git a/NEWS b/NEWS
index fafe178..b107d74 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Gnumeric 1.10.12
Andreas:
* Add argument to FOURIER to separate parts.
* Extend TREND function to handle multiple regression. [#630085]
+ * Fix selection for sheet object lists and combos. [#631322]
--------------------------------------------------------------------------
Gnumeric 1.10.11
diff --git a/src/sheet-object-widget.c b/src/sheet-object-widget.c
index a78486c..6060099 100644
--- a/src/sheet-object-widget.c
+++ b/src/sheet-object-widget.c
@@ -3596,6 +3596,7 @@ sheet_widget_list_create_widget (SheetObjectWidget *sow)
{
SheetWidgetListBase *swl = SHEET_WIDGET_LIST_BASE (sow);
GtkTreeSelection *selection;
+ GtkTreeIter iter;
GtkWidget *frame = g_object_new (GTK_TYPE_FRAME, NULL);
GtkWidget *list = gtk_tree_view_new_with_model (swl->model);
GtkWidget *sw = gtk_scrolled_window_new (
@@ -3617,6 +3618,9 @@ sheet_widget_list_create_widget (SheetObjectWidget *sow)
G_CALLBACK (cb_list_model_changed), list, 0);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
+ if ((swl->model != NULL) &&
+ gtk_tree_model_iter_nth_child (swl->model, &iter, NULL, swl->selection - 1))
+ gtk_tree_selection_select_iter (selection, &iter);
g_signal_connect_object (G_OBJECT (swl), "selection-changed",
G_CALLBACK (cb_list_selection_changed), selection, 0);
g_signal_connect (selection, "changed",
@@ -3800,6 +3804,7 @@ sheet_widget_combo_create_widget (SheetObjectWidget *sow)
g_object_set (G_OBJECT (combo),
"model", swl->model,
"text-column", 0,
+ "active", swl->selection - 1,
NULL);
g_signal_connect_object (G_OBJECT (swl), "model-changed",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]