Update Update. Patch from Lucas Rocha to implement save and directory

2004-09-13  Glynn Foster  <glynn.foster@sun.com>

	* THANKS: Update
	* src/about.c: Update.
	* src/fileselection.c, src/main.c, src/zenity.h:
	Patch from Lucas Rocha to implement save and
	directory selection in the file selection dialog.
	Fixes #138342.
This commit is contained in:
Glynn Foster 2004-09-13 04:56:26 +00:00 committed by Glynn Foster
parent 99c2048a45
commit 03f3e5b060
6 changed files with 77 additions and 3 deletions

View File

@ -1,3 +1,12 @@
2004-09-13 Glynn Foster <glynn.foster@sun.com>
* THANKS: Update
* src/about.c: Update.
* src/fileselection.c, src/main.c, src/zenity.h:
Patch from Lucas Rocha to implement save and
directory selection in the file selection dialog.
Fixes #138342.
2004-09-13 Glynn Foster <glynn.foster@sun.com> 2004-09-13 Glynn Foster <glynn.foster@sun.com>
* configure.in: Post release bump, for unstable * configure.in: Post release bump, for unstable

11
THANKS
View File

@ -22,6 +22,7 @@
"Tomasz Koczko <kloczek pld org pl>", "Tomasz Koczko <kloczek pld org pl>",
"Jordi Mallach <jordi sindominio net>", "Jordi Mallach <jordi sindominio net>",
"Kjartan Maraas <kmaraas gnome org>", "Kjartan Maraas <kmaraas gnome org>",
"Breda McColgan <breda mccolgan sun com>",
"Baptiste Mille-Mathias <bmm80 free fr>", "Baptiste Mille-Mathias <bmm80 free fr>",
"Buhan Milne <bgmilne linux-mandrake com>", "Buhan Milne <bgmilne linux-mandrake com>",
"Christian Monneckes <c-w-m gmx de>", "Christian Monneckes <c-w-m gmx de>",
@ -30,6 +31,7 @@
"Jan Arne Petersen <jpetersen uni-bonn de>", "Jan Arne Petersen <jpetersen uni-bonn de>",
"Kevin C Krinke <kckrinke opendoorsoftware com>", "Kevin C Krinke <kckrinke opendoorsoftware com>",
"Kristian Rietveld <kris gtk org>", "Kristian Rietveld <kris gtk org>",
"Lucas Rocha <lucasr im ufba br>",
"Christian Rose <menthos menthos com>", "Christian Rose <menthos menthos com>",
"Jakub Steiner <jimmac ximian com>", "Jakub Steiner <jimmac ximian com>",
"Luke Suchocki <gnome lukiepoo com>", "Luke Suchocki <gnome lukiepoo com>",
@ -44,6 +46,7 @@
"Taneem Ahmed <taneem bengalinux org>", "Taneem Ahmed <taneem bengalinux org>",
"Takeshi Aihana <aihana gnome gr jp>", "Takeshi Aihana <aihana gnome gr jp>",
"Amanpreet Singh Alam <amanlinux netscape net>", "Amanpreet Singh Alam <amanlinux netscape net>",
"Metin Amiroff <metin karegen com>",
"Sanlig Badral <badral openmn org>", "Sanlig Badral <badral openmn org>",
"John C Barstow <jbowtie amathaine com>", "John C Barstow <jbowtie amathaine com>",
"Aygimantas Beruka <uid0 tuxfamily org>", "Aygimantas Beruka <uid0 tuxfamily org>",
@ -56,7 +59,8 @@
"Fatih Demir <kabalak gtranslator org>", "Fatih Demir <kabalak gtranslator org>",
"Laurent Dhima <laurenti alblinux net>", "Laurent Dhima <laurenti alblinux net>",
"Paul Duffy <dubhthach frink nuigalway ie>", "Paul Duffy <dubhthach frink nuigalway ie>",
" Laszlo Dvornik <dvornik gnome hu>", "Laszlo Dvornik <dvornik gnome hu>",
"Maxim Dziumanenko <mvd mylinux com ua>",
"Francisco Javier Fernandez <serrador arrakis es>", "Francisco Javier Fernandez <serrador arrakis es>",
"Artur Flinta <aflinta cvs gnome org>", "Artur Flinta <aflinta cvs gnome org>",
"Alessio Frusciante <algol firenze linux it>", "Alessio Frusciante <algol firenze linux it>",
@ -64,7 +68,9 @@
"Pablo Gonzalo del Campo <pablodc bigfoot com>", "Pablo Gonzalo del Campo <pablodc bigfoot com>",
"Dhurba Gnawali <dhurbagnawali hotmail com>", "Dhurba Gnawali <dhurbagnawali hotmail com>",
"Sammi Gunnarsson <sammi techattack nu>", "Sammi Gunnarsson <sammi techattack nu>",
"Martin Willemoes Hansen <mwh sysrq dk>",
"Dafydd Harries <daf parnassus ath cx>", "Dafydd Harries <daf parnassus ath cx>",
"Raphael Higino <raphaelh cvs gnome org>",
"Wang Jian <lark linux net cn>", "Wang Jian <lark linux net cn>",
"Guntupalli Karunakar <karunakar freedomink org>", "Guntupalli Karunakar <karunakar freedomink org>",
"Tomas Kuliavas <tokul users sourceforge net>", "Tomas Kuliavas <tokul users sourceforge net>",
@ -72,6 +78,7 @@
"Iaki Larraaga <dooteo euskalgnu org>", "Iaki Larraaga <dooteo euskalgnu org>",
"Ole Laursen <olau hardworking dk>", "Ole Laursen <olau hardworking dk>",
"Toivo Leedjrv <toivo linux ee>", "Toivo Leedjrv <toivo linux ee>",
"David Lodge <dave cirt net>",
"Duarte Loreto <happyguy_pt hotmail com>", "Duarte Loreto <happyguy_pt hotmail com>",
"Johanna Makkonen <johanna makkonen iki fi>", "Johanna Makkonen <johanna makkonen iki fi>",
"Jordi Mallach <jordi sindominio net>", "Jordi Mallach <jordi sindominio net>",
@ -88,10 +95,12 @@
"Metin Omirov <metin karegen com>", "Metin Omirov <metin karegen com>",
"Gareth Owen <gowen72 yahoo com>", "Gareth Owen <gowen72 yahoo com>",
"Kostas Papadimas <pkst gmx net>", "Kostas Papadimas <pkst gmx net>",
"Ankit Patel <ankit redhat com>",
"Sami Pesonen <sampeson iki fi>", "Sami Pesonen <sampeson iki fi>",
"Roozbeh Pournader <roozbeh sharif edu>", "Roozbeh Pournader <roozbeh sharif edu>",
"Jarkko Ranta <jjranta cc joensuu fi>", "Jarkko Ranta <jjranta cc joensuu fi>",
"Rostislav Raykov <zbrox dir bg>", "Rostislav Raykov <zbrox dir bg>",
"Hendrik Richter <hendrik gnome de org>",
"Christian Rose <menthos menthos com>", "Christian Rose <menthos menthos com>",
"Changwoo Ryu <cwryu debian org>", "Changwoo Ryu <cwryu debian org>",
"Pablo Saratxaga <pablo mandrakesoft com>", "Pablo Saratxaga <pablo mandrakesoft com>",

