<div dir="ltr"><br><br><div class="gmail_quote">On Thu, Oct 9, 2008 at 8:58 PM, Andreas Pakulat <span dir="ltr"><<a href="mailto:apaku@gmx.de">apaku@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On 09.10.08 17:41:05, Aleix wrote:<br>
> Hi!<br>
> after a sad tuesday of dealing with not working  and after chatting a bit<br>
> with apaku we decided to take a new approach. I had to to some dirty work so<br>
> maybe someone concerned my want to take a look at it first.<br>
><br>
> It is not fully working yet, though... it still needs some love.<br>
<br>
</div></div>> +class RunSettings : public KDevelop::ProjectConfigSkeleton<br>
<br>
This shouldn't be a project-specific setting. Run configs should be<br>
cross-project IMHO. If somebody wants to have a certain run configuration<br>
in his project we should provide a way to "move" it to that project.</blockquote><div> </div><div>Well, as far as I see it, every project will have some targets (we need to find a better name for this, agree) and will manage his own... do you think this should be moved to KDevelop settings? :S<br>
 <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
> Index: runconfig.cpp<br>
> ===================================================================<br>
> --- runconfig.cpp     (revision 0)<br>
> +++ runconfig.cpp     (revision 0)<br>
> @@ -0,0 +1,48 @@<br>
> +// This file is generated by kconfig_compiler from runconfig.kcfg.<br>
> +// All changes you do to this file will be lost.<br>
> +<br>
> +#include "runconfig.h"<br>
> +<br>
> +#include <klocale.h><br>
> +<br>
> +#include <kglobal.h><br>
> +#include <QtCore/QFile><br>
> +<br>
> +#include <kdebug.h><br>
> +<br>
> +RunSettings::RunSettings(const QString& groupPrefix,  const QString& config  )<br>
> +  : KDevelop::ProjectConfigSkeleton( config )<br>
> +{<br>
> +  setCurrentGroup( groupPrefix+QLatin1String( "-Run Options" ) );<br>
> +<br>
> +  mExecutableItem = new KConfigSkeleton::ItemUrl( currentGroup(), QLatin1String( "Executable" ), mExecutable );<br>
> +  mExecutableItem->setLabel( i18n("Executable") );<br>
<br>
I guess this is largely copied from the kconfig_compiler generated code?</blockquote><div>Good guess. I added the prefix thingie and removed the singleton.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
> Index: runpreferences.h<br>
> ===================================================================<br>
>  namespace KDevelop<br>
>  {<br>
><br>
> -class RunPreferences : public ProjectKCModule<RunSettings><br>
> +class RunPreferences : public KCModule<br>
<br>
Oh, that shouldn't have worked at all, for a ProjectConfigSkeleton you<br>
should always use a ProjectKCModule.</blockquote><div>Well, this information is being tracked in the constructor of each widget. since each widget on the stack is a QWidget, they it can't be a ProjectKCModule, isn't it?<br>
 <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
>  private:<br>
> -    bool configNameValid(const QString& name);<br>
> +    void addTarget(const QString& name);<br>
> +    void removeTarget(int index);<br>
<br>
Maybe "target" isn't quite right here, we also want to support running an<br>
arbitrary executable thats not a target in some project.</blockquote><div>Yes, as I said we should find a better name for an execution configuration. <br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
> +    KConfig m_config;<br>
<br>
Better use a KSharedConfig::Ptr instead of a full copy.</blockquote><div>Fine :) <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
>  };<br>
><br>
>  }<br>
> Index: asktargetname.h<br>
<br>
Hmm, with so many files related to run-preferences I'd like to see a new<br>
subdir inside shell/settings that contains all these files. No need to have<br>
a CMakeLists.txt in it, but just group the files together in there.<br>
</blockquote><div>ok <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
> +class AskTargetName : public QDialog<br>
<br>
Hmm, do we need that for just a name? A dialog that pops up from another<br>
dialog is bad usability.<br>
</blockquote><div>I know, but the previous interface was not working at all (besides the full kconfigskeleton issue) so i decided to change to this which is uglier but more deterministic.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
> Index: CMakeLists.txt<br>
> ===================================================================<br>
> --- CMakeLists.txt    (revision 869604)<br>
> +++ CMakeLists.txt    (working copy)<br>
> @@ -1,16 +1,6 @@<br>
><br>
>  include_directories(<br>
>      ${CMAKE_SOURCE_DIR}<br>
> -    ${CMAKE_SOURCE_DIR}/sublime<br>
> -    ${CMAKE_SOURCE_DIR}/interfaces<br>
> -    ${CMAKE_SOURCE_DIR}/project<br>
> -    ${CMAKE_SOURCE_DIR}/project/interfaces<br>
> -    ${CMAKE_SOURCE_DIR}/language<br>
> -    ${CMAKE_SOURCE_DIR}/language/editor<br>
> -    ${CMAKE_SOURCE_DIR}/language/backgroundparser<br>
> -    ${CMAKE_SOURCE_DIR}/language/interfaces<br>
> -    ${CMAKE_SOURCE_DIR}/shell<br>
> -    ${CMAKE_SOURCE_DIR}/util<br>
<br>
Oh, seems I missed something back when I removed all the include-dirs-stuff<br>
in kdevplatform :)<br>
</blockquote><div>;)<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
> +RunPreferences::RunPreferences( QWidget *parent, const QVariantList &args )<br>
> +    : KCModule( RunPreferencesFactory::componentData(), parent, args )<br>
> +    , m_currentRunTarget(0)<br>
> +    , m_deletingCurrentRunTarget(false)<br>
> +    , m_args(args)<br>
> +    , m_config(m_args[0].toString(), KConfig::SimpleConfig )<br>
> +{<br>
> +    QVBoxLayout * l = new QVBoxLayout(this);<br>
> +    QHBoxLayout * h = new QHBoxLayout(this);<br>
> +<br>
> +    buttonDeleteTarget=new QPushButton(KIcon("list-remove"), QString(), this);<br>
> +    QPushButton *buttonNewTarget=new QPushButton(KIcon("list-add"), QString(), this);<br>
> +<br>
> +    buttonDeleteTarget->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));<br>
> +    buttonNewTarget->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));<br>
<br>
IMHO the kcmodule itself should also use a .ui file, thats a lot nicer to<br>
edit and manage in case we want to add stuff or re-arrange.<br>
</blockquote><div>As you wish, we will have 2 ui's then.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Rest looks fine. Didn't test the patch but except maybe some little bugs it<br>
should work fine. So please commit.</blockquote><div>I'll commit asap.<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>

<br>
Andreas<br>
<font color="#888888"><br>
--<br>
Your boyfriend takes chocolate from strangers.<br>
<br>
_______________________________________________<br>
KDevelop-devel mailing list<br>
<a href="mailto:KDevelop-devel@kdevelop.org">KDevelop-devel@kdevelop.org</a><br>
<a href="https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel" target="_blank">https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel</a><br>
</font></blockquote></div><br></div>