| 1172 | } |
| 1173 | |
| 1174 | cc_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 | |
| 1199 | cc_result Window_SaveFileDialog(const struct SaveFileDialogArgs* args) { |
| 1200 | const char* const* titles = args->titles; |
nothing calls this directly
no test coverage detected