MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / Window_OpenFileDialog

Function Window_OpenFileDialog

src/Window_X11.c:1174–1197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1172}
1173
1174cc_result Window_OpenFileDialog(const struct OpenFileDialogArgs* args) {
1175 const char* const* filters = args->filters;
1176 cc_string path; char pathBuffer[1024];
1177 int i;
1178
1179 String_InitArray_NT(path, pathBuffer);
1180 String_Format1(&path, "zenity --file-selection --file-filter='%c (", args->description);
1181
1182 for (i = 0; filters[i]; i++)
1183 {
1184 if (i) String_Append(&path, ',');
1185 String_Format1(&path, "*%c", filters[i]);
1186 }
1187 String_AppendConst(&path, ") |");
1188
1189 for (i = 0; filters[i]; i++)
1190 {
1191 String_Format1(&path, " *%c", filters[i]);
1192 }
1193 String_AppendConst(&path, "'");
1194
1195 path.buffer[path.length] = '\0';
1196 return OpenSaveFileDialog(path.buffer, args->Callback, NULL);
1197}
1198
1199cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) {
1200 const char* const* titles = args->titles;

Callers

nothing calls this directly

Calls 4

String_Format1Function · 0.85
String_AppendFunction · 0.85
String_AppendConstFunction · 0.85
OpenSaveFileDialogFunction · 0.70

Tested by

no test coverage detected