X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fhildon2%2Fmodest-hildon2-window.c;h=944173859923a39a896ca5f3e2e8fdae4b213dbb;hb=d3152f5a6ea0f939f9535fd8024538d95f14b588;hp=015dedc04b9a904c3e7f87dba7e9d6b3fed5c66f;hpb=789c4eee0ba2641502781c4163b82669d2846a3f;p=modest diff --git a/src/hildon2/modest-hildon2-window.c b/src/hildon2/modest-hildon2-window.c index 015dedc..9441738 100644 --- a/src/hildon2/modest-hildon2-window.c +++ b/src/hildon2/modest-hildon2-window.c @@ -52,7 +52,7 @@ typedef struct _EditModeRegister { /* 'private'/'protected' functions */ static void modest_hildon2_window_class_init (gpointer klass, gpointer class_data); static void modest_hildon2_window_instance_init (GTypeInstance *instance, gpointer g_class); -static void modest_hildon2_window_finalize (GObject *obj); +static void modest_hildon2_window_dispose (GObject *obj); static gboolean on_zoom_minus_plus_not_implemented (ModestWindow *window); static void setup_menu (ModestHildon2Window *self); @@ -142,7 +142,7 @@ modest_hildon2_window_class_init (gpointer klass, gpointer class_data) ModestHildon2WindowClass *modest_hildon2_window_class = (ModestHildon2WindowClass *) klass; parent_class = g_type_class_peek_parent (klass); - gobject_class->finalize = modest_hildon2_window_finalize; + gobject_class->dispose = modest_hildon2_window_dispose; signals[EDIT_MODE_CHANGED_SIGNAL] = g_signal_new ("edit-mode-changed", @@ -165,19 +165,23 @@ modest_hildon2_window_class_init (gpointer klass, gpointer class_data) } static void -modest_hildon2_window_finalize (GObject *obj) +modest_hildon2_window_dispose (GObject *obj) { ModestHildon2WindowPrivate *priv; priv = MODEST_HILDON2_WINDOW_GET_PRIVATE(obj); - g_object_unref (priv->app_menu_dimming_group); - priv->app_menu_dimming_group = NULL; + if (priv->app_menu_dimming_group) { + g_object_unref (priv->app_menu_dimming_group); + priv->app_menu_dimming_group = NULL; + } - g_hash_table_destroy (priv->edit_mode_registry); - priv->edit_mode_registry = NULL; + if (priv->edit_mode_registry) { + g_hash_table_unref (priv->edit_mode_registry); + priv->edit_mode_registry = NULL; + } - G_OBJECT_CLASS(parent_class)->finalize (obj); + G_OBJECT_CLASS(parent_class)->dispose (obj); } static void @@ -232,7 +236,7 @@ modest_hildon2_window_pack_toolbar_not_implemented (ModestHildon2Window *self, { g_return_if_fail (MODEST_IS_HILDON2_WINDOW (self)); - g_warning ("%s not implemented", __FUNCTION__); + g_debug ("%s not implemented", __FUNCTION__); } void @@ -256,12 +260,16 @@ modest_hildon2_window_add_button_to_menu (ModestHildon2Window *self, g_return_if_fail (GTK_IS_BUTTON (button)); priv = MODEST_HILDON2_WINDOW_GET_PRIVATE (self); + modest_ui_dimming_manager_set_widget_dimming_mode (GTK_WIDGET (button), + MODEST_UI_DIMMING_MODE_HIDE); + if (dimming_callback) modest_dimming_rules_group_add_widget_rule (priv->app_menu_dimming_group, GTK_WIDGET (button), (GCallback) dimming_callback, MODEST_WINDOW (self)); hildon_app_menu_append (HILDON_APP_MENU (priv->app_menu), GTK_BUTTON (button)); + gtk_widget_show (GTK_WIDGET (button)); } void @@ -496,15 +504,16 @@ edit_toolbar_button_clicked (HildonEditToolbar *toolbar, EditModeRegister *reg; g_return_if_fail (MODEST_IS_HILDON2_WINDOW (self)); - + reg = (EditModeRegister *) g_hash_table_lookup (priv->edit_mode_registry, GINT_TO_POINTER (priv->edit_command)); - if (reg == NULL) - modest_hildon2_window_unset_edit_mode (self); - if ((reg->action == NULL) || reg->action (self)) + if (reg) { + if ((reg->action == NULL) || reg->action (self)) + modest_hildon2_window_unset_edit_mode (self); + } else { modest_hildon2_window_unset_edit_mode (self); - + } } static void @@ -512,7 +521,7 @@ edit_toolbar_arrow_clicked (HildonEditToolbar *toolbar, ModestHildon2Window *self) { g_return_if_fail (MODEST_IS_HILDON2_WINDOW (self)); - + modest_hildon2_window_unset_edit_mode (self); }