[libgda] Improved gdaui_data_selector_set_column_visible()
- From: Vivien Malerba <vivien src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgda] Improved gdaui_data_selector_set_column_visible()
- Date: Sat, 19 Nov 2011 16:47:14 +0000 (UTC)
commit a6ea0f2a71dabf5bb108d3ba490adff870f56fe8
Author: Vivien Malerba <malerba gnome-db org>
Date: Sat Nov 19 17:40:42 2011 +0100
Improved gdaui_data_selector_set_column_visible()
to allow the setting to be applied to all columns
libgda-ui/gdaui-data-selector.c | 19 +++++++++++++++++--
po/POTFILES.in | 1 +
2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/libgda-ui/gdaui-data-selector.c b/libgda-ui/gdaui-data-selector.c
index b2d113f..5dcaac4 100644
--- a/libgda-ui/gdaui-data-selector.c
+++ b/libgda-ui/gdaui-data-selector.c
@@ -199,7 +199,7 @@ gdaui_data_selector_unselect_row (GdauiDataSelector *iface, gint row)
/**
* gdaui_data_selector_set_column_visible:
* @iface: an object which implements the #GdauiDataSelector interface
- * @column: a column number, starting at %0
+ * @column: a column number, starting at %0, or -1 tp apply to all the columns
* @visible: required visibility of the data in the @column column
*
* Shows or hides the data at column @column
@@ -211,8 +211,23 @@ gdaui_data_selector_set_column_visible (GdauiDataSelector *iface, gint column, g
{
g_return_if_fail (GDAUI_IS_DATA_SELECTOR (iface));
- if (GDAUI_DATA_SELECTOR_GET_IFACE (iface)->set_column_visible)
+ if (!GDAUI_DATA_SELECTOR_GET_IFACE (iface)->set_column_visible)
+ return;
+
+ if (column >= 0)
(GDAUI_DATA_SELECTOR_GET_IFACE (iface)->set_column_visible) (iface, column, visible);
+ else if (column == -1) {
+ gint i, ncols;
+ GdaDataModelIter *iter;
+ iter = gdaui_data_selector_get_data_set (iface);
+ if (!iter)
+ return;
+ ncols = g_slist_length (GDA_SET (iter)->holders);
+ for (i = 0; i < ncols; i++)
+ (GDAUI_DATA_SELECTOR_GET_IFACE (iface)->set_column_visible) (iface, i, visible);
+ }
+ else
+ g_warning (_("Invalid column number %d"), column);
}
/**
diff --git a/po/POTFILES.in b/po/POTFILES.in
index fbede97..73e7e54 100755
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -120,6 +120,7 @@ libgda-ui/internal/utility.c
libgda-ui/gdaui-basic-form.c
libgda-ui/gdaui-cloud.c
libgda-ui/gdaui-combo.c
+libgda-ui/gdaui-data-selector.c
libgda-ui/gdaui-data-store.c
libgda-ui/gdaui-data-proxy.c
libgda-ui/gdaui-data-proxy-info.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]