Commit 74eea651 authored by Matthias Clasen's avatar Matthias Clasen
Browse files

Merge branch 'button-clicked' into 'master'

Drop gtk_button_clicked

See merge request !856
parents 6e2df85e bcfff5e4
Pipeline #82705 passed with stages
in 30 minutes and 30 seconds
......@@ -1669,7 +1669,7 @@ toggle_edit (void)
static void
stop_edit (void)
{
gtk_button_clicked (GTK_BUTTON (edit_toggle));
g_signal_emit_by_name (edit_toggle, "clicked");
}
static gboolean
......
......@@ -158,7 +158,7 @@ activate_open (GSimpleAction *action,
return;
button = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "open_menubutton"));
gtk_button_clicked (GTK_BUTTON (button));
g_signal_emit_by_name (button, "clicked");
}
static void
......@@ -173,7 +173,7 @@ activate_record (GSimpleAction *action,
return;
button = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "record_button"));
gtk_button_clicked (GTK_BUTTON (button));
g_signal_emit_by_name (button, "clicked");
}
static void
......@@ -188,7 +188,7 @@ activate_lock (GSimpleAction *action,
return;
button = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "lockbutton"));
gtk_button_clicked (GTK_BUTTON (button));
g_signal_emit_by_name (button, "clicked");
}
static void
......
......@@ -537,7 +537,6 @@ gtk_button_new
gtk_button_new_with_label
gtk_button_new_with_mnemonic
gtk_button_new_from_icon_name
gtk_button_clicked
gtk_button_set_relief
gtk_button_get_relief
gtk_button_get_label
......
......@@ -236,7 +236,7 @@ gtk_button_accessible_do_action (AtkAction *action,
if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
return FALSE;
gtk_button_clicked (GTK_BUTTON (widget));
g_signal_emit_by_name (widget, "clicked");
return TRUE;
}
......
......@@ -126,7 +126,7 @@ gtk_link_button_accessible_link_do_action (AtkAction *action,
if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
return FALSE;
gtk_button_clicked (GTK_BUTTON (widget));
g_signal_emit_by_name (widget, "clicked");
return TRUE;
}
......
......@@ -646,20 +646,6 @@ gtk_button_new_with_mnemonic (const gchar *label)
return g_object_new (GTK_TYPE_BUTTON, "label", label, "use-underline", TRUE, NULL);
}
/**
* gtk_button_clicked:
* @button: The #GtkButton you want to send the signal to.
*
* Emits a #GtkButton::clicked signal to the given #GtkButton.
*/
void
gtk_button_clicked (GtkButton *button)
{
g_return_if_fail (GTK_IS_BUTTON (button));
g_signal_emit (button, button_signals[CLICKED], 0);
}
/**
* gtk_button_set_relief:
* @button: The #GtkButton you want to set relief styles of
......@@ -739,7 +725,7 @@ gtk_button_do_release (GtkButton *button,
return;
if (emit_clicked)
gtk_button_clicked (button);
g_signal_emit (button, button_signals[CLICKED], 0);
}
}
......@@ -786,7 +772,7 @@ gtk_button_finish_activate (GtkButton *button,
priv->button_down = FALSE;
if (do_it)
gtk_button_clicked (button);
g_signal_emit (button, button_signals[CLICKED], 0);
}
/**
......
......@@ -88,8 +88,6 @@ GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_button_new_from_icon_name (const gchar *icon_name);
GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_button_new_with_mnemonic (const gchar *label);
GDK_AVAILABLE_IN_ALL
void gtk_button_clicked (GtkButton *button);
GDK_AVAILABLE_IN_ALL
void gtk_button_set_relief (GtkButton *button,
......
......@@ -760,7 +760,7 @@ gtk_radio_button_clicked (GtkButton *button)
if (gtk_toggle_button_get_active (tmp_button) && (tmp_button != toggle_button))
{
gtk_button_clicked (GTK_BUTTON (tmp_button));
g_signal_emit_by_name (tmp_button, "clicked");
break;
}
}
......
......@@ -308,7 +308,7 @@ gtk_toggle_button_set_active (GtkToggleButton *toggle_button,
if (priv->active != is_active)
{
gtk_button_clicked (GTK_BUTTON (toggle_button));
g_signal_emit_by_name (toggle_button, "clicked");
g_object_notify_by_pspec (G_OBJECT (toggle_button), toggle_button_props[PROP_ACTIVE]);
}
}
......
......@@ -340,7 +340,7 @@ gtk_toggle_tool_button_set_active (GtkToggleToolButton *button,
if (button->priv->active != is_active)
{
gtk_button_clicked (GTK_BUTTON (_gtk_tool_button_get_button (GTK_TOOL_BUTTON (button))));
g_signal_emit_by_name (_gtk_tool_button_get_button (GTK_TOOL_BUTTON (button)), "clicked");
g_object_notify (G_OBJECT (button), "active");
}
}
......
......@@ -727,6 +727,12 @@ clone_image_menu_size (GtkImage *image)
return NULL;
}
static void
click_button (GtkButton *button)
{
g_signal_emit_by_name (button, "clicked");
}
static gboolean
gtk_tool_button_create_menu_proxy (GtkToolItem *item)
{
......@@ -777,7 +783,7 @@ gtk_tool_button_create_menu_proxy (GtkToolItem *item)
g_signal_connect_closure_by_id (menu_item,
g_signal_lookup ("activate", G_OBJECT_TYPE (menu_item)), 0,
g_cclosure_new_object_swap (G_CALLBACK (gtk_button_clicked),
g_cclosure_new_object_swap (G_CALLBACK (click_button),
G_OBJECT (GTK_TOOL_BUTTON (button)->priv->button)),
FALSE);
......
......@@ -1087,7 +1087,7 @@ gtk_tree_view_column_mnemonic_activate (GtkWidget *widget,
_gtk_tree_view_set_focus_column (GTK_TREE_VIEW (priv->tree_view), column);
if (priv->clickable)
gtk_button_clicked (GTK_BUTTON (priv->button));
g_signal_emit_by_name (priv->button, "clicked");
else if (gtk_widget_get_can_focus (priv->button))
gtk_widget_grab_focus (priv->button);
else
......@@ -2244,9 +2244,8 @@ gtk_tree_view_column_clicked (GtkTreeViewColumn *tree_column)
priv = tree_column->priv;
if (priv->visible &&
priv->clickable)
gtk_button_clicked (GTK_BUTTON (priv->button));
if (priv->visible && priv->clickable)
g_signal_emit_by_name (priv->button, "clicked");
}
/**
......
......@@ -111,7 +111,7 @@ main (int argc,
button2);
gtk_widget_show (window);
gtk_button_clicked (GTK_BUTTON (button));
g_signal_emit_by_name (button, "clicked");
g_timeout_add (4000, (GSourceFunc) show_error, window);
gtk_main ();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment