44 " configuration page.</p>", |
44 " configuration page.</p>", |
45 ).format(filename), |
45 ).format(filename), |
46 ) |
46 ) |
47 ) |
47 ) |
48 else: |
48 else: |
49 return mimetype.split("/")[0] == "text" or mimetype in Preferences.getUI( |
49 return ( |
50 "TextMimeTypes" |
50 mimetype.split("/")[0] == "text" |
|
51 or mimetype in Preferences.getUI("TextMimeTypes") |
|
52 or EricMessageBox.yesNo( |
|
53 None, |
|
54 QCoreApplication.translate("MimeTypes", "Open File"), |
|
55 QCoreApplication.translate( |
|
56 "MimeTypes", |
|
57 "<p>The file <b>{0}</b> has the mime type <b>{1}</b>. This type" |
|
58 " is not recognized as being text to be opened in eric. Is this" |
|
59 " an editable text file?</p>" |
|
60 "<p><b>Note:</b> You may suppress this question by adding an" |
|
61 " entry to the list of known text file types on the" |
|
62 " <b>MimeTypes</b> configuration page.</p>", |
|
63 ).format(filename, mimetype), |
|
64 ) |
51 ) |
65 ) |
52 |
66 |
53 |
67 |
54 def mimeType(filename): |
68 def mimeType(filename): |
55 """ |
69 """ |