Mar 09

I got Drag And Drop working with the File Manager now. To do it I had instead of a normal ListStore declare a ListStoreDND. When declaring a drag’n'drop listStoreDND, you have to defined you’re DND functionality there and then, which is quite annoying to be honest. An `onRowDrag` function would be a lot better, and in keeping with the rest of the library and how actions are done. Also, when you are doing a drag, you have to put data into a “selection” and in the library documentation I could see functions like “selectionSetText”, and “selectionGetText”, which looked like they’d be very useful to me. Denied. You can only put numbers into a selection, and there was one line about this somewhere near the bottom of the library documents. Why have a method like selectionSetText if you can’t set the text in the selection? Makes no sense at all. Regardless, what I do to get around this is: Feed a 0 or 1 into the selection depending on what store the row is being dragged from. Then feed the selected row’s index into it. The if the first number in the selection is 0, I know its from the directory store. So I just pop off the text at that index, and then the text from the dropping position, and then do a move with those. Happy days.

Will post code later when I tidy it up.

M

Tagged with:
Mar 03

I spent the day today rewriting my SystemOperation module, to handle multiple selections. I got multiple selections working yesterday, but I felt it was done poorly, so out with the old in with the new. Due to reducing all my previous code as far as I could, I had to rewrite each function out again, i.e. renameFile, renameFolder etc etc, and then reduce down based on that.

I also added:

  • File Size information, 0 if directory
  • Last Modified Time
  • Permissions

To each element in both the directory and file tree.

This is the point where I would love to be able to actually set the size for the widgets myself, as the directory tree is taking up way too much space on screen, and is annoying the hell out of me. I spent the evening trawling the libraries for something that would let me resize it, on the off chance that they had included this functionality into the new library. No, would be the answer to that. So it’s all or nothing. I also reduced a fair bit of the rest of my code, a line or two here, a line or two there, so all in all, quite the productive day.

M

Tagged with:
preload preload preload