[evolution-mapi] Bug #652857 - Do not use recently deprecated Gtk+ symbols
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-mapi] Bug #652857 - Do not use recently deprecated Gtk+ symbols
- Date: Mon, 20 Jun 2011 08:33:09 +0000 (UTC)
commit 5731b0ad24273fe23092408150cf3a6faa0f97c9
Author: Milan Crha <mcrha redhat com>
Date: Mon Jun 20 10:32:02 2011 +0200
Bug #652857 - Do not use recently deprecated Gtk+ symbols
configure.ac | 4 +-
.../exchange-mapi-account-settings.c | 43 ++++++++++---------
.../exchange-mapi-account-setup.c | 40 +++++++++---------
3 files changed, 46 insertions(+), 41 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index dac8fe1..8c06616 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,7 +57,6 @@ AS_COMPILER_FLAGS(WARNING_FLAGS,
-DPANGO_DISABLE_DEPRECATED
-DGDK_DISABLE_DEPRECATED
-DGDK_PIXBUF_DISABLE_DEPRECATED
- -DGTK_DISABLE_DEPRECATED
-DGNOME_DISABLE_DEPRECATED
-DGSEAL_ENABLE
-DE_BOOK_DISABLE_DEPRECATED
@@ -74,6 +73,9 @@ AS_COMPILER_FLAGS(WARNING_FLAGS,
-Wundef -Wwrite-strings")
AC_SUBST(WARNING_FLAGS)
+dnl When evo will stop using GtkHBox/GtkVBox
+dnl -DGTK_DISABLE_DEPRECATED
+dnl
dnl Other useful compiler warnings for test builds only.
dnl These may produce warnings we have no control over.
dnl
diff --git a/src/account-setup-eplugin/exchange-mapi-account-settings.c b/src/account-setup-eplugin/exchange-mapi-account-settings.c
index 234c15c..15c5e68 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-settings.c
+++ b/src/account-setup-eplugin/exchange-mapi-account-settings.c
@@ -65,7 +65,7 @@ enum {
typedef struct
{
GtkDialog *dialog;
- GtkBox *spinner_hbox;
+ GtkGrid *spinner_grid;
gchar *profile;
@@ -84,7 +84,7 @@ fill_folder_size_dialog_cb (gpointer data)
FolderSizeDialogData *dialog_data = (FolderSizeDialogData *)data;
/* Hide progress bar. Set status*/
- gtk_widget_destroy (GTK_WIDGET (dialog_data->spinner_hbox));
+ gtk_widget_destroy (GTK_WIDGET (dialog_data->spinner_grid));
if (dialog_data->folder_list) {
GtkWidget *scrolledwindow, *tree_view;
@@ -131,7 +131,7 @@ fill_folder_size_dialog_cb (gpointer data)
gtk_widget_show_all (widget);
/* Pack into content_area */
- content_area = (GtkBox*) gtk_dialog_get_content_area (dialog_data->dialog);
+ content_area = GTK_BOX (gtk_dialog_get_content_area (dialog_data->dialog));
gtk_box_pack_start (content_area, widget, TRUE, TRUE, 6);
if (dialog_data->conn)
@@ -172,23 +172,26 @@ mapi_settings_run_folder_size_dialog (const gchar *profile, gpointer data)
gtk_window_set_default_size (GTK_WINDOW (dialog_data->dialog), 250, 300);
- content_area = (GtkBox *)gtk_dialog_get_content_area (dialog_data->dialog);
+ content_area = GTK_BOX (gtk_dialog_get_content_area (dialog_data->dialog));
spinner = gtk_spinner_new ();
gtk_spinner_start (GTK_SPINNER (spinner));
spinner_label = gtk_label_new (_("Fetching folder listâ"));
- dialog_data->spinner_hbox = (GtkBox *) gtk_hbox_new (FALSE, 6);
+ dialog_data->spinner_grid = GTK_GRID (gtk_grid_new ());
+ gtk_grid_set_column_spacing (dialog_data->spinner_grid, 6);
+ gtk_grid_set_column_homogeneous (dialog_data->spinner_grid, FALSE);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (dialog_data->spinner_grid), GTK_ORIENTATION_HORIZONTAL);
alignment = gtk_alignment_new (1.0, 0.5, 0.0, 1.0);
gtk_container_add (GTK_CONTAINER (alignment), spinner);
gtk_misc_set_alignment (GTK_MISC (spinner_label), 0.0, 0.5);
- gtk_box_pack_start (dialog_data->spinner_hbox, alignment, TRUE, TRUE, 0);
- gtk_box_pack_start (dialog_data->spinner_hbox, spinner_label, TRUE, TRUE, 0);
+ gtk_container_add (GTK_CONTAINER (dialog_data->spinner_grid), alignment);
+ gtk_container_add (GTK_CONTAINER (dialog_data->spinner_grid), spinner_label);
/* Pack the TreeView into dialog's content area */
- gtk_box_pack_start (content_area, GTK_WIDGET (dialog_data->spinner_hbox), TRUE, TRUE, 6);
+ gtk_box_pack_start (content_area, GTK_WIDGET (dialog_data->spinner_grid), TRUE, TRUE, 6);
gtk_widget_show_all (GTK_WIDGET (dialog_data->dialog));
dialog_data->profile = g_strdup (profile);
@@ -329,11 +332,11 @@ org_gnome_exchange_mapi_settings (EPlugin *epl, EConfigHookItemFactoryData *data
EMConfigTargetAccount *target_account;
CamelURL *url;
const gchar *source_url;
- GtkVBox *settings;
+ GtkGrid *vsettings;
/* Miscelleneous setting */
GtkFrame *frm_misc;
- GtkVBox *vbox_misc;
+ GtkGrid *vgrid_misc;
GtkTable *tbl_misc;
GtkLabel *lbl_fsize;
GtkButton *btn_fsize;
@@ -349,16 +352,16 @@ org_gnome_exchange_mapi_settings (EPlugin *epl, EConfigHookItemFactoryData *data
return NULL;
}
- settings = (GtkVBox*) g_object_new (GTK_TYPE_VBOX, "homogeneous", FALSE, "spacing", 6, NULL);
- gtk_container_set_border_width (GTK_CONTAINER (settings), 12);
+ vsettings = GTK_GRID (g_object_new (GTK_TYPE_GRID, "column-homogeneous", FALSE, "column-spacing", 6, "orientation", GTK_ORIENTATION_VERTICAL, NULL));
+ gtk_container_set_border_width (GTK_CONTAINER (vsettings), 12);
/* Miscellaneous settings */
frm_misc = (GtkFrame*) g_object_new (GTK_TYPE_FRAME, "label", _("Miscellaneous"), NULL);
- gtk_box_pack_start (GTK_BOX (settings), GTK_WIDGET (frm_misc), FALSE, FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (vsettings), GTK_WIDGET (frm_misc));
- vbox_misc = (GtkVBox*) g_object_new (GTK_TYPE_VBOX, "homogeneous", FALSE, "spacing", 6, NULL);
- gtk_container_set_border_width (GTK_CONTAINER (vbox_misc), 6);
- gtk_container_add (GTK_CONTAINER (frm_misc), GTK_WIDGET (vbox_misc));
+ vgrid_misc = GTK_GRID (g_object_new (GTK_TYPE_GRID, "column-homogeneous", FALSE, "column-spacing", 6, "orientation", GTK_ORIENTATION_VERTICAL, NULL));
+ gtk_container_set_border_width (GTK_CONTAINER (vgrid_misc), 6);
+ gtk_container_add (GTK_CONTAINER (frm_misc), GTK_WIDGET (vgrid_misc));
tbl_misc = (GtkTable*) g_object_new (GTK_TYPE_TABLE, "n-rows", 1, "n-columns", 1,
"homogeneous", FALSE, "row-spacing", 6,
@@ -374,14 +377,14 @@ org_gnome_exchange_mapi_settings (EPlugin *epl, EConfigHookItemFactoryData *data
gtk_table_attach (tbl_misc, GTK_WIDGET (btn_fsize), 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
/*Note : Reason for placing this UI is because we try to be like outlook. */
- gtk_box_pack_start (GTK_BOX (vbox_misc), GTK_WIDGET (tbl_misc), FALSE, FALSE, 0);
- gtk_widget_show_all (GTK_WIDGET (settings));
+ gtk_container_add (GTK_CONTAINER (vgrid_misc), GTK_WIDGET (tbl_misc));
+ gtk_widget_show_all (GTK_WIDGET (vsettings));
/*Insert the page*/
- gtk_notebook_insert_page (GTK_NOTEBOOK (data->parent), GTK_WIDGET (settings),
+ gtk_notebook_insert_page (GTK_NOTEBOOK (data->parent), GTK_WIDGET (vsettings),
gtk_label_new(_("Exchange Settings")), 4);
- return GTK_WIDGET (settings);
+ return GTK_WIDGET (vsettings);
}
static GtkActionEntry folder_size_entries[] = {
diff --git a/src/account-setup-eplugin/exchange-mapi-account-setup.c b/src/account-setup-eplugin/exchange-mapi-account-setup.c
index a07c8a3..66bbc0f 100644
--- a/src/account-setup-eplugin/exchange-mapi-account-setup.c
+++ b/src/account-setup-eplugin/exchange-mapi-account-setup.c
@@ -118,7 +118,7 @@ create_profile_callback (struct SRowSet *rowset, gpointer data)
GtkCellRenderer *renderer;
GtkTreeSelection *selection;
GtkWidget *dialog, *view;
- GtkBox *vbox;
+ GtkBox *content_area;
const gchar *username = (const gchar *)data;
/* If we can find the exact username, then find & return its index. */
@@ -182,12 +182,12 @@ create_profile_callback (struct SRowSet *rowset, gpointer data)
}
/* Pack the TreeView into dialog's content area */
- vbox = (GtkBox *) gtk_dialog_get_content_area (GTK_DIALOG (dialog));
+ content_area = GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog)));
- gtk_box_pack_start (vbox, gtk_label_new (_("There are more users with similar user name on a server.\nPlease select that you would like to use from the below list.")), TRUE, TRUE, 6);
- gtk_box_pack_start (vbox, view, TRUE, TRUE, 6);
+ gtk_box_pack_start (content_area, gtk_label_new (_("There are more users with similar user name on a server.\nPlease select that you would like to use from the below list.")), TRUE, TRUE, 6);
+ gtk_box_pack_start (content_area, view, TRUE, TRUE, 6);
- gtk_widget_show_all (GTK_WIDGET (vbox));
+ gtk_widget_show_all (GTK_WIDGET (content_area));
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (view));
g_signal_connect (selection, "changed", G_CALLBACK (tree_selection_changed), dialog);
@@ -365,7 +365,7 @@ org_gnome_exchange_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData
{
EMConfigTargetAccount *target_account;
CamelURL *url;
- GtkWidget *hbox = NULL;
+ GtkWidget *hgrid = NULL;
gint row;
target_account = (EMConfigTargetAccount *)data->config->target;
@@ -386,7 +386,7 @@ org_gnome_exchange_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData
g_object_get (data->parent, "n-rows", &row, NULL);
/* Domain name & Authenticate Button */
- hbox = gtk_hbox_new (FALSE, 6);
+ hgrid = g_object_new (GTK_TYPE_GRID, "column-homogeneous", FALSE, "column-spacing", 6, "orientation", GTK_ORIENTATION_HORIZONTAL, NULL);
label = gtk_label_new_with_mnemonic (_("_Domain name:"));
gtk_widget_show (label);
@@ -394,16 +394,16 @@ org_gnome_exchange_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData
gtk_label_set_mnemonic_widget (GTK_LABEL (label), domain_name);
if (domain_value && *domain_value)
gtk_entry_set_text (GTK_ENTRY (domain_name), domain_value);
- gtk_box_pack_start (GTK_BOX (hbox), domain_name, FALSE, FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (hgrid), domain_name);
g_signal_connect (domain_name, "changed", G_CALLBACK(domain_entry_changed), data->config);
auth_button = gtk_button_new_with_mnemonic (_("_Authenticate"));
- gtk_box_pack_start (GTK_BOX (hbox), auth_button, FALSE, FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (hgrid), auth_button);
g_signal_connect (auth_button, "clicked", G_CALLBACK (validate_credentials), data->config);
gtk_table_attach (GTK_TABLE (data->parent), label, 0, 1, row, row+1, 0, 0, 0, 0);
- gtk_widget_show_all (GTK_WIDGET (hbox));
- gtk_table_attach (GTK_TABLE (data->parent), GTK_WIDGET (hbox), 1, 2, row, row+1, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
+ gtk_widget_show_all (GTK_WIDGET (hgrid));
+ gtk_table_attach (GTK_TABLE (data->parent), GTK_WIDGET (hgrid), 1, 2, row, row+1, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0);
row++;
@@ -415,7 +415,7 @@ org_gnome_exchange_mapi_account_setup (EPlugin *epl, EConfigHookItemFactoryData
}
camel_url_free (url);
- return hbox;
+ return hgrid;
}
gboolean
@@ -632,7 +632,7 @@ exchange_mapi_cursor_change (GtkTreeView *treeview, ESource *source)
static GtkWidget *
exchange_mapi_create (GtkWidget *parent, ESource *source, ExchangeMAPIFolderType folder_type)
{
- GtkWidget *vbox, *label, *scroll, *tv;
+ GtkWidget *vgrid, *label, *scroll, *tv;
gchar *uri_text, *profile = NULL;
ESourceGroup *group;
gint row;
@@ -668,19 +668,19 @@ exchange_mapi_create (GtkWidget *parent, ESource *source, ExchangeMAPIFolderType
if (conn)
g_object_unref (conn);
- vbox = gtk_vbox_new (FALSE, 6);
+ vgrid = g_object_new (GTK_TYPE_GRID, "column-homogeneous", FALSE, "column-spacing", 6, "orientation", GTK_ORIENTATION_VERTICAL, NULL);
if (folder_type == MAPI_FOLDER_TYPE_CONTACT) {
- gtk_container_add (GTK_CONTAINER (parent), vbox);
+ gtk_container_add (GTK_CONTAINER (parent), vgrid);
} else {
g_object_get (parent, "n-rows", &row, NULL);
- gtk_table_attach (GTK_TABLE (parent), vbox, 0, 2, row+1, row+2, GTK_FILL|GTK_EXPAND, 0, 0, 0);
+ gtk_table_attach (GTK_TABLE (parent), vgrid, 0, 2, row+1, row+2, GTK_FILL|GTK_EXPAND, 0, 0, 0);
}
label = gtk_label_new_with_mnemonic (_("_Location:"));
gtk_widget_show (label);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (vgrid), label);
rcell = gtk_cell_renderer_text_new ();
tvc = gtk_tree_view_column_new_with_attributes (acc, rcell, "text", NAME_COL, NULL);
@@ -703,10 +703,10 @@ exchange_mapi_create (GtkWidget *parent, ESource *source, ExchangeMAPIFolderType
g_signal_connect (G_OBJECT (tv), "cursor-changed", G_CALLBACK (exchange_mapi_cursor_change), source);
gtk_widget_show_all (scroll);
- gtk_box_pack_start (GTK_BOX (vbox), scroll, FALSE, FALSE, 0);
+ gtk_container_add (GTK_CONTAINER (vgrid), scroll);
- gtk_widget_show_all (vbox);
- return vbox;
+ gtk_widget_show_all (vgrid);
+ return vgrid;
}
GtkWidget *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]