add include for gtkstock.h.

2002-11-26  Chris Toshok  <toshok@ximian.com>

	* gui/contact-editor/e-contact-quick-add.c: add include for
	gtkstock.h.

	* gui/contact-list-editor/e-contact-list-model.c
	(e_contact_list_model_add_destination): add pre_change call.
	(e_contact_list_model_remove_row): same.
	(e_contact_list_model_remove_all): same.

	* gui/contact-list-editor/e-contact-list-editor.c
	(e_contact_list_editor_new): ref/sink the contact list editor so
	we don't get the floating unref warning from gtk.

	* gui/contact-editor/e-contact-editor.c (e_contact_editor_new):
	ref/sink the contact editor so we don't get the floating unref
	warning from gtk.
	(e_contact_editor_init): use g_build_filename instead of
	g_concat_dir_and_file.

	* gui/widgets/e-minicard-label.c
	(e_minicard_label_resize_children): use MAX (value, 0) to make
	sure we aren't passing negative values for clip-widths.

	* gui/widgets/e-minicard.c (e_minicard_realize): use MAX (value,
	0) to make sure we aren't passing negative values for widths.

	* gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
	use g_build_filename.

svn path=/trunk/; revision=18946
This commit is contained in:
Chris Toshok
2002-11-27 06:32:23 +00:00
committed by Chris Toshok
parent 7a600dbc41
commit bbb885a116
7 changed files with 61 additions and 19 deletions

View File

@ -1,3 +1,33 @@
2002-11-26 Chris Toshok <toshok@ximian.com>
* gui/contact-editor/e-contact-quick-add.c: add include for
gtkstock.h.
* gui/contact-list-editor/e-contact-list-model.c
(e_contact_list_model_add_destination): add pre_change call.
(e_contact_list_model_remove_row): same.
(e_contact_list_model_remove_all): same.
* gui/contact-list-editor/e-contact-list-editor.c
(e_contact_list_editor_new): ref/sink the contact list editor so
we don't get the floating unref warning from gtk.
* gui/contact-editor/e-contact-editor.c (e_contact_editor_new):
ref/sink the contact editor so we don't get the floating unref
warning from gtk.
(e_contact_editor_init): use g_build_filename instead of
g_concat_dir_and_file.
* gui/widgets/e-minicard-label.c
(e_minicard_label_resize_children): use MAX (value, 0) to make
sure we aren't passing negative values for clip-widths.
* gui/widgets/e-minicard.c (e_minicard_realize): use MAX (value,
0) to make sure we aren't passing negative values for widths.
* gui/contact-editor/e-contact-editor.c (e_contact_editor_init):
use g_build_filename.
2002-11-26 Chris Toshok <toshok@ximian.com>
[ roll forward from 1.2 branch ]

View File

@ -230,7 +230,6 @@ e_contact_editor_class_init (EContactEditorClass *klass)
NULL, NULL,
ece_marshal_NONE__NONE,
G_TYPE_NONE, 0);
}
static void
@ -1465,7 +1464,7 @@ e_contact_editor_init (EContactEditor *e_contact_editor)
GTK_SIGNAL_FUNC (app_delete_event_cb), e_contact_editor);
/* set the icon */
icon_path = g_concat_dir_and_file (EVOLUTION_ICONSDIR, "evolution-contacts-mini.png");
icon_path = g_build_filename (EVOLUTION_ICONSDIR, "evolution-contacts-mini.png", NULL);
gnome_window_icon_set_from_file (GTK_WINDOW (e_contact_editor->app), icon_path);
g_free (icon_path);
}
@ -1611,12 +1610,15 @@ e_contact_editor_new (EBook *book,
all_contact_editors = g_slist_prepend (all_contact_editors, ce);
g_object_weak_ref (G_OBJECT (ce), contact_editor_destroy_notify, ce);
gtk_object_ref (GTK_OBJECT (ce));
gtk_object_sink (GTK_OBJECT (ce));
g_object_set (ce,
"book", book,
"card", card,
"is_new_card", is_new_card,
"editable", editable,
NULL);
"book", book,
"card", card,
"is_new_card", is_new_card,
"editable", editable,
NULL);
if (book)
e_book_get_supported_fields (book, (EBookFieldsCallback)supported_fields_cb, ce);

