new runpreferences

Aleix aleixpol at gmail.com
Thu Oct 9 19:33:06 UTC 2008


On Thu, Oct 9, 2008 at 8:58 PM, Andreas Pakulat <apaku at gmx.de> wrote:

> On 09.10.08 17:41:05, Aleix wrote:
> > Hi!
> > after a sad tuesday of dealing with not working  and after chatting a bit
> > with apaku we decided to take a new approach. I had to to some dirty work
> so
> > maybe someone concerned my want to take a look at it first.
> >
> > It is not fully working yet, though... it still needs some love.
>
> > +class RunSettings : public KDevelop::ProjectConfigSkeleton
>
> This shouldn't be a project-specific setting. Run configs should be
> cross-project IMHO. If somebody wants to have a certain run configuration
> in his project we should provide a way to "move" it to that project.


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


>
>
> > Index: runconfig.cpp
> > ===================================================================
> > --- runconfig.cpp     (revision 0)
> > +++ runconfig.cpp     (revision 0)
> > @@ -0,0 +1,48 @@
> > +// This file is generated by kconfig_compiler from runconfig.kcfg.
> > +// All changes you do to this file will be lost.
> > +
> > +#include "runconfig.h"
> > +
> > +#include <klocale.h>
> > +
> > +#include <kglobal.h>
> > +#include <QtCore/QFile>
> > +
> > +#include <kdebug.h>
> > +
> > +RunSettings::RunSettings(const QString& groupPrefix,  const QString&
> config  )
> > +  : KDevelop::ProjectConfigSkeleton( config )
> > +{
> > +  setCurrentGroup( groupPrefix+QLatin1String( "-Run Options" ) );
> > +
> > +  mExecutableItem = new KConfigSkeleton::ItemUrl( currentGroup(),
> QLatin1String( "Executable" ), mExecutable );
> > +  mExecutableItem->setLabel( i18n("Executable") );
>
> I guess this is largely copied from the kconfig_compiler generated code?

Good guess. I added the prefix thingie and removed the singleton.


>
>
> > Index: runpreferences.h
> > ===================================================================
> >  namespace KDevelop
> >  {
> >
> > -class RunPreferences : public ProjectKCModule<RunSettings>
> > +class RunPreferences : public KCModule
>
> Oh, that shouldn't have worked at all, for a ProjectConfigSkeleton you
> should always use a ProjectKCModule.

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?


>
>
> >  private:
> > -    bool configNameValid(const QString& name);
> > +    void addTarget(const QString& name);
> > +    void removeTarget(int index);
>
> Maybe "target" isn't quite right here, we also want to support running an
> arbitrary executable thats not a target in some project.

Yes, as I said we should find a better name for an execution configuration.


>
> > +    KConfig m_config;
>
> Better use a KSharedConfig::Ptr instead of a full copy.

Fine :)

>
>
> >  };
> >
> >  }
> > Index: asktargetname.h
>
> Hmm, with so many files related to run-preferences I'd like to see a new
> subdir inside shell/settings that contains all these files. No need to have
> a CMakeLists.txt in it, but just group the files together in there.
>
ok

>
> > +class AskTargetName : public QDialog
>
> Hmm, do we need that for just a name? A dialog that pops up from another
> dialog is bad usability.
>
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.


>
> > Index: CMakeLists.txt
> > ===================================================================
> > --- CMakeLists.txt    (revision 869604)
> > +++ CMakeLists.txt    (working copy)
> > @@ -1,16 +1,6 @@
> >
> >  include_directories(
> >      ${CMAKE_SOURCE_DIR}
> > -    ${CMAKE_SOURCE_DIR}/sublime
> > -    ${CMAKE_SOURCE_DIR}/interfaces
> > -    ${CMAKE_SOURCE_DIR}/project
> > -    ${CMAKE_SOURCE_DIR}/project/interfaces
> > -    ${CMAKE_SOURCE_DIR}/language
> > -    ${CMAKE_SOURCE_DIR}/language/editor
> > -    ${CMAKE_SOURCE_DIR}/language/backgroundparser
> > -    ${CMAKE_SOURCE_DIR}/language/interfaces
> > -    ${CMAKE_SOURCE_DIR}/shell
> > -    ${CMAKE_SOURCE_DIR}/util
>
> Oh, seems I missed something back when I removed all the include-dirs-stuff
> in kdevplatform :)
>
;)


>
> > +RunPreferences::RunPreferences( QWidget *parent, const QVariantList
> &args )
> > +    : KCModule( RunPreferencesFactory::componentData(), parent, args )
> > +    , m_currentRunTarget(0)
> > +    , m_deletingCurrentRunTarget(false)
> > +    , m_args(args)
> > +    , m_config(m_args[0].toString(), KConfig::SimpleConfig )
> > +{
> > +    QVBoxLayout * l = new QVBoxLayout(this);
> > +    QHBoxLayout * h = new QHBoxLayout(this);
> > +
> > +    buttonDeleteTarget=new QPushButton(KIcon("list-remove"), QString(),
> this);
> > +    QPushButton *buttonNewTarget=new QPushButton(KIcon("list-add"),
> QString(), this);
> > +
> > +    buttonDeleteTarget->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
> QSizePolicy::Fixed));
> > +    buttonNewTarget->setSizePolicy(QSizePolicy(QSizePolicy::Fixed,
> QSizePolicy::Fixed));
>
> IMHO the kcmodule itself should also use a .ui file, thats a lot nicer to
> edit and manage in case we want to add stuff or re-arrange.
>
As you wish, we will have 2 ui's then.


>
> Rest looks fine. Didn't test the patch but except maybe some little bugs it
> should work fine. So please commit.

I'll commit asap.


>
>
> Andreas
>
> --
> Your boyfriend takes chocolate from strangers.
>
> _______________________________________________
> KDevelop-devel mailing list
> KDevelop-devel at kdevelop.org
> https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20081009/b7a7b6be/attachment.html>


More information about the KDevelop-devel mailing list