Commit 08862aed authored by Paolo Bacchilega's avatar Paolo Bacchilega
Browse files

removed _gtk_request_dialog_run as it is no longer used

parent f1c04321
......@@ -158,110 +158,6 @@ _gtk_message_dialog_new (GtkWindow *parent,
}
char *
_gtk_request_dialog_run (GtkWindow *parent,
GtkDialogFlags flags,
const char *message,
const char *default_value,
int max_length,
const char *no_button_text,
const char *yes_button_text)
{
GtkWidget *d;
GtkWidget *label;
GtkWidget *image;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *entry;
GtkWidget *button;
char *result = NULL;
char *stock_id = GTK_STOCK_DIALOG_QUESTION;
d = gtk_dialog_new_with_buttons ("", parent, flags, NULL);
gtk_window_set_resizable (GTK_WINDOW (d), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (d), 6);
gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (d))), 6);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (d))), 12);
/* Add label and image */
image = gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_DIALOG);
gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
label = gtk_label_new (message);
gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
gtk_label_set_selectable (GTK_LABEL (label), FALSE);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
entry = gtk_entry_new ();
gtk_entry_set_width_chars (GTK_ENTRY (entry), REQUEST_ENTRY_WIDTH_IN_CHARS);
gtk_entry_set_max_length (GTK_ENTRY (entry), max_length);
gtk_entry_set_text (GTK_ENTRY (entry), default_value);
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
hbox = gtk_hbox_new (FALSE, 6);
vbox = gtk_vbox_new (FALSE, 6);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
gtk_box_set_spacing (GTK_BOX (hbox), 12);
gtk_box_set_spacing (GTK_BOX (vbox), 6);
gtk_box_pack_start (GTK_BOX (vbox), label,
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), entry,
FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), image,
FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (hbox), vbox,
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (d))),
hbox,
FALSE, FALSE, 0);
gtk_widget_show_all (hbox);
/* Add buttons */
button = _gtk_button_new_from_stock_with_text (GTK_STOCK_CANCEL, no_button_text);
gtk_dialog_add_action_widget (GTK_DIALOG (d),
button,
GTK_RESPONSE_CANCEL);
/**/
button = _gtk_button_new_from_stock_with_text (GTK_STOCK_OK, yes_button_text);
gtk_dialog_add_action_widget (GTK_DIALOG (d),
button,
GTK_RESPONSE_YES);
/**/
gtk_dialog_set_default_response (GTK_DIALOG (d),
GTK_RESPONSE_YES);
gtk_widget_grab_focus (entry);
/* Run dialog */
if ((gtk_dialog_run (GTK_DIALOG (d)) == GTK_RESPONSE_YES) &&
(strlen (gtk_entry_get_text (GTK_ENTRY (entry))) > 0) )
/* Normalize unicode text to "NFC" form for consistency. */
result = g_utf8_normalize (gtk_entry_get_text (GTK_ENTRY (entry)),
-1,
G_NORMALIZE_NFC);
else
result = NULL;
gtk_widget_destroy (d);
return result;
}
GtkWidget*
_gtk_yesno_dialog_new (GtkWindow *parent,
GtkDialogFlags flags,
......
......@@ -47,13 +47,6 @@ _gtk_message_dialog_with_checkbutton_new (GtkWindow *parent,
const char *check_button_label,
const char *first_button_text,
...);
gchar* _gtk_request_dialog_run (GtkWindow *parent,
GtkDialogFlags flags,
const char *message,
const char *default_value,
int max_length,
const char *no_button_text,
const char *yes_button_text);
GtkWidget* _gtk_yesno_dialog_new (GtkWindow *parent,
GtkDialogFlags flags,
const char *message,
......
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