Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/plugins/views/reports/ksettingsreports.cpp
- This file was copied from kmymoney/dialogs/settings/ksettingsreports.h.
1 | /*************************************************************************** | 1 | /*************************************************************************** | ||
---|---|---|---|---|---|
2 | ksettingsreports.h | 2 | ksettingsreports.cpp | ||
3 | ------------------- | 3 | -------------------- | ||
4 | copyright : (C) 2010 by Bernd Gonsior | 4 | copyright : (C) 2010 by Bernd Gonsior | ||
5 | email : bernd.gonsior@googlemail.com | 5 | email : bernd.gonsior@googlemail.com | ||
6 | (C) 2017 by Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | 6 | (C) 2017 by Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | ||
7 | ***************************************************************************/ | 7 | ***************************************************************************/ | ||
8 | 8 | | |||
9 | /*************************************************************************** | 9 | /*************************************************************************** | ||
10 | * * | 10 | * * | ||
11 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * | ||
12 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * | ||
13 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * | ||
14 | * (at your option) any later version. * | 14 | * (at your option) any later version. * | ||
15 | * * | 15 | * * | ||
16 | ***************************************************************************/ | 16 | ***************************************************************************/ | ||
17 | 17 | | |||
18 | #ifndef KSETTINGSREPORTS_H | 18 | #include "ksettingsreports.h" | ||
19 | #define KSETTINGSREPORTS_H | | |||
20 | 19 | | |||
21 | // ---------------------------------------------------------------------------- | 20 | // ---------------------------------------------------------------------------- | ||
22 | // QT Includes | 21 | // QT Includes | ||
23 | 22 | | |||
24 | #include <QWidget> | 23 | #include <QUrl> | ||
24 | #include <QFileInfo> | ||||
25 | 25 | | |||
26 | // ---------------------------------------------------------------------------- | 26 | // ---------------------------------------------------------------------------- | ||
27 | // KDE Includes | 27 | // KDE Includes | ||
28 | 28 | | |||
29 | #include <KLocalizedString> | ||||
30 | #include <KMessageBox> | ||||
31 | #include <KLineEdit> | ||||
32 | | ||||
29 | // ---------------------------------------------------------------------------- | 33 | // ---------------------------------------------------------------------------- | ||
30 | // Project Includes | 34 | // Project Includes | ||
31 | 35 | | |||
32 | class KSettingsReportsPrivate; | 36 | #include "ui_ksettingsreports.h" | ||
33 | class KSettingsReports : public QWidget | 37 | | ||
38 | #include "kmymoneysettings.h" | ||||
39 | | ||||
40 | | ||||
41 | | ||||
42 | KSettingsReports::KSettingsReports(QWidget* parent) : | ||||
43 | QWidget(parent), | ||||
44 | d_ptr(new KSettingsReportsPrivate) | ||||
34 | { | 45 | { | ||
35 | Q_OBJECT | 46 | Q_D(KSettingsReports); | ||
36 | Q_DISABLE_COPY(KSettingsReports) | 47 | d->ui->setupUi(this); | ||
48 | | ||||
49 | // keep initial (default) css file in mind | ||||
50 | d->m_cssFileOld = KMyMoneySettings::cssFileDefault(); | ||||
51 | | ||||
52 | // set default css file in ksettingsreports dialog | ||||
53 | d->ui->kcfg_CssFileDefault->setUrl(QUrl::fromLocalFile(KMyMoneySettings::cssFileDefault())); | ||||
54 | | ||||
55 | d->m_fileKLineEdit = d->ui->kcfg_CssFileDefault->lineEdit(); | ||||
56 | | ||||
57 | connect(d->ui->kcfg_CssFileDefault, &KUrlRequester::urlSelected, | ||||
58 | this, &KSettingsReports::slotCssUrlSelected); | ||||
59 | | ||||
60 | connect(d->m_fileKLineEdit, &QLineEdit::editingFinished, | ||||
61 | this, &KSettingsReports::slotEditingFinished); | ||||
62 | } | ||||
63 | | ||||
64 | KSettingsReports::~KSettingsReports() | ||||
65 | { | ||||
66 | Q_D(KSettingsReports); | ||||
67 | delete d; | ||||
68 | } | ||||
69 | | ||||
37 | 70 | | |||
38 | public: | | |||
39 | explicit KSettingsReports(QWidget* parent = nullptr); | | |||
40 | ~KSettingsReports(); | | |||
41 | | ||||
42 | protected Q_SLOTS: | | |||
43 | void slotCssUrlSelected(const QUrl&); | | |||
44 | void slotEditingFinished(); | | |||
45 | | ||||
46 | private: | | |||
47 | KSettingsReportsPrivate * const d_ptr; | | |||
48 | Q_DECLARE_PRIVATE(KSettingsReports) | | |||
49 | }; | | |||
50 | #endif | |