From 6498968214fd4fb26675d3f068f7086eef5a2c4d Mon Sep 17 00:00:00 2001 From: Iain Holmes Date: Tue, 25 Sep 2001 23:08:08 +0000 Subject: Freeze and thaw svn path=/trunk/; revision=13132 --- my-evolution/ChangeLog | 10 ++++++++++ my-evolution/e-summary-factory.c | 2 ++ my-evolution/e-summary.c | 37 +++++++++++++++++++++++++++++++++++++ my-evolution/e-summary.h | 2 ++ 4 files changed, 51 insertions(+) diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index 750002aa72..339ae821c0 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,13 @@ +2001-09-25 Iain Holmes + + * e-summary.c (e_summary_draw): Check if the summary is frozen, if so + just set redraw_pending. + (e_summary_freeze): Freeze the summary. + (e_summary_thaw): Thaw the summary and redraw if needed. + + * e-summary-factory.c (control_activate): Thaw summary. + (control_deactivate): Freeze summary. + 2001-09-25 Iain Holmes * Misc warnings cleanups. diff --git a/my-evolution/e-summary-factory.c b/my-evolution/e-summary-factory.c index 1f709e1561..7c19f570ac 100644 --- a/my-evolution/e-summary-factory.c +++ b/my-evolution/e-summary-factory.c @@ -57,6 +57,7 @@ control_activate (BonoboControl *control, e_pixmaps_update (ui_component, pixmaps); bonobo_ui_component_thaw (ui_component, NULL); + e_summary_thaw (summary); } static void @@ -65,6 +66,7 @@ control_deactivate (BonoboControl *control, ESummary *summary) { bonobo_ui_component_unset_container (ui_component); + e_summary_freeze (summary); } static void diff --git a/my-evolution/e-summary.c b/my-evolution/e-summary.c index 0ea9e7cde1..d93877e024 100644 --- a/my-evolution/e-summary.c +++ b/my-evolution/e-summary.c @@ -82,6 +82,9 @@ struct _ESummaryPrivate { GList *connections; gpointer alarm; + + gboolean frozen; + gboolean redraw_pending; }; typedef struct _ProtocolListener { @@ -159,6 +162,11 @@ e_summary_draw (ESummary *summary) return; } + if (summary->priv->frozen == TRUE) { + summary->priv->redraw_pending = TRUE; + return; + } + string = g_string_new (HTML_1); t = time (NULL); strftime (date, 255, _("%A, %B %e %Y"), localtime (&t)); @@ -447,6 +455,9 @@ e_summary_init (ESummary *summary) priv = summary->priv; + priv->frozen = FALSE; + priv->redraw_pending = FALSE; + priv->html_scroller = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->html_scroller), GTK_POLICY_AUTOMATIC, @@ -823,3 +834,29 @@ e_summary_remove_online_connection (ESummary *summary, summary->priv->connections = g_list_remove_link (summary->priv->connections, p); g_list_free (p); } + +void +e_summary_freeze (ESummary *summary) +{ + g_return_if_fail (IS_E_SUMMARY (summary)); + + if (summary->priv->frozen == TRUE) { + return; + } + + summary->priv->frozen = TRUE; +} + +void +e_summary_thaw (ESummary *summary) +{ + g_return_if_fail (IS_E_SUMMARY (summary)); + if (summary->priv->frozen == FALSE) { + return; + } + + summary->priv->frozen = FALSE; + if (summary->priv->redraw_pending) { + e_summary_draw (summary); + } +} diff --git a/my-evolution/e-summary.h b/my-evolution/e-summary.h index 6bb012f75e..d2e4f4e61f 100644 --- a/my-evolution/e-summary.h +++ b/my-evolution/e-summary.h @@ -149,4 +149,6 @@ void e_summary_add_online_connection (ESummary *summary, void e_summary_remove_online_connection (ESummary *summary, ESummaryConnection *connection); +void e_summary_freeze (ESummary *summary); +void e_summary_thaw (ESummary *summary); #endif -- cgit