[gimp] app: Remove empty GimpDocks from GimpDockColumns
- From: Martin Nordholts <martinn src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] app: Remove empty GimpDocks from GimpDockColumns
- Date: Sun, 15 Nov 2009 14:58:29 +0000 (UTC)
commit ae2f595f12cb393ec69ffe30e9ac5acdf2250320
Author: Martin Nordholts <martinn src gnome org>
Date: Sun Nov 15 15:54:20 2009 +0100
app: Remove empty GimpDocks from GimpDockColumns
app/widgets/gimpdockcolumns.c | 23 +++++++++++++++++++++++
1 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpdockcolumns.c b/app/widgets/gimpdockcolumns.c
index b41419f..e1bae0e 100644
--- a/app/widgets/gimpdockcolumns.c
+++ b/app/widgets/gimpdockcolumns.c
@@ -63,6 +63,9 @@ static void gimp_dock_columns_real_dock_added (GimpDockColumns *dock_co
GimpDock *dock);
static void gimp_dock_columns_real_dock_removed (GimpDockColumns *dock_columns,
GimpDock *dock);
+static void gimp_dock_columns_dock_book_remove (GimpDockColumns *dock_columns,
+ GimpDockbook *dockbook,
+ GimpDock *dock);
G_DEFINE_TYPE (GimpDockColumns, gimp_dock_columns, GTK_TYPE_HBOX)
@@ -167,6 +170,17 @@ gimp_dock_columns_real_dock_removed (GimpDockColumns *dock_columns,
{
}
+static void
+gimp_dock_columns_dock_book_remove (GimpDockColumns *dock_columns,
+ GimpDockbook *dockbook,
+ GimpDock *dock)
+{
+ g_return_if_fail (GIMP_IS_DOCK (dock));
+
+ if (gimp_dock_get_dockbooks (dock) == NULL)
+ gimp_dock_columns_remove_dock (dock_columns, dock);
+}
+
/**
* gimp_dock_columns_add_dock:
@@ -189,6 +203,11 @@ gimp_dock_columns_add_dock (GimpDockColumns *dock_columns,
GTK_WIDGET (dock),
index);
+ g_signal_connect_object (dock, "book-removed",
+ G_CALLBACK (gimp_dock_columns_dock_book_remove),
+ dock_columns,
+ G_CONNECT_SWAPPED);
+
g_signal_emit (dock_columns, dock_columns_signals[DOCK_ADDED], 0, dock);
}
@@ -202,6 +221,10 @@ gimp_dock_columns_remove_dock (GimpDockColumns *dock_columns,
dock_columns->p->docks = g_list_remove (dock_columns->p->docks, dock);
+ g_signal_handlers_disconnect_by_func (dock,
+ gimp_dock_columns_dock_book_remove,
+ dock_columns);
+
g_object_ref (dock);
gimp_paned_box_remove_widget (GIMP_PANED_BOX (dock_columns->p->paned_hbox),
GTK_WIDGET (dock));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]