edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! Paths in and out: the pickers, the URIs, the names. |
| 2 | |
| 3 | use crate::*; |
| 4 | |
| 5 | /// How a finished export announces itself. Written by `poll_export` and read |
| 6 | /// by the notice bar, which is what makes that one line clickable. |
| 7 | pub const EXPORT_DONE: &str = "Export done → "; |
| 8 | |
| 9 | /// The path as a URI the bus will take: percent-encoded, because an export |
| 10 | /// lands wherever its source lives and those directories have spaces in them. |
| 11 | /// Bytes, not chars -- a path is not required to be UTF-8. |
| 12 | pub |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | /// Shows a file in the desktop's file manager, selected: the freedesktop |
| 27 | /// interface every major one answers, asked for over the session bus. With no |
| 28 | /// file manager on the bus the folder itself is the next best thing, and with |
| 29 | /// neither there is nothing to say -- the notice the click retired was the |
| 30 | /// answer, and a machine without a desktop opener is not one a second notice |
| 31 | /// would help. Blocks on two child processes, so it is never called on the UI |
| 32 | /// thread. |
| 33 | pub |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | /// Runs the first chooser that is installed. `Some(None)` is a cancelled |
| 61 | /// dialog; `None` is a machine with no chooser at all, and what still works |
| 62 | /// without one differs per dialog, so the caller words that refusal. |
| 63 | /// |
| 64 | /// The desktop's own choosers, asked for by name because gpui 0.2 has no file |
| 65 | /// dialog of its own and none of these is worth a dependency. |
| 66 | pub |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | /// `title` is what the dialog calls itself: two buttons open this same chooser |
| 87 | /// for two different questions -- a file to import, a file to take subtitles out |
| 88 | /// of -- and a dialog titled "import" over the second one is the wrong question |
| 89 | /// answered. No extension filter on either: what can be read is the engine's |
| 90 | /// answer (`PlaybackSession::parse_subtitles` takes a container as readily as a |
| 91 | /// `.srt`), and a list of suffixes written here would hide a file edith would |
| 92 | /// have taken. |
| 93 | pub |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | /// What is said when no file dialog could open (none installed, or none that can draw here). The callers |
| 105 | /// that can take a typed path open the path sheet instead of saying this. |
| 106 | pub const NO_DIALOG: &str = "No file chooser opened here."; |
| 107 | |
| 108 | /// A folder chooser, opened on `start`. `Err` is a machine with no chooser at all. |
| 109 | pub |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | /// The save-side dialog, opened on where the export would land anyway: with no |
| 123 | /// chooser installed that default is still what gets written, so this refusal |
| 124 | /// costs the export nothing and says so. |
| 125 | pub |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | /// Where a save goes when the timeline did not come from a project file: the |
| 145 | /// media path with `.edith` for an extension, beside it like an export. A |
| 146 | /// project loaded from disk keeps its own path instead, so saving it twice |
| 147 | /// writes the same file. |
| 148 | pub |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | /// Whether a dropped or named path is a project rather than media. Exactly the |
| 155 | /// lowercase extension `save_project` writes -- anything else goes to the |
| 156 | /// demuxer, which is the one that can say what it really is. |
| 157 | pub |
| 158 | |
| 159 | |
| 160 | |
| 161 | /// A path's name without its extension, for every surface that shows what a |
| 162 | /// file *is* rather than what it is stored as (cleanse round 2: the bench's |
| 163 | /// name plates and the ledger's project identity). One place, so the two can |
| 164 | /// never come to disagree about the same file's name. |
| 165 | pub |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | /// The tail of a path, for showing. A path that is all root has none, and reads |
| 177 | /// as itself. |
| 178 | pub |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 |