[gthumb] remove the action group when a page is deactivated
- From: Paolo Bacchilega <paobac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gthumb] remove the action group when a page is deactivated
- Date: Thu, 15 Jul 2010 18:36:51 +0000 (UTC)
commit bac7c74b5c91a0f6e2b6df42e70dbca97af8a91e
Author: Paolo Bacchilega <paobac src gnome org>
Date: Wed Jul 14 21:07:33 2010 +0200
remove the action group when a page is deactivated
[bug #596906]
extensions/file_viewer/gth-file-viewer-page.c | 29 ++++++++++++-------
extensions/gstreamer_tools/gth-media-viewer-page.c | 4 +++
extensions/image_viewer/gth-image-viewer-page.c | 5 +++
3 files changed, 27 insertions(+), 11 deletions(-)
---
diff --git a/extensions/file_viewer/gth-file-viewer-page.c b/extensions/file_viewer/gth-file-viewer-page.c
index 60d78e2..91befd3 100644
--- a/extensions/file_viewer/gth-file-viewer-page.c
+++ b/extensions/file_viewer/gth-file-viewer-page.c
@@ -92,7 +92,6 @@ gth_file_viewer_page_real_activate (GthViewerPage *base,
GthBrowser *browser)
{
GthFileViewerPage *self;
- GError *error = NULL;
GtkWidget *vbox1;
GtkWidget *vbox2;
@@ -100,12 +99,6 @@ gth_file_viewer_page_real_activate (GthViewerPage *base,
self->priv->browser = browser;
- self->priv->merge_id = gtk_ui_manager_add_ui_from_string (gth_browser_get_ui_manager (browser), file_viewer_ui_info, -1, &error);
- if (self->priv->merge_id == 0) {
- g_warning ("ui building failed: %s", error->message);
- g_error_free (error);
- }
-
self->priv->thumb_loader = gth_thumb_loader_new (128);
self->priv->thumb_loader_ready_event =
g_signal_connect (G_OBJECT (self->priv->thumb_loader),
@@ -160,10 +153,6 @@ gth_file_viewer_page_real_deactivate (GthViewerPage *base)
g_signal_handler_disconnect (self->priv->thumb_loader, self->priv->thumb_loader_ready_event);
self->priv->thumb_loader_ready_event = 0;
- if (self->priv->merge_id != 0) {
- gtk_ui_manager_remove_ui (gth_browser_get_ui_manager (self->priv->browser), self->priv->merge_id);
- self->priv->merge_id = 0;
- }
gth_browser_set_viewer_widget (self->priv->browser, NULL);
}
@@ -171,12 +160,30 @@ gth_file_viewer_page_real_deactivate (GthViewerPage *base)
static void
gth_file_viewer_page_real_show (GthViewerPage *base)
{
+ GthFileViewerPage *self;
+ GError *error = NULL;
+
+ self = (GthFileViewerPage*) base;
+
+ self->priv->merge_id = gtk_ui_manager_add_ui_from_string (gth_browser_get_ui_manager (self->priv->browser), file_viewer_ui_info, -1, &error);
+ if (self->priv->merge_id == 0) {
+ g_warning ("ui building failed: %s", error->message);
+ g_error_free (error);
+ }
}
static void
gth_file_viewer_page_real_hide (GthViewerPage *base)
{
+ GthFileViewerPage *self;
+
+ self = (GthFileViewerPage*) base;
+
+ if (self->priv->merge_id != 0) {
+ gtk_ui_manager_remove_ui (gth_browser_get_ui_manager (self->priv->browser), self->priv->merge_id);
+ self->priv->merge_id = 0;
+ }
}
diff --git a/extensions/gstreamer_tools/gth-media-viewer-page.c b/extensions/gstreamer_tools/gth-media-viewer-page.c
index 8265b13..7e6f3cd 100644
--- a/extensions/gstreamer_tools/gth-media-viewer-page.c
+++ b/extensions/gstreamer_tools/gth-media-viewer-page.c
@@ -638,6 +638,10 @@ gth_media_viewer_page_real_deactivate (GthViewerPage *base)
self->priv->playbin = NULL;
}
+ gtk_ui_manager_remove_action_group (gth_browser_get_ui_manager (self->priv->browser), self->priv->actions);
+ g_object_unref (self->priv->actions);
+ self->priv->actions = NULL;
+
gth_browser_set_viewer_widget (self->priv->browser, NULL);
}
diff --git a/extensions/image_viewer/gth-image-viewer-page.c b/extensions/image_viewer/gth-image-viewer-page.c
index 6d7398d..1040011 100644
--- a/extensions/image_viewer/gth-image-viewer-page.c
+++ b/extensions/image_viewer/gth-image-viewer-page.c
@@ -512,8 +512,13 @@ gth_image_viewer_page_real_deactivate (GthViewerPage *base)
/**/
+ gtk_ui_manager_remove_action_group (gth_browser_get_ui_manager (self->priv->browser), self->priv->actions);
+ g_object_unref (self->priv->actions);
+ self->priv->actions = NULL;
+
g_signal_handler_disconnect (self->priv->preloader, self->priv->preloader_sig_id);
self->priv->preloader_sig_id = 0;
+
g_object_unref (self->priv->preloader);
self->priv->preloader = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]