comparison src/editors.c @ 1616:475bbae6a7a3

do not block the files sent to external editors like gimp
author nadvornik
date Sun, 31 May 2009 11:08:00 +0000
parents 1b2ddc6b2b27
children
comparison
equal deleted inserted replaced
1615:d960b1743ad8 1616:475bbae6a7a3
1285 if (!editor) return TRUE; 1285 if (!editor) return TRUE;
1286 1286
1287 return !!(editor->flags & EDITOR_DEST); 1287 return !!(editor->flags & EDITOR_DEST);
1288 } 1288 }
1289 1289
1290 gboolean editor_blocks_file(const gchar *key)
1291 {
1292 EditorDescription *editor;
1293 if (!key) return FALSE;
1294
1295 editor = g_hash_table_lookup(editors, key);
1296 if (!editor) return FALSE;
1297
1298 /* Decide if the image file should be blocked during editor execution
1299 Editors like gimp can be used long time after the original file was
1300 saved, for editing unrelated files.
1301 %f vs. %F seems to be a good heuristic to detect this kind of editors.
1302 */
1303
1304 return !(editor->flags & EDITOR_SINGLE_COMMAND);
1305 }
1306
1290 const gchar *editor_get_error_str(EditorFlags flags) 1307 const gchar *editor_get_error_str(EditorFlags flags)
1291 { 1308 {
1292 if (flags & EDITOR_ERROR_EMPTY) return _("Editor template is empty."); 1309 if (flags & EDITOR_ERROR_EMPTY) return _("Editor template is empty.");
1293 if (flags & EDITOR_ERROR_SYNTAX) return _("Editor template has incorrect syntax."); 1310 if (flags & EDITOR_ERROR_SYNTAX) return _("Editor template has incorrect syntax.");
1294 if (flags & EDITOR_ERROR_INCOMPATIBLE) return _("Editor template uses incompatible macros."); 1311 if (flags & EDITOR_ERROR_INCOMPATIBLE) return _("Editor template uses incompatible macros.");