/* -*- 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 *dialog; GtkWidget *prompt_label; GtkWidget *entry; GtkWidget *vbox; char *retval; g_return_val_if_fail (title != NULL, NULL); g_return_val_if_fail (prompt != NULL, NULL); dialog = gnome_dialog_new (title, GNOME_STOCK_BUTTON_OK, GNOME_STOCK_BUTTON_CANCEL, NULL); gnome_dialog_set_parent (GNOME_DIALOG (dialog), parent); gnome_dialog_set_default (GNOME_DIALOG (dialog), 0); gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE); vbox = GNOME_DIALOG (dialog)->vbox; prompt_label = gtk_label_new (prompt); gtk_box_pack_start (GTK_BOX (vbox), prompt_label, TRUE, TRUE, 0); entry = gtk_entry_new (); e_utf8_gtk_entry_set_text (GTK_ENTRY (entry), default_string); gtk_entry_select_region (GTK_ENTRY (entry), 0, -1); gtk_box_pack_start (GTK_BOX (vbox), entry, TRUE, TRUE, 0); gtk_widget_grab_focus (entry); gnome_dialog_editable_enters (GNOME_DIALOG (dialog), GTK_EDITABLE (entry)); gtk_widget_show (prompt_label); gtk_widget_show (entry); gtk_widget_show (dialog); switch (gnome_dialog_run (GNOME_DIALOG (dialog))) { case 0: /* OK. */ retval = e_utf8_gtk_entry_get_text (GTK_ENTRY (entry)); break; case -1: case 1: /* Cancel. */ retval = NULL; break; default: g_assert_not_reached (); retval = NULL; } gtk_widget_destroy (dialog); return retval; } ot/npm_and_yarn/devel/electron4/files/serve-10.1.2 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* Change e-mail address of my ports to my FreeBSD.org one.lme2007-07-131-1/+1
* - Welcome X.org 7.2 \o/.flz2007-05-202-64/+1
* - Update to 2.0.4miwi2006-12-132-4/+4
* - Update to 2.0.3miwi2006-11-303-4/+46
* - Pass maintainer to submittermiwi2006-11-021-1/+1
* - Update to 2.0.2 releaseale2006-11-013-6/+32
* Chase the GNOME X11BASE to LOCALBASE move, and fix the build with themarcus2006-10-141-2/+1
* fix on CURRENToliver2006-09-051-1/+1
* Remove USE_REINPLACE for categories starting with a Gedwin2006-05-081-1/+0
* SHA256ifyedwin2006-01-221-0/+1
* Bump PORTREVISION to chase the glib20 shared library update.marcus2005-11-051-0/+1
* Update to 2.0.1 release.ale2005-06-082-4/+3
* Bump PORTREVISION to chase the glib20 shared lib version change.marcus2005-03-121-0/+1
* Update to 2.0.0 release:ale2005-02-275-35/+25
* Bump PORTREVISIONS for all ports that depend on atk or pango to ease in themarcus2004-11-081-0/+1
* Update to 1.4.5 release.ale2004-10-163-15/+11
* Add support of WITHOUT_NLS and delete the obsolete conflictale2004-08-252-29/+35
* Update to 1.4.3 release.ale2004-05-012-3/+3
* Update to 1.4.2 release.ale2004-04-062-5/+4
* Chase the glib20 update, and bump all affected ports' PORTREVISIONs.marcus2004-04-051-1/+1
* Update to 1.4.1 release.ale2004-03-022-4/+4
* - Fix handling GNOME menu stuffkrion2004-03-023-10/+29
* Add USE_ICONV=yes.ale2004-02-221-2/+2
* - Update to 1.4.0 releaseale2004-02-229-76/+43
* Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-041-1/+1
* SIZEify.trevor2004-01-291-0/+1
* - Update to 1.3.8 releaseale2004-01-271-0/+2
* Reset maintainer on ports owned by the following committers who havekris2003-11-031-1/+1
* Allocate MAXPATHLEN size for filename manipulation to avoid riskkris2003-06-272-0/+20
* Update to 1.2.2.nork2003-04-274-24/+40
* Remove USE_GNOMENG.marcus2003-04-211-1/+0