Commit a20c605a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Add default templates

parent 499fdf47
......@@ -12,6 +12,7 @@ set(headerthemeeditor_SRCS
desktopfilepage.cpp
editorpage.cpp
themetemplatewidget.cpp
themedefaulttemplate.cpp
)
kde4_add_executable(headerthemeeditor ${headerthemeeditor_SRCS} )
......
......@@ -41,8 +41,16 @@ DesktopFilePage::DesktopFilePage(QWidget *parent)
lay->addWidget(lab,1,0);
lay->addWidget(mDescription,1,1);
lab = new QLabel(i18n("Filename:"));
mFilename = new KLineEdit;
lay->addWidget(lab,2,0);
lay->addWidget(mFilename,2,1);
lab = new QLabel(i18n("Extract Headers:"));
lay->addWidget(lab,3,0);
mExtraDisplayHeaders = new PimCommon::SimpleStringListEditor;
lay->addWidget(mExtraDisplayHeaders, 2, 0, 2, 2);
lay->addWidget(mExtraDisplayHeaders, 4, 0, 4, 2);
setLayout(lay);
}
......@@ -57,7 +65,8 @@ void DesktopFilePage::saveTheme(const QString &path)
KConfigGroup grp = desktopFile.actionGroup(QLatin1String("Desktop Entry"));
grp.writeEntry(QLatin1String("Name"), mName->text());
grp.writeEntry(QLatin1String("Description"), mDescription->text());
//TODO grp.writeEntry(QLatin1String("FileName"), mDescription->text());
grp.writeEntry(QLatin1String("FileName"), mFilename->text());
grp.writeEntry(QLatin1String("DisplayExtraHeaders"), mExtraDisplayHeaders->stringList());
grp.sync();
}
......
......@@ -38,6 +38,7 @@ public:
private:
KLineEdit *mName;
KLineEdit *mDescription;
KLineEdit *mFilename;
PimCommon::SimpleStringListEditor *mExtraDisplayHeaders;
};
......
/*
Copyright (c) 2013 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "themedefaulttemplate.h"
QList<PimCommon::defaultTemplate> ThemeDefaultTemplate::defaultTemplates()
{
return QList<PimCommon::defaultTemplate>();
}
/*
Copyright (c) 2013 Montel Laurent <montel@kde.org>
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License, version 2, as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef THEMEDEFAULTTEMPLATE_H
#define THEMEDEFAULTTEMPLATE_H
#include <pimcommon/templatewidgets/templatelistwidget.h>
namespace ThemeDefaultTemplate {
QList<PimCommon::defaultTemplate> defaultTemplates();
}
#endif // THEMEDEFAULTTEMPLATE_H
......@@ -16,6 +16,7 @@
*/
#include "themetemplatewidget.h"
#include "themedefaulttemplate.h"
#include <KLocale>
......@@ -34,11 +35,9 @@ ThemeTemplateListWidget::~ThemeTemplateListWidget()
QList<PimCommon::defaultTemplate> ThemeTemplateListWidget::defaultTemplates()
{
//TODO
return QList<PimCommon::defaultTemplate>();
return ThemeDefaultTemplate::defaultTemplates();
}
ThemeTemplateWidget::ThemeTemplateWidget(const QString &title, QWidget *parent)
: QWidget(parent)
{
......@@ -57,6 +56,4 @@ ThemeTemplateWidget::~ThemeTemplateWidget()
{
}
#include "themetemplatewidget.moc"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment