static void cell_date_edit_text_set_value (ECellText *cell, ETableModel *model, gint col, gint row, const gchar *text) { ECellDateEditText *ecd = E_CELL_DATE_EDIT_TEXT (cell); ETimeParseStatus status; struct tm tmp_tm; ECellDateEditValue *value; gboolean is_date = TRUE; /* Try to parse just a date first. If the value is only a date, we * use a DATE value. */ status = e_time_parse_date (text, &tmp_tm); if (status == E_TIME_PARSE_INVALID) { is_date = FALSE; status = e_time_parse_date_and_time (text, &tmp_tm); if (status == E_TIME_PARSE_INVALID) { show_date_warning (ecd); return; } } if (status == E_TIME_PARSE_NONE) { value = NULL; } else { ECellDateEditValue dv; dv.tt = icaltime_null_time (); dv.tt.year = tmp_tm.tm_year + 1900; dv.tt.month = tmp_tm.tm_mon + 1; dv.tt.day = tmp_tm.tm_mday; dv.tt.hour = tmp_tm.tm_hour; dv.tt.minute = tmp_tm.tm_min; dv.tt.second = tmp_tm.tm_sec; dv.tt.is_date = is_date; /* FIXME: We assume it is being set to the current timezone. * Is that OK? */ if (is_date) { dv.zone = NULL; } else { dv.zone = e_cell_date_edit_text_get_timezone (ecd); } value = &dv; } e_table_model_set_value_at (model, col, row, value); }
static void etss_set_value_at (ETableModel *etm, gint col, gint row, gconstpointer val) { ETableSubset *etss = (ETableSubset *) etm; g_return_if_fail (VALID_ROW (etss, row)); etss->last_access = row; d(g_print("h) Setting last_access to %d\n", row)); e_table_model_set_value_at (etss->source, col, MAP_ROW (etss, row), val); }
static void eprog_set_value (ECellProgressView *progress_view, int model_col, int view_col, int row, int value) { ECell *ecell = progress_view->cell_view.ecell; ECellProgress *progress = E_CELL_PROGRESS (ecell); if (value > progress->max){ value = progress->max; }else if (value < progress->min){ value = progress->min; } e_table_model_set_value_at (progress_view->cell_view.e_table_model, model_col, row, GINT_TO_POINTER (value)); eprog_queue_redraw (progress_view, view_col, row); }
static void ecp_set_value (ECellText *cell, ETableModel *model, gint col, gint row, const gchar *text) { gint matched, percent; gboolean empty = TRUE; const gchar *p; if (text) { p = text; while (*p) { if (!isspace ((guchar) *p)) { empty = FALSE; break; } p++; } } if (empty) { percent = -1; } else { matched = sscanf (text, "%i", &percent); if (matched != 1 || percent < 0 || percent > 100) { show_percent_warning (); return; } } e_table_model_set_value_at ( model, col, row, GINT_TO_POINTER (percent)); }