[Adium-devl] Importer API
gbooker at cod3r.com
Wed Apr 11 19:04:09 UTC 2007
On Apr 11, 2007, at 12:47 AM, Peter Hosey wrote:
> On Apr 10, 2007, at 17:23:13, Graham Booker wrote:
>> The calling thread does *not* wait!
> Then there's no reason for the -beginImportingAccounts method to
> return anything, except maybe a token that can be used to cancel
> the import. (Allowing Cancel would probably be a good idea.)
Actually, along those lines, I was thinking it would be nice to put
in a cancel call into the API.
>> The calling thread is the process's run loop,
> Run loops are per-thread, not per-process. Any thread can have a
> run loop if it wants one.
> Perhaps you meant:
> The calling thread is the main thread,
> I'll continue under that assumption.
Yeah, I did. Sorry.
>> Essentially, the thread, after it has completed, does a
>> performSelectorOnMainThread and then exits.
> So it would be performing some sort of delegate callback message?
I wasn't explicit in the architecture I was envisioning here. Here
is what I was thinking:
For non-log import
The UI gets calls on the main thread.
It deactivates the "Next" button in the wizard
It uses that thread to directly call the account and status import.
It re-activates the "Next" button in the wizard
When it comes to log import, a few things are different.
The UI deactivates the "Next" button in the wizard
The UI class spawns a new thread, which calls a selector within itself.
This selector calls the log import.
The log import has the option of making delegate calls back to the
UI (on its thread) to update the progress bar.
The log import finally finishes, and the function exits.
The UI's selector gets control of its thread again, and it re-
activates the "Next" button on the wizard to proceed.
> Seems like we don't need the import wizard for that. We can order
> out the wizard and just show a regular progress panel, rather like
> the one Sparkle uses.
I thought of doing this, much like the current Fire importer does. I
think it would just be prettier as a progress bar within the Import
wizard though. It can go either way.
> \ Peter Hosey / boredzo at adiumx.com
> PGP public key ID: C6550423 (since 2007-01-01)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1601 bytes
Desc: not available
More information about the Adium-devl