-
Notifications
You must be signed in to change notification settings - Fork 0
/
replicodeconfigpage.cpp
50 lines (40 loc) · 1.32 KB
/
replicodeconfigpage.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "replicodeconfigpage.h"
#include "replicodeconfig.h"
#include <KUrlRequester>
#include <KConfigGroup>
#include <KConfig>
#include <QGridLayout>
#include <QLayout>
#include <klocalizedstring.h>
#include <QLabel>
#include <QTabWidget>
ReplicodeConfigPage::ReplicodeConfigPage(QWidget *parent, const char *name) : Kate::PluginConfigPage(parent, name), m_config(new ReplicodeConfig(this))
{
QGridLayout *gridlayout = new QGridLayout;
setLayout(gridlayout);
gridlayout->addWidget(new QLabel(i18n("Path to replicode executor:")), 0, 0);
m_requester = new KUrlRequester;
m_requester->setMode(KFile::File | KFile::ExistingOnly);
gridlayout->addWidget(m_requester, 0, 1);
gridlayout->addWidget(m_config, 1, 0, 1, 2);
reset();
connect(m_requester, SIGNAL(textChanged(QString)), SIGNAL(changed()));
}
void ReplicodeConfigPage::apply()
{
KConfigGroup config(KGlobal::config(), "Replicode");
config.writeEntry("replicodePath", m_requester->text());
m_config->save();
}
void ReplicodeConfigPage::reset()
{
KConfigGroup config(KGlobal::config(), "Replicode");
m_requester->setText(config.readEntry<QString>("replicodePath", QString()));
m_config->load();
}
void ReplicodeConfigPage::defaults()
{
m_requester->setText(QString());
m_config->reset();
}
#include "replicodeconfigpage.moc"