diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 22:38:03 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 22:38:03 +0000 |
commit | dadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (patch) | |
tree | 99e72842fe687baea16376a147619b6048d7e441 /kmymoney2/dialogs/settings | |
download | kmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.tar.gz kmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.zip |
Added kmymoney
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239792 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/dialogs/settings')
30 files changed, 4280 insertions, 0 deletions
diff --git a/kmymoney2/dialogs/settings/Makefile.am b/kmymoney2/dialogs/settings/Makefile.am new file mode 100644 index 0000000..f296c11 --- /dev/null +++ b/kmymoney2/dialogs/settings/Makefile.am @@ -0,0 +1,25 @@ +noinst_LIBRARIES = libsettings.a +KDE_OPTIONS = noautodist + +INCLUDES = $(all_includes) -I$(top_srcdir) -I. + +libsettings_a_METASOURCES = AUTO + +libsettings_a_SOURCES = ksettingsgeneraldecl.ui ksettingsgeneral.cpp \ + ksettingsregisterdecl.ui ksettingsregister.cpp \ + ksettingsgpgdecl.ui ksettingsgpg.cpp \ + ksettingscolorsdecl.ui ksettingscolors.cpp \ + ksettingsfontsdecl.ui ksettingsfonts.cpp \ + ksettingsschedulesdecl.ui ksettingsschedules.cpp \ + ksettingsonlinequotesdecl.ui ksettingsonlinequotes.cpp \ + ksettingshomedecl.ui ksettingshome.cpp \ + ksettingsforecastdecl.ui ksettingsforecast.cpp \ + ksettingsplugins.cpp + +EXTRA_DIST = ksettingsgeneraldecl.ui ksettingsregisterdecl.ui ksettingsgpgdecl.ui ksettingscolorsdecl.ui ksettingsfontsdecl.ui ksettingsschedulesdecl.ui ksettingsonlinequotesdecl.ui ksettingshomedecl.ui ksettingsforecastdecl.ui + +DISTCLEANFILES= ksettingsgeneraldecl.cpp ksettingsgeneraldecl.h ksettingsregisterdecl.cpp ksettingsregisterdecl.h ksettingsgpgdecl.cpp ksettingsgpgdecl.h ksettingscolorsdecl.cpp ksettingscolorsdecl.h ksettingsfontsdecl.cpp ksettingsfontsdecl.h ksettingsschedulesdecl.cpp ksettingsschedulesdecl.h ksettingsonlinequotesdecl.cpp ksettingsonlinequotesdecl.h ksettingshomedecl.cpp ksettingshomedecl.h ksettingsforecastdecl.cpp ksettingsforecastdecl.h + +noinst_HEADERS = ksettingsgeneral.h ksettingsregister.h ksettingsgpg.h ksettingscolors.h ksettingsfonts.h ksettingsschedules.h ksettingsonlinequotes.h ksettingshome.h ksettingsforecast.h ksettingsplugins.h + +messages: rc.cpp diff --git a/kmymoney2/dialogs/settings/ksettingscolors.cpp b/kmymoney2/dialogs/settings/ksettingscolors.cpp new file mode 100644 index 0000000..727241c --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingscolors.cpp @@ -0,0 +1,37 @@ +/*************************************************************************** + ksettingscolors.cpp + -------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "ksettingscolors.h" + +KSettingsColors::KSettingsColors(QWidget* parent, const char* name) : + KSettingsColorsDecl(parent, name) +{ +} + +KSettingsColors::~KSettingsColors() +{ +} + +#include "ksettingscolors.moc" diff --git a/kmymoney2/dialogs/settings/ksettingscolors.h b/kmymoney2/dialogs/settings/ksettingscolors.h new file mode 100644 index 0000000..896ad85 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingscolors.h @@ -0,0 +1,40 @@ +/*************************************************************************** + ksettingscolors.h + ------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSETTINGSCOLORS_H +#define KSETTINGSCOLORS_H + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "kmymoney2/dialogs/settings/ksettingscolorsdecl.h" + +class KSettingsColors : public KSettingsColorsDecl +{ + Q_OBJECT + +public: + KSettingsColors(QWidget* parent = 0, const char* name = 0); + ~KSettingsColors(); +}; +#endif + diff --git a/kmymoney2/dialogs/settings/ksettingscolorsdecl.ui b/kmymoney2/dialogs/settings/ksettingscolorsdecl.ui new file mode 100644 index 0000000..2d4d15b --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingscolorsdecl.ui @@ -0,0 +1,406 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KSettingsColorsDecl</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KSettingsColorsDecl</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>453</width> + <height>402</height> + </rect> + </property> + <property name="caption"> + <string>Color settings</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QTabWidget"> + <property name="name"> + <cstring>tabWidget2</cstring> + </property> + <widget class="QWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <attribute name="title"> + <string>Foreground</string> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupBox3</cstring> + </property> + <property name="title"> + <string>Text colors</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>textLabel3</cstring> + </property> + <property name="text"> + <string>Grid color</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel1_3</cstring> + </property> + <property name="text"> + <string>Erronous transaction</string> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>textLabel4</cstring> + </property> + <property name="text"> + <string>Value with missing conversion rate</string> + </property> + </widget> + <widget class="KColorButton" row="2" column="1"> + <property name="name"> + <cstring>kcfg_listMissingConversionRate</cstring> + </property> + <property name="text"> + <string></string> + </property> + <property name="color"> + <color> + <red>0</red> + <green>0</green> + <blue>255</blue> + </color> + </property> + </widget> + <widget class="KColorButton" row="3" column="1"> + <property name="name"> + <cstring>kcfg_listNegativeValueColor</cstring> + </property> + <property name="text"> + <string></string> + </property> + <property name="color"> + <color> + <red>255</red> + <green>0</green> + <blue>0</blue> + </color> + </property> + </widget> + <widget class="QLabel" row="3" column="0"> + <property name="name"> + <cstring>textLabel5</cstring> + </property> + <property name="text"> + <string>Negative value</string> + </property> + </widget> + <widget class="KColorButton" row="1" column="1"> + <property name="name"> + <cstring>kcfg_listErronousTransactionColor</cstring> + </property> + <property name="text"> + <string></string> + </property> + <property name="color"> + <color> + <red>255</red> + <green>0</green> + <blue>0</blue> + </color> + </property> + </widget> + <widget class="KColorButton" row="0" column="1"> + <property name="name"> + <cstring>kcfg_listGridColor</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string></string> + </property> + <property name="color"> + <color> + <red>154</red> + <green>154</green> + <blue>154</blue> + </color> + </property> + </widget> + </grid> + </widget> + <spacer> + <property name="name"> + <cstring>spacer3</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>21</width> + <height>20</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <attribute name="title"> + <string>Background</string> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_useSystemColors</cstring> + </property> + <property name="text"> + <string>Use system colors</string> + </property> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>m_individualColorFrame</cstring> + </property> + <property name="title"> + <string>List background colors</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>Normal</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>Alternate</string> + </property> + </widget> + <widget class="KColorButton" row="1" column="1"> + <property name="name"> + <cstring>kcfg_listColor</cstring> + </property> + <property name="text"> + <string></string> + </property> + <property name="color"> + <color> + <red>240</red> + <green>240</green> + <blue>240</blue> + </color> + </property> + </widget> + <widget class="KColorButton" row="0" column="1"> + <property name="name"> + <cstring>kcfg_listBGColor</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string></string> + </property> + <property name="color"> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </property> + </widget> + </grid> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupBox5</cstring> + </property> + <property name="title"> + <string>Special background colors</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>textLabel1_5</cstring> + </property> + <property name="text"> + <string>Ledger group separator</string> + </property> + </widget> + <widget class="KColorButton" row="0" column="1"> + <property name="name"> + <cstring>kcfg_groupMarkerColor</cstring> + </property> + <property name="text"> + <string></string> + </property> + <property name="color"> + <color> + <red>255</red> + <green>170</green> + <blue>0</blue> + </color> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel1_2</cstring> + </property> + <property name="text"> + <string>Required field</string> + </property> + </widget> + <widget class="KColorButton" row="1" column="1"> + <property name="name"> + <cstring>kcfg_requiredFieldColor</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string></string> + </property> + <property name="color"> + <color> + <red>255</red> + <green>255</green> + <blue>221</blue> + </color> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>textLabel1_4</cstring> + </property> + <property name="text"> + <string>Imported transaction</string> + </property> + </widget> + <widget class="KColorButton" row="2" column="1"> + <property name="name"> + <cstring>kcfg_importedTransactionColor</cstring> + </property> + <property name="text"> + <string></string> + </property> + <property name="color"> + <color> + <red>255</red> + <green>255</green> + <blue>0</blue> + </color> + </property> + </widget> + <widget class="QLabel" row="3" column="0"> + <property name="name"> + <cstring>textLabel2_2</cstring> + </property> + <property name="text"> + <string>Matched transaction</string> + </property> + </widget> + <widget class="KColorButton" row="3" column="1"> + <property name="name"> + <cstring>kcfg_matchedTransactionColor</cstring> + </property> + <property name="paletteBackgroundColor"> + <color> + <red>255</red> + <green>255</green> + <blue>221</blue> + </color> + </property> + <property name="text"> + <string></string> + </property> + <property name="color"> + <color> + <red>152</red> + <green>251</green> + <blue>152</blue> + </color> + </property> + </widget> + </grid> + </widget> + <spacer> + <property name="name"> + <cstring>spacer2</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </vbox> + </widget> + </widget> + </vbox> +</widget> +<connections> + <connection> + <sender>kcfg_useSystemColors</sender> + <signal>toggled(bool)</signal> + <receiver>m_individualColorFrame</receiver> + <slot>setDisabled(bool)</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kmymoney2/dialogs/settings/ksettingsfonts.cpp b/kmymoney2/dialogs/settings/ksettingsfonts.cpp new file mode 100644 index 0000000..a4aef71 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsfonts.cpp @@ -0,0 +1,37 @@ +/*************************************************************************** + ksettingsfonts.cpp + -------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "ksettingsfonts.h" + +KSettingsFonts::KSettingsFonts(QWidget* parent, const char* name) : + KSettingsFontsDecl(parent, name) +{ +} + +KSettingsFonts::~KSettingsFonts() +{ +} + +#include "ksettingsfonts.moc" diff --git a/kmymoney2/dialogs/settings/ksettingsfonts.h b/kmymoney2/dialogs/settings/ksettingsfonts.h new file mode 100644 index 0000000..40cb9de --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsfonts.h @@ -0,0 +1,40 @@ +/*************************************************************************** + ksettingsfonts.h + ------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSETTINGSFONTS_H +#define KSETTINGSFONTS_H + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "kmymoney2/dialogs/settings/ksettingsfontsdecl.h" + +class KSettingsFonts : public KSettingsFontsDecl +{ + Q_OBJECT + +public: + KSettingsFonts(QWidget* parent = 0, const char* name = 0); + ~KSettingsFonts(); +}; +#endif + diff --git a/kmymoney2/dialogs/settings/ksettingsfontsdecl.ui b/kmymoney2/dialogs/settings/ksettingsfontsdecl.ui new file mode 100644 index 0000000..cbaefeb --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsfontsdecl.ui @@ -0,0 +1,131 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KSettingsFontsDecl</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KSettingsFontsDecl</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>398</width> + <height>222</height> + </rect> + </property> + <property name="caption"> + <string>Font settings</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_useSystemFont</cstring> + </property> + <property name="text"> + <string>Use system fonts</string> + </property> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>m_individualFontsFrame</cstring> + </property> + <property name="title"> + <string>Individual font settings</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KFontRequester" row="0" column="2"> + <property name="name"> + <cstring>kcfg_listCellFont</cstring> + </property> + </widget> + <widget class="KFontRequester" row="1" column="2"> + <property name="name"> + <cstring>kcfg_listHeaderFont</cstring> + </property> + </widget> + <spacer row="0" column="1"> + <property name="name"> + <cstring>spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>110</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="1" column="1"> + <property name="name"> + <cstring>spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>100</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>Cell font</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>Header font</string> + </property> + </widget> + </grid> + </widget> + <spacer> + <property name="name"> + <cstring>spacer1</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>30</height> + </size> + </property> + </spacer> + </vbox> +</widget> +<connections> + <connection> + <sender>kcfg_useSystemFont</sender> + <signal>toggled(bool)</signal> + <receiver>m_individualFontsFrame</receiver> + <slot>setDisabled(bool)</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kmymoney2/dialogs/settings/ksettingsforecast.cpp b/kmymoney2/dialogs/settings/ksettingsforecast.cpp new file mode 100644 index 0000000..0a74252 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsforecast.cpp @@ -0,0 +1,37 @@ +/*************************************************************************** + ksettingsforecast.cpp + -------------------- + copyright : (C) 2007 by Alvaro Soliverez + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "ksettingsforecast.h" + +KSettingsForecast::KSettingsForecast(QWidget* parent, const char* name) : + KSettingsForecastDecl(parent, name) +{ +} + +KSettingsForecast::~KSettingsForecast() +{ +} + +#include "ksettingsforecast.moc" diff --git a/kmymoney2/dialogs/settings/ksettingsforecast.h b/kmymoney2/dialogs/settings/ksettingsforecast.h new file mode 100644 index 0000000..7195eee --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsforecast.h @@ -0,0 +1,41 @@ +/*************************************************************************** + ksettingsforecast.h + ------------------- + copyright : (C) 2007 by Alvaro Soliverez + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSETTINGSFORECAST_H +#define KSETTINGSFORECAST_H + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "kmymoney2/dialogs/settings/ksettingsforecastdecl.h" + +class KSettingsForecast : public KSettingsForecastDecl +{ + Q_OBJECT + +public: + KSettingsForecast(QWidget* parent = 0, const char* name = 0); + ~KSettingsForecast(); +}; +#endif + diff --git a/kmymoney2/dialogs/settings/ksettingsforecastdecl.ui b/kmymoney2/dialogs/settings/ksettingsforecastdecl.ui new file mode 100644 index 0000000..c412f81 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsforecastdecl.ui @@ -0,0 +1,268 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KSettingsForecastDecl</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KSettingsForecastDecl</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>497</width> + <height>379</height> + </rect> + </property> + <property name="caption"> + <string>Forecast Settings</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QGroupBox" row="0" column="0"> + <property name="name"> + <cstring>groupBox6</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string></string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget" row="0" column="0"> + <property name="name"> + <cstring>layout7</cstring> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget" row="0" column="0"> + <property name="name"> + <cstring>layout5</cstring> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QSpinBox" row="1" column="1"> + <property name="name"> + <cstring>kcfg_forecastAccountCycle</cstring> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>Number of Days of Account Cycle:</string> + </property> + </widget> + <widget class="QSpinBox" row="0" column="1"> + <property name="name"> + <cstring>kcfg_forecastDays</cstring> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>Day of Month to start Forecast:</string> + </property> + </widget> + <widget class="QSpinBox" row="2" column="1"> + <property name="name"> + <cstring>kcfg_beginForecastDay</cstring> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>textLabel4</cstring> + </property> + <property name="text"> + <string>Number of Days to Forecast:</string> + </property> + </widget> + </grid> + </widget> + <spacer row="0" column="1"> + <property name="name"> + <cstring>spacer6</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>133</width> + <height>21</height> + </size> + </property> + </spacer> + </grid> + </widget> + <widget class="QButtonGroup" row="1" column="0"> + <property name="name"> + <cstring>kcfg_forecastMethod</cstring> + </property> + <property name="title"> + <string>Forecast Method</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QRadioButton"> + <property name="name"> + <cstring>radioButton9</cstring> + </property> + <property name="text"> + <string>Scheduled and Future Transactions</string> + </property> + <property name="buttonGroupId"> + <number>0</number> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>radioButton10</cstring> + </property> + <property name="text"> + <string>History-based</string> + </property> + <property name="buttonGroupId"> + <number>1</number> + </property> + </widget> + </vbox> + </widget> + <widget class="QGroupBox" row="2" column="0"> + <property name="name"> + <cstring>groupBox3</cstring> + </property> + <property name="title"> + <string>History-based settings</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel3</cstring> + </property> + <property name="text"> + <string>Number of Cycles to use in Forecast:</string> + </property> + </widget> + <widget class="QSpinBox"> + <property name="name"> + <cstring>kcfg_forecastCycles</cstring> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer7</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>130</width> + <height>21</height> + </size> + </property> + </spacer> + </hbox> + <widget class="QButtonGroup" row="1" column="0"> + <property name="name"> + <cstring>kcfg_historyMethod</cstring> + </property> + <property name="title"> + <string>History Forecast Method</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QRadioButton"> + <property name="name"> + <cstring>radioButton11</cstring> + </property> + <property name="text"> + <string>Simple Moving Average</string> + </property> + <property name="buttonGroupId"> + <number>0</number> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>radioButton12</cstring> + </property> + <property name="text"> + <string>Weighted Moving Average</string> + </property> + <property name="buttonGroupId"> + <number>1</number> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>radioButton13</cstring> + </property> + <property name="text"> + <string>Linear Regression</string> + </property> + <property name="buttonGroupId"> + <number>2</number> + </property> + </widget> + </vbox> + </widget> + </vbox> + </widget> + </grid> + </widget> + <spacer row="1" column="0"> + <property name="name"> + <cstring>spacer10</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </grid> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kmymoney2/dialogs/settings/ksettingsgeneral.cpp b/kmymoney2/dialogs/settings/ksettingsgeneral.cpp new file mode 100644 index 0000000..5acdd08 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsgeneral.cpp @@ -0,0 +1,63 @@ +/*************************************************************************** + ksettingsgeneral.cpp + -------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// ---------------------------------------------------------------------------- +// QT Includes + +#include <qlabel.h> + +// ---------------------------------------------------------------------------- +// KDE Includes + +#include <klineedit.h> +#include <klistview.h> + +// ---------------------------------------------------------------------------- +// Project Includes + +#include <kmymoney/kmymoneydateinput.h> +#include "ksettingsgeneral.h" + +KSettingsGeneral::KSettingsGeneral(QWidget* parent, const char* name) : + KSettingsGeneralDecl(parent, name) +{ + // hide the internally used date field + kcfg_StartDate->hide(); + kcfg_hiddenViews->hide(); + + // for now, we don't show the widgets for view selection + m_viewLabel->hide(); + m_viewList->hide(); + + // setup connections, so that the sort optios get loaded once the edit fields are filled + connect(kcfg_StartDate, SIGNAL(valueChanged(const QDate&)), this, SLOT(slotLoadStartDate(const QDate&))); + + // setup connections, so that changes by the user are forwarded to the (hidden) edit fields + connect(m_startDateEdit, SIGNAL(dateChanged(const QDate&)), kcfg_StartDate, SLOT(setDate(const QDate&))); +} + +KSettingsGeneral::~KSettingsGeneral() +{ +} + +void KSettingsGeneral::slotLoadStartDate(const QDate&) +{ + // only need this once + disconnect(kcfg_StartDate, SIGNAL(valueChanged(const QDate&)), this, SLOT(slotLoadStartDate(const QDate&))); + m_startDateEdit->setDate(kcfg_StartDate->date()); +} + +#include "ksettingsgeneral.moc" diff --git a/kmymoney2/dialogs/settings/ksettingsgeneral.h b/kmymoney2/dialogs/settings/ksettingsgeneral.h new file mode 100644 index 0000000..3bd0992 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsgeneral.h @@ -0,0 +1,44 @@ +/*************************************************************************** + ksettingsgeneral.h + ------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSETTINGSGENERAL_H +#define KSETTINGSGENERAL_H + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "kmymoney2/dialogs/settings/ksettingsgeneraldecl.h" + +class KSettingsGeneral : public KSettingsGeneralDecl +{ + Q_OBJECT + +public: + KSettingsGeneral(QWidget* parent = 0, const char* name = 0); + ~KSettingsGeneral(); + +protected slots: + void slotLoadStartDate(const QDate&); + +}; +#endif + diff --git a/kmymoney2/dialogs/settings/ksettingsgeneraldecl.ui b/kmymoney2/dialogs/settings/ksettingsgeneraldecl.ui new file mode 100644 index 0000000..9eeb181 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsgeneraldecl.ui @@ -0,0 +1,646 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KSettingsGeneralDecl</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KSettingsGeneralDecl</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>614</width> + <height>438</height> + </rect> + </property> + <property name="caption"> + <string>General Settings</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QTabWidget"> + <property name="name"> + <cstring>tabWidget2</cstring> + </property> + <widget class="QWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <attribute name="title"> + <string>Global</string> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QButtonGroup"> + <property name="name"> + <cstring>kcfg_StartLastViewSelected</cstring> + </property> + <property name="title"> + <string>Startup page options</string> + </property> + <property name="exclusive"> + <bool>true</bool> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QRadioButton"> + <property name="name"> + <cstring>radioButton1</cstring> + </property> + <property name="text"> + <string>Start with homepage</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="buttonGroupId"> + <number>0</number> + </property> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>radioButton2</cstring> + </property> + <property name="text"> + <string>Start with last selected view</string> + </property> + <property name="buttonGroupId"> + <number>1</number> + </property> + </widget> + </vbox> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupBox1</cstring> + </property> + <property name="title"> + <string>Precision settings</string> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>Price precision</string> + </property> + </widget> + <widget class="QSpinBox"> + <property name="name"> + <cstring>kcfg_PricePrecision</cstring> + </property> + <property name="maxValue"> + <number>10</number> + </property> + </widget> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>digits</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>61</width> + <height>21</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupBox3</cstring> + </property> + <property name="title"> + <string>Autosave options</string> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_AutoSaveFile</cstring> + </property> + <property name="text"> + <string>Autosave periodically</string> + </property> + </widget> + <widget class="QFrame"> + <property name="name"> + <cstring>m_periodFrame</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="frameShape"> + <enum>NoFrame</enum> + </property> + <property name="frameShadow"> + <enum>Plain</enum> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <widget class="QSpinBox"> + <property name="name"> + <cstring>kcfg_AutoSavePeriod</cstring> + </property> + <property name="maxValue"> + <number>60</number> + </property> + </widget> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel3</cstring> + </property> + <property name="text"> + <string>minutes</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>354</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + </hbox> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupBox6</cstring> + </property> + <property name="title"> + <string>Fiscal Year</string> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel1_2_2</cstring> + </property> + <property name="text"> + <string>Your fiscal year starts on</string> + </property> + </widget> + <widget class="KIntSpinBox"> + <property name="name"> + <cstring>kcfg_FiscalYearBeginDay</cstring> + </property> + </widget> + <widget class="KComboBox"> + <item> + <property name="text"> + <string>January</string> + </property> + </item> + <item> + <property name="text"> + <string>February</string> + </property> + </item> + <item> + <property name="text"> + <string>March</string> + </property> + </item> + <item> + <property name="text"> + <string>April</string> + </property> + </item> + <item> + <property name="text"> + <string>May</string> + </property> + </item> + <item> + <property name="text"> + <string>June</string> + </property> + </item> + <item> + <property name="text"> + <string>July</string> + </property> + </item> + <item> + <property name="text"> + <string>August</string> + </property> + </item> + <item> + <property name="text"> + <string>September</string> + </property> + </item> + <item> + <property name="text"> + <string>October</string> + </property> + </item> + <item> + <property name="text"> + <string>November</string> + </property> + </item> + <item> + <property name="text"> + <string>December</string> + </property> + </item> + <property name="name"> + <cstring>kcfg_FiscalYearBegin</cstring> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer11</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>90</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <spacer> + <property name="name"> + <cstring>spacer3_2</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <attribute name="title"> + <string>Views</string> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_syncLedgerInvestment</cstring> + </property> + <property name="text"> + <string>Synchronize account selection of ledger and investment view</string> + </property> + </widget> + <widget class="KLineEdit"> + <property name="name"> + <cstring>kcfg_hiddenViews</cstring> + </property> + <property name="enabled"> + <bool>true</bool> + </property> + </widget> + <widget class="QLabel"> + <property name="name"> + <cstring>m_viewLabel</cstring> + </property> + <property name="text"> + <string>Check the views you want to enable, uncheck those you want to hide, because you don't need the functionality.</string> + </property> + <property name="alignment"> + <set>WordBreak|AlignTop</set> + </property> + </widget> + <widget class="KListView"> + <property name="name"> + <cstring>m_viewList</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>0</horstretch> + <verstretch>2</verstretch> + </sizepolicy> + </property> + </widget> + <widget class="QButtonGroup"> + <property name="name"> + <cstring>kcfg_iconSize</cstring> + </property> + <property name="title"> + <string>Icon size of navigation bar</string> + </property> + <property name="exclusive"> + <bool>true</bool> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QRadioButton" row="0" column="0"> + <property name="name"> + <cstring>radioButton3</cstring> + </property> + <property name="text"> + <string>Micro (16px)</string> + </property> + </widget> + <widget class="QRadioButton" row="1" column="0"> + <property name="name"> + <cstring>radioButton4</cstring> + </property> + <property name="text"> + <string>Small (32px)</string> + </property> + </widget> + <widget class="QRadioButton" row="0" column="1"> + <property name="name"> + <cstring>radioButton5</cstring> + </property> + <property name="text"> + <string>Normal (48px)</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + </widget> + <widget class="QRadioButton" row="1" column="1"> + <property name="name"> + <cstring>radioButton6</cstring> + </property> + <property name="text"> + <string>Large (64px)</string> + </property> + </widget> + </grid> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_showTitleBar</cstring> + </property> + <property name="text"> + <string>Show title bar on each page</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer7</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>21</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>TabPage</cstring> + </property> + <attribute name="title"> + <string>Filter</string> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupBox2</cstring> + </property> + <property name="title"> + <string>Accounts / Categories</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_HideUnusedCategory</cstring> + </property> + <property name="text"> + <string>Don't show unused categories</string> + </property> + <property name="whatsThis" stdset="0"> + <string>This option hides all categories in the categories view that are not used in at least a single transaction. They are still shown in the category selection lists.</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_HideClosedAccounts</cstring> + </property> + <property name="text"> + <string>Don't show closed accounts</string> + </property> + <property name="whatsThis" stdset="0"> + <string>This option hides all accounts that have been closed by the user in views and selection lists. + +You can use <b>View/Show all accounts</b> to temporarily show hidden accounts in the views.</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_ExpertMode</cstring> + </property> + <property name="text"> + <string>Show equity accounts</string> + </property> + </widget> + </vbox> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupBox4</cstring> + </property> + <property name="title"> + <string>Schedules</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_HideFinishedSchedules</cstring> + </property> + <property name="text"> + <string>Don't show finished schedules</string> + </property> + <property name="whatsThis" stdset="0"> + <string>This option hides all finished schedules in the schedules view.</string> + </property> + </widget> + </vbox> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupBox5</cstring> + </property> + <property name="title"> + <string>Transactions</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout2</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel1_3</cstring> + </property> + <property name="text"> + <string>Don't show transactions prior to</string> + </property> + </widget> + <widget class="kMyMoneyDateInput"> + <property name="name"> + <cstring>m_startDateEdit</cstring> + </property> + </widget> + <widget class="QDateEdit"> + <property name="name"> + <cstring>kcfg_StartDate</cstring> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer10</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>63</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_HideReconciledTransactions</cstring> + </property> + <property name="text"> + <string>Don't show reconciled transactions</string> + </property> + <property name="whatsThis" stdset="0"> + <string>This option hides all reconciled transactions in the ledger view.</string> + </property> + </widget> + </vbox> + </widget> + <spacer> + <property name="name"> + <cstring>spacer4</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>30</height> + </size> + </property> + </spacer> + </vbox> + </widget> + </widget> + </vbox> +</widget> +<customwidgets> +</customwidgets> +<connections> + <connection> + <sender>kcfg_AutoSaveFile</sender> + <signal>toggled(bool)</signal> + <receiver>m_periodFrame</receiver> + <slot>setEnabled(bool)</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kmymoney2/dialogs/settings/ksettingsgpg.cpp b/kmymoney2/dialogs/settings/ksettingsgpg.cpp new file mode 100644 index 0000000..2dba83e --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsgpg.cpp @@ -0,0 +1,200 @@ +/*************************************************************************** + ksettingsgpg.cpp + -------------------- + copyright : (C) 2005, 2008 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// ---------------------------------------------------------------------------- +// QT Includes + +#include <qgroupbox.h> +#include <qcheckbox.h> +#include <qregexp.h> + +// ---------------------------------------------------------------------------- +// KDE Includes + +#include <kled.h> +#include <klineedit.h> +#include <keditlistbox.h> +#include <kcombobox.h> +#include <kmessagebox.h> +#include <klocale.h> + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "ksettingsgpg.h" +#include <kmymoney/kgpgfile.h> + +#define RECOVER_KEY_ID "0xD2B08440" +#define RECOVER_KEY_ID_FULL "59B0F826D2B08440" + +KSettingsGpg::KSettingsGpg(QWidget* parent, const char* name) : + KSettingsGpgDecl(parent, name), + m_checkCount(0), + m_needCheckList(true), + m_listOk(false) +{ + setEnabled(KGPGFile::GPGAvailable()); + + // don't show the widget in which the master key is actually kept + kcfg_GpgRecipient->hide(); + + connect(kcfg_WriteDataEncrypted, SIGNAL(toggled(bool)), this, SLOT(slotStatusChanged(bool))); + connect(m_masterKeyCombo, SIGNAL(activated(int)), this, SLOT(slotIdChanged())); + connect(kcfg_GpgRecipientList, SIGNAL(changed()), this, SLOT(slotIdChanged())); + connect(kcfg_GpgRecipientList, SIGNAL(added(const QString&)), this, SLOT(slotKeyListChanged())); + connect(kcfg_GpgRecipientList, SIGNAL(removed(const QString&)), this, SLOT(slotKeyListChanged())); + + // Initial state setup + slotStatusChanged(kcfg_WriteDataEncrypted->isChecked()); +} + +KSettingsGpg::~KSettingsGpg() +{ +} + +void KSettingsGpg::slotKeyListChanged(void) +{ + m_needCheckList = true; + slotIdChanged(); +} + +void KSettingsGpg::slotIdChanged(void) +{ + // this looks a bit awkward. Here's why: KGPGFile::keyAvailable() starts + // an external task and processes UI events while it waits for the external + // process to finish. Thus, the first time we get here, the external process + // is started and the user may press a second key which calls this routine + // again. + // + // The second invocation is counted, but the check is not started until the + // first one finishes. Once the external process finishes, we check if we + // were called in the meantime and restart the check. + if(++m_checkCount == 1) { + while(1) { + // first we check the current edit field if filled + bool keysOk = true; + if(!kcfg_GpgRecipientList->currentText().isEmpty()) { + keysOk = KGPGFile::keyAvailable(kcfg_GpgRecipientList->currentText()); + } + + // if it is available, then scan the current list if we need to + if(keysOk) { + if(m_needCheckList) { + QStringList keys = kcfg_GpgRecipientList->items(); + QStringList::const_iterator it_s; + for(it_s = keys.begin(); keysOk && it_s != keys.end(); ++it_s) { + if(!KGPGFile::keyAvailable(*it_s)) + keysOk = false; + } + m_listOk = keysOk; + m_needCheckList = false; + + } else { + keysOk = m_listOk; + } + } + + // did we receive some more requests to check? + if(m_checkCount > 1) { + m_checkCount = 1; + continue; + } + + // if we have a master key, we store it in the hidden widget + if(m_masterKeyCombo->currentItem() != 0) { + QRegExp keyExp(".* \\((.*)\\)"); + if(keyExp.search(m_masterKeyCombo->currentText()) != -1) { + kcfg_GpgRecipient->setText(keyExp.cap(1)); + } + } + + m_userKeysFound->setState(static_cast<KLed::State>(keysOk && (kcfg_GpgRecipientList->items().count() != 0) ? KLed::On : KLed::Off)); + break; + } + + --m_checkCount; + } +} + +void KSettingsGpg::show(void) +{ + QString masterKey; + + if(m_masterKeyCombo->currentItem() != 0) { + QRegExp keyExp(".* \\((.*)\\)"); + if(keyExp.search(m_masterKeyCombo->currentText()) != -1) { + masterKey = keyExp.cap(1); + } + } else + masterKey = kcfg_GpgRecipient->text(); + + // fill the secret key combobox with a fresh list + m_masterKeyCombo->clear(); + QStringList keyList; + KGPGFile::secretKeyList(keyList); + + for(QStringList::iterator it = keyList.begin(); it != keyList.end(); ++it) { + QStringList fields = QStringList::split(":", *it); + if(fields[0] != RECOVER_KEY_ID_FULL) { + // replace parenthesis in name field with brackets + QString name = fields[1]; + name.replace('(', "["); + name.replace(')', "]"); + name = QString("%1 (0x%2)").arg(name).arg(fields[0]); + m_masterKeyCombo->insertItem(name); + if(name.contains(masterKey)) + m_masterKeyCombo->setCurrentItem(name); + } + } + + // if we don't have at least one secret key, we turn off encryption + if(keyList.isEmpty()) { + setEnabled(false); + kcfg_WriteDataEncrypted->setChecked(false); + } + + slotStatusChanged(kcfg_WriteDataEncrypted->isChecked()); + KSettingsGpgDecl::show(); +} + +void KSettingsGpg::slotStatusChanged(bool state) +{ + static bool oncePerSession = true; + if(state && !KGPGFile::GPGAvailable()) + state = false; + + if((state == true) && (oncePerSession == true) && isVisible()) { + KMessageBox::information(this, QString("<qt>%1</qt>").arg(i18n("You have turned on the GPG encryption support. This means, that new files will be stored encrypted. Existing files will not be encrypted automatically. To achieve encryption of existing files, please use the <b>File/Save as...</b> feature and store the file under a different name. Once confident with the result, feel free to delete the old file and rename the encrypted one to the old name.")), i18n("GPG encryption activated"), "GpgEncryptionActivated"); + oncePerSession = false; + } + + m_idGroup->setEnabled(state); + kcfg_EncryptRecover->setEnabled(state); + m_masterKeyCombo->setEnabled(state); + kcfg_GpgRecipientList->setEnabled(state); + + if(state) { + m_recoverKeyFound->setState((KLed::State) (KGPGFile::keyAvailable(RECOVER_KEY_ID) ? KLed::On : KLed::Off)); + kcfg_EncryptRecover->setEnabled(m_recoverKeyFound->state() == KLed::On); + slotIdChanged(); + + } else { + m_recoverKeyFound->setState(KLed::Off); + m_userKeysFound->setState(KLed::Off); + } +} + +#include "ksettingsgpg.moc" diff --git a/kmymoney2/dialogs/settings/ksettingsgpg.h b/kmymoney2/dialogs/settings/ksettingsgpg.h new file mode 100644 index 0000000..ecea6ab --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsgpg.h @@ -0,0 +1,54 @@ +/*************************************************************************** + ksettingsgpg.h + ------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSETTINGSGPG_H +#define KSETTINGSGPG_H + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "kmymoney2/dialogs/settings/ksettingsgpgdecl.h" + +class KSettingsGpg : public KSettingsGpgDecl +{ + Q_OBJECT + +public: + KSettingsGpg(QWidget* parent = 0, const char* name = 0); + ~KSettingsGpg(); + +public slots: + void show(void); + +protected slots: + void slotStatusChanged(bool state); + void slotIdChanged(void); + void slotKeyListChanged(void); + +private: + int m_checkCount; + bool m_needCheckList; + bool m_listOk; +}; +#endif + diff --git a/kmymoney2/dialogs/settings/ksettingsgpgdecl.ui b/kmymoney2/dialogs/settings/ksettingsgpgdecl.ui new file mode 100644 index 0000000..15d3bbe --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsgpgdecl.ui @@ -0,0 +1,238 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KSettingsGpgDecl</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KSettingsGpgDecl</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>601</width> + <height>418</height> + </rect> + </property> + <property name="caption"> + <string>GPG encryption settings</string> + </property> + <property name="whatsThis" stdset="0"> + <string>This page allows you to set the parameters for encrypted file storage of your <b>KMyMoney</b> data based on <b>GPG</b>.<p> +Access to the settings is disabled if <b>GPG</b> could not be detected on your system. In this case, please make sure that <b>GPG</b> is working properly for the current user.<p> +The <i>additional recovery encryption</i> is only accessible, if the necessary key for <b>[email protected]</b> with id 0x8AFDDC8E is found in your keyring.</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_WriteDataEncrypted</cstring> + </property> + <property name="text"> + <string>Use GPG encryption</string> + </property> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>m_idGroup</cstring> + </property> + <property name="enabled"> + <bool>true</bool> + </property> + <property name="title"> + <string>GPG encryption</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout3</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel1_2</cstring> + </property> + <property name="text"> + <string>Your key</string> + </property> + </widget> + <widget class="KComboBox"> + <property name="name"> + <cstring>m_masterKeyCombo</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>1</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="whatsThis" stdset="0"> + <string>This combo box lists all the secret keys you have in your keyring. Select the one you want to use for encryption when saving to a file.</string> + </property> + </widget> + </hbox> + </widget> + <widget class="KLineEdit"> + <property name="name"> + <cstring>kcfg_GpgRecipient</cstring> + </property> + </widget> + <widget class="KEditListBox"> + <property name="name"> + <cstring>kcfg_GpgRecipientList</cstring> + </property> + <property name="title"> + <string>Additonal keys</string> + </property> + <property name="checkable"> + <bool>false</bool> + </property> + <property name="buttons"> + <set>Remove|Add</set> + </property> + <property name="whatsThis" stdset="0"> + <string>Enter the id of the key you want to use for data encryption. This can either be an e-mail address or the hexadecimal key id. In case of the key id don't forget the leading 0x.</string> + </property> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout6</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KLed"> + <property name="name"> + <cstring>m_userKeysFound</cstring> + </property> + <property name="shape"> + <enum>Circular</enum> + </property> + <property name="look"> + <enum>Sunken</enum> + </property> + <property name="whatsThis" stdset="0"> + <string>This symbol denotes, if the key for the given user id has been found in your keyring. It is green when found, dark otherwise.</string> + </property> + </widget> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>Keys for all of the above user ids found</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>50</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout5</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KLed"> + <property name="name"> + <cstring>m_recoverKeyFound</cstring> + </property> + <property name="shape"> + <enum>Circular</enum> + </property> + <property name="look"> + <enum>Sunken</enum> + </property> + <property name="whatsThis" stdset="0"> + <string>This symbol denotes, if the KMyMoney recovery key has been found in your keyring. It is green when found, dark otherwise.</string> + </property> + </widget> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>Recover Key available in keyring</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer6</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>16</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_EncryptRecover</cstring> + </property> + <property name="text"> + <string>Also encrypt with KMyMoney's recover key</string> + </property> + <property name="whatsThis" stdset="0"> + <string>You can specify to encrypt the data also with the KMyMoney recover key. Only the core KMyMoney developers are in posession of the respective private key required to read back such encrypted data.<p> + +This mechanism is provided for the case that you have lost your key and cannot access your data anymore. With this option activated, the KMyMoney developers can decrypt the data and supply you with it in a readable form. Please be prepared, that you have to answer a few detailed questions about the contents of your data before we will send it out..</string> + </property> + </widget> + </vbox> + </widget> + <spacer> + <property name="name"> + <cstring>spacer5</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>21</width> + <height>30</height> + </size> + </property> + </spacer> + </vbox> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kmymoney2/dialogs/settings/ksettingshome.cpp b/kmymoney2/dialogs/settings/ksettingshome.cpp new file mode 100644 index 0000000..d2f471b --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingshome.cpp @@ -0,0 +1,173 @@ +/*************************************************************************** + ksettingshome.cpp + -------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// ---------------------------------------------------------------------------- +// QT Includes + +#include <qstringlist.h> +#include <qheader.h> + +// ---------------------------------------------------------------------------- +// KDE Includes + +#include <klistview.h> +#include <kpushbutton.h> +#include <kglobalsettings.h> +#include <kglobal.h> +#include <kiconloader.h> +#include <klocale.h> +#include <ktextedit.h> + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "ksettingshome.h" +#include "kmymoney2/kmymoneyglobalsettings.h" +#include "kmymoney2/kmymoneyutils.h" + +KSettingsHome::KSettingsHome(QWidget* parent, const char* name) : + KSettingsHomeDecl(parent, name), + m_noNeedToUpdateList(false) +{ + m_homePageList->addColumn(""); + m_homePageList->setSorting(-1); + m_homePageList->header()->hide(); + m_homePageList->setAllColumnsShowFocus(true); + + KIconLoader* il = KGlobal::iconLoader(); + KGuiItem upButtonItem( i18n( "&Up" ), + QIconSet(il->loadIcon("up", KIcon::Small, KIcon::SizeSmall)), + i18n("Move selected item up"), + i18n("Use this to move the selected item up by one position in the list.")); + KGuiItem downButtonItem( i18n( "&Down" ), + QIconSet(il->loadIcon("down", KIcon::Small, KIcon::SizeSmall)), + i18n("Move selected item down"), + i18n("Use this to move the selected item down by one position in the list.")); + + m_upButton->setGuiItem(upButtonItem); + m_upButton->setEnabled(false); + m_downButton->setGuiItem(downButtonItem); + m_downButton->setEnabled(false); + + // connect this, so that the list gets loaded once the edit field is filled + connect(kcfg_ItemList, SIGNAL(textChanged()), this, SLOT(slotLoadItems())); + + connect(m_homePageList, SIGNAL(selectionChanged(QListViewItem*)), + this, SLOT(slotSelectHomePageItem(QListViewItem *))); + connect(m_homePageList, SIGNAL(pressed(QListViewItem*)), this, SLOT(slotUpdateItemList())); + + connect(m_upButton, SIGNAL(clicked()), this, SLOT(slotMoveUp())); + connect(m_downButton, SIGNAL(clicked()), this, SLOT(slotMoveDown())); + + // Don't show it to the user, we only need it to load and save the settings + kcfg_ItemList->hide(); +} + +KSettingsHome::~KSettingsHome() +{ +} + +void KSettingsHome::slotLoadItems(void) +{ + if(m_noNeedToUpdateList) + return; + + QStringList list = KMyMoneyGlobalSettings::itemList(); + QStringList::ConstIterator it; + int w = 0; + m_homePageList->clear(); + QCheckListItem *sel = 0; + + QFontMetrics fm( KGlobalSettings::generalFont()); + QCheckListItem* last = 0; + + for(it = list.begin(); it != list.end(); ++it) { + int idx = (*it).toInt(); + // skip over unknown item entries + if(idx == 0) + continue; + bool enabled = idx > 0; + if(!enabled) idx = -idx; + QCheckListItem* item = new QCheckListItem(m_homePageList, KMyMoneyUtils::homePageItemToString(idx), QCheckListItem::CheckBox); + if(last) + item->moveItem(last); + + // qDebug("Adding %s", item->text(0).latin1()); + item->setOn(enabled); + if(item->width(fm, m_homePageList, 0) > w) + w = item->width(fm, m_homePageList, 0); + + if(sel == 0) + sel = item; + last = item; + } + + if(sel) { + m_homePageList->setSelected(sel, true); + slotSelectHomePageItem(sel); + } +} + +void KSettingsHome::slotUpdateItemList(void) +{ + QString list; + QListViewItem *it; + + for(it = m_homePageList->firstChild(); it; ) { + int item = KMyMoneyUtils::stringToHomePageItem(it->text(0)); + if(!(static_cast<QCheckListItem*>(it)->isOn())) + item = -item; + list += QString::number(item); + it = it->nextSibling(); + if(it) + list += ","; + } + + // don't update the list + m_noNeedToUpdateList = true; + kcfg_ItemList->setText(list); + m_noNeedToUpdateList = false; +} + +void KSettingsHome::slotSelectHomePageItem(QListViewItem *item) +{ + m_upButton->setEnabled(m_homePageList->firstChild() != item); + m_downButton->setEnabled(item->nextSibling()); +} + +void KSettingsHome::slotMoveUp(void) +{ + QListViewItem *item = m_homePageList->currentItem(); + QListViewItem *prev = item->itemAbove(); + if(prev) { + prev->moveItem(item); + slotSelectHomePageItem(item); + slotUpdateItemList(); + } +} + +void KSettingsHome::slotMoveDown(void) +{ + QListViewItem *item = m_homePageList->currentItem(); + QListViewItem *next = item->nextSibling(); + if(next) { + item->moveItem(next); + slotSelectHomePageItem(item); + slotUpdateItemList(); + } +} + +#include "ksettingshome.moc" diff --git a/kmymoney2/dialogs/settings/ksettingshome.h b/kmymoney2/dialogs/settings/ksettingshome.h new file mode 100644 index 0000000..c461210 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingshome.h @@ -0,0 +1,52 @@ +/*************************************************************************** + ksettingshome.h + ------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSETTINGSHOME_H +#define KSETTINGSHOME_H + +// ---------------------------------------------------------------------------- +// QT Includes + +class QListViewItem; + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "kmymoney2/dialogs/settings/ksettingshomedecl.h" + +class KSettingsHome : public KSettingsHomeDecl +{ + Q_OBJECT + +public: + KSettingsHome(QWidget* parent = 0, const char* name = 0); + ~KSettingsHome(); + +protected slots: + void slotLoadItems(void); + void slotUpdateItemList(void); + void slotSelectHomePageItem(QListViewItem *); + void slotMoveUp(void); + void slotMoveDown(void); + +private: + bool m_noNeedToUpdateList; +}; +#endif + diff --git a/kmymoney2/dialogs/settings/ksettingshomedecl.ui b/kmymoney2/dialogs/settings/ksettingshomedecl.ui new file mode 100644 index 0000000..49f6251 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingshomedecl.ui @@ -0,0 +1,231 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KSettingsHomeDecl</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KSettingsHomeDecl</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>659</width> + <height>414</height> + </rect> + </property> + <property name="caption"> + <string>Homepage Settings</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout9</cstring> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget" row="0" column="2"> + <property name="name"> + <cstring>layout6</cstring> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <spacer> + <property name="name"> + <cstring>spacer5</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Fixed</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KPushButton"> + <property name="name"> + <cstring>m_upButton</cstring> + </property> + <property name="text"> + <string>Up</string> + </property> + </widget> + <widget class="KPushButton"> + <property name="name"> + <cstring>m_downButton</cstring> + </property> + <property name="text"> + <string>Down</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer15</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>21</width> + <height>70</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <spacer row="0" column="3"> + <property name="name"> + <cstring>spacer16</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>80</width> + <height>21</height> + </size> + </property> + </spacer> + <widget class="QLabel" row="1" column="2" rowspan="1" colspan="2"> + <property name="name"> + <cstring>textLabel4</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>1</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Selected entries are shown on the home page of the application.<p> +Use the buttons and checkboxes to customize the layout of the home page.</string> + </property> + <property name="alignment"> + <set>WordBreak|AlignTop</set> + </property> + </widget> + <widget class="KTextEdit" row="0" column="0" rowspan="2" colspan="1"> + <property name="name"> + <cstring>kcfg_ItemList</cstring> + </property> + <property name="text"> + <string></string> + </property> + </widget> + <widget class="KListView" row="0" column="1" rowspan="2" colspan="1"> + <property name="name"> + <cstring>m_homePageList</cstring> + </property> + <property name="fullWidth"> + <bool>true</bool> + </property> + </widget> + </grid> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupbox</cstring> + </property> + <property name="title"> + <string>Homepage/Summary page font scaling</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>percentageLabel</cstring> + </property> + <property name="text"> + <string>Percentage of default font size:</string> + </property> + </widget> + <widget class="QCheckBox" row="1" column="0" rowspan="1" colspan="3"> + <property name="name"> + <cstring>kcfg_RememberFontSize</cstring> + </property> + <property name="text"> + <string>Remember font size when leaving the program if manually changed with mouse-wheel</string> + </property> + </widget> + <widget class="KIntNumInput" row="0" column="1"> + <property name="name"> + <cstring>kcfg_FontSizePercentage</cstring> + </property> + <property name="value"> + <number>100</number> + </property> + <property name="minValue"> + <number>1</number> + </property> + <property name="maxValue"> + <number>1000</number> + </property> + </widget> + <spacer row="0" column="2"> + <property name="name"> + <cstring>spacer4</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>40</width> + <height>20</height> + </size> + </property> + </spacer> + </grid> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupbox2</cstring> + </property> + <property name="title"> + <string>Information display</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="3"> + <property name="name"> + <cstring>kcfg_ShowLimitInfo</cstring> + </property> + <property name="text"> + <string>Show Account Limit Information</string> + </property> + </widget> + </grid> + </widget> + </vbox> +</widget> +<customwidgets> +</customwidgets> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kmymoney2/dialogs/settings/ksettingsonlinequotes.cpp b/kmymoney2/dialogs/settings/ksettingsonlinequotes.cpp new file mode 100644 index 0000000..db4dc1e --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsonlinequotes.cpp @@ -0,0 +1,219 @@ +/*************************************************************************** + kmymoneyonlinequoteconfig.cpp - description + ------------------- + begin : Thu Dec 30 2004 + copyright : (C) 2004 by Thomas Baumgart + email : Thomas Baumgart <[email protected]> + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// ---------------------------------------------------------------------------- +// QT Includes + +#include <qregexp.h> +#include <qcheckbox.h> + +// ---------------------------------------------------------------------------- +// KDE Includes + +#include <kconfig.h> +#include <kglobal.h> +#include <klocale.h> +#include <klistview.h> +#include <kiconloader.h> +#include <kguiitem.h> +#include <kpushbutton.h> +#include <klineedit.h> + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "ksettingsonlinequotes.h" +#include "kmymoney2/converter/webpricequote.h" + +KSettingsOnlineQuotes::KSettingsOnlineQuotes(QWidget *parent, const char *name ) + : KSettingsOnlineQuotesDecl(parent, name) +{ + QStringList groups = WebPriceQuote::quoteSources(); + + loadList(true /*updateResetList*/); + + m_updateButton->setEnabled(false); + + KIconLoader* il = KGlobal::iconLoader(); + KGuiItem updateButtenItem( i18n("&Update" ), + QIconSet(il->loadIcon("button_ok", KIcon::Small, KIcon::SizeSmall)), + i18n("Accepts the entered data and stores it"), + i18n("Use this to accept the modified data.")); + m_updateButton->setGuiItem(updateButtenItem); + + KGuiItem deleteButtenItem( i18n( "&Delete" ), + QIconSet(il->loadIcon("editdelete", KIcon::Small, KIcon::SizeSmall)), + i18n("Delete the selected source entry"), + i18n("Use this to delete the selected online source entry")); + m_deleteButton->setGuiItem(deleteButtenItem); + + KGuiItem newButtenItem( i18n( "&New..." ), + QIconSet(il->loadIcon("filenew", KIcon::Small, KIcon::SizeSmall)), + i18n("Create a new source entry for online quotes"), + i18n("Use this to create a new entry for online quotes")); + m_newButton->setGuiItem(newButtenItem); + + connect(m_updateButton, SIGNAL(clicked()), this, SLOT(slotUpdateEntry())); + connect(m_newButton, SIGNAL(clicked()), this, SLOT(slotNewEntry())); + + connect(m_quoteSourceList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotLoadWidgets(QListViewItem*))); + connect(m_quoteSourceList, SIGNAL(clicked(QListViewItem*)), this, SLOT(slotLoadWidgets(QListViewItem*))); + connect(m_quoteSourceList, SIGNAL(itemRenamed(QListViewItem*,const QString&,int)), this, SLOT(slotEntryRenamed(QListViewItem*,const QString&,int))); + + connect(m_editURL, SIGNAL(textChanged(const QString&)), this, SLOT(slotEntryChanged())); + connect(m_editSymbol, SIGNAL(textChanged(const QString&)), this, SLOT(slotEntryChanged())); + connect(m_editDate, SIGNAL(textChanged(const QString&)), this, SLOT(slotEntryChanged())); + connect(m_editDateFormat, SIGNAL(textChanged(const QString&)), this, SLOT(slotEntryChanged())); + connect(m_editPrice, SIGNAL(textChanged(const QString&)), this, SLOT(slotEntryChanged())); + connect(m_skipStripping, SIGNAL(toggled(bool)), this, SLOT(slotEntryChanged())); + + // FIXME deleting a source is not yet implemented + m_deleteButton->setEnabled(false); +} + +void KSettingsOnlineQuotes::loadList(const bool updateResetList) +{ + QStringList groups = WebPriceQuote::quoteSources(); + + if(updateResetList) + m_resetList.clear(); + m_quoteSourceList->clear(); + QStringList::Iterator it; + for(it = groups.begin(); it != groups.end(); ++it) { + new QListViewItem(m_quoteSourceList, *it); + if(updateResetList) + m_resetList += WebPriceQuoteSource(*it); + } + + QListViewItem* first = m_quoteSourceList->firstChild(); + if(first) + m_quoteSourceList->setSelected(first, true); + slotLoadWidgets(first); + + m_newButton->setEnabled(m_quoteSourceList->findItem(i18n("New Quote Source"), 0) == 0); +} + +void KSettingsOnlineQuotes::resetConfig(void) +{ + QStringList::ConstIterator it; + QStringList groups = WebPriceQuote::quoteSources(); + + // delete all currently defined entries + for(it = groups.begin(); it != groups.end(); ++it) { + WebPriceQuoteSource(*it).remove(); + } + + // and write back the one's from the reset list + QValueList<WebPriceQuoteSource>::ConstIterator itr; + for(itr = m_resetList.begin(); itr != m_resetList.end(); ++itr) { + (*itr).write(); + } + + loadList(); +} + +void KSettingsOnlineQuotes::slotLoadWidgets(QListViewItem* item) +{ + m_editURL->setEnabled(true); + m_editSymbol->setEnabled(true); + m_editPrice->setEnabled(true); + m_editDate->setEnabled(true); + m_editDateFormat->setEnabled(true); + m_skipStripping->setEnabled(true); + m_editURL->setText(QString()); + m_editSymbol->setText(QString()); + m_editPrice->setText(QString()); + m_editDate->setText(QString()); + m_editDateFormat->setText(QString()); + + if(item) { + m_currentItem = WebPriceQuoteSource(item->text(0)); + m_editURL->setText(m_currentItem.m_url); + m_editSymbol->setText(m_currentItem.m_sym); + m_editPrice->setText(m_currentItem.m_price); + m_editDate->setText(m_currentItem.m_date); + m_editDateFormat->setText(m_currentItem.m_dateformat); + m_skipStripping->setChecked(m_currentItem.m_skipStripping); + } else { + m_editURL->setEnabled(false); + m_editSymbol->setEnabled(false); + m_editPrice->setEnabled(false); + m_editDate->setEnabled(false); + m_editDateFormat->setEnabled(false); + m_skipStripping->setEnabled(false); + } + + m_updateButton->setEnabled(false); + +} + +void KSettingsOnlineQuotes::slotEntryChanged(void) +{ + bool modified = m_editURL->text() != m_currentItem.m_url + || m_editSymbol->text() != m_currentItem.m_sym + || m_editDate->text() != m_currentItem.m_date + || m_editDateFormat->text() != m_currentItem.m_dateformat + || m_editPrice->text() != m_currentItem.m_price + || m_skipStripping->isChecked() != m_currentItem.m_skipStripping; + + m_updateButton->setEnabled(modified); +} + +void KSettingsOnlineQuotes::slotUpdateEntry(void) +{ + m_currentItem.m_url = m_editURL->text(); + m_currentItem.m_sym = m_editSymbol->text(); + m_currentItem.m_date = m_editDate->text(); + m_currentItem.m_dateformat = m_editDateFormat->text(); + m_currentItem.m_price = m_editPrice->text(); + m_currentItem.m_skipStripping = m_skipStripping->isChecked(); + m_currentItem.write(); + slotEntryChanged(); +} + +void KSettingsOnlineQuotes::slotNewEntry(void) +{ + WebPriceQuoteSource newSource(i18n("New Quote Source")); + newSource.write(); + loadList(); + QListViewItem* item = m_quoteSourceList->findItem(i18n("New Quote Source"), 0); + if(item) { + m_quoteSourceList->setSelected(item, true); + slotLoadWidgets(item); + } +} + +void KSettingsOnlineQuotes::slotEntryRenamed(QListViewItem* item, const QString& text, int /* col */) +{ + int nameCount = 0; + QListViewItemIterator it(m_quoteSourceList); + while(it.current()) { + if(it.current()->text(0) == text) + ++nameCount; + ++it; + } + + // Make sure we get a non-empty and unique name + if(text.length() > 0 && nameCount == 1) { + m_currentItem.rename(text); + } else { + item->setText(0, m_currentItem.m_name); + } + m_newButton->setEnabled(m_quoteSourceList->findItem(i18n("New Quote Source"), 0) == 0); +} + +#include "ksettingsonlinequotes.moc" diff --git a/kmymoney2/dialogs/settings/ksettingsonlinequotes.h b/kmymoney2/dialogs/settings/ksettingsonlinequotes.h new file mode 100644 index 0000000..8c0b6f0 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsonlinequotes.h @@ -0,0 +1,59 @@ +/*************************************************************************** + kmymoneyonlinequoteconfig.h - description + ------------------- + begin : Thu Dec 30 2004 + copyright : (C) 2004 by Thomas Baumgart + email : Thomas Baumgart <[email protected]> + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSETTINGSONLINEQUOTES_H +#define KSETTINGSONLINEQUOTES_H + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "kmymoney2/dialogs/settings/ksettingsonlinequotesdecl.h" +#include "kmymoney2/converter/webpricequote.h" + +class KSettingsOnlineQuotes : public KSettingsOnlineQuotesDecl +{ + Q_OBJECT +public: + KSettingsOnlineQuotes(QWidget* parent = 0, const char *name = 0); + virtual ~KSettingsOnlineQuotes() {} + + void writeConfig(void) {} + void readConfig(void) {} + void resetConfig(void); + +protected slots: + void slotUpdateEntry(void); + void slotLoadWidgets(QListViewItem* item); + void slotEntryChanged(void); + void slotNewEntry(void); + void slotEntryRenamed(QListViewItem* item, const QString& text, int col); + +protected: + void loadList(const bool updateResetList = false); + +private: + QValueList<WebPriceQuoteSource> m_resetList; + WebPriceQuoteSource m_currentItem; +}; + +#endif diff --git a/kmymoney2/dialogs/settings/ksettingsonlinequotesdecl.ui b/kmymoney2/dialogs/settings/ksettingsonlinequotesdecl.ui new file mode 100644 index 0000000..3077b78 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsonlinequotesdecl.ui @@ -0,0 +1,234 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KSettingsOnlineQuotesDecl</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KSettingsOnlineQuotesDecl</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>512</width> + <height>442</height> + </rect> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>0</height> + </size> + </property> + <property name="caption"> + <string>Online Quotes</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KListView"> + <column> + <property name="text"> + <string>Name</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizable"> + <bool>true</bool> + </property> + </column> + <property name="name"> + <cstring>m_quoteSourceList</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>3</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="allColumnsShowFocus"> + <bool>true</bool> + </property> + <property name="defaultRenameAction"> + <enum>Accept</enum> + </property> + <property name="itemsRenameable"> + <bool>true</bool> + </property> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupParsing</cstring> + </property> + <property name="title"> + <string>Details</string> + </property> + <property name="whatsThis" stdset="0"> + <string><i>Enter regular expressions which can be used to parse the data returned from the URL entered above. The symbol, price, and date must be found in the quote data to be usable. You may also try the KMyMoney user's mailinglist at <a href="mailto:[email protected]">[email protected]</a> to find what settings work for other users in your country.</i></string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="3" column="0"> + <property name="name"> + <cstring>textLabel4</cstring> + </property> + <property name="text"> + <string>Date</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>Symbol</string> + </property> + </widget> + <widget class="KLineEdit" row="1" column="1" rowspan="1" colspan="2"> + <property name="name"> + <cstring>m_editSymbol</cstring> + </property> + <property name="toolTip" stdset="0"> + <string>Regular Expression to extract the symbol from the downloaded data</string> + </property> + </widget> + <widget class="KLineEdit" row="2" column="1" rowspan="1" colspan="2"> + <property name="name"> + <cstring>m_editPrice</cstring> + </property> + <property name="toolTip" stdset="0"> + <string>Regular Expression to extract the price from the downloaded data</string> + </property> + </widget> + <widget class="KLineEdit" row="0" column="1" rowspan="1" colspan="2"> + <property name="name"> + <cstring>m_editURL</cstring> + </property> + <property name="toolTip" stdset="0"> + <string>URL to be used to download the quote</string> + </property> + <property name="whatsThis" stdset="0"> + <string>Enter the URL from which stock quotes will be fetched. <b>%1</b> will be replaced with the symbol for the security being quoted. For currency conversions, <b>%2</b> will be replaced with the currency to be quoted and <b>%1</b> with the currency the quote is based on.</string> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>textLabel3</cstring> + </property> + <property name="text"> + <string>Price</string> + </property> + </widget> + <widget class="KLineEdit" row="3" column="1" rowspan="1" colspan="2"> + <property name="name"> + <cstring>m_editDate</cstring> + </property> + <property name="toolTip" stdset="0"> + <string>Regular Expression to extract the date from the downloaded data</string> + </property> + </widget> + <widget class="QLabel" row="4" column="0"> + <property name="name"> + <cstring>textLabel4_2</cstring> + </property> + <property name="text"> + <string>Date Format</string> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>URL</string> + </property> + </widget> + <widget class="KLineEdit" row="4" column="1"> + <property name="name"> + <cstring>m_editDateFormat</cstring> + </property> + <property name="toolTip" stdset="0"> + <string>Regular Expression to extract the date from the downloaded data</string> + </property> + </widget> + <widget class="QCheckBox" row="4" column="2"> + <property name="name"> + <cstring>m_skipStripping</cstring> + </property> + <property name="text"> + <string>Skip HTML stripping</string> + </property> + <property name="whatsThis" stdset="0"> + <string><p>For easier processing of the data returned by the online source, KMyMoney usually strips unused parts before it is parsed with the regular expressions. If matching of the fields relies on those items, then use this option to turn stripping off.</p> + +<p>The following items are usually removed by stripping: + +<ul> +<li>HTML tags such as <b>&lt;tag&gt;</b></li> +<li>& encoded characters such as <b>&amp;nbsp;</b></li> +<li>duplicate whitespace</li> +</ul> +</p></string> + </property> + </widget> + </grid> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout15</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KPushButton"> + <property name="name"> + <cstring>m_newButton</cstring> + </property> + <property name="text"> + <string>New</string> + </property> + </widget> + <widget class="KPushButton"> + <property name="name"> + <cstring>m_deleteButton</cstring> + </property> + <property name="text"> + <string>Delete</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer6</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>240</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="KPushButton"> + <property name="name"> + <cstring>m_updateButton</cstring> + </property> + <property name="text"> + <string>Update</string> + </property> + </widget> + </hbox> + </widget> + </vbox> +</widget> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kmymoney2/dialogs/settings/ksettingsplugins.cpp b/kmymoney2/dialogs/settings/ksettingsplugins.cpp new file mode 100644 index 0000000..0887315 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsplugins.cpp @@ -0,0 +1,66 @@ +/*************************************************************************** + ksettingsplugins.cpp + ------------------- + begin : Thu Feb 12 2009 + copyright : (C) 2009 Cristian Onet + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// ---------------------------------------------------------------------------- +// QT Includes + +#include <qlayout.h> +#include <qstring.h> +#include <qlabel.h> + +// ---------------------------------------------------------------------------- +// KDE Includes + +#include <klocale.h> +#include <kdialog.h> +#include <kpluginselector.h> + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "kmymoney2/plugins/pluginloader.h" +#include "ksettingsplugins.h" + +KSettingsPlugins::KSettingsPlugins(QWidget* parent) + : QWidget(parent) +{ + QVBoxLayout *layout = new QVBoxLayout(this); + KMyMoneyPlugin::PluginLoader::instance()->pluginSelectorWidget()->reparent(this, QPoint()); + layout->addWidget(KMyMoneyPlugin::PluginLoader::instance()->pluginSelectorWidget()); + layout->setSpacing(KDialog::spacingHint()); +} + +KSettingsPlugins::~KSettingsPlugins() +{ +} + +void KSettingsPlugins::slotLoadPlugins() +{ + KMyMoneyPlugin::PluginLoader::instance()->pluginSelectorWidget()->load(); +} + +void KSettingsPlugins::slotSavePlugins() +{ + KMyMoneyPlugin::PluginLoader::instance()->pluginSelectorWidget()->save(); +} + +void KSettingsPlugins::slotDefaultsPlugins() +{ + KMyMoneyPlugin::PluginLoader::instance()->pluginSelectorWidget()->defaults(); +} + +#include "ksettingsplugins.moc" diff --git a/kmymoney2/dialogs/settings/ksettingsplugins.h b/kmymoney2/dialogs/settings/ksettingsplugins.h new file mode 100644 index 0000000..9c36f67 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsplugins.h @@ -0,0 +1,47 @@ +/*************************************************************************** + ksettingsplugins.h + ------------------- + begin : Thu Feb 12 2009 + copyright : (C) 2009 Cristian Onet + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSETTINGSPLUGINS_H +#define KSETTINGSPLUGINS_H + +// ---------------------------------------------------------------------------- +// QT Includes + +#include <qwidget.h> + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +class KSettingsPlugins : public QWidget +{ + Q_OBJECT + +public: + + KSettingsPlugins(QWidget* parent = 0); + ~KSettingsPlugins(); + +public slots: + void slotLoadPlugins(); + void slotSavePlugins(); + void slotDefaultsPlugins(); +}; + +#endif // KSETTINGSPLUGINS_H diff --git a/kmymoney2/dialogs/settings/ksettingsregister.cpp b/kmymoney2/dialogs/settings/ksettingsregister.cpp new file mode 100644 index 0000000..9f1fda2 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsregister.cpp @@ -0,0 +1,75 @@ +/*************************************************************************** + ksettingsregister.cpp + -------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +#include <ktextedit.h> + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "ksettingsregister.h" +#include <kmymoney/transactionsortoption.h> + +KSettingsRegister::KSettingsRegister(QWidget* parent, const char* name) : + KSettingsRegisterDecl(parent, name) +{ + // hide the internally used text fields + kcfg_sortNormalView->hide(); + kcfg_sortReconcileView->hide(); + kcfg_sortSearchView->hide(); + + // setup connections, so that the sort optios get loaded once the edit fields are filled + connect(kcfg_sortNormalView, SIGNAL(textChanged()), this, SLOT(slotLoadNormal())); + connect(kcfg_sortReconcileView, SIGNAL(textChanged()), this, SLOT(slotLoadReconcile())); + connect(kcfg_sortSearchView, SIGNAL(textChanged()), this, SLOT(slotLoadSearch())); + + // setup connections, so that changes by the user are forwarded to the (hidden) edit fields + connect(m_sortNormalView, SIGNAL(settingsChanged(const QString&)), kcfg_sortNormalView, SLOT(setText(const QString&))); + connect(m_sortReconcileView, SIGNAL(settingsChanged(const QString&)), kcfg_sortReconcileView, SLOT(setText(const QString&))); + connect(m_sortSearchView, SIGNAL(settingsChanged(const QString&)), kcfg_sortSearchView, SLOT(setText(const QString&))); +} + +KSettingsRegister::~KSettingsRegister() +{ +} + +void KSettingsRegister::slotLoadNormal(void) +{ + // only need this once + disconnect(kcfg_sortNormalView, SIGNAL(textChanged()), this, SLOT(slotLoadNormal())); + m_sortNormalView->setSettings(kcfg_sortNormalView->text()); +} + +void KSettingsRegister::slotLoadReconcile(void) +{ + // only need this once + disconnect(kcfg_sortReconcileView, SIGNAL(textChanged()), this, SLOT(slotLoadReconcile())); + m_sortReconcileView->setSettings(kcfg_sortReconcileView->text()); +} + +void KSettingsRegister::slotLoadSearch(void) +{ + // only need this once + disconnect(kcfg_sortSearchView, SIGNAL(textChanged()), this, SLOT(slotLoadSearch())); + m_sortSearchView->setSettings(kcfg_sortSearchView->text()); +} + +#include "ksettingsregister.moc" diff --git a/kmymoney2/dialogs/settings/ksettingsregister.h b/kmymoney2/dialogs/settings/ksettingsregister.h new file mode 100644 index 0000000..bcad7eb --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsregister.h @@ -0,0 +1,45 @@ +/*************************************************************************** + ksettingsregister.h + ------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSETTINGSREGISTER_H +#define KSETTINGSREGISTER_H + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "kmymoney2/dialogs/settings/ksettingsregisterdecl.h" + +class KSettingsRegister : public KSettingsRegisterDecl +{ + Q_OBJECT + +public: + KSettingsRegister(QWidget* parent = 0, const char* name = 0); + ~KSettingsRegister(); + +protected slots: + void slotLoadNormal(void); + void slotLoadReconcile(void); + void slotLoadSearch(void); +}; +#endif + diff --git a/kmymoney2/dialogs/settings/ksettingsregisterdecl.ui b/kmymoney2/dialogs/settings/ksettingsregisterdecl.ui new file mode 100644 index 0000000..c03807e --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsregisterdecl.ui @@ -0,0 +1,549 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KSettingsRegisterDecl</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KSettingsRegisterDecl</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>632</width> + <height>403</height> + </rect> + </property> + <property name="caption"> + <string>Register settings</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QTabWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <widget class="QWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <attribute name="title"> + <string>Display</string> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_ShowGrid</cstring> + </property> + <property name="text"> + <string>Show a grid in the register</string> + </property> + <property name="accel"> + <string></string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_LedgerLens</cstring> + </property> + <property name="text"> + <string>Use the ledger lens</string> + </property> + <property name="accel"> + <string></string> + </property> + <property name="whatsThis" stdset="0"> + <string>Using the ledger lens shows the details for the transaction that has focus in the ledger. Usually, when using the transaction form, only a one line summary is displayed for each transaction as the details are shown in the form.</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_TransactionForm</cstring> + </property> + <property name="text"> + <string>Show transaction form</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_AlwaysShowNrField</cstring> + </property> + <property name="text"> + <string>Always show a No. field</string> + </property> + <property name="accel"> + <string></string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_ShowFancyMarker</cstring> + </property> + <property name="text"> + <string>Show group header between transactions</string> + </property> + <property name="accel"> + <string></string> + </property> + <property name="whatsThis" stdset="0"> + <string>Draws a larger header above each group of transaction. The grouping depends on the current sort order.</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_ShowFiscalMarker</cstring> + </property> + <property name="text"> + <string>Show header for the previous and current fiscal year</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer6</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>sorting</cstring> + </property> + <attribute name="title"> + <string>Sorting</string> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QTabWidget"> + <property name="name"> + <cstring>tabWidget3</cstring> + </property> + <widget class="QWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <attribute name="title"> + <string>Normal view</string> + </attribute> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KTextEdit"> + <property name="name"> + <cstring>kcfg_sortNormalView</cstring> + </property> + </widget> + <widget class="TransactionSortOption"> + <property name="name"> + <cstring>m_sortNormalView</cstring> + </property> + </widget> + </hbox> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>tab</cstring> + </property> + <attribute name="title"> + <string>Reconciliation view</string> + </attribute> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KTextEdit"> + <property name="name"> + <cstring>kcfg_sortReconcileView</cstring> + </property> + </widget> + <widget class="TransactionSortOption"> + <property name="name"> + <cstring>m_sortReconcileView</cstring> + </property> + </widget> + </hbox> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>TabPage</cstring> + </property> + <attribute name="title"> + <string>Search view</string> + </attribute> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="KTextEdit"> + <property name="name"> + <cstring>kcfg_sortSearchView</cstring> + </property> + </widget> + <widget class="TransactionSortOption"> + <property name="name"> + <cstring>m_sortSearchView</cstring> + </property> + </widget> + </hbox> + </widget> + </widget> + <widget class="KActiveLabel"> + <property name="name"> + <cstring>kActiveLabel2</cstring> + </property> + <property name="text"> + <string>Use the <i>left</i> and <i>right</i> buttons to add and remove sort options. Use the <i>up</i> and <i>down</i> buttons to modify the sort order. Double-Click a selected entry to toggle the sort order between <i>ascending</i> and <i>descending</i>.</string> + </property> + </widget> + </vbox> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>TabPage</cstring> + </property> + <attribute name="title"> + <string>Data entry</string> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_CopyTypeToNr</cstring> + </property> + <property name="text"> + <string>Insert transaction type into No. field for new transactions</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_AutoIncCheckNumber</cstring> + </property> + <property name="text"> + <string>Auto increment check number</string> + </property> + <property name="accel"> + <string></string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_FocusChangeIsEnter</cstring> + </property> + <property name="text"> + <string>Keep changes when selecting a different transaction/split</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_EnterMovesBetweenFields</cstring> + </property> + <property name="text"> + <string>Use Enter to move between fields</string> + </property> + <property name="accel"> + <string></string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_stringMatchFromStart</cstring> + </property> + <property name="text"> + <string>Match names from start</string> + </property> + <property name="whatsThis" stdset="0"> + <string>Mark this option, if you always want to match names e.g. for payees from the start. If unset, any substring is matched.</string> + </property> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout5</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel2_2</cstring> + </property> + <property name="text"> + <string>Default reconciliation state</string> + </property> + </widget> + <widget class="KComboBox"> + <item> + <property name="text"> + <string>Not reconciled</string> + </property> + </item> + <item> + <property name="text"> + <string>Cleared</string> + </property> + </item> + <item> + <property name="text"> + <string>Reconciled</string> + </property> + </item> + <property name="name"> + <cstring>kcfg_defaultReconciliationState</cstring> + </property> + <property name="toolTip" stdset="0"> + <string>Default reconciliation state for transactions entered during reconciliation of an account</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer15</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>31</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <widget class="QButtonGroup"> + <property name="name"> + <cstring>kcfg_AutoFillTransaction</cstring> + </property> + <property name="title"> + <string>Autofill</string> + </property> + <property name="exclusive"> + <bool>false</bool> + </property> + <property name="selectedId" stdset="0"> + <number>-1</number> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QRadioButton"> + <property name="name"> + <cstring>radioButton1</cstring> + </property> + <property name="text"> + <string>No Autofill</string> + </property> + <property name="whatsThis" stdset="0"> + <string>Don't do autofill of transaction data at all.</string> + </property> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout4</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QRadioButton"> + <property name="name"> + <cstring>radioButton2</cstring> + </property> + <property name="text"> + <string>Same transaction if amount differs less than</string> + </property> + <property name="accel"> + <string></string> + </property> + <property name="whatsThis" stdset="0"> + <string>Collect all transactions for the given payee. Treat all transactions that refer to the same category and have an amount with +/- X % as identical. If more than one transaction is found, a list of them is presented to the user. + +Selecting 0% will list all transactions.</string> + </property> + </widget> + <widget class="KIntSpinBox"> + <property name="name"> + <cstring>kcfg_AutoFillDifference</cstring> + </property> + <property name="maxValue"> + <number>100</number> + </property> + <property name="value"> + <number>10</number> + </property> + <property name="whatsThis" stdset="0"> + <string>Two transactions are usually treated identical for autofill, if they refer the same accounts. They are treated as different transactions though, when their amount varies by more than the percentage given here.</string> + </property> + </widget> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>percent.</string> + <comment>Same transaction if amount differs less than percent.</comment> + </property> + </widget> + </hbox> + </widget> + <widget class="QRadioButton"> + <property name="name"> + <cstring>radioButton3</cstring> + </property> + <property name="text"> + <string>with previously most often used transaction for the payee</string> + </property> + <property name="whatsThis" stdset="0"> + <string>The data of the last transaction assigned to the category used most often for this payee is autofilled into the transaction editor.</string> + </property> + </widget> + </vbox> + </widget> + <spacer> + <property name="name"> + <cstring>spacer4</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </vbox> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>TabPage</cstring> + </property> + <attribute name="title"> + <string>Import</string> + </attribute> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout4</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel1_2</cstring> + </property> + <property name="text"> + <string>Match transactions within days</string> + </property> + </widget> + <widget class="KIntSpinBox"> + <property name="name"> + <cstring>kcfg_matchInterval</cstring> + </property> + <property name="buttonSymbols"> + <enum>UpDownArrows</enum> + </property> + <property name="maxValue"> + <number>99</number> + </property> + <property name="minValue"> + <number>0</number> + </property> + <property name="value"> + <number>4</number> + </property> + <property name="whatsThis" stdset="0"> + <string>Search for matching transactions within the range of the posting date of the imported transaction +/- the number of given days.</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer13</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>61</width> + <height>20</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_askForPayeeCategory</cstring> + </property> + <property name="text"> + <string>Ask for a new payee's default category</string> + </property> + <property name="accel"> + <string></string> + </property> + <property name="whatsThis" stdset="0"> + <string>Whenever a new payee is detected during import of a statement, the user will be asked to assign a default category for this user when this option is selected.</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer14</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>60</height> + </size> + </property> + </spacer> + </vbox> + </widget> + </widget> + </vbox> +</widget> +<customwidgets> +</customwidgets> +<layoutdefaults spacing="6" margin="11"/> +</UI> diff --git a/kmymoney2/dialogs/settings/ksettingsschedules.cpp b/kmymoney2/dialogs/settings/ksettingsschedules.cpp new file mode 100644 index 0000000..6f9a77c --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsschedules.cpp @@ -0,0 +1,37 @@ +/*************************************************************************** + ksettingsschedules.cpp + -------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "ksettingsschedules.h" + +KSettingsSchedules::KSettingsSchedules(QWidget* parent, const char* name) : + KSettingsSchedulesDecl(parent, name) +{ +} + +KSettingsSchedules::~KSettingsSchedules() +{ +} + +#include "ksettingsschedules.moc" diff --git a/kmymoney2/dialogs/settings/ksettingsschedules.h b/kmymoney2/dialogs/settings/ksettingsschedules.h new file mode 100644 index 0000000..caa7d33 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsschedules.h @@ -0,0 +1,41 @@ +/*************************************************************************** + ksettingsschedules.h + ------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KSETTINGSSCHEDULES_H +#define KSETTINGSSCHEDULES_H + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + + +// ---------------------------------------------------------------------------- +// Project Includes + +#include "kmymoney2/dialogs/settings/ksettingsschedulesdecl.h" + +class KSettingsSchedules : public KSettingsSchedulesDecl +{ + Q_OBJECT + +public: + KSettingsSchedules(QWidget* parent = 0, const char* name = 0); + ~KSettingsSchedules(); +}; +#endif + diff --git a/kmymoney2/dialogs/settings/ksettingsschedulesdecl.ui b/kmymoney2/dialogs/settings/ksettingsschedulesdecl.ui new file mode 100644 index 0000000..fca9aa9 --- /dev/null +++ b/kmymoney2/dialogs/settings/ksettingsschedulesdecl.ui @@ -0,0 +1,145 @@ +<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> +<class>KSettingsSchedulesDecl</class> +<widget class="QWidget"> + <property name="name"> + <cstring>KSettingsSchedulesDecl</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>482</width> + <height>236</height> + </rect> + </property> + <property name="caption"> + <string>Schedule Settings</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QGroupBox"> + <property name="name"> + <cstring>groupBox6</cstring> + </property> + <property name="title"> + <string>Startup options</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>kcfg_CheckSchedule</cstring> + </property> + <property name="text"> + <string>Check schedules on startup</string> + </property> + </widget> + <widget class="QFrame"> + <property name="name"> + <cstring>m_dayCountFrame</cstring> + </property> + <property name="enabled"> + <bool>false</bool> + </property> + <property name="frameShape"> + <enum>StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>Raised</enum> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel3</cstring> + </property> + <property name="text"> + <string>Enter transactions this number of days in advance</string> + </property> + </widget> + <widget class="QSpinBox"> + <property name="name"> + <cstring>kcfg_CheckSchedulePreview</cstring> + </property> + </widget> + </hbox> + </widget> + </vbox> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>layout2</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>Number of days to preview schedules in ledger</string> + </property> + </widget> + <widget class="KIntSpinBox"> + <property name="name"> + <cstring>kcfg_SchedulePreview</cstring> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>41</width> + <height>21</height> + </size> + </property> + </spacer> + </hbox> + </widget> + <spacer> + <property name="name"> + <cstring>spacer10</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </vbox> +</widget> +<customwidgets> +</customwidgets> +<connections> + <connection> + <sender>kcfg_CheckSchedule</sender> + <signal>toggled(bool)</signal> + <receiver>m_dayCountFrame</receiver> + <slot>setEnabled(bool)</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +</UI> |