View File

@ -31,6 +31,7 @@
#include <gtk/gtklabel.h>
#include <gtk/gtktable.h>
#include <gtk/gtkdialog.h>
#include <gtk/gtkstock.h>
#include <libgnome/gnome-i18n.h>
#include <libgnomeui/gnome-app.h>
#include <gal/widgets/e-unicode.h>

View File

@ -586,12 +586,15 @@ e_contact_list_editor_new (EBook *book,
all_contact_list_editors = g_slist_prepend (all_contact_list_editors, ce);
g_object_weak_ref (G_OBJECT (ce), contact_list_editor_destroy_notify, ce);
gtk_object_ref (GTK_OBJECT (ce));
gtk_object_sink (GTK_OBJECT (ce));
g_object_set (ce,
"book", book,
"card", list_card,
"is_new_list", is_new_list,
"editable", editable,
NULL);
"book", book,
"card", list_card,
"is_new_list", is_new_list,
"editable", editable,
NULL);
return ce;
}

View File

@ -171,6 +171,8 @@ e_contact_list_model_add_destination (EContactListModel *model, EDestination *de
g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
g_return_if_fail (E_IS_DESTINATION (dest));
e_table_model_pre_change (E_TABLE_MODEL (model));
if (model->data_count + 1 >= model->data_alloc) {
model->data_alloc *= 2;
model->data = g_renew (EDestination*, model->data, model->data_alloc);
@ -218,6 +220,8 @@ e_contact_list_model_remove_row (EContactListModel *model, int row)
g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
g_return_if_fail (0 <= row && row < model->data_count);
e_table_model_pre_change (E_TABLE_MODEL (model));
g_object_unref (model->data[row]);
memmove (model->data + row, model->data + row + 1, sizeof (EDestination*) * (model->data_count - row - 1));
model->data_count --;
@ -232,6 +236,8 @@ e_contact_list_model_remove_all (EContactListModel *model)
g_return_if_fail (E_IS_CONTACT_LIST_MODEL (model));
e_table_model_pre_change (E_TABLE_MODEL (model));
for (i = 0; i < model->data_count; i ++) {
g_object_unref (model->data[i]);
model->data[i] = NULL;

View File

@ -451,10 +451,10 @@ e_minicard_label_resize_children(EMinicardLabel *e_minicard_label)
left_width = e_minicard_label->width / 2 - 4;
gnome_canvas_item_set( e_minicard_label->fieldname,
"clip_width", (double) ( left_width ),
"clip_width", (double) MAX ( left_width, 0 ),
NULL );
gnome_canvas_item_set( e_minicard_label->field,
"clip_width", (double) ( e_minicard_label->width - 8 - left_width ),
"clip_width", (double) MAX ( e_minicard_label->width - 8 - left_width, 0 ),
NULL );
}

View File

@ -446,8 +446,8 @@ e_minicard_realize (GnomeCanvasItem *item)
gnome_canvas_rect_get_type(),
"x1", (double) 0,
"y1", (double) 0,
"x2", (double) e_minicard->width - 1,
"y2", (double) e_minicard->height - 1,
"x2", (double) MAX (e_minicard->width - 1, 0),
"y2", (double) MAX (e_minicard->height - 1, 0),
"outline_color", NULL,
NULL );
@ -456,8 +456,8 @@ e_minicard_realize (GnomeCanvasItem *item)
gnome_canvas_rect_get_type(),
"x1", (double) 2,
"y1", (double) 2,
"x2", (double) e_minicard->width - 3,
"y2", (double) e_minicard->height - 3,
"x2", (double) MAX (e_minicard->width - 3, 0),
"y2", (double) MAX (e_minicard->height - 3, 0),
"fill_color_gdk", &canvas->style->bg[GTK_STATE_NORMAL],
NULL );
@ -465,7 +465,7 @@ e_minicard_realize (GnomeCanvasItem *item)
gnome_canvas_item_new( group,
e_text_get_type(),
"anchor", GTK_ANCHOR_NW,
"width", (double) ( e_minicard->width - 12 ),
"width", (double) MAX( e_minicard->width - 12, 0 ),
"clip", TRUE,
"use_ellipsis", TRUE,
#if 0