1 /* This file is part of KDevelop
3 Copyright 2009 Milian Wolff <mail@milianw.de>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
21 #include "phpdocsconfig.h"
23 #include <KLocalizedString>
24 #include <KPluginFactory>
25 #include <KPluginLoader>
26 #include <KConfigGroup>
27 #include <KUrlRequester>
32 #include <KSettings/Dispatcher>
34 #include <QtGui/QBoxLayout>
35 #include <QtGui/QLabel>
36 #include <QtCore/QFile>
37 #include <QtCore/QStringList>
39 #include "phpdocssettings.h"
40 #include "ui_phpdocsconfig.h"
42 K_PLUGIN_FACTORY(PhpDocsConfigFactory, registerPlugin<PhpDocsConfig>();)
43 K_EXPORT_PLUGIN(PhpDocsConfigFactory("kdevphpdocs_config"))
45 PhpDocsConfig::PhpDocsConfig(QWidget *parent, const QVariantList &args)
46 : KCModule(PhpDocsConfigFactory::componentData(), parent, args)
48 QVBoxLayout * l = new QVBoxLayout( this );
50 QWidget* w = new QWidget;
51 m_configWidget = new Ui::PhpDocsConfigUI;
52 m_configWidget->setupUi( w );
54 m_configWidget->kcfg_phpDocLocation->setMode( KFile::Directory | KFile::ExistingOnly );
58 addConfig( PhpDocsSettings::self(), w );
63 void PhpDocsConfig::save()
67 // looks like we have to force a write so readConfig() can get the new values
68 PhpDocsSettings::self()->writeConfig();
70 KSettings::Dispatcher::reparseConfiguration( componentData().componentName() );
73 PhpDocsConfig::~PhpDocsConfig()
75 delete m_configWidget;
78 #include "phpdocsconfig.moc"