aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-01-31 03:03:19 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-04-08 23:05:26 +0800
commit72797decc12602b181f69dba7c54df7a0d1b9326 (patch)
treeecd1314c92bc26b59647b351b2d47e446f4ed21d /addressbook/gui/widgets
parent3ba0b61f9f447b01c3a83bfb78ee33a45d413700 (diff)
downloadgsoc2013-evolution-72797decc12602b181f69dba7c54df7a0d1b9326.tar.gz
gsoc2013-evolution-72797decc12602b181f69dba7c54df7a0d1b9326.tar.zst
gsoc2013-evolution-72797decc12602b181f69dba7c54df7a0d1b9326.zip
Giant leap towards GSEAL compliance.
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r--addressbook/gui/widgets/e-addressbook-selector.c2
-rw-r--r--addressbook/gui/widgets/e-addressbook-view.c10
-rw-r--r--addressbook/gui/widgets/e-minicard-label.c18
-rw-r--r--addressbook/gui/widgets/e-minicard-view-widget.c26
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c18
-rw-r--r--addressbook/gui/widgets/e-minicard.c30
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c5
7 files changed, 64 insertions, 45 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-selector.c b/addressbook/gui/widgets/e-addressbook-selector.c
index 3fcf8e8f8b..690ad007ba 100644
--- a/addressbook/gui/widgets/e-addressbook-selector.c
+++ b/addressbook/gui/widgets/e-addressbook-selector.c
@@ -295,7 +295,7 @@ addressbook_selector_data_dropped (ESourceSelector *selector,
priv = E_ADDRESSBOOK_SELECTOR_GET_PRIVATE (selector);
g_return_val_if_fail (priv->current_view != NULL, FALSE);
- string = (const gchar *) selection_data->data;
+ string = (const gchar *) gtk_selection_data_get_data (selection_data);
remove_from_source = (action == GDK_ACTION_MOVE);
target_book = e_book_new (destination, NULL);
diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c
index c27bb74d8d..1e9b732861 100644
--- a/addressbook/gui/widgets/e-addressbook-view.c
+++ b/addressbook/gui/widgets/e-addressbook-view.c
@@ -241,6 +241,7 @@ table_drag_data_get (ETable *table,
EAddressbookModel *model;
EBook *book;
GList *contact_list;
+ GdkAtom target;
gchar *value;
if (!E_IS_ADDRESSBOOK_TABLE_ADAPTER (view->priv->object))
@@ -250,14 +251,15 @@ table_drag_data_get (ETable *table,
book = e_addressbook_model_get_book (model);
contact_list = e_addressbook_view_get_selected (view);
+ target = gtk_selection_data_get_target (selection_data);
switch (info) {
case DND_TARGET_TYPE_VCARD:
value = eab_contact_list_to_string (contact_list);
gtk_selection_data_set (
- selection_data, selection_data->target,
- 8, (guchar *)value, strlen (value));
+ selection_data, target, 8,
+ (guchar *)value, strlen (value));
g_free (value);
break;
@@ -267,8 +269,8 @@ table_drag_data_get (ETable *table,
book, contact_list);
gtk_selection_data_set (
- selection_data, selection_data->target,
- 8, (guchar *)value, strlen (value));
+ selection_data, target, 8,
+ (guchar *)value, strlen (value));
g_free (value);
break;
diff --git a/addressbook/gui/widgets/e-minicard-label.c b/addressbook/gui/widgets/e-minicard-label.c
index 3b0edc8854..0eb166bcf3 100644
--- a/addressbook/gui/widgets/e-minicard-label.c
+++ b/addressbook/gui/widgets/e-minicard-label.c
@@ -414,9 +414,13 @@ e_minicard_label_resize_children(EMinicardLabel *e_minicard_label)
static void
set_colors (EMinicardLabel *label)
{
- if ((GTK_OBJECT_FLAGS( label ) & GNOME_CANVAS_ITEM_REALIZED)) {
- GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (label)->canvas);
- GtkStyle *style = gtk_widget_get_style (canvas);
+ if ((GTK_OBJECT_FLAGS (label) & GNOME_CANVAS_ITEM_REALIZED)) {
+ GnomeCanvas *canvas;
+ GtkStyle *style;
+
+ canvas = GNOME_CANVAS_ITEM (label)->canvas;
+ style = gtk_widget_get_style (GTK_WIDGET (canvas));
+
if (label->has_focus) {
gnome_canvas_item_set (label->rect,
"outline_color_gdk", &style->mid[GTK_STATE_SELECTED],
@@ -424,11 +428,11 @@ set_colors (EMinicardLabel *label)
NULL);
gnome_canvas_item_set (label->field,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
+ "fill_color_gdk", &style->text[GTK_STATE_NORMAL],
NULL);
gnome_canvas_item_set (label->fieldname,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
+ "fill_color_gdk", &style->text[GTK_STATE_NORMAL],
NULL);
}
else {
@@ -438,11 +442,11 @@ set_colors (EMinicardLabel *label)
NULL);
gnome_canvas_item_set (label->field,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
+ "fill_color_gdk", &style->text[GTK_STATE_NORMAL],
NULL);
gnome_canvas_item_set (label->fieldname,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
+ "fill_color_gdk", &style->text[GTK_STATE_NORMAL],
NULL);
}
}
diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c
index 0244d13d34..7a78d83a42 100644
--- a/addressbook/gui/widgets/e-minicard-view-widget.c
+++ b/addressbook/gui/widgets/e-minicard-view-widget.c
@@ -361,11 +361,14 @@ static void
e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style)
{
EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(widget);
+ GtkStyle *style;
+
+ style = gtk_widget_get_style (widget);
if (view->background)
- gnome_canvas_item_set (view->background,
- "fill_color_gdk", &widget->style->base[GTK_STATE_NORMAL],
- NULL );
+ gnome_canvas_item_set (
+ view->background, "fill_color_gdk",
+ &style->base[GTK_STATE_NORMAL], NULL);
if (GTK_WIDGET_CLASS(parent_class)->style_set)
GTK_WIDGET_CLASS(parent_class)->style_set (widget, previous_style);
@@ -420,11 +423,7 @@ e_minicard_view_widget_size_allocate(GtkWidget *widget, GtkAllocation *allocatio
if (GTK_WIDGET_CLASS(parent_class)->size_allocate)
GTK_WIDGET_CLASS(parent_class)->size_allocate (widget, allocation);
-#if GTK_CHECK_VERSION(2,19,7)
if (gtk_widget_get_realized (widget)) {
-#else
- if (GTK_WIDGET_REALIZED(widget)) {
-#endif
gdouble width;
EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(widget);
@@ -447,15 +446,18 @@ e_minicard_view_widget_reflow(ECanvas *canvas)
{
gdouble width;
EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET(canvas);
+ GtkAllocation allocation;
if (E_CANVAS_CLASS(parent_class)->reflow)
E_CANVAS_CLASS(parent_class)->reflow (canvas);
- g_object_get(view->emv,
- "width", &width,
- NULL);
- width = MAX(width, GTK_WIDGET(canvas)->allocation.width);
- gnome_canvas_set_scroll_region(GNOME_CANVAS(canvas), 0, 0, width - 1, GTK_WIDGET(canvas)->allocation.height - 1);
+ g_object_get (view->emv, "width", &width, NULL);
+ gtk_widget_get_allocation (GTK_WIDGET (canvas), &allocation);
+
+ gnome_canvas_set_scroll_region (
+ GNOME_CANVAS(canvas), 0, 0,
+ MAX (width, allocation.width) - 1,
+ allocation.height - 1);
}
ESelectionModel *
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
index 04121207e7..b69f842d63 100644
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ b/addressbook/gui/widgets/e-minicard-view.c
@@ -83,19 +83,22 @@ e_minicard_view_drag_data_get(GtkWidget *widget,
guint time,
EMinicardView *view)
{
+ GdkAtom target;
+
if (!E_IS_MINICARD_VIEW(view))
return;
+ target = gtk_selection_data_get_target (selection_data);
+
switch (info) {
case DND_TARGET_TYPE_VCARD_LIST: {
gchar *value;
value = eab_contact_list_to_string (view->drag_list);
- gtk_selection_data_set (selection_data,
- selection_data->target,
- 8,
- (guchar *)value, strlen (value));
+ gtk_selection_data_set (
+ selection_data, target, 8,
+ (guchar *) value, strlen (value));
g_free (value);
break;
}
@@ -106,10 +109,9 @@ e_minicard_view_drag_data_get(GtkWidget *widget,
g_object_get (view->adapter, "book", &book, NULL);
value = eab_book_and_contact_list_to_string (book, view->drag_list);
- gtk_selection_data_set (selection_data,
- selection_data->target,
- 8,
- (guchar *)value, strlen (value));
+ gtk_selection_data_set (
+ selection_data, target, 8,
+ (guchar *) value, strlen (value));
g_free (value);
break;
}
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index 8a5783f3ed..213d600746 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -267,26 +267,31 @@ e_minicard_init (EMinicard *minicard)
static void
set_selected (EMinicard *minicard, gboolean selected)
{
- GtkWidget *canvas = GTK_WIDGET(GNOME_CANVAS_ITEM(minicard)->canvas);
+ GnomeCanvas *canvas;
+ GtkStyle *style;
+
+ canvas = GNOME_CANVAS_ITEM (minicard)->canvas;
+ style = gtk_widget_get_style (GTK_WIDGET (canvas));
+
if (selected) {
gnome_canvas_item_set (minicard->rect,
- "outline_color_gdk", &canvas->style->bg[GTK_STATE_ACTIVE],
+ "outline_color_gdk", &style->bg[GTK_STATE_ACTIVE],
NULL);
gnome_canvas_item_set (minicard->header_rect,
- "fill_color_gdk", &canvas->style->bg[GTK_STATE_SELECTED],
+ "fill_color_gdk", &style->bg[GTK_STATE_SELECTED],
NULL);
gnome_canvas_item_set (minicard->header_text,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_SELECTED],
+ "fill_color_gdk", &style->text[GTK_STATE_SELECTED],
NULL);
} else {
gnome_canvas_item_set (minicard->rect,
"outline_color", NULL,
NULL);
gnome_canvas_item_set (minicard->header_rect,
- "fill_color_gdk", &canvas->style->bg[GTK_STATE_NORMAL],
+ "fill_color_gdk", &style->bg[GTK_STATE_NORMAL],
NULL);
gnome_canvas_item_set (minicard->header_text,
- "fill_color_gdk", &canvas->style->text[GTK_STATE_NORMAL],
+ "fill_color_gdk", &style->text[GTK_STATE_NORMAL],
NULL);
}
minicard->selected = selected;
@@ -471,11 +476,14 @@ e_minicard_realize (GnomeCanvasItem *item)
{
EMinicard *e_minicard;
GnomeCanvasGroup *group;
- GtkWidget *canvas;
+ GnomeCanvas *canvas;
+ GtkStyle *style;
e_minicard = E_MINICARD (item);
- group = GNOME_CANVAS_GROUP( item );
- canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (item)->canvas);
+ group = GNOME_CANVAS_GROUP (item);
+
+ canvas = GNOME_CANVAS_ITEM (item)->canvas;
+ style = gtk_widget_get_style (GTK_WIDGET (canvas));
if (GNOME_CANVAS_ITEM_CLASS(parent_class)->realize)
(* GNOME_CANVAS_ITEM_CLASS(parent_class)->realize) (item);
@@ -497,7 +505,7 @@ e_minicard_realize (GnomeCanvasItem *item)
"y1", (double) 2,
"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],
+ "fill_color_gdk", &style->bg[GTK_STATE_NORMAL],
NULL );
e_minicard->header_text =
@@ -507,7 +515,7 @@ e_minicard_realize (GnomeCanvasItem *item)
"width", (double) MAX( e_minicard->width - 12, 0 ),
"clip", TRUE,
"use_ellipsis", TRUE,
- "fill_color_gdk", &canvas->style->fg[GTK_STATE_NORMAL],
+ "fill_color_gdk", &style->fg[GTK_STATE_NORMAL],
"text", "",
"draw_background", FALSE,
NULL );
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index 080d1787c7..d127d50786 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -234,6 +234,7 @@ eab_select_source (ESource *except_source, const gchar *title, const gchar *mess
{
ESource *source;
ESourceList *source_list;
+ GtkWidget *content_area;
GtkWidget *dialog;
GtkWidget *ok_button;
/* GtkWidget *label; */
@@ -272,8 +273,8 @@ eab_select_source (ESource *except_source, const gchar *title, const gchar *mess
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window), GTK_SHADOW_IN);
gtk_container_add (GTK_CONTAINER (scrolled_window), selector);
- /* gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), label, FALSE, FALSE, 4); */
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), scrolled_window, TRUE, TRUE, 4);
+ content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ gtk_box_pack_start (GTK_BOX (content_area), scrolled_window, TRUE, TRUE, 4);
gtk_widget_show_all (dialog);
response = gtk_dialog_run (GTK_DIALOG (dialog));