Files
evolution/my-evolution/e-cell-tri.c
Ettore Perazzoli 3fee618acf 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
2002-10-25 22:05:14 +00:00

120 lines
2.9 KiB
C

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Authors: Iain Holmes <iain@ximian.com>
*
* Copyright 2002 Ximain, Inc. (www.ximian.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
*
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <gdk/gdkkeysyms.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gal/util/e-util.h>
#include <gal/e-table/e-table-item.h>
#include "e-cell-tri.h"
#include "check-none.xpm"
#include "check-empty.xpm"
#include "check-filled.xpm"
#define PARENT_TYPE e_cell_toggle_get_type ()
static GdkPixbuf *checks[3];
static void
set_value (ECellView *view,
int model_col,
int view_col,
int row,
int value)
{
ECell *ecell = view->ecell;
ECellToggle *toggle = E_CELL_TOGGLE (ecell);
if (value >= toggle->n_states)
value = 1;
e_table_model_set_value_at (view->e_table_model,
model_col, row, GINT_TO_POINTER (value));
}
static gint
event (ECellView *ecell_view,
GdkEvent *event,
int model_col,
int view_col,
int row,
ECellFlags flags,
ECellActions *actions)
{
void *_value = e_table_model_value_at (ecell_view->e_table_model, model_col, row);
const int value = GPOINTER_TO_INT (_value);
switch (event->type) {
case GDK_KEY_PRESS:
if (event->key.keyval != GDK_space) {
return FALSE;
}
/* Fall through */
case GDK_BUTTON_PRESS:
if (e_table_model_is_cell_editable (ecell_view->e_table_model, model_col, row) == FALSE) {
return FALSE;
}
if (value == 0) {
return FALSE;
}
set_value (ecell_view, model_col, view_col, row, value + 1);
return TRUE;
default:
return FALSE;
}
return TRUE;
}
static void
e_cell_tri_class_init (GtkObjectClass *object_class)
{
ECellClass *e_cell_class = E_CELL_CLASS (object_class);
e_cell_class->event = event;
checks[0] = gdk_pixbuf_new_from_xpm_data (check_none_xpm);
checks[1] = gdk_pixbuf_new_from_xpm_data (check_empty_xpm);
checks[2] = gdk_pixbuf_new_from_xpm_data (check_filled_xpm);
}
E_MAKE_TYPE (e_cell_tri, "ECellTri", ECellTri, e_cell_tri_class_init, NULL, PARENT_TYPE);
ECell *
e_cell_tri_new (void)
{
ECellTri *ect = gtk_type_new (e_cell_tri_get_type ());
e_cell_toggle_construct (E_CELL_TOGGLE (ect), 2, 3, checks);
return (ECell *) ect;
}