From 276eb145ce96d5f75f8d3901daf6310f60ddbb81 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Tue, 22 Nov 2016 15:02:51 -0500 Subject: move to GTK+3 (>= 3.14), drop libunique, GTK+2 code, and --with-gtk build option *Remove GTK_VERSION_CHECK (3, 0, 0) and libunique selectors *Remove GTK2 and libunique specific code. *Leaves selector for specific GTK3 versions. *Remove #DEFINES for vbox/hbox previously required for GTK2 compatability *Keep vbox in caja-spatial-window.c, it is necessary for the desktop to work *spatial-window vbox issue at https://github.com/mate-desktop/caja/issues/591 --- src/file-manager/fm-ditem-page.c | 68 ++-------------------------------------- 1 file changed, 3 insertions(+), 65 deletions(-) (limited to 'src/file-manager/fm-ditem-page.c') diff --git a/src/file-manager/fm-ditem-page.c b/src/file-manager/fm-ditem-page.c index 13803597..08f87b20 100644 --- a/src/file-manager/fm-ditem-page.c +++ b/src/file-manager/fm-ditem-page.c @@ -36,10 +36,6 @@ #define MAIN_GROUP "Desktop Entry" -#if GTK_CHECK_VERSION (3, 0, 0) -#define gtk_vbox_new(X,Y) gtk_box_new(GTK_ORIENTATION_VERTICAL,Y) -#endif - typedef struct ItemEntry { const char *field; @@ -320,38 +316,21 @@ entry_focus_out_cb (GtkWidget *entry, } static GtkWidget * -#if GTK_CHECK_VERSION (3, 0, 0) build_grid (GtkWidget *container, -#else -build_table (GtkWidget *container, -#endif GKeyFile *key_file, GtkSizeGroup *label_size_group, GList *entries) { -#if GTK_CHECK_VERSION (3, 0, 0) GtkWidget *grid; -#else - GtkWidget *table; -#endif GtkWidget *label; GtkWidget *entry; GList *l; char *val; -#if GTK_CHECK_VERSION (3, 0, 0) grid = gtk_grid_new (); gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL); gtk_grid_set_row_spacing (GTK_GRID (grid), 6); gtk_grid_set_column_spacing (GTK_GRID (grid), 12); -#else - int i; - - table = gtk_table_new (g_list_length (entries) + 1, 2, FALSE); - gtk_table_set_row_spacings (GTK_TABLE (table), 6); - gtk_table_set_col_spacings (GTK_TABLE (table), 12); - i = 0; -#endif for (l = entries; l; l = l->next) { @@ -370,9 +349,8 @@ build_table (GtkWidget *container, gtk_size_group_add_widget (label_size_group, label); entry = gtk_entry_new (); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_widget_set_hexpand (entry, TRUE); -#endif + if (item_entry->localized) { @@ -393,18 +371,9 @@ build_table (GtkWidget *container, gtk_entry_set_text (GTK_ENTRY (entry), item_entry->current_value); g_free (val); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_container_add (GTK_CONTAINER (grid), label); gtk_grid_attach_next_to (GTK_GRID (grid), entry, label, GTK_POS_RIGHT, 1, 1); -#else - gtk_table_attach (GTK_TABLE (table), label, - 0, 1, i, i+1, GTK_FILL, GTK_FILL, - 0, 0); - gtk_table_attach (GTK_TABLE (table), entry, - 1, 2, i, i+1, GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, - 0, 0); -#endif g_signal_connect (entry, "activate", G_CALLBACK (entry_activate_cb), @@ -438,39 +407,21 @@ build_table (GtkWidget *container, G_CALLBACK (fm_ditem_page_exec_drag_data_received), entry); } - -#if !GTK_CHECK_VERSION (3, 0, 0) - i++; -#endif } /* append dummy row */ label = gtk_label_new (""); -#if GTK_CHECK_VERSION (3, 0, 0) gtk_container_add (GTK_CONTAINER (grid), label); gtk_size_group_add_widget (label_size_group, label); gtk_widget_show_all (grid); return grid; -#else - gtk_table_attach (GTK_TABLE (table), label, - 0, 1, i, i+1, GTK_FILL, GTK_FILL, - 0, 0); - gtk_size_group_add_widget (label_size_group, label); - - gtk_widget_show_all (table); - return table; -#endif } static void create_page (GKeyFile *key_file, GtkWidget *box) { -#if GTK_CHECK_VERSION (3, 0, 0) GtkWidget *grid; -#else - GtkWidget *table; -#endif GList *entries; GtkSizeGroup *label_size_group; char *type; @@ -507,16 +458,11 @@ create_page (GKeyFile *key_file, GtkWidget *box) { /* we only handle launchers and links */ - /* ensure that we build an empty table with a dummy row at the end */ -#if GTK_CHECK_VERSION (3, 0, 0) + /* ensure that we build an empty gid with a dummy row at the end */ goto build_grid; -#else - goto build_table; -#endif } g_free (type); -#if GTK_CHECK_VERSION (3, 0, 0) build_grid: label_size_group = g_object_get_data (G_OBJECT (box), "label-size-group"); @@ -524,15 +470,7 @@ build_grid: g_list_free (entries); gtk_box_pack_start (GTK_BOX (box), grid, FALSE, TRUE, 0); -#else -build_table: - label_size_group = g_object_get_data (G_OBJECT (box), "label-size-group"); - table = build_table (box, key_file, label_size_group, entries); - g_list_free (entries); - - gtk_box_pack_start (GTK_BOX (box), table, FALSE, TRUE, 0); -#endif gtk_widget_show_all (GTK_WIDGET (box)); } @@ -588,7 +526,7 @@ fm_ditem_page_make_box (GtkSizeGroup *label_size_group, g_assert (fm_ditem_page_should_show (files)); - box = gtk_vbox_new (FALSE, 6); + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); g_object_set_data_full (G_OBJECT (box), "label-size-group", label_size_group, (GDestroyNotify) g_object_unref); -- cgit v1.2.1