Fix browsing for souns folder in newer GTK
authorH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 3 Jun 2019 11:54:53 +0000 (13:54 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 3 Jun 2019 11:54:53 +0000 (13:54 +0200)
The file chooser would grey out all folders unless the user would first
switch the filter to 'All Files', in newer GTK versions, when choosing
a sounds or piece-image directory. The problem could be traced to the
corresponding Options specifying an empty filter string, rather than
a NULL pointer. The file chooser would be started with this filter
selected, and at some point GTK changed to interpret the empty pattern
as 'nothing' rather than 'everything'. By specifying NULL for the filter
'All files' will be the only option, and automatically selected.

dialogs.c

index 421e938..1372cfa 100644 (file)
--- a/dialogs.c
+++ b/dialogs.c
@@ -850,7 +850,7 @@ static Option soundOptions[] = {
 { 0, 0, 0, NULL, (void*) &appData.soundIcsAlarm, (char*) soundFiles, soundNames, ComboBox, N_("Alarm:") },
 { 0, 0, 0, NULL, (void*) &appData.soundChallenge, (char*) soundFiles, soundNames, ComboBox, N_("Challenge:") },
 { 0, SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, "" },
-{ 0, 0, 0, NULL, (void*) &appData.soundDirectory, "", NULL, PathName, N_("Sounds Directory:") },
+{ 0, 0, 0, NULL, (void*) &appData.soundDirectory, NULL, NULL, PathName, N_("Sounds Directory:") },
 { 0, 0, 0, NULL, (void*) &appData.soundShout, (char*) soundFiles, soundNames, ComboBox, N_("Shout:") },
 { 0, 0, 0, NULL, (void*) &appData.soundSShout, (char*) soundFiles, soundNames, ComboBox, N_("S-Shout:") },
 { 0, 0, 0, NULL, (void*) &appData.soundChannel, (char*) soundFiles, soundNames, ComboBox, N_("Channel:") },
@@ -947,7 +947,7 @@ static Option boardOptions[] = {
 { 0, 0, 0, NULL, (void*) &appData.darkBackTextureFile, ".png", (char**)(intptr_t) 1, FileName, N_("Dark-Squares Texture File:") },
 { 0, 0, 0, NULL, (void*) &appData.liteBackTextureFile, ".png", (char**)(intptr_t) 2, FileName, N_("Light-Squares Texture File:") },
 { 0, 0, 0, NULL, (void*) &appData.trueColors, "", NULL, CheckBox, N_("Use external piece bitmaps with their own colors") },
-{ 0, 0, 0, NULL, (void*) &appData.pieceDirectory, "",  (char**)(intptr_t) 3, PathName, N_("Directory with Pieces Images:") },
+{ 0, 0, 0, NULL, (void*) &appData.pieceDirectory, NULL,  (char**)(intptr_t) 3, PathName, N_("Directory with Pieces Images:") },
 { 0, 0, 0, NULL, (void*) &BoardOptionsOK, "", NULL, EndMark , "" }
 };