/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* e-request.c * * Copyright (C) 2000, 2001 Ximian, Inc. * * This program is free software; you can redistribute it and/or * modify it under the terms of version 2 of the GNU General Public * License as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Author: Ettore Perazzoli */ #ifdef HAVE_CONFIG_H #include #endif #include "e-request.h" #include #include #include #include #include /** * e_request_string: * @parent: parent window, or %NULL * @title: the dialog title (in the locale character set) * @prompt: the prompt (in the locale character set) * @default: default value (in UTF8) * * Request a string from the user. * * Return value: %NULL if the user cancelled the dialog, the inserted * string (in UTF8) otherwise. The string must be freed by the caller. **/ char * e_request_string (GtkWindow *parent, const char *title, const char *prompt, const char *default_string) { GtkWidget *prompt_label; char *text; GtkWidget *dialog; GtkWidget *entry; GtkWidget *vbox; g_return_val_if_fail (title != NULL, NULL); g_return_val_if_fail (prompt != NULL, NULL); dialog = gtk_dialog_new_with_buttons (title, parent, GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_MODAL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); gtk_window_set_default_size (GTK_WINDOW (dialog), 275, -1); gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); vbox = GTK_DIALOG (dialog)->vbox; prompt_label = gtk_label_new (prompt); gtk_box_pack_start (GTK_BOX (vbox), prompt_label, TRUE, TRUE, 6); gtk_box_set_spacing (GTK_BOX (vbox), 6); entry = gtk_entry_new (); gtk_entry_set_text (GTK_ENTRY (entry), default_string); gtk_editable_select_region (GTK_EDITABLE (entry), 0, -1); gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE); gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 3); gtk_widget_grab_focus (entry); gtk_widget_show (prompt_label); gtk_widget_show (entry); gtk_widget_show (dialog); switch (gtk_dialog_run (GTK_DIALOG (dialog))) { case GTK_RESPONSE_OK: text = g_strdup (gtk_entry_get_text (GTK_ENTRY (entry))); break; default: text = NULL; break; } gtk_widget_destroy (dialog); return text; } 2.2'>dependabot/npm_and_yarn/devel/electron4/files/y18n-3.2.2 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* - Update to 0.4.0.jkim2012-11-035-22/+30
* - update png to 1.5.10dinoex2012-06-011-0/+1
* - Add LDFLAGS to CONFIGURE_ENV and MAKE_ENV (as it was done with LDFLAGS)amdmi32011-09-241-2/+2
* Make portlint happy.jkim2011-08-271-3/+3
* Update to 0.3.2 and grab maintainership.jkim2011-08-273-16/+22
* - Get Rid MD5 supportmiwi2011-03-191-1/+0
* Bounce PORTREVISION for gettext-related ports. Have fun, ya'll.ade2010-05-311-1/+1
* - update to 1.4.1dinoex2010-03-281-1/+1
* - update to jpeg-8dinoex2010-02-051-1/+1
* Reset cjh due to inactivity. We hope to see him back again soon.linimon2010-01-031-1/+1
* - Switch SourceForge ports to the new File Release System: categories startin...amdmi32009-08-221-2/+1
* - bump all port that indirectly depends on libjpeg and have not yet been bump...dinoex2009-07-311-1/+1
* Bump portrevision due to upgrade of devel/gettext.edwin2008-06-061-1/+1
* - Chase libhangul updatepav2007-12-151-2/+2
* Add new .mo file (pa translation).cjh2007-06-271-0/+1
* Update to 0.3.1. It depends ko-libhangul now.cjh2007-06-242-5/+7
* - Welcome X.org 7.2 \o/.flz2007-05-202-5/+1
* Fix plist after upgrading scim to 1.4.5.ume2007-04-022-7/+5
* - Fix after objformat removalpav2007-03-291-17/+6
* Chase the GNOME X11BASE to LOCALBASE move, and fix the build with themarcus2006-10-142-2/+5
* temporarily, I mark it BROKEN in 4.x.cjh2006-08-131-0/+4
* Fix devel/libytnef[1] and others[2] after libtool commit.ade2006-02-241-1/+1
* Conversion to a single libtool environment.ade2006-02-232-1/+3
* Replace ugly "@unexec rmdir %D... 2>/dev/null || true" with @dirrmtryedwin2006-01-221-3/+3
* Update to 0.2.1.cjh2005-12-082-4/+5
* Mass-conversion to the USE_AUTOTOOLS New World Order. The code presentade2005-11-151-1/+1
* Bump PORTREVISION to chase the glib20 shared library update.marcus2005-11-051-1/+1
* SCIM updated to 1.4.2.nork2005-10-151-1/+1