aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2002-10-26 06:05:14 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2002-10-26 06:05:14 +0800
commit3fee618acffe3885cafae17a30127468f6b7a58c (patch)
treed1f8c1b6b2041742eec104b8885c086a678e4bfc /my-evolution
parent8481c20f533cd2b87c79e1fc38b0632ace3939aa (diff)
downloadgsoc2013-evolution-3fee618acffe3885cafae17a30127468f6b7a58c.tar
gsoc2013-evolution-3fee618acffe3885cafae17a30127468f6b7a58c.tar.gz
gsoc2013-evolution-3fee618acffe3885cafae17a30127468f6b7a58c.tar.bz2
gsoc2013-evolution-3fee618acffe3885cafae17a30127468f6b7a58c.tar.lz
gsoc2013-evolution-3fee618acffe3885cafae17a30127468f6b7a58c.tar.xz
gsoc2013-evolution-3fee618acffe3885cafae17a30127468f6b7a58c.tar.zst
gsoc2013-evolution-3fee618acffe3885cafae17a30127468f6b7a58c.zip
Removed debugging message.
* e-cell-tri.c (set_value): Removed debugging message. * e-summary-factory.c (control_activate): Removed the call to e_summary_thaw(). (control_deactivate): Removed the call to e_summary_freeze(). * e-summary-mail.c (folder_gen_html): Removed debugging message. (insert_path_recur): Likewise. (add_storage_to_table): Likewise. (folder_info_pb_changed): Likewise. (lazy_register_storages): Likewise. * e-summary-weather.c: #include "e-summary-preferences.h". (e_summary_weather_update): Removed debugging message. * e-summary-offline-handler.c: #include <gtk/gtksignal.h>. * main.c: #include <gconf/gconf.h> and <gal/widgets/e-cursors.h>. * e-summary-preferences.c (free_rdf_info): Removed unused function. (find_name_for_url): Likewise. (mail_etable_item_changed_cb): Likewise. (maybe_add_to_shown): Likewise. (get_folders_from_view): Removed debugging messages. * e-summary-rdf.c (tree_walk): Removed debugging message. (e_summary_rdf_update): Likewise. * e-summary-shown.c (find_entry_from_location): Removed unused function. (maybe_move_to_shown): Removed debugging message. * e-summary-tasks.c: New members cal_open_reload_timeout_id and reload_count in ESummaryTasks. (generate_html): Return if the load_state of the cal_client is not CAL_CLIENT_LOAD_LOADED. (cal_open_reload_timeout): New; timeout function for attempting to reload the calendar if the first attempt failed. (cal_opened_cb): If the load failed, register cal_open_reload_timeout to try again after one second. (setup_task_folder): If there is a pending timeout callback [cal_open_reload_timeout_id nonzero], remove it. (e_summary_tasks_init): Call setup_task_folder(). (e_summary_tasks_free): If there is a pending timeout callback [cal_open_reload_timeout_id nonzero], remove it. * e-summary-calendar.c: New members cal_open_reload_timeout_id and reload_count in ESummaryCalendar. (e_cal_comp_util_compare_event_timezones): Renamed to compare_event_timezones() and made static. (generate_html): Return if the load_state of the cal_client is not CAL_CLIENT_LOAD_LOADED. Call e_summary_draw() before returning. (cal_open_reload_timeout): New; timeout function for attempting to reload the calendar if the first attempt failed. (cal_opened_cb): Return if the load_state of the cal_client is not CAL_CLIENT_LOAD_LOADED. (e_summary_calendar_reconfigure): Call setup_calendar() so that, if the default folder has changed, it gets reloaded. (setup_calendar): If there is a pending timeout callback [cal_open_reload_timeout_id nonzero], remove it. (e_summary_calendar_free): Likewise. * e-summary.c: New member queue_draw_idle_id in ESummaryPrivate. Removed member redraw_pending. (destroy): If queue_draw_idle_id is nonzero, remove the corresponding glib mainloop source. (draw_idle_cb): New function to regenerate the HTML in the idle loop; moved all the code from e_summary_draw() in here. (e_summary_draw): Set up draw_idle_cb as an idle callback. (e_summary_init): Initialize queued_draw_idle_id. (e_summary_reload_timeout): Call e_summary_calendar_reconfigure() and e_summary_tasks_reconfigure(). Removed debugging message. (e_summary_set_online): Removed debugging message. (e_summary_freeze): Removed. (e_summary_thaw): Removed. svn path=/trunk/; revision=18443
Diffstat (limited to 'my-evolution')
-rw-r--r--my-evolution/ChangeLog79
-rw-r--r--my-evolution/e-cell-tri.c4
-rw-r--r--my-evolution/e-summary-calendar.c59
-rw-r--r--my-evolution/e-summary-factory.c2
-rw-r--r--my-evolution/e-summary-mail.c11
-rw-r--r--my-evolution/e-summary-offline-handler.c1
-rw-r--r--my-evolution/e-summary-preferences.c57
-rw-r--r--my-evolution/e-summary-rdf.c2
-rw-r--r--my-evolution/e-summary-shown.c22
-rw-r--r--my-evolution/e-summary-tasks.c48
-rw-r--r--my-evolution/e-summary-weather.c2
-rw-r--r--my-evolution/e-summary.c104
-rw-r--r--my-evolution/e-summary.h1
-rw-r--r--my-evolution/main.c4
14 files changed, 222 insertions, 174 deletions
diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog
index e901cd73de..226ae81ed9 100644
--- a/my-evolution/ChangeLog
+++ b/my-evolution/ChangeLog
@@ -1,3 +1,82 @@
+2002-10-25 Ettore Perazzoli <ettore@ximian.com>
+
+ * e-cell-tri.c (set_value): Removed debugging message.
+
+ * e-summary-factory.c (control_activate): Removed the call to
+ e_summary_thaw().
+ (control_deactivate): Removed the call to e_summary_freeze().
+
+ * e-summary-mail.c (folder_gen_html): Removed debugging message.
+ (insert_path_recur): Likewise.
+ (add_storage_to_table): Likewise.
+ (folder_info_pb_changed): Likewise.
+ (lazy_register_storages): Likewise.
+
+ * e-summary-weather.c: #include "e-summary-preferences.h".
+ (e_summary_weather_update): Removed debugging message.
+
+ * e-summary-offline-handler.c: #include <gtk/gtksignal.h>.
+
+ * main.c: #include <gconf/gconf.h> and <gal/widgets/e-cursors.h>.
+
+ * e-summary-preferences.c (free_rdf_info): Removed unused
+ function.
+ (find_name_for_url): Likewise.
+ (mail_etable_item_changed_cb): Likewise.
+ (maybe_add_to_shown): Likewise.
+ (get_folders_from_view): Removed debugging messages.
+
+ * e-summary-rdf.c (tree_walk): Removed debugging message.
+ (e_summary_rdf_update): Likewise.
+
+ * e-summary-shown.c (find_entry_from_location): Removed unused
+ function.
+ (maybe_move_to_shown): Removed debugging message.
+
+ * e-summary-tasks.c: New members cal_open_reload_timeout_id and
+ reload_count in ESummaryTasks.
+ (generate_html): Return if the load_state of the cal_client is not
+ CAL_CLIENT_LOAD_LOADED.
+ (cal_open_reload_timeout): New; timeout function for attempting to
+ reload the calendar if the first attempt failed.
+ (cal_opened_cb): If the load failed, register
+ cal_open_reload_timeout to try again after one second.
+ (setup_task_folder): If there is a pending timeout callback
+ [cal_open_reload_timeout_id nonzero], remove it.
+ (e_summary_tasks_init): Call setup_task_folder().
+ (e_summary_tasks_free): If there is a pending timeout callback
+ [cal_open_reload_timeout_id nonzero], remove it.
+
+ * e-summary-calendar.c: New members cal_open_reload_timeout_id and
+ reload_count in ESummaryCalendar.
+ (e_cal_comp_util_compare_event_timezones): Renamed to
+ compare_event_timezones() and made static.
+ (generate_html): Return if the load_state of the cal_client is not
+ CAL_CLIENT_LOAD_LOADED. Call e_summary_draw() before returning.
+ (cal_open_reload_timeout): New; timeout function for attempting to
+ reload the calendar if the first attempt failed.
+ (cal_opened_cb): Return if the load_state of the cal_client is not
+ CAL_CLIENT_LOAD_LOADED.
+ (e_summary_calendar_reconfigure): Call setup_calendar() so that,
+ if the default folder has changed, it gets reloaded.
+ (setup_calendar): If there is a pending timeout callback
+ [cal_open_reload_timeout_id nonzero], remove it.
+ (e_summary_calendar_free): Likewise.
+
+ * e-summary.c: New member queue_draw_idle_id in ESummaryPrivate.
+ Removed member redraw_pending.
+ (destroy): If queue_draw_idle_id is nonzero, remove the
+ corresponding glib mainloop source.
+ (draw_idle_cb): New function to regenerate the HTML in the idle
+ loop; moved all the code from e_summary_draw() in here.
+ (e_summary_draw): Set up draw_idle_cb as an idle callback.
+ (e_summary_init): Initialize queued_draw_idle_id.
+ (e_summary_reload_timeout): Call e_summary_calendar_reconfigure()
+ and e_summary_tasks_reconfigure(). Removed debugging message.
+ (e_summary_set_online): Removed debugging message.
+ (e_summary_freeze): Removed.
+ (e_summary_thaw): Removed.
+
2002-10-23 Ettore Perazzoli <ettore@ximian.com>
* e-summary-preferences.c: Replace Gnotices with Footnotes.
diff --git a/my-evolution/e-cell-tri.c b/my-evolution/e-cell-tri.c
index 677ce26a2c..d08845f680 100644
--- a/my-evolution/e-cell-tri.c
+++ b/my-evolution/e-cell-tri.c
@@ -49,10 +49,8 @@ set_value (ECellView *view,
ECell *ecell = view->ecell;
ECellToggle *toggle = E_CELL_TOGGLE (ecell);
- if (value >= toggle->n_states) {
- g_print ("Value 2: %d\n", value);
+ if (value >= toggle->n_states)
value = 1;
- }
e_table_model_set_value_at (view->e_table_model,
model_col, row, GINT_TO_POINTER (value));
diff --git a/my-evolution/e-summary-calendar.c b/my-evolution/e-summary-calendar.c
index 8d874cc015..7903c3642d 100644
--- a/my-evolution/e-summary-calendar.c
+++ b/my-evolution/e-summary-calendar.c
@@ -44,6 +44,8 @@
#include <ical.h>
+#define MAX_RELOAD_TRIES 10
+
struct _ESummaryCalendar {
CalClient *client;
@@ -53,6 +55,9 @@ struct _ESummaryCalendar {
char *default_uri;
EConfigListener *config_listener;
+
+ int cal_open_reload_timeout_id;
+ int reload_count;
};
const char *
@@ -89,10 +94,10 @@ cal_component_compare_tzid (const char *tzid1, const char *tzid2)
return retval;
}
-gboolean
-e_cal_comp_util_compare_event_timezones (CalComponent *comp,
- CalClient *client,
- icaltimezone *zone)
+static gboolean
+compare_event_timezones (CalComponent *comp,
+ CalClient *client,
+ icaltimezone *zone)
{
CalClientGetStatus status;
CalComponentDateTime start_datetime, end_datetime;
@@ -335,6 +340,9 @@ generate_html (gpointer data)
char *tmp;
time_t t, begin, end, f;
+ if (cal_client_get_load_state (calendar->client) != CAL_CLIENT_LOAD_LOADED)
+ return FALSE;
+
/* Set the default timezone on the server. */
if (summary->tz) {
cal_client_set_default_timezone (calendar->client,
@@ -379,7 +387,7 @@ generate_html (gpointer data)
g_free (s1);
g_free (s2);
-/* e_summary_draw (summary); */
+ e_summary_draw (summary);
return FALSE;
} else {
GPtrArray *uidarray;
@@ -414,9 +422,9 @@ generate_html (gpointer data)
if (cal_component_has_alarms (event->comp)) {
img = "es-appointments.png";
- } else if (e_cal_comp_util_compare_event_timezones (event->comp,
- calendar->client,
- summary->tz) == FALSE) {
+ } else if (compare_event_timezones (event->comp,
+ calendar->client,
+ summary->tz) == FALSE) {
img = "timezone-16.xpm";
} else {
img = "new_appointment.xpm";
@@ -444,7 +452,23 @@ generate_html (gpointer data)
calendar->html = string->str;
g_string_free (string, FALSE);
-/* e_summary_draw (summary); */
+ e_summary_draw (summary);
+ return FALSE;
+}
+
+static gboolean
+cal_open_reload_timeout (void *data)
+{
+ ESummary *summary = (ESummary *) data;
+
+ summary->calendar->cal_open_reload_timeout_id = 0;
+
+ if (++ summary->calendar->reload_count >= MAX_RELOAD_TRIES) {
+ summary->calendar->reload_count = 0;
+ return FALSE;
+ }
+
+ cal_client_open_default_calendar (summary->calendar->client, FALSE);
return FALSE;
}
@@ -456,9 +480,12 @@ cal_opened_cb (CalClient *client,
if (status == CAL_CLIENT_OPEN_SUCCESS) {
g_idle_add (generate_html, summary);
} else {
- /* Need to work out what to do if there's an error */
+ summary->calendar->cal_open_reload_timeout_id = g_timeout_add (1000,
+ cal_open_reload_timeout,
+ summary);
}
}
+
static void
obj_changed_cb (CalClient *client,
const char *uid,
@@ -520,6 +547,12 @@ setup_calendar (ESummary *summary)
calendar = summary->calendar;
g_assert (calendar != NULL);
+ if (calendar->cal_open_reload_timeout_id != 0) {
+ g_source_remove (calendar->cal_open_reload_timeout_id);
+ calendar->cal_open_reload_timeout_id = 0;
+ calendar->reload_count = 0;
+ }
+
if (calendar->client != NULL)
gtk_object_unref (GTK_OBJECT (calendar->client));
@@ -549,7 +582,6 @@ config_listener_key_changed_cb (EConfigListener *listener,
void *user_data)
{
setup_calendar (E_SUMMARY (user_data));
-
generate_html (user_data);
}
@@ -589,6 +621,7 @@ e_summary_calendar_init (ESummary *summary)
void
e_summary_calendar_reconfigure (ESummary *summary)
{
+ setup_calendar (summary);
generate_html (summary);
}
@@ -601,6 +634,10 @@ e_summary_calendar_free (ESummary *summary)
g_return_if_fail (IS_E_SUMMARY (summary));
calendar = summary->calendar;
+
+ if (calendar->cal_open_reload_timeout_id != 0)
+ g_source_remove (calendar->cal_open_reload_timeout_id);
+
gtk_object_unref (GTK_OBJECT (calendar->client));
g_free (calendar->html);
g_free (calendar->default_uri);
diff --git a/my-evolution/e-summary-factory.c b/my-evolution/e-summary-factory.c
index db84213374..2a181aba74 100644
--- a/my-evolution/e-summary-factory.c
+++ b/my-evolution/e-summary-factory.c
@@ -69,7 +69,6 @@ control_activate (BonoboControl *control,
e_pixmaps_update (ui_component, pixmaps);
bonobo_ui_component_thaw (ui_component, NULL);
- e_summary_thaw (summary);
}
static void
@@ -78,7 +77,6 @@ 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-mail.c b/my-evolution/e-summary-mail.c
index da278dc8ad..ef45d70d35 100644
--- a/my-evolution/e-summary-mail.c
+++ b/my-evolution/e-summary-mail.c
@@ -130,7 +130,6 @@ folder_gen_html (ESummary *summary,
pretty_name = make_pretty_foldername (summary, folder->path);
str = g_strdup_printf ("<tr><td><a href=\"%s\"><pre>%s</pre></a></td><td align=\"Left\"><pre>%d/%d</pre></td></tr>",
folder->uri, pretty_name, folder->unread, folder->count);
- g_print ("%s\n", folder->uri);
g_string_append (string, str);
g_free (pretty_name);
g_free (str);
@@ -159,7 +158,7 @@ e_summary_mail_generate_html (ESummary *summary)
for (p = folder_store->shown; p; p = p->next) {
ESummaryMailFolder *mail_folder = p->data;
- folder_gen_html (summary, p->data, string);
+ folder_gen_html (summary, mail_folder, string);
}
g_string_append (string, "</table></dd></dl>");
@@ -644,8 +643,6 @@ insert_path_recur (ESummaryTable *est,
/* FIXME: Not sure I like this, but... */
si->toplevel = g_strdup (path);
}
-
- g_print ("Generated toplevel as %s\n", si->toplevel);
}
if (strcmp (si->toplevel, path) == 0) {
@@ -715,11 +712,9 @@ add_storage_to_table (ESummaryTable *est,
path_hash = g_hash_table_new (g_str_hash, g_str_equal);
si->folders = g_list_sort (si->folders, str_compare);
- g_print ("Adding %s\n", si->name);
for (p = si->folders; p; p = p->next) {
ESummaryMailFolder *folder = p->data;
- g_print ("folder->path: %s\n", folder->path);
insert_path_recur (est, si, path_hash, folder->path);
}
@@ -819,7 +814,6 @@ folder_info_pb_changed (BonoboListener *listener,
CORBA_Environment *ev,
gpointer data)
{
- g_print ("Changed: %s\n", name);
e_summary_folder_register_storages (folder_store->shell);
}
@@ -849,7 +843,6 @@ lazy_register_storages (void)
"folder-info-ready",
NULL);
if (ready == TRUE) {
- g_print ("We're ready\n");
/* Register storages */
e_summary_folder_register_storages (folder_store->shell);
return;
@@ -879,8 +872,6 @@ lazy_register_storages (void)
bonobo_object_unref (BONOBO_OBJECT (listener));
return;
}
-
- g_print ("Ready\n");
}
gboolean
diff --git a/my-evolution/e-summary-offline-handler.c b/my-evolution/e-summary-offline-handler.c
index ffa2b2aa12..f7d75eb74b 100644
--- a/my-evolution/e-summary-offline-handler.c
+++ b/my-evolution/e-summary-offline-handler.c
@@ -32,6 +32,7 @@
#include <bonobo/bonobo-exception.h>
#include <gtk/gtkmain.h>
+#include <gtk/gtksignal.h>
#include <gal/util/e-util.h>
#define PARENT_TYPE bonobo_x_object_get_type ()
diff --git a/my-evolution/e-summary-preferences.c b/my-evolution/e-summary-preferences.c
index ebbd943651..b231da9263 100644
--- a/my-evolution/e-summary-preferences.c
+++ b/my-evolution/e-summary-preferences.c
@@ -609,35 +609,6 @@ static struct _RDFInfo rdfs[] = {
};
static void
-free_rdf_info (struct _RDFInfo *info)
-{
- g_free (info->url);
- g_free (info->name);
- g_free (info);
-}
-
-static const char *
-find_name_for_url (PropertyData *pd,
- const char *url)
-{
- GList *p;
-
- for (p = pd->rdf->known; p; p = p->next) {
- struct _RDFInfo *info = p->data;
-
- if (info == NULL || info->url == NULL) {
- continue;
- }
-
- if (strcmp (url, info->url) == 0) {
- return info->name;
- }
- }
-
- return url;
-}
-
-static void
save_known_rdfs (GList *rdfs)
{
FILE *handle;
@@ -939,16 +910,6 @@ rdf_limit_value_changed_cb (GtkAdjustment *adj,
}
static void
-mail_etable_item_changed_cb (ESummaryTable *est,
- ETreePath path,
- PropertyData *pd)
-{
- if (pd->config_control != NULL) {
- evolution_config_control_changed (pd->config_control);
- }
-}
-
-static void
rdf_etable_item_changed_cb (ESummaryShown *ess,
PropertyData *pd)
{
@@ -1288,22 +1249,6 @@ free_property_dialog (PropertyData *pd)
g_free (pd);
}
-static void
-maybe_add_to_shown (gpointer key,
- gpointer value,
- gpointer data)
-{
- ESummaryTableModelEntry *item;
- GList **list;
-
- item = (ESummaryTableModelEntry *) value;
- list = (GList **) data;
-
- if (item->shown == TRUE) {
- *list = g_list_prepend (*list, g_strdup (item->location));
- }
-}
-
/* Prototypes to shut gcc up */
GtkWidget *e_summary_preferences_make_mail_table (PropertyData *pd);
@@ -1457,8 +1402,6 @@ get_folders_from_view (GtkWidget *view)
f = g_new (ESummaryPrefsFolder, 1);
f->evolution_uri = g_strdup (folder.evolutionUri);
f->physical_uri = g_strdup (folder.physicalUri);
- g_print ("Physical: %s\n", folder.physicalUri);
- g_print ("Evolution: %s\n----\n", folder.evolutionUri);
out_list = g_list_append (out_list, f);
}
diff --git a/my-evolution/e-summary-rdf.c b/my-evolution/e-summary-rdf.c
index 8b019301e2..f5ba7e2eaf 100644
--- a/my-evolution/e-summary-rdf.c
+++ b/my-evolution/e-summary-rdf.c
@@ -232,7 +232,6 @@ tree_walk (xmlNodePtr root,
}
if (strcasecmp (walk->name, "image") == 0) {
image = walk;
- g_print ("Image\n");
}
if (strcasecmp (walk->name, "item") == 0 && items < 16) {
item[items++] = walk;
@@ -370,7 +369,6 @@ e_summary_rdf_update (ESummary *summary)
}
context = soup_context_get (rdf->uri);
- g_print ("Updating %s\n", rdf->uri);
if (context == NULL) {
g_warning ("Invalid URL: %s", rdf->uri);
soup_context_unref (context);
diff --git a/my-evolution/e-summary-shown.c b/my-evolution/e-summary-shown.c
index 631703d8ae..340488f2da 100644
--- a/my-evolution/e-summary-shown.c
+++ b/my-evolution/e-summary-shown.c
@@ -238,27 +238,6 @@ is_location_in_shown (ESummaryShown *shown,
return FALSE;
}
-static ESummaryShownModelEntry *
-find_entry_from_location (ESummaryShown *shown,
- const char *location)
-{
- GSList *p;
-
- for (p = shown->priv->shown->contents; p; p = p->next) {
- ESummaryShownModelEntry *entry = p->data;
-
- if (entry->location == NULL) {
- continue;
- }
-
- if (strcmp ((char *) entry->location, location) == 0) {
- return entry;
- }
- }
-
- return NULL;
-}
-
struct _CountData {
ESummaryShown *shown;
GList *selected_list;
@@ -369,7 +348,6 @@ maybe_move_to_shown (ETreePath path,
new_entry->showable = entry->showable;
new_entry->ref_count = 0;
- g_print ("Added %s\n", entry->name);
*list = g_list_prepend (*list, new_entry);
}
diff --git a/my-evolution/e-summary-tasks.c b/my-evolution/e-summary-tasks.c
index dd7bc15349..84cbb9256f 100644
--- a/my-evolution/e-summary-tasks.c
+++ b/my-evolution/e-summary-tasks.c
@@ -44,6 +44,8 @@
#include <bonobo-conf/bonobo-config-database.h>
#include <liboaf/liboaf.h>
+#define MAX_RELOAD_TRIES 10
+
struct _ESummaryTasks {
CalClient *client;
@@ -54,6 +56,9 @@ struct _ESummaryTasks {
char *default_uri;
EConfigListener *config_listener;
+
+ int cal_open_reload_timeout_id;
+ int reload_count;
};
const char *
@@ -295,6 +300,9 @@ generate_html (gpointer data)
char *tmp;
time_t t;
+ if (cal_client_get_load_state (tasks->client) != CAL_CLIENT_LOAD_LOADED)
+ return FALSE;
+
/* Set the default timezone on the server. */
if (summary->tz) {
cal_client_set_default_timezone (tasks->client,
@@ -325,7 +333,6 @@ generate_html (gpointer data)
g_free (s1);
g_free (s2);
-/* e_summary_draw (summary); */
return FALSE;
} else {
char *s;
@@ -390,7 +397,23 @@ generate_html (gpointer data)
tasks->html = string->str;
g_string_free (string, FALSE);
-/* e_summary_draw (summary); */
+ e_summary_draw (summary);
+ return FALSE;
+}
+
+static gboolean
+cal_open_reload_timeout (void *data)
+{
+ ESummary *summary = (ESummary *) data;
+
+ summary->tasks->cal_open_reload_timeout_id = 0;
+
+ if (++ summary->tasks->reload_count >= MAX_RELOAD_TRIES) {
+ summary->tasks->reload_count = 0;
+ return FALSE;
+ }
+
+ cal_client_open_default_tasks (summary->tasks->client, FALSE);
return FALSE;
}
@@ -399,12 +422,14 @@ cal_opened_cb (CalClient *client,
CalClientOpenStatus status,
ESummary *summary)
{
- if (status == CAL_CLIENT_OPEN_SUCCESS) {
+ if (status == CAL_CLIENT_OPEN_SUCCESS)
g_idle_add (generate_html, summary);
- } else {
- /* Need to work out what to do if there's an error */
- }
+ else
+ summary->tasks->cal_open_reload_timeout_id = g_timeout_add (1000,
+ cal_open_reload_timeout,
+ summary);
}
+
static void
obj_changed_cb (CalClient *client,
const char *uid,
@@ -457,6 +482,12 @@ setup_task_folder (ESummary *summary)
g_assert (tasks != NULL);
g_assert (tasks->config_listener != NULL);
+ if (tasks->cal_open_reload_timeout_id != 0) {
+ g_source_remove (tasks->cal_open_reload_timeout_id);
+ tasks->cal_open_reload_timeout_id = 0;
+ tasks->reload_count = 0;
+ }
+
g_free (tasks->due_today_colour);
g_free (tasks->overdue_colour);
g_free (tasks->default_uri);
@@ -536,6 +567,7 @@ e_summary_tasks_init (ESummary *summary)
void
e_summary_tasks_reconfigure (ESummary *summary)
{
+ setup_task_folder (summary);
generate_html (summary);
}
@@ -548,6 +580,10 @@ e_summary_tasks_free (ESummary *summary)
g_return_if_fail (IS_E_SUMMARY (summary));
tasks = summary->tasks;
+
+ if (tasks->cal_open_reload_timeout_id != 0)
+ g_source_remove (tasks->cal_open_reload_timeout_id);
+
gtk_object_unref (GTK_OBJECT (tasks->client));
g_free (tasks->html);
g_free (tasks->due_today_colour);
diff --git a/my-evolution/e-summary-weather.c b/my-evolution/e-summary-weather.c
index 667853a8b0..b065527ead 100644
--- a/my-evolution/e-summary-weather.c
+++ b/my-evolution/e-summary-weather.c
@@ -37,6 +37,7 @@
#include "e-summary.h"
#include "e-summary-shown.h"
#include "e-summary-weather.h"
+#include "e-summary-preferences.h"
#include "weather.h"
#include "metar.h"
@@ -320,7 +321,6 @@ e_summary_weather_update (ESummary *summary)
uri = g_strdup_printf ("http://weather.noaa.gov/cgi-bin/mgetmetar.pl?cccc=%s", weather->location);
context = soup_context_get (uri);
- g_print ("Updating %s\n", uri);
if (context == NULL) {
g_warning ("Invalid URL: %s", uri);
soup_context_unref (context);
diff --git a/my-evolution/e-summary.c b/my-evolution/e-summary.c
index e4bdfcf3f1..4c66167482 100644
--- a/my-evolution/e-summary.c
+++ b/my-evolution/e-summary.c
@@ -98,7 +98,8 @@ struct _ESummaryPrivate {
gpointer alarm;
gboolean frozen;
- gboolean redraw_pending;
+
+ int queued_draw_idle_id;
};
typedef struct _ProtocolListener {
@@ -134,7 +135,12 @@ destroy (GtkObject *object)
gtk_timeout_remove (priv->pending_reload_tag);
priv->pending_reload_tag = 0;
}
-
+
+ if (priv->queued_draw_idle_id != 0) {
+ g_source_remove (priv->queued_draw_idle_id);
+ priv->queued_draw_idle_id = 0;
+ }
+
if (summary->mail) {
e_summary_mail_free (summary);
}
@@ -165,28 +171,17 @@ destroy (GtkObject *object)
e_summary_parent_class->destroy (object);
}
-void
-e_summary_draw (ESummary *summary)
+static gboolean
+draw_idle_cb (void *data)
{
+ ESummary *summary;
GString *string;
GtkHTMLStream *stream;
char *html;
char date[256], *date_utf;
time_t t;
- g_return_if_fail (summary != NULL);
- g_return_if_fail (IS_E_SUMMARY (summary));
-
- if (summary->mail == NULL || summary->calendar == NULL
- || summary->rdf == NULL || summary->weather == NULL
- || summary->tasks == NULL) {
- return;
- }
-
- if (summary->priv->frozen == TRUE) {
- summary->priv->redraw_pending = TRUE;
- return;
- }
+ summary = E_SUMMARY (data);
string = g_string_new (HTML_1);
t = time (NULL);
@@ -237,6 +232,28 @@ e_summary_draw (ESummary *summary)
gtk_html_end (GTK_HTML (summary->priv->html), stream, GTK_HTML_STREAM_OK);
g_string_free (string, TRUE);
+
+ summary->priv->queued_draw_idle_id = 0;
+
+ return FALSE;
+}
+
+void
+e_summary_draw (ESummary *summary)
+{
+ g_return_if_fail (summary != NULL);
+ g_return_if_fail (IS_E_SUMMARY (summary));
+
+ if (summary->mail == NULL || summary->calendar == NULL
+ || summary->rdf == NULL || summary->weather == NULL
+ || summary->tasks == NULL) {
+ return;
+ }
+
+ if (summary->priv->queued_draw_idle_id != 0)
+ return;
+
+ summary->priv->queued_draw_idle_id = g_idle_add (draw_idle_cb, summary);
}
void
@@ -473,7 +490,6 @@ e_summary_init (ESummary *summary)
priv = summary->priv;
priv->frozen = TRUE;
- priv->redraw_pending = FALSE;
priv->pending_reload_tag = 0;
priv->html_scroller = gtk_scrolled_window_new (NULL, NULL);
@@ -495,10 +511,6 @@ e_summary_init (ESummary *summary)
GTK_SIGNAL_FUNC (e_summary_url_requested), summary);
gtk_signal_connect (GTK_OBJECT (priv->html), "link-clicked",
GTK_SIGNAL_FUNC (e_summary_url_clicked), summary);
-#if 0
- gtk_signal_connect (GTK_OBJECT (priv->html), "on-url",
- GTK_SIGNAL_FUNC (e_summary_on_url), summary);
-#endif
gtk_container_add (GTK_CONTAINER (priv->html_scroller), priv->html);
gtk_widget_show_all (priv->html_scroller);
@@ -535,6 +547,8 @@ e_summary_init (ESummary *summary)
}
priv->alarm = alarm_add (day_end, alarm_fn, summary, NULL);
+
+ priv->queued_draw_idle_id = 0;
}
E_MAKE_TYPE (e_summary, "ESummary", ESummary, e_summary_class_init,
@@ -772,13 +786,17 @@ e_summary_reload_timeout (gpointer closure)
{
ESummary *summary = closure;
- if (summary->rdf != NULL) {
+ if (summary->rdf != NULL)
e_summary_rdf_update (summary);
- }
- if (summary->weather != NULL) {
+ if (summary->weather != NULL)
e_summary_weather_update (summary);
- }
+
+ if (summary->calendar != NULL)
+ e_summary_calendar_reconfigure (summary);
+
+ if (summary->tasks != NULL)
+ e_summary_tasks_reconfigure (summary);
summary->priv->pending_reload_tag = 0;
@@ -828,7 +846,6 @@ e_summary_count_connections (ESummary *summary)
count += c->count (summary, c->closure);
}
- g_print ("Count: %d", count);
return count;
}
@@ -872,11 +889,9 @@ e_summary_set_online (ESummary *summary,
c->callback_closure = closure;
c->set_online (summary, progress, online, c->closure);
- g_print ("Setting %s\n", online ? "online" : "offline");
- if (callback != NULL) {
+ if (callback != NULL)
callback (summary, closure);
- }
}
}
@@ -908,32 +923,3 @@ 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));
- g_return_if_fail (summary->priv != NULL);
-
- if (summary->priv->frozen == TRUE) {
- return;
- }
-
- summary->priv->frozen = TRUE;
-}
-
-void
-e_summary_thaw (ESummary *summary)
-{
- g_return_if_fail (IS_E_SUMMARY (summary));
- g_return_if_fail (summary->priv != NULL);
-
- 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 33e70da868..1eda58bd0e 100644
--- a/my-evolution/e-summary.h
+++ b/my-evolution/e-summary.h
@@ -108,7 +108,6 @@ struct _ESummary {
GtkVBox parent;
ESummaryPrefs *preferences;
-/* ESummaryPrefs *old_prefs; */
ESummaryMail *mail;
ESummaryCalendar *calendar;
diff --git a/my-evolution/main.c b/my-evolution/main.c
index 0e0b630343..6932bce4f4 100644
--- a/my-evolution/main.c
+++ b/my-evolution/main.c
@@ -43,6 +43,10 @@
#include <glade/glade.h>
+#include <gconf/gconf.h>
+
+#include <gal/widgets/e-cursors.h>
+
#include "component-factory.h"