[PC-BSD Dev] Fwd: pkg and EVENT_PIPE

Ken Moore ken at pcbsd.org
Tue Feb 18 14:04:40 PST 2014

I just finished putting together a new class in libpcbsd utils - DLProcess.
You should be able to just use instances of it for your PBI/PKG 
downloads now, but I have not done a full testing of it yet to make sure 
it works properly (I will need to pick a utility and convert it to use 
the new class first).

Couple quick notes about usage:
1) Make sure you run the "setWardenDir()" function before "setDLType()" 
if the parent app is running in a warden jail.
2) There are 3 different types of downloads it handles: "PBI" for the 
pbi_* downloads, "PKG" for package downloads, and "CDN" for running 
other PC-BSD CLI utilities that download things from the CDN.

Example use:

DLProcess *proc = new DLProcess(this);
   proc->setWardenDir("path/to/warden/jail"); //If necessary
   proc->setDLType("PBI"); // [ "PBI", "PKG", or "CDN" ]
     connect(proc, SIGNAL(UpdateMessage(QString)), this, 
SLOT(newMessage(QString)) ); //A single-line message
     connect(proc, SIGNAL(UpdatePercent(QString,QString,QString)), this, 
SLOT(updateProgressBar(QString, QString, QString)) ); // output=[Percent 
Finished, Total Size (Human readable), Filename (for pkg output) or 
download speed (for PBI/CDN) ]
   proc->start("pbi_add -R firefox");

Of course, you will want to make sure that you connect it to your GUI 
slots as appropriate as well as keep the DLProcess pointer in memory 
while it is being used.

I hope this helps!!

On 02/18/2014 10:50, Ken Moore wrote:
> On 02/18/2014 10:34, Yuri Momotiuk wrote:
>> Hi, Ken
>> 2014-02-18 17:23 GMT+02:00 Ken Moore <ken at pcbsd.org 
>> <mailto:ken at pcbsd.org>>:
>>     Exactly my thoughts too.
>>     Just use a more generic naming method for the libpcbsd backends
>>     instead of labeling them by the primary front-end that uses it
>>     (so PBI-DB instead of AppCafeBackend, since it is just how to
>>     access the PBI database, or something along those lines).
>> I agree with that.
>>     I also agree that we could put a couple small GUI widgets or
>>     display windows in libpcbsd as well. Again, just make sure they
>>     are generic enough to be used in multiple locations.
>> I think about several libs with backends and widgets. Like libPBI.so, 
>> libPBIWidgets.so, etc IMHO libpcbsd should contain only general 
>> things like new QProcess, Utils class, etc
>>     This might be a good way to unify the PC-BSD application icon
>>     scheme as well. Instead of having each utility bundle it's own
>>     copy of the icons, we could have a single libpcbsd icon resource
>>     with a simplified front-end function to get a type of icon.
>>     Something along the same lines as the EasyPBI backend.cpp
>>     "icon(QString name)" function would work well I think.
>> About icons. Maybe the better solution is just putting icons somewere 
>> in /usr/local/share/pcbsd/ . In that case we can change icon set 'on 
>> the fly' without recompilation. We also can have several icon sets. 
>> Or even icon sets from users.
> That sounds like a good way to do it. I am not sure if an internal Qt 
> resource will work for a library anyway (have not tested that). The 
> static function interface to the PC-BSD icons is definitely the way to 
> go then.
>> PS Can we continue discussion tomorrow (or maybe later)? Seems like 
>> this night will be hot in Kiev :(
>> -- 
>> Best regards, Yuri Momotyuk
> Sure thing. Have a good evening!
>> -- 
>> Best regards, Yuri Momotyuk
>> _______________________________________________
>> Dev mailing list
>> Dev at lists.pcbsd.org
>> http://lists.pcbsd.org/mailman/listinfo/dev
> -- 
> ~~ Ken Moore ~~
> PC-BSD/iXsystems
> _______________________________________________
> Dev mailing list
> Dev at lists.pcbsd.org
> http://lists.pcbsd.org/mailman/listinfo/dev

~~ Ken Moore ~~

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pcbsd.org/pipermail/dev/attachments/20140218/b6a3cadb/attachment.html>

More information about the Dev mailing list