[PC-BSD Dev] pcbsd system source idea and question

Ken Moore ken at pcbsd.org
Mon Jan 6 05:56:31 PST 2014


That is the header file that Qt automatically generates for the *.ui 
files. You probably just forgot to add cmdDialog.ui to the project as well.

NOTE: *.ui files should be added to the project file using the "FORMS 
+=" variable.
NOTE2: Don't forget to re-run "qmake-qt4" after modifying the project file.

On 01/05/2014 13:28, Joe Maloney wrote:
> I was able to get the new files added to the project file with no 
> problem.  However cmddialog.cpp references a file called 
> ui_cmdDialog.h that doesn’t exist so cmddialog.cpp cannot be compiled. 
>  Will this file need to be created as well?  Would it be replacing 
> something?
>
> Joe Maloney
>
> On Jan 3, 2014, at 11:08 AM, Ken Moore <ken at pcbsd.org 
> <mailto:ken at pcbsd.org>> wrote:
>
>> On 01/03/2014 10:24, Ken Moore wrote:
>>> Comments in-line below:
>>>
>>> On 12/27/2013 18:54, Joe Maloney wrote:
>>>> Ok here is what I have been able to come up with so far.  I’m 
>>>> confident there is still not quite right but this is just to show 
>>>> you where I am at a stopping point.
>>>>
>>>> I was also considering renaming all portsnapprogress* files of 
>>>> course once it’s functional to maybe something like gitprogress.h, 
>>>> gitprogress,cpp, gitprogress.ui since it’s not really portsnap 
>>>> anymore.  Then call the portsnapproc something else of course as 
>>>> well like gitProc or something like that.
>>>>
>>>
>>> That sounds like a good idea. A simple find/replace should let you 
>>> switch them over pretty quickly.
>>>
>>>> portsnapprogress.h -> http://pastebin.com/TF6bSKFz
>>>>
>>>> portsnapprogress.cpp -> http://pastebin.com/aL7mfgqi
>>>>
>>>> pbsystemtab.cpp -> http://pastebin.com/NtqEM35Z
>>>>
>>>> pbsystemtab.h -> http://pastebin.com/Y2yYczzb
>>>>
>>>> The above compiles fine if i remove the show function from 
>>>> pbsystemtab.cpp under the fetchSourcePressed and fetchPortsPressed 
>>>> sections .  You will see that I added init back into public to make 
>>>> it compile in portsnaprogress.h.  Otherwise pbsystemtab.cpp 
>>>> complained that no member named init was found.  Even though I had 
>>>> pointed portnsapProc to PortsnapUI in pbsystemtab.h
>>>>
>>>
>>> Ah, that is because you have mixed up the class names between the 
>>> backend PortsnapProc and your GUI PortsnapProgress classes. 
>>> portsnapprogress.cpp should be using a different class name - 
>>> otherwise in your "init" function you are doing a recursive call in 
>>> that the initial PortsnapProc class is re-creating a new 
>>> PortsnapProc class within it.
>>>
>>> Give me a little bit and I will write up a quick PortsnapProc -> 
>>> ProgressDialog thing for you so that you can see what I mean.
>>>
>>>> portsnapUI->show();
>>>>
>>>> Also I know that I will need to find a way to get branch detection 
>>>> to work with the new methods.  The old method was using this for 
>>>> source.  I’m not sure how to fit this in with what I have for 
>>>> startSource now.
>>>>
>>>> void PortsnapProgress::startSource(QString pcVer)
>>>> {
>>>> label->setText(tr("Downloading FreeBSD sources..."));
>>>>
>>>> QString branch;
>>>> // Figure out which to download
>>>> if ( pcVer.indexOf("STABLE") )
>>>> branch = "stable/" + pcVer.section("-", 0, 0).section(".", 0, 0);
>>>> else if ( pcVer.indexOf(" .") != -1 )
>>>> branch = "releng/" + pcVer.section("-", 0, 0);
>>>> else
>>>> branch = "master";
>>>> QStringList args;
>>>> QString prog;
>>>> prog = "git";
>>>> args << "clone" << "https://github.com/pcbsd/freebsd.git" << "-b" 
>>>> << branch << "/usr/src";
>>>> qDebug() << args;
>>>> portsnap = new QProcess(this);
>>>> portsnap->setProcessChannelMode(QProcess::MergedChannels);
>>>> connect(portsnap, SIGNAL(readyReadStandardOutput()), this, 
>>>> SLOT(parseUpdate()));
>>>> connect(portsnap, SIGNAL(finished(int, QProcess::ExitStatus)), 
>>>> this, SLOT(fetchDone()));
>>>> portsnap->start(prog, args);
>>>> }
>>>>
>>>
>>> It sounds like you are just needing to modify the git command a bit. 
>>> You could either do the detection early on and just pass that branch 
>>> info to the process as a quick QString input (the "branch" variable 
>>> above), or you could actually build it into the process cmd 
>>> generation routine itself (in PortsnapProc->startSource()).
>>>
>>>
>>> - snip all the older conversations -
>>>
>>> -- 
>>> ~~ Ken Moore ~~
>>> PC-BSD/iXsystems
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev at lists.pcbsd.org
>>> http://lists.pcbsd.org/mailman/listinfo/dev
>>
>> OK, here is are the fixed-up portsnapprogress.[cpp/h] files, as well 
>> as the new/simple GUI class to run/display it (cmdDialog.[ui/cpp/h]). 
>> This is not tested yet, so there might be a few minor compilation 
>> errors you need to fix.
>>
>> I only did a couple quick modifications to your PCSystemTab class to 
>> use the new CMDDialog class (specifically to the fetchSourcePressed() 
>> and fetchPortsPressed() functions). You will still need to make sure 
>> that the new files are added to your project first.
>>
>> -- 
>> ~~ Ken Moore ~~
>> PC-BSD/iXsystems
>> <cmdDialog.cpp><cmdDialog.h><cmdDialog.ui><pbsystemtab.cpp><pbsystemtab.h><portsnapprogress.cpp><portsnapprogress.h>
>


-- 
~~ Ken Moore ~~
PC-BSD/iXsystems

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


More information about the Dev mailing list