Commit c5b37dd8 authored by Alexander Schwinn's avatar Alexander Schwinn

Used G_GNUC_BEGIN_IGNORE_DEPRECATIONS on gtk_action and dependencies.

So far there is no good solution to replace them.
The official workaround for pictured menu items would add an ugly left
padding.
So we will keep the current code as long as there is no other option.
parent 9f90645a
......@@ -230,6 +230,7 @@ thunar_abstract_icon_view_init (ThunarAbstractIconView *abstract_icon_view)
gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (view), THUNAR_STANDARD_VIEW (abstract_icon_view)->name_renderer,
"text", THUNAR_COLUMN_NAME);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* setup the abstract icon view actions */
gtk_action_group_add_actions (THUNAR_STANDARD_VIEW (abstract_icon_view)->action_group,
action_entries, G_N_ELEMENTS (action_entries),
......@@ -240,6 +241,7 @@ thunar_abstract_icon_view_init (ThunarAbstractIconView *abstract_icon_view)
gtk_action_group_add_radio_actions (THUNAR_STANDARD_VIEW (abstract_icon_view)->action_group, order_action_entries,
G_N_ELEMENTS (order_action_entries), GTK_SORT_ASCENDING,
G_CALLBACK (thunar_abstract_icon_view_action_sort), abstract_icon_view);
G_GNUC_END_IGNORE_DEPRECATIONS
/* we need to listen to sort column changes to sync the menu items */
g_signal_connect (G_OBJECT (THUNAR_STANDARD_VIEW (abstract_icon_view)->model), "sort-column-changed",
......@@ -280,8 +282,10 @@ thunar_abstract_icon_view_connect_ui_manager (ThunarStandardView *standard_view,
ThunarAbstractIconView *abstract_icon_view = THUNAR_ABSTRACT_ICON_VIEW (standard_view);
GError *error = NULL;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
abstract_icon_view->priv->ui_merge_id = gtk_ui_manager_add_ui_from_string (ui_manager, thunar_abstract_icon_view_ui,
thunar_abstract_icon_view_ui_length, &error);
G_GNUC_END_IGNORE_DEPRECATIONS
if (G_UNLIKELY (abstract_icon_view->priv->ui_merge_id == 0))
{
g_error ("Failed to merge ThunarAbstractIconView menus: %s", error->message);
......@@ -295,7 +299,9 @@ static void
thunar_abstract_icon_view_disconnect_ui_manager (ThunarStandardView *standard_view,
GtkUIManager *ui_manager)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_ui_manager_remove_ui (ui_manager, THUNAR_ABSTRACT_ICON_VIEW (standard_view)->priv->ui_merge_id);
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -415,6 +421,7 @@ thunar_abstract_icon_view_highlight_path (ThunarStandardView *standard_view,
static GtkAction*
thunar_abstract_icon_view_gesture_action (ThunarAbstractIconView *abstract_icon_view)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (abstract_icon_view->priv->gesture_start_y - abstract_icon_view->priv->gesture_current_y > 40
&& ABS (abstract_icon_view->priv->gesture_start_x - abstract_icon_view->priv->gesture_current_x) < 40)
{
......@@ -435,6 +442,7 @@ thunar_abstract_icon_view_gesture_action (ThunarAbstractIconView *abstract_icon_
{
return gtk_ui_manager_get_action (THUNAR_STANDARD_VIEW (abstract_icon_view)->ui_manager, "/main-menu/view-menu/reload");
}
G_GNUC_END_IGNORE_DEPRECATIONS
return NULL;
}
......@@ -449,6 +457,7 @@ thunar_abstract_icon_view_action_sort (GtkAction *action,
GtkSortType order;
gint column;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* query the new sort column id */
action = gtk_action_group_get_action (standard_view->action_group, "sort-by-name");
column = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
......@@ -456,6 +465,7 @@ thunar_abstract_icon_view_action_sort (GtkAction *action,
/* query the new sort order */
action = gtk_action_group_get_action (standard_view->action_group, "sort-ascending");
order = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* apply the new settings */
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (standard_view->model), column, order);
......@@ -546,10 +556,12 @@ thunar_abstract_icon_view_button_press_event (ExoIconView *view,
in_tab = !in_tab;
action_name = in_tab ? "open-in-new-tab" : "open-in-new-window";
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* emit the action */
action = thunar_gtk_ui_manager_get_action_by_name (THUNAR_STANDARD_VIEW (abstract_icon_view)->ui_manager, action_name);
if (G_LIKELY (action != NULL))
gtk_action_activate (action);
G_GNUC_END_IGNORE_DEPRECATIONS
/* release the file reference */
g_object_unref (G_OBJECT (file));
......@@ -597,8 +609,10 @@ thunar_abstract_icon_view_button_release_event (ExoIconView *view,
/* run the selected action (if any) */
action = thunar_abstract_icon_view_gesture_action (abstract_icon_view);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
if (G_LIKELY (action != NULL))
gtk_action_activate (action);
G_GNUC_END_IGNORE_DEPRECATIONS
/* unregister the "expose-event" handler */
g_signal_handler_disconnect (G_OBJECT (view), abstract_icon_view->priv->gesture_expose_id);
......@@ -749,10 +763,12 @@ thunar_abstract_icon_view_item_activated (ExoIconView *view,
exo_icon_view_unselect_all (view);
exo_icon_view_select_path (view, path);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* emit the "open" action */
action = thunar_gtk_ui_manager_get_action_by_name (THUNAR_STANDARD_VIEW (abstract_icon_view)->ui_manager, "open");
if (G_LIKELY (action != NULL))
gtk_action_activate (action);
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -767,6 +783,7 @@ thunar_abstract_icon_view_sort_column_changed (GtkTreeSortable *sortable,
if (gtk_tree_sortable_get_sort_column_id (sortable, &column, &order))
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* apply the new sort column */
action = gtk_action_group_get_action (THUNAR_STANDARD_VIEW (abstract_icon_view)->action_group, "sort-by-name");
gtk_radio_action_set_current_value (GTK_RADIO_ACTION (action), column);
......@@ -774,6 +791,7 @@ thunar_abstract_icon_view_sort_column_changed (GtkTreeSortable *sortable,
/* apply the new sort order */
action = gtk_action_group_get_action (THUNAR_STANDARD_VIEW (abstract_icon_view)->action_group, "sort-ascending");
gtk_radio_action_set_current_value (GTK_RADIO_ACTION (action), order);
G_GNUC_END_IGNORE_DEPRECATIONS
}
}
......
......@@ -86,6 +86,7 @@ thunar_component_class_init (gpointer klass)
THUNARX_TYPE_FILE_INFO_LIST,
EXO_PARAM_READWRITE));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/**
* ThunarComponent:ui-manager:
*
......@@ -99,6 +100,7 @@ thunar_component_class_init (gpointer klass)
"ui-manager",
GTK_TYPE_UI_MANAGER,
EXO_PARAM_READWRITE));
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -198,7 +200,9 @@ thunar_component_set_ui_manager (ThunarComponent *component,
GtkUIManager *ui_manager)
{
_thunar_return_if_fail (THUNAR_IS_COMPONENT (component));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (ui_manager == NULL || GTK_IS_UI_MANAGER (ui_manager));
G_GNUC_END_IGNORE_DEPRECATIONS
(*THUNAR_COMPONENT_GET_IFACE (component)->set_ui_manager) (component, ui_manager);
}
......
......@@ -204,10 +204,12 @@ thunar_details_view_init (ThunarDetailsView *details_view)
*/
g_signal_connect (G_OBJECT (details_view), "notify::zoom-level", G_CALLBACK (thunar_details_view_zoom_level_changed), NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* setup the details view actions */
gtk_action_group_add_actions (THUNAR_STANDARD_VIEW (details_view)->action_group,
action_entries, G_N_ELEMENTS (action_entries),
GTK_WIDGET (details_view));
G_GNUC_END_IGNORE_DEPRECATIONS
/* create the tree view to embed */
tree_view = exo_tree_view_new ();
......@@ -404,7 +406,6 @@ thunar_details_view_get_accessible (GtkWidget *widget)
}
static void
thunar_details_view_connect_ui_manager (ThunarStandardView *standard_view,
GtkUIManager *ui_manager)
......@@ -412,8 +413,10 @@ thunar_details_view_connect_ui_manager (ThunarStandardView *standard_view,
ThunarDetailsView *details_view = THUNAR_DETAILS_VIEW (standard_view);
GError *error = NULL;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
details_view->ui_merge_id = gtk_ui_manager_add_ui_from_string (ui_manager, thunar_details_view_ui,
thunar_details_view_ui_length, &error);
G_GNUC_END_IGNORE_DEPRECATIONS
if (G_UNLIKELY (details_view->ui_merge_id == 0))
{
g_error ("Failed to merge ThunarDetailsView menus: %s", error->message);
......@@ -427,7 +430,9 @@ static void
thunar_details_view_disconnect_ui_manager (ThunarStandardView *standard_view,
GtkUIManager *ui_manager)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_ui_manager_remove_ui (ui_manager, THUNAR_DETAILS_VIEW (standard_view)->ui_merge_id);
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -782,9 +787,11 @@ thunar_details_view_button_press_event (GtkTreeView *tree_view,
action = thunar_gtk_ui_manager_get_action_by_name (THUNAR_STANDARD_VIEW (details_view)->ui_manager, action_name);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* emit the action */
if (G_LIKELY (action != NULL))
gtk_action_activate (action);
G_GNUC_END_IGNORE_DEPRECATIONS
/* release the file reference */
g_object_unref (G_OBJECT (file));
......@@ -835,10 +842,12 @@ thunar_details_view_row_activated (GtkTreeView *tree_view,
gtk_tree_selection_unselect_all (selection);
gtk_tree_selection_select_path (selection, path);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* emit the "open" action */
action = thunar_gtk_ui_manager_get_action_by_name (THUNAR_STANDARD_VIEW (details_view)->ui_manager, "open");
if (G_LIKELY (action != NULL))
gtk_action_activate (action);
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -910,7 +919,9 @@ thunar_details_view_action_setup_columns (GtkAction *action,
ThunarDetailsView *details_view)
{
_thunar_return_if_fail (THUNAR_IS_DETAILS_VIEW (details_view));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* popup the column editor dialog */
thunar_show_column_editor (details_view);
......
......@@ -46,6 +46,7 @@ thunar_gtk_action_set_tooltip (GtkAction *action,
const gchar *format,
...)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
va_list var_args;
gchar *tooltip;
......@@ -62,6 +63,7 @@ thunar_gtk_action_set_tooltip (GtkAction *action,
/* release the tooltip */
g_free (tooltip);
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -80,6 +82,7 @@ thunar_gtk_action_group_set_action_sensitive (GtkActionGroup *action_group,
const gchar *action_name,
gboolean sensitive)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GtkAction *action;
_thunar_return_if_fail (GTK_IS_ACTION_GROUP (action_group));
......@@ -90,6 +93,7 @@ thunar_gtk_action_group_set_action_sensitive (GtkActionGroup *action_group,
/* apply the sensitivity to the action */
gtk_action_set_sensitive (action, sensitive);
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -174,6 +178,7 @@ thunar_gtk_ui_manager_get_action_by_name (GtkUIManager *ui_manager,
GtkAction *action;
GList *lp;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_val_if_fail (GTK_IS_UI_MANAGER (ui_manager), NULL);
_thunar_return_val_if_fail (action_name != NULL, NULL);
......@@ -184,6 +189,7 @@ thunar_gtk_ui_manager_get_action_by_name (GtkUIManager *ui_manager,
if (G_LIKELY (action != NULL))
return action;
}
G_GNUC_END_IGNORE_DEPRECATIONS
return NULL;
}
......
......@@ -47,7 +47,9 @@ struct _ThunarHistoryAction
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
G_DEFINE_TYPE (ThunarHistoryAction, thunar_history_action, GTK_TYPE_ACTION)
G_GNUC_END_IGNORE_DEPRECATIONS
......@@ -56,7 +58,9 @@ thunar_history_action_class_init (ThunarHistoryActionClass *klass)
{
GtkActionClass *gtkaction_class;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtkaction_class = GTK_ACTION_CLASS (klass);
G_GNUC_END_IGNORE_DEPRECATIONS
gtkaction_class->create_tool_item = thunar_history_action_create_tool_item;
/**
......@@ -148,8 +152,10 @@ thunar_history_action_button_release_event (GtkWidget *toggle_button,
g_source_remove (history_action->popup_delay);
history_action->popup_delay = 0;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* activate event */
gtk_action_activate (GTK_ACTION (history_action));
G_GNUC_END_IGNORE_DEPRECATIONS
}
}
else
......@@ -205,8 +211,10 @@ thunar_history_action_activate (GtkWidget *toggle_button,
_thunar_return_if_fail (GTK_IS_TOGGLE_BUTTON (toggle_button));
_thunar_return_if_fail (THUNAR_IS_HISTORY_ACTION (history_action));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* activate event (only key events trigger this function) */
gtk_action_activate (GTK_ACTION (history_action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* activate, so the code deactivates a bit later... */
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle_button), TRUE);
......@@ -226,9 +234,11 @@ thunar_history_action_toolbar_configured (GtkWidget *tool_item,
icon = gtk_bin_get_child (GTK_BIN (toggle_button));
action = g_object_get_data (G_OBJECT (toggle_button), I_("thunar-history-action"));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_image_set_from_icon_name (GTK_IMAGE (icon),
gtk_action_get_icon_name (action),
gtk_tool_item_get_icon_size (GTK_TOOL_ITEM (tool_item)));
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -253,8 +263,10 @@ thunar_history_action_create_tool_item (GtkAction *action)
gtk_button_set_focus_on_click (GTK_BUTTON (button), FALSE);
gtk_widget_show (button);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
icon = gtk_image_new_from_icon_name (gtk_action_get_icon_name (action),
gtk_tool_item_get_icon_size (GTK_TOOL_ITEM (tool_item)));
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_container_add (GTK_CONTAINER (button), icon);
gtk_widget_show (icon);
......
......@@ -121,6 +121,7 @@ thunar_history_class_init (ThunarHistoryClass *klass)
thunar_history_display_name_quark = g_quark_from_static_string ("thunar-history-display-name");
thunar_history_gfile_quark = g_quark_from_static_string ("thunar-history-gfile");
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/**
* ThunarHistory::action-group:
*
......@@ -134,6 +135,7 @@ thunar_history_class_init (ThunarHistoryClass *klass)
"action-group",
GTK_TYPE_ACTION_GROUP,
EXO_PARAM_READWRITE));
G_GNUC_END_IGNORE_DEPRECATIONS
/**
* ThunarHistory::current-directory:
......@@ -163,13 +165,17 @@ thunar_history_init (ThunarHistory *history)
history->action_back = thunar_history_action_new ("back", _("Back"), _("Go to the previous visited folder"), "go-previous-symbolic");
g_signal_connect (G_OBJECT (history->action_back), "activate", G_CALLBACK (thunar_history_action_back), history);
g_signal_connect (G_OBJECT (history->action_back), "show-menu", G_CALLBACK (thunar_history_show_menu), history);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_action_set_sensitive (history->action_back, FALSE);
G_GNUC_END_IGNORE_DEPRECATIONS
/* create the "forward" action */
history->action_forward = thunar_history_action_new ("forward", _("Forward"), _("Go to the next visited folder"), "go-next-symbolic");
g_signal_connect (G_OBJECT (history->action_forward), "activate", G_CALLBACK (thunar_history_action_forward), history);
g_signal_connect (G_OBJECT (history->action_forward), "show-menu", G_CALLBACK (thunar_history_show_menu), history);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_action_set_sensitive (history->action_forward, FALSE);
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -314,7 +320,9 @@ thunar_history_set_current_directory (ThunarNavigator *navigator,
else
{
/* clear the "forward" list */
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_action_set_sensitive (history->action_forward, FALSE);
G_GNUC_END_IGNORE_DEPRECATIONS
g_slist_free_full (history->forward_list, g_object_unref);
history->forward_list = NULL;
......@@ -323,7 +331,9 @@ thunar_history_set_current_directory (ThunarNavigator *navigator,
{
gfile = thunar_history_get_gfile (history->current_directory);
history->back_list = g_slist_prepend (history->back_list, gfile);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_action_set_sensitive (history->action_back, TRUE);
G_GNUC_END_IGNORE_DEPRECATIONS
g_object_unref (history->current_directory);
}
......@@ -445,9 +455,11 @@ thunar_history_go_back (ThunarHistory *history,
update_actions:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* update the sensitivity of the actions */
gtk_action_set_sensitive (history->action_back, (history->back_list != NULL));
gtk_action_set_sensitive (history->action_forward, (history->forward_list != NULL));
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -524,9 +536,11 @@ thunar_history_go_forward (ThunarHistory *history,
update_actions:
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* update the sensitivity of the actions */
gtk_action_set_sensitive (history->action_back, (history->back_list != NULL));
gtk_action_set_sensitive (history->action_forward, (history->forward_list != NULL));
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -535,7 +549,9 @@ static void
thunar_history_action_back (GtkAction *action,
ThunarHistory *history)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
_thunar_return_if_fail (THUNAR_IS_HISTORY (history));
/* go back one step */
......@@ -565,7 +581,9 @@ static void
thunar_history_action_forward (GtkAction *action,
ThunarHistory *history)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
_thunar_return_if_fail (THUNAR_IS_HISTORY (history));
/* go forward one step */
......@@ -608,7 +626,9 @@ thunar_history_show_menu (GtkAction *action,
const gchar *icon_name;
gchar *parse_name;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_MENU_SHELL (menu));
_thunar_return_if_fail (THUNAR_IS_HISTORY (history));
......@@ -718,6 +738,7 @@ static void
thunar_history_set_action_group (ThunarHistory *history,
GtkActionGroup *action_group)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (THUNAR_IS_HISTORY (history));
_thunar_return_if_fail (action_group == NULL || GTK_IS_ACTION_GROUP (action_group));
......@@ -746,6 +767,7 @@ thunar_history_set_action_group (ThunarHistory *history,
/* notify listeners */
g_object_notify (G_OBJECT (history), "action-group");
G_GNUC_END_IGNORE_DEPRECATIONS
}
......@@ -758,7 +780,9 @@ thunar_history_copy (ThunarHistory *history,
GSList *lp;
_thunar_return_val_if_fail (history == NULL || THUNAR_IS_HISTORY (history), NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_val_if_fail (action_group == NULL || GTK_IS_ACTION_GROUP (action_group), NULL);
G_GNUC_END_IGNORE_DEPRECATIONS
if (G_UNLIKELY (history == NULL))
return NULL;
......@@ -779,9 +803,11 @@ thunar_history_copy (ThunarHistory *history,
for (lp = history->forward_list; lp != NULL; lp = lp->next)
copy->forward_list = g_slist_append (copy->forward_list, g_object_ref (G_OBJECT (lp->data)));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* update the sensitivity of the actions */
gtk_action_set_sensitive (copy->action_back, (copy->back_list != NULL));
gtk_action_set_sensitive (copy->action_forward, (copy->forward_list != NULL));
G_GNUC_END_IGNORE_DEPRECATIONS
return copy;
}
......
This diff is collapsed.
......@@ -265,11 +265,13 @@ thunar_location_buttons_init (ThunarLocationButtons *buttons)
{
GtkWidget *icon;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* setup the action group for the location buttons */
buttons->action_group = gtk_action_group_new ("ThunarLocationButtons");
gtk_action_group_set_accel_group (buttons->action_group, gtk_accel_group_new ());
gtk_action_group_set_translation_domain (buttons->action_group, GETTEXT_PACKAGE);
gtk_action_group_add_actions (buttons->action_group, action_entries, G_N_ELEMENTS (action_entries), buttons);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_widget_set_has_window (GTK_WIDGET (buttons), FALSE);
gtk_widget_set_redraw_on_allocate (GTK_WIDGET (buttons), FALSE);
......@@ -1247,6 +1249,7 @@ thunar_location_buttons_context_menu (ThunarLocationButton *button,
/* grab a reference on the clipboard manager for this display */
clipboard = thunar_clipboard_manager_get_for_display (gtk_widget_get_display (GTK_WIDGET (buttons)));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* setup the "Open" action */
action = gtk_action_group_get_action (buttons->action_group, "location-buttons-open");
thunar_gtk_action_set_tooltip (action, _("Open \"%s\" in this window"), display_name);
......@@ -1279,11 +1282,13 @@ thunar_location_buttons_context_menu (ThunarLocationButton *button,
gtk_action_set_visible (action, (thunar_file_is_root (file) && thunar_file_is_trashed (file)));
gtk_action_set_sensitive (action, (thunar_file_get_size (file) > 0));
gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_action_create_menu_item (action));
G_GNUC_END_IGNORE_DEPRECATIONS
item = gtk_separator_menu_item_new ();
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show (item);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* setup the "Paste Into Folder" action */
action = gtk_action_group_get_action (buttons->action_group, "location-buttons-paste-into-folder");
thunar_gtk_action_set_tooltip (action, _("Move or copy files previously selected by a Cut or Copy command into \"%s\""), display_name);
......@@ -1300,6 +1305,7 @@ thunar_location_buttons_context_menu (ThunarLocationButton *button,
thunar_gtk_action_set_tooltip (action, _("View the properties of the folder \"%s\""), display_name);
g_object_set_qdata_full (G_OBJECT (action), thunar_file_quark, g_object_ref (G_OBJECT (file)), (GDestroyNotify) g_object_unref);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_action_create_menu_item (action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* run the menu (takes over the floating of menu) */
thunar_gtk_menu_run (GTK_MENU (menu));
......@@ -1326,7 +1332,9 @@ thunar_location_buttons_action_create_folder (GtkAction *action,
gchar *name;
_thunar_return_if_fail (THUNAR_IS_LOCATION_BUTTONS (buttons));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* determine the directory for the action */
directory = g_object_get_qdata (G_OBJECT (action), thunar_file_quark);
......@@ -1366,7 +1374,9 @@ thunar_location_buttons_action_down_folder (GtkAction *action,
GList *lp;
_thunar_return_if_fail (THUNAR_IS_LOCATION_BUTTONS (buttons));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* lookup the active button */
for (lp = buttons->list; lp != NULL; lp = lp->next)
......@@ -1392,7 +1402,9 @@ thunar_location_buttons_action_empty_trash (GtkAction *action,
ThunarApplication *application;
_thunar_return_if_fail (THUNAR_IS_LOCATION_BUTTONS (buttons));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* launch the operation */
application = thunar_application_get ();
......@@ -1409,7 +1421,9 @@ thunar_location_buttons_action_open (GtkAction *action,
ThunarFile *directory;
_thunar_return_if_fail (THUNAR_IS_LOCATION_BUTTONS (buttons));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* determine the directory for the action */
directory = g_object_get_qdata (G_OBJECT (action), thunar_file_quark);
......@@ -1429,7 +1443,9 @@ thunar_location_buttons_action_open_in_new_tab (GtkAction *action,
ThunarFile *directory;
_thunar_return_if_fail (THUNAR_IS_LOCATION_BUTTONS (buttons));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* determine the directory for the action */
directory = g_object_get_qdata (G_OBJECT (action), thunar_file_quark);
......@@ -1450,7 +1466,9 @@ thunar_location_buttons_action_open_in_new_window (GtkAction *action
ThunarFile *directory;
_thunar_return_if_fail (THUNAR_IS_LOCATION_BUTTONS (buttons));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* determine the directory for the action */
directory = g_object_get_qdata (G_OBJECT (action), thunar_file_quark);
......@@ -1473,7 +1491,9 @@ thunar_location_buttons_action_paste_into_folder (GtkAction *action,
ThunarFile *directory;
_thunar_return_if_fail (THUNAR_IS_LOCATION_BUTTONS (buttons));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* determine the directory for the action */
directory = g_object_get_qdata (G_OBJECT (action), thunar_file_quark);
......@@ -1497,7 +1517,9 @@ thunar_location_buttons_action_properties (GtkAction *action,
GtkWidget *dialog;
_thunar_return_if_fail (THUNAR_IS_LOCATION_BUTTONS (buttons));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
/* determine the directory for the action */
directory = g_object_get_qdata (G_OBJECT (action), thunar_file_quark);
......
......@@ -51,6 +51,7 @@ action_from_menu_item (GObject *item)
"priority", &priority,
NULL);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
action = gtk_action_new (name, label, tooltip, NULL);
if (icon_name != NULL)
......@@ -59,6 +60,7 @@ action_from_menu_item (GObject *item)
}
gtk_action_set_sensitive (action, sensitive);
G_GNUC_END_IGNORE_DEPRECATIONS
g_object_set (action, "is-important", priority, NULL);
g_signal_connect_data (action, "activate",
......@@ -90,6 +92,7 @@ thunar_menu_util_add_items_to_ui_manager (GtkUIManager *ui_manager,
char *action_path;
GList *children;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* add the menu items to the UI manager */
for (lp = items; lp != NULL; lp = lp->next)
{
......@@ -124,6 +127,7 @@ thunar_menu_util_add_items_to_ui_manager (GtkUIManager *ui_manager,
thunarx_menu_item_list_free (children);
g_free (subpath);
}
G_GNUC_END_IGNORE_DEPRECATIONS
/* release the reference on item and action */
g_object_unref (G_OBJECT (lp->data));
......@@ -149,7 +153,9 @@ thunar_menu_util_add_items_to_menu (GtkWidget *menu,
{
action = action_from_menu_item (G_OBJECT (lp->data));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
item = gtk_action_create_menu_item (action);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show (item);
......
......@@ -361,6 +361,7 @@ thunar_renamer_dialog_init (ThunarRenamerDialog *renamer_dialog)
gtk_dialog_set_default_response (GTK_DIALOG (renamer_dialog), GTK_RESPONSE_ACCEPT);
gtk_widget_set_tooltip_text (button, _("Click here to actually rename the files listed above to their new names."));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* setup the action group for this dialog */
renamer_dialog->action_group = gtk_action_group_new ("ThunarRenamerDialog");
gtk_action_group_set_translation_domain (renamer_dialog->action_group, GETTEXT_PACKAGE);
......@@ -370,6 +371,7 @@ thunar_renamer_dialog_init (ThunarRenamerDialog *renamer_dialog)
renamer_dialog->ui_manager = gtk_ui_manager_new ();
gtk_ui_manager_insert_action_group (renamer_dialog->ui_manager, renamer_dialog->action_group, 0);
gtk_ui_manager_add_ui_from_string (renamer_dialog->ui_manager, thunar_renamer_dialog_ui, thunar_renamer_dialog_ui_length, NULL);
G_GNUC_END_IGNORE_DEPRECATIONS
/* connect the accelerators */
accel_group = gtk_ui_manager_get_accel_group (renamer_dialog->ui_manager);
......@@ -382,7 +384,9 @@ thunar_renamer_dialog_init (ThunarRenamerDialog *renamer_dialog)
exo_binding_new (G_OBJECT (renamer_dialog), "selected-files", G_OBJECT (renamer_dialog->launcher), "selected-files");
/* add the toolbar to the dialog */
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
toolbar = gtk_ui_manager_get_widget (renamer_dialog->ui_manager, "/toolbar");
G_GNUC_END_IGNORE_DEPRECATIONS
exo_binding_new (G_OBJECT (renamer_dialog), "standalone", G_OBJECT (toolbar), "visible");
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (renamer_dialog))), toolbar, FALSE, FALSE, 0);
......@@ -859,6 +863,7 @@ thunar_renamer_dialog_context_menu (ThunarRenamerDialog *renamer_dialog)
items = thunarx_renamer_get_menu_items (renamer, GTK_WINDOW (renamer_dialog), renamer_dialog->selected_files);
}
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
/* check if we have any renamer menu items */
if (G_UNLIKELY (items != NULL))
{
......@@ -896,6 +901,7 @@ thunar_renamer_dialog_context_menu (ThunarRenamerDialog *renamer_dialog)
g_object_unref (G_OBJECT (renamer_actions));
}
G_GNUC_END_IGNORE_DEPRECATIONS
/* release the additional reference on the dialog */
g_object_unref (G_OBJECT (renamer_dialog));
}
......@@ -1032,7 +1038,9 @@ thunar_renamer_dialog_action_add_files (GtkAction *action,
GSList *lp;
gchar *uri;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
_thunar_return_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog));
/* allocate the file chooser */
......@@ -1138,7 +1146,9 @@ thunar_renamer_dialog_action_remove_files (GtkAction *action,
GList *rows;
GList *lp;
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
_thunar_return_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog));
/* determine the selected rows in the view */
......@@ -1178,7 +1188,9 @@ static void
thunar_renamer_dialog_action_clear (GtkAction *action,
ThunarRenamerDialog *renamer_dialog)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
_thunar_return_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog));
/* just clear the list of files in the model */
......@@ -1191,7 +1203,9 @@ static void
thunar_renamer_dialog_action_about (GtkAction *action,
ThunarRenamerDialog *renamer_dialog)
{
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
_thunar_return_if_fail (GTK_IS_ACTION (action));
G_GNUC_END_IGNORE_DEPRECATIONS
_thunar_return_if_fail (THUNAR_IS_RENAMER_DIALOG (renamer_dialog));
/* just popup the about dialog */
......@@ -1208,7 +1222,9 @@ thunar_renamer_dialog_action_properties (GtkAction *action,
{