kplato
kptaccountsviewconfigdialog.cc00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "kptaccountsviewconfigdialog.h"
00021
00022 #include <qcheckbox.h>
00023 #include <qcombobox.h>
00024 #include <qdatetimeedit.h>
00025 #include <qdatetime.h>
00026 #include <qstring.h>
00027
00028 #include <kdatewidget.h>
00029 #include <klocale.h>
00030
00031 #include <kdebug.h>
00032
00033 namespace KPlato
00034 {
00035
00036 AccountsviewConfigDialog::AccountsviewConfigDialog(const QDate &date, int period, const QStringList &periodTexts, bool cumulative, QWidget *p)
00037 : KDialogBase(Swallow, i18n("Settings"), Ok|Cancel, Ok, p, "Accountsview Settings Dialog", true, true)
00038 {
00039 m_panel = new AccountsviewConfigPanel(this);
00040 m_panel->dateEdit->setDate(date);
00041 m_panel->periodBox->insertStringList(periodTexts);
00042 m_panel->periodBox->setCurrentItem(period);
00043 m_panel->cumulative->setChecked(cumulative);
00044 setMainWidget(m_panel);
00045
00046 enableButtonOK(false);
00047
00048 connect(m_panel, SIGNAL(changed(bool)), SLOT( enableButtonOK(bool)));
00049 }
00050
00051
00052 QDate AccountsviewConfigDialog::date() {
00053 return m_panel->dateEdit->date();
00054 }
00055
00056 int AccountsviewConfigDialog::period() {
00057 return m_panel->periodBox->currentItem();
00058 }
00059
00060 QString AccountsviewConfigDialog::periodText() {
00061 return m_panel->periodBox->currentText();
00062 }
00063
00064 bool AccountsviewConfigDialog::isCumulative() {
00065 return m_panel->cumulative->isChecked();
00066 }
00067
00068
00069
00070 AccountsviewConfigPanel::AccountsviewConfigPanel(QWidget *parent)
00071 : AccountsviewConfigurePanelBase(parent) {
00072
00073 connect(dateEdit, SIGNAL(changed(QDate)), SLOT(slotChanged()));
00074 connect(periodBox, SIGNAL(activated(int)), SLOT(slotChanged()));
00075 connect(cumulative, SIGNAL(clicked()), SLOT(slotChanged()));
00076 }
00077
00078 void AccountsviewConfigPanel::slotChanged() {
00079 emit changed(true);
00080 }
00081
00082
00083 }
00084
00085 #include "kptaccountsviewconfigdialog.moc"
|