/* -*- 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_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK); gtk_window_set_default_size (GTK_WINDOW (dialog), 275, -1); vbox = GTK_DIALOG (dialog)->vbox; prompt_label = gtk_label_new (prompt); gtk_box_pack_start (GTK_BOX (vbox), prompt_label, TRUE, TRUE, 3); 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; case GTK_RESPONSE_CANCEL: text = NULL; break; default: g_assert_not_reached (); } gtk_widget_destroy (dialog); return text; } lue='xserver-next'/>
path: root/audio
Commit message (Expand)AuthorAgeFilesLines
* Remove wrongly used QT-related plist-subs from plisttcberner2016-10-281-1/+1
* Add virtual_oss and it's graphical control panel virtual_oss_ctl.kwm2016-10-288-0/+80
* - Add LICENSEehaupt2016-10-281-4/+7
* - Add LICENSEamdmi32016-10-272-0/+20
* audio/pulseaudio-module-sndio: update to 9.0 to unbreak after r424621jbeich2016-10-272-10/+6
* The OpenSSL selection is done globally with DEFAULT_VERSIONS.mat2016-10-261-10/+3
* Cleanup USE_GITHUB usage.mat2016-10-262-5/+5
* Do not hand roll PYTHON_CMDantoine2016-10-261-1/+1
* audio/pulseaudio: update to 9.0jbeich2016-10-257-65/+51
* - Mark broken on 9.x: does not build doe to wxgtk/c++11 issuesamdmi32016-10-251-17/+8
* OPTIONS_SET/OPTIONS_UNSET are global variables, they cannot be used in ports ...mat2016-10-241-1/+0
* - Update to 3.4.2jhale2016-10-242-9/+7
* - Update to version 1.17.2mva2016-10-235-43/+29
* Convert to USES=pyqtjhale2016-10-231-6/+3
* Fix build with libc++ 3.9.0riggs2016-10-221-0/+11
* Take maintainership (part of Linphone stack)tijl2016-10-221-1/+1
* Update to 16.06jhale2016-10-222-3/+4
* Use USES=pathfix where applicable.mat2016-10-2114-54/+6
* ${RM} already has -f.mat2016-10-2121-25/+25
* Reassign makc's ports back to the pool.rakuco2016-10-203-3/+3
* audio/logitechmediaserver: replace "freebsd" with %%OPSYS%% in pkg-plistmarino2016-10-202-230/+231
* Fix pkg-plist.tijl2016-10-203-10/+11
* Fix pkg-plist.tijl2016-10-203-0/+21
* Fix build when RUNTIME option is selectedjhale2016-10-201-1/+0
* - Fix build on 9.x by propagating c++11 requirement from c++ dependencyamdmi32016-10-201-3/+3
* Add Linux CentOS 7 infrastructure ports.tijl2016-10-1970-0/+1454
* Introduce new extensible virtual categories for KDEtcberner2016-10-196-18/+6
* audio/gbsplay: Add explicit -L option for NLS LDFLAGSmarino2016-10-181-1/+1
* Update the Linphone stack:tijl2016-10-173-3/+13
* audio/logitechmediaserver: Remove patch-dbix-class-bug.diffwoodsb022016-10-152-35/+1
* - Fix ID3 option selectiondanilo2016-10-141-2/+3
* - Switch waf to verbose builds as wellamdmi32016-10-144-16/+0
* - Update to 4.4.1ehaupt2016-10-132-4/+7
* audio/rhythmbox: fix packaging with python 3.5rm2016-10-132-50/+54
* Update to version 1.10.danfe2016-10-122-3/+4
* - Update to 2.5.1amdmi32016-10-122-3/+4
* - This port is not unfetchableamdmi32016-10-111-4/+1
* - Add LICENSEamdmi32016-10-111-2/+3
* - Add LICENSEamdmi32016-10-111-3/+4
* - Add LICENSEamdmi32016-10-111-2/+5
* - Add LICENSEamdmi32016-10-111-4/+9