View File

@ -70,6 +70,7 @@ static const gchar *author_credits[] = {
"Tomasz Koczko <kloczek pld org pl>", "Tomasz Koczko <kloczek pld org pl>",
"Jordi Mallach <jordi sindominio net>", "Jordi Mallach <jordi sindominio net>",
"Kjartan Maraas <kmaraas gnome org>", "Kjartan Maraas <kmaraas gnome org>",
"Breda McColgan <breda mccolgan sun com>",
"Baptiste Mille-Mathias <bmm80 free fr>", "Baptiste Mille-Mathias <bmm80 free fr>",
"Buhan Milne <bgmilne linux-mandrake com>", "Buhan Milne <bgmilne linux-mandrake com>",
"Christian Monneckes <c-w-m gmx de>", "Christian Monneckes <c-w-m gmx de>",
@ -78,6 +79,7 @@ static const gchar *author_credits[] = {
"Jan Arne Petersen <jpetersen uni-bonn de>", "Jan Arne Petersen <jpetersen uni-bonn de>",
"Kevin C Krinke <kckrinke opendoorsoftware com>", "Kevin C Krinke <kckrinke opendoorsoftware com>",
"Kristian Rietveld <kris gtk org>", "Kristian Rietveld <kris gtk org>",
"Lucas Rocha <lucasr im ufba br>",
"Christian Rose <menthos menthos com>", "Christian Rose <menthos menthos com>",
"Jakub Steiner <jimmac ximian com>", "Jakub Steiner <jimmac ximian com>",
"Luke Suchocki <gnome lukiepoo com>", "Luke Suchocki <gnome lukiepoo com>",
@ -92,6 +94,7 @@ static const gchar *author_credits[] = {
"Taneem Ahmed <taneem bengalinux org>", "Taneem Ahmed <taneem bengalinux org>",
"Takeshi Aihana <aihana gnome gr jp>", "Takeshi Aihana <aihana gnome gr jp>",
"Amanpreet Singh Alam <amanlinux netscape net>", "Amanpreet Singh Alam <amanlinux netscape net>",
"Metin Amiroff <metin karegen com>",
"Sanlig Badral <badral openmn org>", "Sanlig Badral <badral openmn org>",
"John C Barstow <jbowtie amathaine com>", "John C Barstow <jbowtie amathaine com>",
"Aygimantas Beruka <uid0 tuxfamily org>", "Aygimantas Beruka <uid0 tuxfamily org>",
@ -104,7 +107,8 @@ static const gchar *author_credits[] = {
"Fatih Demir <kabalak gtranslator org>", "Fatih Demir <kabalak gtranslator org>",
"Laurent Dhima <laurenti alblinux net>", "Laurent Dhima <laurenti alblinux net>",
"Paul Duffy <dubhthach frink nuigalway ie>", "Paul Duffy <dubhthach frink nuigalway ie>",
" Laszlo Dvornik <dvornik gnome hu>", "Laszlo Dvornik <dvornik gnome hu>",
"Maxim Dziumanenko <mvd mylinux com ua>",
"Francisco Javier Fernandez <serrador arrakis es>", "Francisco Javier Fernandez <serrador arrakis es>",
"Artur Flinta <aflinta cvs gnome org>", "Artur Flinta <aflinta cvs gnome org>",
"Alessio Frusciante <algol firenze linux it>", "Alessio Frusciante <algol firenze linux it>",
@ -112,7 +116,9 @@ static const gchar *author_credits[] = {
"Pablo Gonzalo del Campo <pablodc bigfoot com>", "Pablo Gonzalo del Campo <pablodc bigfoot com>",
"Dhurba Gnawali <dhurbagnawali hotmail com>", "Dhurba Gnawali <dhurbagnawali hotmail com>",
"Sammi Gunnarsson <sammi techattack nu>", "Sammi Gunnarsson <sammi techattack nu>",
"Martin Willemoes Hansen <mwh sysrq dk>",
"Dafydd Harries <daf parnassus ath cx>", "Dafydd Harries <daf parnassus ath cx>",
"Raphael Higino <raphaelh cvs gnome org>",
"Wang Jian <lark linux net cn>", "Wang Jian <lark linux net cn>",
"Guntupalli Karunakar <karunakar freedomink org>", "Guntupalli Karunakar <karunakar freedomink org>",
"Tomas Kuliavas <tokul users sourceforge net>", "Tomas Kuliavas <tokul users sourceforge net>",
@ -120,6 +126,7 @@ static const gchar *author_credits[] = {
"Iaki Larraaga <dooteo euskalgnu org>", "Iaki Larraaga <dooteo euskalgnu org>",
"Ole Laursen <olau hardworking dk>", "Ole Laursen <olau hardworking dk>",
"Toivo Leedjrv <toivo linux ee>", "Toivo Leedjrv <toivo linux ee>",
"David Lodge <dave cirt net>",
"Duarte Loreto <happyguy_pt hotmail com>", "Duarte Loreto <happyguy_pt hotmail com>",
"Johanna Makkonen <johanna makkonen iki fi>", "Johanna Makkonen <johanna makkonen iki fi>",
"Jordi Mallach <jordi sindominio net>", "Jordi Mallach <jordi sindominio net>",
@ -136,10 +143,12 @@ static const gchar *author_credits[] = {
"Metin Omirov <metin karegen com>", "Metin Omirov <metin karegen com>",
"Gareth Owen <gowen72 yahoo com>", "Gareth Owen <gowen72 yahoo com>",
"Kostas Papadimas <pkst gmx net>", "Kostas Papadimas <pkst gmx net>",
"Ankit Patel <ankit redhat com>",
"Sami Pesonen <sampeson iki fi>", "Sami Pesonen <sampeson iki fi>",
"Roozbeh Pournader <roozbeh sharif edu>", "Roozbeh Pournader <roozbeh sharif edu>",
"Jarkko Ranta <jjranta cc joensuu fi>", "Jarkko Ranta <jjranta cc joensuu fi>",
"Rostislav Raykov <zbrox dir bg>", "Rostislav Raykov <zbrox dir bg>",
"Hendrik Richter <hendrik gnome de org>",
"Christian Rose <menthos menthos com>", "Christian Rose <menthos menthos com>",
"Changwoo Ryu <cwryu debian org>", "Changwoo Ryu <cwryu debian org>",
"Pablo Saratxaga <pablo mandrakesoft com>", "Pablo Saratxaga <pablo mandrakesoft com>",

View File

@ -34,11 +34,22 @@ void zenity_fileselection (ZenityData *data, ZenityFileData *file_data)
GtkWidget *dialog; GtkWidget *dialog;
gchar *dir; gchar *dir;
gchar *basename; gchar *basename;
GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
zen_data = data; zen_data = data;
if (file_data->directory) {
if (file_data->save)
action = GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER;
else
action = GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
} else {
if (file_data->save)
action = GTK_FILE_CHOOSER_ACTION_SAVE;
}
dialog = gtk_file_chooser_dialog_new (NULL, NULL, dialog = gtk_file_chooser_dialog_new (NULL, NULL,
GTK_FILE_CHOOSER_ACTION_OPEN, action,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK, GTK_STOCK_OK, GTK_RESPONSE_OK,
NULL); NULL);

View File

@ -94,6 +94,8 @@ enum {
OPTION_INFOTEXT, OPTION_INFOTEXT,
OPTION_FILENAME, OPTION_FILENAME,
OPTION_MULTIFILE, OPTION_MULTIFILE,
OPTION_DIR,
OPTION_SAVE,
OPTION_TEXTFILENAME, OPTION_TEXTFILENAME,
OPTION_LISTTEXT, OPTION_LISTTEXT,
OPTION_COLUMN, OPTION_COLUMN,
@ -440,6 +442,24 @@ struct poptOption file_selection_options[] = {
N_("Allow multiple files to be selected"), N_("Allow multiple files to be selected"),
NULL NULL
}, },
{
"directory",
'\0',
POPT_ARG_NONE,
NULL,
OPTION_DIR,
N_("Activate directory-only selection"),
NULL
},
{
"save",
'\0',
POPT_ARG_NONE,
NULL,
OPTION_SAVE,
N_("Activate save mode"),
NULL
},
{ {
"separator", "separator",
'\0', '\0',
@ -971,6 +991,8 @@ zenity_init_parsing_options (void) {
results->calendar_data->year = 0; results->calendar_data->year = 0;
results->calendar_data->dialog_text = NULL; results->calendar_data->dialog_text = NULL;
results->file_data->multi = FALSE; results->file_data->multi = FALSE;
results->file_data->directory = FALSE;
results->file_data->save = FALSE;
results->file_data->separator = g_strdup ("|"); results->file_data->separator = g_strdup ("|");
results->text_data->editable = FALSE; results->text_data->editable = FALSE;
results->tree_data->separator = g_strdup ("|"); results->tree_data->separator = g_strdup ("|");
@ -1409,6 +1431,18 @@ zenity_parse_options_callback (poptContext ctx,
results->file_data->multi = TRUE; results->file_data->multi = TRUE;
break; break;
case OPTION_DIR:
if (results->mode != MODE_FILE)
zenity_error ("--directory", ERROR_SUPPORT);
results->file_data->directory = TRUE;
break;
case OPTION_SAVE:
if (results->mode != MODE_FILE)
zenity_error ("--save", ERROR_SUPPORT);
results->file_data->save = TRUE;
break;
case OPTION_COLUMN: case OPTION_COLUMN:
if (results->mode != MODE_LIST) if (results->mode != MODE_LIST)
zenity_error ("--column", ERROR_SUPPORT); zenity_error ("--column", ERROR_SUPPORT);

View File

@ -62,6 +62,8 @@ typedef struct {
typedef struct { typedef struct {
gchar *uri; gchar *uri;
gboolean multi; gboolean multi;
gboolean directory;
gboolean save;
gchar *separator; gchar *separator;
} ZenityFileData; } ZenityFileData;