Drag and Drop in KRsN
Working pretty well now. It's not saved for following sessions, and the folders don't do what I want (show an aggregate of their inner feeds) yet, but it was pretty easy.
Working pretty well now. It's not saved for following sessions, and the folders don't do what I want (show an aggregate of their inner feeds) yet, but it was pretty easy.
Ok, here it goes. If you are not fluent in Qt programming the following entry will make no sense whatsoever :-)
If you set the contents of a QTextBrowser, and the content is HTML, it will call its QMimeSourceFactory's data() method to get MimeObjects representing, for example, images in the HTML.
So far so good.
However, I am mistified by this: While it's doing that, you can change the contents, and it will go along it's merry way, except that old data() calls are still in progress.
In other words, it acts as if it's multithreaded. Usually, in Qt, this is because someone is calling QApp::processEvents, and then you have multiple functions running and yielding to each other in the Qt event loop.
That is surely what's happeneing, but... how the hell does one stop the old data() calls????
The processEvents call is not made by me, it's done internally by some method in the QTextBrowser.... so, right now, in KRsN, sometimes you are downloading images for old stuff you saw minutes ago!
I have been using Bruce Guenter's nice Qmail rpms for years, but he doesn't seem to be working on them much.
So, I just fixed a couple of issues:
TLS Support
errno fix (for glibc 2.3)
svc-add smtpd (silly)
So, it now builds out-of-the-box on RH8 and RH9.
I should open a sf.net site for them, probably. Add CRAM-MD5 authentication (I have it working with a plain file, LDAP would be nicer), a working courier RPM (tricky to build sometimes), a little extra stuff (antivirus, spamassassin, autoresponder) and it's really a nice mail server in a box.
A modest one, though. I got a 802.11b card, and a nice USB storage thingie. Nice toys, should be useful, too.
Coding in KRsN is quite nicely moving forward. The design of the app is almost competent now, and it works well (a couple silly mistakes I just fixed had broken feed addition, though)
Now, I didn't expect this to work at all!
A QlistView is a sort of tree widget, and is drag&drop enabled.
The trick is, you have to reimplement dragObject() so it returns a draggable thingie after you drag something.
But, since I am using designer to draw the forms, I have to use a real QListView, not a child class.
Conundrum? Custom widget in designer? Not with python!
return QTextDrag("something",self)
self.tree.__class__.dragObject=myDragObject
And that works! I know it should work in python, but QListView is implemented in a C++ module!
The guys that did PyQt really made it well.