[evolution/gtk3: 3/10] Remove almost all uses of GTK_CHECK_VERSION.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gtk3: 3/10] Remove almost all uses of GTK_CHECK_VERSION.
- Date: Thu, 11 Nov 2010 19:07:44 +0000 (UTC)
commit 670dbe35bb80c633a8ced0752d03861d6763e4db
Author: Matthew Barnes <mbarnes redhat com>
Date: Tue Nov 9 08:48:33 2010 -0500
Remove almost all uses of GTK_CHECK_VERSION.
.../gui/contact-editor/e-contact-editor-fullname.c | 3 -
e-util/e-alert-dialog.c | 4 -
e-util/e-datetime-format.c | 27 ++----
e-util/e-util.c | 7 +-
e-util/gtk-compat.h | 101 --------------------
filter/e-filter-datespec.c | 3 -
filter/e-rule-context.c | 3 -
filter/e-rule-editor.c | 9 --
mail/e-mail-label-dialog.c | 3 -
modules/calendar/e-cal-attachment-handler.c | 3 -
modules/mailto-handler/evolution-mailto-handler.c | 3 -
plugins/backup-restore/backup.c | 3 -
plugins/mark-all-read/mark-all-read.c | 3 -
plugins/publish-calendar/url-editor-dialog.c | 3 -
shell/main.c | 3 -
widgets/menus/gal-view-instance-save-as-dialog.c | 3 -
widgets/misc/e-attachment-dialog.c | 3 -
widgets/misc/e-charset-combo-box.c | 3 -
widgets/misc/e-dateedit.c | 19 +---
widgets/misc/e-signature-script-dialog.c | 3 -
20 files changed, 17 insertions(+), 192 deletions(-)
---
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
index c26b6e5..31577fe 100644
--- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c
+++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c
@@ -200,9 +200,6 @@ e_contact_editor_fullname_init (EContactEditorFullname *e_contact_editor_fullnam
content_area = gtk_dialog_get_content_area (dialog);
gtk_widget_realize (GTK_WIDGET (e_contact_editor_fullname));
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
gtk_container_set_border_width (GTK_CONTAINER (action_area), 12);
gtk_container_set_border_width (GTK_CONTAINER (content_area), 0);
diff --git a/e-util/e-alert-dialog.c b/e-util/e-alert-dialog.c
index 2639196..c94f022 100644
--- a/e-util/e-alert-dialog.c
+++ b/e-util/e-alert-dialog.c
@@ -129,10 +129,6 @@ alert_dialog_constructed (GObject *object)
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
-
gtk_widget_ensure_style (GTK_WIDGET (dialog));
gtk_container_set_border_width (GTK_CONTAINER (action_area), 12);
gtk_container_set_border_width (GTK_CONTAINER (content_area), 0);
diff --git a/e-util/e-datetime-format.c b/e-util/e-datetime-format.c
index f5155be..0ec9748 100644
--- a/e-util/e-datetime-format.c
+++ b/e-util/e-datetime-format.c
@@ -495,6 +495,7 @@ unref_setup_keyfile (gpointer ptr)
void
e_datetime_format_add_setup_widget (GtkWidget *table, gint row, const gchar *component, const gchar *part, DTFormatKind kind, const gchar *caption)
{
+ GtkListStore *store;
GtkWidget *label, *combo, *preview, *align;
gchar *key;
@@ -506,23 +507,15 @@ e_datetime_format_add_setup_widget (GtkWidget *table, gint row, const gchar *com
key = gen_key (component, part, kind);
label = gtk_label_new_with_mnemonic (caption ? caption : _("Format:"));
-#if GTK_CHECK_VERSION(2,23,0)
- /* FIXME Rewrite this when removing the version check. */
- {
- GtkListStore *store;
-
- store = gtk_list_store_new (1, G_TYPE_STRING);
- combo = g_object_new (
- GTK_TYPE_COMBO_BOX_TEXT,
- "model", store,
- "has-entry", TRUE,
- "entry-text-column", 0,
- NULL);
- g_object_unref (store);
- }
-#else
- combo = gtk_combo_box_entry_new_text ();
-#endif
+
+ store = gtk_list_store_new (1, G_TYPE_STRING);
+ combo = g_object_new (
+ GTK_TYPE_COMBO_BOX_TEXT,
+ "model", store,
+ "has-entry", TRUE,
+ "entry-text-column", 0,
+ NULL);
+ g_object_unref (store);
fill_combo_formats (combo, key, kind);
gtk_label_set_mnemonic_widget ((GtkLabel *)label, combo);
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 4c2764d..f62a150 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -59,12 +59,7 @@
#include "e-util-private.h"
#include "gtk-compat.h"
-#if !GTK_CHECK_VERSION (2,23,0)
- #undef GtkComboBoxText
- ENSURE_GTK_COMBO_BOX_TEXT_TYPE
-#else
- ENSURE_GTK_COMBO_BOX_ENTRY_TYPE
-#endif
+ENSURE_GTK_COMBO_BOX_ENTRY_TYPE
/**
* e_get_gnome2_user_dir:
diff --git a/e-util/gtk-compat.h b/e-util/gtk-compat.h
index ab4a872..786cc04 100644
--- a/e-util/gtk-compat.h
+++ b/e-util/gtk-compat.h
@@ -5,107 +5,6 @@
/* Provide a GTK+ compatibility layer. */
-#if !GTK_CHECK_VERSION (2,23,0)
-#define gtk_combo_box_text_new gtk_combo_box_new_text
-#define gtk_combo_box_text_append_text gtk_combo_box_append_text
-#define gtk_combo_box_text_prepend_text gtk_combo_box_prepend_text
-#define gtk_combo_box_text_get_active_text gtk_combo_box_get_active_text
-#define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX
-#define GtkComboBoxText GtkComboBox
-
-/* The below can be used only once in sources */
-#define ENSURE_GTK_COMBO_BOX_TEXT_TYPE \
- GType gtk_combo_box_text_get_type (void); \
- typedef struct _GtkComboBoxText GtkComboBoxText; \
- typedef struct _GtkComboBoxTextClass GtkComboBoxTextClass; \
- \
- struct _GtkComboBoxText { \
- GtkComboBox parent; \
- }; \
- \
- struct _GtkComboBoxTextClass { \
- GtkComboBoxClass parent_class; \
- }; \
- \
- \
- G_DEFINE_TYPE (GtkComboBoxText, gtk_combo_box_text, GTK_TYPE_COMBO_BOX) \
- \
- static void gtk_combo_box_text_init (GtkComboBoxText *cbt) {} \
- static void gtk_combo_box_text_class_init (GtkComboBoxTextClass *kl) {}
-
-static inline gint
-gdk_window_get_width (GdkWindow *window)
-{
- gint width, height;
-
- gdk_drawable_get_size (GDK_DRAWABLE (window), &width, &height);
-
- return width;
-}
-
-static inline gint
-gdk_window_get_height (GdkWindow *window)
-{
- gint width, height;
-
- gdk_drawable_get_size (GDK_DRAWABLE (window), &width, &height);
-
- return height;
-}
-#endif
-
-#if GTK_CHECK_VERSION (2,23,0)
-#define GTK_COMBO_BOX_ENTRY GTK_COMBO_BOX
-
-#define ENSURE_GTK_COMBO_BOX_ENTRY_TYPE \
- GType gtk_combo_box_entry_get_type (void); \
- typedef struct _GtkComboBoxEntry GtkComboBoxEntry; \
- typedef struct _GtkComboBoxEntryClass GtkComboBoxEntryClass; \
- \
- struct _GtkComboBoxEntry { \
- GtkComboBoxText parent; \
- }; \
- \
- struct _GtkComboBoxEntryClass { \
- GtkComboBoxTextClass parent_class; \
- }; \
- \
- G_DEFINE_TYPE (GtkComboBoxEntry, gtk_combo_box_entry, GTK_TYPE_COMBO_BOX_TEXT)\
- \
- static GObject * \
- gtk_combo_box_entry_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_properties) \
- { \
- GObjectConstructParam *params = g_new0 (GObjectConstructParam, n_construct_properties + 1);\
- GValue val = {0}; \
- GObject *res; \
- gint ii; \
- \
- for (ii = 0; ii < n_construct_properties; ii++) { \
- params[ii] = construct_properties[ii]; \
- } \
- \
- g_value_init (&val, G_TYPE_BOOLEAN); \
- g_value_set_boolean (&val, TRUE); \
- \
- params[n_construct_properties].pspec = g_object_class_find_property (G_OBJECT_CLASS (gtk_combo_box_entry_parent_class), "has-entry");\
- params[n_construct_properties].value = &val; \
- \
- res = G_OBJECT_CLASS (gtk_combo_box_entry_parent_class)->constructor (type, n_construct_properties + 1, params);\
- \
- g_free (params); \
- return res; \
- } \
- static void gtk_combo_box_entry_init (GtkComboBoxEntry *cbt) {} \
- static void gtk_combo_box_entry_class_init (GtkComboBoxEntryClass *kl) \
- { \
- GObjectClass *object_class = G_OBJECT_CLASS (kl); \
- object_class->constructor = gtk_combo_box_entry_constructor; \
- }
-#else
-#define gtk_combo_box_set_entry_text_column \
- gtk_combo_box_entry_set_text_column
-#endif
-
#if GTK_CHECK_VERSION (2,90,5)
/* Recreate GdkRegion until we drop GTK2 compatibility. */
diff --git a/filter/e-filter-datespec.c b/filter/e-filter-datespec.c
index db251f3..2c79899 100644
--- a/filter/e-filter-datespec.c
+++ b/filter/e-filter-datespec.c
@@ -288,9 +288,6 @@ button_clicked (GtkButton *button, EFilterDatespec *fds)
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
p->notebook_type = e_builder_get_widget (builder, "notebook_type");
p->combobox_type = e_builder_get_widget (builder, "combobox_type");
diff --git a/filter/e-rule-context.c b/filter/e-rule-context.c
index 2ec6253..f28945d 100644
--- a/filter/e-rule-context.c
+++ b/filter/e-rule-context.c
@@ -774,9 +774,6 @@ e_rule_context_add_rule_gui (ERuleContext *context,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
gtk_window_set_title ((GtkWindow *) dialog, title);
gtk_window_set_default_size ((GtkWindow *) dialog, 600, 400);
diff --git a/filter/e-rule-editor.c b/filter/e-rule-editor.c
index 68c005c..5145c16 100644
--- a/filter/e-rule-editor.c
+++ b/filter/e-rule-editor.c
@@ -263,9 +263,6 @@ rule_add (GtkWidget *widget, ERuleEditor *editor)
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (editor->dialog, "has-separator", FALSE, NULL);
-#endif
gtk_window_set_title ((GtkWindow *) editor->dialog, _("Add Rule"));
gtk_window_set_default_size (GTK_WINDOW (editor->dialog), 650, 400);
@@ -352,9 +349,6 @@ rule_edit (GtkWidget *widget, ERuleEditor *editor)
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (editor->dialog, "has-separator", FALSE, NULL);
-#endif
gtk_window_set_title ((GtkWindow *) editor->dialog, _("Edit Rule"));
gtk_window_set_default_size (GTK_WINDOW (editor->dialog), 650, 400);
@@ -850,9 +844,6 @@ e_rule_editor_construct (ERuleEditor *editor,
G_CALLBACK (editor_response), editor);
rule_editor_set_source (editor, source);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (editor, "has-separator", FALSE, NULL);
-#endif
gtk_dialog_add_buttons ((GtkDialog *) editor,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,
diff --git a/mail/e-mail-label-dialog.c b/mail/e-mail-label-dialog.c
index 9a9f210..598a8d3 100644
--- a/mail/e-mail-label-dialog.c
+++ b/mail/e-mail-label-dialog.c
@@ -194,9 +194,6 @@ mail_label_dialog_init (EMailLabelDialog *dialog)
GTK_DIALOG (dialog),
GTK_STOCK_OK, GTK_RESPONSE_OK);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
container = content_area;
diff --git a/modules/calendar/e-cal-attachment-handler.c b/modules/calendar/e-cal-attachment-handler.c
index a9f5237..8fea91f 100644
--- a/modules/calendar/e-cal-attachment-handler.c
+++ b/modules/calendar/e-cal-attachment-handler.c
@@ -264,9 +264,6 @@ attachment_handler_run_dialog (GtkWindow *parent,
GTK_DIALOG (dialog), widget, GTK_RESPONSE_OK);
gtk_widget_show (widget);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
gtk_window_set_default_size (GTK_WINDOW (dialog), 300, 400);
container = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
diff --git a/modules/mailto-handler/evolution-mailto-handler.c b/modules/mailto-handler/evolution-mailto-handler.c
index 01d1bd2..4170dfc 100644
--- a/modules/mailto-handler/evolution-mailto-handler.c
+++ b/modules/mailto-handler/evolution-mailto-handler.c
@@ -117,9 +117,6 @@ mailto_handler_prompt (EMailtoHandler *extension)
GTK_STOCK_YES, GTK_RESPONSE_YES,
NULL);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
diff --git a/plugins/backup-restore/backup.c b/plugins/backup-restore/backup.c
index 555eebe..9334de3 100644
--- a/plugins/backup-restore/backup.c
+++ b/plugins/backup-restore/backup.c
@@ -709,9 +709,6 @@ main (gint argc, gchar **argv)
GTK_RESPONSE_REJECT,
NULL);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (progress_dialog, "has-separator", FALSE, NULL);
-#endif
gtk_container_set_border_width (GTK_CONTAINER (progress_dialog), 12);
action_area = gtk_dialog_get_action_area (
diff --git a/plugins/mark-all-read/mark-all-read.c b/plugins/mark-all-read/mark-all-read.c
index 62b8102..5abfd0c 100644
--- a/plugins/mark-all-read/mark-all-read.c
+++ b/plugins/mark-all-read/mark-all-read.c
@@ -111,9 +111,6 @@ prompt_user (gboolean has_subfolders)
dialog = gtk_dialog_new ();
widget = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
gtk_widget_hide (widget);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
gtk_window_set_title (GTK_WINDOW (dialog), "");
g_signal_connect (
dialog, "map",
diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c
index 89bec64..5d8a0ee 100644
--- a/plugins/publish-calendar/url-editor-dialog.c
+++ b/plugins/publish-calendar/url-editor-dialog.c
@@ -381,9 +381,6 @@ url_editor_dialog_construct (UrlEditorDialog *dialog)
gtk_container_add (GTK_CONTAINER (content_area), toplevel);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 6);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
dialog->cancel = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
dialog->ok = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_OK, GTK_RESPONSE_OK);
diff --git a/shell/main.c b/shell/main.c
index 7f2bd06..ad383bc 100644
--- a/shell/main.c
+++ b/shell/main.c
@@ -171,9 +171,6 @@ show_development_warning (void)
gtk_dialog_add_button (
GTK_DIALOG (warning_dialog),
GTK_STOCK_OK, GTK_RESPONSE_OK);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (warning_dialog, "has-separator", FALSE, NULL);
-#endif
action_area = gtk_dialog_get_action_area (GTK_DIALOG (warning_dialog));
content_area = gtk_dialog_get_content_area (GTK_DIALOG (warning_dialog));
diff --git a/widgets/menus/gal-view-instance-save-as-dialog.c b/widgets/menus/gal-view-instance-save-as-dialog.c
index 04b00a0..8cacf1a 100644
--- a/widgets/menus/gal-view-instance-save-as-dialog.c
+++ b/widgets/menus/gal-view-instance-save-as-dialog.c
@@ -247,9 +247,6 @@ gal_view_instance_save_as_dialog_init (GalViewInstanceSaveAsDialog *dialog)
/* TODO: add position/size saving/restoring */
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_window_set_default_size (GTK_WINDOW (dialog), 300, 360);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
gtk_dialog_add_buttons (
GTK_DIALOG (dialog),
diff --git a/widgets/misc/e-attachment-dialog.c b/widgets/misc/e-attachment-dialog.c
index 24fe7b4..cb50421 100644
--- a/widgets/misc/e-attachment-dialog.c
+++ b/widgets/misc/e-attachment-dialog.c
@@ -306,9 +306,6 @@ e_attachment_dialog_init (EAttachmentDialog *dialog)
gtk_window_set_title (
GTK_WINDOW (dialog), _("Attachment Properties"));
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
container = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
diff --git a/widgets/misc/e-charset-combo-box.c b/widgets/misc/e-charset-combo-box.c
index 5f542a6..e2cf06e 100644
--- a/widgets/misc/e-charset-combo-box.c
+++ b/widgets/misc/e-charset-combo-box.c
@@ -103,9 +103,6 @@ charset_combo_box_run_dialog (ECharsetComboBox *combo_box)
dialog = GTK_DIALOG (widget);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 12);
diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c
index a1a385c..a7425ff 100644
--- a/widgets/misc/e-dateedit.c
+++ b/widgets/misc/e-dateedit.c
@@ -513,6 +513,7 @@ static void
create_children (EDateEdit *dedit)
{
EDateEditPrivate *priv;
+ GtkCellRenderer *cell;
ECalendar *calendar;
GtkWidget *frame, *arrow;
GtkWidget *vbox, *bbox;
@@ -571,29 +572,21 @@ create_children (EDateEdit *dedit)
"widget \"*.e-dateedit-timecombo\" style \"e-dateedit-timecombo-style\"");
time_store = gtk_list_store_new (1, G_TYPE_STRING);
-#if GTK_CHECK_VERSION(2,23,0)
priv->time_combo = g_object_new (
GTK_TYPE_COMBO_BOX_TEXT,
"model", time_store,
"has-entry", TRUE,
"entry-text-column", 0,
NULL);
-
- {
- GtkCellRenderer *cell;
+ g_object_unref (time_store);
gtk_cell_layout_clear (GTK_CELL_LAYOUT (priv->time_combo));
cell = gtk_cell_renderer_text_new ();
- gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (priv->time_combo), cell, TRUE);
- gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (priv->time_combo), cell, "text", 0, NULL);
- }
-
-#else
- priv->time_combo = gtk_combo_box_entry_new_with_model (
- GTK_TREE_MODEL (time_store), 0);
-#endif
- g_object_unref (time_store);
+ gtk_cell_layout_pack_start (
+ GTK_CELL_LAYOUT (priv->time_combo), cell, TRUE);
+ gtk_cell_layout_set_attributes (
+ GTK_CELL_LAYOUT (priv->time_combo), cell, "text", 0, NULL);
child = gtk_bin_get_child (GTK_BIN (priv->time_combo));
diff --git a/widgets/misc/e-signature-script-dialog.c b/widgets/misc/e-signature-script-dialog.c
index 1d514f5..1364737 100644
--- a/widgets/misc/e-signature-script-dialog.c
+++ b/widgets/misc/e-signature-script-dialog.c
@@ -242,9 +242,6 @@ e_signature_script_dialog_init (ESignatureScriptDialog *dialog)
GTK_DIALOG (dialog),
GTK_STOCK_SAVE, GTK_RESPONSE_OK);
-#if !GTK_CHECK_VERSION(2,90,7)
- g_object_set (dialog, "has-separator", FALSE, NULL);
-#endif
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
container = content_area;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]