Check-in [9f0bce8535]
Overview
| Comment: | Fallback for Gtk3 using set_text() now. Fix "href" vs "raw" format probing. | 
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive | 
| Timelines: | family | ancestors | descendants | both | trunk | 
| Files: | files | file ages | folders | 
| SHA1: | 9f0bce853564a44b0778318bafd6c0cc | 
| User & Date: | mario on 2015-04-24 21:53:39 | 
| Other Links: | manifest | tags | 
Context
| 2015-04-24 | ||
| 21:54 | Add spacing for config dialog options (indented per plugin). Narrower labels, icons now show up. Undo newline-removal for Gtk3 tooltips (work with preformatted text instead). check-in: c02e9a3ec0 user: mario tags: trunk | |
| 21:53 | Fallback for Gtk3 using set_text() now. Fix "href" vs "raw" format probing. check-in: 9f0bce8535 user: mario tags: trunk | |
| 19:22 | Add .url exporting (shallow Windows variant of .desktop files). check-in: fd963a3d9b user: mario tags: trunk | |
Changes
Modified channels/dnd.py from [aebf24e232] to [4107767093].
| ︙ | |||
| 26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | - + + - - - - - + + + + + + - + + | import action import compat2and3 # Welcome to my new blog. # # Now it's perhaps not even Gtks fault, but all the gory implementation | 
| ︙ | |||
| 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | + | 
      ("application/x-desktop", 0, 26),
      # direct srv urls
      ("text/url", 0, 15),  #@TODO: support in action.save_/convert_
      ("message/external-body", 0, 15),
      ("url/direct", 0, 15),
      # filename, file:// IRL
      ("FILE_NAME", 0, 3),
#     ("text/uri-list;x-format=xspf,pls,m3u,jspf,smil,http", 0, 4),
      ("text/uri-list", 0, 4),
      # url+comments
      ("TEXT", 0, 5),
      ("STRING", 0, 5),
      ("UTF8_STRING", 0, 5),
      ("text/plain", 0, 5),
    ]
 | 
| ︙ | |||
| 158 159 160 161 162 163 164 | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | + - - - - + + + + + + + | 
    # Target window/app requests data for offered drop
    def data_get(self, widget, context, selection, info, time):
        log.DND("sourceโout: data-get, send and convert to requested target type:", info, selection.get_target())
        # Return prepared data
        func, data = self.export_row(info, self.row)
        log.DND("data==", func, data)
        if func.find("text") >= 0:
            try:
 | 
| ︙ | |||
| 213 214 215 216 217 218 219 | 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 | + - + | 
    # -- DESTINATION, when playlist/file gets dragged into ST2 from other app --
    # Just a notification for incoming drop
    def drop(self, widget, context, x, y, time):
        log.DND("destโin: drop-probing, possible targets:", context.targets)
        # find a matching target
        targets = [t.split(";")[0] for t in context.targets]
 | 
| ︙ | |||
| 252 253 254 255 256 257 258 | 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 | + + + + + - + - | 
            log.DND("Received row in internal format, append+reload")
            rows += [ json.loads(data) ]
        # Convertible formats as direct payload
        elif data and info >= 5:
            log.DND("Converting direct payload playlist")
            cnv = action.extract_playlist(data)
            if info >= 20:
                fmt = self.cnv_types[info]
            else:
                fmt = cnv.probe_fmt()
                if fmt == "href": fmt = "raw"
 |